From 6ca69b56407661dcfdbb21f21cedf944e6e4e67f Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Mon, 23 Jul 2018 10:45:01 -0400 Subject: [PATCH 001/382] Remove Stetic Gtk#2 GUI designer Stetic is what sold me on MonoDevelop in the first place, more than a decade ago. A high quality GUI designer, fully integratwd into the IDE, on Linux, was bliss - as compared to the state of the art of `glade-2` XML files at the time. However. In 2018, it is effectively dead weight for us. Visual Studio for Mac is not a Gtk# IDE, and does not benefit from Gtk# app authoring support. And, crucially, Stetic depends heavily on the internals of libglade, which no longer exists in Gtk+ 3.0+. In order to move forwards with porting MonoDevelop to Gtk#3, Stetic in its current incarnation needs to go away. All the internals need rewriting, and we cannot justify the engineer time required to do that ourselves. So, like our C/C++ support, remove it & focus on the fundamentals. This removal removes support for creating new Gtk# projects (as the templates are in MonoDevelop.GtkCore), but it can still open/compile existing Gtk# projects fine. --- main/Main.sln | 57 - main/configure.ac | 3 - main/src/addins/Makefile.am | 1 - .../addins/MonoDevelop.GtkCore/AddinInfo.cs | 16 - .../MonoDevelop.GtkCore/AssemblyInfo.cs | 9 - ...e.Dialogs.GtkDesignerOptionsPanelWidget.cs | 39 - .../addins/MonoDevelop.GtkCore/Makefile.am | 3 - .../GladeCommands.cs | 41 - .../BindDesignDialog.cs | 187 -- .../ConfirmWindowDeleteDialog.cs | 80 - .../GtkDesignerOptionsPanelWidget.cs | 64 - .../GtkFeatureWidget.cs | 40 - .../SelectRenamedClassDialog.cs | 95 - .../WidgetBuilderOptionPanel.cs | 140 - .../ActionGroupDisplayBinding.cs | 202 -- .../ActionGroupView.cs | 314 --- .../ClassUtils.cs | 66 - .../CodeBinder.cs | 352 --- .../CombinedDesignView.cs | 292 --- .../GtkProjectServiceExtension.cs | 98 - .../GuiBuilderDisplayBinding.cs | 118 - .../GuiBuilderDocumentOutline.cs | 104 - .../GuiBuilderProject.cs | 690 ----- .../GuiBuilderService.cs | 660 ----- .../GuiBuilderView.cs | 622 ----- .../GuiBuilderWindow.cs | 253 -- .../PropertiesWidget.cs | 211 -- .../ToolboxLoader.cs | 81 - .../ToolboxProvider.cs | 202 -- .../ActionGroupNodeBuilder.cs | 145 -- .../ProjectFolderNodeBuilderExtension.cs | 192 -- .../ProjectNodeBuilder.cs | 83 - .../StockIconsNodeBuilder.cs | 87 - .../WidgetNodeBuilder.cs | 147 -- .../WindowsFolder.cs | 78 - .../WindowsFolderNodeBuilder.cs | 114 - .../MonoDevelop.GtkCore.addin.xml | 162 -- .../MonoDevelop.GtkCore.csproj | 183 -- .../MonoDevelop.GtkCore/Counters.cs | 39 - .../MonoDevelop.GtkCore/GtkCoreService.cs | 43 - .../MonoDevelop.GtkCore/GtkDesignInfo.cs | 366 --- .../MonoDevelop.GtkCore/ObjectsDocument.cs | 310 --- .../ProjectResourceProvider.cs | 89 - .../MonoDevelop.GtkCore/ReferenceManager.cs | 300 --- .../WidgetFileDescriptionTemplate.cs | 140 - .../MonoDevelop.GtkCore/WidgetParser.cs | 150 -- main/src/addins/MonoDevelop.GtkCore/gui.glade | 710 ----- .../MonoDevelop.GtkCore/icons/actiongroup.png | Bin 274 -> 0 bytes .../MonoDevelop.GtkCore/icons/dialog.png | Bin 671 -> 0 bytes .../icons/image-x-generic.png | Bin 558 -> 0 bytes .../MonoDevelop.GtkCore/icons/widget.png | Bin 337 -> 0 bytes .../MonoDevelop.GtkCore/icons/window.png | Bin 321 -> 0 bytes .../libstetic/ClassDescriptor.cs | 344 --- .../libstetic/Clipboard.cs | 91 - .../libstetic/CommandDescriptor.cs | 152 -- .../libstetic/CustomWidget.cs | 27 - .../MonoDevelop.GtkCore/libstetic/DND.cs | 636 ----- .../libstetic/EnumDescriptor.cs | 86 - .../libstetic/ErrorWidget.cs | 111 - .../libstetic/GeneratorContext.cs | 569 ---- .../libstetic/GladeException.cs | 59 - .../libstetic/GladeUtils.cs | 791 ------ .../libstetic/IDesignArea.cs | 39 - .../libstetic/IEditableObject.cs | 18 - .../MonoDevelop.GtkCore/libstetic/IProject.cs | 32 - .../libstetic/IPropertyEditor.cs | 23 - .../libstetic/IRadioGroupManager.cs | 21 - .../libstetic/IResourceProvider.cs | 72 - .../libstetic/ImageInfo.cs | 217 -- .../libstetic/ItemDescriptor.cs | 158 -- .../libstetic/ItemGroup.cs | 78 - .../libstetic/ItemGroupCollection.cs | 42 - .../MonoDevelop.GtkCore/libstetic/Makefile.am | 1 - .../libstetic/NoGuiDispatchAttribute.cs | 9 - .../libstetic/ObjectReader.cs | 38 - .../libstetic/ObjectWrapper.cs | 470 ---- .../libstetic/ObjectWrapperEventHandler.cs | 20 - .../libstetic/ObjectWriter.cs | 38 - .../libstetic/ParamSpec.cs | 233 -- .../libstetic/Placeholder.cs | 152 -- .../libstetic/ProjectIconFactory.cs | 335 --- .../libstetic/PropertyDescriptor.cs | 309 --- .../libstetic/PropertyEditorAttribute.cs | 36 - .../libstetic/PropertyEditorCell.cs | 306 --- .../libstetic/RadioGroupManager.cs | 212 -- .../MonoDevelop.GtkCore/libstetic/Registry.cs | 363 --- .../MonoDevelop.GtkCore/libstetic/Set.cs | 51 - .../libstetic/SignalDescriptor.cs | 70 - .../libstetic/TopLevelDialog.cs | 39 - .../libstetic/TopLevelWindow.cs | 57 - .../libstetic/TranslatableAttribute.cs | 8 - .../libstetic/TypedClassDescriptor.cs | 203 -- .../libstetic/TypedPropertyDescriptor.cs | 321 --- .../libstetic/TypedSignalDescriptor.cs | 59 - .../libstetic/WidgetLibrary.cs | 163 -- .../libstetic/WidgetUtils.cs | 391 --- .../libstetic/editor/Accelerator.cs | 196 -- .../libstetic/editor/ActionGroupEditor.cs | 575 ----- .../libstetic/editor/ActionItem.cs | 209 -- .../libstetic/editor/ActionMenu.cs | 648 ----- .../libstetic/editor/ActionMenuBar.cs | 553 ---- .../libstetic/editor/ActionMenuItem.cs | 588 ----- .../libstetic/editor/ActionToolItem.cs | 371 --- .../libstetic/editor/ActionToolbar.cs | 540 ---- .../libstetic/editor/Boolean.cs | 67 - .../libstetic/editor/CellRendererComboBox.cs | 111 - .../libstetic/editor/Char.cs | 45 - .../libstetic/editor/Color.cs | 55 - .../libstetic/editor/DateTimeEditor.cs | 72 - .../libstetic/editor/EditIconDialog.cs | 285 -- .../libstetic/editor/EditIconFactoryDialog.cs | 97 - .../libstetic/editor/Enumeration.cs | 87 - .../libstetic/editor/Flags.cs | 174 -- .../libstetic/editor/FlagsSelectorDialog.cs | 82 - .../libstetic/editor/FloatRange.cs | 47 - .../libstetic/editor/GroupPicker.cs | 175 -- .../libstetic/editor/GtkWorkarounds.cs | 255 -- .../libstetic/editor/IconList.cs | 205 -- .../libstetic/editor/IconSelectorItem.cs | 284 -- .../libstetic/editor/IconSelectorMenu.cs | 56 - .../libstetic/editor/IconSelectorMenuItem.cs | 59 - .../libstetic/editor/Identifier.cs | 78 - .../libstetic/editor/Image.cs | 265 -- .../libstetic/editor/ImageFile.cs | 10 - .../libstetic/editor/ImageSelector.cs | 177 -- .../libstetic/editor/IntRange.cs | 120 - .../editor/NonContainerWarningDialog.cs | 53 - .../libstetic/editor/OptIntRange.cs | 90 - .../libstetic/editor/ProjectIconList.cs | 29 - .../editor/ProjectIconSelectorItem.cs | 21 - .../libstetic/editor/PropertyTextEditor.cs | 83 - .../libstetic/editor/ResponseId.cs | 100 - .../libstetic/editor/SelectIconDialog.cs | 178 -- .../libstetic/editor/SelectImageDialog.cs | 317 --- .../libstetic/editor/StockIconList.cs | 27 - .../libstetic/editor/StockIconSelectorItem.cs | 134 - .../libstetic/editor/StockItem.cs | 200 -- .../libstetic/editor/String.cs | 44 - .../libstetic/editor/StringArray.cs | 99 - .../libstetic/editor/Text.cs | 14 - .../libstetic/editor/TextBox.cs | 51 - .../libstetic/editor/TextEditorDialog.cs | 72 - .../libstetic/editor/ThemedIcon.cs | 162 -- .../libstetic/editor/ThemedIconList.cs | 1018 -------- .../libstetic/editor/TimeSpanEditor.cs | 67 - .../libstetic/editor/Translatable.cs | 233 -- .../libstetic/editor/TreeViewCellContainer.cs | 82 - .../libstetic/editor/WidgetSelector.cs | 98 - .../libstetic/libstetic.csproj | 272 -- .../libstetic/libstetic.dll.config | 8 - .../libstetic/stetic.glade | 2107 --------------- .../libstetic/undo/ActionDiffAdaptor.cs | 273 -- .../libstetic/undo/DiffGenerator.cs | 319 --- .../libstetic/undo/IDiffAdaptor.cs | 31 - .../libstetic/undo/UndoManager.cs | 315 --- .../libstetic/undo/XmlDiffAdaptor.cs | 230 -- .../libstetic/wrapper/AboutDialog.cs | 75 - .../libstetic/wrapper/Action.cs | 504 ---- .../libstetic/wrapper/ActionGroup.cs | 425 --- .../libstetic/wrapper/ActionToolbarWrapper.cs | 337 --- .../libstetic/wrapper/ActionTree.cs | 351 --- .../libstetic/wrapper/Bin.cs | 378 --- .../libstetic/wrapper/Box.cs | 276 -- .../libstetic/wrapper/Button.cs | 324 --- .../libstetic/wrapper/ButtonBox.cs | 161 -- .../libstetic/wrapper/CheckButton.cs | 90 - .../libstetic/wrapper/ColorButton.cs | 37 - .../libstetic/wrapper/ComboBox.cs | 122 - .../libstetic/wrapper/ComboBoxEntry.cs | 32 - .../libstetic/wrapper/Container.cs | 1454 ----------- .../libstetic/wrapper/Custom.cs | 123 - .../libstetic/wrapper/Dialog.cs | 183 -- .../libstetic/wrapper/Entry.cs | 15 - .../libstetic/wrapper/Expander.cs | 80 - .../libstetic/wrapper/Fixed.cs | 91 - .../libstetic/wrapper/FontButton.cs | 22 - .../libstetic/wrapper/FontSelectionDialog.cs | 19 - .../libstetic/wrapper/Frame.cs | 92 - .../libstetic/wrapper/HScale.cs | 18 - .../libstetic/wrapper/HScrollbar.cs | 18 - .../libstetic/wrapper/IconView.cs | 39 - .../libstetic/wrapper/Image.cs | 80 - .../libstetic/wrapper/ImageMenuItem.cs | 62 - .../libstetic/wrapper/Label.cs | 49 - .../libstetic/wrapper/MenuBar.cs | 261 -- .../libstetic/wrapper/MenuItem.cs | 110 - .../libstetic/wrapper/MessageDialog.cs | 141 - .../libstetic/wrapper/Misc.cs | 40 - .../libstetic/wrapper/Notebook.cs | 269 -- .../libstetic/wrapper/NotifyWorkaround.cs | 91 - .../libstetic/wrapper/Object.cs | 49 - .../libstetic/wrapper/OptionMenu.cs | 79 - .../libstetic/wrapper/Paned.cs | 73 - .../wrapper/RadioActionGroupManager.cs | 144 -- .../libstetic/wrapper/RadioButton.cs | 80 - .../libstetic/wrapper/RadioMenuItem.cs | 75 - .../libstetic/wrapper/RadioToolButton.cs | 80 - .../libstetic/wrapper/Range.cs | 24 - .../libstetic/wrapper/Scale.cs | 24 - .../libstetic/wrapper/ScrolledWindow.cs | 112 - .../libstetic/wrapper/Signal.cs | 60 - .../wrapper/SignalChangedEventHandler.cs | 19 - .../libstetic/wrapper/SignalCollection.cs | 89 - .../libstetic/wrapper/SignalEventHandler.cs | 19 - .../libstetic/wrapper/SpinButton.cs | 12 - .../libstetic/wrapper/Table.cs | 520 ---- .../libstetic/wrapper/TextView.cs | 65 - .../libstetic/wrapper/ToggleToolButton.cs | 12 - .../libstetic/wrapper/ToolButton.cs | 147 -- .../libstetic/wrapper/Toolbar.cs | 178 -- .../libstetic/wrapper/TreeView.cs | 21 - .../libstetic/wrapper/VScale.cs | 18 - .../libstetic/wrapper/VScrollbar.cs | 18 - .../libstetic/wrapper/Viewport.cs | 28 - .../libstetic/wrapper/Widget.cs | 1098 -------- .../libstetic/wrapper/WidgetEventHandler.cs | 33 - .../wrapper/WidgetNameChangedHandler.cs | 25 - .../libstetic/wrapper/Window.cs | 221 -- .../libstetic/wrapper/objects.xml | 2292 ----------------- .../libstetic/wrapper/pixmaps/COPIED | 1 - .../libstetic/wrapper/pixmaps/accellabel.png | Bin 489 -> 0 bytes .../libstetic/wrapper/pixmaps/actiongroup.png | Bin 274 -> 0 bytes .../wrapper/pixmaps/add-check-label.png | Bin 626 -> 0 bytes .../libstetic/wrapper/pixmaps/add-menu.png | Bin 381 -> 0 bytes .../libstetic/wrapper/pixmaps/alignment.png | Bin 213 -> 0 bytes .../libstetic/wrapper/pixmaps/arrow.png | Bin 378 -> 0 bytes .../libstetic/wrapper/pixmaps/box-expand.png | Bin 338 -> 0 bytes .../libstetic/wrapper/pixmaps/box-fill.png | Bin 357 -> 0 bytes .../libstetic/wrapper/pixmaps/button.png | Bin 374 -> 0 bytes .../libstetic/wrapper/pixmaps/calendar.png | Bin 478 -> 0 bytes .../wrapper/pixmaps/cell-expand-h.png | Bin 332 -> 0 bytes .../wrapper/pixmaps/cell-expand-v.png | Bin 341 -> 0 bytes .../libstetic/wrapper/pixmaps/cell-fill-h.png | Bin 296 -> 0 bytes .../libstetic/wrapper/pixmaps/cell-fill-v.png | Bin 332 -> 0 bytes .../libstetic/wrapper/pixmaps/checkbutton.png | Bin 360 -> 0 bytes .../libstetic/wrapper/pixmaps/colorbutton.png | Bin 1136 -> 0 bytes .../wrapper/pixmaps/colorselection.png | Bin 1136 -> 0 bytes .../wrapper/pixmaps/colorselectiondialog.png | Bin 1136 -> 0 bytes .../libstetic/wrapper/pixmaps/combo.png | Bin 456 -> 0 bytes .../libstetic/wrapper/pixmaps/comboentry.png | Bin 529 -> 0 bytes .../libstetic/wrapper/pixmaps/custom.png | Bin 212 -> 0 bytes .../libstetic/wrapper/pixmaps/dec-border.png | Bin 363 -> 0 bytes .../libstetic/wrapper/pixmaps/dialog.png | Bin 671 -> 0 bytes .../libstetic/wrapper/pixmaps/drawingarea.png | Bin 926 -> 0 bytes .../libstetic/wrapper/pixmaps/entry.png | Bin 606 -> 0 bytes .../libstetic/wrapper/pixmaps/eventbox.png | Bin 565 -> 0 bytes .../libstetic/wrapper/pixmaps/expander.png | Bin 536 -> 0 bytes .../wrapper/pixmaps/fileselection.png | Bin 1230 -> 0 bytes .../libstetic/wrapper/pixmaps/fixed.png | Bin 122 -> 0 bytes .../libstetic/wrapper/pixmaps/fontbutton.png | Bin 774 -> 0 bytes .../wrapper/pixmaps/fontselection.png | Bin 774 -> 0 bytes .../wrapper/pixmaps/fontselectiondialog.png | Bin 605 -> 0 bytes .../libstetic/wrapper/pixmaps/frame.png | Bin 307 -> 0 bytes .../libstetic/wrapper/pixmaps/globe-not.png | Bin 795 -> 0 bytes .../libstetic/wrapper/pixmaps/globe.png | Bin 715 -> 0 bytes .../libstetic/wrapper/pixmaps/handlebox.png | Bin 339 -> 0 bytes .../libstetic/wrapper/pixmaps/hbox.png | Bin 397 -> 0 bytes .../libstetic/wrapper/pixmaps/hbuttonbox.png | Bin 274 -> 0 bytes .../libstetic/wrapper/pixmaps/hpaned.png | Bin 655 -> 0 bytes .../libstetic/wrapper/pixmaps/hscale.png | Bin 255 -> 0 bytes .../libstetic/wrapper/pixmaps/hscrollbar.png | Bin 324 -> 0 bytes .../libstetic/wrapper/pixmaps/hseparator.png | Bin 315 -> 0 bytes .../libstetic/wrapper/pixmaps/iconview.png | Bin 590 -> 0 bytes .../libstetic/wrapper/pixmaps/image.png | Bin 594 -> 0 bytes .../libstetic/wrapper/pixmaps/inc-border.png | Bin 370 -> 0 bytes .../libstetic/wrapper/pixmaps/label.png | Bin 420 -> 0 bytes .../libstetic/wrapper/pixmaps/menu.png | Bin 284 -> 0 bytes .../libstetic/wrapper/pixmaps/menubar.png | Bin 593 -> 0 bytes .../wrapper/pixmaps/messagedialog.png | Bin 726 -> 0 bytes .../libstetic/wrapper/pixmaps/missing.png | Bin 357 -> 0 bytes .../libstetic/wrapper/pixmaps/notebook.png | Bin 752 -> 0 bytes .../libstetic/wrapper/pixmaps/optionmenu.png | Bin 501 -> 0 bytes .../libstetic/wrapper/pixmaps/progressbar.png | Bin 194 -> 0 bytes .../libstetic/wrapper/pixmaps/radiobutton.png | Bin 560 -> 0 bytes .../wrapper/pixmaps/remove-check-label.png | Bin 593 -> 0 bytes .../libstetic/wrapper/pixmaps/remove-menu.png | Bin 324 -> 0 bytes .../wrapper/pixmaps/scrolledwindow.png | Bin 667 -> 0 bytes .../libstetic/wrapper/pixmaps/spinbutton.png | Bin 523 -> 0 bytes .../libstetic/wrapper/pixmaps/statusbar.png | Bin 199 -> 0 bytes .../libstetic/wrapper/pixmaps/table.png | Bin 499 -> 0 bytes .../libstetic/wrapper/pixmaps/textview.png | Bin 592 -> 0 bytes .../wrapper/pixmaps/togglebutton.png | Bin 612 -> 0 bytes .../libstetic/wrapper/pixmaps/toolbar.png | Bin 788 -> 0 bytes .../libstetic/wrapper/pixmaps/treeview.png | Bin 556 -> 0 bytes .../libstetic/wrapper/pixmaps/vbox.png | Bin 373 -> 0 bytes .../libstetic/wrapper/pixmaps/vbuttonbox.png | Bin 268 -> 0 bytes .../libstetic/wrapper/pixmaps/viewport.png | Bin 204 -> 0 bytes .../libstetic/wrapper/pixmaps/vpaned.png | Bin 787 -> 0 bytes .../libstetic/wrapper/pixmaps/vscale.png | Bin 279 -> 0 bytes .../libstetic/wrapper/pixmaps/vscrollbar.png | Bin 362 -> 0 bytes .../libstetic/wrapper/pixmaps/vseparator.png | Bin 327 -> 0 bytes .../libstetic/wrapper/pixmaps/widget.png | Bin 337 -> 0 bytes .../libstetic/wrapper/pixmaps/window.png | Bin 321 -> 0 bytes .../libsteticui/ActionComponent.cs | 75 - .../libsteticui/ActionGroupComponent.cs | 58 - .../libsteticui/ActionGroupDesigner.cs | 278 -- .../libsteticui/ActionGroupDesignerBackend.cs | 45 - .../libsteticui/ActionGroupEditSession.cs | 352 --- .../libsteticui/ActionGroupToolbar.cs | 275 -- .../libsteticui/Application.cs | 587 ----- .../libsteticui/ApplicationBackend.cs | 652 ----- .../ApplicationBackendController.cs | 105 - .../libsteticui/AssemblyResolver.cs | 242 -- .../libsteticui/AssemblyWidgetLibrary.cs | 141 - .../libsteticui/CecilClassDescriptor.cs | 398 --- .../libsteticui/CecilPropertyDescriptor.cs | 127 - .../libsteticui/CecilSignalDescriptor.cs | 88 - .../libsteticui/CecilWidgetLibrary.cs | 359 --- .../libsteticui/CodeGenerationResult.cs | 26 - .../libsteticui/CodeGenerator.cs | 435 ---- .../libsteticui/CodeGeneratorInternalClass.cs | 319 --- .../libsteticui/CodeGeneratorPartialClass.cs | 144 -- .../libsteticui/Component.cs | 112 - .../libsteticui/ComponentEventHandler.cs | 67 - .../ComponentSignalEventHandler.cs | 27 - .../libsteticui/ComponentType.cs | 94 - .../libsteticui/ContainerUndoRedoManager.cs | 18 - .../libsteticui/ContextMenu.cs | 174 -- .../libsteticui/Designer.cs | 44 - .../MonoDevelop.GtkCore/libsteticui/Glade.cs | 63 - .../MonoDevelop.GtkCore/libsteticui/Grid.cs | 349 --- .../libsteticui/GuiDispatchServerSink.cs | 142 - .../GuiDispatchServerSinkProvider.cs | 30 - .../libsteticui/LibraryCache.cs | 798 ------ .../libsteticui/Makefile.am | 1 - .../libsteticui/Palette.cs | 46 - .../libsteticui/PaletteBackend.cs | 409 --- .../libsteticui/PluggableWidget.cs | 151 -- .../libsteticui/Project.cs | 838 ------ .../libsteticui/ProjectBackend.cs | 1146 --------- .../libsteticui/ProjectViewBackend.cs | 346 --- .../libsteticui/PropertyEditor.cs | 64 - .../libsteticui/PropertyGrid.cs | 275 -- .../libsteticui/PropertyTree.cs | 582 ----- .../MonoDevelop.GtkCore/libsteticui/Shadow.cs | 116 - .../libsteticui/SignalsEditor.cs | 90 - .../libsteticui/SignalsEditorBackend.cs | 479 ---- .../libsteticui/UndoQueue.cs | 282 -- .../libsteticui/UserInterface.cs | 34 - .../libsteticui/WidgetActionBar.cs | 251 -- .../libsteticui/WidgetComponent.cs | 122 - .../libsteticui/WidgetDesigner.cs | 449 ---- .../libsteticui/WidgetDesignerBackend.cs | 959 ------- .../libsteticui/WidgetEditSession.cs | 431 ---- .../libsteticui/WidgetFactory.cs | 136 - .../libsteticui/WidgetInfoEventHandler.cs | 41 - .../libsteticui/WidgetPropertyTree.cs | 28 - .../libsteticui/WidgetPropertyTreeBackend.cs | 118 - .../libsteticui/WidgetTree.cs | 92 - .../libsteticui/WidgetTreeCombo.cs | 213 -- .../libsteticui/Windows/Preview.cs | 109 - .../libsteticui/Windows/WindowsTheme.cs | 206 -- .../libsteticui/action.png | Bin 319 -> 0 bytes .../libsteticui/libsteticui.csproj | 120 - .../libsteticui/libsteticui.dll.config | 8 - .../libsteticui/missing.png | Bin 357 -> 0 bytes .../libsteticui/packages.config | 4 - .../MonoDevelop.GtkCore/packages.config | 4 - .../templates/ActionGroup.xft.xml | 69 - .../templates/ActionGroupPartial.xft.xml | 65 - .../templates/Dialog.xft.xml | 129 - .../templates/DialogPartial.xft.xml | 125 - .../templates/DrawingArea.xft.xml | 176 -- .../templates/Widget.xft.xml | 79 - .../templates/WidgetPartial.xft.xml | 75 - .../templates/Window.xft.xml | 78 - .../templates/WindowPartial.xft.xml | 74 - 367 files changed, 56670 deletions(-) delete mode 100644 main/src/addins/MonoDevelop.GtkCore/AddinInfo.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/AssemblyInfo.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/Gui/MonoDevelop.GtkCore.Dialogs.GtkDesignerOptionsPanelWidget.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/Makefile.am delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Commands/GladeCommands.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ClassUtils.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDocumentOutline.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.addin.xml delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.csproj delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/Counters.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/GtkCoreService.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/GtkDesignInfo.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ObjectsDocument.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ProjectResourceProvider.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ReferenceManager.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetParser.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/gui.glade delete mode 100644 main/src/addins/MonoDevelop.GtkCore/icons/actiongroup.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/icons/dialog.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/icons/image-x-generic.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/icons/widget.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/icons/window.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/ClassDescriptor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/Clipboard.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/CommandDescriptor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/CustomWidget.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/DND.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/EnumDescriptor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/ErrorWidget.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/GeneratorContext.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/GladeException.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/GladeUtils.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/IDesignArea.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/IEditableObject.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/IProject.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/IPropertyEditor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/IRadioGroupManager.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/IResourceProvider.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/ImageInfo.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/ItemDescriptor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/ItemGroup.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/ItemGroupCollection.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/Makefile.am delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/NoGuiDispatchAttribute.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/ObjectReader.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/ObjectWrapper.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/ObjectWrapperEventHandler.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/ObjectWriter.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/ParamSpec.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/Placeholder.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/ProjectIconFactory.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/PropertyDescriptor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/PropertyEditorAttribute.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/PropertyEditorCell.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/RadioGroupManager.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/Registry.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/Set.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/SignalDescriptor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/TopLevelDialog.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/TopLevelWindow.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/TranslatableAttribute.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/TypedClassDescriptor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/TypedPropertyDescriptor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/TypedSignalDescriptor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/WidgetLibrary.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/WidgetUtils.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Accelerator.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionGroupEditor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionItem.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionMenu.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionMenuBar.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionMenuItem.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionToolItem.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionToolbar.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Boolean.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/CellRendererComboBox.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Char.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Color.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/DateTimeEditor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/EditIconDialog.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/EditIconFactoryDialog.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Enumeration.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Flags.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/FlagsSelectorDialog.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/FloatRange.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/GroupPicker.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/GtkWorkarounds.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconList.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconSelectorItem.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconSelectorMenu.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconSelectorMenuItem.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Identifier.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Image.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ImageFile.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ImageSelector.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IntRange.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/NonContainerWarningDialog.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/OptIntRange.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ProjectIconList.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ProjectIconSelectorItem.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/PropertyTextEditor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ResponseId.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/SelectIconDialog.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/SelectImageDialog.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/StockIconList.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/StockIconSelectorItem.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/StockItem.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/String.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/StringArray.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Text.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TextBox.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TextEditorDialog.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ThemedIcon.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ThemedIconList.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TimeSpanEditor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Translatable.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TreeViewCellContainer.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/editor/WidgetSelector.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.csproj delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.dll.config delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/stetic.glade delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/undo/ActionDiffAdaptor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/undo/DiffGenerator.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/undo/IDiffAdaptor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/undo/UndoManager.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/undo/XmlDiffAdaptor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/AboutDialog.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Action.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ActionGroup.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ActionToolbarWrapper.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ActionTree.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Bin.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Box.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Button.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ButtonBox.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/CheckButton.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ColorButton.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ComboBox.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ComboBoxEntry.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Container.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Custom.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Dialog.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Entry.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Expander.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Fixed.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/FontButton.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/FontSelectionDialog.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Frame.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/HScale.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/HScrollbar.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/IconView.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Image.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ImageMenuItem.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Label.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/MenuBar.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/MenuItem.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/MessageDialog.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Misc.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Notebook.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/NotifyWorkaround.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Object.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/OptionMenu.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Paned.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/RadioActionGroupManager.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/RadioButton.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/RadioMenuItem.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/RadioToolButton.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Range.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Scale.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ScrolledWindow.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Signal.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/SignalChangedEventHandler.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/SignalCollection.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/SignalEventHandler.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/SpinButton.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Table.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/TextView.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ToggleToolButton.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ToolButton.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Toolbar.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/TreeView.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/VScale.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/VScrollbar.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Viewport.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Widget.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/WidgetEventHandler.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/WidgetNameChangedHandler.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Window.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/objects.xml delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/COPIED delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/accellabel.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/actiongroup.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/add-check-label.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/add-menu.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/alignment.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/arrow.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/box-expand.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/box-fill.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/button.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/calendar.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/cell-expand-h.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/cell-expand-v.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/cell-fill-h.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/cell-fill-v.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/checkbutton.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/colorbutton.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/colorselection.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/colorselectiondialog.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/combo.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/comboentry.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/custom.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/dec-border.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/dialog.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/drawingarea.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/entry.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/eventbox.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/expander.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/fileselection.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/fixed.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/fontbutton.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/fontselection.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/fontselectiondialog.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/frame.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/globe-not.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/globe.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/handlebox.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/hbox.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/hbuttonbox.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/hpaned.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/hscale.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/hscrollbar.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/hseparator.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/iconview.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/image.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/inc-border.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/label.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/menu.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/menubar.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/messagedialog.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/missing.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/notebook.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/optionmenu.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/progressbar.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/radiobutton.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/remove-check-label.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/remove-menu.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/scrolledwindow.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/spinbutton.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/statusbar.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/table.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/textview.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/togglebutton.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/toolbar.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/treeview.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/vbox.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/vbuttonbox.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/viewport.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/vpaned.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/vscale.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/vscrollbar.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/vseparator.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/widget.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/window.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionComponent.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionGroupComponent.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionGroupDesigner.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionGroupDesignerBackend.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionGroupEditSession.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionGroupToolbar.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/Application.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/ApplicationBackend.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/ApplicationBackendController.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/AssemblyResolver.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/AssemblyWidgetLibrary.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/CecilClassDescriptor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/CecilPropertyDescriptor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/CecilSignalDescriptor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/CecilWidgetLibrary.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/CodeGenerationResult.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/CodeGenerator.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/CodeGeneratorInternalClass.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/CodeGeneratorPartialClass.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/Component.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/ComponentEventHandler.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/ComponentSignalEventHandler.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/ComponentType.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/ContainerUndoRedoManager.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/ContextMenu.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/Designer.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/Glade.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/Grid.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/GuiDispatchServerSink.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/GuiDispatchServerSinkProvider.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/LibraryCache.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/Makefile.am delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/Palette.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/PaletteBackend.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/PluggableWidget.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/Project.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/ProjectBackend.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/ProjectViewBackend.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/PropertyEditor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/PropertyGrid.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/PropertyTree.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/Shadow.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/SignalsEditor.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/SignalsEditorBackend.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/UndoQueue.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/UserInterface.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetActionBar.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetComponent.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetDesigner.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetDesignerBackend.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetEditSession.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetFactory.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetInfoEventHandler.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetPropertyTree.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetPropertyTreeBackend.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetTree.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetTreeCombo.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/Windows/Preview.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/Windows/WindowsTheme.cs delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/action.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/libsteticui.csproj delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/libsteticui.dll.config delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/missing.png delete mode 100644 main/src/addins/MonoDevelop.GtkCore/libsteticui/packages.config delete mode 100644 main/src/addins/MonoDevelop.GtkCore/packages.config delete mode 100644 main/src/addins/MonoDevelop.GtkCore/templates/ActionGroup.xft.xml delete mode 100644 main/src/addins/MonoDevelop.GtkCore/templates/ActionGroupPartial.xft.xml delete mode 100644 main/src/addins/MonoDevelop.GtkCore/templates/Dialog.xft.xml delete mode 100644 main/src/addins/MonoDevelop.GtkCore/templates/DialogPartial.xft.xml delete mode 100644 main/src/addins/MonoDevelop.GtkCore/templates/DrawingArea.xft.xml delete mode 100644 main/src/addins/MonoDevelop.GtkCore/templates/Widget.xft.xml delete mode 100644 main/src/addins/MonoDevelop.GtkCore/templates/WidgetPartial.xft.xml delete mode 100644 main/src/addins/MonoDevelop.GtkCore/templates/Window.xft.xml delete mode 100644 main/src/addins/MonoDevelop.GtkCore/templates/WindowPartial.xft.xml diff --git a/main/Main.sln b/main/Main.sln index 5ee822a35e5..a3ebe61dedb 100644 --- a/main/Main.sln +++ b/main/Main.sln @@ -41,12 +41,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VersionControl.Subversion.W EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MonoDevelop.GtkCore", "MonoDevelop.GtkCore", "{02280E65-C507-4931-AE68-AA2E89E15EEF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.GtkCore", "src\addins\MonoDevelop.GtkCore\MonoDevelop.GtkCore.csproj", "{7FCDB0D9-AA7D-44E4-BE74-55312B432389}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "libstetic", "src\addins\MonoDevelop.GtkCore\libstetic\libstetic.csproj", "{F870E2E7-FA64-4B2F-968A-90B36AB7AAA9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "libsteticui", "src\addins\MonoDevelop.GtkCore\libsteticui\libsteticui.csproj", "{7926DB5B-96A7-47A7-9870-DB42FA5C3548}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VBNetBinding", "VBNetBinding", "{481E1487-E0F1-4C6D-BD71-E572D9A19683}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBNetBinding", "src\addins\VBNetBinding\VBNetBinding.csproj", "{EF91D0B8-53F6-4622-9F26-3ED27815878A}" @@ -543,54 +537,6 @@ Global {E17829B5-8EAC-4714-8798-EB8ED3540191}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU {E17829B5-8EAC-4714-8798-EB8ED3540191}.ReleaseWin32|Any CPU.ActiveCfg = Release|Any CPU {E17829B5-8EAC-4714-8798-EB8ED3540191}.ReleaseWin32|Any CPU.Build.0 = Release|Any CPU - {7FCDB0D9-AA7D-44E4-BE74-55312B432389}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7FCDB0D9-AA7D-44E4-BE74-55312B432389}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7FCDB0D9-AA7D-44E4-BE74-55312B432389}.DebugGnome|Any CPU.ActiveCfg = DebugGnome|Any CPU - {7FCDB0D9-AA7D-44E4-BE74-55312B432389}.DebugGnome|Any CPU.Build.0 = DebugGnome|Any CPU - {7FCDB0D9-AA7D-44E4-BE74-55312B432389}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU - {7FCDB0D9-AA7D-44E4-BE74-55312B432389}.DebugMac|Any CPU.Build.0 = Debug|Any CPU - {7FCDB0D9-AA7D-44E4-BE74-55312B432389}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU - {7FCDB0D9-AA7D-44E4-BE74-55312B432389}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU - {7FCDB0D9-AA7D-44E4-BE74-55312B432389}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7FCDB0D9-AA7D-44E4-BE74-55312B432389}.Release|Any CPU.Build.0 = Release|Any CPU - {7FCDB0D9-AA7D-44E4-BE74-55312B432389}.ReleaseGnome|Any CPU.ActiveCfg = ReleaseGnome|Any CPU - {7FCDB0D9-AA7D-44E4-BE74-55312B432389}.ReleaseGnome|Any CPU.Build.0 = ReleaseGnome|Any CPU - {7FCDB0D9-AA7D-44E4-BE74-55312B432389}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU - {7FCDB0D9-AA7D-44E4-BE74-55312B432389}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU - {7FCDB0D9-AA7D-44E4-BE74-55312B432389}.ReleaseWin32|Any CPU.ActiveCfg = Release|Any CPU - {7FCDB0D9-AA7D-44E4-BE74-55312B432389}.ReleaseWin32|Any CPU.Build.0 = Release|Any CPU - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9}.DebugGnome|Any CPU.ActiveCfg = Debug|Any CPU - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9}.DebugGnome|Any CPU.Build.0 = Debug|Any CPU - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9}.DebugMac|Any CPU.Build.0 = Debug|Any CPU - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9}.Release|Any CPU.Build.0 = Release|Any CPU - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9}.ReleaseGnome|Any CPU.ActiveCfg = Release|Any CPU - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9}.ReleaseGnome|Any CPU.Build.0 = Release|Any CPU - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9}.ReleaseWin32|Any CPU.ActiveCfg = Release|Any CPU - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9}.ReleaseWin32|Any CPU.Build.0 = Release|Any CPU - {7926DB5B-96A7-47A7-9870-DB42FA5C3548}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7926DB5B-96A7-47A7-9870-DB42FA5C3548}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7926DB5B-96A7-47A7-9870-DB42FA5C3548}.DebugGnome|Any CPU.ActiveCfg = Debug|Any CPU - {7926DB5B-96A7-47A7-9870-DB42FA5C3548}.DebugGnome|Any CPU.Build.0 = Debug|Any CPU - {7926DB5B-96A7-47A7-9870-DB42FA5C3548}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU - {7926DB5B-96A7-47A7-9870-DB42FA5C3548}.DebugMac|Any CPU.Build.0 = Debug|Any CPU - {7926DB5B-96A7-47A7-9870-DB42FA5C3548}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU - {7926DB5B-96A7-47A7-9870-DB42FA5C3548}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU - {7926DB5B-96A7-47A7-9870-DB42FA5C3548}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7926DB5B-96A7-47A7-9870-DB42FA5C3548}.Release|Any CPU.Build.0 = Release|Any CPU - {7926DB5B-96A7-47A7-9870-DB42FA5C3548}.ReleaseGnome|Any CPU.ActiveCfg = Release|Any CPU - {7926DB5B-96A7-47A7-9870-DB42FA5C3548}.ReleaseGnome|Any CPU.Build.0 = Release|Any CPU - {7926DB5B-96A7-47A7-9870-DB42FA5C3548}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU - {7926DB5B-96A7-47A7-9870-DB42FA5C3548}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU - {7926DB5B-96A7-47A7-9870-DB42FA5C3548}.ReleaseWin32|Any CPU.ActiveCfg = Release|Any CPU - {7926DB5B-96A7-47A7-9870-DB42FA5C3548}.ReleaseWin32|Any CPU.Build.0 = Release|Any CPU {EF91D0B8-53F6-4622-9F26-3ED27815878A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EF91D0B8-53F6-4622-9F26-3ED27815878A}.Debug|Any CPU.Build.0 = Debug|Any CPU {EF91D0B8-53F6-4622-9F26-3ED27815878A}.DebugGnome|Any CPU.ActiveCfg = Debug|Any CPU @@ -2110,9 +2056,6 @@ Global {1038FBD8-750E-4081-BC65-D89FFED3C881} = {DEEB9163-3966-4E5E-9AB5-FBB3E01AC82A} {E17829B5-8EAC-4714-8798-EB8ED3540191} = {DEEB9163-3966-4E5E-9AB5-FBB3E01AC82A} {02280E65-C507-4931-AE68-AA2E89E15EEF} = {D417E929-2B3A-46AC-BBE8-027ADB63A790} - {7FCDB0D9-AA7D-44E4-BE74-55312B432389} = {02280E65-C507-4931-AE68-AA2E89E15EEF} - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9} = {02280E65-C507-4931-AE68-AA2E89E15EEF} - {7926DB5B-96A7-47A7-9870-DB42FA5C3548} = {02280E65-C507-4931-AE68-AA2E89E15EEF} {481E1487-E0F1-4C6D-BD71-E572D9A19683} = {D417E929-2B3A-46AC-BBE8-027ADB63A790} {EF91D0B8-53F6-4622-9F26-3ED27815878A} = {481E1487-E0F1-4C6D-BD71-E572D9A19683} {75B9F2DF-4DEA-4007-965D-339563735EBE} = {D417E929-2B3A-46AC-BBE8-027ADB63A790} diff --git a/main/configure.ac b/main/configure.ac index 940e54af963..cd79c192814 100644 --- a/main/configure.ac +++ b/main/configure.ac @@ -331,9 +331,6 @@ src/addins/CSharpBinding/AspNet/Makefile src/addins/ILAsmBinding/Makefile src/addins/VBNetBinding/Makefile src/addins/ChangeLogAddIn/Makefile -src/addins/MonoDevelop.GtkCore/Makefile -src/addins/MonoDevelop.GtkCore/libstetic/Makefile -src/addins/MonoDevelop.GtkCore/libsteticui/Makefile src/addins/TextTemplating/Makefile src/addins/TextTemplating/MonoDevelop.TextTemplating/Makefile src/addins/AspNet/Makefile diff --git a/main/src/addins/Makefile.am b/main/src/addins/Makefile.am index e41a99aafcf..aecba0ceabd 100644 --- a/main/src/addins/Makefile.am +++ b/main/src/addins/Makefile.am @@ -21,7 +21,6 @@ SUBDIRS = \ MonoDevelop.UnitTesting.NUnit \ MonoDeveloperExtensions \ VBNetBinding \ - MonoDevelop.GtkCore \ ChangeLogAddIn \ MonoDevelop.WebReferences \ MonoDevelop.RegexToolkit \ diff --git a/main/src/addins/MonoDevelop.GtkCore/AddinInfo.cs b/main/src/addins/MonoDevelop.GtkCore/AddinInfo.cs deleted file mode 100644 index 904938eb23b..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/AddinInfo.cs +++ /dev/null @@ -1,16 +0,0 @@ - -using System; -using Mono.Addins; -using Mono.Addins.Description; - -[assembly:Addin ("GtkCore", - Namespace = "MonoDevelop", - Version = MonoDevelop.BuildInfo.Version, - Category = "IDE extensions")] - -[assembly:AddinName ("GTK# Visual Designer")] -[assembly:AddinDescription ("Provides support for visual design of GTK# windows, dialogs and widgets")] - -[assembly:AddinDependency ("Core", MonoDevelop.BuildInfo.Version)] -[assembly:AddinDependency ("Ide", MonoDevelop.BuildInfo.Version)] -[assembly:AddinDependency ("DesignerSupport", MonoDevelop.BuildInfo.Version)] diff --git a/main/src/addins/MonoDevelop.GtkCore/AssemblyInfo.cs b/main/src/addins/MonoDevelop.GtkCore/AssemblyInfo.cs deleted file mode 100644 index d123b0eb9eb..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/AssemblyInfo.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Autogenerated from MonoDevelop.GtkCore.addin.xml - -using System.Reflection; - -[assembly: AssemblyProduct ("MonoDevelop")] -[assembly: AssemblyTitle ("GTK# Visual Designer")] -[assembly: AssemblyDescription ("Provides support for visual design of GTK# windows, dialogs and widgets.")] -[assembly: AssemblyVersion ("2.6")] -[assembly: AssemblyCopyright ("X11")] diff --git a/main/src/addins/MonoDevelop.GtkCore/Gui/MonoDevelop.GtkCore.Dialogs.GtkDesignerOptionsPanelWidget.cs b/main/src/addins/MonoDevelop.GtkCore/Gui/MonoDevelop.GtkCore.Dialogs.GtkDesignerOptionsPanelWidget.cs deleted file mode 100644 index 9483546d2de..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/Gui/MonoDevelop.GtkCore.Dialogs.GtkDesignerOptionsPanelWidget.cs +++ /dev/null @@ -1,39 +0,0 @@ - -// This file has been generated by the GUI designer. Do not modify. -namespace MonoDevelop.GtkCore.Dialogs -{ - public partial class GtkDesignerOptionsPanelWidget - { - private global::Gtk.VBox vbox2; - private global::Gtk.CheckButton checkSwitchLayout; - - protected virtual void Build () - { - MonoDevelop.Components.Gui.Initialize (this); - // Widget MonoDevelop.GtkCore.Dialogs.GtkDesignerOptionsPanelWidget - MonoDevelop.Components.BinContainer.Attach (this); - this.Name = "MonoDevelop.GtkCore.Dialogs.GtkDesignerOptionsPanelWidget"; - // Container child MonoDevelop.GtkCore.Dialogs.GtkDesignerOptionsPanelWidget.Gtk.Container+ContainerChild - this.vbox2 = new global::Gtk.VBox (); - this.vbox2.Name = "vbox2"; - this.vbox2.Spacing = 6; - // Container child vbox2.Gtk.Box+BoxChild - this.checkSwitchLayout = new global::Gtk.CheckButton (); - this.checkSwitchLayout.CanFocus = true; - this.checkSwitchLayout.Name = "checkSwitchLayout"; - this.checkSwitchLayout.Label = global::Mono.Unix.Catalog.GetString ("Automatically switch to the \"GUI Builder\" layout when opening the designer"); - this.checkSwitchLayout.DrawIndicator = true; - this.checkSwitchLayout.UseUnderline = true; - this.vbox2.Add (this.checkSwitchLayout); - global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.checkSwitchLayout])); - w1.Position = 0; - w1.Expand = false; - w1.Fill = false; - this.Add (this.vbox2); - if ((this.Child != null)) { - this.Child.ShowAll (); - } - this.Hide (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/Makefile.am b/main/src/addins/MonoDevelop.GtkCore/Makefile.am deleted file mode 100644 index bf3218efd0e..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -SUBDIRS = libstetic libsteticui - -include $(top_srcdir)/xbuild.include diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Commands/GladeCommands.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Commands/GladeCommands.cs deleted file mode 100644 index 9da1639402c..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Commands/GladeCommands.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// GtkCommands.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace MonoDevelop.GtkCore -{ - public enum GtkCommands - { - AddNewDialog, - AddNewWindow, - AddNewWidget, - AddNewActionGroup, - ImportGladeFile, - EditIcons, - GtkSettings - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs deleted file mode 100644 index bb7717969e5..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs +++ /dev/null @@ -1,187 +0,0 @@ -// -// BindDesignDialog.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -using Glade; -using Gtk; -using MonoDevelop.Core; -using MonoDevelop.Components; -using MonoDevelop.Ide; - -namespace MonoDevelop.GtkCore.Dialogs -{ - class BindDesignDialog: IDisposable - { - #pragma warning disable 649 // never assigned - [Glade.Widget ("BindDesignDialog")] protected Gtk.Dialog dialog; - [Glade.Widget] protected Gtk.Label labelMessage; - [Glade.Widget] protected Gtk.ComboBox comboClasses; - [Glade.Widget] protected Gtk.Entry entryClassName; - [Glade.Widget] protected Gtk.Entry entryNamespace; - [Glade.Widget] protected Gtk.RadioButton radioSelect; - [Glade.Widget] protected Gtk.RadioButton radioCreate; - [Glade.Widget] protected Gtk.Table tableNewClass; - [Glade.Widget] protected Gtk.Button okButton; - [Glade.Widget] protected Gtk.EventBox fileEntryBox; - #pragma warning restore 649 - - FolderEntry fileEntry; - - ListStore store; - static string lastNamespace = ""; - - public BindDesignDialog (string id, ArrayList validClasses, string baseFolder) - { - XML glade = new XML (null, "gui.glade", "BindDesignDialog", null); - glade.Autoconnect (this); - labelMessage.Text = GettextCatalog.GetString ("The widget design {0} is not currently bound to a class.", id); - - fileEntry = new FolderEntry (); - fileEntryBox.Add (fileEntry); - fileEntry.ShowAll (); - - if (validClasses.Count > 0) { - - store = new ListStore (typeof (string)); - foreach (string cname in validClasses) - store.AppendValues (cname); - comboClasses.Model = store; - CellRendererText cr = new CellRendererText (); - comboClasses.PackStart (cr, true); - comboClasses.AddAttribute (cr, "text", 0); - comboClasses.Active = 0; - - } else { - radioSelect.Sensitive = false; - radioCreate.Active = true; - } - - fileEntry.Path = baseFolder; - - // Initialize the class name using the widget name - int i = id.IndexOf ('.'); - if (i != -1) { - entryClassName.Text = id.Substring (i+1); - entryNamespace.Text = id.Substring (0,i); - } else { - entryClassName.Text = id; - entryNamespace.Text = lastNamespace; - } - - dialog.Response += new Gtk.ResponseHandler (OnResponse); - UpdateStatus (); - } - - void OnResponse (object ob, Gtk.ResponseArgs args) - { - dialog.Response -= new Gtk.ResponseHandler (OnResponse); - if (args.ResponseId == ResponseType.Ok && radioCreate.Active) - lastNamespace = Namespace; - } - - public bool Run () - { - return MessageService.ShowCustomDialog (dialog) == (int) ResponseType.Ok; - } - - public bool CreateNew { - get { return radioCreate.Active; } - } - - public string ClassName { - get { - if (radioCreate.Active) { - return entryClassName.Text; - } else { - Gtk.TreeIter it; - if (!comboClasses.GetActiveIter (out it)) - return ""; - string s = (string) store.GetValue (it, 0); - int i = s.IndexOf ('.'); - if (i != -1) - return s.Substring (i+1); - else - return s; - } - } - } - - public string Namespace { - get { - if (radioCreate.Active) { - return entryNamespace.Text; - } else { - Gtk.TreeIter it; - if (!comboClasses.GetActiveIter (out it)) - return ""; - string s = (string) store.GetValue (it, 0); - int i = s.IndexOf ('.'); - if (i != -1) - return s.Substring (0, i); - else - return ""; - } - } - } - - public string Folder { - get { return fileEntry.Path; } - } - - protected void OnSelectToggled (object ob, EventArgs args) - { - UpdateStatus (); - } - - protected void OnEntryChanged (object ob, EventArgs a) - { - UpdateStatus (); - } - - void UpdateStatus () - { - if (radioSelect.Active) { - tableNewClass.Sensitive = false; - comboClasses.Sensitive = true; - okButton.Sensitive = true; - } else { - tableNewClass.Sensitive = true; - comboClasses.Sensitive = false; - okButton.Sensitive = ClassName != "" && Folder != ""; - } - } - - public void Dispose () - { - dialog.Dispose (); - } - } - -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs deleted file mode 100644 index 7d66c092cb0..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs +++ /dev/null @@ -1,80 +0,0 @@ -// -// ConfirmWindowDeleteDialog.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using Glade; -using Gtk; -using MonoDevelop.Core; -using MonoDevelop.Ide; - -namespace MonoDevelop.GtkCore.Dialogs -{ - class ConfirmWindowDeleteDialog: IDisposable - { - #pragma warning disable 649 // never assigned - [Glade.Widget ("ConfirmWindowDeleteDialog")] protected Gtk.Dialog dialog; - [Glade.Widget] protected Gtk.Label label; - [Glade.Widget] protected Gtk.CheckButton checkbox; - #pragma warning restore 649 - - public ConfirmWindowDeleteDialog (string windowName, string fileName, Stetic.ProjectItemInfo obj) - { - XML glade = new XML (null, "gui.glade", "ConfirmWindowDeleteDialog", null); - glade.Autoconnect (this); - - if (obj is Stetic.WidgetInfo && ((Stetic.WidgetInfo)obj).IsWindow) { - label.Text = GettextCatalog.GetString ("Are you sure you want to delete the window '{0}'?", windowName); - } else if (obj is Stetic.WidgetInfo) { - label.Text = GettextCatalog.GetString ("Are you sure you want to delete the widget '{0}'?", windowName); - } else if (obj is Stetic.ActionGroupInfo) { - label.Text = GettextCatalog.GetString ("Are you sure you want to delete the action group '{0}'?", windowName); - } else - label.Text = GettextCatalog.GetString ("Are you sure you want to delete '{0}'?", windowName); - - if (fileName != null) { - checkbox.Label = string.Format (checkbox.Label, fileName); - checkbox.Active = true; - } else - checkbox.Hide (); - } - - public void Dispose () - { - dialog.Dispose (); - } - - public int Run () - { - return MessageService.ShowCustomDialog (dialog); - } - - public bool DeleteFile { - get { return checkbox.Active; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs deleted file mode 100644 index 41f1b27042b..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// GtkDesignerOptionPanelWidget.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (c) 2009 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using MonoDevelop.GtkCore.GuiBuilder; -using MonoDevelop.Components; -using MonoDevelop.Ide.Gui.Dialogs; - -namespace MonoDevelop.GtkCore.Dialogs -{ - public class GtkDesignerOptionPanel: OptionsPanel - { - GtkDesignerOptionsPanelWidget widget; - - public override Control CreatePanelWidget () - { - widget = new GtkDesignerOptionsPanelWidget (); - widget.AutoSwitchLayout = GuiBuilderService.AutoSwitchGuiLayout; - return widget; - } - - public override void ApplyChanges () - { - GuiBuilderService.AutoSwitchGuiLayout = widget.AutoSwitchLayout; - } - } - - [System.ComponentModel.ToolboxItem(true)] - public partial class GtkDesignerOptionsPanelWidget : Gtk.Bin - { - public GtkDesignerOptionsPanelWidget() - { - this.Build(); - } - - public bool AutoSwitchLayout { - get { return checkSwitchLayout.Active; } - set { checkSwitchLayout.Active = value; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs deleted file mode 100644 index c1cd93ba599..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs +++ /dev/null @@ -1,40 +0,0 @@ - -using System; -using MonoDevelop.Ide.Templates; -using MonoDevelop.Core; -using MonoDevelop.Projects; -using Gtk; - -namespace MonoDevelop.GtkCore.Dialogs -{ - class GtkFeatureWidget : Gtk.VBox - { - ComboBox versionCombo; - - public GtkFeatureWidget (DotNetProject project) - { - Spacing = 6; - - versionCombo = Gtk.ComboBox.NewText (); - ReferenceManager refmgr = new ReferenceManager (project); - foreach (string v in refmgr.SupportedGtkVersions) - versionCombo.AppendText (v); - versionCombo.Active = 0; - refmgr.Dispose (); - - // GTK# version selector - HBox box = new HBox (false, 6); - Gtk.Label vlab = new Label (GettextCatalog.GetString ("Target GTK# version:")); - box.PackStart (vlab, false, false, 0); - box.PackStart (versionCombo, false, false, 0); - box.PackStart (new Label (GettextCatalog.GetString ("(or upper)")), false, false, 0); - PackStart (box, false, false, 0); - - ShowAll (); - } - - public string SelectedVersion { - get { return versionCombo.ActiveText; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs deleted file mode 100644 index 0b74290fe35..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs +++ /dev/null @@ -1,95 +0,0 @@ -// -// SelectRenamedClassDialog.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections.Generic; -using Gtk; -using Gdk; -using Glade; -using MonoDevelop.Ide; -using MonoDevelop.Ide.TypeSystem; -using MonoDevelop.Components; -using Microsoft.CodeAnalysis; -using ICSharpCode.NRefactory6.CSharp; - -namespace MonoDevelop.GtkCore.Dialogs -{ - public class SelectRenamedClassDialog: IDisposable - { - [Glade.Widget ("SelectRenamedClassDialog")] protected Gtk.Dialog dialog; - [Glade.Widget] protected Gtk.TreeView treeClasses; - ListStore store; - - public SelectRenamedClassDialog (IEnumerable classes) - { - XML glade = new XML (null, "gui.glade", "SelectRenamedClassDialog", null); - glade.Autoconnect (this); - - store = new ListStore (typeof(Xwt.Drawing.Image), typeof(string)); - treeClasses.Model = store; - - TreeViewColumn column = new TreeViewColumn (); - - var pr = new CellRendererImage (); - column.PackStart (pr, false); - column.AddAttribute (pr, "image", 0); - - CellRendererText crt = new CellRendererText (); - column.PackStart (crt, true); - column.AddAttribute (crt, "text", 1); - - treeClasses.AppendColumn (column); - - foreach (var cls in classes) { - var pic = ImageService.GetIcon (cls.GetStockIcon ()); - store.AppendValues (pic, cls.GetFullName ()); - } - } - - public bool Run () - { - return MessageService.ShowCustomDialog (dialog) == (int) ResponseType.Ok; - } - - public string SelectedClass { - get { - Gtk.TreeModel foo; - Gtk.TreeIter iter; - if (!treeClasses.Selection.GetSelected (out foo, out iter)) - return null; - return (string) store.GetValue (iter, 1); - } - } - - public void Dispose () - { - dialog.Dispose (); - } - } - -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs deleted file mode 100644 index 794b08476bd..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs +++ /dev/null @@ -1,140 +0,0 @@ -// -// WidgetBuilderOptionPanel.cs -// -// Author: -// Lluis Sanchez Gual -// Mike Kestner -// -// Copyright (C) 2006, 2008 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using Gtk; - -using MonoDevelop.Components; -using MonoDevelop.Core; -using MonoDevelop.Projects; -using MonoDevelop.Ide.Gui.Dialogs; - -namespace MonoDevelop.GtkCore.Dialogs -{ - class WidgetBuilderOptionPanel: ItemOptionsPanel - { - class WidgetBuilderOptionPanelWidget : Gtk.VBox - { - Gtk.CheckButton checkGettext; - Gtk.Entry entryGettext; - Gtk.Entry entryResourceLoader; - Gtk.ComboBox comboVersions; - - DotNetProject project; - - public WidgetBuilderOptionPanelWidget (Project project) : base (false, 6) - { - this.project = project as DotNetProject; - - Gtk.HBox box = new Gtk.HBox (false, 3); - Gtk.Label lbl = new Gtk.Label (GettextCatalog.GetString ("Target Gtk# version:")); - box.PackStart (lbl, false, false, 0); - comboVersions = ComboBox.NewText (); - ReferenceManager refmgr = new ReferenceManager (project as DotNetProject); - foreach (string v in refmgr.SupportedGtkVersions) - comboVersions.AppendText (v); - comboVersions.Active = refmgr.SupportedGtkVersions.IndexOf (refmgr.GtkPackageVersion); - refmgr.Dispose (); - box.PackStart (comboVersions, false, false, 0); - box.ShowAll (); - PackStart (box, false, false, 0); - - HSeparator sep = new HSeparator (); - sep.Show (); - PackStart (sep, false, false, 0); - - if (!GtkDesignInfo.HasDesignedObjects (project)) - return; - - GtkDesignInfo designInfo = GtkDesignInfo.FromProject (project); - checkGettext = new CheckButton (GettextCatalog.GetString ("Enable gettext support")); - checkGettext.Active = designInfo.GenerateGettext; - checkGettext.Show (); - PackStart (checkGettext, false, false, 0); - - box = new Gtk.HBox (false, 3); - box.PackStart (new Label (GettextCatalog.GetString ("Gettext class:")), false, false, 0); - entryGettext = new Gtk.Entry (); - entryGettext.Text = designInfo.GettextClass; - entryGettext.Sensitive = checkGettext.Active; - box.PackStart (entryGettext, false, false, 0); - box.ShowAll (); - PackStart (box, false, false, 0); - - box = new Gtk.HBox (false, 3); - box.PackStart (new Label (GettextCatalog.GetString ("Resource loader class:")), false, false, 0); - entryResourceLoader = new Gtk.Entry (); - entryResourceLoader.Text = designInfo.ImageResourceLoaderClass; - entryResourceLoader.Sensitive = checkGettext.Active; - box.PackStart (entryResourceLoader, false, false, 0); - box.ShowAll (); - PackStart (box, false, false, 0); - - checkGettext.Clicked += delegate { - box.Sensitive = checkGettext.Active; - if (checkGettext.Active) - entryGettext.Text = "Mono.Unix.Catalog"; - }; - } - - public void Store () - { - ReferenceManager refmgr = new ReferenceManager (project); - if (!string.IsNullOrEmpty (comboVersions.ActiveText)) - refmgr.GtkPackageVersion = comboVersions.ActiveText; - if (GtkDesignInfo.HasDesignedObjects (project)) { - GtkDesignInfo info = GtkDesignInfo.FromProject (project); - info.GenerateGettext = checkGettext.Active; - info.GettextClass = entryGettext.Text; - info.ImageResourceLoaderClass = entryResourceLoader.Text; - info.GuiBuilderProject.SteticProject.TargetGtkVersion = comboVersions.ActiveText; - info.GuiBuilderProject.SaveProject (false); - } - refmgr.Dispose (); - } - } - - WidgetBuilderOptionPanelWidget widget; - - public override Control CreatePanelWidget() - { - return (widget = new WidgetBuilderOptionPanelWidget (ConfiguredProject)); - } - - public override bool IsVisible () - { - return GtkDesignInfo.SupportsDesigner (DataObject as Project); - } - - public override void ApplyChanges () - { - widget.Store (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs deleted file mode 100644 index 68871e78abc..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs +++ /dev/null @@ -1,202 +0,0 @@ -// -// ActionGroupDisplayBinding.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System.Collections; - -using MonoDevelop.Core; -using MonoDevelop.Ide.Gui; -using MonoDevelop.Projects; -using MonoDevelop.GtkCore.Dialogs; -using MonoDevelop.Ide; -using MonoDevelop.Ide.TypeSystem; -using System.Linq; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using MonoDevelop.Refactoring; - - -namespace MonoDevelop.GtkCore.GuiBuilder -{ - public class ActionGroupDisplayBinding : IViewDisplayBinding - { - bool excludeThis = false; - - public string Name { - get { return MonoDevelop.Core.GettextCatalog.GetString ("Action Group Editor"); } - } - - public bool CanUseAsDefault { - get { return true; } - } - - public bool CanHandle (FilePath fileName, string mimeType, MonoDevelop.Projects.Project ownerProject) - { - if (excludeThis) - return false; - - if (fileName.IsNullOrEmpty) - return false; - - if (!IdeApp.Workspace.IsOpen) - return false; - - if (GetActionGroup (fileName) == null) - return false; - - excludeThis = true; - var db = DisplayBindingService.GetDefaultViewBinding (fileName, mimeType, ownerProject); - excludeThis = false; - return db != null; - } - - public ViewContent CreateContent (FilePath fileName, string mimeType, MonoDevelop.Projects.Project ownerProject) - { - excludeThis = true; - var db = DisplayBindingService.GetDefaultViewBinding (fileName, mimeType, ownerProject); - GtkDesignInfo info = GtkDesignInfo.FromProject ((DotNetProject) ownerProject); - - var content = db.CreateContent (fileName, mimeType, ownerProject); - content.Binding = db; - ActionGroupView view = new ActionGroupView (content, GetActionGroup (fileName), info.GuiBuilderProject); - excludeThis = false; - return view; - } - - Stetic.ActionGroupInfo GetActionGroup (string file) - { - var project = IdeApp.Workspace.GetProjectsContainingFile (file).FirstOrDefault (); - if (!GtkDesignInfo.HasDesignedObjects (project)) - return null; - - return GtkDesignInfo.FromProject (project).GuiBuilderProject.GetActionGroupForFile (file); - } - - internal static string BindToClass (MonoDevelop.Projects.Project project, Stetic.ActionGroupInfo group) - { - GuiBuilderProject gproject = GtkDesignInfo.FromProject (project).GuiBuilderProject; - string file = gproject.GetSourceCodeFile (group); - if (file != null) - return file; - - // Find the classes that could be bound to this design - - ArrayList list = new ArrayList (); - var ctx = gproject.GetParserContext (); - foreach (var cls in ctx.GetAllTypesInMainAssembly ()) - if (IsValidClass (cls)) - list.Add (cls.GetFullName ()); - - // Ask what to do - - using (BindDesignDialog dialog = new BindDesignDialog (group.Name, list, project.BaseDirectory)) { - if (!dialog.Run ()) - return null; - - if (dialog.CreateNew) - CreateClass (project, (Stetic.ActionGroupComponent) group.Component, dialog.ClassName, dialog.Namespace, dialog.Folder); - - string fullName = dialog.Namespace.Length > 0 ? dialog.Namespace + "." + dialog.ClassName : dialog.ClassName; - group.Name = fullName; - } - return gproject.GetSourceCodeFile (group); - } - - static ITypeSymbol CreateClass (MonoDevelop.Projects.Project project, Stetic.ActionGroupComponent group, string name, string namspace, string folder) - { - string fullName = namspace.Length > 0 ? namspace + "." + name : name; - - var type = SyntaxFactory.ClassDeclaration (name) - .AddBaseListTypes (SyntaxFactory.SimpleBaseType (SyntaxFactory.ParseTypeName ("Gtk.ActionGroup"))); - - // Generate the constructor. It contains the call that builds the widget. - var ctor = SyntaxFactory.ConstructorDeclaration ( - new SyntaxList (), - SyntaxFactory.TokenList (SyntaxFactory.Token (SyntaxKind.PublicKeyword)), - SyntaxFactory.Identifier (name), - SyntaxFactory.ParameterList (), - SyntaxFactory.ConstructorInitializer (SyntaxKind.BaseKeyword, SyntaxFactory.ArgumentList (new SeparatedSyntaxList { SyntaxFactory.Argument (SyntaxFactory.ParseExpression (fullName)) } )), - SyntaxFactory.Block ( - SyntaxFactory.ExpressionStatement ( - SyntaxFactory.InvocationExpression ( - SyntaxFactory.ParseExpression ("Stetic.Gui.Build"), - SyntaxFactory.ArgumentList ( - new SeparatedSyntaxList { - SyntaxFactory.Argument (SyntaxFactory.ThisExpression ()), - SyntaxFactory.Argument (SyntaxFactory.ParseExpression (fullName)) - } - ) - ) - ) - ) - ); - - type = type.AddMembers (ctor); - - // Add signal handlers - foreach (Stetic.ActionComponent action in group.GetActions ()) { - foreach (Stetic.Signal signal in action.GetSignals ()) { - - var parameters = new SeparatedSyntaxList (); - foreach (var p in signal.SignalDescriptor.HandlerParameters) { - parameters = parameters.Add (SyntaxFactory.Parameter (new SyntaxList (), SyntaxFactory.TokenList (), SyntaxFactory.ParseTypeName (p.TypeName), SyntaxFactory.Identifier (p.Name), null)); - } - - var met = SyntaxFactory.MethodDeclaration ( - new SyntaxList (), - SyntaxFactory.TokenList (SyntaxFactory.Token (SyntaxKind.ProtectedKeyword)), - SyntaxFactory.ParseTypeName (signal.SignalDescriptor.HandlerReturnTypeName), - null, - SyntaxFactory.Identifier (signal.Handler), - null, - SyntaxFactory.ParameterList (parameters), - new SyntaxList (), - SyntaxFactory.Block (), - null - ); - - - type = type.AddMembers (met); - } - } - - // Create the class - return CodeGenerationService.AddType ((DotNetProject)project, folder, namspace, type); - } - - internal static bool IsValidClass (ITypeSymbol cls) - { - if (cls.SpecialType == SpecialType.System_Object) - return false; - if (cls.BaseType.GetFullName () == "Gtk.ActionGroup") - return true; - return IsValidClass (cls.BaseType); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs deleted file mode 100644 index 9bd11bc1f68..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs +++ /dev/null @@ -1,314 +0,0 @@ -// -// ActionGroupView.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Linq; - -using MonoDevelop.Projects; -using MonoDevelop.Core; -using MonoDevelop.Ide.Gui; -using MonoDevelop.Ide.Commands; -using MonoDevelop.Components.Commands; -using MonoDevelop.DesignerSupport; -using Microsoft.CodeAnalysis; -using MonoDevelop.Ide; -using System.Threading.Tasks; -using MonoDevelop.Refactoring; - -namespace MonoDevelop.GtkCore.GuiBuilder -{ - public class ActionGroupView: CombinedDesignView - { - Stetic.ActionGroupDesigner designer; - CodeBinder codeBinder; - GuiBuilderProject project; - Stetic.ActionGroupComponent group; - Stetic.ActionGroupInfo groupInfo; - string groupName; - - public ActionGroupView (ViewContent content, Stetic.ActionGroupInfo group, GuiBuilderProject project): base (content) - { - groupName = group.Name; - this.project = project; - LoadDesigner (); - } - - void LoadDesigner () - { - groupInfo = project.GetActionGroup (groupName); - if (groupInfo == null) - // Group not found - return; - - group = (Stetic.ActionGroupComponent) groupInfo.Component; - project.Unloaded += OnDisposeProject; - - designer = project.SteticProject.CreateActionGroupDesigner (groupInfo, false); - designer.AllowActionBinding = project.Project.UsePartialTypes; - designer.BindField += new EventHandler (OnBindField); - - ActionGroupPage actionsPage = new ActionGroupPage (); - actionsPage.PackStart (designer, true, true, 0); - actionsPage.ShowAll (); - - AddButton (GettextCatalog.GetString ("Actions"), actionsPage); - - designer.ModifiedChanged += OnGroupModified; - designer.SignalAdded += OnSignalAdded; - designer.SignalChanged += OnSignalChanged; - designer.RootComponentChanged += OnRootComponentChanged; - - codeBinder = new CodeBinder (project.Project, new OpenDocumentFileProvider (), designer.RootComponent); - } - - public void CloseDesigner () - { - if (designer == null) - return; - project.Unloaded -= OnDisposeProject; - designer.BindField -= OnBindField; - designer.RootComponentChanged -= OnRootComponentChanged; - designer.ModifiedChanged -= OnGroupModified; - designer.SignalAdded -= OnSignalAdded; - designer.SignalChanged -= OnSignalChanged; - designer.Destroy (); - designer = null; - - project.Reloaded += OnReloadProject; - } - - public override Stetic.Designer Designer { - get { return designer; } - } - - void OnDisposeProject (object s, EventArgs args) - { - RemoveButton (1); - CloseDesigner (); - } - - void OnReloadProject (object s, EventArgs args) - { - if (designer == null) - LoadDesigner (); - } - - public Stetic.ActionGroupComponent ActionGroup { - get { return group; } - set { Load (value.Name); } - } - - protected override void OnPageShown (int npage) - { - if (designer != null && group != null) { - // At every page switch update the generated code, to make sure code completion works - // for the generated fields. The call to GenerateSteticCodeStructure will generate - // the code for the window (only the fields in fact) and update the parser database, it - // will not save the code to disk. - if (project.Project.UsePartialTypes) - GuiBuilderService.GenerateSteticCodeStructure ((DotNetProject)project.Project, designer.RootComponent, null, false, false); - } - base.OnPageShown (npage); - } - - void OnRootComponentChanged (object s, EventArgs args) - { - codeBinder.TargetObject = designer.RootComponent; - } - - public override async Task Save (FileSaveInformation fileSaveInformation) - { - string oldBuildFile = GuiBuilderService.GetBuildCodeFileName (project.Project, groupInfo.Name); - - await base.Save (fileSaveInformation); - if (designer == null) - return; - - codeBinder.UpdateBindings (fileSaveInformation.FileName); - - designer.Save (); - - string newBuildFile = GuiBuilderService.GetBuildCodeFileName (project.Project, groupInfo.Name); - if (oldBuildFile != newBuildFile) - FileService.MoveFile (oldBuildFile, newBuildFile); - - project.SaveProject (true); - } - - public override void Dispose () - { - CloseDesigner (); - project.Reloaded -= OnReloadProject; - base.Dispose (); - } - - public void ShowDesignerView () - { - ShowPage (1); - } - - public void SelectAction (Stetic.ActionComponent action) - { - if (designer != null) - designer.SelectedAction = action; - } - - public override void JumpToSignalHandler (Stetic.Signal signal) - { - var cls = codeBinder.GetClass (); - var met = cls.GetMembers (signal.Handler).OfType ().FirstOrDefault (); - if (met != null) { - ShowPage (1); - RefactoringService.RoslynJumpToDeclaration(met); - } - } - - void OnGroupModified (object s, EventArgs a) - { - IsDirty = designer.Modified; - } - - void OnSignalAdded (object s, Stetic.ComponentSignalEventArgs a) - { - codeBinder.BindSignal (a.Signal); - } - - async void OnSignalChanged (object s, Stetic.ComponentSignalEventArgs a) - { - await codeBinder.UpdateSignal (a.OldSignal, a.Signal); - } - - async void OnBindField (object s, EventArgs args) - { - if (designer.SelectedAction != null) { - await codeBinder.BindToField (designer.SelectedAction); - } - } - } - - class ActionGroupPage: Gtk.VBox, ICustomPropertyPadProvider - { - public ActionGroupPage () - { - } - - Gtk.Widget ICustomPropertyPadProvider.GetCustomPropertyWidget () - { - return PropertiesWidget.Instance; - } - - void ICustomPropertyPadProvider.DisposeCustomPropertyWidget () - { - } - - public void ClearChild () - { - if (Children.Length > 0) { - Gtk.Widget w = Children [0]; - Remove (w); - w.Destroy (); - } - } - - Stetic.ActionGroupDesigner actionsBox { - get { return Children[0] as Stetic.ActionGroupDesigner; } - } - - [CommandHandler (EditCommands.Delete)] - protected void OnDelete () - { - actionsBox.DeleteSelection (); - } - - [CommandUpdateHandler (EditCommands.Delete)] - protected void OnUpdateDelete (CommandInfo cinfo) - { - cinfo.Enabled = actionsBox != null && actionsBox.SelectedAction != null; - } - - [CommandHandler (EditCommands.Copy)] - protected void OnCopy () - { - actionsBox.CopySelection (); - } - - [CommandUpdateHandler (EditCommands.Copy)] - protected void OnUpdateCopy (CommandInfo cinfo) - { - cinfo.Enabled = actionsBox != null && actionsBox.SelectedAction != null; - } - - [CommandHandler (EditCommands.Cut)] - protected void OnCut () - { - actionsBox.CutSelection (); - } - - [CommandUpdateHandler (EditCommands.Cut)] - protected void OnUpdateCut (CommandInfo cinfo) - { - cinfo.Enabled = actionsBox != null && actionsBox.SelectedAction != null; - } - - [CommandHandler (EditCommands.Paste)] - protected void OnPaste () - { - actionsBox.PasteToSelection (); - } - - [CommandUpdateHandler (EditCommands.Paste)] - protected void OnUpdatePaste (CommandInfo cinfo) - { - cinfo.Enabled = false; - } - - [CommandHandler (EditCommands.Undo)] - protected void OnUndo () - { - actionsBox.UndoQueue.Undo (); - } - - [CommandHandler (EditCommands.Redo)] - protected void OnRedo () - { - actionsBox.UndoQueue.Redo (); - } - - [CommandUpdateHandler (EditCommands.Undo)] - protected void OnUpdateUndo (CommandInfo cinfo) - { - cinfo.Enabled = actionsBox != null && actionsBox.UndoQueue.CanUndo; - } - - [CommandUpdateHandler (EditCommands.Redo)] - protected void OnUpdateRedo (CommandInfo cinfo) - { - cinfo.Enabled = actionsBox != null && actionsBox.UndoQueue.CanRedo; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ClassUtils.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ClassUtils.cs deleted file mode 100644 index 8c5d0a54622..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ClassUtils.cs +++ /dev/null @@ -1,66 +0,0 @@ -// -// ClassUtils.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using Gtk; -using System; -using System.Collections; -using System.CodeDom; -using Microsoft.CodeAnalysis; - -namespace MonoDevelop.GtkCore.GuiBuilder -{ - internal class ClassUtils - { - public static IFieldSymbol FindWidgetField (ITypeSymbol cls, string name) - { - foreach (var field in cls.GetMembers ().OfType ()) { - if (name == GetWidgetFieldName (field)) - return field; - } - return null; - } - - public static string GetWidgetFieldName (IFieldSymbol field) - { - foreach (AttributeData att in field.GetAttributes ()) { - var type = att.AttributeClass; - if (type.Name == "Widget" || type.Name == "WidgetAttribute") { - var pArgs = att.ConstructorArguments; - if (pArgs != null && pArgs.Length > 0) { - var exp = pArgs[0].Value; - if (exp != null) - return exp.ToString (); - } else { - return field.Name; - } - } - } - return field.Name; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs deleted file mode 100644 index 4a998d7201f..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs +++ /dev/null @@ -1,352 +0,0 @@ -// -// CodeBinder.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.CodeDom; -using System.Collections.Generic; -using System.Linq; - -using MonoDevelop.Core; -using MonoDevelop.Core.ProgressMonitoring; -using MonoDevelop.Projects; -using MonoDevelop.Projects.Text; -using MonoDevelop.Ide.Gui; -using MonoDevelop.GtkCore.Dialogs; -using MonoDevelop.Ide; -using MonoDevelop.Ide.TypeSystem; -using MonoDevelop.Ide.FindInFiles; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using ICSharpCode.NRefactory6.CSharp; -using MonoDevelop.CSharp.Refactoring; -using MonoDevelop.Refactoring; -using System.Xml.XPath; -using System.IO; -using System.Threading.Tasks; - -namespace MonoDevelop.GtkCore.GuiBuilder -{ - /// This class provides several methods for managing the relation - /// between an object (e.g. a window) and the source code that will implement the - /// code for that object. - /// - /// Once created, a CodeBinder object will keep track of the class bound to the - /// object. If the class is renamed, it will properly update the object name. - - public class CodeBinder - { - ITextFileProvider textFileProvider; - Stetic.Component targetObject; - MonoDevelop.Projects.Project project; - GuiBuilderProject gproject; - string className; - string classFile; - - public CodeBinder (MonoDevelop.Projects.Project project, ITextFileProvider textFileProvider, Stetic.Component targetObject) - { - this.project = project; - this.textFileProvider = textFileProvider; - - gproject = GtkDesignInfo.FromProject (project).GuiBuilderProject; - - TargetObject = targetObject; - } - - public Stetic.Component TargetObject { - get { return targetObject; } - set { - this.targetObject = value; - if (targetObject != null) { - var cls = gproject.FindClass (GetClassName (targetObject)); - if (cls != null) { - className = cls.GetFullName (); - classFile = cls.Locations.First ().SourceTree.FilePath; - } - } - } - } - - /// Synchronizes the bindings between the object and the source code - public void UpdateBindings (string fileName) - { - if (targetObject == null) - return; - - classFile = fileName; - - var cls = GetClass (); - if (cls != null) { - UpdateBindings (targetObject, cls); - targetObject.GeneratePublic = cls.DeclaredAccessibility == Accessibility.Public; - } - } - - void UpdateBindings (Stetic.Component obj, ITypeSymbol cls) - { - if (targetObject == null || cls == null) - return; - - // Remove signals for which there isn't a handler in the class - - Stetic.SignalCollection objectSignals = obj.GetSignals (); - if (objectSignals != null) { - Stetic.Signal[] signals = new Stetic.Signal [objectSignals.Count]; - objectSignals.CopyTo (signals, 0); - foreach (Stetic.Signal signal in signals) { - if (FindSignalHandler (cls, signal) == null) { - obj.RemoveSignal (signal); - } - } - } - - // Update children - - foreach (Stetic.Component ob in obj.GetChildren ()) - UpdateBindings (ob, cls); - } - - static IMethodSymbol FindSignalHandler (ITypeSymbol cls, Stetic.Signal signal) - { - return cls.GetMembers (signal.Handler).OfType ().FirstOrDefault (); - } - - public async Task UpdateField (Stetic.Component obj, string oldName) - { - if (targetObject == null) - return; - - if (obj == targetObject) - return; // The root widget name can only be changed internally. - - var cls = GetClass (false); - - string newName = GetObjectName (obj); - if (newName.Length == 0) - return; - - if (cls != null) { - var f = ClassUtils.FindWidgetField (cls, oldName); - if (f != null) { - await MonoDevelop.Refactoring.Rename.RenameRefactoring.Rename (f, newName); - } - } - } - - /// Adds a signal handler to the class - public void BindSignal (Stetic.Signal signal) - { - if (targetObject == null) - return; - - var cls = GetClass (); - if (cls == null) - return; - - if (FindSignalHandler (cls, signal) != null) - return; - - var met = SyntaxFactory.MethodDeclaration (SyntaxFactory.ParseTypeName (signal.SignalDescriptor.HandlerReturnTypeName), - signal.Handler) - .WithBody (SyntaxFactory.Block ()) - .AddModifiers (SyntaxFactory.Token (SyntaxKind.ProtectedKeyword)); - - var parameters = new List (); - foreach (Stetic.ParameterDescriptor pinfo in signal.SignalDescriptor.HandlerParameters) - parameters.Add (SyntaxFactory.Parameter (new SyntaxList (), new SyntaxTokenList (), SyntaxFactory.ParseTypeName (pinfo.TypeName), SyntaxFactory.Identifier (pinfo.Name), null)); - met = met.AddParameterListParameters (parameters.ToArray ()); - - CodeGenerationService.AddNewMember (project, cls, GetSourceLocation (cls), met); - } - - static Location GetSourceLocation (INamedTypeSymbol cls) - { - foreach (var loc in cls.Locations) { - if (loc.IsInSource) { - if (!Path.GetDirectoryName (loc.SourceTree.FilePath).EndsWith ("gtk-gui", FilePath.PathComparison)) - return loc; - } - } - - return cls.Locations.First (); - } - - public async Task UpdateSignal (Stetic.Signal oldSignal, Stetic.Signal newSignal) - { - if (targetObject == null) - return; - - if (oldSignal.Handler == newSignal.Handler) - return; - - var cls = GetClass (); - if (cls == null) - return; - var met = FindSignalHandler (cls, oldSignal); - if (met == null) - return; - await MonoDevelop.Refactoring.Rename.RenameRefactoring.Rename (met, newSignal.Handler); - } - - /// Adds a field to the class - public async Task BindToField (Stetic.Component obj) - { - if (targetObject == null) - return; - - string name = GetMemberName (obj); - var cls = GetClass (); - - if (FindField (cls, name) != null) - return; - - var location = GetSourceLocation(cls); - var doc = await IdeApp.Workbench.OpenDocument (location.SourceTree.FilePath, project, true); - - var editor = doc.Editor; - if (editor != null) { - await CodeGenerationService.AddNewMember (project, cls, cls.Locations.First (), GetFieldCode (cls, obj, name)); - } - } - - FieldDeclarationSyntax GetFieldCode (ITypeSymbol cls, Stetic.Component obj, string name) - { - return SyntaxFactory.FieldDeclaration ( - SyntaxFactory.VariableDeclaration ( - SyntaxFactory.ParseTypeName (obj.Type.ClassName), - new SeparatedSyntaxList { - SyntaxFactory.VariableDeclarator (name) - } - ) - ).AddModifiers (SyntaxFactory.Token (SyntaxKind.ProtectedKeyword)); - } - - - static IFieldSymbol FindField (ITypeSymbol cls, string name) - { - return cls - .GetMembers (name) - .OfType () - .FirstOrDefault (); - } - - public INamedTypeSymbol GetClass () - { - return GetClass (true); - } - - public INamedTypeSymbol GetClass (bool getUserClass) - { - if (targetObject == null) - return null; - - var cls = gproject.FindClass (className, getUserClass); - if (cls != null) - return cls; - - // The class name may have changed. Try to guess the new name. -// TODO (roslyn port) - is that really required ? -// var matches = new List (); -// ParsedDocument unit = null; -// var ctx = gproject.GetParserContext (); -// var doc = TypeSystemService.ParseFile (project, classFile); -// if (doc != null) { -// unit = doc; -// foreach (var fcls in unit.TopLevelTypeDefinitions) { -// if (IsValidClass (fcls, targetObject)) -// matches.Add (fcls); -// } -// } -// -// // If found the class, just return it -// if (matches.Count == 1) { -// cls = matches [0]; -// className = cls.GetFullName (); -// targetObject.Name = className; -// gproject.SaveWindow (true, targetObject.Name); -// return cls; -// } -// -// // If not found, warn the user. -// -// if (unit != null && unit.TopLevelTypeDefinitions.Count > 0) { -// using (var dialog = new SelectRenamedClassDialog (unit.TopLevelTypeDefinitions.Select (c => c.Resolve (project)))) { -// if (dialog.Run ()) { -// className = dialog.SelectedClass; -// if (className == null) -// return null; -// else { -// targetObject.Name = className; -// gproject.SaveWindow (true, targetObject.Name); -// return gproject.FindClass (className); -// } -// } -// } -// } else { -// MessageService.ShowError (GettextCatalog.GetString ("The class bound to the component '{0}' could not be found. This may be due to syntax errors in the source code file.", GetObjectName(targetObject))); -// } - - return null; - } - - static bool IsValidClass (ITypeSymbol cls, Stetic.Component obj) - { - if (cls.BaseType.SpecialType == SpecialType.System_Object) - return false; - string typeName = obj.Type.ClassName; - - if (cls.BaseType.GetFullName () == typeName) - return true; - return IsValidClass (cls.BaseType, obj); - } - - internal static string GetClassName (Stetic.Component obj) - { - return GetObjectName (obj); - } - - internal static string GetMemberName (Stetic.Component obj) - { - return obj.Name; - } - - internal static string GetObjectName (Stetic.Component obj) - { - return obj.Name; - } - - internal static string GetClassName (Stetic.ProjectItemInfo obj) - { - return GetObjectName (obj); - } - - internal static string GetObjectName (Stetic.ProjectItemInfo obj) - { - return obj.Name; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs deleted file mode 100644 index eb93b3efe01..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs +++ /dev/null @@ -1,292 +0,0 @@ -// -// CombinedDesignView.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System; -using System.Linq; -using Gtk; -using MonoDevelop.Components; -using MonoDevelop.Core; -using MonoDevelop.Ide.Gui.Content; -using MonoDevelop.Ide.Gui; -using MonoDevelop.Components.Commands; -using MonoDevelop.Ide; -using System.Collections.Generic; -using MonoDevelop.Ide.Editor; -using System.Threading.Tasks; - -namespace MonoDevelop.GtkCore.GuiBuilder -{ - public class CombinedDesignView : ViewContent - { - ViewContent content; - Gtk.Widget control; - List tabs = new List (); - - public CombinedDesignView (ViewContent content) - { - this.content = content; - /* This code causes that chagnes in a version control view always select the source code view. - if (content is IEditableTextBuffer) { - ((IEditableTextBuffer)content).CaretPositionSet += delegate { - ShowPage (0); - }; - }*/ - content.DirtyChanged += new EventHandler (OnTextDirtyChanged); - - CommandRouterContainer crc = new CommandRouterContainer (content.Control, content, true); - crc.Show (); - control = crc; - - IdeApp.Workbench.ActiveDocumentChanged += new EventHandler (OnActiveDocumentChanged); - } - - public virtual Stetic.Designer Designer { - get { return null; } - } - - public override string TabPageLabel { - get { - return GettextCatalog.GetString ("Source"); - } - } - - protected void AddButton (string label, Gtk.Widget page) - { - TabView view = new TabView (label, page); - tabs.Add (view); - if (WorkbenchWindow != null) { - view.WorkbenchWindow = WorkbenchWindow; - WorkbenchWindow.AttachViewContent (view); - } - } - - public bool HasPage (Gtk.Widget page) - { - return tabs.Any (p => p.Control.GetNativeWidget () == page); - } - - public void RemoveButton (Gtk.Widget page) - { -/* int i = notebook.PageNum (page); - if (i != -1) - RemoveButton (i);*/ - } - - public void RemoveButton (int npage) - { -/* if (npage >= toolbar.Children.Length) - return; - notebook.RemovePage (npage); - Gtk.Widget cw = toolbar.Children [npage]; - toolbar.Remove (cw); - cw.Destroy (); - ShowPage (0);*/ - } - - protected override void OnSetProject (Projects.Project project) - { - base.OnSetProject (project); - content.Project = project; - } - - public override ProjectReloadCapability ProjectReloadCapability { - get { - return content.ProjectReloadCapability; - } - } - - protected override void OnWorkbenchWindowChanged () - { - base.OnWorkbenchWindowChanged (); - if (content != null) - content.WorkbenchWindow = WorkbenchWindow; - if (WorkbenchWindow != null) { - foreach (TabView view in tabs) { - view.WorkbenchWindow = WorkbenchWindow; - WorkbenchWindow.AttachViewContent (view); - } - WorkbenchWindow.ActiveViewContentChanged += OnActiveViewContentChanged; - } - } - - void OnActiveViewContentChanged (object o, ActiveViewContentEventArgs e) - { - if (WorkbenchWindow.ActiveViewContent == this) - OnPageShown (0); - else { - TabView tab = WorkbenchWindow.ActiveViewContent as TabView; - if (tab != null) { - int n = tabs.IndexOf (tab); - if (n != -1) - OnPageShown (n + 1); - } - } - } - - public void ShowPage (int npage) - { - if (WorkbenchWindow != null) { - if (npage == 0) - WorkbenchWindow.SwitchView (0); - else { - var view = tabs [npage - 1]; - WorkbenchWindow.SwitchView (view); - } - } - } - - protected virtual void OnPageShown (int npage) - { - } - - public override void Dispose () - { - if (content == null) - return; - - content.DirtyChanged -= new EventHandler (OnTextDirtyChanged); - IdeApp.Workbench.ActiveDocumentChanged -= new EventHandler (OnActiveDocumentChanged); - content.Dispose (); - - content = null; - control = null; - - base.Dispose (); - } - - public override Task Load (FileOpenInformation fileOpenInformation) - { - ContentName = fileOpenInformation.FileName; - return content.Load (ContentName); - } - - public override Control Control { - get { return control; } - } - - public override Task Save (FileSaveInformation fileSaveInformation) - { - return content.Save (fileSaveInformation); - } - - public override bool IsDirty { - get { - return content.IsDirty; - } - set { - content.IsDirty = value; - } - } - - public override bool IsReadOnly - { - get { - return content.IsReadOnly; - } - } - - public virtual void AddCurrentWidgetToClass () - { - } - - public virtual void JumpToSignalHandler (Stetic.Signal signal) - { - } - - void OnTextDirtyChanged (object s, EventArgs args) - { - OnDirtyChanged (); - } - - void OnActiveDocumentChanged (object s, EventArgs args) - { - if (IdeApp.Workbench.ActiveDocument != null && IdeApp.Workbench.ActiveDocument.GetContent() == this) - OnDocumentActivated (); - } - - protected virtual void OnDocumentActivated () - { - } - - protected override object OnGetContent (Type type) - { -// if (type == typeof(IEditableTextBuffer)) { -// // Intercept the IPositionable interface, since we need to -// // switch to the text editor when jumping to a line -// if (content.GetContent (type) != null) -// return this; -// else -// return null; -// } -// - return base.OnGetContent (type) ?? (content !=null ? content.GetContent (type) : null); - } - - public void JumpTo (int line, int column) - { - var ip = (TextEditor) content.GetContent (typeof(TextEditor)); - if (ip != null) { - ShowPage (0); - ip.SetCaretLocation (line, column); - } - } - } - - class TabView: BaseViewContent - { - string label; - Gtk.Widget content; - - public TabView (string label, Gtk.Widget content) - { - this.label = label; - this.content = content; - } - - protected override object OnGetContent (Type type) - { - if (type.IsInstanceOfType (content)) - return content; - return base.OnGetContent (type); - } - - public override Control Control { - get { - return content; - } - } - - public override string TabPageLabel { - get { - return label; - } - } - } -} - diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs deleted file mode 100644 index 04e2b66bd2d..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs +++ /dev/null @@ -1,98 +0,0 @@ - -using System; -using System.Threading; -using MonoDevelop.Core; -using MonoDevelop.Projects; -using MonoDevelop.Core.Serialization; -using MonoDevelop.Ide; -using System.Threading.Tasks; - -namespace MonoDevelop.GtkCore.GuiBuilder -{ - public class GtkProjectServiceExtension: DotNetProjectExtension - { - [ItemProperty ("GtkDesignInfo", IsExternal = true, SkipEmpty = true)] - GtkDesignInfo info; - - protected override bool SupportsObject (WorkspaceObject item) - { - return base.SupportsObject (item) && IdeApp.IsInitialized; - } - - protected override void OnReadProject (ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject) - { - base.OnReadProject (monitor, msproject); - if (info != null) - info.Project = Project; - } - - public GtkDesignInfo DesignInfo { - get { - if (info == null) - info = new GtkDesignInfo (Project); - return info; - } - set { - info = value; - } - } - - protected async override Task OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext) - { - if (Project.References.Count == 0 || !GtkDesignInfo.HasDesignedObjects (Project)) - return await base.OnBuild (monitor, configuration, operationContext); - - Generator gen = new Generator (); - if (!await gen.Run (monitor, Project, configuration)) { - BuildResult gr = new BuildResult (); - foreach (string s in gen.Messages) - gr.AddError (DesignInfo.GuiBuilderProject.File, 0, 0, null, s); - return gr; - } - - BuildResult res = await base.OnBuild (monitor, configuration, operationContext); - - if (gen.Messages != null) { - foreach (string s in gen.Messages) - res.AddWarning (DesignInfo.GuiBuilderProject.File, 0, 0, null, s); - - if (gen.Messages.Length > 0) - DesignInfo.ForceCodeGenerationOnBuild (); - } - - if (res.Failed && !Platform.IsWindows && !Platform.IsMac) { - // Some gtk# packages don't include the .pc file unless you install gtk-sharp-devel - if (Project.AssemblyContext.GetPackage ("gtk-sharp-2.0") == null) { - string msg = GettextCatalog.GetString ( - "ERROR: MonoDevelop could not find the Gtk# 2.0 development package. " + - "Compilation of projects depending on Gtk# libraries will fail. " + - "You may need to install development packages for gtk-sharp-2.0."); - monitor.Log.WriteLine (); - monitor.Log.WriteLine (BrandingService.BrandApplicationName (msg)); - } - } - - return res; - } - } - - class Generator - { - public async Task Run (ProgressMonitor monitor, DotNetProject project, ConfigurationSelector configuration) - { - try { - Stetic.CodeGenerationResult res = await GuiBuilderService.GenerateSteticCode (monitor, project, configuration); - if (res != null) - Messages = res.Warnings; - return true; - } catch (Exception ex) { - Error = ex; - LoggingService.LogError (ex.ToString ()); - Messages = new [] { Error.Message }; - return false; - } - } - public string[] Messages; - public Exception Error; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs deleted file mode 100644 index 1a4ff83c4ca..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs +++ /dev/null @@ -1,118 +0,0 @@ -// -// GuiBuilderDisplayBinding.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using MonoDevelop.Ide.Gui; -using MonoDevelop.Projects; -using MonoDevelop.Ide; -using MonoDevelop.Ide.TypeSystem; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using System.Linq; -using Microsoft.CodeAnalysis.CSharp; -using System; -using ICSharpCode.NRefactory6.CSharp; - - -namespace MonoDevelop.GtkCore.GuiBuilder -{ - public class GuiBuilderDisplayBinding : IViewDisplayBinding - { - bool excludeThis = false; - - public string Name { - get { return MonoDevelop.Core.GettextCatalog.GetString ("Window Designer"); } - } - - public bool CanUseAsDefault { - get { return true; } - } - - public bool CanHandle (MonoDevelop.Core.FilePath fileName, string mimeType, Project ownerProject) - { - if (excludeThis) - return false; - - if (fileName.IsNullOrEmpty) - return false; - - if (GetWindow (fileName, ownerProject) == null) - return false; - - excludeThis = true; - var db = DisplayBindingService.GetDefaultViewBinding (fileName, mimeType, ownerProject); - excludeThis = false; - return db != null; - } - - public ViewContent CreateContent (MonoDevelop.Core.FilePath fileName, string mimeType, Project ownerProject) - { - excludeThis = true; - var db = DisplayBindingService.GetDefaultViewBinding (fileName, mimeType, ownerProject); - var content = db.CreateContent (fileName, mimeType, ownerProject); - content.Binding = db; - var window = GetWindow (fileName, ownerProject); - if (window == null) - throw new InvalidOperationException ("GetWindow == null"); - GuiBuilderView view = new GuiBuilderView (content, window); - excludeThis = false; - return view; - } - - internal static GuiBuilderWindow GetWindow (string file, Project project) - { - if (!IdeApp.Workspace.IsOpen) - return null; - if (!GtkDesignInfo.HasDesignedObjects (project)) - return null; - GtkDesignInfo info = GtkDesignInfo.FromProject (project); - if (file.StartsWith (info.GtkGuiFolder)) - return null; - var docId = TypeSystemService.GetDocumentId (project, file); - if (docId == null) - return null; - var doc = TypeSystemService.GetCodeAnalysisDocument (docId); - if (doc == null) - return null; - Microsoft.CodeAnalysis.SemanticModel semanticModel; - try { - semanticModel = doc.GetSemanticModelAsync ().Result; - } catch { - return null; - } - if (semanticModel == null) - return null; - var root = semanticModel.SyntaxTree.GetRoot (); - foreach (var classDeclaration in root.DescendantNodesAndSelf (child => !(child is BaseTypeDeclarationSyntax)).OfType ()) { - var c = semanticModel.GetDeclaredSymbol (classDeclaration); - GuiBuilderWindow win = info.GuiBuilderProject.GetWindowForClass (c.ToDisplayString (Microsoft.CodeAnalysis.SymbolDisplayFormat.CSharpErrorMessageFormat)); - if (win != null) - return win; - } - return null; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDocumentOutline.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDocumentOutline.cs deleted file mode 100644 index 8cbf2677bb7..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDocumentOutline.cs +++ /dev/null @@ -1,104 +0,0 @@ -// -// GuiBuilderProjectPad.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System; -using Gtk; -using MonoDevelop.Ide.Gui; -using MonoDevelop.Ide.Commands; -using MonoDevelop.Components.Commands; -using MonoDevelop.DesignerSupport; - -namespace MonoDevelop.GtkCore.GuiBuilder -{ - internal class GuiBuilderDocumentOutline: Alignment, ICustomPropertyPadProvider - { - static GuiBuilderDocumentOutline instance; - - GuiBuilderDocumentOutline () : base (0, 0, 1, 1) - { - BorderWidth = 0; - GuiBuilderService.SteticApp.WidgetTreeWidget.BorderWidth = 0; - Add (GuiBuilderService.SteticApp.WidgetTreeWidget); - ShowAll (); - } - - internal static GuiBuilderDocumentOutline Instance { - get { - if (instance == null) - instance = new GuiBuilderDocumentOutline (); - return instance; - } - } - - Gtk.Widget ICustomPropertyPadProvider.GetCustomPropertyWidget () - { - return PropertiesWidget.Instance; - } - - void ICustomPropertyPadProvider.DisposeCustomPropertyWidget () - { - } - - [CommandHandler (EditCommands.Undo)] - protected void OnUndo () - { -// GuiBuilderService.App.CommandUndo (); - } - - [CommandHandler (EditCommands.Redo)] - protected void OnRedo () - { -// GuiBuilderService.App.CommandRedo (); - } - - [CommandHandler (EditCommands.Copy)] - protected void OnCopy () - { -// GuiBuilderService.App.CommandCopy (); - } - - [CommandHandler (EditCommands.Cut)] - protected void OnCut () - { -// GuiBuilderService.App.CommandCut (); - } - - [CommandHandler (EditCommands.Paste)] - protected void OnPaste () - { -// GuiBuilderService.App.CommandPaste (); - } - - [CommandHandler (EditCommands.Delete)] - protected void OnDelete () - { -// GuiBuilderService.App.CommandDelete (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs deleted file mode 100644 index a5be678483d..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs +++ /dev/null @@ -1,690 +0,0 @@ -// -// GuiBuilderProject.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Xml; -using System.IO; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.CodeDom.Compiler; - -using MonoDevelop.Core; -using MonoDevelop.Projects; -using MonoDevelop.Ide; -using MonoDevelop.Ide.TypeSystem; -using System.Linq; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp.Syntax; - -namespace MonoDevelop.GtkCore.GuiBuilder -{ - public class GuiBuilderProject - { - internal object MemoryProbe = Counters.GuiProjectsInMemory.CreateMemoryProbe (); - - List formInfos; - Stetic.Project gproject; - DotNetProject project; - string fileName; - bool hasError; - bool needsUpdate = true; - - FileSystemWatcher watcher; - DateTime lastSaveTime; - object fileSaveLock = new object (); - bool disposed; - bool librariesUpdated; - - public event WindowEventHandler WindowAdded; - public event WindowEventHandler WindowRemoved; - public event EventHandler Reloaded; - public event EventHandler Unloaded; - public event EventHandler Changed; - - public GuiBuilderProject (DotNetProject project, string fileName) - { - this.fileName = fileName; - this.project = project; - Counters.GuiProjectsLoaded++; - GuiBuilderService.NotifyGuiProjectLoaded (); - } - - void Load () - { - if (gproject != null || disposed || fileName == null) - return; - - gproject = GuiBuilderService.SteticApp.CreateProject (); - formInfos = new List (); - - if (!System.IO.File.Exists (fileName)) { - // Regenerate the gtk-gui folder if the stetic project - // doesn't exist. - GtkDesignInfo.FromProject (project).UpdateGtkFolder (); - } - - try { - gproject.Load (fileName); - } catch (Exception ex) { - MessageService.ShowError (GettextCatalog.GetString ("The GUI designer project file '{0}' could not be loaded.", fileName), ex); - hasError = true; - } - - Counters.SteticProjectsLoaded++; - gproject.ResourceProvider = GtkDesignInfo.FromProject (project).ResourceProvider; - gproject.WidgetAdded += OnAddWidget; - gproject.WidgetRemoved += OnRemoveWidget; - gproject.ActionGroupsChanged += OnGroupsChanged; - project.FileAddedToProject += OnFileAdded; - project.FileRemovedFromProject += OnFileRemoved; - project.ReferenceAddedToProject += OnReferenceAdded; - project.ReferenceRemovedFromProject += OnReferenceRemoved; - - foreach (Stetic.WidgetInfo ob in gproject.Widgets) - RegisterWindow (ob, false); - - // Monitor changes in the file - lastSaveTime = System.IO.File.GetLastWriteTime (fileName); - watcher = new FileSystemWatcher (); - if (System.IO.File.Exists (fileName)) { - watcher.Path = Path.GetDirectoryName (fileName); - watcher.Filter = Path.GetFileName (fileName); - watcher.Changed += OnSteticFileChanged; - watcher.EnableRaisingEvents = true; - } - } - - void Unload () - { - if (gproject == null) - return; - - Counters.SteticProjectsLoaded--; - - if (Unloaded != null) - Unloaded (this, EventArgs.Empty); - if (formInfos != null) { - foreach (GuiBuilderWindow win in formInfos) - win.Dispose (); - formInfos = null; - } - if (gproject != null) { - gproject.WidgetAdded -= OnAddWidget; - gproject.WidgetRemoved -= OnRemoveWidget; - gproject.ActionGroupsChanged -= OnGroupsChanged; - gproject.Dispose (); - gproject = null; - } - if (project != null) { - project.FileAddedToProject -= OnFileAdded; - project.FileRemovedFromProject -= OnFileRemoved; - project.ReferenceAddedToProject -= OnReferenceAdded; - project.ReferenceRemovedFromProject -= OnReferenceRemoved; - } - needsUpdate = true; - hasError = false; - librariesUpdated = false; - if (watcher != null) { - watcher.Dispose (); - watcher = null; - } - NotifyChanged (); - } - - void OnSteticFileChanged (object s, FileSystemEventArgs args) - { - Runtime.RunInMainThread (() => { - lock (fileSaveLock) { - if (lastSaveTime == System.IO.File.GetLastWriteTime (fileName)) - return; - } - - if (GuiBuilderService.HasOpenDesigners (project, true)) { - if (MessageService.AskQuestion (GettextCatalog.GetString ("The project '{0}' has been modified by an external application. Do you want to reload it?", project.Name), GettextCatalog.GetString ("Unsaved changes in the open GTK designers will be lost."), AlertButton.Cancel, AlertButton.Reload) != AlertButton.Reload) - return; - } - if (!disposed) - Reload (); - }); - } - - public void Reload () - { - if (disposed) - return; - Unload (); - if (Reloaded != null) - Reloaded (this, EventArgs.Empty); - NotifyChanged (); - } - - public bool HasError { - get { return hasError; } - } - - public bool IsEmpty { - get { - // If the project is not loaded, assume not empty - return gproject != null && Windows != null && Windows.Count == 0; - } - } - - public void SaveAll (bool saveMdProject) - { - if (gproject != null) - gproject.SetAllWidgetsModified (); - SaveProject (saveMdProject); - } - - public void SaveWindow (bool saveMdProject, string modifiedWindow) - { - if (gproject != null) - gproject.SetWidgetModified (modifiedWindow); - SaveProject (saveMdProject); - } - - public void SaveProject (bool saveMdProject) - { - if (disposed) - return; - - if (gproject != null && !hasError) { - lock (fileSaveLock) { - gproject.Save (fileName); - lastSaveTime = System.IO.File.GetLastWriteTime (fileName); - } - } - - if (GtkDesignInfo.FromProject (project).UpdateGtkFolder () && saveMdProject) - IdeApp.ProjectOperations.SaveAsync (project); - } - - public string File { - get { return fileName; } - } - - public Stetic.Project SteticProject { - get { - Load (); - return gproject; - } - } - - public ICollection Windows { - get { - Load (); - return formInfos; - } - } - - public DotNetProject Project { - get { return project; } - } - - public void Dispose () - { - if (disposed) - return; - GuiBuilderService.NotifyGuiProjectUnloaded (); - Counters.GuiProjectsLoaded--; - disposed = true; - if (watcher != null) - watcher.Dispose (); - Unload (); - } - - public Stetic.WidgetInfo AddNewComponent (Stetic.ComponentType type, string name) - { - Stetic.WidgetInfo c = SteticProject.AddNewComponent (type, name); - RegisterWindow (c, true); - return c; - } - - public Stetic.WidgetInfo AddNewComponent (XmlElement element) - { - Stetic.WidgetInfo c = SteticProject.AddNewComponent (element); - // Register the window now, don't wait for the WidgetAdded event since - // it may take some time, and the GuiBuilderWindow object is needed - // just after this call - RegisterWindow (c, true); - return c; - } - - void RegisterWindow (Stetic.WidgetInfo widget, bool notify) - { - if (formInfos != null) { - foreach (GuiBuilderWindow w in formInfos) - if (w.RootWidget == widget) - return; - - GuiBuilderWindow win = new GuiBuilderWindow (this, gproject, widget); - formInfos.Add (win); - - if (notify) { - if (WindowAdded != null) - WindowAdded (this, new WindowEventArgs (win)); - NotifyChanged (); - } - } - } - - void UnregisterWindow (GuiBuilderWindow win) - { - if (!formInfos.Contains (win)) - return; - - formInfos.Remove (win); - - if (WindowRemoved != null) - WindowRemoved (this, new WindowEventArgs (win)); - - win.Dispose (); - NotifyChanged (); - } - - public void Remove (GuiBuilderWindow win) - { - gproject.RemoveComponent (win.RootWidget); - UnregisterWindow (win); - } - - public void RemoveActionGroup (Stetic.ActionGroupInfo group) - { - gproject.RemoveActionGroup (group); - } - - void OnAddWidget (object s, Stetic.WidgetInfoEventArgs args) - { - if (!disposed) - RegisterWindow (args.WidgetInfo, true); - } - - void OnRemoveWidget (object s, Stetic.WidgetInfoEventArgs args) - { - if (disposed || Windows == null) - return; - foreach (GuiBuilderWindow form in Windows) { - if (form.RootWidget.Name == args.WidgetInfo.Name) { - UnregisterWindow (form); - break; - } - } - } - - void OnFileAdded (object sender, ProjectFileEventArgs e) - { - foreach (ProjectFileEventInfo args in e) { - var docId = TypeSystemService.GetDocumentId (args.Project, args.ProjectFile.Name); - if (docId == null) - continue; - var doc = TypeSystemService.GetCodeAnalysisDocument (docId); - if (doc == null) - continue; - - string dir = Path.Combine (Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "stetic"), "deleted-designs"); - if (!Directory.Exists (dir) || !Directory.EnumerateFiles (dir).Any ()) - continue; - var semanticModel = doc.GetSemanticModelAsync ().Result; - if (semanticModel == null) - continue; - - foreach (var classDeclaration in semanticModel.SyntaxTree.GetRoot ().DescendantNodesAndSelf (child => !(child is BaseTypeDeclarationSyntax)).OfType ()) { - var c = semanticModel.GetDeclaredSymbol (classDeclaration); - string path = Path.Combine (dir, c.ToDisplayString (Microsoft.CodeAnalysis.SymbolDisplayFormat.CSharpErrorMessageFormat) + ".xml"); - if (!System.IO.File.Exists (path)) - continue; - XmlDocument xmldoc = new XmlDocument (); - xmldoc.Load (path); - AddNewComponent (xmldoc.DocumentElement); - System.IO.File.Delete (path); - } - } - } - - void OnFileRemoved (object sender, ProjectFileEventArgs e) - { - ArrayList toDelete = new ArrayList (); - - foreach (ProjectFileEventInfo args in e) { - - var docId = TypeSystemService.GetDocumentId (args.Project, args.ProjectFile.Name); - if (docId == null) - continue; - var doc = TypeSystemService.GetCodeAnalysisDocument (docId); - if (doc == null) - continue; - var semanticModel = doc.GetSemanticModelAsync ().Result; - if (semanticModel == null) - continue; - - - foreach (var classDeclaration in semanticModel.SyntaxTree.GetRoot ().DescendantNodesAndSelf (child => !(child is BaseTypeDeclarationSyntax)).OfType ()) { - var c = semanticModel.GetDeclaredSymbol (classDeclaration); - GuiBuilderWindow win = GetWindowForClass (c.ToDisplayString (Microsoft.CodeAnalysis.SymbolDisplayFormat.MinimallyQualifiedFormat)); - if (win != null) - toDelete.Add (win); - } - } - - foreach (GuiBuilderWindow win in toDelete) - Remove (win); - } - - void OnGroupsChanged (object s, EventArgs a) - { - if (!disposed) - NotifyChanged (); - } - - void OnReferenceAdded (object ob, ProjectReferenceEventArgs args) - { - if (disposed || !librariesUpdated) - return; - string pref = GetReferenceLibraryPath (args.ProjectReference); - if (pref != null) { - gproject.AddWidgetLibrary (pref); - SaveProject (false); - } - } - - void OnReferenceRemoved (object ob, ProjectReferenceEventArgs args) - { - if (disposed || !librariesUpdated) - return; - string pref = GetReferenceLibraryPath (args.ProjectReference); - if (pref != null) { - gproject.RemoveWidgetLibrary (pref); - SaveProject (false); - } - } - - string GetReferenceLibraryPath (MonoDevelop.Projects.ProjectReference pref) - { - string path = null; - - if (pref.ReferenceType == ReferenceType.Project) { - DotNetProject p = pref.ResolveProject (project.ParentSolution) as DotNetProject; - if (p != null) - path = p.GetOutputFileName (IdeApp.Workspace.ActiveConfiguration); - } else if (pref.ReferenceType == ReferenceType.Assembly) { - path = pref.HintPath; - } else if (pref.ReferenceType == ReferenceType.Package) { - path = pref.Reference; - } - if (path != null && GuiBuilderService.SteticApp.IsWidgetLibrary (path)) - return path; - else - return null; - } - - public void ImportGladeFile () - { - var dlg = new MonoDevelop.Components.SelectFileDialog (GettextCatalog.GetString ("Open Glade File")); - dlg.AddFilter (GettextCatalog.GetString ("Glade files"), "*.glade"); - dlg.AddAllFilesFilter (); - if (dlg.Run ()) { - SteticProject.ImportGlade (dlg.SelectedFile); - SaveAll (true); - } - } - - public GuiBuilderWindow GetWindowForClass (string className) - { - if (Windows != null) { - foreach (GuiBuilderWindow form in Windows) { - if (CodeBinder.GetObjectName (form.RootWidget) == className) - return form; - } - } - return null; - } - - public GuiBuilderWindow GetWindowForFile (FilePath fileName) - { - if (Windows != null) { - foreach (GuiBuilderWindow win in Windows) { - if (fileName == win.SourceCodeFile) - return win; - } - } - return null; - } - - public GuiBuilderWindow GetWindow (string name) - { - if (Windows != null) { - foreach (GuiBuilderWindow win in Windows) { - if (name == win.Name) - return win; - } - } - return null; - } - - public Stetic.ActionGroupInfo GetActionGroupForFile (FilePath fileName) - { - foreach (Stetic.ActionGroupInfo group in SteticProject.ActionGroups) { - if (fileName == GetSourceCodeFile (group, true)) - return group; - } - return null; - } - - public Stetic.ActionGroupInfo GetActionGroup (string name) - { - return SteticProject.GetActionGroup (name); - } - - public FilePath GetSourceCodeFile (Stetic.ProjectItemInfo obj) - { - return GetSourceCodeFile (obj, true); - } - - public FilePath GetSourceCodeFile (Stetic.ProjectItemInfo obj, bool getUserClass) - { - var cls = GetClass (obj, getUserClass); - if (cls != null) - return cls.Locations.First ().SourceTree.FilePath; - return null; - } - - INamedTypeSymbol GetClass (Stetic.ProjectItemInfo obj, bool getUserClass) - { - string name = CodeBinder.GetClassName (obj); - return FindClass (name, getUserClass); - } - - public INamedTypeSymbol FindClass (string className) - { - return FindClass (className, true); - } - - public INamedTypeSymbol FindClass (string className, bool getUserClass) - { - FilePath gui_folder = GtkDesignInfo.FromProject (project).GtkGuiFolder; - var ctx = GetParserContext (); - if (ctx == null) - return null; - foreach (var cls in ctx.GetAllTypesInMainAssembly ()) { - if (cls.GetFullName() == className) { - if (getUserClass) { - // Return this class only if it is declared outside the gtk-gui - // folder. Generated partial classes will be ignored. - foreach (var part in cls.Locations) { - var filePath = part.SourceTree.FilePath; - if (!string.IsNullOrEmpty (filePath) && !((FilePath)filePath).IsChildPathOf (gui_folder)) { - return cls; - } - } - continue; - } - return cls; - } - } - return null; - } - - public Compilation GetParserContext () - { - System.Threading.Tasks.Task task; - do { - task = TypeSystemService.GetCompilationAsync (Project); - task.Wait (500); - } while (!task.IsCompleted); - - var dom = task.Result; - if (dom != null && needsUpdate) { - needsUpdate = false; - } - return dom; - } - - public WidgetParser WidgetParser { - get { - return new WidgetParser (GetParserContext ()); - } - } - - public void UpdateLibraries () - { - if (hasError || disposed || gproject == null) - return; - - bool needsSave = false; - librariesUpdated = true; - - string[] oldLibs = gproject.WidgetLibraries; - - ArrayList libs = new ArrayList (); - string[] internalLibs; - - foreach (var pref in project.References) { - string wref = GetReferenceLibraryPath (pref); - if (wref != null) - libs.Add (wref); - } - - ReferenceManager refmgr = new ReferenceManager (project); - string target_version = refmgr.TargetGtkVersion; - refmgr.Dispose (); - - // Make sure the target gtk version is properly set - if (gproject.TargetGtkVersion != target_version) { - gproject.TargetGtkVersion = target_version; - needsSave = true; - } - - string outLib = project.GetOutputFileName (IdeApp.Workspace.ActiveConfiguration); - if (!string.IsNullOrEmpty (outLib)) - internalLibs = new string [] { outLib }; - else - internalLibs = new string [0]; - - string[] newLibs = (string[]) libs.ToArray (typeof(string)); - - // See if something has changed - if (LibrariesChanged (oldLibs, internalLibs, newLibs)) { - gproject.SetWidgetLibraries (newLibs, internalLibs); - needsSave = true; - } else { - GuiBuilderService.SteticApp.UpdateWidgetLibraries (false); - } - - if (needsSave) - SaveAll (true); - } - - bool LibrariesChanged (string[] oldLibs, string[] internalLibs, string[] newLibs) - { - if (oldLibs.Length == newLibs.Length + internalLibs.Length) { - foreach (string s in newLibs) { - if (!((IList)oldLibs).Contains (s)) - return true; - } - foreach (string s in internalLibs) { - if (!((IList)oldLibs).Contains (s)) - return true; - } - return false; - } else - return true; - } - - void NotifyChanged () - { - if (Changed != null && !disposed) - Changed (this, EventArgs.Empty); - } - - public StringCollection GenerateFiles (string guiFolder) - { - StringCollection files = new StringCollection (); - - if (hasError) - return files; - - var binding = LanguageBindingService.GetBindingPerLanguageName (project.LanguageName); - string path = Path.Combine (guiFolder, binding.GetFileName ("generated")); - if (!System.IO.File.Exists (path)) { - // Generate an empty build class - CodeDomProvider provider = binding.GetCodeDomProvider (); - if (provider == null) - throw new UserException ("Code generation not supported for language: " + project.LanguageName); - GuiBuilderService.SteticApp.GenerateProjectCode (path, "Stetic", provider, null); - } - files.Add (path); - - if (Windows != null) { - foreach (GuiBuilderWindow win in Windows) - files.Add (GuiBuilderService.GenerateSteticCodeStructure (project, win.RootWidget, true, false)); - } - - foreach (Stetic.ActionGroupInfo ag in SteticProject.ActionGroups) - files.Add (GuiBuilderService.GenerateSteticCodeStructure (project, ag, true, false)); - - return files; - } - } - - public delegate void WindowEventHandler (object s, WindowEventArgs args); - - public class WindowEventArgs: EventArgs - { - GuiBuilderWindow win; - - public WindowEventArgs (GuiBuilderWindow win) - { - this.win = win; - } - - public GuiBuilderWindow Window { - get { return win; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs deleted file mode 100644 index bb545fe25db..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs +++ /dev/null @@ -1,660 +0,0 @@ -// -// GuiBuilderService.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.IO; -using System.Collections; -using System.CodeDom; -using System.CodeDom.Compiler; - -using MonoDevelop.Ide.Gui; -using MonoDevelop.Projects; -using MonoDevelop.Projects.Text; -using MonoDevelop.Core; -using MonoDevelop.Core.Execution; -using MonoDevelop.Deployment; -using MonoDevelop.Projects.Policies; -using MonoDevelop.Ide; -using MonoDevelop.Ide.Gui.Content; -using MonoDevelop.Ide.TypeSystem; -using System.Threading.Tasks; -using MonoDevelop.Ide.Editor; - - -namespace MonoDevelop.GtkCore.GuiBuilder -{ - class GuiBuilderService - { - static string GuiBuilderLayout = "Visual Design"; - static int loadedGuiProjects; - -#if DUMMY_STRINGS_FOR_TRANSLATION_DO_NOT_COMPILE - private void DoNotCompile () - { - //The default GUI Builder layout, translated indirectly because it's used as an ID - GettextCatalog.GetString ("GUI Builder"); - } -#endif - - static string defaultLayout; - - static Stetic.Application steticApp; - - static bool generating; - - static Stetic.IsolationMode IsolationMode = Stetic.IsolationMode.None; -// static Stetic.IsolationMode IsolationMode = Stetic.IsolationMode.ProcessUnix; - - static GuiBuilderService () - { - if (IdeApp.Workbench == null) - return; -// IdeApp.Workspace.ParserDatabase.AssemblyInformationChanged += (AssemblyInformationEventHandler) DispatchService.GuiDispatch (new AssemblyInformationEventHandler (OnAssemblyInfoChanged)); - - IdeApp.Exited += delegate { - if (steticApp != null) { - StoreConfiguration (); - steticApp.Dispose (); - } - }; - } - - static void InitializeService () - { - if (IdeApp.IsInitialized) { - IdeApp.ProjectOperations.EndBuild += OnProjectCompiled; - IdeApp.Workbench.ActiveDocumentChanged += OnActiveDocumentChanged; - } - } - - static void ShutdownService () - { - if (IdeApp.IsInitialized) { - IdeApp.ProjectOperations.EndBuild -= OnProjectCompiled; - IdeApp.Workbench.ActiveDocumentChanged -= OnActiveDocumentChanged; - } - if (steticApp != null) { - StoreConfiguration (); - steticApp.Dispose (); - steticApp = null; - } - } - - public static GuiBuilderProject CreateBuilderProject (DotNetProject project, string fileName) - { - return new GuiBuilderProject (project, fileName); - } - - public static Stetic.Application SteticApp { - get { - // Stetic is not thread safe, so all has to be done in the gui thread - Runtime.AssertMainThread (); - if (steticApp == null) { - steticApp = Stetic.ApplicationFactory.CreateApplication (Stetic.IsolationMode.None); - steticApp.AllowInProcLibraries = false; - steticApp.ShowNonContainerWarning = PropertyService.Get ("MonoDevelop.GtkCore.ShowNonContainerWarning", true); - steticApp.MimeResolver = OnMimeResolve; - steticApp.ShowUrl = OnShowUrl; - steticApp.WidgetLibraryResolver = OnAssemblyResolve; - } - return steticApp; - } - } - - internal static void NotifyGuiProjectLoaded () - { - if (++loadedGuiProjects == 1) - InitializeService (); - } - - internal static void NotifyGuiProjectUnloaded () - { - if (--loadedGuiProjects == 0) - ShutdownService (); - } - - static string OnAssemblyResolve (string assemblyName) - { - return Runtime.SystemAssemblyService.DefaultAssemblyContext.GetAssemblyLocation (assemblyName, null); - } - - static string OnMimeResolve (string url) - { - return DesktopService.GetMimeTypeForUri (url); - } - - static void OnShowUrl (string url) - { - DesktopService.ShowUrl (url); - } - - internal static void StoreConfiguration () - { - PropertyService.Set ("MonoDevelop.GtkCore.ShowNonContainerWarning", steticApp.ShowNonContainerWarning); - PropertyService.SaveProperties (); - } - - public static bool AutoSwitchGuiLayout { - get { - return PropertyService.Get ("MonoDevelop.GtkCore.AutoSwitchGuiLayout", false); - } - set { - PropertyService.Set ("MonoDevelop.GtkCore.AutoSwitchGuiLayout", value); - } - } - - public static async Task OpenActionGroup (Project project, Stetic.ActionGroupInfo group) - { - GuiBuilderProject p = GtkDesignInfo.FromProject (project).GuiBuilderProject ; - string file = p != null ? p.GetSourceCodeFile (group) : null; - if (file == null) { - file = ActionGroupDisplayBinding.BindToClass (project, group); - } - - Document doc = await IdeApp.Workbench.OpenDocument (file, null, true); - if (doc != null) { - ActionGroupView view = doc.GetContent (); - if (view != null) { - view.ShowDesignerView (); - return view; - } - } - return null; - } - - static void OnActiveDocumentChanged (object s, EventArgs args) - { - if (IdeApp.Workbench.ActiveDocument == null) { - if (SteticApp.ActiveDesigner != null) { - SteticApp.ActiveDesigner = null; - RestoreLayout (); - } - return; - } - - CombinedDesignView view = IdeApp.Workbench.ActiveDocument.GetContent (); - if (view != null) { - SteticApp.ActiveDesigner = view.Designer; - SetDesignerLayout (); - return; - } - else if (SteticApp.ActiveDesigner != null) { - SteticApp.ActiveDesigner = null; - RestoreLayout (); - } - } - - static void SetDesignerLayout () - { - if (AutoSwitchGuiLayout && IdeApp.Workbench.CurrentLayout != GuiBuilderLayout) { - bool exists = IdeApp.Workbench.Layouts.Contains (GuiBuilderLayout); - defaultLayout = IdeApp.Workbench.CurrentLayout; - IdeApp.Workbench.CurrentLayout = GuiBuilderLayout; - if (!exists) { - Pad p = IdeApp.Workbench.GetPad (); - if (p != null) p.Visible = true; - p = IdeApp.Workbench.GetPad (); - if (p != null) p.Visible = true; - } - } - } - - static void RestoreLayout () - { - if (AutoSwitchGuiLayout && defaultLayout != null) { - IdeApp.Workbench.CurrentLayout = defaultLayout; - defaultLayout = null; - } - } - - static void OnProjectCompiled (object s, BuildEventArgs args) - { - if (args.Success) { - // Unload stetic projects which are not currently - // being used by the IDE. This will avoid unnecessary updates. - if (IdeApp.Workspace.IsOpen) { - foreach (Project prj in IdeApp.Workspace.GetAllProjects ()) { - if (!HasOpenDesigners (prj, false) && GtkDesignInfo.HasDesignedObjects (prj)) { - GtkDesignInfo info = GtkDesignInfo.FromProject (prj); - info.ReloadGuiBuilderProject (); - } - } - } - - SteticApp.UpdateWidgetLibraries (false); - } - } - - internal static bool HasOpenDesigners (Project project, bool modifiedOnly) - { - foreach (Document doc in IdeApp.Workbench.Documents) { - if ((doc.GetContent() != null || doc.GetContent() != null) && doc.Project == project && (!modifiedOnly || doc.IsDirty)) - return true; - } - return false; - } - - //static void OnAssemblyInfoChanged (object s, AssemblyInformationEventArgs args) -// { - //SteticApp.UpdateWidgetLibraries (false); -// } - - internal static void AddCurrentWidgetToClass () - { - if (IdeApp.Workbench.ActiveDocument != null) { - GuiBuilderView view = IdeApp.Workbench.ActiveDocument.GetContent (); - if (view != null) - view.AddCurrentWidgetToClass (); - } - } - - internal static void JumpToSignalHandler (Stetic.Signal signal) - { - if (IdeApp.Workbench.ActiveDocument != null) { - CombinedDesignView view = IdeApp.Workbench.ActiveDocument.GetContent (); - if (view != null) - view.JumpToSignalHandler (signal); - } - } - - public static void ImportGladeFile (Project project) - { - GtkDesignInfo info = GtkDesignInfo.FromProject (project); - info.GuiBuilderProject.ImportGladeFile (); - } - - public static string GetBuildCodeFileName (Project project, string componentName) - { - GtkDesignInfo info = GtkDesignInfo.FromProject (project); - return Path.Combine (info.GtkGuiFolder, componentName + Path.GetExtension (info.SteticGeneratedFile)); - } - - public static string GenerateSteticCodeStructure (DotNetProject project, Stetic.ProjectItemInfo item, bool saveToFile, bool overwrite) - { - return GenerateSteticCodeStructure (project, item, null, null, saveToFile, overwrite); - } - - public static string GenerateSteticCodeStructure (DotNetProject project, Stetic.Component component, Stetic.ComponentNameEventArgs args, bool saveToFile, bool overwrite) - { - return GenerateSteticCodeStructure (project, null, component, args, saveToFile, overwrite); - } - - static string GenerateSteticCodeStructure (DotNetProject project, Stetic.ProjectItemInfo item, Stetic.Component component, Stetic.ComponentNameEventArgs args, bool saveToFile, bool overwrite) - { - // Generate a class which contains fields for all bound widgets of the component - - string name = item != null ? item.Name : component.Name; - string fileName = GetBuildCodeFileName (project, name); - - string ns = ""; - int i = name.LastIndexOf ('.'); - if (i != -1) { - ns = name.Substring (0, i); - name = name.Substring (i + 1); - } - - if (saveToFile && !overwrite && File.Exists (fileName)) - return fileName; - - if (item != null) - component = item.Component; - - CodeCompileUnit cu = new CodeCompileUnit (); - if (project.UsePartialTypes) { - CodeNamespace cns = new CodeNamespace (ns); - cu.Namespaces.Add (cns); - - CodeTypeDeclaration type = new CodeTypeDeclaration (name); - type.IsPartial = true; - type.Attributes = MemberAttributes.Public; - type.TypeAttributes = System.Reflection.TypeAttributes.Public; - cns.Types.Add (type); - type.Members.Add ( - new CodeMemberMethod () { - Name = "Build" - } - ); - - foreach (Stetic.ObjectBindInfo binfo in component.GetObjectBindInfo ()) { - // When a component is being renamed, we have to generate the - // corresponding field using the old name, since it will be renamed - // later using refactory - string nname = args != null && args.NewName == binfo.Name ? args.OldName : binfo.Name; - type.Members.Add ( - new CodeMemberField ( - binfo.TypeName, - nname - ) - ); - } - } else { - if (!saveToFile) - return fileName; - CodeNamespace cns = new CodeNamespace (); - cns.Comments.Add (new CodeCommentStatement ("Generated code for component " + component.Name)); - cu.Namespaces.Add (cns); - } - - CodeDomProvider provider = project.LanguageBinding.GetCodeDomProvider (); - if (provider == null) - throw new UserException ("Code generation not supported for language: " + project.LanguageName); - - string text; - var pol = project.Policies.Get (); - using (var fileStream = new StringWriter ()) { - var options = new CodeGeneratorOptions () { - IndentString = pol.TabsToSpaces? new string (' ', pol.TabWidth) : "\t", - BlankLinesBetweenMembers = true, - }; - provider.GenerateCodeFromCompileUnit (cu, fileStream, options); - text = fileStream.ToString (); - text = FormatGeneratedFile (fileName, text, project, provider); - } - if (saveToFile) - File.WriteAllText (fileName, text); - TypeSystemService.NotifyFileChange (fileName, text); - - return fileName; - } - - - public async static Task GenerateSteticCode (ProgressMonitor monitor, DotNetProject project, ConfigurationSelector configuration) - { - if (generating || !GtkDesignInfo.HasDesignedObjects (project)) - return null; - - using (var timer = Counters.SteticFileGeneratedTimer.BeginTiming ()) { - - timer.Trace ("Checking references"); - GtkDesignInfo info = GtkDesignInfo.FromProject (project); - - DateTime last_gen_time = File.Exists (info.SteticGeneratedFile) ? File.GetLastWriteTime (info.SteticGeneratedFile) : DateTime.MinValue; - - bool ref_changed = false; - - // Disabled check for changes in referenced assemblies, since it cause too much - // regeneration of code. If a component has changed in a referenced project, this - // project may not build, but this can be solved by editing some file in the - // designer and saving. - -/* foreach (ProjectReference pref in project.References) { - if (!pref.IsValid) - continue; - foreach (string filename in pref.GetReferencedFileNames (configuration)) { - if (File.GetLastWriteTime (filename) > last_gen_time) { - ref_changed = true; - break; - } - } - if (ref_changed) - break; - }*/ - - // Check if generated code is already up to date. - if (!ref_changed && last_gen_time >= File.GetLastWriteTime (info.SteticFile)) - return null; - - if (info.GuiBuilderProject.HasError) { - var error = GettextCatalog.GetString ("GUI code generation failed for project '{0}'. The file '{1}' could not be loaded.", project.Name, info.SteticFile); - monitor.ReportError (error, null); - throw new UserException (error); - } - - if (info.GuiBuilderProject.IsEmpty) - return null; - - monitor.Log.WriteLine (GettextCatalog.GetString ("Generating GUI code for project '{0}'...", project.Name)); - - timer.Trace ("Update libraries"); - - info.GuiBuilderProject.UpdateLibraries (); - - ArrayList projects = new ArrayList (); - projects.Add (info.GuiBuilderProject.File); - - generating = true; - Stetic.CodeGenerationResult generationResult = null; - Exception generatedException = null; - - bool canGenerateInProcess = IsolationMode != Stetic.IsolationMode.None || info.GuiBuilderProject.SteticProject.CanGenerateCode; - - if (!canGenerateInProcess) { - timer.Trace ("Generating out of process"); - - await Task.Run (delegate { - try { - // Generate the code in another process if stetic is not isolated - CodeGeneratorProcess cob = (CodeGeneratorProcess)Runtime.ProcessService.CreateExternalProcessObject (typeof(CodeGeneratorProcess), false); - using (cob) { - generationResult = cob.GenerateCode (projects, info.GenerateGettext, info.GettextClass, info.ImageResourceLoaderClass, project.UsePartialTypes); - } - } catch (Exception ex) { - generatedException = ex; - } finally { - generating = false; - } - }); - - } else { - timer.Trace ("Generating in-process"); - // No need to create another process, since stetic has its own backend process - // or the widget libraries have no custom wrappers - try { - Stetic.GenerationOptions options = new Stetic.GenerationOptions (); - options.UseGettext = info.GenerateGettext; - options.GettextClass = info.GettextClass; - options.ImageResourceLoaderClass = info.ImageResourceLoaderClass; - options.UsePartialClasses = project.UsePartialTypes; - options.GenerateSingleFile = false; - options.GenerateModifiedOnly = true; - generationResult = SteticApp.GenerateProjectCode (options, info.GuiBuilderProject.SteticProject); - info.GuiBuilderProject.SteticProject.ResetModifiedWidgetFlags (); - } catch (Exception ex) { - generatedException = ex; - } - generating = false; - } - timer.Trace ("Writing code units"); - - if (generatedException != null) { - LoggingService.LogError ("GUI code generation failed", generatedException); - throw new UserException ("GUI code generation failed: " + generatedException.Message); - } - - if (generationResult == null) - return null; - - CodeDomProvider provider = project.LanguageBinding.GetCodeDomProvider (); - if (provider == null) - throw new UserException ("Code generation not supported for language: " + project.LanguageName); - - string basePath = Path.GetDirectoryName (info.SteticGeneratedFile); - string ext = Path.GetExtension (info.SteticGeneratedFile); - - var pol = project.Policies.Get (); - var codeGeneratorOptions = new CodeGeneratorOptions () { - IndentString = pol.TabsToSpaces? new string (' ', pol.TabWidth) : "\t", - BlankLinesBetweenMembers = true - }; - - foreach (Stetic.SteticCompilationUnit unit in generationResult.Units) { - string fname; - if (unit.Name.Length == 0) - fname = info.SteticGeneratedFile; - else - fname = Path.Combine (basePath, unit.Name) + ext; - StringWriter sw = new StringWriter (); - try { - foreach (CodeNamespace ns in unit.Namespaces) - ns.Comments.Add (new CodeCommentStatement ("This file has been generated by the GUI designer. Do not modify.")); - timer.Trace ("Generating code for " + unit.Name); - provider.GenerateCodeFromCompileUnit (unit, sw, codeGeneratorOptions); - string content = sw.ToString (); - - timer.Trace ("Formatting code"); - content = FormatGeneratedFile (fname, content, project, provider); - timer.Trace ("Writing code"); - File.WriteAllText (fname, content); - } finally { - timer.Trace ("Code written to file"); - } - } - - timer.Trace ("Updating GTK folder"); - - // Make sure the generated files are added to the project - if (info.UpdateGtkFolder ()) { - Gtk.Application.Invoke ((o, args) => { - IdeApp.ProjectOperations.SaveAsync (project); - }); - } - - return generationResult; - } - } - - internal static string ImportFile (Project prj, string file) - { - ProjectFile pfile = prj.Files.GetFile (file); - if (pfile == null) { - var files = IdeApp.ProjectOperations.AddFilesToProject (prj, new string[] { file }, prj.BaseDirectory); - if (files.Count == 0 || files[0] == null) - return null; - pfile = files [0]; - } - if (pfile.BuildAction == BuildAction.EmbeddedResource) { - AlertButton embedButton = new AlertButton (GettextCatalog.GetString ("_Use as Source")); - if (MessageService.AskQuestion (GettextCatalog.GetString ("You are requesting the file '{0}' to be used as source for an image. However, this file is already added to the project as a resource. Are you sure you want to continue (the file will have to be removed from the resource list)?"), AlertButton.Cancel, embedButton) == embedButton) - return null; - } - pfile.BuildAction = BuildAction.Content; - DeployProperties props = DeployService.GetDeployProperties (pfile); - props.UseProjectRelativePath = true; - return pfile.FilePath; - } - - static string FormatGeneratedFile (string file, string content, Project project, CodeDomProvider provider) - { - content = StripHeaderAndBlankLines (content, provider); - - string mt = DesktopService.GetMimeTypeForUri (file); - var formatter = MonoDevelop.Ide.CodeFormatting.CodeFormatterService.GetFormatter (mt); - if (formatter != null) - content = formatter.FormatText (PolicyService.InvariantPolicies, content) ?? content; - - // The project policies should be taken for generated files (windows git eol problem) - var pol = project.Policies.Get (DesktopService.GetMimeTypeForUri (file)); - string eol = pol.GetEolMarker (); - if (Environment.NewLine != eol) - content = content.Replace (Environment.NewLine, eol); - - return content; - } - - static string StripHeaderAndBlankLines (string text, CodeDomProvider provider) - { - var doc = TextEditorFactory.CreateNewDocument (); - doc.Text = text; - int realStartLine = 0; - for (int i = 1; i <= doc.LineCount; i++) { - string lineText = doc.GetTextAt (doc.GetLine (i)); - // Microsoft.NET generates "auto-generated" tags where Mono generates "autogenerated" tags. - if (lineText.Contains ("") || lineText.Contains ("")) { - realStartLine = i + 2; - break; - } - } - - // The Mono provider inserts additional blank lines, so strip them out - // But blank lines might actually be significant in other languages. - // We reformat the C# generated output to the user's coding style anyway, but the reformatter preserves blank lines - if (provider is Microsoft.CSharp.CSharpCodeProvider) { - bool previousWasBlank = false; - for (int i = 1; i <= doc.LineCount; i++) { - var line = doc.GetLine (i); - bool isBlank, isBracket; - CheckLine (doc, line, out isBlank, out isBracket); - if (isBlank && previousWasBlank && line.LengthIncludingDelimiter > 0) { - doc.RemoveText (line.Offset, line.LengthIncludingDelimiter); - i--; - } - previousWasBlank = isBlank || isBracket; - } - } - - int offset = doc.GetLine (realStartLine).Offset; - return doc.GetTextAt (offset, doc.Length - offset); - } - - static void CheckLine (IReadonlyTextDocument doc, IDocumentLine line, out bool isBlank, out bool isBracket) - { - isBlank = true; - isBracket = false; - for (int i = 0; i < line.LengthIncludingDelimiter; i++) { - char c = doc.GetCharAt (line.Offset + i); - if (c == '{') { - isBracket = true; - isBlank = false; - } - else if (!Char.IsWhiteSpace (c)) { - isBlank = false; - if (isBracket) { - isBracket = false; - break; - } - } - } - } - } - - - public class CodeGeneratorProcess: RemoteProcessObject - { - public Stetic.CodeGenerationResult GenerateCode (ArrayList projectFiles, bool useGettext, string gettextClass, string resourceLoaderClass, bool usePartialClasses) - { - Gtk.Application.Init (); - - Stetic.Application app = Stetic.ApplicationFactory.CreateApplication (Stetic.IsolationMode.None); - - Stetic.Project[] projects = new Stetic.Project [projectFiles.Count]; - for (int n=0; n < projectFiles.Count; n++) { - projects [n] = app.CreateProject (); - projects [n].Load ((string) projectFiles [n]); - } - - Stetic.GenerationOptions options = new Stetic.GenerationOptions (); - options.UseGettext = useGettext; - options.GettextClass = gettextClass; - options.ImageResourceLoaderClass = resourceLoaderClass; - options.UsePartialClasses = usePartialClasses; - options.GenerateSingleFile = false; - - return app.GenerateProjectCode (options, projects); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs deleted file mode 100644 index f1b4ded7ea7..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs +++ /dev/null @@ -1,622 +0,0 @@ -// -// GuiBuilderView.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System; -using System.Linq; -using System.Collections.Generic; -using System.ComponentModel; - -using MonoDevelop.Core; -using MonoDevelop.Ide.Gui.Content; -using MonoDevelop.Ide.Gui; -using MonoDevelop.Ide.Commands; -using MonoDevelop.Components.Commands; -using MonoDevelop.Projects; -using MonoDevelop.DesignerSupport.Toolbox; -using MonoDevelop.DesignerSupport; - -using Gtk; -using Gdk; -using MonoDevelop.Ide; -using Microsoft.CodeAnalysis; -using System.Threading.Tasks; -using MonoDevelop.Refactoring; - -namespace MonoDevelop.GtkCore.GuiBuilder -{ - public class GuiBuilderView : CombinedDesignView - { - Stetic.WidgetDesigner designer; - Stetic.ActionGroupDesigner actionsBox; - GuiBuilderWindow window; - - DesignerPage designerPage; - ActionGroupPage actionsPage; - - - CodeBinder codeBinder; - GuiBuilderProject gproject; - string rootName; - object designerStatus; - - public GuiBuilderView (ViewContent content, GuiBuilderWindow window): base (content) - { - rootName = window.Name; - - designerPage = new DesignerPage (window.Project); - designerPage.Show (); - AddButton (GettextCatalog.GetString ("Designer"), designerPage); - - actionsPage = new ActionGroupPage (); - actionsPage.Show (); - - AttachWindow (window); - } - - void AttachWindow (GuiBuilderWindow window) - { - gproject = window.Project; - GtkDesignInfo info = GtkDesignInfo.FromProject (gproject.Project); - gproject.SteticProject.ImagesRootPath = FileService.AbsoluteToRelativePath (info.GtkGuiFolder, gproject.Project.BaseDirectory); - gproject.UpdateLibraries (); - LoadDesigner (); - } - - public override ProjectReloadCapability ProjectReloadCapability { - get { - return ProjectReloadCapability.Full; - } - } - - protected override void OnSetProject (Projects.Project project) - { - base.OnSetProject (project); - - if (gproject != null && gproject.Project == project) - return; - - if (designer != null) - designerStatus = designer.SaveStatus (); - - CloseDesigner (); - CloseProject (); - if (project != null) { - GuiBuilderWindow w = GuiBuilderDisplayBinding.GetWindow (this.ContentName, project); - if (w != null) { - AttachWindow (w); - if (designerStatus != null) - designer.LoadStatus (designerStatus); - designerStatus = null; - } - } - } - - void LoadDesigner () - { - this.window = gproject.GetWindow (rootName); - if (window == null) { - // The window doesn't exist anymore - return; - } - - gproject.Unloaded += OnDisposeProject; - - designer = gproject.SteticProject.CreateWidgetDesigner (window.RootWidget, false); - - // Designer page - designerPage.ClearChild (); - designerPage.Add (designer); - - if (designer.RootComponent == null) { - // Something went wrong while creating the designer. Show it, but don't do aything else. - designer.ShowAll (); - return; - } - - designer.AllowWidgetBinding = !gproject.Project.UsePartialTypes; - - codeBinder = new CodeBinder (gproject.Project, new OpenDocumentFileProvider (), designer.RootComponent); - - designer.BindField += OnBindWidgetField; - designer.ModifiedChanged += OnWindowModifiedChanged; - designer.SignalAdded += OnSignalAdded; - designer.SignalRemoved += OnSignalRemoved; - designer.SignalChanged += OnSignalChanged; - designer.ComponentNameChanged += OnComponentNameChanged; - designer.RootComponentChanged += OnRootComponentChanged; - designer.ComponentTypesChanged += OnComponentTypesChanged; - designer.ImportFileCallback = ImportFile; - - // Actions designer - actionsBox = designer.CreateActionGroupDesigner (); - actionsBox.AllowActionBinding = !gproject.Project.UsePartialTypes; - actionsBox.BindField += new EventHandler (OnBindActionField); - actionsBox.ModifiedChanged += new EventHandler (OnActionshanged); - - actionsPage.ClearChild (); - actionsPage.PackStart (actionsBox, true, true, 0); - actionsPage.ShowAll (); - - if (actionsBox.HasData) { - if (!HasPage (actionsPage)) - AddButton (GettextCatalog.GetString ("Actions"), actionsPage); - } else { - RemoveButton (actionsPage); - } - - designer.ShowAll (); - GuiBuilderService.SteticApp.ActiveDesigner = designer; - } - - public override Stetic.Designer Designer { - get { return designer; } - } - - void OnDisposeProject (object s, EventArgs args) - { - CloseDesigner (); - } - - void OnReloadProject (object s, EventArgs args) - { - if (designer == null) - LoadDesigner (); - } - - public GuiBuilderWindow Window { - get { return window; } - } - - void CloseDesigner () - { - if (designer == null) - return; - - gproject.Unloaded -= OnDisposeProject; - designer.BindField -= OnBindWidgetField; - designer.ModifiedChanged -= OnWindowModifiedChanged; - designer.SignalAdded -= OnSignalAdded; - designer.SignalRemoved -= OnSignalRemoved; - designer.SignalChanged -= OnSignalChanged; - designer.ComponentNameChanged -= OnComponentNameChanged; - designer.RootComponentChanged -= OnRootComponentChanged; - designer.ComponentTypesChanged -= OnComponentTypesChanged; - - if (actionsBox != null) { - actionsBox.BindField -= OnBindActionField; - actionsBox.ModifiedChanged -= OnActionshanged; - actionsBox = null; - } - - actionsPage.ClearChild (); - designerPage.ClearChild (); - - designerPage.Add (CreateDesignerNotAvailableWidget ()); - actionsPage.Add (CreateDesignerNotAvailableWidget ()); - - designer = null; - - gproject.Reloaded += OnReloadProject; - } - - void CloseProject () - { - gproject.Reloaded -= OnReloadProject; - } - - public override void Dispose () - { - CloseDesigner (); - CloseProject (); - codeBinder = null; - base.Dispose (); - } - - Gtk.Widget CreateDesignerNotAvailableWidget () - { - Gtk.Label label = new Gtk.Label (GettextCatalog.GetString ("Designer not available")); - label.Show (); - return label; - } - - protected override void OnPageShown (int npage) - { - if (npage == 0 && designer != null && window != null && !ErrorMode) { - // At every page switch update the generated code, to make sure code completion works - // for the generated fields. The call to GenerateSteticCodeStructure will generate - // the code for the window (only the fields in fact) and update the parser database, it - // will not save the code to disk. - if (gproject.Project.UsePartialTypes) - GuiBuilderService.GenerateSteticCodeStructure ((DotNetProject)gproject.Project, designer.RootComponent, null, false, false); - } - base.OnPageShown (npage); - } - - string ImportFile (string file) - { - return GuiBuilderService.ImportFile (gproject.Project, file); - } - - void OnRootComponentChanged (object s, EventArgs args) - { - codeBinder.TargetObject = designer.RootComponent; - } - - async void OnComponentNameChanged (object s, Stetic.ComponentNameEventArgs args) - { - try { - // Make sure the fields in the partial class are up to date. - // Provide the args parameter to GenerateSteticCodeStructure, in this - // way the component that has been renamed will be generated with the - // old name, and UpdateField will be able to find it (to rename the - // references to the field, it needs to have the old name). - if (gproject.Project.UsePartialTypes) - GuiBuilderService.GenerateSteticCodeStructure ((DotNetProject)gproject.Project, designer.RootComponent, args, false, false); - - await codeBinder.UpdateField (args.Component, args.OldName); - } - catch (Exception ex) { - LoggingService.LogInternalError (ex); - } - } - - void OnComponentTypesChanged (object s, EventArgs a) - { - if (ToolboxProvider.Instance != null) - ToolboxProvider.Instance.NotifyItemsChanged (); - } - - void OnActionshanged (object s, EventArgs args) - { - if (designer != null && !HasPage (actionsPage) && !ErrorMode) - AddButton (GettextCatalog.GetString ("Actions"), actionsPage); - } - - void OnWindowModifiedChanged (object s, EventArgs args) - { - OnDirtyChanged (); - } - - async void OnBindWidgetField (object o, EventArgs a) - { - if (designer.Selection != null) - await codeBinder.BindToField (designer.Selection); - } - - async void OnBindActionField (object o, EventArgs a) - { - if (actionsBox.SelectedAction != null) - await codeBinder.BindToField (actionsBox.SelectedAction); - } - - void OnSignalAdded (object sender, Stetic.ComponentSignalEventArgs args) - { - codeBinder.BindSignal (args.Signal); - } - - void OnSignalRemoved (object sender, Stetic.ComponentSignalEventArgs args) - { - } - - async void OnSignalChanged (object sender, Stetic.ComponentSignalEventArgs args) - { - await codeBinder.UpdateSignal (args.OldSignal, args.Signal); - } - - public override async Task Save (FileSaveInformation fileSaveInformation) - { - await base.Save (fileSaveInformation); - - if (designer == null) - return; - - string oldBuildFile = GuiBuilderService.GetBuildCodeFileName (gproject.Project, window.RootWidget.Name); - - codeBinder.UpdateBindings (fileSaveInformation.FileName); - if (!ErrorMode) { - if (designer != null) - designer.Save (); - if (actionsBox != null) - actionsBox.Save (); - } - - string newBuildFile = GuiBuilderService.GetBuildCodeFileName (gproject.Project, window.RootWidget.Name); - - if (oldBuildFile != newBuildFile) { - if (System.IO.File.Exists (newBuildFile)) - FileService.DeleteFile (newBuildFile); - FileService.MoveFile (oldBuildFile, newBuildFile); - } - - gproject.SaveWindow (true, window.RootWidget.Name); - } - - public override bool IsDirty { - get { - // There is no need to check if the action group designer is modified - // since changes in the action group are as well changes in the designed widget - return base.IsDirty || (designer != null && designer.Modified); - } - set { - base.IsDirty = value; - } - } - - public override void JumpToSignalHandler (Stetic.Signal signal) - { - var cls = codeBinder.GetClass (); - if (cls == null) - return; - var met = cls - .GetMembers (signal.Handler) - .OfType () - .FirstOrDefault (); - if (met != null) { - ShowPage (0); - RefactoringService.RoslynJumpToDeclaration (met); - } - } - - public void ShowDesignerView () - { - if (designer != null) - ShowPage (1); - } - - public void ShowActionDesignerView (string name) - { - if (designer != null) { - ShowPage (2); - if (!ErrorMode) - actionsBox.ActiveGroup = name; - } - } - - bool ErrorMode { - get { return designer.RootComponent == null; } - } - } - - class DesignerPage: Gtk.EventBox, ICustomPropertyPadProvider, IToolboxConsumer, MonoDevelop.DesignerSupport.IOutlinedDocument - { - GuiBuilderProject gproject; - - public DesignerPage (GuiBuilderProject gproject) - { - this.gproject = gproject; - } - - public Stetic.ComponentType[] GetComponentTypes () - { - if (Designer != null) - return Designer.GetComponentTypes (); - else - return null; - } - - public DotNetProject Project { - get { return gproject.Project; } - } - - Gtk.Widget ICustomPropertyPadProvider.GetCustomPropertyWidget () - { - return PropertiesWidget.Instance; - } - - void ICustomPropertyPadProvider.DisposeCustomPropertyWidget () - { - } - - Stetic.WidgetDesigner Designer { - get { - return Child as Stetic.WidgetDesigner; - } - } - - public void ClearChild () - { - if (Child != null) { - Gtk.Widget w = Child; - Remove (w); - w.Destroy (); - } - } - - void IToolboxConsumer.ConsumeItem (ItemToolboxNode item) - { - } - - //Toolbox service uses this to filter toolbox items. - ToolboxItemFilterAttribute[] IToolboxConsumer.ToolboxFilterAttributes { - get { - return new ToolboxItemFilterAttribute [] { - new ToolboxItemFilterAttribute ("gtk-sharp", ToolboxItemFilterType.Custom) - }; - } - } - - //Used if ToolboxItemFilterAttribute demands ToolboxItemFilterType.Custom - //If not expecting it, should just return false - bool IToolboxConsumer.CustomFilterSupports (ItemToolboxNode item) - { - ComponentToolboxNode cnode = item as ComponentToolboxNode; - if (cnode != null && gproject.SteticProject != null) { - if (cnode.GtkVersion == null || Mono.Addins.Addin.CompareVersions (gproject.SteticProject.TargetGtkVersion, cnode.GtkVersion) <= 0) - return true; - } - return false; - } - - string IToolboxConsumer.DefaultItemDomain { - get { return ComponentToolboxNode.GtkWidgetDomain; } - } - - void IToolboxConsumer.DragItem (ItemToolboxNode item, Gtk.Widget source, Gdk.DragContext ctx) - { - if (Designer != null) { - ComponentToolboxNode node = item as ComponentToolboxNode; - if (node != null) { - if (node.Reference == null) - Designer.BeginComponentDrag (node.ComponentType, source, ctx); - else - Designer.BeginComponentDrag (node.Name, node.ClassName, source, ctx, delegate { CheckReference (node); }); - } - } - } - - void CheckReference (ComponentToolboxNode node) - { - if (node.Reference == null) - return; - - MonoDevelop.Projects.ProjectReference pref; - - // If the class name includes an assembly name it means that the - // widget is implemented in another assembly, not in the one that - // has the objects.xml file. - int i = node.ClassName.IndexOf (','); - if (i != -1) { - string asm = node.ClassName.Substring (i+1).Trim (); - if (asm == "gtk-sharp") - // If we are adding a widget to a window, the project must already have a gtk# reference - return; - - asm = gproject.Project.AssemblyContext.GetAssemblyFullName (asm, gproject.Project.TargetFramework); - if (asm == null) - return; - if (gproject.Project.AssemblyContext.GetPackagesFromFullName (asm).Length > 0) { - pref = MonoDevelop.Projects.ProjectReference.CreateAssemblyReference (asm); - } else { - asm = gproject.Project.AssemblyContext.GetAssemblyLocation (asm, gproject.Project.TargetFramework); - pref = MonoDevelop.Projects.ProjectReference.CreateAssemblyFileReference (asm); - } - } - else - pref = MonoDevelop.Projects.ProjectReference.CreateCustomReference (node.ReferenceType, node.Reference); - - foreach (var pr in gproject.Project.References) { - if (pr.Reference == pref.Reference) - return; - } - gproject.Project.References.Add (pref); - } - - TargetEntry[] IToolboxConsumer.DragTargets { - get { return Stetic.DND.Targets; } - } - - [CommandHandler (EditCommands.Delete)] - protected void OnDelete () - { - Designer.DeleteSelection (); - } - - [CommandUpdateHandler (EditCommands.Delete)] - protected void OnUpdateDelete (CommandInfo cinfo) - { - cinfo.Bypass = Designer != null && !Designer.CanDeleteSelection; - } - - [CommandHandler (EditCommands.Copy)] - protected void OnCopy () - { - Designer.CopySelection (); - } - - [CommandUpdateHandler (EditCommands.Copy)] - protected void OnUpdateCopy (CommandInfo cinfo) - { - cinfo.Enabled = Designer != null && Designer.CanCopySelection; - } - - [CommandHandler (EditCommands.Cut)] - protected void OnCut () - { - Designer.CutSelection (); - } - - [CommandUpdateHandler (EditCommands.Cut)] - protected void OnUpdateCut (CommandInfo cinfo) - { - cinfo.Enabled = Designer != null && Designer.CanCutSelection; - } - - [CommandHandler (EditCommands.Paste)] - protected void OnPaste () - { - Designer.PasteToSelection (); - } - - [CommandHandler (EditCommands.Undo)] - protected void OnUndo () - { - Designer.UndoQueue.Undo (); - } - - [CommandHandler (EditCommands.Redo)] - protected void OnRedo () - { - Designer.UndoQueue.Redo (); - } - - [CommandUpdateHandler (EditCommands.Paste)] - protected void OnUpdatePaste (CommandInfo cinfo) - { - cinfo.Enabled = Designer != null && Designer.CanPasteToSelection; - } - - [CommandUpdateHandler (EditCommands.Undo)] - protected void OnUpdateUndo (CommandInfo cinfo) - { - cinfo.Enabled = Designer != null && Designer.UndoQueue.CanUndo; - } - - [CommandUpdateHandler (EditCommands.Redo)] - protected void OnUpdateRedo (CommandInfo cinfo) - { - cinfo.Enabled = Designer != null && Designer.UndoQueue.CanRedo; - } - - Widget MonoDevelop.DesignerSupport.IOutlinedDocument.GetOutlineWidget () - { - return GuiBuilderDocumentOutline.Instance; - } - - IEnumerable MonoDevelop.DesignerSupport.IOutlinedDocument.GetToolbarWidgets () - { - return null; - } - - void MonoDevelop.DesignerSupport.IOutlinedDocument.ReleaseOutlineWidget () - { - //Do nothing. We keep the instance to avoid creation cost when switching documents. - } - } -} - diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs deleted file mode 100644 index 972852bb565..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs +++ /dev/null @@ -1,253 +0,0 @@ -// -// GuiBuilderWindow.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System; -using System.Collections; -using System.CodeDom; - -using MonoDevelop.Core; -using MonoDevelop.Ide.Gui; -using MonoDevelop.Projects; -using MonoDevelop.Projects.Text; -using MonoDevelop.GtkCore.Dialogs; -using MonoDevelop.Ide; -using Microsoft.CodeAnalysis; -using ICSharpCode.NRefactory6.CSharp; -using MonoDevelop.Ide.Editor; -using MonoDevelop.Ide.TypeSystem; - -namespace MonoDevelop.GtkCore.GuiBuilder -{ - public class GuiBuilderWindow: IDisposable - { - Stetic.WidgetInfo rootWidget; - GuiBuilderProject fproject; - Stetic.Project gproject; - string name; - - public event WindowEventHandler Changed; - - internal GuiBuilderWindow (GuiBuilderProject fproject, Stetic.Project gproject, Stetic.WidgetInfo rootWidget) - { - this.fproject = fproject; - this.rootWidget = rootWidget; - this.gproject = gproject; - name = rootWidget.Name; - gproject.ProjectReloaded += OnProjectReloaded; - rootWidget.Changed += OnChanged; - } - - public Stetic.WidgetInfo RootWidget { - get { return rootWidget; } - } - - public GuiBuilderProject Project { - get { return fproject; } - } - - public string Name { - get { return rootWidget.Name; } - } - - public FilePath SourceCodeFile { - get { return fproject.GetSourceCodeFile (rootWidget); } - } - - public void Dispose () - { - gproject.ProjectReloaded -= OnProjectReloaded; - rootWidget.Changed -= OnChanged; - } - - void OnProjectReloaded (object s, EventArgs args) - { - rootWidget.Changed -= OnChanged; - rootWidget = gproject.GetWidget (name); - if (rootWidget != null) - rootWidget.Changed += OnChanged; - } - - void OnChanged (object o, EventArgs args) - { - // Update the name, it may have changed - name = rootWidget.Name; - - if (Changed != null) - Changed (this, new WindowEventArgs (this)); - } - - public bool BindToClass () - { - if (SourceCodeFile != FilePath.Null) - return true; - - // Find the classes that could be bound to this design - var ctx = fproject.GetParserContext (); - ArrayList list = new ArrayList (); - foreach (var cls in ctx.GetAllTypesInMainAssembly ()) { - if (IsValidClass (cls)) - list.Add (cls.GetFullName ()); - } - - // Ask what to do - - try { - using (BindDesignDialog dialog = new BindDesignDialog (Name, list, Project.Project.BaseDirectory)) { - if (!dialog.Run ()) - return false; - - if (dialog.CreateNew) - CreateClass (dialog.ClassName, dialog.Namespace, dialog.Folder); - - string fullName = dialog.Namespace.Length > 0 ? dialog.Namespace + "." + dialog.ClassName : dialog.ClassName; - rootWidget.Name = fullName; - fproject.SaveWindow (true, fullName); - } - return true; - } catch (Exception ex) { - LoggingService.LogInternalError (ex); - return false; - } - } - - void CreateClass (string name, string namspace, string folder) - { - // TODO: Type system conversion. - -// string fullName = namspace.Length > 0 ? namspace + "." + name : name; -// -// var gen = new CodeRefactorer (fproject.Project.ParentSolution); -// bool partialSupport = fproject.Project.UsePartialTypes; -// Stetic.WidgetComponent component = (Stetic.WidgetComponent) rootWidget.Component; -// -// CodeTypeDeclaration type = new CodeTypeDeclaration (); -// type.Name = name; -// type.IsClass = true; -// type.IsPartial = partialSupport; -// type.BaseTypes.Add (new CodeTypeReference (component.Type.ClassName)); -// -// // Generate the constructor. It contains the call that builds the widget. -// -// CodeConstructor ctor = new CodeConstructor (); -// ctor.Attributes = MemberAttributes.Public | MemberAttributes.Final; -// -// foreach (object val in component.Type.InitializationValues) { -// if (val is Enum) { -// ctor.BaseConstructorArgs.Add ( -// new CodeFieldReferenceExpression ( -// new CodeTypeReferenceExpression (val.GetType ()), -// val.ToString () -// ) -// ); -// } -// else -// ctor.BaseConstructorArgs.Add (new CodePrimitiveExpression (val)); -// } -// -// if (partialSupport) { -// CodeMethodInvokeExpression call = new CodeMethodInvokeExpression ( -// new CodeMethodReferenceExpression ( -// new CodeThisReferenceExpression (), -// "Build" -// ) -// ); -// ctor.Statements.Add (call); -// } else { -// CodeMethodInvokeExpression call = new CodeMethodInvokeExpression ( -// new CodeMethodReferenceExpression ( -// new CodeTypeReferenceExpression ("Stetic.Gui"), -// "Build" -// ), -// new CodeThisReferenceExpression (), -// new CodeTypeOfExpression (fullName) -// ); -// ctor.Statements.Add (call); -// } -// type.Members.Add (ctor); -// -// // Add signal handlers -// -// AddSignalsRec (type, component); -// foreach (Stetic.Component ag in component.GetActionGroups ()) -// AddSignalsRec (type, ag); -// -// // Create the class -// IType cls = gen.CreateClass (Project.Project, ((DotNetProject)Project.Project).LanguageName, folder, namspace, type); -// if (cls == null) -// throw new UserException ("Could not create class " + fullName); -// -// Project.Project.AddFile (cls.CompilationUnit.FileName, BuildAction.Compile); -// IdeApp.ProjectOperations.Save (Project.Project); -// -// // Make sure the database is up-to-date -// ProjectDomService.Parse (Project.Project, cls.CompilationUnit.FileName); - } - - void AddSignalsRec (CodeTypeDeclaration type, Stetic.Component comp) - { - foreach (Stetic.Signal signal in comp.GetSignals ()) { - CodeMemberMethod met = new CodeMemberMethod (); - met.Name = signal.Handler; - met.Attributes = MemberAttributes.Family; - met.ReturnType = new CodeTypeReference (signal.SignalDescriptor.HandlerReturnTypeName); - - foreach (Stetic.ParameterDescriptor pinfo in signal.SignalDescriptor.HandlerParameters) - met.Parameters.Add (new CodeParameterDeclarationExpression (pinfo.TypeName, pinfo.Name)); - - type.Members.Add (met); - } - foreach (Stetic.Component cc in comp.GetChildren ()) { - AddSignalsRec (type, cc); - } - } - - internal bool IsValidClass (ITypeSymbol cls) - { - if (cls.SpecialType == Microsoft.CodeAnalysis.SpecialType.System_Object) - return false; - if (cls.BaseType.GetFullName () == rootWidget.Component.Type.ClassName) - return true; - return IsValidClass (cls.BaseType); - } - } - - class OpenDocumentFileProvider: ITextFileProvider - { - public ITextDocument GetEditableTextFile (FilePath filePath) - { - foreach (var doc in IdeApp.Workbench.Documents) { - if (doc.FileName == filePath) { - var ef = doc.Editor; - if (ef != null) return ef; - } - } - return null; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs deleted file mode 100644 index 6cedb0f4b2b..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs +++ /dev/null @@ -1,211 +0,0 @@ -// -// GuiBuilderPropertiesPad.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System; -using Gtk; -using MonoDevelop.Core; -using MonoDevelop.Projects; -using MonoDevelop.Ide.Gui; -using MonoDevelop.Components.Commands; -using MonoDevelop.Ide.Commands; - -namespace MonoDevelop.GtkCore.GuiBuilder -{ - class PropertiesWidget: Gtk.VBox - { - public static PropertiesWidget Instance; - - Stetic.SignalsEditor signalsEditor; - - static PropertiesWidget () - { - Instance = new PropertiesWidget (); - } - - public PropertiesWidget () - { - Stetic.WidgetPropertyTree grid = GuiBuilderService.SteticApp.PropertiesWidget; - - Notebook tabs = new Notebook (); - - tabs.AppendPage (grid, new Label (GettextCatalog.GetString ("Properties"))); - - signalsEditor = GuiBuilderService.SteticApp.SignalsWidget; - signalsEditor.SignalActivated += new EventHandler (OnSignalActivated); - tabs.AppendPage (signalsEditor, new Label (GettextCatalog.GetString ("Signals"))); - - Gtk.EventBox infoBox = new Gtk.EventBox (); - tabs.AppendPage (infoBox, new Gtk.Label ("")); - - PackStart (tabs, true, true, 0); - - ShowAll (); - infoBox.Hide (); - - tabs.Page = 0; - } - - void OnSignalActivated (object s, EventArgs a) - { - GuiBuilderService.JumpToSignalHandler (signalsEditor.SelectedSignal); - } - } - -/* public class GuiBuilderPropertiesPad: AbstractPadContent - { - Stetic.WidGetTree grid; - Stetic.SignalsEditor signalsEditor; - Gtk.EventBox infoBox; - Gtk.Widget widget; - Stetic.Wrapper.Action currentAction; - Notebook tabs; - - public GuiBuilderPropertiesPad (): base ("") - { - grid = GuiBuilderService.SteticApp.PropertiesWidget; - - DefaultPlacement = "MonoDevelop.GtkCore.GuiBuilder.GuiBuilderPalettePad/bottom; right"; - - tabs = new Notebook (); - - tabs.AppendPage (grid, new Label (GettextCatalog.GetString ("Properties"))); - - signalsEditor = GuiBuilderService.SteticApp.SignalsWidget; - signalsEditor.SignalActivated += new EventHandler (OnSignalActivated); - tabs.AppendPage (signalsEditor, new Label (GettextCatalog.GetString ("Signals"))); - - infoBox = new Gtk.EventBox (); - tabs.AppendPage (infoBox, new Gtk.Label ("")); - - widget = tabs; - - widget.ShowAll (); - infoBox.Hide (); - - tabs.Page = 0; - } - - public override Gtk.Widget Control { - get { return widget; } - } - - void OnSignalActivated (object s, EventArgs a) - { - GuiBuilderService.JumpToSignalHandler (signalsEditor.SelectedSignal); - } - - public object TargetObject { - get { - return grid.TargetObject; - } - set { - Stetic.Wrapper.Action action = Stetic.ObjectWrapper.Lookup (value) as Stetic.Wrapper.Action; - if (action != null) { - // Don't allow editing of global actions - if (grid.Project != null && grid.Project.ActionGroups.IndexOf (action.ActionGroup) != -1) { - if (infoBox.Child != null) - infoBox.Remove (infoBox.Child); - infoBox.Add (CreateGlobalActionInfo (action)); - infoBox.ShowAll (); - tabs.Page = 2; - tabs.ShowTabs = false; - grid.Hide (); - signalsEditor.Hide (); - return; - } - } - - if (!grid.Visible) { - tabs.ShowTabs = true; - grid.Show (); - signalsEditor.Show (); - tabs.Page = 0; - infoBox.Hide (); - } - - grid.TargetObject = value; - signalsEditor.TargetObject = value; - } - } - - Gtk.Widget CreateGlobalActionInfo (Stetic.Wrapper.Action action) - { - currentAction = action; - - Gtk.HBox hbox = new Gtk.HBox (); - hbox.BorderWidth = 12; - Gtk.Image img = new Gtk.Image (Gtk.Stock.DialogInfo, Gtk.IconSize.Menu); - img.Yalign = 0; - hbox.PackStart (img, false, false, 0); - - Gtk.VBox box = new Gtk.VBox (); - Gtk.Label info = new Gtk.Label (GettextCatalog.GetString ("The action '{0}' belongs to the global action group '{1}'. To modify it, open the action group file.", action.MenuLabel, action.ActionGroup.Name)); - info.Xalign = 0; - info.WidthRequest = 200; - info.LineWrap = true; - box.PackStart (info, false, false, 0); - - HBox bb = new HBox (); - Gtk.Button but = new Gtk.Button (GettextCatalog.GetString ("Open Action Group")); - but.Clicked += new EventHandler (OnOpenGroup); - bb.PackStart (but, false, false, 0); - box.PackStart (bb, false, false, 12); - - hbox.PackStart (box, true, true, 12); - hbox.ShowAll (); - return hbox; - } - - void OnOpenGroup (object s, EventArgs args) - { - Project prj = GetProjectFromDesign (currentAction.ActionGroup); - if (prj != null) { - ActionGroupView view = GuiBuilderService.OpenActionGroup (prj, currentAction.ActionGroup); - if (view != null) - view.SelectAction (currentAction); - } - } - - - public static Project GetProjectFromDesign (Stetic.Wrapper.ActionGroup group) - { - if (IdeApp.ProjectOperations.CurrentOpenCombine == null) - return null; - - foreach (Project prj in IdeApp.ProjectOperations.CurrentOpenCombine.GetAllProjects ()) { - GtkDesignInfo info = GtkCoreService.GetGtkInfo (prj); - if (info != null && info.GuiBuilderProject != null && info.GuiBuilderProject.SteticProject.ActionGroups.IndexOf (group) != -1) - return prj; - } - return null; - } - - } -*/ -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs deleted file mode 100644 index c477c66e8ce..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs +++ /dev/null @@ -1,81 +0,0 @@ -// -// ToolboxLoader.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2007 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections.Generic; -using MonoDevelop.DesignerSupport.Toolbox; -using MonoDevelop.Projects; -using MonoDevelop.Core; -using MonoDevelop.Core.Assemblies; -using Stetic; -using MonoDevelop.Ide; - -namespace MonoDevelop.GtkCore.GuiBuilder -{ - public class ToolboxLoader: IToolboxLoader - { - public virtual string[] FileTypes { - get { return new string [] { "dll", "exe" }; } - } - - public virtual IList Load (LoaderContext ctx, string filename) - { - SystemPackage sp = Runtime.SystemAssemblyService.DefaultAssemblyContext.GetPackageFromPath (filename); - ReferenceType rt; - string rname; - - if (sp != null) { - rt = ReferenceType.Package; - rname = Runtime.SystemAssemblyService.DefaultAssemblyContext.GetAssemblyFullName (filename, null); - } else { - rt = ReferenceType.Assembly; - rname = filename; - } - - List list = new List (); - - if (ctx.CancellationToken.IsCancellationRequested) - return list; - - var types = Runtime.RunInMainThread (delegate { - // Stetic is not thread safe, it has to be used from the gui thread - return GuiBuilderService.SteticApp.GetComponentTypes (filename); - }).WaitAndGetResult (ctx.CancellationToken); - - foreach (ComponentType ct in types) { - if (ct.Category == "window") - continue; - ComponentToolboxNode cn = new ComponentToolboxNode (ct); - cn.ReferenceType = rt; - cn.Reference = rname; - list.Add (cn); - } - return list; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs deleted file mode 100644 index 1616424340a..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs +++ /dev/null @@ -1,202 +0,0 @@ - -using System; -using System.ComponentModel; -using System.Collections; -using System.Collections.Generic; - -using MonoDevelop.DesignerSupport.Toolbox; -using MonoDevelop.Projects; -using MonoDevelop.Core.Serialization; -using Stetic; -using MonoDevelop.Core; -using MonoDevelop.Ide; -using MonoDevelop.Components; - -namespace MonoDevelop.GtkCore.GuiBuilder -{ - public class ToolboxProvider: IToolboxDynamicProvider, IToolboxDefaultProvider - { - internal static ToolboxProvider Instance; - - public ToolboxProvider () - { - Instance = this; - } - - public IEnumerable GetDynamicItems (IToolboxConsumer consumer) - { - DesignerPage view = consumer as DesignerPage; - if (view == null) - return null; - - ComponentType[] types = view.GetComponentTypes (); - if (types == null) - return null; - - Hashtable refs = new Hashtable (); - Hashtable projects = new Hashtable (); - string of = FileService.GetFullPath (view.Project.GetOutputFileName (IdeApp.Workspace.ActiveConfiguration)); - projects [of] = view.Project.Name; - foreach (ProjectReference pr in ((DotNetProject)view.Project).References) - foreach (string f in pr.GetReferencedFileNames (IdeApp.Workspace.ActiveConfiguration)) { - if (pr.ReferenceType == ReferenceType.Project) - projects[FileService.GetFullPath (f)] = pr.Reference; - else - refs[FileService.GetFullPath (f)] = f; - } - - List list = new List (); - foreach (ComponentType type in types) { - if (type.Category == "window") - continue; - - string fullName = null; - if (!String.IsNullOrEmpty (type.Library)) - fullName = FileService.GetFullPath (type.Library); - - if (type.ClassName == "Gtk.Action" || (fullName != null && refs.Contains (fullName))) { - ComponentToolboxNode node = new ComponentToolboxNode (type); - list.Add (node); - } else if (fullName != null && projects.Contains (fullName)) { - ComponentToolboxNode node = new ComponentToolboxNode (type); - node.Category = (string) projects [fullName]; - list.Add (node); - } - } - list.Sort (); - return list; - } - - public void NotifyItemsChanged () - { - if (ItemsChanged != null) - ItemsChanged (this, EventArgs.Empty); - } - - public virtual IEnumerable GetDefaultItems () - { - return null; - } - - public virtual IEnumerable GetDefaultFiles () - { - yield return typeof(Stetic.Wrapper.Widget).Assembly.Location; - } - - public event EventHandler ItemsChanged; - } - - class ComponentToolboxNode: ItemToolboxNode - { - public ComponentType componentType; - - [ItemProperty] - ReferenceType refType; - [ItemProperty] - string reference; - [ItemProperty] - string className; - [ItemProperty] - string gtkVersion; - - static ToolboxItemFilterAttribute[] attributes = new ToolboxItemFilterAttribute[] { - new ToolboxItemFilterAttribute ("gtk-sharp", ToolboxItemFilterType.Require) - }; - - internal static readonly string GtkWidgetDomain = GettextCatalog.GetString ("GTK# Widgets"); - - public ComponentToolboxNode () - { - } - - public ComponentToolboxNode (ComponentType type) - { - if (type.Description.Length > 0) - Name = type.Description; - else { - int i = type.Name.LastIndexOf ('.'); - if (i == -1) - Name = type.Name; - else - Name = type.Name.Substring (i+1); - } - - componentType = type; - className = type.ClassName; - Category = GetCategoryName (type.Category); - Icon = type.Icon.ToXwtImage (); - gtkVersion = type.TargetGtkVersion; - } - - [Browsable (false)] - public override IList ItemFilters { - get { return attributes; } - } - - [Browsable (false)] - public Stetic.ComponentType ComponentType { - get { - return componentType; - } - } - - [ReadOnly (true)] - [LocalizedCategory ("Misc")] - [LocalizedDisplayName ("Reference Type")] - [LocalizedDescription ("The type of the project or assembly from which this component originates.")] - public ReferenceType ReferenceType { - get { - return refType; - } - set { - refType = value; - } - } - - [ReadOnly (true)] - [LocalizedCategory ("Misc")] - [LocalizedDisplayName ("Reference Path")] - [LocalizedDescription ("The project or assembly from which this component originates.")] - public string Reference { - get { - return reference; - } - set { - reference = value; - } - } - - [LocalizedCategory ("Misc")] - [LocalizedDisplayName ("Class Name")] - [LocalizedDescription ("The name of the component class.")] - public string ClassName { - get { - return className; - } - } - - [LocalizedCategory ("Misc")] - [LocalizedDisplayName ("GTK# Version")] - [LocalizedDescription ("The minimum GTK# version required to use this component.")] - public string GtkVersion { - get { - return gtkVersion; - } - } - - string GetCategoryName (string cat) - { - if (cat == "container") - return GettextCatalog.GetString ("Containers"); - else if (cat == "widget") - return GettextCatalog.GetString ("Widgets"); - else - return cat; - } - - [Browsable (false)] - public override string ItemDomain { - get { return GtkWidgetDomain; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs deleted file mode 100644 index 931f55efd7e..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs +++ /dev/null @@ -1,145 +0,0 @@ -// -// ActionGroupNodeBuilder.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using MonoDevelop.Core; -using MonoDevelop.Ide.Gui; -using MonoDevelop.GtkCore.GuiBuilder; -using MonoDevelop.GtkCore.Dialogs; -using MonoDevelop.Projects; -using MonoDevelop.Ide.Gui.Components; -using MonoDevelop.Ide; - -namespace MonoDevelop.GtkCore.NodeBuilders -{ - public class ActionGroupNodeBuilder: TypeNodeBuilder - { - public override Type CommandHandlerType { - get { return typeof(ActionGroupCommandHandler); } - } - - public override string ContextMenuAddinPath { - get { return "/MonoDevelop/GtkCore/ContextMenu/ProjectPad.ActionGroup"; } - } - - public override Type NodeDataType { - get { return typeof(Stetic.ActionGroupInfo); } - } - - public override string GetNodeName (ITreeNavigator thisNode, object dataObject) - { - Stetic.ActionGroupInfo group = (Stetic.ActionGroupInfo) dataObject; - return group.Name; - } - - public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo) - { - Stetic.ActionGroupInfo group = (Stetic.ActionGroupInfo) dataObject; - nodeInfo.Label = group.Name; - nodeInfo.Icon = Context.GetIcon ("md-gtkcore-actiongroup"); - } - - public override void OnNodeAdded (object dataObject) - { - Stetic.ActionGroupInfo group = (Stetic.ActionGroupInfo) dataObject; - group.Changed += new EventHandler (OnChanged); - } - - public override void OnNodeRemoved (object dataObject) - { - Stetic.ActionGroupInfo group = (Stetic.ActionGroupInfo) dataObject; - group.Changed -= new EventHandler (OnChanged); - } - - void OnChanged (object s, EventArgs a) - { - ITreeBuilder tb = Context.GetTreeBuilder (s); - if (tb != null) - tb.Update (); - } - } - - class ActionGroupCommandHandler: NodeCommandHandler - { - public override async void ActivateItem () - { - GuiBuilderWindow w = (GuiBuilderWindow) CurrentNode.GetParentDataItem (typeof(GuiBuilderWindow), false); - if (w != null) { - if (w.SourceCodeFile == FilePath.Null && !w.BindToClass ()) - return; - - Document doc = await IdeApp.Workbench.OpenDocument (w.SourceCodeFile, null, true); - if (doc != null) { - GuiBuilderView view = doc.GetContent (); - if (view != null) - view.ShowActionDesignerView (((Stetic.ActionGroupInfo) CurrentNode.DataItem).Name); - } - } - else { - Project project = (Project) CurrentNode.GetParentDataItem (typeof(Project), false); - Stetic.ActionGroupInfo group = (Stetic.ActionGroupInfo) CurrentNode.DataItem; - await GuiBuilderService.OpenActionGroup (project, group); - } - } - - public override bool CanDeleteItem () - { - // Don't allow deleting action groups local to a window - GuiBuilderWindow w = (GuiBuilderWindow) CurrentNode.GetParentDataItem (typeof(GuiBuilderWindow), false); - return (w == null); - } - - public override void DeleteItem () - { - // Don't allow deleting action groups local to a window - GuiBuilderWindow w = (GuiBuilderWindow) CurrentNode.GetParentDataItem (typeof(GuiBuilderWindow), false); - if (w != null) - return; - - Project project = (Project) CurrentNode.GetParentDataItem (typeof(Project), false); - Stetic.ActionGroupInfo group = (Stetic.ActionGroupInfo) CurrentNode.DataItem; - GuiBuilderProject gproject = GtkDesignInfo.FromProject (project).GuiBuilderProject; - string sfile = gproject.GetSourceCodeFile (group); - - if (sfile != null) { - using (ConfirmWindowDeleteDialog dialog = new ConfirmWindowDeleteDialog (group.Name, sfile, group)) { - if (dialog.Run () == (int) Gtk.ResponseType.Yes) { - if (dialog.DeleteFile) { - ProjectFile file = project.GetProjectFile (sfile); - if (file != null) - project.Files.Remove (file); - } - gproject.RemoveActionGroup (group); - gproject.SaveProject (false); - IdeApp.ProjectOperations.SaveAsync (project); - } - } - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs deleted file mode 100644 index 42cfbd603d8..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs +++ /dev/null @@ -1,192 +0,0 @@ -// -// ProjectFolderNodeBuilderExtension.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System; -using MonoDevelop.Projects; -using MonoDevelop.Ide.Gui.Pads.ProjectPad; -using MonoDevelop.Components.Commands; -using MonoDevelop.GtkCore.GuiBuilder; -using MonoDevelop.Ide.Gui.Components; -using MonoDevelop.Ide; - -namespace MonoDevelop.GtkCore.NodeBuilders -{ - class ProjectFolderNodeBuilderExtension: NodeBuilderExtension - { - public override bool CanBuildNode (Type dataType) - { - return typeof(ProjectFolder).IsAssignableFrom (dataType) || - typeof(DotNetProject).IsAssignableFrom (dataType); - } - - public override Type CommandHandlerType { - get { return typeof(UserInterfaceCommandHandler); } - } - - public override void GetNodeAttributes (ITreeNavigator treeNavigator, object dataObject, ref NodeAttributes attributes) - { - if (treeNavigator.Options ["ShowAllFiles"]) - return; - - ProjectFolder folder = dataObject as ProjectFolder; - if (folder != null && folder.Project is DotNetProject) { - GtkDesignInfo info = GtkDesignInfo.FromProject (folder.Project); - if (info.GtkGuiFolder == folder.Path) - attributes |= NodeAttributes.Hidden; - } - } - } - - class UserInterfaceCommandHandler: NodeCommandHandler - { - [CommandHandler (MonoDevelop.GtkCore.GtkCommands.AddNewDialog)] - public void AddNewDialogToProject() - { - AddNewWindow ("DialogFileTemplate"); - } - - [CommandUpdateHandler (MonoDevelop.GtkCore.GtkCommands.AddNewDialog)] - public void UpdateAddNewDialogToProject (CommandInfo cinfo) - { - cinfo.Visible = CanAddWindow (); - } - - [CommandHandler (MonoDevelop.GtkCore.GtkCommands.AddNewWindow)] - public void AddNewWindowToProject() - { - AddNewWindow ("WindowFileTemplate"); - } - - [CommandUpdateHandler (MonoDevelop.GtkCore.GtkCommands.AddNewWindow)] - public void UpdateAddNewWindowToProject (CommandInfo cinfo) - { - cinfo.Visible = CanAddWindow (); - } - - [CommandHandler (MonoDevelop.GtkCore.GtkCommands.AddNewWidget)] - public void AddNewWidgetToProject() - { - AddNewWindow ("WidgetFileTemplate"); - } - - [CommandUpdateHandler (MonoDevelop.GtkCore.GtkCommands.AddNewWidget)] - public void UpdateAddNewWidgetToProject (CommandInfo cinfo) - { - cinfo.Visible = CanAddWindow (); - } - - [CommandHandler (MonoDevelop.GtkCore.GtkCommands.AddNewActionGroup)] - public void AddNewActionGroupToProject() - { - AddNewWindow ("ActionGroupFileTemplate"); - } - - [CommandUpdateHandler (MonoDevelop.GtkCore.GtkCommands.AddNewActionGroup)] - public void UpdateAddNewActionGroupToProject(CommandInfo cinfo) - { - cinfo.Visible = CanAddWindow (); - } - - [CommandHandler (GtkCommands.ImportGladeFile)] - protected void OnImportGladeFile () - { - Project project = CurrentNode.GetParentDataItem (typeof(Project), true) as Project; - GuiBuilderService.ImportGladeFile (project); - } - - [CommandUpdateHandler (GtkCommands.ImportGladeFile)] - protected void UpdateImportGladeFile (CommandInfo cinfo) - { - cinfo.Visible = CanAddWindow (); - } - - [CommandHandler (GtkCommands.EditIcons)] - protected void OnEditIcons () - { - Project project = CurrentNode.GetParentDataItem (typeof(Project), true) as Project; - GuiBuilderProject gp = GtkDesignInfo.FromProject (project).GuiBuilderProject; - Stetic.Project sp = gp.SteticProject; - sp.EditIcons (); - gp.SaveProject (true); - } - - [CommandUpdateHandler (GtkCommands.EditIcons)] - protected void UpdateEditIcons (CommandInfo cinfo) - { - cinfo.Visible = CanAddWindow (); - } - - [CommandHandler (GtkCommands.GtkSettings)] - protected void OnGtkSettings () - { - Project project = CurrentNode.GetParentDataItem (typeof(Project), true) as Project; - IdeApp.ProjectOperations.ShowOptions (project, "SteticOptionsPanel"); - } - - [CommandUpdateHandler (GtkCommands.EditIcons)] - protected void UpdateGtkSettings (CommandInfo cinfo) - { - cinfo.Visible = CanAddWindow (); - } - - bool CanAddWindow () - { - DotNetProject project = CurrentNode.GetParentDataItem (typeof(Project), true) as DotNetProject; - return GtkDesignInfo.SupportsDesigner (project); - } - - public void AddNewWindow (string id) - { - DotNetProject project = CurrentNode.GetParentDataItem (typeof(Project), true) as DotNetProject; - if (project == null) - return; - - object dataItem = CurrentNode.DataItem; - - ProjectFolder folder = CurrentNode.GetParentDataItem (typeof(ProjectFolder), true) as ProjectFolder; - - if (project.UsePartialTypes) - id = "Partial" + id; - - string path; - if (folder != null) - path = folder.Path; - else - path = project.BaseDirectory; - - IdeApp.ProjectOperations.CreateProjectFile (project, path, id); - - IdeApp.ProjectOperations.SaveAsync (project); - - ITreeNavigator nav = Tree.GetNodeAtObject (dataItem); - if (nav != null) - nav.Expanded = true; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs deleted file mode 100644 index 28b187f62b1..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs +++ /dev/null @@ -1,83 +0,0 @@ -// -// ProjectNodeBuilder.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -using MonoDevelop.Projects; -using MonoDevelop.Core; -using MonoDevelop.Ide.Gui.Pads; -using MonoDevelop.Ide.Gui; -using MonoDevelop.Ide.Gui.Components; - -using MonoDevelop.GtkCore.GuiBuilder; - -namespace MonoDevelop.GtkCore.NodeBuilders -{ - public class ProjectNodeBuilder: NodeBuilderExtension - { - static ProjectNodeBuilder instance; - - public override bool CanBuildNode (Type dataType) - { - return typeof(DotNetProject).IsAssignableFrom (dataType); - } - - protected override void Initialize () - { - base.Initialize (); - - lock (typeof (ProjectNodeBuilder)) - instance = this; - } - - public override void Dispose () - { - lock (typeof (ProjectNodeBuilder)) - instance = null; - - base.Dispose (); - } - - public override void BuildChildNodes (ITreeBuilder builder, object dataObject) - { - if (GtkDesignInfo.HasDesignedObjects ((Project)dataObject)) - builder.AddChild (new WindowsFolder ((Project)dataObject)); - } - - public static void OnSupportChanged (Project p) - { - if (instance == null) - return; - - ITreeBuilder tb = instance.Context.GetTreeBuilder (p); - if (tb != null) - tb.UpdateAll (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs deleted file mode 100644 index a8088a2ad60..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs +++ /dev/null @@ -1,87 +0,0 @@ - -using System; -using Gdk; - -using MonoDevelop.Ide.Gui.Pads; -using MonoDevelop.Core; -using MonoDevelop.Projects; -using MonoDevelop.Components.Commands; -using MonoDevelop.GtkCore.GuiBuilder; -using MonoDevelop.Ide.Gui.Components; - -namespace MonoDevelop.GtkCore.NodeBuilders -{ - class StockIconsNode - { - public StockIconsNode (Project project) - { - this.Project = project; - } - - public Project Project; - } - - public class StockIconsNodeBuilder: TypeNodeBuilder - { - Xwt.Drawing.Image iconsIcon; - - public override Type NodeDataType { - get { return typeof(StockIconsNode); } - } - - public override Type CommandHandlerType { - get { return typeof(StockIconsNodeCommandHandler); } - } - - public override string ContextMenuAddinPath { - get { return "/MonoDevelop/GtkCore/ContextMenu/ProjectPad.StockIcons"; } - } - public StockIconsNodeBuilder () - { - try { - iconsIcon = Xwt.Drawing.Image.FromResource ("image-x-generic.png"); - } catch (Exception e) { - Console.WriteLine ("Error while loading pixbuf 'image-x-generic.png': " + e); - } - } - public override int GetSortIndex (ITreeNavigator node) - { - return -100; - } - - public override string GetNodeName (ITreeNavigator thisNode, object dataObject) - { - return "StockIcons"; - } - - public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo) - { - nodeInfo.Label = GettextCatalog.GetString ("Stock Icons"); - nodeInfo.Icon = iconsIcon; - } - } - - public class StockIconsNodeCommandHandler: NodeCommandHandler - { - public override void ActivateItem () - { - StockIconsNode node = (StockIconsNode) CurrentNode.DataItem; - GtkDesignInfo info = GtkDesignInfo.FromProject (node.Project); - GuiBuilderProject gp = info.GuiBuilderProject; - Stetic.Project sp = gp.SteticProject; - sp.ImagesRootPath = FileService.AbsoluteToRelativePath (info.GtkGuiFolder, gp.Project.BaseDirectory); - sp.ImportFileCallback = delegate (string file) { - return GuiBuilderService.ImportFile (gp.Project, file); - }; - sp.EditIcons (); - gp.SaveProject (true); - } - - [CommandHandler (GtkCommands.EditIcons)] - protected void OnEditIcons () - { - ActivateItem (); - } - } -} - diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs deleted file mode 100644 index 21bf56999c6..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs +++ /dev/null @@ -1,147 +0,0 @@ -// -// WidgetNodeBuilder.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -using MonoDevelop.Projects; -using MonoDevelop.Core; -using MonoDevelop.Ide.Gui; -using MonoDevelop.Ide.Gui.Components; -using MonoDevelop.GtkCore.GuiBuilder; -using MonoDevelop.GtkCore.Dialogs; -using MonoDevelop.Ide; - -namespace MonoDevelop.GtkCore.NodeBuilders -{ - public class WidgetNodeBuilder: TypeNodeBuilder - { - WindowEventHandler onChanged; - - public WidgetNodeBuilder () - { - onChanged = new WindowEventHandler (OnChanged); - } - - public override Type CommandHandlerType { - get { return typeof(GladeWindowCommandHandler); } - } - - public override string ContextMenuAddinPath { - get { return "/MonoDevelop/GtkCore/ContextMenu/ProjectPad.Component"; } - } - - public override Type NodeDataType { - get { return typeof(GuiBuilderWindow); } - } - - public override string GetNodeName (ITreeNavigator thisNode, object dataObject) - { - GuiBuilderWindow win = (GuiBuilderWindow) dataObject; - return win.Name; - } - - public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo) - { - GuiBuilderWindow win = (GuiBuilderWindow) dataObject; - nodeInfo.Label = win.Name; - -// if (win.RootWidget.IsWindow) -// icon = ImageService.GetPixbuf ("md-gtkcore-window"); - if (win.RootWidget.IsWindow) - nodeInfo.Icon = Context.GetIcon ("md-gtkcore-dialog"); - else - nodeInfo.Icon = Context.GetIcon ("md-gtkcore-widget"); - } - - public override void BuildChildNodes (ITreeBuilder builder, object dataObject) - { - GuiBuilderWindow win = (GuiBuilderWindow) dataObject; - builder.AddChildren (win.RootWidget.ActionGroups); - } - - public override bool HasChildNodes (ITreeBuilder builder, object dataObject) - { - GuiBuilderWindow win = (GuiBuilderWindow) dataObject; - return win.RootWidget.ActionGroups.GetEnumerator().MoveNext (); - } - - public override void OnNodeAdded (object dataObject) - { - GuiBuilderWindow win = (GuiBuilderWindow) dataObject; - win.Changed += onChanged; - } - - public override void OnNodeRemoved (object dataObject) - { - GuiBuilderWindow win = (GuiBuilderWindow) dataObject; - win.Changed -= onChanged; - } - - void OnChanged (object s, WindowEventArgs a) - { - ITreeBuilder tb = Context.GetTreeBuilder (a.Window); - if (tb != null) - tb.UpdateAll (); - } - } - - class GladeWindowCommandHandler: NodeCommandHandler - { - public override async void ActivateItem () - { - GuiBuilderWindow w = (GuiBuilderWindow) CurrentNode.DataItem; - if (w.SourceCodeFile == FilePath.Null && !w.BindToClass ()) - return; - - Document doc = await IdeApp.Workbench.OpenDocument (w.SourceCodeFile, null, true); - if (doc != null) { - GuiBuilderView view = doc.GetContent (); - if (view != null) - view.ShowDesignerView (); - } - } - - public override void DeleteItem () - { - GuiBuilderWindow w = (GuiBuilderWindow) CurrentNode.DataItem; - string fn = FileService.AbsoluteToRelativePath (w.Project.Project.BaseDirectory, w.SourceCodeFile); - using (ConfirmWindowDeleteDialog dialog = new ConfirmWindowDeleteDialog (w.Name, fn, w.RootWidget)) { - if (dialog.Run () == (int) Gtk.ResponseType.Yes) { - if (dialog.DeleteFile) { - ProjectFile file = w.Project.Project.GetProjectFile (w.SourceCodeFile); - if (file != null) - w.Project.Project.Files.Remove (file); - } - w.Project.Remove (w); - w.Project.SaveProject (false); - IdeApp.ProjectOperations.SaveAsync (w.Project.Project); - } - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs deleted file mode 100644 index 796e5e14b0f..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs +++ /dev/null @@ -1,78 +0,0 @@ -// -// WindowsFolder.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using MonoDevelop.Projects; -using MonoDevelop.GtkCore.GuiBuilder; - -namespace MonoDevelop.GtkCore.NodeBuilders -{ - class WindowsFolder - { - Project project; - GuiBuilderProject gproject; - - public event EventHandler Changed; - - public WindowsFolder (Project project) - { - this.project = project; - GtkDesignInfo info = GtkDesignInfo.FromProject (project); - - gproject = info.GuiBuilderProject; - gproject.Changed += OnUpdateFiles; - } - - public void Dispose () - { - gproject.Changed -= OnUpdateFiles; - } - - void OnUpdateFiles (object s, EventArgs args) - { - if (Changed != null) Changed (this, EventArgs.Empty); - } - - public Project Project { - get { return project; } - } - - public override bool Equals (object obj) - { - WindowsFolder wf = obj as WindowsFolder; - return wf != null && wf.project == project; - } - - public override int GetHashCode ( ) - { - unchecked { - return project.GetHashCode () * 234; - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs deleted file mode 100644 index 2e1b0f44ea8..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs +++ /dev/null @@ -1,114 +0,0 @@ -// -// WindowsFolderNodeBuilder.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -using MonoDevelop.Projects; -using MonoDevelop.Core; -using MonoDevelop.Ide.Gui; -using MonoDevelop.GtkCore.GuiBuilder; -using MonoDevelop.Ide.Gui.Components; -using MonoDevelop.Ide; - -namespace MonoDevelop.GtkCore.NodeBuilders -{ - public class WindowsFolderNodeBuilder: TypeNodeBuilder - { - public override Type NodeDataType { - get { return typeof(WindowsFolder); } - } - - public override Type CommandHandlerType { - get { return typeof(UserInterfaceCommandHandler); } - } - - public override string ContextMenuAddinPath { - get { return "/MonoDevelop/GtkCore/ContextMenu/ProjectPad.UserInterfaceFolder"; } - } - - public override string GetNodeName (ITreeNavigator thisNode, object dataObject) - { - return "UserInterface"; - } - - public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo) - { - Project p = ((WindowsFolder)dataObject).Project; - GtkDesignInfo info = GtkDesignInfo.FromProject (p); - if (info.GuiBuilderProject.HasError) { - nodeInfo.Label = GettextCatalog.GetString ("User Interface (GUI project load failed)"); - } else { - nodeInfo.Label = GettextCatalog.GetString ("User Interface"); - } - nodeInfo.Icon = Context.GetIcon (Stock.OpenResourceFolder); - nodeInfo.ClosedIcon = Context.GetIcon (Stock.ClosedResourceFolder); - } - - public override void BuildChildNodes (ITreeBuilder builder, object dataObject) - { - Project p = ((WindowsFolder)dataObject).Project; - GtkDesignInfo info = GtkDesignInfo.FromProject (p); - if (!info.GuiBuilderProject.HasError) { - builder.AddChild (new StockIconsNode (p)); - builder.AddChildren (info.GuiBuilderProject.Windows); - builder.AddChildren (info.GuiBuilderProject.SteticProject.ActionGroups); - } - } - - public override bool HasChildNodes (ITreeBuilder builder, object dataObject) - { - return true; - } - - public override int GetSortIndex (ITreeNavigator node) - { - return -200; - } - - public override void OnNodeAdded (object dataObject) - { - WindowsFolder w = (WindowsFolder) dataObject; - w.Changed += OnUpdateFiles; - } - - public override void OnNodeRemoved (object dataObject) - { - WindowsFolder w = (WindowsFolder)dataObject; - w.Changed -= OnUpdateFiles; - w.Dispose (); - } - - void OnUpdateFiles (object s, EventArgs args) - { - ITreeBuilder tb = Context.GetTreeBuilder (s); - if (tb != null) { - tb.UpdateAll (); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.addin.xml b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.addin.xml deleted file mode 100644 index 4c42bffbb91..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.addin.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.csproj b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.csproj deleted file mode 100644 index d80594fc0a8..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.csproj +++ /dev/null @@ -1,183 +0,0 @@ - - - - Debug - AnyCPU - {7FCDB0D9-AA7D-44E4-BE74-55312B432389} - $(MDFrameworkVersion) - ..\..\..\build\AddIns\MonoDevelop.GtkCore - - - - - - - - - - - - - - - - - - ..\..\..\build\bin\System.Reflection.Metadata.dll - False - - - ..\..\..\build\bin\System.Collections.Immutable.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.CSharp.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.Workspaces.dll - False - - - ..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.dll - False - - - ..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.Mdb.dll - False - - - ..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.Pdb.dll - False - - - ..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.Rocks.dll - False - - - - - {7525BB88-6142-4A26-93B9-A30C6983390A} - MonoDevelop.Core - False - - - {27096E7F-C91C-4AC6-B289-6897A701DF21} - MonoDevelop.Ide - False - - - {2C24D515-4A2C-445C-8419-C09231913CFA} - MonoDevelop.DesignerSupport - False - - - {9BC670A8-1851-40EC-9685-279F4C98433D} - MonoDevelop.Deployment - False - - - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9} - libstetic - False - - - {7926DB5B-96A7-47A7-9870-DB42FA5C3548} - libsteticui - False - - - {100568FC-F4E8-439B-94AD-41D11724E45B} - MonoDevelop.Refactoring - False - - - {91DD5A2D-9FE3-4C3C-9253-876141874DAD} - Mono.Addins - False - - - {92494904-35FA-4DC9-BDE9-3A3E87AC49D3} - Xwt - False - - - {07CC7654-27D6-421D-A64C-0FFA40456FA2} - CSharpBinding - False - - - {53DCA265-3C3C-42F9-B647-F72BA678122B} - ICSharpCode.NRefactory.CSharp - False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/Counters.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/Counters.cs deleted file mode 100644 index 8b428d82833..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/Counters.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// Counters.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (c) 2009 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using MonoDevelop.Core.Instrumentation; - -namespace MonoDevelop.GtkCore -{ - internal static class Counters - { - public static Counter GuiProjectsInMemory = InstrumentationService.CreateCounter ("GUI Projects in Memory", "GTK# Designer"); - public static Counter GuiProjectsLoaded = InstrumentationService.CreateCounter ("GUI Projects Loaded", "GTK# Designer"); - public static Counter SteticProjectsLoaded = InstrumentationService.CreateCounter ("Stetic Projects Loaded", "GTK# Designer"); - public static TimerCounter SteticFileGeneratedTimer = InstrumentationService.CreateTimerCounter ("Stetic File Generated", "GTK# Designer"); - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/GtkCoreService.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/GtkCoreService.cs deleted file mode 100644 index ce3bf3268a5..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/GtkCoreService.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// GtkCoreService.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections.Generic; -using MonoDevelop.Core; -using MonoDevelop.Components.Commands; - -namespace MonoDevelop.GtkCore -{ - class GtkCoreStartupCommand: CommandHandler - { - protected override void Run() - { - ReferenceManager.Initialize (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/GtkDesignInfo.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/GtkDesignInfo.cs deleted file mode 100644 index 628ae3560a6..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/GtkDesignInfo.cs +++ /dev/null @@ -1,366 +0,0 @@ -// -// GtkDesignInfo.cs -// -// Authors: -// Lluis Sanchez Gual -// Mike Kestner -// -// Copyright (C) 2006-2008 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.IO; -using System.Collections.Specialized; - -using MonoDevelop.Core; -using MonoDevelop.Projects; -using MonoDevelop.Core.Serialization; -using MonoDevelop.GtkCore.GuiBuilder; -using MonoDevelop.GtkCore.NodeBuilders; -using MonoDevelop.Ide; -using MonoDevelop.Ide.TypeSystem; - -namespace MonoDevelop.GtkCore -{ - public class GtkDesignInfo: IDisposable - { - DotNetProject project; - GuiBuilderProject builderProject; - LanguageBinding binding; - ProjectResourceProvider resourceProvider; - ReferenceManager referenceManager; - - [ItemProperty (DefaultValue=true)] - bool generateGettext = true; - - [ItemProperty (DefaultValue="Mono.Unix.Catalog")] - string gettextClass = "Mono.Unix.Catalog"; - - [ItemProperty (DefaultValue="Gdk.Pixbuf")] - string imageResourceLoaderClass = "Gdk.Pixbuf"; - - internal GtkDesignInfo () - { - } - - internal GtkDesignInfo (DotNetProject project) - { - Project = project; - } - - internal DotNetProject Project { - get { return project; } - set { - if (project == value) - return; - - if (project != null) { - project.FileAddedToProject -= OnFileEvent; - project.FileChangedInProject -= OnFileEvent; - project.FileRemovedFromProject -= OnFileEvent; - binding = null; - if (referenceManager != null) - referenceManager.Dispose (); - referenceManager = null; - } - project = value; - if (project != null) { - binding = LanguageBindingService.GetBindingPerLanguageName (project.LanguageName); - project.FileAddedToProject += OnFileEvent; - project.FileChangedInProject += OnFileEvent; - project.FileRemovedFromProject += OnFileEvent; - } - } - } - - void OnFileEvent (object o, ProjectFileEventArgs args) - { - if (!IdeApp.IsInitialized || !IdeApp.Workspace.IsOpen || !File.Exists (ObjectsFile)) - return; - - UpdateObjectsFile (); - } - - public void Dispose () - { - if (resourceProvider != null) - System.Runtime.Remoting.RemotingServices.Disconnect (resourceProvider); - resourceProvider = null; - if (builderProject != null) - builderProject.Dispose (); - builderProject = null; - if (referenceManager != null) - referenceManager.Dispose (); - referenceManager = null; - Project = null; - } - - public GuiBuilderProject GuiBuilderProject { - get { - if (builderProject == null) { - if (SupportsDesigner (project)) { - if (!File.Exists (SteticFile)) { - UpdateGtkFolder (); - ProjectNodeBuilder.OnSupportChanged (project); - } - builderProject = GuiBuilderService.CreateBuilderProject (project, SteticFile); - } else - builderProject = GuiBuilderService.CreateBuilderProject (project, null); - } - return builderProject; - } - } - - public ReferenceManager ReferenceManager { - get { - if (referenceManager == null) - referenceManager = new ReferenceManager (project); - return referenceManager; - } - } - - public void ReloadGuiBuilderProject () - { - if (builderProject != null) - builderProject.Reload (); - } - - public ProjectResourceProvider ResourceProvider { - get { - if (resourceProvider == null) { - resourceProvider = new ProjectResourceProvider (project); - System.Runtime.Remoting.RemotingServices.Marshal (resourceProvider, null, typeof(Stetic.IResourceProvider)); - } - return resourceProvider; - } - } - - FilePath ObjectsFile { - get { return GtkGuiFolder.Combine ("objects.xml"); } - } - - public FilePath SteticGeneratedFile { - get { return GtkGuiFolder.Combine (binding.GetFileName ("generated")); } - } - - public FilePath SteticFile { - get { return GtkGuiFolder.Combine ("gui.stetic"); } - } - - public FilePath GtkGuiFolder { - get { return project.BaseDirectory.Combine ("gtk-gui"); } - } - - public bool GenerateGettext { - get { return generateGettext; } - set { - generateGettext = value; - // Set to default value if gettext is not enabled - if (!generateGettext) - gettextClass = "Mono.Unix.Catalog"; - } - } - - public string GettextClass { - get { return gettextClass; } - set { gettextClass = value; } - } - - public string ImageResourceLoaderClass { - get { return imageResourceLoaderClass; } - set { imageResourceLoaderClass = value; } - } - - public static bool HasDesignedObjects (Project project) - { - if (project == null || !SupportsDesigner (project)) - return false; - - return File.Exists (Path.Combine (project.BaseDirectory, "gtk-gui", "gui.stetic")); - } - - static bool steticDisabled = !string.IsNullOrEmpty (Environment.GetEnvironmentVariable ("DISABLE_STETIC")); - public static bool SupportsDesigner (Project project) - { - if (steticDisabled) { - return false; - } - DotNetProject dnp = project as DotNetProject; - return dnp != null && HasGtkReference (dnp) && SupportsRefactoring (dnp); - } - - public static bool SupportsRefactoring (DotNetProject project) - { - if (project == null || project.LanguageBinding == null || project.LanguageBinding.GetCodeDomProvider () == null) - return false; - if (project.ExtendedProperties.Contains ("GtkRefactoringSupported")) - return (bool)project.ExtendedProperties ["GtkRefactoringSupported"]; - - var testFileName = project.LanguageBinding.GetFileName ("test"); - bool hasSupport = CodeGenerator.HasGenerator (DesktopService.GetMimeTypeForUri (testFileName)); - project.ExtendedProperties ["GtkRefactoringSupported"] = hasSupport; - return hasSupport; - } - - static bool IsGtkReference (ProjectReference pref) - { - if (pref.ReferenceType != ReferenceType.Package) - return false; - - return pref.StoredReference.StartsWith ("gtk-sharp,", StringComparison.Ordinal); - } - - static bool HasGtkReference (DotNetProject project) - { - if (project.ExtendedProperties.Contains ("GtkReferenceExists")) - return (bool)project.ExtendedProperties ["GtkReferenceExists"]; - - bool found = false; - foreach (ProjectReference pref in project.References) - if (IsGtkReference (pref)) { - found = true; - break; - } - project.ExtendedProperties ["GtkReferenceExists"] = found; - return found; - } - - public void ForceCodeGenerationOnBuild () - { - if (!SupportsDesigner (project)) - return; - try { - FileInfo fi = new FileInfo (SteticFile); - fi.LastWriteTime = DateTime.Now; - } catch { - // Ignore errors here - } - } - - bool CleanGtkFolder (StringCollection remaining_files) - { - bool projectModified = false; - - // Remove all project files which are not in the generated list - foreach (ProjectFile pf in project.Files.GetFilesInPath (GtkGuiFolder)) { - if (remaining_files.Contains (pf.FilePath)) - continue; - - project.Files.Remove (pf); - FileService.DeleteFile (pf.FilePath); - projectModified = true; - } - - if (remaining_files.Count == 0) - FileService.DeleteDirectory (GtkGuiFolder); - - return projectModified; - } - - public bool UpdateGtkFolder () - { - if (!SupportsDesigner (project)) - return false; - - // This method synchronizes the current gtk project configuration info - // with the needed support files in the gtk-gui folder. - - FileService.CreateDirectory (GtkGuiFolder); - bool projectModified = false; - bool initialGeneration = false; - - if (!File.Exists (SteticFile)) { - initialGeneration = true; - StreamWriter sw = new StreamWriter (SteticFile); - sw.WriteLine (""); - sw.Close (); - } - - if (!project.IsFileInProject (SteticFile)) { - ProjectFile pf = project.AddFile (SteticFile, BuildAction.EmbeddedResource); - pf.ResourceId = "gui.stetic"; - projectModified = true; - } - - StringCollection files = GuiBuilderProject.GenerateFiles (GtkGuiFolder); - DateTime generatedTime = File.GetLastWriteTime (SteticFile).Subtract (TimeSpan.FromSeconds (2)); - - foreach (string filename in files) { - if (initialGeneration) { - // Ensure that the generation date of this file is < the date of the .stetic file - // In this way the code will be properly regenerated when building the project. - File.SetLastWriteTime (filename, generatedTime); - } - if (!project.IsFileInProject (filename)) { - project.AddFile (filename, BuildAction.Compile); - projectModified = true; - } - } - - UpdateObjectsFile (); - files.Add (ObjectsFile); - files.Add (SteticFile); - - if (CleanGtkFolder (files)) - projectModified = true; - - return ReferenceManager.Update () || projectModified; - } - - void UpdateObjectsFile () - { - if (!File.Exists (ObjectsFile)) - return; - - ObjectsDocument doc = new ObjectsDocument (ObjectsFile); - doc.Update (GuiBuilderProject.WidgetParser, GuiBuilderProject.SteticProject); - } - - public static void DisableProject (Project project) - { - if (HasDesignedObjects (project)) - return; - - GtkDesignInfo info = FromProject (project); - StringCollection saveFiles = new StringCollection (); - saveFiles.AddRange (new string[] {info.ObjectsFile, info.SteticFile}); - info.CleanGtkFolder (saveFiles); - project.Files.Remove (info.ObjectsFile); - project.Files.Remove (info.SteticFile); - - var ext = project.GetService (); - if (ext != null) - ext.DesignInfo = null; - info.Dispose (); - - ProjectNodeBuilder.OnSupportChanged (project); - } - - public static GtkDesignInfo FromProject (Project project) - { - var ext = project.GetService (); - if (ext != null) - return ext.DesignInfo; - return new GtkDesignInfo (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ObjectsDocument.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ObjectsDocument.cs deleted file mode 100644 index 9595cfed2c3..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ObjectsDocument.cs +++ /dev/null @@ -1,310 +0,0 @@ -// -// ObjectsDocument.cs -// -// Authors: -// Lluis Sanchez Gual -// Mike Kestner -// -// Copyright (C) 2006-2008 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Xml; -using System.CodeDom; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using MonoDevelop.Ide.TypeSystem; -using Microsoft.CodeAnalysis; -using ICSharpCode.NRefactory6.CSharp; -using MonoDevelop.CSharp.Refactoring; -using MonoDevelop.Refactoring; - -namespace MonoDevelop.GtkCore -{ - - - public class ObjectsDocument : XmlDocument - { - string path; - - public ObjectsDocument (string path) : base () - { - this.path = path; - Load (path); - } - - public StringCollection ObjectNames { - get { - StringCollection names = new StringCollection (); - foreach (XmlNode node in DocumentElement) { - if (node.Name != "object") - continue; - XmlElement elem = node as XmlElement; - names.Add (elem.GetAttribute ("type")); - } - return names; - } - } - - enum SyncState - { - Unspecified, - Off, - On, - } - - SyncState AttrSyncState { - get { - if (DocumentElement.HasAttribute ("attr-sync")) { - if (string.Equals (DocumentElement.GetAttribute ("attr-sync"), "off", StringComparison.OrdinalIgnoreCase)) - return SyncState.Off; - else - return SyncState.On; - } else - return SyncState.Unspecified; - } - set { - switch (value) { - case SyncState.Unspecified: - DocumentElement.RemoveAttribute ("attr-sync"); - break; - case SyncState.Off: - DocumentElement.SetAttribute ("attr-sync", "off"); - break; - case SyncState.On: - DocumentElement.SetAttribute ("attr-sync", "on"); - break; - default: - throw new ArgumentOutOfRangeException ("value"); - } - Save (); - } - } - - public void Save () - { - //Always write line endings as \n to be consistent with other stetic files - //and explicitly write with no BOM or XML declaration in order to be consistent with existing format. - var settings = new XmlWriterSettings () { - Encoding = Stetic.EncodingUtility.UTF8NoBom, - NewLineChars = "\n", - Indent = true, - OmitXmlDeclaration = true, - }; - using (var writer = XmlTextWriter.Create (path, settings)) { - Save (writer); - } - } - void InsertToolboxItemAttributes (WidgetParser parser) - { - var tb_items = parser.GetToolboxItems (); - foreach (string clsname in ObjectNames) { - if (tb_items.ContainsKey (clsname)) - continue; - - var cls = parser.GetClass (clsname); - if (cls == null) - continue; - CodeGenerationService.AddAttribute (cls, "System.ComponentModel.ToolboxItem", true); - XmlElement elem = DocumentElement.SelectSingleNode ("object[@type='" + clsname + "']") as XmlElement; - if (elem != null && elem.HasAttribute ("palette-category")) { - CodeGenerationService.AddAttribute (cls, "System.ComponentModel.Category", elem.GetAttribute ("palette-category")); - } - } - } - - public void Update (WidgetParser parser, Stetic.Project stetic) - { - if (AttrSyncState == SyncState.Unspecified) { - InsertToolboxItemAttributes (parser); - AttrSyncState = SyncState.On; - return; - } else if (AttrSyncState == SyncState.Off) - return; - - StringCollection tb_names = new StringCollection (); - foreach (var cls in parser.GetToolboxItems().Values) { - UpdateClass (parser, stetic, cls, null); - tb_names.Add (cls.GetFullName ()); - } - - List toDelete = new List (); - - foreach (XmlElement elem in SelectNodes ("objects/object")) { - string name = elem.GetAttribute ("type"); - if (!tb_names.Contains (name)) - toDelete.Add (elem); - } - - foreach (XmlElement elem in toDelete) - elem.ParentNode.RemoveChild (elem); - - Save (); - } - - void UpdateClass (WidgetParser parser, Stetic.Project stetic, ITypeSymbol widgetClass, ITypeSymbol wrapperClass) - { - string typeName = widgetClass.GetFullName(); - string basetypeName = GetBaseType (parser, widgetClass, stetic); - XmlElement objectElem = (XmlElement) SelectSingleNode ("objects/object[@type='" + typeName + "']"); - - if (objectElem == null) { - - // The widget class is not yet in the XML file. Create an element for it. - objectElem = CreateElement ("object"); - objectElem.SetAttribute ("type", typeName); - string category = widgetClass.GetComponentCategory(); - if (category == String.Empty) - objectElem.SetAttribute ("palette-category", "General"); - else - objectElem.SetAttribute ("palette-category", category); - objectElem.SetAttribute ("allow-children", "false"); - if (wrapperClass != null) - objectElem.SetAttribute ("wrapper", wrapperClass.GetFullName()); - - // By default add a reference to Gtk.Widget properties and events - XmlElement itemGroups = objectElem.OwnerDocument.CreateElement ("itemgroups"); - objectElem.AppendChild (itemGroups); - - itemGroups = objectElem.OwnerDocument.CreateElement ("signals"); - objectElem.AppendChild (itemGroups); - - objectElem.SetAttribute ("base-type", basetypeName); - DocumentElement.AppendChild (objectElem); - } - - UpdateObject (parser, basetypeName, objectElem, widgetClass, wrapperClass); - } - - string GetBaseType (WidgetParser parser, ITypeSymbol widgetClass, Stetic.Project stetic) - { - string[] types = stetic.GetWidgetTypes (); - Hashtable typesHash = new Hashtable (); - foreach (string t in types) - typesHash [t] = t; - - string ret = parser.GetBaseType (widgetClass, typesHash); - return ret ?? "Gtk.Widget"; - } - - void UpdateObject (WidgetParser parser, string topType, XmlElement objectElem, ITypeSymbol widgetClass, ITypeSymbol wrapperClass) - { - if (widgetClass.DeclaredAccessibility == Accessibility.Public) - objectElem.RemoveAttribute ("internal"); - else - objectElem.SetAttribute ("internal", "true"); - - ListDictionary properties = new ListDictionary (); - ListDictionary events = new ListDictionary (); - - parser.CollectMembers (widgetClass, true, topType, properties, events); - if (wrapperClass != null) - parser.CollectMembers (wrapperClass, false, null, properties, events); - - foreach (IPropertySymbol prop in properties.Values) - MergeProperty (parser, objectElem, prop); - - foreach (IEventSymbol ev in events.Values) - MergeEvent (parser, objectElem, ev); - - // Remove old properties - ArrayList toDelete = new ArrayList (); - foreach (XmlElement xprop in objectElem.SelectNodes ("itemgroups/itemgroup/property")) { - if (!properties.Contains (xprop.GetAttribute ("name"))) - toDelete.Add (xprop); - } - - // Remove old signals - foreach (XmlElement xevent in objectElem.SelectNodes ("signals/itemgroup/signal")) { - if (!events.Contains (xevent.GetAttribute ("name"))) - toDelete.Add (xevent); - } - - foreach (XmlElement el in toDelete) { - XmlElement pe = (XmlElement) el.ParentNode; - pe.RemoveChild (el); - if (pe.ChildNodes.Count == 0) - pe.ParentNode.RemoveChild (pe); - } - } - - void MergeProperty (WidgetParser parser, XmlElement objectElem, IPropertySymbol prop) - { - XmlElement itemGroups = objectElem ["itemgroups"]; - if (itemGroups == null) { - itemGroups = objectElem.OwnerDocument.CreateElement ("itemgroups"); - objectElem.AppendChild (itemGroups); - } - - string cat = prop.GetComponentCategory (); - XmlElement itemGroup = GetItemGroup (prop.ContainingType, itemGroups, cat, "Properties"); - - XmlElement propElem = (XmlElement) itemGroup.SelectSingleNode ("property[@name='" + prop.Name + "']"); - if (propElem == null) { - propElem = itemGroup.OwnerDocument.CreateElement ("property"); - propElem.SetAttribute ("name", prop.Name); - itemGroup.AppendChild (propElem); - } - } - - void MergeEvent (WidgetParser parser, XmlElement objectElem, IEventSymbol evnt) - { - XmlElement itemGroups = objectElem ["signals"]; - if (itemGroups == null) { - itemGroups = objectElem.OwnerDocument.CreateElement ("signals"); - objectElem.AppendChild (itemGroups); - } - - string cat = evnt.GetComponentCategory (); - XmlElement itemGroup = GetItemGroup (evnt.ContainingType, itemGroups, cat, "Signals"); - - XmlElement signalElem = (XmlElement) itemGroup.SelectSingleNode ("signal[@name='" + evnt.Name + "']"); - if (signalElem == null) { - signalElem = itemGroup.OwnerDocument.CreateElement ("signal"); - signalElem.SetAttribute ("name", evnt.Name); - itemGroup.AppendChild (signalElem); - } - } - - XmlElement GetItemGroup (ITypeSymbol cls, XmlElement itemGroups, string cat, string groupName) - { - XmlElement itemGroup; - - if (cat != "") - itemGroup = (XmlElement) itemGroups.SelectSingleNode ("itemgroup[@name='" + cat + "']"); - else - itemGroup = (XmlElement) itemGroups.SelectSingleNode ("itemgroup[(not(@name) or @name='') and not(@ref)]"); - - if (itemGroup == null) { - itemGroup = itemGroups.OwnerDocument.CreateElement ("itemgroup"); - if (cat != null && cat != "") { - itemGroup.SetAttribute ("name", cat); - itemGroup.SetAttribute ("label", cat); - } else - itemGroup.SetAttribute ("label", cls.Name + " " + groupName); - itemGroups.AppendChild (itemGroup); - } - return itemGroup; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ProjectResourceProvider.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ProjectResourceProvider.cs deleted file mode 100644 index 6128a6a9bfa..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ProjectResourceProvider.cs +++ /dev/null @@ -1,89 +0,0 @@ -// -// ProjectResourceProvider.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.IO; -using MonoDevelop.Projects; -using MonoDevelop.Ide; - -namespace MonoDevelop.GtkCore -{ - public class ProjectResourceProvider: MarshalByRefObject, Stetic.IResourceProvider - { - Project project; - - public ProjectResourceProvider (Project project) - { - this.project = project; - } - - public Stetic.ResourceInfo[] GetResources () - { - ArrayList list = new ArrayList (); - foreach (ProjectFile file in project.Files) { - if (file.BuildAction == BuildAction.EmbeddedResource) - list.Add (new Stetic.ResourceInfo (file.ResourceId, file.Name, DesktopService.GetMimeTypeForUri (file.Name))); - } - return (Stetic.ResourceInfo[]) list.ToArray (typeof(Stetic.ResourceInfo)); - } - - public Stream GetResourceStream (string resourceName) - { - foreach (ProjectFile file in project.Files) { - if (resourceName == file.ResourceId) - return File.OpenRead (file.Name); - } - return null; - } - - public Stetic.ResourceInfo AddResource (string fileName) - { - ProjectFile file = project.AddFile (fileName, BuildAction.EmbeddedResource); - IdeApp.ProjectOperations.SaveAsync (project); - return new Stetic.ResourceInfo (file.ResourceId, fileName); - } - - public void RemoveResource (string resourceName) - { - foreach (ProjectFile file in project.Files) { - if (resourceName == file.ResourceId) { - project.Files.Remove (file); - IdeApp.ProjectOperations.SaveAsync (project); - return; - } - } - } - - public override object InitializeLifetimeService () - { - return null; - } - } - -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ReferenceManager.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ReferenceManager.cs deleted file mode 100644 index 4f6ead6eabc..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ReferenceManager.cs +++ /dev/null @@ -1,300 +0,0 @@ -// ReferenceManager.cs -// -// Author: Mike Kestner -// -// Copyright (C) 2008 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -using System; -using System.Collections.Generic; - -using MonoDevelop.Core; -using MonoDevelop.Core.Assemblies; -using MonoDevelop.Projects; -using MonoDevelop.Ide; - -namespace MonoDevelop.GtkCore { - - public class ReferenceManager : IDisposable { - - DotNetProject project; - - public ReferenceManager (DotNetProject project) - { - this.project = project; - project.AssemblyContext.Changed += ResetSupportedVersions; - } - - public void Dispose () - { - project.AssemblyContext.Changed -= ResetSupportedVersions; - project = null; - } - - void ResetSupportedVersions (object o, EventArgs a) - { - supported_versions = null; - } - - string CurrentAssemblyVersion { - get { - foreach (ProjectReference pref in project.References) { - if (!IsGtkReference (pref)) - continue; - string val = pref.StoredReference; - int idx = val.IndexOf (",") + 1; - return val.Substring (idx).Trim (); - } - return String.Empty; - } - } - - public string GtkPackageVersion { - get { return GetGtkPackageVersion (CurrentAssemblyVersion); } - set { - if (String.IsNullOrEmpty (value)) - throw new ArgumentException ("value"); - - Update (GetGtkAssemblyVersion (value)); - } - } - - public string TargetGtkVersion { - get { - string assm_version = CurrentAssemblyVersion; - if (String.IsNullOrEmpty (assm_version)) - return String.Empty; - int idx = assm_version.IndexOf (","); - if (idx > 0) - assm_version = assm_version.Substring (0, idx); - idx = assm_version.IndexOf ("="); - if (idx > 0) - assm_version = assm_version.Substring (idx + 1); - string[] toks = assm_version.Split ('.'); - if (toks.Length > 1) - return toks[0] + "." + toks[1]; - return String.Empty; - } - } - - string GetGtkAssemblyVersion (string pkg_version) - { - if (String.IsNullOrEmpty (pkg_version)) - return String.Empty; - - pkg_version = pkg_version + "."; - foreach (SystemAssembly asm in project.AssemblyContext.GetAssemblies ()) { - if (asm.Name == "gtk-sharp" && asm.Version.StartsWith (pkg_version)) { - int i = asm.FullName.IndexOf (','); - return asm.FullName.Substring (i+1).Trim (); - } - } - return string.Empty; - } - - string GetGtkPackageVersion (string assembly_version) - { - if (String.IsNullOrEmpty (assembly_version)) - return String.Empty; - - int i = assembly_version.IndexOf ('='); - assembly_version = assembly_version.Substring (i+1); - return GetVersionPrefix (assembly_version); - } - - public bool Update () - { - return Update (CurrentAssemblyVersion); - } - - bool Update (string assm_version) - { - if (assm_version == null) - throw new ArgumentException (assm_version); - - bool changed = false; - updating = true; - - bool gdk = false, gtk = false, posix = false; - - foreach (ProjectReference r in new List (project.References)) { - if (r.ReferenceType != ReferenceType.Package) - continue; - string name = GetReferenceName (r); - if (name == "gdk-sharp") - gdk = true; - if (name == "gtk-sharp") - gtk = true; - else if (name == "Mono.Posix") - posix = true; - - // Is a gtk-sharp-2.0 assembly? - if (Array.IndexOf (gnome_assemblies, name) == -1) - continue; - - string sr = r.StoredReference; - string version = sr.Substring (sr.IndexOf (",") + 1).Trim (); - if (version != assm_version) { - project.References.Remove (r); - if (name == "gnome-sharp" && assm_version == "Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f") { - project.References.Add (ProjectReference.CreateAssemblyReference (name + ", Version=2.24.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f")); - } else { - project.References.Add (ProjectReference.CreateAssemblyReference (name + ", " + assm_version)); - } - changed = true; - } - } - - if (!gtk) { - project.References.Add (ProjectReference.CreateAssemblyReference ("gtk-sharp" + ", " + assm_version)); - project.ExtendedProperties ["GtkReferenceExists"] = true; - changed = true; - } - - if (!GtkDesignInfo.HasDesignedObjects (project)) - return changed; - - GtkDesignInfo info = GtkDesignInfo.FromProject (project); - if (!gdk) { - project.References.Add (ProjectReference.CreateAssemblyReference ("gdk-sharp" + ", " + assm_version)); - changed = true; - } - - if (!posix && info.GenerateGettext && info.GettextClass == "Mono.Unix.Catalog") { - // Add a reference to Mono.Posix. Use the version for the selected project's runtime version. - string aname = project.AssemblyContext.FindInstalledAssembly ("Mono.Posix, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756", null, project.TargetFramework); - if (aname != null) { - aname = project.AssemblyContext.GetAssemblyNameForVersion (aname, project.TargetFramework); - if (aname != null) { - project.References.Add (ProjectReference.CreateAssemblyReference (aname)); - changed = true; - } - } - } - updating = false; - return changed; - } - - static bool updating; - static string[] gnome_assemblies = new string [] { - "art-sharp", "atk-sharp", "gconf-sharp", "gdk-sharp", - "glade-sharp","glib-sharp", "gnome-sharp", - "gnome-vfs-sharp", "gtk-dotnet", "gtkhtml-sharp", - "gtk-sharp", "pango-sharp", "rsvg-sharp" - }; - - public static void Initialize () - { - IdeApp.Workspace.ReferenceAddedToProject += OnReferenceAdded; - IdeApp.Workspace.ReferenceRemovedFromProject += OnReferenceRemoved; - } - - static void OnReferenceAdded (object o, ProjectReferenceEventArgs args) - { - if (updating || !IsGtkReference (args.ProjectReference)) - return; - - args.Project.ExtendedProperties ["GtkReferenceExists"] = true; - string sr = args.ProjectReference.StoredReference; - string version = sr.Substring (sr.IndexOf (",") + 1).Trim (); - ReferenceManager rm = new ReferenceManager (args.Project as DotNetProject); - rm.Update (version); - } - - static void OnReferenceRemoved (object o, ProjectReferenceEventArgs args) - { - if (updating || !IsGtkReference (args.ProjectReference)) - return; - - DotNetProject dnp = args.Project as DotNetProject; - - if (MessageService.Confirm (GettextCatalog.GetString ("The Gtk# User Interface designer will be disabled by removing the gtk-sharp reference."), new AlertButton (GettextCatalog.GetString ("Disable Designer")))) { - dnp.ExtendedProperties ["GtkReferenceExists"] = false; - GtkDesignInfo.DisableProject (dnp); - } else - dnp.References.Add (ProjectReference.CreateAssemblyReference (args.ProjectReference.StoredReference)); - } - - static string GetReferenceName (ProjectReference pref) - { - string stored = pref.StoredReference; - int idx = stored.IndexOf (","); - if (idx == -1) - return stored.Trim (); - - return stored.Substring (0, idx).Trim (); - } - - static bool IsGtkReference (ProjectReference pref) - { - if (pref.ReferenceType != ReferenceType.Package) - return false; - - return pref.StoredReference.StartsWith ("gtk-sharp,", StringComparison.Ordinal); - } - - public static bool HasGtkReference (DotNetProject project) - { - foreach (ProjectReference pref in project.References) - if (IsGtkReference (pref)) - return true; - return false; - } - - List supported_versions; - string default_version; - - public string DefaultGtkVersion { - get { - if (SupportedGtkVersions.Count > 0 && default_version == null) - default_version = SupportedGtkVersions [0]; - return default_version; - } - } - - public List SupportedGtkVersions { - get { - if (supported_versions == null) { - supported_versions = new List (); - foreach (SystemAssembly asm in project.AssemblyContext.GetAssemblies ()) { - if (asm.Name == "gtk-sharp") { - string v = GetVersionPrefix (asm.Version); - if (!supported_versions.Contains (v)) - supported_versions.Add (v); - if (v == "2.8") - default_version = v; - } - } - supported_versions.Sort (); - } - return supported_versions; - } - } - - string GetVersionPrefix (string version) - { - int i = version.IndexOf ('.'); - i = version.IndexOf ('.', i + 1); - return version.Substring (0, i); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs deleted file mode 100644 index dd0685c8b2d..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs +++ /dev/null @@ -1,140 +0,0 @@ -// -// WidgetFileDescriptionTemplate.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System; -using System.IO; -using System.Threading.Tasks; -using System.Xml; - -using MonoDevelop.Core; -using MonoDevelop.GtkCore.GuiBuilder; -using MonoDevelop.Ide; -using MonoDevelop.Ide.Templates; -using MonoDevelop.Projects; - -namespace MonoDevelop.GtkCore -{ - public class WidgetFileDescriptionTemplate: FileDescriptionTemplate - { - SingleFileDescriptionTemplate fileTemplate; - XmlElement steticTemplate; - - public override string Name { - get { return "Widget"; } - } - - public override void Load (XmlElement filenode, FilePath baseDirectory) - { - foreach (XmlNode node in filenode.ChildNodes) { - XmlElement elem = node as XmlElement; - if (elem == null) continue; - - if (elem.Name == "SteticTemplate") { - if (steticTemplate != null) - throw new InvalidOperationException ("Widget templates can't contain more than one SteticTemplate element"); - steticTemplate = elem; - } else if (fileTemplate == null) { - fileTemplate = FileDescriptionTemplate.CreateTemplate (elem, baseDirectory) as SingleFileDescriptionTemplate; - if (fileTemplate == null) - throw new InvalidOperationException ("Widget templates can only contain single-file and stetic templates."); - } - } - if (fileTemplate == null) - throw new InvalidOperationException ("File template not found in widget template."); - if (steticTemplate == null) - throw new InvalidOperationException ("Stetic template not found in widget template."); - } - - public override bool SupportsProject (Project project, string projectPath) - { - return (project is DotNetProject) && GtkDesignInfo.SupportsRefactoring (project as DotNetProject); - } - - public override async Task AddToProjectAsync (SolutionFolderItem policyParent, Project project, string language, string directory, string name) - { - if (!GtkDesignInfo.SupportsDesigner (project)) { - ReferenceManager mgr = new ReferenceManager (project as DotNetProject); - mgr.GtkPackageVersion = mgr.DefaultGtkVersion; - mgr.Dispose (); - } - - GtkDesignInfo info = GtkDesignInfo.FromProject ((DotNetProject) project); - - GuiBuilderProject gproject = info.GuiBuilderProject; - - string fileName = fileTemplate.GetFileName (policyParent, project, language, directory, name); - await fileTemplate.AddToProjectAsync (policyParent, project, language, directory, name); - - DotNetProject netProject = project as DotNetProject; - string ns = netProject != null ? netProject.GetDefaultNamespace (fileName) : ""; - string cname = Path.GetFileNameWithoutExtension (fileName); - string fullName = ns.Length > 0 ? ns + "." + cname : cname; - string[,] tags = { - {"Name", cname}, - {"Namespace", ns}, - {"FullName", fullName} - }; - - XmlElement widgetElem = steticTemplate ["widget"]; - if (widgetElem != null) { - string content = widgetElem.OuterXml; - content = StringParserService.Parse (content, tags); - - XmlDocument doc = new XmlDocument (); - doc.LoadXml (content); - - gproject.AddNewComponent (doc.DocumentElement); - gproject.SaveAll (false); - IdeApp.ProjectOperations.SaveAsync (project).Ignore (); - return true; - } - - widgetElem = steticTemplate ["action-group"]; - if (widgetElem != null) { - string content = widgetElem.OuterXml; - content = StringParserService.Parse (content, tags); - - XmlDocument doc = new XmlDocument (); - doc.LoadXml (content); - - gproject.SteticProject.AddNewActionGroup (doc.DocumentElement); - gproject.SaveAll (false); - IdeApp.ProjectOperations.SaveAsync (project).Ignore (); - return true; - } - - throw new InvalidOperationException (" or element not found in widget template."); - } - - public override void Show () - { - fileTemplate.Show (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetParser.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetParser.cs deleted file mode 100644 index 5b6b642216d..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetParser.cs +++ /dev/null @@ -1,150 +0,0 @@ -// -// ObjectsDocument.cs -// -// Authors: -// Lluis Sanchez Gual -// Mike Kestner -// -// Copyright (C) 2006-2008 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Xml; -using System.CodeDom; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using MonoDevelop.Ide.TypeSystem; -using Microsoft.CodeAnalysis; -using System.Linq; -using ICSharpCode.NRefactory6.CSharp; - -namespace MonoDevelop.GtkCore -{ - - public class WidgetParser - { - Compilation ctx; - - public Compilation Ctx { - get { - return ctx; - } - } - - public WidgetParser (Compilation ctx) - { - this.ctx = ctx; - } - - static bool IsWidget(INamedTypeSymbol type) - { - if (type.SpecialType == SpecialType.System_Object) - return false; - if (type.GetFullName () == "Gtk.Widget") - return true; - - return IsWidget (type.BaseType); - } - - public Dictionary GetToolboxItems () - { - var tb_items = new Dictionary (); - - foreach (var t in ctx.GetAllTypesInMainAssembly ()) { - if (t.IsToolboxItem() && IsWidget(t)) - tb_items [t.GetFullName ()] = t; - } - - return tb_items; - } - - public void CollectMembers (ITypeSymbol cls, bool inherited, string topType, ListDictionary properties, ListDictionary events) - { - if (cls.GetFullName () == topType) - return; - - foreach (var prop in cls.GetMembers ().OfType ()) - if (IsBrowsable (prop)) - properties [prop.Name] = prop; - - foreach (var ev in cls.GetMembers ().OfType ()) - if (IsBrowsable (ev)) - events [ev.Name] = ev; - - if (inherited) { - CollectMembers (cls.BaseType, true, topType, properties, events); - } - } - - public string GetBaseType (ITypeSymbol cls, Hashtable knownTypes) - { - if (cls.SpecialType == SpecialType.System_Object) - return null; - if (knownTypes.Contains (cls.BaseType.GetFullName ())) - return cls.BaseType.GetFullName (); - return GetBaseType (cls.BaseType, knownTypes); - } - - - public INamedTypeSymbol GetClass (string classname) - { - return ctx.GetTypeByMetadataName (classname); - } - - public bool IsBrowsable (ISymbol member) - { - if (member.DeclaredAccessibility != Accessibility.Public) - return false; - - var prop = member as IPropertySymbol; - if (prop != null) { - if (prop.GetMethod == null || prop.SetMethod == null) - return false; - if (Array.IndexOf (supported_types, prop.Type.GetFullName ()) == -1) - return false; - } - - return member.IsDesignerBrowsable (); - } - - static string[] supported_types = new string[] { - "System.Boolean", - "System.Char", - "System.SByte", - "System.Byte", - "System.Int16", - "System.UInt16", - "System.Int32", - "System.UInt32", - "System.Int64", - "System.UInt64", - "System.Decimal", - "System.Single", - "System.Double", - "System.DateTime", - "System.String", - "System.TimeSpan", - "Gtk.Adjustment", - }; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/gui.glade b/main/src/addins/MonoDevelop.GtkCore/gui.glade deleted file mode 100644 index 92f5740b919..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/gui.glade +++ /dev/null @@ -1,710 +0,0 @@ - - - - - - - - True - GUI Designer - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - False - 6 - - - - 549 - True - The class that was bound to the design currently edited could not be found. Please select the class you want to bind to the design: - False - False - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - True - False - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - - True - Bind Widget Design - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - False - 6 - - - - True - The widget design {0} is not currently bound to a class. - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - Bind the design to an existing class - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - False - - - - - - True - False - 0 - - - - 24 - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - Select a class: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - True - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - True - Create a new class - True - GTK_RELIEF_NORMAL - True - False - False - True - radioSelect - - - - 0 - False - False - - - - - - True - 3 - 3 - False - 6 - 6 - - - - True - Name: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 0 - 1 - fill - - - - - - - True - Namespace: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 1 - 2 - fill - - - - - - - True - Location: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 2 - 3 - fill - - - - - - - 24 - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - True - True - True - 0 - - True - * - False - - - - 2 - 3 - 0 - 1 - - - - - - - True - True - True - True - 0 - - True - * - False - - - - 2 - 3 - 1 - 2 - - - - - - - True - True - False - - - - - - - 2 - 3 - 2 - 3 - fill - fill - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - - True - MonoDevelop - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-no - True - GTK_RELIEF_NORMAL - True - -9 - - - - - - True - True - True - gtk-yes - True - GTK_RELIEF_NORMAL - True - -8 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 12 - True - False - 12 - - - - True - gtk-dialog-question - 6 - 0.5 - 0 - 0 - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - True - Are you sure you want to delete the window '{0}'? - False - False - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - Also remove the file '{0}' - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - diff --git a/main/src/addins/MonoDevelop.GtkCore/icons/actiongroup.png b/main/src/addins/MonoDevelop.GtkCore/icons/actiongroup.png deleted file mode 100644 index de43e0a5c44fadf6d42622cd7a9c534ec6a24a05..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^q9Dw{1|(OCFP#RY*pj^6T^Rm@;DWu&Cj&(|3p^r= z85p>QL70(Y)*K0-AbW|YuPggCRskU{t#x~D+XIE>d%8G=Se$-3+*?u3WLo^+QI>L(Q2__o@hMKHoI4X?9$uO@_+lJExUZi<{?X zhQC_r$%wOP7^xm+9LP?0esQX~%Z&^E?KF0h*@K>2$Ddn@XiZKA&IM3n?X=o0|Y7;OmsYb=`$z zh{8xINvG3Of{;Y*cAKlKD|U8vVm*i>i8a}_ZR+(pwOS3+G&wsv3nj8Fi+a62*2>iNhwvo-&co+hw5QCj-!r_ zj+78W2_a%Jx3*#`l zuFpTFx3{;9Mx%vq@jT;w-)DV&efAXfdOecKBmnpK_X`n)I-2i?D_Bu0cm;eng68}T zNC$n?2#A-BF)##v08$H*tpQI1GUGpY{tNgC_`!d*@f+oB{m3gC>v#YF002ovPDHLk FV1mmPD|Y|@ diff --git a/main/src/addins/MonoDevelop.GtkCore/icons/image-x-generic.png b/main/src/addins/MonoDevelop.GtkCore/icons/image-x-generic.png deleted file mode 100644 index 68da5027cf1aa23d6ca16eca99fd01025c82f776..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 558 zcmV+}0@3}6P)W8+D$+wD1(hb7ZnxQ)>0#;WVhSMx1M~WOW`<`(y-`~O?lW3>LcLKl zTI-Q&y-_m`fH8&#kDju%^KPiHOVtHdSC#>A0E7_i?tf4s(+R0|vB7qwa4%ryoayflfE%+4_t0F6nNx)`Z6qVHi=FPKTS#CU}=K zz{+W!#C9YIhrSlXiNSHls7#+^Yo;a`d;);QTNPSAe+|gJYq?(Q!^i)DrRoA3o7+RD wat;teu)4CGrROk3N|^!cjmHn~jryI>0JT`*mWx6Xs{jB107*qoM6N<$f&tz34gdfE diff --git a/main/src/addins/MonoDevelop.GtkCore/icons/widget.png b/main/src/addins/MonoDevelop.GtkCore/icons/widget.png deleted file mode 100644 index 7f5844bbfc1b2fa32871ef69da808b67a152e149..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 337 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYYs>cdx@v7EBiGj839%iVe{O%K%sk{E{-7{$KOtM_+7Qe9I|Z$TLej>gLQKRJy*^e=S2 zaoBVI&A0pq54=`Q-yIqLu3N5%^^EfB38|8qvy@s2{4}5bo}-Y~s^`^HHn`48bt`x2tnm*#9c!5$a>`0EM1eB(3bxxyU(mPKVx2@+kg zy7t(NTbWT`3|3A*aIwsQS?qv_L@7f(1KW<9d?E&n$DYax3a}Qi7X@zex~98`fwAHF c`}a@8*Ppezr`kK$66jL~Pgg&ebxsLQ0OZ7xUTyI zHMK7c!`yoCjpw=p%$&^I-2xgwr3Cm12!XvmfeX}tY6;a$J8}S$ub0ff|5R`VtpGG& T8^-zz00000NkvXXu0mjf#e{z- diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/ClassDescriptor.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/ClassDescriptor.cs deleted file mode 100644 index 29a1f9a5939..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/ClassDescriptor.cs +++ /dev/null @@ -1,344 +0,0 @@ -using System; -using System.Collections; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Xml; - -namespace Stetic { - - - public abstract class ClassDescriptor - { - protected string label, category, cname; - protected bool deprecated, hexpandable, vexpandable, allowChildren = true; - - protected ItemGroupCollection groups = new ItemGroupCollection (); - protected ItemGroupCollection signals = new ItemGroupCollection (); - - protected int importantGroups; - protected ItemGroup contextMenu; - protected ItemGroup internalChildren; - protected string baseType; - protected bool isInternal; - protected string targetGtkVersion; - - WidgetLibrary library; - PropertyDescriptor[] initializationProperties; - static PropertyDescriptor[] emptyPropArray = new PropertyDescriptor[0]; - - int counter; - - protected void Load (XmlElement elem) - { - if (elem.HasAttribute ("cname")) - cname = elem.GetAttribute ("cname"); - else if (cname == null) - cname = elem.GetAttribute ("type"); - - label = elem.GetAttribute ("label"); - if (label == "") { - label = WrappedTypeName; - int i = label.LastIndexOf ('.'); - if (i != -1) - label = label.Substring (i+1); - } - - if (elem.HasAttribute ("allow-children")) - allowChildren = elem.GetAttribute ("allow-children") == "yes" || elem.GetAttribute ("allow-children") == "true"; - - category = elem.GetAttribute ("palette-category"); - - if (elem.HasAttribute ("deprecated")) - deprecated = true; - if (elem.HasAttribute ("hexpandable")) - hexpandable = true; - if (elem.HasAttribute ("vexpandable")) - vexpandable = true; - if (elem.GetAttribute ("internal") == "true") - isInternal = true; - - contextMenu = ItemGroup.Empty; - - baseType = elem.GetAttribute ("base-type"); - if (baseType.Length > 0) { - ClassDescriptor basec = Registry.LookupClassByName (baseType); - if (basec == null) - throw new InvalidOperationException ("Base type '" + baseType + "' not found."); - foreach (ItemGroup group in basec.ItemGroups) - groups.Add (group); - foreach (ItemGroup group in basec.SignalGroups) - signals.Add (group); - contextMenu = basec.ContextMenu; - } else - baseType = null; - - XmlElement groupsElem = elem["itemgroups"]; - if (groupsElem != null) { - foreach (XmlElement groupElem in groupsElem.SelectNodes ("itemgroup")) { - ItemGroup itemgroup; - - if (groupElem.HasAttribute ("ref")) { - string refname = groupElem.GetAttribute ("ref"); - itemgroup = Registry.LookupItemGroup (refname); - } else - itemgroup = new ItemGroup (groupElem, this); - groups.Add (itemgroup); - - if (groupElem.HasAttribute ("important")) { - if (groupElem.GetAttribute ("important") == "true") - importantGroups++; - } else if (groups.Count == 1) - importantGroups++; - } - } - - XmlElement signalsElem = elem["signals"]; - if (signalsElem != null) { - foreach (XmlElement groupElem in signalsElem.SelectNodes ("itemgroup")) { - ItemGroup itemgroup; - if (groupElem.HasAttribute ("ref")) { - string refname = groupElem.GetAttribute ("ref"); - itemgroup = Registry.LookupSignalGroup (refname); - } else - itemgroup = new ItemGroup (groupElem, this); - signals.Add (itemgroup); - } - } - - XmlElement contextElem = elem["contextmenu"]; - if (contextElem != null) { - if (contextElem.HasAttribute ("ref")) { - string refname = contextElem.GetAttribute ("ref"); - contextMenu = Registry.LookupContextMenu (refname); - } else - contextMenu = new ItemGroup (contextElem, this); - } - - XmlElement ichildElem = elem["internal-children"]; - if (ichildElem != null) - internalChildren = new ItemGroup (ichildElem, this); - else - internalChildren = ItemGroup.Empty; - - string initProps = elem.GetAttribute ("init-properties"); - if (initProps.Length > 0) { - string[] props = initProps.Split (' '); - ArrayList list = new ArrayList (); - foreach (string prop in props) { - PropertyDescriptor idesc = this [prop] as PropertyDescriptor; - if (idesc == null) - throw new InvalidOperationException ("Initialization property not found: " + prop); - list.Add (idesc); - } - initializationProperties = (PropertyDescriptor[]) list.ToArray (typeof(PropertyDescriptor)); - } else - initializationProperties = emptyPropArray; - - targetGtkVersion = elem.GetAttribute ("gtk-version"); - if (targetGtkVersion.Length == 0) - targetGtkVersion = null; - } - - public virtual string Name { - get { - return WrappedTypeName; - } - } - - public virtual bool IsInternal { - get { return isInternal; } - } - - public abstract string WrappedTypeName { - get; - } - - public string CName { - get { - return cname; - } - } - - public bool Deprecated { - get { - return deprecated; - } - } - - public bool HExpandable { - get { - return hexpandable; - } - } - - public bool VExpandable { - get { - return vexpandable; - } - } - - public string Label { - get { - return label; - } - } - - public abstract Gdk.Pixbuf Icon { - get; - } - - public string Category { - get { - return category; - } - } - - public virtual string TargetGtkVersion { - get { - if (targetGtkVersion == null) - return library.TargetGtkVersion; - else - return targetGtkVersion; - } - } - - public bool SupportsGtkVersion (string targetVersion) - { - return WidgetUtils.CompareVersions (TargetGtkVersion, targetVersion) >= 0; - } - - public PropertyDescriptor[] InitializationProperties { - get { return initializationProperties; } - } - - public object NewInstance (IProject proj) - { - return NewInstance (proj, true); - } - - public object NewInstance (IProject proj, bool initialize) - { - object ob = CreateInstance (proj); - - string name = WrappedTypeName.ToLower () + (++counter).ToString (); - int i = name.LastIndexOf ('.'); - if (i != -1) { - if (i < name.Length) - name = name.Substring (i+1); - else - name = name.Replace (".", ""); - } - - ObjectWrapper ow = CreateWrapper (); - try { - ow.Loading = true; - ObjectWrapper.Bind (proj, this, ow, ob, !initialize); - - // Initialize the properties after creating the wrapper, since some properties - // may be implemented in the wrapper - - foreach (ItemGroup group in groups) { - foreach (ItemDescriptor item in group) { - PropertyDescriptor prop = item as PropertyDescriptor; - if (prop != null && prop.InitWithName) { - prop.SetValue (ob, name); - } - } - } - } - finally { - ow.Loading = false; - } - - return ob; - } - - // Sets the default values for an instance - public virtual void ResetInstance (object obj) - { - foreach (ItemGroup group in groups) { - foreach (ItemDescriptor item in group) { - PropertyDescriptor prop = item as PropertyDescriptor; - if (prop != null) { - try { - prop.ResetValue (obj); - } catch (Exception ex) { - // Ignore. ResetInstance should never crash since it can - // leave a widget half initialized - Console.WriteLine (ex); - } - } - } - } - } - - public abstract object CreateInstance (IProject proj); - - public abstract ObjectWrapper CreateWrapper (); - - public ItemDescriptor this[string name] { - get { - if (groups != null) { - foreach (ItemGroup group in groups) { - ItemDescriptor item = group[name]; - if (item != null) - return item; - } - } - - return null; - } - } - - public ItemGroupCollection ItemGroups { - get { - return groups; - } - } - - public ItemGroupCollection SignalGroups { - get { - return signals; - } - } - - public int ImportantGroups { - get { - return importantGroups; - } - } - - public ItemGroup ContextMenu { - get { - return contextMenu; - } - } - - public ItemGroup InternalChildren { - get { - return internalChildren; - } - } - - public WidgetLibrary Library { - get { return library; } - } - - public virtual bool AllowChildren { - get { return allowChildren; } - } - - internal protected virtual ItemDescriptor CreateItemDescriptor (XmlElement elem, ItemGroup group) - { - if (elem.Name == "command") - return new CommandDescriptor (elem, group, this); - else - throw new ApplicationException ("Bad item name " + elem.Name + " in " + WrappedTypeName); - } - - internal void SetLibrary (WidgetLibrary library) - { - this.library = library; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/Clipboard.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/Clipboard.cs deleted file mode 100644 index 9c27ceec405..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/Clipboard.cs +++ /dev/null @@ -1,91 +0,0 @@ -using Gtk; -using System; -using System.Xml; - -namespace Stetic { - - internal static class Clipboard { - - const int SteticType = 0; - const int TextType = 1; - - static Gtk.TargetEntry[] targets; - static Gtk.TargetEntry[] Targets { - get { - if (targets == null) { -#if GTK_SHARP_2_6 - Gtk.TargetList list = new Gtk.TargetList (); - list.Add ((string)WidgetUtils.ApplicationXSteticAtom, 0, SteticType); - list.AddTextTargets (TextType); - targets = (Gtk.TargetEntry[])list; -#else - targets = new Gtk.TargetEntry[] { - new Gtk.TargetEntry ((string)WidgetUtils.ApplicationXSteticAtom, 0, SteticType) - }; -#endif - } - return targets; - } - } - - static Gtk.Clipboard MainClipboard { - get { - return Gtk.Clipboard.Get (Gdk.Selection.Clipboard); - } - } - - static XmlElement selection; - - static void ClipboardGet (Gtk.Clipboard clipboard, Gtk.SelectionData seldata, uint info) - { - if (selection == null) - return; - - if (info == TextType) - seldata.Text = selection.OuterXml; - else - seldata.Set (WidgetUtils.ApplicationXSteticAtom, 8, System.Text.Encoding.UTF8.GetBytes (selection.OuterXml)); - } - - static void ClipboardClear (Gtk.Clipboard clipboard) - { - selection = null; - } - - public static void Copy (Gtk.Widget widget) - { - MainClipboard.SetWithData (Targets, ClipboardGet, ClipboardClear); - selection = widget != null ? WidgetUtils.ExportWidget (widget) : null; - } - - public static void Cut (Gtk.Widget widget) - { - Copy (widget); - Stetic.Wrapper.Widget wrapper = Stetic.Wrapper.Widget.Lookup (widget); - if (wrapper != null) - wrapper.Delete (); - } - - static Placeholder target; - - static void ClipboardPaste (Gtk.Clipboard clipboard, Gtk.SelectionData seldata) - { - Stetic.Wrapper.Container parent = Stetic.Wrapper.Container.LookupParent (target); - if (parent == null) - return; - - Stetic.Wrapper.Widget wrapper = WidgetUtils.Paste (parent.Project, seldata); - if (wrapper == null) - return; - - parent.PasteChild (target, wrapper.Wrapped); - target = null; - } - - public static void Paste (Placeholder target) - { - Clipboard.target = target; - MainClipboard.RequestContents (WidgetUtils.ApplicationXSteticAtom, ClipboardPaste); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/CommandDescriptor.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/CommandDescriptor.cs deleted file mode 100644 index eadd8b39700..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/CommandDescriptor.cs +++ /dev/null @@ -1,152 +0,0 @@ -using System; -using System.Collections; -using System.Reflection; -using System.Xml; - -namespace Stetic { - - public class CommandDescriptor : ItemDescriptor { - - string name, checkName, label, description, icon; - - const BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; - - public CommandDescriptor (XmlElement elem, ItemGroup group, ClassDescriptor klass) : base (elem, group, klass) - { - name = elem.GetAttribute ("name"); - label = elem.GetAttribute ("label"); - description = elem.GetAttribute ("description"); - checkName = elem.GetAttribute ("check"); - icon = elem.GetAttribute ("icon"); - } - - public override string Name { - get { - return name; - } - } - - public string Label { - get { - return label; - } - } - - public string Description { - get { - return description; - } - } - - public bool IsToggleCommand (object obj) - { - object target; - return (FindBoolProperty (obj, out target) != null); - } - - public bool IsToogled (object obj) - { - object target; - PropertyInfo prop = FindBoolProperty (obj, out target); - return prop != null && (bool) prop.GetValue (target, null); - } - - PropertyInfo FindBoolProperty (object obj, out object target) - { - PropertyInfo prop = obj.GetType().GetProperty (name, flags); - if (prop != null && prop.PropertyType == typeof(bool)) { - target = obj; - return prop; - } - - ObjectWrapper wrap = ObjectWrapper.Lookup (obj); - if (wrap != null) { - prop = wrap.GetType().GetProperty (name, flags); - if (prop != null && prop.PropertyType == typeof(bool)) { - target = wrap; - return prop; - } - } - target = null; - return null; - } - - public Gtk.Image GetImage () - { - if (icon == null || icon.Length == 0) - return null; - if (icon.StartsWith ("res:")) { - System.IO.Stream s = this.ClassDescriptor.Library.GetResource (icon.Substring (4)); - if (s == null) - return null; - using (s) { - Gdk.Pixbuf pixbuf; - try { - pixbuf = new Gdk.Pixbuf (s); - } catch (Exception e) { - Console.WriteLine ("Error while loading pixbuf '" + icon.Substring (4) + "': " + e); - return null; - } - return new Gtk.Image (pixbuf); - } - } else { - return new Gtk.Image (icon, Gtk.IconSize.Menu); - } - } - - public bool Enabled (object obj) - { - if (checkName == "") - return EnabledFor (obj); - else - return (bool) InvokeMethod (ObjectWrapper.Lookup (obj), checkName, null, false); - } - - public bool Enabled (object obj, Gtk.Widget context) - { - if (checkName == "") - return EnabledFor (obj); - - ObjectWrapper wrapper = ObjectWrapper.Lookup (obj); - return (bool) InvokeMethod (wrapper, checkName, context, true); - } - - public void Run (object obj) - { - ObjectWrapper ww = ObjectWrapper.Lookup (obj); - using (ww.UndoManager.AtomicChange) { - InvokeMethod (ww, name, null, false); - } - } - - public void Run (object obj, Gtk.Widget context) - { - ObjectWrapper ww = ObjectWrapper.Lookup (obj); - using (ww.UndoManager.AtomicChange) { - InvokeMethod (ww, name, context, true); - } - } - - object InvokeMethod (object target, string name, object context, bool withContext) - { - object ptarget; - PropertyInfo prop = FindBoolProperty (target, out ptarget); - if (prop != null) { - prop.SetValue (ptarget, !(bool)prop.GetValue (ptarget, null), null); - return null; - } - - if (withContext) { - MethodInfo metc = target.GetType().GetMethod (name, flags, null, new Type[] {typeof(Gtk.Widget)}, null); - if (metc != null) - return metc.Invoke (target, new object[] { context }); - } - - MethodInfo met = target.GetType().GetMethod (name, flags, null, Type.EmptyTypes, null); - if (met != null) - return met.Invoke (target, new object[0]); - - throw new ArgumentException ("Invalid command or checker name. Method '" + name +"' not found in class '" + target.GetType() + "'"); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/CustomWidget.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/CustomWidget.cs deleted file mode 100644 index f9f39343432..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/CustomWidget.cs +++ /dev/null @@ -1,27 +0,0 @@ - -using System; - -namespace Stetic -{ - // This widget is used at design-time to represent a Gtk.Bin container. - // Gtk.Bin is the base class for custom widgets. - - public class CustomWidget: Gtk.EventBox - { - public CustomWidget (IntPtr ptr): base (ptr) - { - } - - public CustomWidget () - { - this.VisibleWindow = false; - this.Events |= Gdk.EventMask.ButtonPressMask; - } - - protected override bool OnButtonPressEvent (Gdk.EventButton ev) - { - // Avoid forwarding event to parent widget - return true; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/DND.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/DND.cs deleted file mode 100644 index e9f98e5a343..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/DND.cs +++ /dev/null @@ -1,636 +0,0 @@ -using System; -using System.Collections; - -namespace Stetic { - - public static class DND { - static Gtk.TargetEntry[] targets; - static Gtk.TargetList targetList; - static Gdk.Atom steticWidgetType; - static Gdk.Pixbuf widgetIcon; - - const int SteticType = 0; - const int GladeType = 1; - - static DND () - { - try { - widgetIcon = Gdk.Pixbuf.LoadFromResource ("widget.png"); - } catch (Exception e) { - Console.WriteLine ("Error while loading pixbuf 'widget.png': " + e); - } - - steticWidgetType = Gdk.Atom.Intern ("application/x-stetic-widget", false); - - targets = new Gtk.TargetEntry[2]; - targets[0] = new Gtk.TargetEntry (steticWidgetType, 0, SteticType); - targets[1] = new Gtk.TargetEntry ((string) GladeUtils.ApplicationXGladeAtom, 0, GladeType); - - targetList = new Gtk.TargetList (targets); - targets = (Gtk.TargetEntry[]) targetList; - } - - public static Gtk.TargetEntry[] Targets { - get { return targets; } - } - - public static void SourceSet (Gtk.Widget source) - { - Gtk.Drag.SourceSet (source, Gdk.ModifierType.Button1Mask, - targets, Gdk.DragAction.Move); - } - - public static void SourceUnset (Gtk.Widget source) - { - Gtk.Drag.SourceUnset (source); - } - - public static void DestSet (Gtk.Widget dest, bool automatic) - { - Gtk.Drag.DestSet (dest, automatic ? Gtk.DestDefaults.All : 0, - targets, Gdk.DragAction.Move | Gdk.DragAction.Copy); - } - - public static void DestUnset (Gtk.Widget dest) - { - Gtk.Drag.DestUnset (dest); - } - - static Gtk.Widget dragWidget; - static WidgetDropCallback dropCallback; - static int dragHotX; - static int dragHotY; - - // Drag function for non-automatic sources, called from MotionNotifyEvent - public static void Drag (Gtk.Widget source, Gdk.Event evt, Gtk.Widget dragWidget) - { - Gdk.DragContext ctx; - - ctx = Gtk.Drag.Begin (source, targetList, Gdk.DragAction.Move, - 1 /* button */, evt); - Drag (source, ctx, dragWidget); - } - - // Drag function for automatic sources, called from DragBegin - public static void Drag (Gtk.Widget source, Gdk.DragContext ctx, WidgetDropCallback dropCallback, string label) - { - Gtk.Frame fr = new Gtk.Frame (); - fr.ShadowType = Gtk.ShadowType.Out; - Gtk.HBox box = new Gtk.HBox (); - box.Spacing = 3; - box.BorderWidth = 3; - box.PackStart (new Gtk.Image (widgetIcon), false, false, 0); - Gtk.Label lab = new Gtk.Label (label); - lab.Xalign = 0; - box.PackStart (lab, true, true, 0); - fr.Add (box); - fr.ShowAll (); - Drag (source, ctx, dropCallback, fr); - } - - // Drag function for automatic sources, called from DragBegin - public static void Drag (Gtk.Widget source, Gdk.DragContext ctx, Gtk.Widget dragWidget) - { - Drag (source, ctx, null, dragWidget); - } - - // Drag function for automatic sources, called from DragBegin - static void Drag (Gtk.Widget source, Gdk.DragContext ctx, WidgetDropCallback dropCallback, Gtk.Widget dragWidget) - { - if (ctx == null) - return; - - Gtk.Window dragWin; - Gtk.Requisition req; - - ShowFaults (); - DND.dragWidget = dragWidget; - DND.dropCallback = dropCallback; - - dragWin = new Gtk.Window (Gtk.WindowType.Popup); - dragWin.Add (dragWidget); - - req = dragWidget.SizeRequest (); - if (req.Width < 20 && req.Height < 20) - dragWin.SetSizeRequest (20, 20); - else if (req.Width < 20) - dragWin.SetSizeRequest (20, -1); - else if (req.Height < 20) - dragWin.SetSizeRequest (-1, 20); - - req = dragWin.SizeRequest (); - if (ctx.SourceWindow != null) { - int px, py, rx, ry; - Gdk.ModifierType pmask; - ctx.SourceWindow.GetPointer (out px, out py, out pmask); - ctx.SourceWindow.GetRootOrigin (out rx, out ry); - - dragWin.Move (rx + px, ry + py); - dragWin.Show (); - - dragHotX = req.Width / 2; - dragHotY = -3; - - Gtk.Drag.SetIconWidget (ctx, dragWin, dragHotX, dragHotY); - } - - if (source != null) { - source.DragDataGet += DragDataGet; - source.DragEnd += DragEnded; - } - } - - public static Gtk.Widget DragWidget { - get { - return dragWidget; - } - } - - public static int DragHotX { - get { - return dragHotX; - } - } - - public static int DragHotY { - get { - return dragHotY; - } - } - - // Call this from a DragDrop event to receive the dragged widget - public static void Drop (Gdk.DragContext ctx, uint time, ObjectWrapper targetWrapper, string dropData) - { - if (dropCallback == null) { - Gtk.Widget w = Drop (ctx, (Gtk.Widget) targetWrapper.Wrapped, time); - targetWrapper.DropObject (dropData, w); - return; - } - - Cancel (); - Gtk.Drag.Finish (ctx, true, true, time); - - Gtk.Application.Invoke ((args, e) => { - IProject project = targetWrapper.Project; - string uid = targetWrapper.UndoId; - string tname = ((Wrapper.Widget)targetWrapper).GetTopLevel ().Wrapped.Name; - - // This call may cause the project to be reloaded - dragWidget = dropCallback (); - if (dragWidget == null) - return; - - if (targetWrapper.IsDisposed) { - // The project has been reloaded. Find the wrapper again. - Gtk.Widget twidget = project.GetTopLevel (tname); - ObjectWrapper ow = ObjectWrapper.Lookup (twidget); - if (ow != null) - targetWrapper = ow.FindObjectByUndoId (uid); - else - targetWrapper = null; - - if (targetWrapper == null) { - // Target wrapper not found. Just ignore the drop. - return; - } - } - - targetWrapper.DropObject (dropData, dragWidget); - }); - } - - public static Gtk.Widget Drop (Gdk.DragContext ctx, Gtk.Widget target, uint time) - { - if (dropCallback != null) { - dragWidget = dropCallback (); - } - - if (dragWidget == null) { - Gtk.Drag.GetData (target, ctx, GladeUtils.ApplicationXGladeAtom, time); - return null; - } - - Gtk.Widget w = Cancel (); - Gtk.Drag.Finish (ctx, true, true, time); - return w; - } - - // Call this from a DragEnd event to check if the widget wasn't dropped - public static Gtk.Widget Cancel () - { - if (dragWidget == null) - return null; - - Gtk.Widget w = dragWidget; - dragWidget = null; - - // Remove the widget from its dragWindow - Gtk.Container parent = w.Parent as Gtk.Container; - if (parent != null) { - parent.Remove (w); - parent.Destroy (); - } - return w; - } - - static void DragEnded (object obj, Gtk.DragEndArgs args) - { - dragWidget = null; - HideFaults (); - - ((Gtk.Widget)obj).DragEnd -= DragEnded; - ((Gtk.Widget)obj).DragDataGet -= DragDataGet; - } - - static void DragDataGet (object obj, Gtk.DragDataGetArgs args) - { - if (args.Info == GladeType) { - Gtk.Widget w = Cancel (); - if (w != null) - WidgetUtils.Copy (w, args.SelectionData, false); - } - } - - class Fault { - public Stetic.Wrapper.Widget Owner; - public object Id; - public Gtk.Orientation Orientation; - public Gdk.Window Window; - - public Fault (Stetic.Wrapper.Widget owner, object id, - Gtk.Orientation orientation, Gdk.Window window) - { - Owner = owner; - Id = id; - Orientation = orientation; - Window = window; - } - } - - static Hashtable faultGroups = new Hashtable (); - const int FaultOverlap = 3; - - public static void AddFault (Stetic.Wrapper.Widget owner, object faultId, - Gtk.Orientation orientation, Gdk.Rectangle fault) - { - AddFault (owner, faultId, orientation, - fault.X, fault.Y, fault.Width, fault.Height); - } - - public static void AddFault (Stetic.Wrapper.Widget owner, object faultId, - Gtk.Orientation orientation, - int x, int y, int width, int height) - { - Gtk.Widget widget = owner.Wrapped; - if (!widget.IsRealized) - return; - - Gdk.Window win = NewWindow (widget, Gdk.WindowClass.InputOnly); - win.MoveResize (x, y, width, height); - - Hashtable widgetFaults = faultGroups[widget] as Hashtable; - if (widgetFaults == null) { - faultGroups[widget] = widgetFaults = new Hashtable (); - widget.Destroyed += FaultWidgetDestroyed; - widget.DragMotion += FaultDragMotion; - widget.DragLeave += FaultDragLeave; - widget.DragDrop += FaultDragDrop; - widget.DragDataReceived += FaultDragDataReceived; - DND.DestSet (widget, false); - } - widgetFaults[win] = new Fault (owner, faultId, orientation, win); - } - - public static void AddFault (Stetic.Wrapper.Widget owner, object faultId, - Gtk.Orientation orientation, - Gtk.Widget before, Gtk.Widget after) - { - if (orientation == Gtk.Orientation.Horizontal) - AddHFault (owner, faultId, before, after); - else - AddVFault (owner, faultId, before, after); - } - - public static void AddHFault (Stetic.Wrapper.Widget owner, object faultId, - Gtk.Widget above, Gtk.Widget below) - { - Gtk.Widget widget = owner.Wrapped; - if (!widget.IsRealized) - return; - - Gdk.Rectangle aboveAlloc, belowAlloc; - int x1, y1, x2, y2; - - if (above != null && below != null) { - aboveAlloc = above.Allocation; - belowAlloc = below.Allocation; - - x1 = Math.Min (aboveAlloc.X, belowAlloc.X); - x2 = Math.Max (aboveAlloc.X + aboveAlloc.Width, belowAlloc.X + belowAlloc.Width); - y1 = aboveAlloc.Y + aboveAlloc.Height; - y2 = belowAlloc.Y; - - while (y2 - y1 < FaultOverlap * 2) { - y1--; - y2++; - } - } else if (above == null) { - belowAlloc = below.Allocation; - - x1 = belowAlloc.X; - x2 = belowAlloc.X + belowAlloc.Width; - y1 = 0; - y2 = Math.Max (belowAlloc.Y, FaultOverlap); - } else { - aboveAlloc = above.Allocation; - - x1 = aboveAlloc.X; - x2 = aboveAlloc.X + aboveAlloc.Width; - y1 = Math.Min (aboveAlloc.Y + aboveAlloc.Height, widget.Allocation.Height - FaultOverlap); - y2 = widget.Allocation.Height; - } - - AddFault (owner, faultId, Gtk.Orientation.Horizontal, - x1, y1, x2 - x1, y2 - y1); - } - - public static void AddVFault (Stetic.Wrapper.Widget owner, object faultId, - Gtk.Widget left, Gtk.Widget right) - { - Gtk.Widget widget = owner.Wrapped; - if (!widget.IsRealized) - return; - - Gdk.Rectangle leftAlloc, rightAlloc; - int x1, y1, x2, y2; - - if (left != null && right != null) { - leftAlloc = left.Allocation; - rightAlloc = right.Allocation; - - x1 = leftAlloc.X + leftAlloc.Width; - x2 = rightAlloc.X; - - y1 = Math.Min (leftAlloc.Y, rightAlloc.Y); - y2 = Math.Max (leftAlloc.Y + leftAlloc.Height, rightAlloc.Y + rightAlloc.Height); - - while (x2 - x1 < FaultOverlap * 2) { - x1--; - x2++; - } - } else if (left == null) { - rightAlloc = right.Allocation; - - x1 = 0; - x2 = Math.Max (rightAlloc.X, FaultOverlap); - - y1 = rightAlloc.Y; - y2 = rightAlloc.Y + rightAlloc.Height; - } else { - leftAlloc = left.Allocation; - - x1 = Math.Min (leftAlloc.X + leftAlloc.Width, widget.Allocation.Width - FaultOverlap); - x2 = widget.Allocation.Width; - - y1 = leftAlloc.Y; - y2 = leftAlloc.Y + leftAlloc.Height; - } - - AddFault (owner, faultId, Gtk.Orientation.Vertical, - x1, y1, x2 - x1, y2 - y1); - } - - public static void AddFault (Stetic.Wrapper.Widget owner, object faultId, - Gtk.SideType side, Gtk.Widget widget) - { - Gdk.Rectangle fault; - Gtk.Orientation orientation; - - if (widget == null) { - fault = owner.Wrapped.Allocation; - int border = (int)((Gtk.Container)owner.Wrapped).BorderWidth; - fault.Inflate (-border, -border); - } else - fault = widget.Allocation; - - switch (side) { - case Gtk.SideType.Top: - fault.Y -= FaultOverlap; - fault.Height = 2 * FaultOverlap; - orientation = Gtk.Orientation.Horizontal; - break; - case Gtk.SideType.Bottom: - fault.Y += fault.Height - FaultOverlap; - fault.Height = 2 * FaultOverlap; - orientation = Gtk.Orientation.Horizontal; - break; - case Gtk.SideType.Left: - fault.X -= FaultOverlap; - fault.Width = 2 * FaultOverlap; - orientation = Gtk.Orientation.Vertical; - break; - case Gtk.SideType.Right: - fault.X += fault.Width - FaultOverlap; - fault.Width = 2 *FaultOverlap; - orientation = Gtk.Orientation.Vertical; - break; - default: - throw new Exception ("not reached"); - } - - AddFault (owner, faultId, orientation, fault); - } - - static void FaultWidgetDestroyed (object widget, EventArgs args) - { - ClearFaults ((Gtk.Widget)widget); - } - - public static void ClearFaults (Stetic.Wrapper.Widget owner) - { - ClearFaults (owner.Wrapped); - } - - static void ClearFaults (Gtk.Widget widget) - { - Hashtable widgetFaults = faultGroups[widget] as Hashtable; - if (widgetFaults == null) - return; - faultGroups.Remove (widget); - widget.Destroyed -= FaultWidgetDestroyed; - widget.DragMotion -= FaultDragMotion; - widget.DragLeave -= FaultDragLeave; - widget.DragDrop -= FaultDragDrop; - widget.DragDataReceived -= FaultDragDataReceived; - - foreach (Gdk.Window win in widgetFaults.Keys) - win.Destroy (); - widgetFaults.Clear (); - DND.DestUnset (widget); - } - - static void ShowFaults () - { - foreach (Hashtable widgetFaults in faultGroups.Values) { - foreach (Gdk.Window win in widgetFaults.Keys) - win.Show (); - } - } - - static void HideFaults () - { - foreach (Hashtable widgetFaults in faultGroups.Values) { - foreach (Gdk.Window win in widgetFaults.Keys) - win.Hide (); - } - DestroySplitter (); - dragFault = null; - } - - static Fault dragFault; - static Gdk.Window splitter; - - static void DestroySplitter () - { - if (splitter != null) { - splitter.Hide (); - splitter.Destroy (); - splitter = null; - } - } - - static Fault FindFault (int x, int y, Gtk.Widget w) - { - int wx, wy, width, height, depth; - - Hashtable widgetFaults = (Hashtable) faultGroups [w]; - if (widgetFaults == null) - return null; - - foreach (Fault f in widgetFaults.Values) { - f.Window.GetGeometry (out wx, out wy, out width, out height, out depth); - if (x >= wx && y >= wy && x <= wx + width && y <= wy + height) { - return f; - } - } - return null; - } - - static void FaultDragMotion (object obj, Gtk.DragMotionArgs args) - { - int wx, wy, width, height, depth; - - Gtk.Widget widget = (Gtk.Widget) obj; - int px = args.X + widget.Allocation.X; - int py = args.Y + widget.Allocation.Y; - - Fault fault = FindFault (px, py, widget); - - // If there's a splitter visible, and we're not currently dragging - // in the fault that owns that splitter, hide it - if (splitter != null && dragFault != fault) - DestroySplitter (); - - if (dragFault != fault) { - dragFault = fault; - if (dragFault == null) - return; - - splitter = NewWindow (fault.Owner.Wrapped, Gdk.WindowClass.InputOutput); - fault.Window.GetGeometry (out wx, out wy, out width, out height, out depth); - if (fault.Orientation == Gtk.Orientation.Horizontal) { - splitter.MoveResize (wx, wy + height / 2 - FaultOverlap, - width, 2 * FaultOverlap); - } else { - splitter.MoveResize (wx + width / 2 - FaultOverlap, wy, - 2 * FaultOverlap, height); - } - splitter.ShowUnraised (); - fault.Window.Lower (); - } else if (dragFault == null) - return; - - Gdk.Drag.Status (args.Context, Gdk.DragAction.Move, args.Time); - args.RetVal = true; - } - - static void FaultDragLeave (object obj, Gtk.DragLeaveArgs args) - { - DestroySplitter (); - dragFault = null; - } - - static void FaultDrop (Stetic.Wrapper.Widget wrapper, int x, int y, Gtk.Widget targetWidget) - { - Fault fault = FindFault (x, y, targetWidget); - if (fault != null) { - fault.Owner.Drop (wrapper.Wrapped, fault.Id); - wrapper.Select (); - } - } - - static void FaultDragDrop (object obj, Gtk.DragDropArgs args) - { - Gtk.Widget w = DND.Drop (args.Context, (Gtk.Widget)obj, args.Time); - Stetic.Wrapper.Widget dropped = Stetic.Wrapper.Widget.Lookup (w); - if (dropped != null) { - Gtk.Widget targetWidget = (Gtk.Widget) obj; - int px = args.X + targetWidget.Allocation.X; - int py = args.Y + targetWidget.Allocation.Y; - - FaultDrop (dropped, px, py, targetWidget); - args.RetVal = true; - } - } - - static void FaultDragDataReceived (object obj, Gtk.DragDataReceivedArgs args) - { - Stetic.Wrapper.Widget dropped = null; - - Stetic.Wrapper.Widget faultOwner = Stetic.Wrapper.Widget.Lookup ((Gtk.Widget)obj); - if (faultOwner != null) - dropped = WidgetUtils.Paste (faultOwner.Project, args.SelectionData); - Gtk.Drag.Finish (args.Context, dropped != null, - dropped != null, args.Time); - if (dropped != null) { - Gtk.Widget targetWidget = (Gtk.Widget) obj; - int px = args.X + targetWidget.Allocation.X; - int py = args.Y + targetWidget.Allocation.Y; - FaultDrop (dropped, px, py, targetWidget); - } - } - - static Gdk.Window NewWindow (Gtk.Widget parent, Gdk.WindowClass wclass) - { - Gdk.WindowAttr attributes; - Gdk.WindowAttributesType attributesMask; - Gdk.Window win; - - attributes = new Gdk.WindowAttr (); - attributes.WindowType = Gdk.WindowType.Child; - attributes.Wclass = wclass ; - attributes.Visual = parent.Visual; - attributes.Colormap = parent.Colormap; - attributes.Mask = (Gdk.EventMask.ButtonPressMask | - Gdk.EventMask.ButtonMotionMask | - Gdk.EventMask.ButtonReleaseMask | - Gdk.EventMask.ExposureMask | - Gdk.EventMask.EnterNotifyMask | - Gdk.EventMask.LeaveNotifyMask); - - attributesMask = - Gdk.WindowAttributesType.Visual | - Gdk.WindowAttributesType.Colormap; - - win = new Gdk.Window (parent.GdkWindow, attributes, attributesMask); - win.UserData = parent.Handle; - - if (wclass == Gdk.WindowClass.InputOutput) - parent.Style.Attach (win); - - return win; - } - } - - public delegate Gtk.Widget WidgetDropCallback (); -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/EnumDescriptor.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/EnumDescriptor.cs deleted file mode 100644 index 79ee48b3c97..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/EnumDescriptor.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Collections; -using System.Reflection; -using System.Xml; - -namespace Stetic { - public class EnumValue { - public Enum Value; - public string Label; - public string Description; - - internal EnumValue (Enum value, string label, string description) - { - Value = value; - Label = label; - Description = description; - } - } - - public class EnumDescriptor { - - Type enumType; - Hashtable values; - Enum[] values_array; - string name; - - public EnumDescriptor (XmlElement elem) - { - string cls = elem.GetAttribute ("type"); - enumType = Registry.GetType (cls, true); - this.name = enumType.FullName; - - values = new Hashtable (); - - // This gets the list of enum names and gets the value of each of them. - // This is not done the other way (get the values, and then the names from them) - // because it won't work if two different enum members have the same value - ArrayList list = new ArrayList (); - Hashtable evalues = new Hashtable (); - foreach (string name in Enum.GetNames (enumType)) { - object value = Enum.Parse (enumType, name); - list.Add (value); - evalues[name] = value; - } - - foreach (XmlElement valueElem in elem.SelectNodes ("value")) { - string name = valueElem.GetAttribute ("name"); - if (!evalues.Contains (name)) - throw new ArgumentException (" node for " + enumType.FullName + " contains extra element " + name); - Enum value = (Enum)evalues[name]; - values[value] = new EnumValue (value, - valueElem.GetAttribute ("label"), - valueElem.GetAttribute ("description")); - evalues.Remove (name); - } - - // Remove from the array the values not declared in the xml file - foreach (object val in evalues.Values) - list.Remove (val); - - values_array = (Enum[]) list.ToArray (typeof(Enum)); - } - - public string Name { - get { return name; } - } - - public Type EnumType { - get { - return enumType; - } - } - - public Enum[] Values { - get { - return values_array; - } - } - - public EnumValue this[Enum value] { - get { - return (EnumValue)values[value]; - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/ErrorWidget.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/ErrorWidget.cs deleted file mode 100644 index 38915196d65..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/ErrorWidget.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using System.Xml; -using System.CodeDom; -using Mono.Unix; - -namespace Stetic -{ - // This widget is shown in place of widgets with unknown classes. - - public class ErrorWidget: Gtk.Frame - { - readonly string className; - readonly Exception exc; - - public ErrorWidget (Exception ex, string id) - { - exc = ex; - Init (Catalog.GetString ("Load Error:") + " " + ex.Message, id); - } - - public ErrorWidget (string className, string id) - { - this.className = className; - Init (Catalog.GetString ("Unknown widget:") + " " + className, id); - } - - public ErrorWidget (string className, string minGtkVersion, string foundGtkVersion, string id) - { - this.className = className; - Init (string.Format (Catalog.GetString ("Widget '{0}' not available in GTK# {1}"), className, foundGtkVersion), id); - } - - void Init (string message, string id) - { - Gtk.Label lab = new Gtk.Label (); - lab.Markup = "" + message + ""; - this.CanFocus = false; - Add (lab); - this.ShadowType = Gtk.ShadowType.In; - ShowAll (); - if (id != null && id.Length > 0) - Name = id; - } - - public string ClassName { - get { return className; } - } - - public Exception Exception { - get { return exc; } - } - } - - internal class ErrorWidgetWrapper: Wrapper.Widget - { - XmlElement elementData; - FileFormat format; - - public override void Read (ObjectReader reader, XmlElement elem) - { - elementData = elem; - this.format = reader.Format; - } - - public override XmlElement Write (ObjectWriter writer) - { - if (writer.Format != this.format) { - ErrorWidget ew = (ErrorWidget) Wrapped; - XmlElement elem = writer.XmlDocument.CreateElement ("widget"); - elem.SetAttribute ("class", "Gtk.Label"); - elem.SetAttribute ("id", Wrapped.Name); - XmlElement ce = writer.XmlDocument.CreateElement ("property"); - string msg; - if (ew.Exception != null) - msg = "Invalid widget"; - else - msg = "Unknown widget: " + ew.ClassName; - ce.SetAttribute ("name", "LabelProp"); - ce.InnerText = msg; - elem.AppendChild (ce); - return elem; - } - else - return (XmlElement) writer.XmlDocument.ImportNode (elementData, true); - } - - public override string WrappedTypeName { - get { - ErrorWidget ew = (ErrorWidget) Wrapped; - return ew.ClassName; - } - } - - internal protected override CodeExpression GenerateObjectCreation (GeneratorContext ctx) - { - ErrorWidget ew = (ErrorWidget) Wrapped; - string msg; - if (ew.Exception != null) - msg = Project.FileName + ": Could not generate code for an invalid widget. The widget failed to load: " + ew.Exception.Message + ". The generated code may be invalid."; - else - msg = Project.FileName + ": Could not generate code for widgets of type: " + ew.ClassName + ". The widget could not be found in any referenced library. The generated code may be invalid."; - - if (ctx.Options.FailForUnknownWidgets) { - throw new InvalidOperationException (msg); - } else { - ctx.ReportWarning (msg); - return new CodePrimitiveExpression (null); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/GeneratorContext.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/GeneratorContext.cs deleted file mode 100644 index 42559124218..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/GeneratorContext.cs +++ /dev/null @@ -1,569 +0,0 @@ -using System; -using System.CodeDom; -using System.Collections; - -namespace Stetic -{ - public class GeneratorContext - { - CodeNamespace cns; - int n; - string idPrefix; - Hashtable vars = new Hashtable (); - ArrayList generatedWrappers = new ArrayList (); - WidgetMap map; - CodeStatementCollection statements; - GenerationOptions options; - ArrayList warnings = new ArrayList (); - CodeExpression rootObject; - - public GeneratorContext (CodeNamespace cns, string idPrefix, CodeStatementCollection statements, GenerationOptions options) - { - this.cns = cns; - this.idPrefix = idPrefix; - this.statements = statements; - this.options = options; - map = new WidgetMap (vars); - } - - public CodeNamespace GlobalCodeNamespace { - get { return cns; } - } - - public CodeStatementCollection Statements { - get { return statements; } - } - - public GenerationOptions Options { - get { return options; } - } - - public string[] Warnings { - get { return (string[]) warnings.ToArray (typeof(string)); } - } - - public void ReportWarning (string s) - { - warnings.Add (s); - } - - public string NewId () - { - return idPrefix + (++n); - } - - public CodeExpression GenerateNewInstanceCode (Wrapper.Widget widget) - { - CodeExpression exp = widget.GenerateObjectCreation (this); - CodeExpression var = GenerateInstanceExpression (widget, exp); - GenerateBuildCode (widget, var); - return var; - } - - public virtual CodeExpression GenerateInstanceExpression (ObjectWrapper wrapper, CodeExpression newObject) - { - string varName = NewId (); - CodeVariableDeclarationStatement varDec = new CodeVariableDeclarationStatement (wrapper.WrappedTypeName.ToGlobalTypeRef (), varName); - varDec.InitExpression = newObject; - statements.Add (varDec); - return new CodeVariableReferenceExpression (varName); - } - - public virtual void GenerateCreationCode (ObjectWrapper wrapper, CodeExpression varExp) - { - rootObject = varExp; - wrapper.GenerateInitCode (this, varExp); - GenerateBuildCode (wrapper, varExp); - } - - public virtual void GenerateBuildCode (ObjectWrapper wrapper, CodeExpression var) - { - vars [wrapper] = var; - wrapper.GenerateBuildCode (this, var); - generatedWrappers.Add (wrapper); - } - - public virtual void GenerateCreationCode (Wrapper.ActionGroup agroup, CodeExpression var) - { - rootObject = var; - vars [agroup] = var; - agroup.GenerateBuildCode (this, var); - } - - public CodeExpression GenerateValue (object value, Type type) - { - return GenerateValue (value, type, false); - } - - public CodeExpression GenerateValue (object value, Type type, bool translatable) - { - if (value == null) - return new CodePrimitiveExpression (value); - - if (value.GetType ().IsEnum) { - if (!type.IsEnum) { - object ival = Convert.ChangeType (value, type); - return new CodePrimitiveExpression (ival); - } else { - long ival = (long) Convert.ChangeType (value, typeof(long)); - return new CodeCastExpression ( - value.GetType ().ToGlobalTypeRef (), - new CodePrimitiveExpression (ival) - ); - } - } - - if (value is Gtk.Adjustment) { - Gtk.Adjustment adj = value as Gtk.Adjustment; - return new CodeObjectCreateExpression ( - typeof(Gtk.Adjustment).ToGlobalTypeRef (), - new CodePrimitiveExpression (adj.Value), - new CodePrimitiveExpression (adj.Lower), - new CodePrimitiveExpression (adj.Upper), - new CodePrimitiveExpression (adj.StepIncrement), - new CodePrimitiveExpression (adj.PageIncrement), - new CodePrimitiveExpression (adj.PageSize)); - } - if (value is ushort || value is uint) { - return new CodeCastExpression ( - value.GetType ().ToGlobalTypeRef (), - new CodePrimitiveExpression (Convert.ChangeType (value, typeof(long)))); - } - if (value is ulong) { - return new CodeMethodInvokeExpression ( - new CodeTypeReferenceExpression (value.GetType ()), - "Parse", - new CodePrimitiveExpression (value.ToString ())); - } - - if (value is ImageInfo && typeof(Gdk.Pixbuf).IsAssignableFrom (type)) - return ((ImageInfo)value).ToCodeExpression (this); - - if (value is Wrapper.ActionGroup) { - return new CodeMethodInvokeExpression ( - new CodeMethodReferenceExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (GlobalCodeNamespace.Name + ".ActionGroups", CodeTypeReferenceOptions.GlobalReference)), - "GetActionGroup" - ), - new CodePrimitiveExpression (((Wrapper.ActionGroup)value).Name) - ); - } - - if (value is Array) { - ArrayList list = new ArrayList (); - foreach (object val in (Array)value) - list.Add (GenerateValue (val, val != null ? val.GetType() : null, translatable)); - return new CodeArrayCreateExpression (value.GetType().GetElementType(), (CodeExpression[]) list.ToArray(typeof(CodeExpression))); - } - - if (value is DateTime) { - return new CodeObjectCreateExpression ( - typeof(DateTime).ToGlobalTypeRef (), - new CodePrimitiveExpression (((DateTime)value).Ticks) - ); - } - - if (value is TimeSpan) { - return new CodeObjectCreateExpression ( - typeof(TimeSpan).ToGlobalTypeRef (), - new CodePrimitiveExpression (((TimeSpan)value).Ticks) - ); - } - - string str = value as string; - if (translatable && str != null && str.Length > 0 && options.UseGettext) { - return new CodeMethodInvokeExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (options.GettextClass, CodeTypeReferenceOptions.GlobalReference)), - "GetString", - new CodePrimitiveExpression (str) - ); - } - - return new CodePrimitiveExpression (value); - } - - public WidgetMap WidgetMap { - get { return map; } - } - - public System.CodeDom.CodeExpression RootObject { - get { - return rootObject; - } - set { - rootObject = value; - } - } - - public void EndGeneration () - { - foreach (ObjectWrapper w in generatedWrappers) { - CodeExpression var = (CodeExpression) vars [w]; - w.GeneratePostBuildCode (this, var); - } - } - - public void Reset () - { - vars.Clear (); - generatedWrappers.Clear (); - map = new WidgetMap (vars); - n = 0; - } - - public CodeExpression GenerateLoadPixbuf (string name, Gtk.IconSize size) - { - bool found = false; - foreach (CodeTypeDeclaration t in cns.Types) { - if (t.Name == "IconLoader") { - found = true; - break; - } - } - - if (!found) - { - CodeTypeDeclaration cls = new CodeTypeDeclaration ("IconLoader"); - cls.Attributes = MemberAttributes.Private; - cls.TypeAttributes = System.Reflection.TypeAttributes.NestedAssembly; - cns.Types.Add (cls); - - CodeMemberMethod met = new CodeMemberMethod (); - cls.Members.Add (met); - met.Attributes = MemberAttributes.Public | MemberAttributes.Static; - met.Name = "LoadIcon"; - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(Gtk.Widget), "widget")); - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(string), "name")); - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(Gtk.IconSize), "size")); - met.ReturnType = new CodeTypeReference (typeof(Gdk.Pixbuf)); - - CodeExpression widgetExp = new CodeVariableReferenceExpression ("widget"); - CodeExpression nameExp = new CodeVariableReferenceExpression ("name"); - CodeExpression sizeExp = new CodeVariableReferenceExpression ("size"); - CodeExpression szExp = new CodeVariableReferenceExpression ("sz"); - CodeExpression mgExp = new CodeBinaryOperatorExpression (szExp, CodeBinaryOperatorType.Divide, new CodePrimitiveExpression (4)); - CodeExpression pmapExp = new CodeVariableReferenceExpression ("pmap"); - CodeExpression gcExp = new CodeVariableReferenceExpression ("gc"); - CodeExpression szM1Exp = new CodeBinaryOperatorExpression (szExp, CodeBinaryOperatorType.Subtract, new CodePrimitiveExpression (1)); - CodeExpression zeroExp = new CodePrimitiveExpression (0); - CodeExpression resExp = new CodeVariableReferenceExpression ("res"); - - met.Statements.Add ( - new CodeVariableDeclarationStatement (typeof(Gdk.Pixbuf), "res", - new CodeMethodInvokeExpression ( - widgetExp, - "RenderIcon", - nameExp, - sizeExp, - new CodePrimitiveExpression (null) - ) - ) - ); - - CodeConditionStatement nullcheck = new CodeConditionStatement (); - met.Statements.Add (nullcheck); - nullcheck.Condition = new CodeBinaryOperatorExpression ( - resExp, - CodeBinaryOperatorType.IdentityInequality, - new CodePrimitiveExpression (null) - ); - nullcheck.TrueStatements.Add (new CodeMethodReturnStatement (resExp)); - - // int sz, h; - // Gtk.Icon.SizeLookup (size, out sz, out h); - - nullcheck.FalseStatements.Add (new CodeVariableDeclarationStatement (typeof(int), "sz")); - nullcheck.FalseStatements.Add (new CodeVariableDeclarationStatement (typeof(int), "sy")); - nullcheck.FalseStatements.Add (new CodeMethodInvokeExpression ( - new CodeTypeReferenceExpression (typeof(Gtk.Icon).ToGlobalTypeRef ()), - "SizeLookup", - sizeExp, - new CodeDirectionExpression (FieldDirection.Out, szExp), - new CodeDirectionExpression (FieldDirection.Out, new CodeVariableReferenceExpression ("sy")) - )); - - CodeTryCatchFinallyStatement trycatch = new CodeTryCatchFinallyStatement (); - nullcheck.FalseStatements.Add (trycatch); - trycatch.TryStatements.Add ( - new CodeMethodReturnStatement ( - new CodeMethodInvokeExpression ( - new CodePropertyReferenceExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (typeof(Gtk.IconTheme))), - "Default" - ), - "LoadIcon", - nameExp, - szExp, - zeroExp - ) - ) - ); - - CodeCatchClause ccatch = new CodeCatchClause (); - trycatch.CatchClauses.Add (ccatch); - - CodeConditionStatement cond = new CodeConditionStatement (); - ccatch.Statements.Add (cond); - - cond.Condition = new CodeBinaryOperatorExpression ( - nameExp, - CodeBinaryOperatorType.IdentityInequality, - new CodePrimitiveExpression ("gtk-missing-image") - ); - - cond.TrueStatements.Add ( - new CodeMethodReturnStatement ( - new CodeMethodInvokeExpression ( - new CodeTypeReferenceExpression (cns.Name + "." + cls.Name), - "LoadIcon", - widgetExp, - new CodePrimitiveExpression ("gtk-missing-image"), - sizeExp - ) - ) - ); - - CodeStatementCollection stms = cond.FalseStatements; - - stms.Add ( - new CodeVariableDeclarationStatement (typeof(Gdk.Pixmap), "pmap", - new CodeObjectCreateExpression ( - typeof(Gdk.Pixmap), - new CodePropertyReferenceExpression ( - new CodePropertyReferenceExpression ( - new CodeTypeReferenceExpression (typeof(Gdk.Screen)), - "Default" - ), - "RootWindow" - ), - szExp, - szExp - ) - ) - ); - stms.Add ( - new CodeVariableDeclarationStatement (typeof(Gdk.GC), "gc", - new CodeObjectCreateExpression (typeof(Gdk.GC), pmapExp) - ) - ); - stms.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression ( - gcExp, - "RgbFgColor" - ), - new CodeObjectCreateExpression ( - typeof(Gdk.Color), - new CodePrimitiveExpression (255), - new CodePrimitiveExpression (255), - new CodePrimitiveExpression (255) - ) - ) - ); - stms.Add ( - new CodeMethodInvokeExpression ( - pmapExp, - "DrawRectangle", - gcExp, - new CodePrimitiveExpression (true), - zeroExp, - zeroExp, - szExp, - szExp - ) - ); - stms.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression ( - gcExp, - "RgbFgColor" - ), - new CodeObjectCreateExpression ( - typeof(Gdk.Color), - zeroExp, zeroExp, zeroExp - ) - ) - ); - stms.Add ( - new CodeMethodInvokeExpression ( - pmapExp, - "DrawRectangle", - gcExp, - new CodePrimitiveExpression (false), - zeroExp, - zeroExp, - szM1Exp, - szM1Exp - ) - ); - stms.Add ( - new CodeMethodInvokeExpression ( - gcExp, - "SetLineAttributes", - new CodePrimitiveExpression (3), - new CodeFieldReferenceExpression (new CodeTypeReferenceExpression (typeof(Gdk.LineStyle)), "Solid"), - new CodeFieldReferenceExpression (new CodeTypeReferenceExpression (typeof(Gdk.CapStyle)), "Round"), - new CodeFieldReferenceExpression (new CodeTypeReferenceExpression (typeof(Gdk.JoinStyle)), "Round") - ) - ); - stms.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression ( - gcExp, - "RgbFgColor" - ), - new CodeObjectCreateExpression ( - typeof(Gdk.Color), - new CodePrimitiveExpression (255), - zeroExp, - zeroExp - ) - ) - ); - stms.Add ( - new CodeMethodInvokeExpression ( - pmapExp, - "DrawLine", - gcExp, - mgExp, - mgExp, - new CodeBinaryOperatorExpression (szM1Exp, CodeBinaryOperatorType.Subtract, mgExp), - new CodeBinaryOperatorExpression (szM1Exp, CodeBinaryOperatorType.Subtract, mgExp) - ) - ); - stms.Add ( - new CodeMethodInvokeExpression ( - pmapExp, - "DrawLine", - gcExp, - new CodeBinaryOperatorExpression (szM1Exp, CodeBinaryOperatorType.Subtract, mgExp), - mgExp, - mgExp, - new CodeBinaryOperatorExpression (szM1Exp, CodeBinaryOperatorType.Subtract, mgExp) - ) - ); - stms.Add ( - new CodeMethodReturnStatement ( - new CodeMethodInvokeExpression ( - new CodeTypeReferenceExpression (typeof(Gdk.Pixbuf)), - "FromDrawable", - pmapExp, - new CodePropertyReferenceExpression (pmapExp, "Colormap"), - zeroExp, zeroExp, zeroExp, zeroExp, szExp, szExp - ) - ) - ); - } - - int sz, h; - Gtk.Icon.SizeLookup (size, out sz, out h); - - return new CodeMethodInvokeExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (cns.Name + ".IconLoader", CodeTypeReferenceOptions.GlobalReference)), - "LoadIcon", - rootObject, - new CodePrimitiveExpression (name), - new CodeFieldReferenceExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (typeof(Gtk.IconSize), CodeTypeReferenceOptions.GlobalReference)), - size.ToString () - ) - ); - } - } - - public class WidgetMap - { - Hashtable vars; - - internal WidgetMap (Hashtable vars) - { - this.vars = vars; - } - - public CodeExpression GetWidgetExp (ObjectWrapper wrapper) - { - return (CodeExpression) vars [wrapper]; - } - - public CodeExpression GetWidgetExp (object wrapped) - { - ObjectWrapper w = ObjectWrapper.Lookup (wrapped); - if (w != null) - return GetWidgetExp (w); - else - return null; - } - } - - [Serializable] - public class GenerationOptions - { - bool useGettext; - bool partialClasses; - bool generateEmptyBuildMethod; - bool generateSingleFile = true; - bool failForUnknownWidgets = false; - string path; - string globalNamespace = "Stetic"; - string gettextClass; - string resourceLoader; - - public bool UseGettext { - get { return useGettext; } - set { useGettext = value; } - } - - public string GettextClass { - get { - if (string.IsNullOrEmpty (gettextClass)) - return "Mono.Unix.Catalog"; - else - return gettextClass; - } - set { gettextClass = value; } - } - - public string ImageResourceLoaderClass { - get { - if (string.IsNullOrEmpty (resourceLoader)) - return "Gdk.Pixbuf"; - else - return resourceLoader; - } - set { resourceLoader = value; } - } - - public bool UsePartialClasses { - get { return partialClasses; } - set { partialClasses = value; } - } - - public string Path { - get { return path; } - set { path = value; } - } - - public bool GenerateEmptyBuildMethod { - get { return generateEmptyBuildMethod; } - set { generateEmptyBuildMethod = value; } - } - - public bool GenerateSingleFile { - get { return generateSingleFile; } - set { generateSingleFile = value; } - } - - public string GlobalNamespace { - get { return globalNamespace; } - set { globalNamespace = value; } - } - - public bool FailForUnknownWidgets { - get { return failForUnknownWidgets; } - set { failForUnknownWidgets = value; } - } - - public bool GenerateModifiedOnly { get; set; } - } -} - diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/GladeException.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/GladeException.cs deleted file mode 100644 index 504dab9823e..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/GladeException.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; - -namespace Stetic { - - public class GladeException : ApplicationException { - - public GladeException (string message) : base (message) { } - - public GladeException (string message, string className) : - this (message + " (class " + className + ")") - { - this.className = className; - } - - public GladeException (string message, string className, - bool childprop, string propName) : - this (message + " (class " + className + ", " + (childprop ? "child " : "") + "property " + propName + ")") - { - this.childprop = childprop; - this.propName = propName; - } - - public GladeException (string message, string className, - bool childprop, string propName, string propVal) : - this (message + " (class " + className + ", " + (childprop ? "child " : "") + "property " + propName + ", value " + propVal + ")") - { - this.childprop = childprop; - this.propName = propName; - this.propVal = propVal; - } - - string className, propName, propVal; - bool childprop; - - public string ClassName { - get { - return className; - } - } - - public bool ChildProp { - get { - return childprop; - } - } - - public string PropName { - get { - return propName; - } - } - - public string PropVal { - get { - return propVal; - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/GladeUtils.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/GladeUtils.cs deleted file mode 100644 index 54ddf19983b..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/GladeUtils.cs +++ /dev/null @@ -1,791 +0,0 @@ -using System; -using System.IO; -using System.Reflection; -using System.Collections; -using System.Runtime.InteropServices; -using System.Xml; -using Stetic.Wrapper; - -namespace Stetic { - - public static class GladeUtils { - - public const string Glade20SystemId = "http://glade.gnome.org/glade-2.0.dtd"; - const string LIBGOBJ = "libgobject-2.0-0.dll"; - const string LIBGLIBGLUE = "glibsharpglue-2"; - const string LIBGTK = "libgtk-win32-2.0-0.dll"; - - static Gdk.Atom gladeAtom; - public static Gdk.Atom ApplicationXGladeAtom { - get { - if (gladeAtom == null) - gladeAtom = Gdk.Atom.Intern ("application/x-glade", false); - return gladeAtom; - } - } - - public static XmlDocument XslImportTransform (XmlDocument doc) - { -/* XmlDocumentType doctype = doc.DocumentType; - if (doctype == null || - doctype.Name != "glade-interface" || - doctype.SystemId != Glade20SystemId) - throw new GladeException ("Not a glade file according to doctype"); -*/ - - StringWriter sw = new StringWriter (); - XmlWriter xw = XmlWriter.Create (sw); - Registry.GladeImportXsl.Transform (doc, xw); - XmlReader reader = XmlReader.Create (sw.ToString ()); - doc = new XmlDocument (); - doc.PreserveWhitespace = true; - doc.Load (reader); - - return doc; - } - - public static XmlDocument XslExportTransform (XmlDocument doc) - { - StringWriter sw = new StringWriter (); - XmlWriter xw = XmlWriter.Create (sw); - Registry.GladeExportXsl.Transform (doc, xw); - XmlReader reader = XmlReader.Create (sw.ToString ()); - doc = new XmlDocument (); - doc.PreserveWhitespace = true; - doc.Load (reader); - - XmlDocumentType doctype = doc.CreateDocumentType ("glade-interface", null, Glade20SystemId, null); - doc.PrependChild (doctype); - - return doc; - } - - public static XmlDocument Export (Gtk.Widget widget) - { - Stetic.Wrapper.Widget wrapper = Stetic.Wrapper.Widget.Lookup (widget); - if (wrapper == null) - return null; - - XmlDocument doc = new XmlDocument (); - doc.PreserveWhitespace = true; - - XmlElement toplevel = doc.CreateElement ("glade-interface"); - doc.AppendChild (toplevel); - - // For toplevel widgets, glade just saves it as-is. For - // non-toplevels, it puts the widget into a dummy GtkWindow, - // but using the packing attributes of the widget's real - // container (so as to preserve expand/fill settings and the - // like). - - XmlElement elem; - Stetic.Wrapper.Container parent = wrapper.ParentWrapper; - ObjectWriter writer = new ObjectWriter (doc, FileFormat.Glade); - - if (parent == null) { - elem = wrapper.Write (writer); - if (elem == null) - return null; - if (!(widget is Gtk.Window)) { - XmlElement window = doc.CreateElement ("widget"); - window.SetAttribute ("class", "GtkWindow"); - window.SetAttribute ("id", "glade-dummy-container"); - XmlElement child = doc.CreateElement ("child"); - window.AppendChild (child); - child.AppendChild (elem); - elem = window; - } - } else { - elem = doc.CreateElement ("widget"); - // Set the class correctly (temporarily) so the XSL - // transforms will work correctly. - ClassDescriptor klass = parent.ClassDescriptor; - elem.SetAttribute ("class", klass.CName); - elem.AppendChild (parent.WriteContainerChild (writer, wrapper)); - } - toplevel.AppendChild (elem); - - doc = XslExportTransform (doc); - - if (parent != null) { - elem = (XmlElement)doc.SelectSingleNode ("glade-interface/widget"); - elem.SetAttribute ("class", "GtkWindow"); - elem.SetAttribute ("id", "glade-dummy-container"); - } - return doc; - } - - public static Stetic.Wrapper.Widget Import (IProject project, XmlDocument doc) - { - try { - doc = XslImportTransform (doc); - } catch { - return null; - } - - ObjectReader reader = new ObjectReader (project, FileFormat.Glade); - - XmlElement elem = (XmlElement)doc.SelectSingleNode ("glade-interface/widget"); - if (elem.GetAttribute ("class") != "GtkWindow" || - elem.GetAttribute ("id") != "glade-dummy-container") { - // Creating a new toplevel - Stetic.Wrapper.Widget toplevel = (Stetic.Wrapper.Widget) - Stetic.ObjectWrapper.ReadObject (reader, elem); - if (toplevel != null) { - project.AddWindow ((Gtk.Window)toplevel.Wrapped); - } - return toplevel; - } - - return (Stetic.Wrapper.Widget) - Stetic.ObjectWrapper.ReadObject (reader, (XmlElement)elem.SelectSingleNode ("child/widget")); - } - - public static void Copy (Gtk.Widget widget, Gtk.SelectionData seldata, bool copyAsText) - { - XmlDocument doc = Export (widget); - if (doc == null) - return; - - if (copyAsText) - seldata.Text = doc.OuterXml; - else - seldata.Set (ApplicationXGladeAtom, 8, System.Text.Encoding.UTF8.GetBytes (doc.OuterXml)); - } - - public static Stetic.Wrapper.Widget Paste (IProject project, Gtk.SelectionData seldata) - { - if (seldata.Type != ApplicationXGladeAtom) - return null; - string data = System.Text.Encoding.UTF8.GetString (seldata.Data); - - XmlDocument doc = new XmlDocument (); - doc.PreserveWhitespace = true; - try { - doc.LoadXml (data); - } catch { - return null; - } - - return Import (project, doc); - } - - static object GetProperty (XmlElement elem, string selector, object defaultValue, bool extract) - { - XmlElement prop = (XmlElement)elem.SelectSingleNode (selector); - if (prop == null) - return defaultValue; - if (extract) - prop.ParentNode.RemoveChild (prop); - return ParseProperty (null, defaultValue.GetType (), prop.InnerText).Val; - } - - public static object GetProperty (XmlElement elem, string name, object defaultValue) - { - return GetProperty (elem, "./property[@name='" + name + "']", defaultValue, false); - } - - public static object ExtractProperty (XmlElement elem, string name, object defaultValue) - { - return GetProperty (elem, "./property[@name='" + name + "']", defaultValue, true); - } - - public static object GetChildProperty (XmlElement elem, string name, object defaultValue) - { - return GetProperty (elem, "./packing/property[@name='" + name + "']", defaultValue, false); - } - - public static object ExtractChildProperty (XmlElement elem, string name, object defaultValue) - { - return GetProperty (elem, "./packing/property[@name='" + name + "']", defaultValue, true); - } - - public static void RenameProperty (XmlElement elem, string name, string newName) - { - XmlElement prop = (XmlElement)elem.SelectSingleNode ("./property[@name='" + name + "']"); - if (prop != null) - prop.SetAttribute ("name", newName); - } - - public static void SetProperty (XmlElement elem, string name, string value) - { - XmlElement prop_elem = elem.OwnerDocument.CreateElement ("property"); - prop_elem.SetAttribute ("name", name); - prop_elem.InnerText = value; - elem.AppendChild (prop_elem); - } - - public static void SetChildProperty (XmlElement elem, string name, string value) - { - XmlElement packing_elem = elem["packing"]; - if (packing_elem == null) { - packing_elem = elem.OwnerDocument.CreateElement ("packing"); - elem.AppendChild (packing_elem); - } - SetProperty (packing_elem, name, value); - } - - static GLib.Value ParseBasicType (GLib.TypeFundamentals type, string strval) - { - switch (type) { - case GLib.TypeFundamentals.TypeChar: - return new GLib.Value (SByte.Parse (strval)); - case GLib.TypeFundamentals.TypeUChar: - return new GLib.Value (Byte.Parse (strval)); - case GLib.TypeFundamentals.TypeBoolean: - return new GLib.Value (strval == "True"); - case GLib.TypeFundamentals.TypeInt: - return new GLib.Value (Int32.Parse (strval)); - case GLib.TypeFundamentals.TypeUInt: - return new GLib.Value (UInt32.Parse (strval)); - case GLib.TypeFundamentals.TypeInt64: - return new GLib.Value (Int64.Parse (strval)); - case GLib.TypeFundamentals.TypeUInt64: - return new GLib.Value (UInt64.Parse (strval)); - case GLib.TypeFundamentals.TypeFloat: - return new GLib.Value (Single.Parse (strval, System.Globalization.CultureInfo.InvariantCulture)); - case GLib.TypeFundamentals.TypeDouble: - return new GLib.Value (Double.Parse (strval, System.Globalization.CultureInfo.InvariantCulture)); - case GLib.TypeFundamentals.TypeString: - return new GLib.Value (strval); - default: - throw new GladeException ("Could not parse"); - } - } - - static GLib.Value ParseEnum (IntPtr gtype, string strval) - { - IntPtr enum_class = g_type_class_ref (gtype); - try { - IntPtr enum_value = g_enum_get_value_by_name (enum_class, strval); - if (enum_value == IntPtr.Zero) - throw new GladeException ("Could not parse"); - - int eval = Marshal.ReadInt32 (enum_value); - return new GLib.Value (Enum.ToObject (GLib.GType.LookupType (gtype), eval)); - } finally { - g_type_class_unref (enum_class); - } - } - - static GLib.Value ParseFlags (IntPtr gtype, string strval) - { - IntPtr flags_class = g_type_class_ref (gtype); - uint fval = 0; - - try { - foreach (string flag in strval.Split ('|')) { - if (flag == "") - continue; - IntPtr flags_value = g_flags_get_value_by_name (flags_class, flag); - if (flags_value == IntPtr.Zero) - throw new GladeException ("Could not parse"); - - int bits = Marshal.ReadInt32 (flags_value); - fval |= (uint)bits; - } - - return new GLib.Value (Enum.ToObject (GLib.GType.LookupType (gtype), fval)); - } finally { - g_type_class_unref (flags_class); - } - } - - static GLib.Value ParseAdjustment (string strval) - { - string[] vals = strval.Split (' '); - double deflt, min, max, step, page_inc, page_size; - - deflt = Double.Parse (vals[0], System.Globalization.CultureInfo.InvariantCulture); - min = Double.Parse (vals[1], System.Globalization.CultureInfo.InvariantCulture); - max = Double.Parse (vals[2], System.Globalization.CultureInfo.InvariantCulture); - step = Double.Parse (vals[3], System.Globalization.CultureInfo.InvariantCulture); - page_inc = Double.Parse (vals[4], System.Globalization.CultureInfo.InvariantCulture); - page_size = Double.Parse (vals[5], System.Globalization.CultureInfo.InvariantCulture); - return new GLib.Value (new Gtk.Adjustment (deflt, min, max, step, page_inc, page_size)); - } - - /* static GLib.Value ParseUnichar (string strval) - { - return new GLib.Value (strval.Length == 1 ? (uint)strval[0] : 0U); - }*/ - - static GLib.Value ParseProperty (ParamSpec pspec, Type propType, string strval) - { - IntPtr gtype; - if (propType != null) - gtype = ((GLib.GType)propType).Val; -/* - FIXME: ValueType is not supported right now - - else if (pspec != null) - gtype = pspec.ValueType; -*/ - else - throw new GladeException ("Bad type"); - - GLib.TypeFundamentals typef = (GLib.TypeFundamentals)(int)g_type_fundamental (gtype); - - if (gtype == Gtk.Adjustment.GType.Val) - return ParseAdjustment (strval); - else if (typef == GLib.TypeFundamentals.TypeEnum) - return ParseEnum (gtype, strval); - else if (typef == GLib.TypeFundamentals.TypeFlags) - return ParseFlags (gtype, strval); -// FIXME: Enable when ParamSpec.IsUnichar is implemented. -// else if (pspec != null && pspec.IsUnichar) -// return ParseUnichar (strval); - else - return ParseBasicType (typef, strval); - } - - static PropertyInfo FindClrProperty (Type type, string name, bool childprop) - { - if (childprop) { - Type[] types = type.GetNestedTypes (); - foreach (Type t in types) { - if (typeof(Gtk.Container.ContainerChild).IsAssignableFrom (t)) { - type = t; - break; - } - } - foreach (PropertyInfo pi in type.GetProperties ()) { - Gtk.ChildPropertyAttribute at = (Gtk.ChildPropertyAttribute) Attribute.GetCustomAttribute (pi, typeof(Gtk.ChildPropertyAttribute), false); - if (at != null && at.Name == name) - return pi; - } - if (typeof(GLib.Object).IsAssignableFrom (type.BaseType)) - return FindClrProperty (type.BaseType, name, true); - } - - foreach (PropertyInfo pi in type.GetProperties ()) { - GLib.PropertyAttribute at = (GLib.PropertyAttribute) Attribute.GetCustomAttribute (pi, typeof(GLib.PropertyAttribute), false); - if (at != null && at.Name == name) - return pi; - } - return null; - } - - static GLib.Value ParseProperty (Type type, bool childprop, string name, string strval) - { - ParamSpec pspec; - - // FIXME: this can be removed when GParamSpec supports ValueType. - PropertyInfo pi = FindClrProperty (type, name, childprop); - if (pi == null) - throw new GladeException ("Unknown property", type.ToString (), childprop, name, strval); - - if (childprop) - pspec = ParamSpec.LookupChildProperty (type, name); - else - pspec = ParamSpec.LookupObjectProperty (type, name); - if (pspec == null) - throw new GladeException ("Unknown property", type.ToString (), childprop, name, strval); - - try { - return ParseProperty (pspec, pi.PropertyType, strval); - } catch { - throw new GladeException ("Could not parse property", type.ToString (), childprop, name, strval); - } - } - - static void ParseProperties (Type type, bool childprops, IEnumerable props, - out string[] propNames, out GLib.Value[] propVals) - { - ArrayList names = new ArrayList (); - ArrayList values = new ArrayList (); - - foreach (XmlElement prop in props) { - string name = prop.GetAttribute ("name").Replace ("_","-"); - string strval = prop.InnerText; - - // Skip translation context - if (prop.GetAttribute ("context") == "yes" && - strval.IndexOf ('|') != -1) - strval = strval.Substring (strval.IndexOf ('|') + 1); - - GLib.Value value; - try { - value = ParseProperty (type, childprops, name, strval); - names.Add (name); - values.Add (value); - } catch (GladeException ge) { - Console.Error.WriteLine (ge.Message); - } - } - - propNames = (string[])names.ToArray (typeof (string)); - propVals = (GLib.Value[])values.ToArray (typeof (GLib.Value)); - } - - static void ExtractProperties (TypedClassDescriptor klass, XmlElement elem, - out Hashtable rawProps, out Hashtable overrideProps) - { - rawProps = new Hashtable (); - overrideProps = new Hashtable (); - foreach (ItemGroup group in klass.ItemGroups) { - foreach (ItemDescriptor item in group) { - TypedPropertyDescriptor prop = item as TypedPropertyDescriptor; - if (prop == null) - continue; - prop = prop.GladeProperty; - if (prop.GladeName == null) - continue; - - XmlNode prop_node = elem.SelectSingleNode ("property[@name='" + prop.GladeName + "']"); - if (prop_node == null) - continue; - - if (prop.GladeOverride) - overrideProps[prop] = prop_node; - else - rawProps[prop] = prop_node; - } - } - } - - static void ReadSignals (TypedClassDescriptor klass, ObjectWrapper wrapper, XmlElement elem) - { - Stetic.Wrapper.Widget ob = wrapper as Stetic.Wrapper.Widget; - if (ob == null) return; - - foreach (ItemGroup group in klass.SignalGroups) { - foreach (TypedSignalDescriptor signal in group) { - if (signal.GladeName == null) - continue; - - XmlElement signal_elem = elem.SelectSingleNode ("signal[@name='" + signal.GladeName + "']") as XmlElement; - if (signal_elem == null) - continue; - - string handler = signal_elem.GetAttribute ("handler"); - bool after = signal_elem.GetAttribute ("after") == "yes"; - ob.Signals.Add (new Signal (signal, handler, after)); - } - } - } - - static public void ImportWidget (ObjectWrapper wrapper, XmlElement elem) - { - string className = elem.GetAttribute ("class"); - if (className == null) - throw new GladeException (" node with no class name"); - - ClassDescriptor klassBase = Registry.LookupClassByCName (className); - if (klassBase == null) - throw new GladeException ("No stetic ClassDescriptor for " + className); - - TypedClassDescriptor klass = klassBase as TypedClassDescriptor; - if (klass == null) - throw new GladeException ("The widget class " + className + " is not supported by Glade"); - - ReadSignals (klass, wrapper, elem); - - Hashtable rawProps, overrideProps; - ExtractProperties (klass, elem, out rawProps, out overrideProps); - - string[] propNames; - GLib.Value[] propVals; - ParseProperties (klass.WrappedType, false, rawProps.Values, - out propNames, out propVals); - - Gtk.Widget widget; - - if (wrapper.Wrapped == null) { - if (className == "GtkWindow" || className == "GtkDialog") { - widget = (Gtk.Widget) klass.CreateInstance (wrapper.Project); - ObjectWrapper.Bind (wrapper.Project, klass, wrapper, widget, true); - SetProperties (klass, widget, propNames, propVals); - } else { - IntPtr raw = gtksharp_object_newv (klass.GType.Val, propNames.Length, propNames, propVals); - if (raw == IntPtr.Zero) - throw new GladeException ("Could not create widget", className); - widget = (Gtk.Widget)GLib.Object.GetObject (raw, true); - if (widget == null) { - gtk_object_sink (raw); - throw new GladeException ("Could not create gtk# wrapper", className); - } - ObjectWrapper.Bind (wrapper.Project, klass, wrapper, widget, true); - } - } else { - widget = (Gtk.Widget)wrapper.Wrapped; - for (int i = 0; i < propNames.Length; i++) - g_object_set_property (widget.Handle, propNames[i], ref propVals[i]); - } - MarkTranslatables (widget, rawProps); - - widget.Name = elem.GetAttribute ("id"); - - SetOverrideProperties (wrapper, overrideProps); - MarkTranslatables (widget, overrideProps); - } - - static void SetProperties (TypedClassDescriptor klass, Gtk.Widget widget, string[] propNames, GLib.Value[] propVals) - { - for (int n=0; n 0) - prop_elem.InnerText = val; - - if (prop.Translatable && prop.IsTranslated (wrapper.Wrapped)) { - prop_elem.SetAttribute ("translatable", "yes"); - if (prop.TranslationContext (wrapper.Wrapped) != null) { - prop_elem.SetAttribute ("context", "yes"); - prop_elem.InnerText = prop.TranslationContext (wrapper.Wrapped) + "|" + prop_elem.InnerText; - } - if (prop.TranslationComment (wrapper.Wrapped) != null) - prop_elem.SetAttribute ("comments", prop.TranslationComment (wrapper.Wrapped)); - } - - parent_elem.AppendChild (prop_elem); - } - } - } - - static public void GetSignals (ObjectWrapper wrapper, XmlElement parent_elem) - { - Stetic.Wrapper.Widget ob = wrapper as Stetic.Wrapper.Widget; - if (ob == null) return; - - foreach (Signal signal in ob.Signals) { - if (((TypedSignalDescriptor)signal.SignalDescriptor).GladeName == null) - continue; - if (!signal.SignalDescriptor.VisibleFor (wrapper.Wrapped)) - continue; - - XmlElement signal_elem = parent_elem.OwnerDocument.CreateElement ("signal"); - signal_elem.SetAttribute ("name", ((TypedSignalDescriptor)signal.SignalDescriptor).GladeName); - signal_elem.SetAttribute ("handler", signal.Handler); - if (signal.After) - signal_elem.SetAttribute ("after", "yes"); - parent_elem.AppendChild (signal_elem); - } - } - - [DllImport (LIBGOBJ, CallingConvention = CallingConvention.Cdecl)] - static extern IntPtr g_type_fundamental (IntPtr gtype); - - [DllImport (LIBGOBJ, CallingConvention = CallingConvention.Cdecl)] - static extern IntPtr g_type_class_ref (IntPtr gtype); - - [DllImport (LIBGOBJ, CallingConvention = CallingConvention.Cdecl)] - static extern IntPtr g_type_class_unref (IntPtr klass); - - [DllImport (LIBGLIBGLUE, CallingConvention = CallingConvention.Cdecl)] - static extern IntPtr gtksharp_object_newv (IntPtr gtype, int n_params, string[] names, GLib.Value[] vals); - - [DllImport (LIBGTK, CallingConvention = CallingConvention.Cdecl)] - static extern void gtk_object_sink (IntPtr raw); - - [DllImport (LIBGOBJ, CallingConvention = CallingConvention.Cdecl)] - static extern void g_object_get_property (IntPtr obj, string name, ref GLib.Value val); - - [DllImport (LIBGOBJ, CallingConvention = CallingConvention.Cdecl)] - static extern void g_object_set_property (IntPtr obj, string name, ref GLib.Value val); - - [DllImport (LIBGTK, CallingConvention = CallingConvention.Cdecl)] - static extern void gtk_container_child_get_property (IntPtr parent, IntPtr child, string name, ref GLib.Value val); - - [DllImport (LIBGOBJ, CallingConvention = CallingConvention.Cdecl)] - static extern IntPtr g_enum_get_value_by_name (IntPtr enum_class, string name); - - [DllImport (LIBGOBJ, CallingConvention = CallingConvention.Cdecl)] - static extern IntPtr g_enum_get_value (IntPtr enum_class, int val); - - [DllImport (LIBGOBJ, CallingConvention = CallingConvention.Cdecl)] - static extern IntPtr g_flags_get_value_by_name (IntPtr flags_class, string nick); - - [DllImport (LIBGOBJ, CallingConvention = CallingConvention.Cdecl)] - static extern IntPtr g_flags_get_first_value (IntPtr flags_class, uint val); - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/IDesignArea.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/IDesignArea.cs deleted file mode 100644 index 7fb86f1bebf..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/IDesignArea.cs +++ /dev/null @@ -1,39 +0,0 @@ - -using System; - -namespace Stetic -{ - public interface IDesignArea - { - IObjectSelection SetSelection (Gtk.Widget widget, object selectedInstance); - IObjectSelection SetSelection (Gtk.Widget widget, object selectedInstance, bool allowDrag); - void ResetSelection (Gtk.Widget widget); - bool IsSelected (Gtk.Widget widget); - IObjectSelection GetSelection (); - IObjectSelection GetSelection (Gtk.Widget widget); - - void AddWidget (Gtk.Widget w, int x, int y); - void RemoveWidget (Gtk.Widget w); - void MoveWidget (Gtk.Widget w, int x, int y); - Gdk.Rectangle GetCoordinates (Gtk.Widget w); - - event EventHandler SelectionChanged; - } - - public delegate void DragDelegate (Gdk.EventMotion evt, int dx, int dy); - - public interface IObjectViewer - { - object TargetObject { get; set; } - } - - public interface IObjectSelection: IDisposable - { - Gtk.Widget Widget { get; } - object DataObject { get; } - bool AllowDrag {get; set; } - - event DragDelegate Drag; - event EventHandler Disposed; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/IEditableObject.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/IEditableObject.cs deleted file mode 100644 index dd2e54c5dfb..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/IEditableObject.cs +++ /dev/null @@ -1,18 +0,0 @@ - -using System; - -namespace Stetic -{ - public interface IEditableObject - { - bool CanCopy { get; } - bool CanCut { get; } - bool CanPaste { get; } - bool CanDelete { get; } - - void Copy (); - void Cut (); - void Paste (); - void Delete (); - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/IProject.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/IProject.cs deleted file mode 100644 index 2f01c90c155..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/IProject.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; - -namespace Stetic -{ - public interface IProject - { - string FileName { get; } - Gtk.Widget[] Toplevels { get; } - Gtk.Widget GetTopLevel (string name); - Gtk.Widget Selection { get; set; } - Wrapper.ActionGroupCollection ActionGroups { get; } - ProjectIconFactory IconFactory { get; } - string ImagesRootPath { get; } - string TargetGtkVersion { get; } - bool Modified { get; set; } - IResourceProvider ResourceProvider { get; set; } - - void PopupContextMenu (Stetic.Wrapper.Widget wrapper); - void PopupContextMenu (Placeholder ph); - void AddWindow (Gtk.Window window); - string ImportFile (string filePath); - - event Wrapper.WidgetEventHandler SelectionChanged; - - void NotifyObjectChanged (ObjectWrapperEventArgs args); - void NotifyNameChanged (Stetic.Wrapper.WidgetNameChangedArgs args); - void NotifySignalAdded (SignalEventArgs args); - void NotifySignalRemoved (SignalEventArgs args); - void NotifySignalChanged (SignalChangedEventArgs args); - void NotifyWidgetContentsChanged (Wrapper.Widget w); - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/IPropertyEditor.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/IPropertyEditor.cs deleted file mode 100644 index f0cb14a48b5..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/IPropertyEditor.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; - -namespace Stetic -{ - // Property editors must be Gtk Widgets and implement this interface - - public interface IPropertyEditor: IDisposable - { - // Called once to initialize the editor. - void Initialize (PropertyDescriptor descriptor); - - // Called when the object to be edited changes. - void AttachObject (object obj); - - // Gets/Sets the value of the editor. If the editor supports - // several value types, it is the responsibility of the editor - // to return values with the expected type. - object Value { get; set; } - - // To be fired when the edited value changes. - event EventHandler ValueChanged; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/IRadioGroupManager.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/IRadioGroupManager.cs deleted file mode 100644 index fe0cdec704b..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/IRadioGroupManager.cs +++ /dev/null @@ -1,21 +0,0 @@ - -using System; -using System.Collections; - -namespace Stetic -{ - public delegate void GroupsChangedDelegate (); - - public interface IRadioGroupManagerProvider - { - IRadioGroupManager GetGroupManager (); - } - - public interface IRadioGroupManager - { - event GroupsChangedDelegate GroupsChanged; - IEnumerable GroupNames { get; } - void Rename (string oldName, string newName); - void Add (string group); - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/IResourceProvider.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/IResourceProvider.cs deleted file mode 100644 index 3394cf77a62..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/IResourceProvider.cs +++ /dev/null @@ -1,72 +0,0 @@ - -using System; -using System.IO; - -namespace Stetic -{ - public interface IResourceProvider - { - ResourceInfo[] GetResources (); - Stream GetResourceStream (string resourceName); - ResourceInfo AddResource (string fileName); - void RemoveResource (string resourceName); - } - - public delegate string MimeResolverDelegate (string url); - - [Serializable] - public class ResourceInfo - { - public static MimeResolverDelegate MimeResolver; - - string name; - string fileName; - string mimeType; - - public ResourceInfo (string name, string fileName): this (name, fileName, null) - { - } - - public ResourceInfo (string name, string fileName, string mimeType) - { - this.name = name; - this.fileName = fileName; - this.mimeType = mimeType; - } - - public string Name { - get { return name; } - } - - public string FileName { - get { return fileName; } - } - - public string MimeType { - get { - if (mimeType == null) { - if (MimeResolver == null) - return null; - - if (File.Exists (fileName)) { - mimeType = MimeResolver (fileName); - } else { - // Guess the mime type creating a temp file with the same extension - string fn = Path.GetTempFileName (); - string ext = Path.GetExtension (fileName); - int n=0; - while (File.Exists (fn + n + ext)) - n++; - string tname = fn + n + ext; - File.Move (fn, tname); - mimeType = MimeResolver (tname); - File.Delete (tname); - } - if (mimeType == null || mimeType == "") - mimeType = "text"; - } - return mimeType; - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/ImageInfo.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/ImageInfo.cs deleted file mode 100644 index 0a766731d3e..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/ImageInfo.cs +++ /dev/null @@ -1,217 +0,0 @@ - -using System; -using System.IO; -using System.CodeDom; - -namespace Stetic -{ - public enum ImageSource - { - Theme, - Resource, - File - } - - public class ImageInfo - { - ImageSource source; - string name; - Gtk.IconSize size; - Gdk.Pixbuf image; - - private ImageInfo () - { - } - - public string Label { - get { - if (source == ImageSource.File) - return Path.GetFileName (name); - else - return name; - } - } - - public string Name { - get { return name; } - } - - public Gtk.IconSize ThemeIconSize { - get { return size; } - } - - public ImageSource Source { - get { return source; } - } - - public override string ToString () - { - if (source == ImageSource.Theme) - return "stock:" + name + " " + size; - else if (source == ImageSource.Resource) - return "resource:" + name; - else - return "file:" + name; - } - - public static ImageInfo FromResource (string resourceName) - { - ImageInfo info = new ImageInfo (); - info.name = resourceName; - info.source = ImageSource.Resource; - return info; - } - - public static ImageInfo FromTheme (string iconId, Gtk.IconSize size) - { - ImageInfo info = new ImageInfo (); - info.name = iconId; - info.size = size; - info.source = ImageSource.Theme; - return info; - } - - public static ImageInfo FromFile (string file) - { - ImageInfo info = new ImageInfo (); - info.name = file; - info.source = ImageSource.File; - return info; - } - - public static ImageInfo FromString (string str) - { - ImageInfo info = new ImageInfo (); - if (str.StartsWith ("resource:")) { - info.source = ImageSource.Resource; - info.name = str.Substring (9); - } else if (str.StartsWith ("stock:")) { - info.source = ImageSource.Theme; - string[] s = str.Substring (6).Split (' '); - if (s.Length != 2) - return null; - info.name = s[0]; - info.size = (Gtk.IconSize) Enum.Parse (typeof(Gtk.IconSize), s[1]); - } else if (str.StartsWith ("file:")) { - info.source = ImageSource.File; - info.name = str.Substring (5); - } else - return null; - return info; - } - - public Gdk.Pixbuf GetImage (IProject project) - { - if (image != null) - return image; - - switch (source) { - case ImageSource.Resource: - if (project.ResourceProvider == null) - return null; - System.IO.Stream s = project.ResourceProvider.GetResourceStream (name); - if (s == null) - return null; - try { - return image = new Gdk.Pixbuf (s); - } catch { - // Not a valid image - return WidgetUtils.MissingIcon; - } finally { - s.Dispose (); - } - - case ImageSource.Theme: - return image = WidgetUtils.LoadIcon (name, size); - - case ImageSource.File: - try { - string file = Path.Combine (project.ImagesRootPath, name); - return image = new Gdk.Pixbuf (file); - } catch { - return WidgetUtils.MissingIcon; - } - } - return null; - } - - public Gdk.Pixbuf GetThumbnail (IProject project, int thumbnailSize) - { - Gdk.Pixbuf pix = GetImage (project); - if (pix == null) - return null; - - if (pix.Width >= pix.Height && pix.Width > thumbnailSize) { - return ScaleImage (pix, thumbnailSize, thumbnailSize); - } else if (pix.Height > pix.Width && pix.Height > thumbnailSize) { - return ScaleImage (pix, thumbnailSize, thumbnailSize); - } - return pix; - } - - public Gdk.Pixbuf GetScaledImage (IProject project, Gtk.IconSize size) - { - int w, h; - Gtk.Icon.SizeLookup (size, out w, out h); - return GetScaledImage (project, w, h); - } - - public Gdk.Pixbuf GetScaledImage (IProject project, int width, int height) - { - Gdk.Pixbuf pix = GetImage (project); - if (pix == null) - return null; - else - return ScaleImage (pix, width, height); - } - - Gdk.Pixbuf ScaleImage (Gdk.Pixbuf pix, int width, int height) - { - if ((pix.Width - width) > (pix.Height - height)) { - if (pix.Width != width) { - float prop = (float) pix.Height / (float) pix.Width; - return pix.ScaleSimple (width, (int)(width * prop), Gdk.InterpType.Bilinear); - } - } else { - if (pix.Height != height) { - float prop = (float) pix.Width / (float) pix.Height; - return pix.ScaleSimple ((int)(height * prop), height, Gdk.InterpType.Bilinear); - } - } - return pix; - } - - public CodeExpression ToCodeExpression (GeneratorContext ctx) - { - switch (source) { - case ImageSource.Resource: - return new CodeMethodInvokeExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (ctx.Options.ImageResourceLoaderClass, CodeTypeReferenceOptions.GlobalReference)), - "LoadFromResource", - new CodePrimitiveExpression (name) - ); - - case ImageSource.Theme: - return ctx.GenerateLoadPixbuf (name, size); - - case ImageSource.File: - return new CodeObjectCreateExpression ( - typeof(Gdk.Pixbuf).ToGlobalTypeRef (), - new CodeMethodInvokeExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (typeof(System.IO.Path), CodeTypeReferenceOptions.GlobalReference)), - "Combine", - new CodePropertyReferenceExpression ( - new CodePropertyReferenceExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (typeof(AppDomain), CodeTypeReferenceOptions.GlobalReference)), - "CurrentDomain" - ), - "BaseDirectory" - ), - new CodePrimitiveExpression (name) - ) - ); - } - return new CodePrimitiveExpression (null); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/ItemDescriptor.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/ItemDescriptor.cs deleted file mode 100644 index a64644eb068..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/ItemDescriptor.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System; -using System.Collections; -using System.Xml; -using System.Reflection; - -namespace Stetic -{ - [Serializable] - public abstract class ItemDescriptor - { - [NonSerialized] - ArrayList deps; - - [NonSerialized] - ArrayList visdeps; - - [NonSerialized] - bool isInternal; - - [NonSerialized] - ClassDescriptor klass; - - protected string targetGtkVersion; - - protected ItemDescriptor () {} - - protected ItemDescriptor (XmlElement elem, ItemGroup group, ClassDescriptor klass) - { - this.klass = klass; - isInternal = elem.HasAttribute ("internal"); - deps = AddSubprops (elem.SelectNodes ("./disabled-if"), group, klass); - visdeps = AddSubprops (elem.SelectNodes ("./invisible-if"), group, klass); - targetGtkVersion = elem.GetAttribute ("gtk-version"); - if (targetGtkVersion.Length == 0) - targetGtkVersion = null; - } - - ArrayList AddSubprops (XmlNodeList nodes, ItemGroup group, ClassDescriptor klass) - { - ArrayList list = null; - - // Sub-properties can have a name+value (which checks for the value of a - // property) or a method name, which should return true if the item has - // to be disabled/hidden. - - foreach (XmlElement elem in nodes) { - string name = elem.GetAttribute ("name"); - if (name.Length > 0) { - string value = elem.GetAttribute ("value"); - - PropertyDescriptor prop = (PropertyDescriptor)group[name]; - if (prop == null) - prop = (PropertyDescriptor)klass[name]; - if (prop == null) - throw new ArgumentException ("Bad sub-prop " + name); - if (list == null) - list = new ArrayList (); - - DepInfo info = new DepInfo (); - info.Property = prop; - info.Value = prop.StringToValue (value); - list.Add (info); - } else if ((name = elem.GetAttribute ("check")).Length > 0) { - DepInfo info = new DepInfo (); - info.CheckName = name; - if (list == null) - list = new ArrayList (); - list.Add (info); - } else { - throw new ArgumentException ("Bad sub-prop"); - } - } - return list; - } - - // The property's display name - public abstract string Name { get; } - - public virtual string TargetGtkVersion { - get { - if (targetGtkVersion == null) - return klass.TargetGtkVersion; - else - return targetGtkVersion; - } - } - - public bool SupportsGtkVersion (string targetVersion) - { - return WidgetUtils.CompareVersions (TargetGtkVersion, targetVersion) >= 0; - } - - public bool HasDependencies { - get { - return deps != null || visdeps != null; - } - } - - public bool EnabledFor (object obj) - { - if (deps == null) - return true; - - foreach (DepInfo dep in deps) { - if (dep.Check (obj)) - return false; - } - return true; - } - - public bool HasVisibility { - get { - return visdeps != null; - } - } - - public bool VisibleFor (object obj) - { - if (visdeps == null) - return true; - - foreach (DepInfo dep in visdeps) { - if (dep.Check (obj)) - return false; - } - return true; - } - - public bool IsInternal { - get { - return isInternal; - } - } - - public ClassDescriptor ClassDescriptor { - get { return klass; } - } - - class DepInfo - { - public string CheckName; - public PropertyDescriptor Property; - public object Value; - - public bool Check (object obj) - { - if (Property != null) { - object depValue = Property.GetValue (obj); - return Value.Equals (depValue); - } else { - object wrapper = ObjectWrapper.Lookup (obj); - object res = wrapper.GetType ().InvokeMember (CheckName, BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, wrapper, null); - return !(bool) res; - } - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/ItemGroup.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/ItemGroup.cs deleted file mode 100644 index b5083c53d34..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/ItemGroup.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Specialized; -using System.Xml; - -namespace Stetic { - public class ItemGroup : IEnumerable - { - public static ItemGroup Empty; - - string label, name; - ListDictionary items = new ListDictionary (); - ClassDescriptor declaringType; - - static ItemGroup () - { - Empty = new ItemGroup (); - } - - private ItemGroup () - { - } - - public ItemGroup (XmlElement elem, ClassDescriptor klass) - { - declaringType = klass; - label = elem.GetAttribute ("label"); - name = elem.GetAttribute ("name"); - - XmlNodeList nodes = elem.SelectNodes ("property | command | signal"); - for (int i = 0; i < nodes.Count; i++) { - XmlElement item = (XmlElement)nodes[i]; - string refname = item.GetAttribute ("ref"); - if (refname != "") { - if (refname.IndexOf ('.') != -1) { - ItemDescriptor desc = (ItemDescriptor) Registry.LookupItem (refname); - items [desc.Name] = desc; - } else { - ItemDescriptor desc = (ItemDescriptor) klass[refname]; - items [desc.Name] = desc; - } - continue; - } - - ItemDescriptor idesc = klass.CreateItemDescriptor ((XmlElement)item, this); - if (idesc != null) - items [idesc.Name] = idesc; - } - } - - public string Label { - get { - return label; - } - } - - public string Name { - get { - return name; - } - } - - public IEnumerator GetEnumerator () - { - return items.Values.GetEnumerator (); - } - - public ItemDescriptor this [string name] { - get { - return (ItemDescriptor) items [name]; - } - } - - public ClassDescriptor DeclaringType { - get { return declaringType; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/ItemGroupCollection.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/ItemGroupCollection.cs deleted file mode 100644 index 9fb9296315c..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/ItemGroupCollection.cs +++ /dev/null @@ -1,42 +0,0 @@ - -using System; -using System.Collections; - -namespace Stetic -{ - public class ItemGroupCollection: CollectionBase - { - public void Add (ItemGroup group) - { - List.Add (group); - } - - public ItemGroup this [int n] - { - get { - return (ItemGroup) List [n]; - } - } - - public ItemGroup this [string name] - { - get { - for (int n=0; n 0) { - Type type = Registry.GetType (convTypeName, true); - typeConverter = (TypeConverter) Activator.CreateInstance (type); - } - } - - // The property's user-visible name - public virtual string Label { - get { - return label; - } - } - - // The property's type - public abstract Type PropertyType { - get ; - } - - // The property's user-visible description - public virtual string Description { - get { - return description; - } - } - - // The property's GUI editor type, if overridden - public virtual Type EditorType { - get { - return editorType; - } - } - - // The property's minimum value, if declared - public virtual object Minimum { - get { - return minimum; - } - } - - // The property's maximum value, if declared - public virtual object Maximum { - get { - return maximum; - } - } - - public virtual string InternalChildId { - get { return null; } - } - - // Whether or not the property has a default value - public virtual bool HasDefault { - get { - return hasDefault; - } - set { - hasDefault = value; - } - } - - public virtual bool IsDefaultValue (object value) - { - if (value == null) - return true; - if (defaultValue != null) - return value.Equals (defaultValue); - return false; - } - - public virtual void ResetValue (object instance) - { - if (HasDefault) - SetValue (instance, defaultValue); - } - - // The property's type at run time - public virtual Type RuntimePropertyType { - get { return PropertyType; } - } - - // Gets the value of the property on @obj - public abstract object GetValue (object obj); - - // Gets the value of the property on @obj, bypassing the wrapper. - public virtual object GetRuntimeValue (object obj) - { - return GetValue (obj); - } - - // Whether or not the property is writable - public virtual bool CanWrite { - get { return true; } - } - - // Sets the value of the property on @obj - public abstract void SetValue (object obj, object value); - - // Sets the value of the property on @obj, bypassing the wrapper. - public virtual void SetRuntimeValue (object obj, object value) - { - SetValue (obj, value); - } - - // Parses a string an returns a value valid for this property - public virtual object StringToValue (string value) - { - if (typeConverter != null && typeConverter.CanConvertFrom (typeof(string))) - return typeConverter.ConvertFromString (value); - else if (PropertyType.IsEnum) - return Enum.Parse (PropertyType, value); - else if (PropertyType == typeof(ImageInfo)) - return ImageInfo.FromString (value); - else if (PropertyType == typeof(string[])) - return string.IsNullOrEmpty (value) ? null : value.Split ('\n'); - else if (PropertyType == typeof(DateTime)) - return new DateTime (long.Parse (value)); - else if (PropertyType == typeof(TimeSpan)) - return new TimeSpan (long.Parse (value)); - else if (PropertyType == typeof(double)) { - int i = value.IndexOf (System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator); - if (i != -1) - return Convert.ChangeType (value, PropertyType, System.Globalization.CultureInfo.CurrentCulture); - else - return Convert.ChangeType (value, PropertyType, System.Globalization.CultureInfo.InvariantCulture); - } else - return Convert.ChangeType (value, PropertyType, System.Globalization.CultureInfo.InvariantCulture.NumberFormat); - } - - // Returns a string representation of the provided property value - public virtual string ValueToString (object value) - { - if (typeConverter != null && typeConverter.CanConvertTo (typeof(string))) - return typeConverter.ConvertToString (value); - else if (PropertyType == typeof(string[])) - return value == null ? string.Empty : string.Join ("\n", (string[])value); - else if (PropertyType == typeof(DateTime)) - return ((DateTime)value).Ticks.ToString (); - else if (PropertyType == typeof(TimeSpan)) - return ((TimeSpan)value).Ticks.ToString (); - else if (PropertyType == typeof(double)) - return ((double)value).ToString (System.Globalization.CultureInfo.InvariantCulture); - else - return value.ToString (); - } - - public virtual bool InitWithName { - get { - return initWithName; - } - } - - public virtual bool IsRuntimeProperty { - get { return isRuntimeProperty; } - } - - public virtual bool Translatable { - get { - return translatable; - } - } - - public virtual bool IsTranslated (object obj) - { - if (!translatable) - return false; - - ObjectWrapper wrapper = ObjectWrapper.Lookup (obj); - if (wrapper == null) - return false; - - // Since translatable properties are assumed to be translated - // by default, we return true if there is no TranslationInfo - // for the object - - if (wrapper.translationInfo == null) - return true; - - TranslationInfo info = (TranslationInfo)wrapper.translationInfo[obj]; - return (info == null || info.Translated == true); - } - - public virtual void SetTranslated (object obj, bool translated) - { - ObjectWrapper wrapper = ObjectWrapper.Lookup (obj); - if (wrapper == null) return; - - if (wrapper.translationInfo == null) - wrapper.translationInfo = new Hashtable (); - - TranslationInfo info = (TranslationInfo)wrapper.translationInfo[obj]; - if (info == null) { - info = new TranslationInfo (); - wrapper.translationInfo[obj] = info; - } - - if (translated) - info.Translated = true; - else - info.Translated = false; - // We leave the old Context and Comment around, so that if - // you toggle Translated off and then back on, the old info - // is still there. - } - - public virtual string TranslationContext (object obj) - { - ObjectWrapper wrapper = ObjectWrapper.Lookup (obj); - if (wrapper == null || wrapper.translationInfo == null) return null; - - TranslationInfo info = (TranslationInfo)wrapper.translationInfo[obj]; - return info != null ? info.Context : null; - } - - public virtual void SetTranslationContext (object obj, string context) - { - SetTranslated (obj, true); - - ObjectWrapper wrapper = ObjectWrapper.Lookup (obj); - if (wrapper == null) return; - ((TranslationInfo)wrapper.translationInfo[obj]).Context = context; - } - - public virtual string TranslationComment (object obj) - { - ObjectWrapper wrapper = ObjectWrapper.Lookup (obj); - if (wrapper == null || wrapper.translationInfo == null) return null; - - TranslationInfo info = (TranslationInfo)wrapper.translationInfo[obj]; - return info != null ? info.Comment : null; - } - - public virtual void SetTranslationComment (object obj, string comment) - { - SetTranslated (obj, true); - - ObjectWrapper wrapper = ObjectWrapper.Lookup (obj); - if (wrapper == null) return; - ((TranslationInfo)wrapper.translationInfo[obj]).Comment = comment; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/PropertyEditorAttribute.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/PropertyEditorAttribute.cs deleted file mode 100644 index 05c2bb720bc..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/PropertyEditorAttribute.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; - -namespace Stetic { - - [AttributeUsage (AttributeTargets.Class)] - public sealed class PropertyEditorAttribute : Attribute { - - public PropertyEditorAttribute (string property, string evt) - { - this.property = property; - this.evt = evt; - } - - public PropertyEditorAttribute (string property) : this (property, property + "Changed") {} - - string property; - public string Property { - get { - return property; - } - set { - property = value; - } - } - - string evt; - public string Event { - get { - return evt; - } - set { - evt = value; - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/PropertyEditorCell.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/PropertyEditorCell.cs deleted file mode 100644 index aab3a1968f6..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/PropertyEditorCell.cs +++ /dev/null @@ -1,306 +0,0 @@ - -using System; -using System.Collections; -using Gtk; -using Gdk; - -namespace Stetic -{ - public class PropertyEditorCell - { - Pango.Layout layout; - PropertyDescriptor property; - object obj; - Gtk.Widget container; - - static Hashtable editors; - static PropertyEditorCell Default = new PropertyEditorCell (); - static Hashtable cellCache = new Hashtable (); - - static PropertyEditorCell () - { - editors = new Hashtable (); - - editors[typeof (bool)] = typeof (Stetic.Editor.Boolean); - editors[typeof (byte)] = typeof (Stetic.Editor.IntRange); - editors[typeof (sbyte)] = typeof (Stetic.Editor.IntRange); - editors[typeof (short)] = typeof (Stetic.Editor.IntRange); - editors[typeof (ushort)] = typeof (Stetic.Editor.IntRange); - editors[typeof (int)] = typeof (Stetic.Editor.IntRange); - editors[typeof (uint)] = typeof (Stetic.Editor.IntRange); - editors[typeof (long)] = typeof (Stetic.Editor.IntRange); - editors[typeof (ulong)] = typeof (Stetic.Editor.IntRange); - editors[typeof (float)] = typeof (Stetic.Editor.FloatRange); - editors[typeof (double)] = typeof (Stetic.Editor.FloatRange); - editors[typeof (char)] = typeof (Stetic.Editor.Char); - editors[typeof (string)] = typeof (Stetic.Editor.PropertyTextEditor); - editors[typeof (DateTime)] = typeof (Stetic.Editor.DateTimeEditorCell); - editors[typeof (TimeSpan)] = typeof (Stetic.Editor.TimeSpanEditorCell); - editors[typeof (string[])] = typeof (Stetic.Editor.StringArray); - editors[typeof (Gdk.Color)] = typeof (Stetic.Editor.Color); - editors[typeof (Stetic.ImageInfo)] = typeof (Stetic.Editor.ImageSelector); - } - - public object Instance { - get { return obj; } - } - - public PropertyDescriptor Property { - get { return property; } - } - - public Gtk.Widget Container { - get { return container; } - } - - public void Initialize (Widget container, PropertyDescriptor property, object obj) - { - this.container = container; - if (layout != null) { - layout.Dispose (); - } - layout = new Pango.Layout (container.PangoContext); - layout.Width = -1; - - Pango.FontDescription des = container.Style.FontDescription.Copy(); - des.Size = 10 * (int) Pango.Scale.PangoScale; - layout.FontDescription = des; - - this.property = property; - this.obj = obj; - Initialize (); - } - - public EditSession StartEditing (Gdk.Rectangle cell_area, StateType state) - { - IPropertyEditor ed = CreateEditor (cell_area, state); - if (ed == null) - return null; - ed.Initialize (property); - if (obj != null) { - ed.AttachObject (obj); - ed.Value = property.GetValue (obj); - } - return new EditSession (container, obj, property, ed); - } - - protected virtual string GetValueText () - { - if (obj == null) return ""; - object val = property.GetValue (obj); - if (val == null) return ""; - else return property.ValueToString (val); - } - - string GetNormalizedText () - { - string s = GetValueText (); - if (s == null) - return ""; - - int i = s.IndexOf ('\n'); - if (i == -1) - return s; - - s = s.TrimStart ('\n',' ','\t'); - i = s.IndexOf ('\n'); - if (i != -1) - return s.Substring (0, i) + "..."; - else - return s; - } - - public object Value { - get { return obj != null ? property.GetValue (obj) : null; } - } - - protected virtual void Initialize () - { - layout.SetText (GetNormalizedText ()); - } - - public virtual void GetSize (int availableWidth, out int width, out int height) - { - layout.GetPixelSize (out width, out height); - } - - public virtual void Render (Drawable window, Gdk.Rectangle bounds, StateType state) - { - int w, h; - layout.GetPixelSize (out w, out h); - int dy = (bounds.Height - h) / 2; - window.DrawLayout (container.Style.TextGC (state), bounds.X, dy + bounds.Y, layout); - } - - protected virtual IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, StateType state) - { - Type editorType = property.EditorType; - - if (editorType == null) { - editorType = GetEditorForType (property.PropertyType); - if (editorType == null) - return null; - } - - IPropertyEditor editor = Activator.CreateInstance (editorType) as IPropertyEditor; - if (editor == null) - throw new Exception ("The property editor '" + editorType + "' must implement the interface IPropertyEditor"); - return editor; - } - - public static Type GetEditorForType (Type propertyType) - { - if (propertyType.IsEnum) { - if (propertyType.IsDefined (typeof (FlagsAttribute), true)) - return typeof (Stetic.Editor.Flags); - else - return typeof (Stetic.Editor.Enumeration); - } else { - return editors [propertyType] as Type; - } - } - - public static PropertyEditorCell GetPropertyCell (PropertyDescriptor property) - { - Type editorType = property.EditorType; - - if (editorType == null) - editorType = GetEditorForType (property.PropertyType); - - if (editorType == null) - return Default; - - if (typeof(IPropertyEditor).IsAssignableFrom (editorType)) { - if (!typeof(Gtk.Widget).IsAssignableFrom (editorType)) - throw new Exception ("The property editor '" + editorType + "' must be a Gtk Widget"); - return Default; - } - - PropertyEditorCell cell = (PropertyEditorCell) cellCache [editorType]; - if (cell != null) - return cell; - - if (!typeof(PropertyEditorCell).IsAssignableFrom (editorType)) - throw new Exception ("The property editor '" + editorType + "' must be a subclass of Stetic.PropertyEditorCell or implement Stetic.IPropertyEditor"); - - cell = (PropertyEditorCell) Activator.CreateInstance (editorType); - cellCache [editorType] = cell; - return cell; - } - } - - - class DefaultPropertyEditor: Gtk.Entry, IPropertyEditor - { - PropertyDescriptor property; - - public void Initialize (PropertyDescriptor property) - { - this.property = property; - } - - public void AttachObject (object obj) - { - } - - public object Value { - get { - return Convert.ChangeType (Text, property.PropertyType); - } - set { - if (value == null) - Text = ""; - else - Text = Convert.ToString (value); - } - } - - protected override void OnChanged () - { - base.OnChanged (); - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } - - public event EventHandler ValueChanged; - } - - public class EditSession - { - PropertyDescriptor property; - object obj; - Gtk.Widget container; - IPropertyEditor currentEditor; - bool syncing; - object initialVal; - - public EditSession (Gtk.Widget container, object instance, PropertyDescriptor property, IPropertyEditor currentEditor) - { - this.property = property; - this.obj = instance; - this.container = container; - this.currentEditor = currentEditor; - currentEditor.ValueChanged += OnValueChanged; - initialVal = currentEditor.Value; - } - - public object Instance { - get { return obj; } - } - - public PropertyDescriptor Property { - get { return property; } - } - - public Gtk.Widget Container { - get { return container; } - } - - public IPropertyEditor Editor { - get { return currentEditor; } - } - - void OnValueChanged (object s, EventArgs a) - { - if (!syncing) { - syncing = true; - property.SetValue (obj, currentEditor.Value); - Stetic.Wrapper.Widget wrapper = Stetic.Wrapper.Widget.Lookup (obj) as Stetic.Wrapper.Widget; - if (wrapper != null) - wrapper.NotifyChanged (); - syncing = false; - } - } - - public void AttachObject (object ob) - { - if (ob == null) - throw new ArgumentNullException ("ob"); - - syncing = true; - this.obj = ob; - currentEditor.AttachObject (obj); - - // It is the responsibility of the editor to convert value types - object initial = property.GetValue (obj); - currentEditor.Value = initial; - - syncing = false; - } - - public void UpdateEditor () - { - if (!syncing) { - syncing = true; - currentEditor.Value = property.GetValue (obj); - syncing = false; - } - } - - public void Dispose () - { - if (!object.Equals (initialVal, currentEditor.Value)) - OnValueChanged (null, null); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/RadioGroupManager.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/RadioGroupManager.cs deleted file mode 100644 index 73c8fb8f699..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/RadioGroupManager.cs +++ /dev/null @@ -1,212 +0,0 @@ -using System; -using System.Collections; -using System.Reflection; -using System.CodeDom; - -// The stetic representation of "radio widget" (Gtk.RadioButton, -// Gtk.RadioToolButton, and Gtk.RadioMenuItem) groups is that the -// groups have names, and each widget's "Group" property stores the -// name of its group. The glade representation is similar, except that -// the group names aren't arbitrary; they have to be the name of the -// first widget in the group. (On disk, the "group leader" has no -// "group" property, and the other widgets have the leader's name as -// their group property.) -// -// The internal gtk representation of groups is that each radio widget -// has a GLib.SList "Group" property. The content of the list is -// essentially opaque. (For Gtk.RadioButton, the list contains all of -// the RadioButtons in the group. But for Gtk.ToolRadioButton it -// contains pointers to internal widgets, not the ToolRadioButtons -// themselves.) The only thing we can do with them then is to read one -// widget's group and then immediately assign it to another widget. We -// can't look into the list, or assume that a widget's Group property -// will keep the same value if any other widget's Group changes. -// -// Each radio widget type wrapper class keeps a static -// RadioGroupManager to handle this string<->GLib.SList translation -// for it. - -namespace Stetic { - - public class RadioGroup { - public string Name; - public ArrayList Widgets; - - public RadioGroup (string name) - { - Name = name; - Widgets = new ArrayList (); - } - } - - public class RadioGroupManager: IRadioGroupManager - { - PropertyInfo groupProperty; - ArrayList groups; - Hashtable widgets; - - public RadioGroupManager (Type widgetType) - { - groupProperty = widgetType.GetProperty ("Group"); - if (groupProperty == null || groupProperty.PropertyType != typeof (GLib.SList)) - throw new ArgumentException ("No 'public GLib.SList Group' property on '" + widgetType.FullName + "'"); - - groups = new ArrayList (); - widgets = new Hashtable (); - } - - public event GroupsChangedDelegate GroupsChanged; - - void EmitGroupsChanged () - { - if (GroupsChanged != null) - GroupsChanged (); - } - - public IEnumerable GroupNames { - get { - string[] names = new string[groups.Count]; - for (int i = 0; i < groups.Count; i++) - names[i] = ((RadioGroup)groups[i]).Name; - return names; - } - } - - public string LastGroup { - get { - if (groups.Count == 0) - Add ("group1"); - RadioGroup group = groups[groups.Count - 1] as RadioGroup; - return group.Name; - } - } - - public RadioGroup FindGroup (string name) - { - for (int i = 0; i < groups.Count; i++) { - RadioGroup group = groups[i] as RadioGroup; - if (group.Name == name) - return group; - } - return null; - } - - void IRadioGroupManager.Add (string name) - { - Add (name); - } - - public RadioGroup Add (string name) - { - RadioGroup group = new RadioGroup (name); - groups.Add (group); - EmitGroupsChanged (); - return group; - } - - public void Rename (string oldName, string newName) - { - RadioGroup group = FindGroup (oldName); - if (group != null) { - group.Name = newName; - EmitGroupsChanged (); - } - } - - void RadioDestroyed (object obj, EventArgs args) - { - Gtk.Widget radio = obj as Gtk.Widget; - this[radio] = null; - } - - public string this[Gtk.Widget radio] { - get { - RadioGroup group = widgets[radio] as RadioGroup; - if (group != null) - return group.Name; - else - return null; - } - set { - GLib.SList group_value; - - RadioGroup oldGroup = widgets[radio] as RadioGroup; - if (oldGroup == null) { - radio.Destroyed += RadioDestroyed; - } else { - if (oldGroup.Name == value) - return; - oldGroup.Widgets.Remove (radio); - if (oldGroup.Widgets.Count == 0) { - groups.Remove (oldGroup); - EmitGroupsChanged (); - } - } - - if (value == null) { - radio.Destroyed -= RadioDestroyed; - groupProperty.SetValue (radio, new GLib.SList (IntPtr.Zero), null); - widgets.Remove (radio); - return; - } - - RadioGroup newGroup = FindGroup (value); - if (newGroup == null) - newGroup = Add (value); - - if (newGroup.Widgets.Count == 0) - group_value = new GLib.SList (IntPtr.Zero); - else - group_value = (GLib.SList)groupProperty.GetValue (newGroup.Widgets[0], null); - - groupProperty.SetValue (radio, group_value, null); - newGroup.Widgets.Add (radio); - widgets[radio] = newGroup; - } - } - - public string GladeGroupName (Gtk.Widget radio) - { - RadioGroup group = widgets[radio] as RadioGroup; - if (group == null || group.Widgets.Count == 0) - return null; - - Gtk.Widget leader = (Gtk.Widget)group.Widgets[0]; - return leader.Name; - } - - public CodeExpression GenerateGroupExpression (GeneratorContext ctx, Gtk.Widget widget) - { - // Returns and expression that represents the group to which the radio belongs. - // This expression can be an empty SList, if this is the first radio of the - // group that has been generated, or an SList taken from previously generated - // radios from the same group. - - RadioGroup group = widgets[widget] as RadioGroup; - CodeExpression var = null; - - foreach (Gtk.Widget radio in group.Widgets) { - if (radio == widget) - continue; - var = ctx.WidgetMap.GetWidgetExp (radio); - if (var != null) - break; - } - - if (var == null) { - return new CodeObjectCreateExpression ( - "GLib.SList".ToGlobalTypeRef (), - new CodePropertyReferenceExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (typeof(IntPtr), CodeTypeReferenceOptions.GlobalReference)), - "Zero" - ) - ); - } else { - return new CodePropertyReferenceExpression ( - var, - "Group" - ); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/Registry.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/Registry.cs deleted file mode 100644 index d6c5c653e1a..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/Registry.cs +++ /dev/null @@ -1,363 +0,0 @@ -using System; -using System.Collections; -using System.Reflection; -using System.Xml; -using System.Xml.Xsl; - -namespace Stetic { - public static class Registry { - - static ArrayList libraries = new ArrayList (); - static ArrayList classes = new ArrayList (); - - static XslCompiledTransform gladeImport, gladeExport; - static WidgetLibrary coreLib; - - public static event EventHandler RegistryChanging; - public static event EventHandler RegistryChanged; - - static int changing; - static bool changed; - - public static void Initialize (WidgetLibrary coreLibrary) - { - RegisterWidgetLibrary (coreLibrary); - coreLib = coreLibrary; - } - - public static WidgetLibrary CoreWidgetLibrary { - get { return coreLib; } - } - - public static void BeginChangeSet () - { - if (changing == 0) - changed = false; - changing++; - } - - public static void EndChangeSet () - { - if (--changing == 0) { - if (changed) { - foreach (WidgetLibrary lib in libraries) - lib.Flush (); - NotifyChanged (); - } - changed = false; - } - } - - public static void RegisterWidgetLibrary (WidgetLibrary library) - { - NotifyChanging (); - - try { - if (coreLib != null && library.Name == coreLib.Name) { - libraries.Remove (coreLib); - InternalUpdate (); - coreLib = library; - } - libraries.Add (library); - library.Load (); - classes.AddRange (library.AllClasses); - UpdateGladeTransform (); - } catch (Exception ex) { - Console.WriteLine (ex); - throw; - } finally { - NotifyChanged (); - } - } - - public static void UnregisterWidgetLibrary (WidgetLibrary library) - { - if (library == coreLib) - return; - - NotifyChanging (); - - libraries.Remove (library); - library.Dispose (); - InternalUpdate (); - - NotifyChanged (); - } - - - // Returns true if all libraries that need reloading - // could be reloaded - - public static bool ReloadWidgetLibraries () - { - bool needsReload = false; - - // If there is a lib which can't be reloaded, - // there is no need to start the reloading process - - foreach (WidgetLibrary lib in libraries) { - if (lib != coreLib && lib.NeedsReload) { - if (!lib.CanReload) - return false; - needsReload = true; - } - } - - if (!needsReload) - return true; - - try { - NotifyChanging (); - - foreach (WidgetLibrary lib in libraries) - if (lib != coreLib && lib.NeedsReload) - lib.Reload (); - - InternalUpdate (); - } finally { - NotifyChanged (); - } - - return true; - } - - public static bool IsRegistered (WidgetLibrary library) - { - return libraries.Contains (library); - } - - public static WidgetLibrary GetWidgetLibrary (string name) - { - foreach (WidgetLibrary lib in libraries) - if (lib.Name == name) - return lib; - return null; - } - - public static bool IsRegistered (string name) - { - foreach (WidgetLibrary lib in libraries) - if (lib.Name == name) - return true; - return false; - } - - public static WidgetLibrary[] RegisteredWidgetLibraries { - get { return (WidgetLibrary[]) libraries.ToArray (typeof(WidgetLibrary)); } - } - - static void NotifyChanging () - { - if (changing > 0) { - if (changed) - return; - else - changed = true; - } - if (RegistryChanging != null) - RegistryChanging (null, EventArgs.Empty); - } - - static void NotifyChanged () - { - if (changing == 0 && RegistryChanged != null) - RegistryChanged (null, EventArgs.Empty); - } - - static void InternalUpdate () - { - classes.Clear (); - foreach (WidgetLibrary lib in libraries) - classes.AddRange (lib.AllClasses); - UpdateGladeTransform (); - } - - static void UpdateGladeTransform () - { - XmlDocument doc = CreateGladeTransformBase (); - XmlNamespaceManager nsm = new XmlNamespaceManager (doc.NameTable); - nsm.AddNamespace ("xsl", "http://www.w3.org/1999/XSL/Transform"); - - foreach (WidgetLibrary lib in libraries) { - foreach (XmlElement elem in lib.GetGladeImportTransformElements ()) - doc.FirstChild.PrependChild (doc.ImportNode (elem, true)); - } - - gladeImport = new XslCompiledTransform (); - gladeImport.Load (doc); - - doc = CreateGladeTransformBase (); - - foreach (WidgetLibrary lib in libraries) { - foreach (XmlElement elem in lib.GetGladeExportTransformElements ()) - doc.FirstChild.PrependChild (doc.ImportNode (elem, true)); - } - - gladeExport = new XslCompiledTransform (); - gladeExport.Load (doc); - } - - static XmlDocument CreateGladeTransformBase () - { - XmlDocument doc = new XmlDocument (); - doc.LoadXml ( - "" + - " " + - " " + - " " + - " " + - " " + - "" - ); - return doc; - } - - public static IEnumerable AllClasses { - get { - return classes; - } - } - - public static XslCompiledTransform GladeImportXsl { - get { - return gladeImport; - } - } - - public static XslCompiledTransform GladeExportXsl { - get { - return gladeExport; - } - } - - public static EnumDescriptor LookupEnum (string typeName) - { - foreach (WidgetLibrary lib in libraries) { - EnumDescriptor desc = lib.LookupEnum (typeName); - if (desc != null) - return desc; - } - return null; - } - - public static ClassDescriptor LookupClassByCName (string cname) - { - foreach (WidgetLibrary lib in libraries) { - ClassDescriptor desc = lib.LookupClassByCName (cname); - if (desc != null) - return desc; - } - return null; - } - - public static ClassDescriptor LookupClassByName (string cname) - { - foreach (WidgetLibrary lib in libraries) { - ClassDescriptor desc = lib.LookupClassByName (cname); - if (desc != null) - return desc; - } - return null; - } - - static ClassDescriptor FindGroupClass (string name, out string groupname) - { - int sep = name.LastIndexOf ('.'); - string classname = name.Substring (0, sep); - groupname = name.Substring (sep + 1); - ClassDescriptor klass = LookupClassByName (classname); - if (klass == null) { - klass = LookupClassByName (name); - if (klass == null) - throw new ArgumentException ("No class for itemgroup " + name); - classname = name; - groupname = ""; - } - return klass; - } - - public static ItemGroup LookupItemGroup (string name) - { - string groupname; - ClassDescriptor klass = FindGroupClass (name, out groupname); - - foreach (ItemGroup grp in klass.ItemGroups) - if (grp.Name == groupname && grp.DeclaringType == klass) - return grp; - - throw new ArgumentException ("No itemgroup '" + groupname + "' in class " + klass.WrappedTypeName); - } - - public static ItemGroup LookupSignalGroup (string name) - { - string groupname; - ClassDescriptor klass = FindGroupClass (name, out groupname); - - foreach (ItemGroup grp in klass.SignalGroups) - if (grp.Name == groupname && grp.DeclaringType == klass) - return grp; - throw new ArgumentException ("No itemgroup '" + groupname + "' in class " + klass.WrappedTypeName); - } - - public static ItemDescriptor LookupItem (string name) - { - int sep = name.LastIndexOf ('.'); - string classname = name.Substring (0, sep); - string propname = name.Substring (sep + 1); - ClassDescriptor klass = LookupClassByName (classname); - if (klass == null) - throw new ArgumentException ("No class " + classname + " for property " + propname); - ItemDescriptor idesc = klass[propname]; - if (idesc == null) - throw new ArgumentException ("Property '" + propname + "' not found in class '" + classname + "'"); - return idesc; - } - - public static ItemGroup LookupContextMenu (string classname) - { - ClassDescriptor klass = LookupClassByName (classname); - if (klass == null) - throw new ArgumentException ("No class for contextmenu " + classname); - return klass.ContextMenu; - } - - public static object NewInstance (string typeName, IProject proj) - { - return LookupClassByName (typeName).NewInstance (proj); - } - - public static Type GetType (string typeName, bool throwOnError) - { - Type t = Type.GetType (typeName, false); - if (t != null) return t; - - foreach (WidgetLibrary lib in libraries) { - t = lib.GetType (typeName); - if (t != null) return t; - } - - string tname, aname; - int i = typeName.IndexOf (','); - if (i != -1) { - tname = typeName.Substring (0, i).Trim (); - aname = typeName.Substring (i + 1).Trim (); - } - else { - tname = typeName; - aname = null; - } - foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies ()) { - if (aname == null || asm.GetName ().Name == aname) { - t = asm.GetType (tname); - if (t != null) - return t; - } - } - - if (throwOnError) - throw new TypeLoadException ("Could not load type '" + typeName + "'"); - - return null; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/Set.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/Set.cs deleted file mode 100644 index 58f0b26b0b5..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/Set.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections; - -namespace Stetic { - - public class Set : IEnumerable, IEnumerator { - - Hashtable hash = new Hashtable (); - - public bool this [object obj] { - get { - return hash[obj] != null; - } - set { - if (value) - hash[obj] = obj; - else - hash.Remove (obj); - } - } - - public void Clear () - { - hash.Clear (); - } - - public IEnumerator GetEnumerator () - { - return this; - } - - IDictionaryEnumerator hashEnum; - - public void Reset () - { - hashEnum = hash.GetEnumerator (); - hashEnum.Reset (); - } - - public bool MoveNext () - { - return hashEnum.MoveNext (); - } - - public object Current { - get { - return hashEnum.Key; - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/SignalDescriptor.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/SignalDescriptor.cs deleted file mode 100644 index 871364d67bb..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/SignalDescriptor.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Reflection; -using System.Xml; - -namespace Stetic -{ - [Serializable] - public abstract class SignalDescriptor: ItemDescriptor - { - protected string name, label, description; - protected string handlerTypeName; - protected string handlerReturnTypeName; - protected ParameterDescriptor[] handlerParameters; - - public SignalDescriptor (XmlElement elem, ItemGroup group, ClassDescriptor klass) : base (elem, group, klass) - { - } - - protected virtual void Load (XmlElement elem) - { - name = elem.GetAttribute ("name"); - label = elem.GetAttribute ("label"); - description = elem.GetAttribute ("description"); - } - - public override string Name { - get { return name; } - } - - public string Label { - get { return label; } - } - - public string Description { - get { return description; } - } - - public string HandlerTypeName { - get { return handlerTypeName; } - } - - public string HandlerReturnTypeName { - get { return handlerReturnTypeName; } - } - - public ParameterDescriptor[] HandlerParameters { - get { return handlerParameters; } - } - } - - [Serializable] - public class ParameterDescriptor - { - string name, type; - - public ParameterDescriptor (string name, string type) - { - this.name = name; - this.type = type; - } - - public string Name { - get { return name; } - } - - public string TypeName { - get { return type; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/TopLevelDialog.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/TopLevelDialog.cs deleted file mode 100644 index 04f066e5077..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/TopLevelDialog.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Gtk; - -namespace Stetic -{ - public class TopLevelDialog: TopLevelWindow - { - HButtonBox buttonBox; - VBox vbox; - HSeparator separator; - - public TopLevelDialog ( ) - { - vbox = new VBox (); - separator = new HSeparator (); - buttonBox = new HButtonBox (); - vbox.PackEnd (buttonBox, false, false, 0); - vbox.PackEnd (separator, false, false, 0); - vbox.ShowAll (); - Add (vbox); - } - - public HButtonBox ActionArea { - get { return buttonBox; } - } - - public VBox VBox { - get { return vbox; } - } - - public bool HasSeparator - { - get { return separator.Visible; } - set { separator.Visible = value; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/TopLevelWindow.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/TopLevelWindow.cs deleted file mode 100644 index 3e3cdc694a0..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/TopLevelWindow.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Stetic -{ - public class TopLevelWindow: Gtk.EventBox - { - string title; - Gdk.WindowTypeHint typeHint; - bool modal; - bool resizable = true; - - public event EventHandler PropertyChanged; - - public string Title { - get { return title; } - set { - title = value; - NotifyChange (); - } - } - - public Gdk.WindowTypeHint TypeHint { - get { return typeHint; } - set { - typeHint = value; - NotifyChange (); - } - } - - public bool Modal { - get { return modal; } - set - { - modal = value; - NotifyChange (); - } - } - - public bool Resizable - { - get { return resizable; } - set - { - resizable = value; - NotifyChange (); - } - } - - void NotifyChange ( ) - { - if (PropertyChanged != null) - PropertyChanged (this, EventArgs.Empty); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/TranslatableAttribute.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/TranslatableAttribute.cs deleted file mode 100644 index 2b938420e6c..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/TranslatableAttribute.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace Stetic { - - [AttributeUsage (AttributeTargets.Property | AttributeTargets.Field)] - public sealed class TranslatableAttribute : Attribute { - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/TypedClassDescriptor.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/TypedClassDescriptor.cs deleted file mode 100644 index 2f3425c31d5..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/TypedClassDescriptor.cs +++ /dev/null @@ -1,203 +0,0 @@ -using System; -using System.Collections; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Xml; - -namespace Stetic -{ - public class TypedClassDescriptor: ClassDescriptor - { - Type wrapped, wrapper; - GLib.GType gtype; - - MethodInfo ctorMethodInfo; - MethodInfo ctorMethodInfoWithClass; - ConstructorInfo cinfo; - bool useGTypeCtor; - Gdk.Pixbuf icon; - bool defaultValuesLoaded; - - const BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; - - static Gdk.Pixbuf missingIcon; - - public TypedClassDescriptor (Assembly assembly, XmlElement elem) - { - bool inheritedWrapper = false; - - wrapped = Registry.GetType (elem.GetAttribute ("type"), true); - if (elem.HasAttribute ("wrapper")) - wrapper = Registry.GetType (elem.GetAttribute ("wrapper"), true); - else { - inheritedWrapper = true; - string baseClass = elem.GetAttribute ("base-type"); - if (baseClass.Length > 0) { - // If a base type is specified, use the wrapper of that base type - TypedClassDescriptor parent = Registry.LookupClassByName (baseClass) as TypedClassDescriptor; - if (parent != null) - wrapper = parent.WrapperType; - } - else { - for (Type type = wrapped.BaseType; type != null; type = type.BaseType) { - TypedClassDescriptor parent = Registry.LookupClassByName (type.FullName) as TypedClassDescriptor; - if (parent != null) { - wrapper = parent.WrapperType; - break; - } - } - } - if (wrapper == null) - throw new ArgumentException (string.Format ("No wrapper type for class {0}", wrapped.FullName)); - } - - gtype = (GLib.GType)wrapped; - cname = gtype.ToString (); - - string iconname = elem.GetAttribute ("icon"); - if (iconname.Length > 0) { - try { - // Using the pixbuf resource constructor generates a gdk warning. - Gdk.PixbufLoader loader = new Gdk.PixbufLoader (assembly, iconname); - icon = loader.Pixbuf; - } catch { - Console.WriteLine ("Could not load icon: " + iconname); - icon = GetDefaultIcon (); - } - } else - icon = GetDefaultIcon (); - - BindingFlags flags = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly; - - // If the wrapper is inherited from a base class, ignore the CreateInstance method - // since it is going to create an instance of the base class. - if (!inheritedWrapper) { - ctorMethodInfoWithClass = wrapper.GetMethod ("CreateInstance", flags, null, new Type[] { typeof(ClassDescriptor)}, null); - if (ctorMethodInfoWithClass == null) { - ctorMethodInfo = wrapper.GetMethod ("CreateInstance", flags, null, Type.EmptyTypes, null); - } - } - - // Look for a constructor even if a CreateInstance method was - // found, since it may return null. - cinfo = wrapped.GetConstructor (Type.EmptyTypes); - if (cinfo == null) { - useGTypeCtor = true; - cinfo = wrapped.GetConstructor (new Type[] { typeof (IntPtr) }); - } - - Load (elem); - } - - public override Gdk.Pixbuf Icon { - get { - return icon; - } - } - - public override string WrappedTypeName { - get { return WrappedType.FullName; } - } - - public Type WrapperType { - get { - return wrapper; - } - } - - public Type WrappedType { - get { - return wrapped; - } - } - - public GLib.GType GType { - get { - return gtype; - } - } - - public override ObjectWrapper CreateWrapper () - { - return (ObjectWrapper) Activator.CreateInstance (WrapperType); - } - - [DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] - static extern IntPtr g_object_new (IntPtr gtype, IntPtr dummy); - - public override object CreateInstance (IProject proj) - { - object inst; - - if (ctorMethodInfoWithClass != null) { - inst = ctorMethodInfoWithClass.Invoke (null, new object[] { this }); - if (inst != null) return inst; - } - if (ctorMethodInfo != null) { - inst = ctorMethodInfo.Invoke (null, new object[0]); - if (inst != null) return inst; - } - - if (cinfo == null) - throw new InvalidOperationException ("The class '" + wrapped + "' does not have a default constructor."); - - if (!useGTypeCtor) - inst = cinfo.Invoke (new object[0]); - else { - IntPtr raw = g_object_new (gtype.Val, IntPtr.Zero); - inst = cinfo.Invoke (new object[] { raw }); - } - - return inst; - } - - internal protected override ItemDescriptor CreateItemDescriptor (XmlElement elem, ItemGroup group) - { - if (elem.Name == "property") - return new TypedPropertyDescriptor (elem, group, this); - else if (elem.Name == "signal") - return new TypedSignalDescriptor (elem, group, this); - else - return base.CreateItemDescriptor (elem, group); - } - - Gdk.Pixbuf GetDefaultIcon () - { - if (missingIcon == null) - missingIcon = WidgetUtils.MissingIcon; - return missingIcon; - } - - internal void LoadDefaultValues () - { - // This is a hack because there is no managed way of getting - // the default value of a GObject property. - // This method creates an dummy instance of this class and - // gets the values for their properties. Those values are - // considered the default - - if (defaultValuesLoaded) - return; - defaultValuesLoaded = true; - - object ob = NewInstance (null, false); - - foreach (ItemGroup group in ItemGroups) { - foreach (ItemDescriptor item in group) { - TypedPropertyDescriptor prop = item as TypedPropertyDescriptor; - if (prop == null) - continue; - - if (!prop.HasDefault) { - prop.SetDefault (null); - } else { - object val = prop.GetValue (ob); - prop.SetDefault (val); - } - } - } - ObjectWrapper ww = ObjectWrapper.Lookup (ob); - ww.Dispose (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/TypedPropertyDescriptor.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/TypedPropertyDescriptor.cs deleted file mode 100644 index 5be86a0ad64..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/TypedPropertyDescriptor.cs +++ /dev/null @@ -1,321 +0,0 @@ -using System; -using System.ComponentModel; -using System.Collections; -using System.Reflection; -using System.Xml; - -namespace Stetic -{ - public class TypedPropertyDescriptor : PropertyDescriptor { - - PropertyInfo memberInfo, propertyInfo, runtimePropertyInfo, runtimeMemberInfo; - ParamSpec pspec; - TypedPropertyDescriptor gladeProperty; - bool isWrapperProperty; - TypedClassDescriptor klass; - bool defaultSet; - - const BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; - - public TypedPropertyDescriptor (XmlElement elem, ItemGroup group, TypedClassDescriptor klass) : base (elem, group, klass) - { - this.klass = klass; - string propertyName = elem.GetAttribute ("name"); - int dot = propertyName.IndexOf ('.'); - - if (dot != -1) { - // Sub-property (eg, "Alignment.Value") - memberInfo = FindProperty (klass.WrapperType, klass.WrappedType, propertyName.Substring (0, dot)); - isWrapperProperty = memberInfo.DeclaringType.IsSubclassOf (typeof (ObjectWrapper)); - gladeProperty = new TypedPropertyDescriptor (isWrapperProperty ? klass.WrapperType : klass.WrappedType, memberInfo.Name); - propertyInfo = FindProperty (memberInfo.PropertyType, propertyName.Substring (dot + 1)); - } else { - // Basic simple property - propertyInfo = FindProperty (klass.WrapperType, klass.WrappedType, propertyName); - isWrapperProperty = propertyInfo.DeclaringType.IsSubclassOf (typeof (ObjectWrapper)); - } - - // Wrapper properties that override widgets properties (using the same name) - // must be considered runtime properties (will be available at run-time). - if (!isWrapperProperty || klass.WrappedType.GetProperty (propertyName) != null) - isRuntimeProperty = true; - - if (!IsInternal && propertyInfo.PropertyType.IsEnum && - Registry.LookupEnum (propertyInfo.PropertyType.FullName) == null) - throw new ArgumentException ("No EnumDescriptor for " + propertyInfo.PropertyType.FullName + "(" + klass.WrappedType.FullName + "." + propertyName + ")"); - - pspec = FindPSpec (propertyInfo); - - if (isWrapperProperty && pspec == null) { - PropertyInfo pinfo = klass.WrappedType.GetProperty (propertyInfo.Name, flags); - if (pinfo != null) - pspec = FindPSpec (pinfo); - } - - if (pspec != null) { - // This information will be overridden by what's specified in the xml file - description = pspec.Blurb; - minimum = pspec.Minimum; - maximum = pspec.Maximum; - label = propertyName; - if (!elem.HasAttribute ("ignore-default")) - hasDefault = Type.GetTypeCode (PropertyType) != TypeCode.Object || PropertyType.IsEnum; - } else { - label = propertyInfo.Name; - gladeOverride = true; - } - - string typeName = elem.GetAttribute ("editor"); - if (typeName.Length > 0) - editorType = Registry.GetType (typeName, false); - - // Look for a default value attribute - - object[] ats = propertyInfo.GetCustomAttributes (typeof(DefaultValueAttribute), true); - if (ats.Length > 0) { - DefaultValueAttribute at = (DefaultValueAttribute) ats [0]; - defaultValue = at.Value; - } - - // Load default data - Load (elem); - } - - TypedPropertyDescriptor (Type objectType, string propertyName) - { - propertyInfo = FindProperty (objectType, propertyName); - isWrapperProperty = false; - - pspec = FindPSpec (propertyInfo); - if (pspec != null) { - label = propertyName; - description = pspec.Blurb; - minimum = pspec.Minimum; - maximum = pspec.Maximum; - hasDefault = Type.GetTypeCode (PropertyType) != TypeCode.Object || PropertyType.IsEnum; - } else - label = propertyInfo.Name; - } - - static PropertyInfo FindProperty (Type type, string propertyName) { - return FindProperty (null, type, propertyName); - } - - static PropertyInfo FindProperty (Type wrapperType, Type objectType, string propertyName) - { - PropertyInfo info = null; - - if (wrapperType != null) { - info = wrapperType.GetProperty (propertyName, flags); - if (info != null) - return info; - } - - try { - info = objectType.GetProperty (propertyName, flags); - } - catch (AmbiguousMatchException) { - foreach (PropertyInfo pi in objectType.GetProperties ()) { - if (pi.Name == propertyName) { - info = pi; - break; - } - } - } - - if (info != null) - return info; - - throw new ArgumentException ("Invalid property name " + objectType.Name + "." + propertyName); - } - - ParamSpec FindPSpec (PropertyInfo pinfo) - { - foreach (object attr in pinfo.GetCustomAttributes (false)) { - if (attr is GLib.PropertyAttribute) { - GLib.PropertyAttribute pattr = (GLib.PropertyAttribute)attr; - return ParamSpec.LookupObjectProperty (pinfo.DeclaringType, pattr.Name); - } - - if (attr is Gtk.ChildPropertyAttribute) { - Gtk.ChildPropertyAttribute cpattr = (Gtk.ChildPropertyAttribute)attr; - return ParamSpec.LookupChildProperty (pinfo.DeclaringType.DeclaringType, cpattr.Name); - } - } - return null; - } - - // The property's internal name - public override string Name { - get { - return propertyInfo.Name; - } - } - - // The property's type - public override Type PropertyType { - get { - return propertyInfo.PropertyType; - } - } - - // The property's PropertyInfo - public PropertyInfo PropertyInfo { - get { - return propertyInfo; - } - } - - // The property's ParamSpec - public virtual ParamSpec ParamSpec { - get { - return pspec; - } - } - - public override bool IsDefaultValue (object value) - { - if (defaultValue != null) - return base.IsDefaultValue (value); - if (ParamSpec != null && value != null) - return ParamSpec.IsDefaultValue (value); - else - return false; - } - - public override void ResetValue (object instance) - { - // This is a hack because there is no managed way of getting - // the default value of a GObject property. The call to LoadDefaultValues - // will guess the default values from a dummy instance - if (!defaultSet) { - ObjectWrapper ww = ObjectWrapper.Lookup (instance); - TypedClassDescriptor td = ww.ClassDescriptor as TypedClassDescriptor; - if (td != null) - td.LoadDefaultValues (); - defaultSet = true; - } - base.ResetValue (instance); - } - - internal void SetDefault (object val) - { - defaultValue = val; - defaultSet = true; - } - - // Gets the value of the property on @obj - public override object GetValue (object obj) - { - try { - if (isWrapperProperty) - obj = ObjectWrapper.Lookup (obj); - if (memberInfo != null) - obj = memberInfo.GetValue (obj, null); - return propertyInfo.GetValue (obj, null); - } catch (Exception ex) { - throw new InvalidOperationException ("Could not get value for property " + klass.Name + "." + Name + " from object '" + obj + "'", ex); - } - } - - // Whether or not the property is writable - public override bool CanWrite { - get { - return propertyInfo.CanWrite; - } - } - - // Sets the value of the property on @obj - public override void SetValue (object obj, object value) - { - ObjectWrapper ww = ObjectWrapper.Lookup (obj); - IDisposable t = ww != null && !ww.Loading? ww.UndoManager.AtomicChange : null; - try { - if (isWrapperProperty) - obj = ww; - if (memberInfo != null) - obj = memberInfo.GetValue (obj, null); - propertyInfo.SetValue (obj, value, null); - } catch (Exception ex) { - throw new InvalidOperationException ("Could not set value for property " + klass.Name + "." + Name + " to object '" + obj + "'", ex); - } finally { - if (t != null) - t.Dispose (); - } - } - - // The property's type at run time - public override Type RuntimePropertyType { - get { - if (runtimePropertyInfo == null) - SetupRuntimeProperties (); - return runtimePropertyInfo.PropertyType; - } - } - - public override void SetRuntimeValue (object obj, object value) - { - if (runtimePropertyInfo == null) - SetupRuntimeProperties (); - if (runtimeMemberInfo != null) - obj = runtimeMemberInfo.GetValue (obj, null); - - if (runtimePropertyInfo.PropertyType.IsInstanceOfType (value)) - runtimePropertyInfo.SetValue (obj, value, null); - } - - public override object GetRuntimeValue (object obj) - { - if (runtimePropertyInfo == null) - SetupRuntimeProperties (); - if (runtimeMemberInfo != null) - obj = runtimeMemberInfo.GetValue (obj, null); - return runtimePropertyInfo.GetValue (obj, null); - } - - void SetupRuntimeProperties () - { - if (isWrapperProperty) { - Type t = klass.WrappedType; - if (memberInfo != null) { - runtimeMemberInfo = t.GetProperty (memberInfo.Name, flags); - t = runtimeMemberInfo.PropertyType; - } - runtimePropertyInfo = t.GetProperty (propertyInfo.Name, flags); - } else { - runtimeMemberInfo = memberInfo; - runtimePropertyInfo = propertyInfo; - } - } - - public virtual bool GladeOverride { - get { - return gladeOverride; - } - } - - public TypedPropertyDescriptor GladeProperty { - get { - if (gladeProperty != null) - return gladeProperty; - else - return this; - } - } - - public virtual string GladeName { - get { - if (gladeName != null) - return gladeName; - else if (pspec != null && pspec.Name != null) - return pspec.Name.Replace ('-', '_'); - else - return null; - } - } - - public override string InternalChildId { - get { return GladeName; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/TypedSignalDescriptor.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/TypedSignalDescriptor.cs deleted file mode 100644 index 5c87947dee6..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/TypedSignalDescriptor.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Reflection; -using System.Xml; - -namespace Stetic -{ - [Serializable] - public class TypedSignalDescriptor: SignalDescriptor - { - string gladeName; - - const BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; - - public TypedSignalDescriptor (XmlElement elem, ItemGroup group, TypedClassDescriptor klass) : base (elem, group, klass) - { - Load (elem); - - EventInfo eventInfo = FindEvent (klass.WrapperType, klass.WrappedType, name); - MethodInfo handler = eventInfo.EventHandlerType.GetMethod ("Invoke"); - - if (elem.HasAttribute ("glade-name")) - gladeName = elem.GetAttribute ("glade-name"); - else { - object[] att = eventInfo.GetCustomAttributes (typeof(GLib.SignalAttribute), true); - if (att.Length > 0) - gladeName = ((GLib.SignalAttribute)att[0]).CName; - } - - handlerTypeName = eventInfo.EventHandlerType.FullName; - handlerReturnTypeName = handler.ReturnType.FullName; - - ParameterInfo[] pars = handler.GetParameters (); - handlerParameters = new ParameterDescriptor [pars.Length]; - for (int n=0; n 0 ? targetGtkVersion : "2.4"; } - } - - public bool SupportsGtkVersion (string targetVersion) - { - return WidgetUtils.CompareVersions (TargetGtkVersion, targetVersion) >= 0; - } - - public virtual void Reload () - { - Load (); - } - - public virtual void Load () - { - } - - protected virtual void Load (XmlDocument objects) - { - classes_by_cname.Clear (); - classes_by_csname.Clear (); - enums.Clear (); - - if (objects == null || objects.DocumentElement == null) - return; - - targetGtkVersion = objects.DocumentElement.GetAttribute ("gtk-version"); - if (targetGtkVersion.Length == 0) - targetGtkVersion = "2.4"; - - foreach (XmlElement element in objects.SelectNodes ("/objects/enum")) { - EnumDescriptor enm = new EnumDescriptor (element); - enums[enm.Name] = enm; - } - - foreach (XmlElement element in objects.SelectNodes ("/objects/object")) - AddClass (LoadClassDescriptor (element)); - - XmlNamespaceManager nsm = new XmlNamespaceManager (objects.NameTable); - nsm.AddNamespace ("xsl", "http://www.w3.org/1999/XSL/Transform"); - - XmlNodeList nodes = objects.SelectNodes ("/objects/object/glade-transform/import/xsl:*", nsm); - importElems = new XmlElement [nodes.Count]; - for (int n=0; n 0) - prop_elem.InnerText = val; - - if (prop.Translatable && prop.IsTranslated (wrapper.Wrapped)) { - prop_elem.SetAttribute ("translatable", "yes"); - string tcx = prop.TranslationContext (wrapper.Wrapped); - if (tcx != null && tcx.Length > 0) { - prop_elem.SetAttribute ("context", "yes"); - prop_elem.InnerText = tcx + "|" + prop_elem.InnerText; - } - string tcm = prop.TranslationComment (wrapper.Wrapped); - if (tcm != null && tcm.Length > 0) - prop_elem.SetAttribute ("comments", prop.TranslationComment (wrapper.Wrapped)); - } - - parent_elem.AppendChild (prop_elem); - } - } - } - - public static void GetSignals (ObjectWrapper ob, XmlElement parent_elem) - { - foreach (Signal signal in ob.Signals) { - if (!signal.SignalDescriptor.VisibleFor (ob.Wrapped)) - continue; - - XmlElement signal_elem = parent_elem.OwnerDocument.CreateElement ("signal"); - signal_elem.SetAttribute ("name", signal.SignalDescriptor.Name); - signal_elem.SetAttribute ("handler", signal.Handler); - if (signal.After) - signal_elem.SetAttribute ("after", "yes"); - parent_elem.AppendChild (signal_elem); - } - } - - static public void Read (ObjectWrapper wrapper, XmlElement elem) - { - string className = elem.GetAttribute ("class"); - if (className == null) - throw new GladeException (" node with no class name"); - - ClassDescriptor klass = Registry.LookupClassByName (className); - if (klass == null) - throw new GladeException ("No stetic ClassDescriptor for " + className); - - Gtk.Widget widget = (Gtk.Widget) wrapper.Wrapped; - if (widget == null) { - widget = (Gtk.Widget) klass.CreateInstance (wrapper.Project); - ObjectWrapper.Bind (wrapper.Project, klass, wrapper, widget, true); - } - - widget.Name = elem.GetAttribute ("id"); - - ReadMembers (klass, wrapper, widget, elem); - - if (!(widget is Gtk.Window)) - widget.ShowAll (); - } - - public static void ReadMembers (ClassDescriptor klass, ObjectWrapper wrapper, object wrapped, XmlElement elem) - { - foreach (XmlNode node in elem.ChildNodes) { - XmlElement child = node as XmlElement; - if (child == null) - continue; - - if (child.LocalName == "signal") - ReadSignal (klass, wrapper, child); - else if (child.LocalName == "property") - ReadProperty (klass, wrapper, wrapped, child); - } - } - - public static void ReadSignal (ClassDescriptor klass, ObjectWrapper ob, XmlElement elem) - { - string name = elem.GetAttribute ("name"); - SignalDescriptor signal = klass.SignalGroups.GetItem (name) as SignalDescriptor; - if (signal != null) { - string handler = elem.GetAttribute ("handler"); - bool after = elem.GetAttribute ("after") == "yes"; - ob.Signals.Add (new Signal (signal, handler, after)); - } - } - - public static void ReadProperty (ClassDescriptor klass, ObjectWrapper wrapper, object wrapped, XmlElement prop_node) - { - string name = prop_node.GetAttribute ("name"); - PropertyDescriptor prop = klass [name] as PropertyDescriptor; - if (prop == null || !prop.CanWrite) - return; - - string strval = prop_node.InnerText; - - // Skip translation context - if (prop_node.GetAttribute ("context") == "yes" && strval.IndexOf ('|') != -1) - strval = strval.Substring (strval.IndexOf ('|') + 1); - - object value = prop.StringToValue (strval); - prop.SetValue (wrapped, value); - - if (prop.Translatable) { - if (prop_node.GetAttribute ("translatable") != "yes") { - prop.SetTranslated (wrapped, false); - } - else { - prop.SetTranslated (wrapped, true); - if (prop_node.GetAttribute ("context") == "yes") { - strval = prop_node.InnerText; - int bar = strval.IndexOf ('|'); - if (bar != -1) - prop.SetTranslationContext (wrapped, strval.Substring (0, bar)); - } - - if (prop_node.HasAttribute ("comments")) - prop.SetTranslationComment (wrapped, prop_node.GetAttribute ("comments")); - } - } - } - - static public void SetPacking (Stetic.Wrapper.Container.ContainerChild wrapper, XmlElement child_elem) - { - XmlElement packing = child_elem["packing"]; - if (packing == null) - return; - - Gtk.Container.ContainerChild cc = wrapper.Wrapped as Gtk.Container.ContainerChild; - ClassDescriptor klass = wrapper.ClassDescriptor; - ReadMembers (klass, wrapper, cc, packing); - } - - internal static XmlElement CreatePacking (XmlDocument doc, Stetic.Wrapper.Container.ContainerChild childwrapper) - { - XmlElement packing_elem = doc.CreateElement ("packing"); - WidgetUtils.GetProps (childwrapper, packing_elem); - return packing_elem; - } - - public static void Copy (Gtk.Widget widget, Gtk.SelectionData seldata, bool copyAsText) - { - XmlElement elem = ExportWidget (widget); - if (elem == null) - return; - - if (copyAsText) - seldata.Text = elem.OuterXml; - else - seldata.Set (ApplicationXSteticAtom, 8, System.Text.Encoding.UTF8.GetBytes (elem.OuterXml)); - } - - public static Stetic.Wrapper.Widget Paste (IProject project, Gtk.SelectionData seldata) - { - if (seldata == null || seldata.Type == null || seldata.Type.Name != ApplicationXSteticAtom.Name) - return null; - - string data = System.Text.Encoding.UTF8.GetString (seldata.Data); - XmlDocument doc = new XmlDocument (); - doc.PreserveWhitespace = true; - try { - doc.LoadXml (data); - } catch { - return null; - } - - Gtk.Widget w = ImportWidget (project, doc.DocumentElement); - return Wrapper.Widget.Lookup (w); - } - - public static IDesignArea GetDesignArea (Gtk.Widget w) - { - while (w != null && !(w is IDesignArea)) - w = w.Parent; - return w as IDesignArea; - } - - internal static void ParseWidgetName (string name, out string baseName, out int idx) - { - // Extract a numerical suffix from the name - // If suffix has more than 4 digits, only the last 4 digits are considered - // a numerical suffix. - - int n; - for (n = name.Length - 1; n >= name.Length-4 && n >= 0 && char.IsDigit (name [n]); n--) - ; - - if (n < name.Length - 1) { - baseName = name.Substring (0, n + 1); - idx = int.Parse (name.Substring (n + 1)); - } else { - baseName = name; - idx = 0; - } - } - - internal static string GetUndoId () - { - return (undoIdCount++).ToString (); - } - - public static Gdk.Pixbuf MissingIcon { - get { - if (missingIcon == null) { - try { - if (Gtk.IconTheme.Default.HasIcon (Gtk.Stock.MissingImage)) - missingIcon = Gtk.IconTheme.Default.LoadIcon (Gtk.Stock.MissingImage, 16, 0); - } catch {} - if (missingIcon == null) { - try { - missingIcon = Gdk.Pixbuf.LoadFromResource ("missing.png"); - } catch (Exception e) { - Console.WriteLine ("Error while loading pixbuf 'missing.png': " + e); - } - } - } - return missingIcon; - } - } - - public static string AbsoluteToRelativePath (string baseDirectoryPath, string absPath) - { - if (! Path.IsPathRooted (absPath)) - return absPath; - - absPath = Path.GetFullPath (absPath); - baseDirectoryPath = Path.GetFullPath (baseDirectoryPath); - - char[] separators = { Path.DirectorySeparatorChar, Path.VolumeSeparatorChar, Path.AltDirectorySeparatorChar }; - baseDirectoryPath = baseDirectoryPath.TrimEnd (separators); - string[] bPath = baseDirectoryPath.Split (separators); - string[] aPath = absPath.Split (separators); - int indx = 0; - for(; indx < Math.Min(bPath.Length, aPath.Length); ++indx){ - if(!bPath[indx].Equals(aPath[indx])) - break; - } - - if (indx == 0) { - return absPath; - } - - string erg = ""; - - if(indx == bPath.Length) { - erg += "." + Path.DirectorySeparatorChar; - } else { - for (int i = indx; i < bPath.Length; ++i) { - erg += ".." + Path.DirectorySeparatorChar; - } - } - erg += String.Join(Path.DirectorySeparatorChar.ToString(), aPath, indx, aPath.Length-indx); - - return erg; - } - - public static int CompareVersions (string v1, string v2) - { - string[] a1 = v1.Split ('.'); - string[] a2 = v2.Split ('.'); - - for (int n=0; n= a2.Length) - return -1; - if (a1[n].Length == 0) { - if (a2[n].Length != 0) - return 1; - continue; - } - try { - int n1 = int.Parse (a1[n]); - int n2 = int.Parse (a2[n]); - if (n1 < n2) - return 1; - else if (n1 > n2) - return -1; - } catch { - return 1; - } - } - if (a2.Length > a1.Length) - return 1; - return 0; - } - - public static Gdk.Pixbuf LoadIcon (string name, Gtk.IconSize size) - { - if (renderer == null) - renderer = new Gtk.HBox (); - Gdk.Pixbuf image = renderer.RenderIcon (name, size, null); - if (image != null) - return image; - - int w, h; - Gtk.Icon.SizeLookup (size, out w, out h); - try { - return Gtk.IconTheme.Default.LoadIcon (name, w, 0); - } catch { - // Icon not in theme - return MissingIcon; - } - } - - public static System.CodeDom.CodeTypeReference ToGlobalTypeRef (this Type type) - { - return new System.CodeDom.CodeTypeReference (type, System.CodeDom.CodeTypeReferenceOptions.GlobalReference); - } - - public static System.CodeDom.CodeTypeReference ToGlobalTypeRef (this string type) - { - return new System.CodeDom.CodeTypeReference (type, System.CodeDom.CodeTypeReferenceOptions.GlobalReference); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Accelerator.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Accelerator.cs deleted file mode 100644 index f6f884848df..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Accelerator.cs +++ /dev/null @@ -1,196 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using Mono.Unix; - -namespace Stetic.Editor { - - [PropertyEditor ("Accel", "AccelChanged")] - public class Accelerator : Gtk.HBox, IPropertyEditor { - - uint keyval; - Gdk.ModifierType mask; - bool editing; - - Gtk.Button clearButton; - Gtk.Entry entry; - - public const Gdk.ModifierType AcceleratorModifierMask = ~( - Gdk.ModifierType.Button1Mask | - Gdk.ModifierType.Button2Mask | - Gdk.ModifierType.Button3Mask | - Gdk.ModifierType.Button4Mask | - Gdk.ModifierType.Button5Mask); - - public Accelerator () - { - entry = new Gtk.Entry (); - clearButton = new Gtk.Button (new Gtk.Image (Gtk.Stock.Clear, Gtk.IconSize.Menu)); - PackStart (entry, true, true, 0); - PackStart (clearButton, false, false, 3); - clearButton.Clicked += delegate (object s, EventArgs args) { - Value = null; - }; - entry.IsEditable = false; - entry.ButtonPressEvent += OnButtonPressEvent; - entry.KeyPressEvent += OnKeyPressEvent; - ShowAll (); - } - - public void Initialize (PropertyDescriptor descriptor) - { - if (descriptor.PropertyType != typeof(string)) - throw new ApplicationException ("Accelerator editor does not support editing values of type " + descriptor.PropertyType); - } - - public void AttachObject (object obj) - { - Value = null; - } - - [GLib.ConnectBefore] - void OnButtonPressEvent (object s, Gtk.ButtonPressEventArgs args) - { - if (editing) - Ungrab (args.Event.Time); - else - Grab (args.Event.Window, args.Event.Time); - args.RetVal = true; - } - - GrabDialog grabWindow; - - void Ungrab (uint time) - { - if (!editing) - return; - editing = false; - - if (Value != null) - entry.Text = (string) Value; - else - entry.Text = ""; - - grabWindow.Destroy (); - } - - void Grab (Gdk.Window window, uint time) - { - if (editing) - return; - - grabWindow = new GrabDialog (); - editing = true; - entry.Text = Catalog.GetString ("Press a key..."); - grabWindow.TransientFor = this.Toplevel as Gtk.Window; - grabWindow.Run (); - this.keyval = grabWindow.Keyval; - this.mask = grabWindow.Mask; - Ungrab (time); - EmitAccelChanged (); - } - - [GLib.ConnectBefore] - void OnKeyPressEvent (object s, Gtk.KeyPressEventArgs args) - { - Gdk.EventKey evt = args.Event; - - if (!editing || !Gtk.Accelerator.Valid (evt.KeyValue, evt.State)) - return; - - uint keyval; - int effectiveGroup, level; - Gdk.ModifierType consumedMods, mask; - - // We know this will succeed, since we're already here... - Gdk.Keymap.Default.TranslateKeyboardState (evt.HardwareKeycode, evt.State, evt.Group, out keyval, out effectiveGroup, out level, out consumedMods); - mask = evt.State & AcceleratorModifierMask & ~consumedMods; - - if (evt.Key != Gdk.Key.Escape || mask != 0) { - this.keyval = keyval; - this.mask = mask; - } - - clearButton.Sensitive = true; - - Ungrab (evt.Time); - EmitAccelChanged (); - args.RetVal = true; - } - - public object Value { - get { - if (keyval != 0) - return Gtk.Accelerator.Name (keyval, mask); - else - return null; - } - set { - string s = value as string; - if (s == null) { - keyval = 0; - mask = 0; - clearButton.Sensitive = false; - } else { - Gtk.Accelerator.Parse (s, out keyval, out mask); - clearButton.Sensitive = true; - } - if (Value != null) - entry.Text = (string) Value; - else - entry.Text = ""; - EmitAccelChanged (); - } - } - - public event EventHandler ValueChanged; - - void EmitAccelChanged () - { - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } - } - - class GrabDialog: Gtk.Dialog - { - public uint Keyval; - public Gdk.ModifierType Mask; - - public GrabDialog () - { - Decorated = false; - this.SkipPagerHint = true; - this.SkipTaskbarHint = true; - this.WindowPosition = Gtk.WindowPosition.CenterOnParent; - Gtk.Frame f = new Gtk.Frame (); - f.Shadow = Gtk.ShadowType.Out; - this.VBox.PackStart (f, true, true, 0); - Gtk.Label lab = new Gtk.Label (Catalog.GetString ("Press the key combination you want to assign to the accelerator...")); - lab.Xpad = 12; - lab.Ypad = 12; - f.Add (lab); - ShowAll (); - } - - protected override bool OnKeyPressEvent (Gdk.EventKey evt) - { - uint keyval; - int effectiveGroup, level; - Gdk.ModifierType consumedMods, mask; - - if (!Gtk.Accelerator.Valid (evt.KeyValue, evt.State)) - return base.OnKeyPressEvent (evt); - - // We know this will succeed, since we're already here... - Gdk.Keymap.Default.TranslateKeyboardState (evt.HardwareKeycode, evt.State, evt.Group, out keyval, out effectiveGroup, out level, out consumedMods); - mask = evt.State & Accelerator.AcceleratorModifierMask & ~consumedMods; - - if (evt.Key != Gdk.Key.Escape || mask != 0) { - Keyval = keyval; - Mask = mask; - this.Respond (0); - } - return false; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionGroupEditor.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionGroupEditor.cs deleted file mode 100644 index dc94b834c6d..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionGroupEditor.cs +++ /dev/null @@ -1,575 +0,0 @@ - -using System; -using System.Collections; -using Stetic.Wrapper; -using Mono.Unix; - -namespace Stetic.Editor -{ - public class ActionGroupEditor: Gtk.EventBox, IMenuItemContainer - { - ActionGroup actionGroup; - Gtk.Table table; - IProject project; - ArrayList items = new ArrayList (); - Gtk.EventBox emptyLabel; - EditableLabel headerLabel; - uint columns = 2; - bool modified; - bool disposed; - ObjectWrapperEventHandler changedEvent; - IDesignArea darea; - - public EventHandler GroupModified; - public EventHandler SelectionChanged; - - public ActionGroupEditor () - { - changedEvent = new ObjectWrapperEventHandler (OnActionChanged); - - Gtk.Fixed fx = new Gtk.Fixed (); - table = new Gtk.Table (0, 0, false); - table.RowSpacing = 8; - table.ColumnSpacing = 8; - table.BorderWidth = 12; - - Gtk.EventBox ebox = new Gtk.EventBox (); - ebox.ModifyBg (Gtk.StateType.Normal, this.Style.Backgrounds [0]); - headerLabel = new EditableLabel (); - headerLabel.MarkupTemplate = "$TEXT"; - headerLabel.Changed += OnGroupNameChanged; - Gtk.VBox vbox = new Gtk.VBox (); - Gtk.Label grpLabel = new Gtk.Label (); - grpLabel.Xalign = 0; - grpLabel.Markup = "Action Group"; -// vbox.PackStart (grpLabel, false, false, 0); - vbox.PackStart (headerLabel, false, false, 3); - vbox.BorderWidth = 12; - ebox.Add (vbox); - - Gtk.VBox box = new Gtk.VBox (); - box.Spacing = 6; - box.PackStart (ebox, false, false, 0); - box.PackStart (table, false, false, 0); - - fx.Put (box, 0, 0); - Add (fx); - ShowAll (); - } - - public override void Dispose () - { - if (disposed) - return; - disposed = true; - headerLabel.Changed -= OnGroupNameChanged; - if (emptyLabel != null) - emptyLabel.ButtonPressEvent -= OnAddClicked; - - foreach (ActionMenuItem aitem in items) { - aitem.KeyPressEvent -= OnItemKeyPress; - aitem.Node.Dispose (); - aitem.Detach (); - aitem.Destroy (); - } - items.Clear (); - ActionGroup = null; - project = null; - headerLabel = null; - - if (darea != null) { - darea.SelectionChanged -= OnSelectionChanged; - darea = null; - } - - base.Dispose (); - } - - public ActionGroup ActionGroup { - get { return actionGroup; } - set { - if (actionGroup != null) { - actionGroup.ObjectChanged -= OnGroupChanged; - actionGroup.ActionAdded -= OnActionAdded; - actionGroup.ActionRemoved -= OnActionRemoved; - foreach (Wrapper.Action a in actionGroup.Actions) - a.ObjectChanged -= changedEvent; - } - actionGroup = value; - if (actionGroup != null) { - headerLabel.Text = actionGroup.Name; - actionGroup.ObjectChanged += OnGroupChanged; - actionGroup.ActionAdded += OnActionAdded; - actionGroup.ActionRemoved += OnActionRemoved; - foreach (Wrapper.Action a in actionGroup.Actions) - a.ObjectChanged += changedEvent; - } - if (!disposed) - Fill (); - } - } - - public IProject Project { - get { return project; } - set { project = value; } - } - - public bool Modified { - get { return modified; } - set { modified = value; } - } - - public Wrapper.Action SelectedAction { - get { - IDesignArea designArea = GetDesignArea (); - IObjectSelection sel = designArea.GetSelection (); - if (sel != null) - return ObjectWrapper.Lookup (sel.DataObject) as Wrapper.Action; - else - return null; - } - set { - foreach (ActionMenuItem item in items) { - if (item.Node.Action == value) - item.Select (); - } - } - } - - ActionMenuItem SelectedActionMenuItem { - get { - IDesignArea designArea = GetDesignArea (); - IObjectSelection sel = designArea.GetSelection (); - if (sel != null) - return sel.Widget as ActionMenuItem; - else - return null; - } - } - - public void StartEditing () - { - IDesignArea designArea = GetDesignArea (); - designArea.SetSelection (headerLabel, null); - headerLabel.StartEditing (); - } - - void Fill () - { - IDesignArea designArea = GetDesignArea (); - if (designArea == null) - return; - - Wrapper.Action selAction = null; - - foreach (ActionMenuItem item in items) { - if (designArea.IsSelected (item)) - selAction = item.Node.Action; - item.Node.Dispose (); - item.Detach (); - item.Destroy (); - } - items.Clear (); - - if (actionGroup != null) { - Wrapper.Action[] sortedActions = new Wrapper.Action [actionGroup.Actions.Count]; - actionGroup.Actions.CopyTo (sortedActions, 0); - Array.Sort (sortedActions, new ActionComparer ()); - for (int n = 0; n < sortedActions.Length; n++) { - Wrapper.Action action = (Wrapper.Action) sortedActions [n]; - ActionMenuItem item = InsertAction (action, n); - if (selAction == action) - item.Select (); - } - - if (selAction == null) - designArea.SetSelection (null, null); - - headerLabel.Sensitive = true; - PlaceAddLabel (actionGroup.Actions.Count); - } else { - HideAddLabel (); - headerLabel.Text = Catalog.GetString ("No selection"); - headerLabel.Sensitive = false; - } - ShowAll (); - } - - ActionMenuItem InsertAction (Wrapper.Action action, int n) - { - uint row = (uint) n / columns; - uint col = (uint) (n % columns) * 3; - - IDesignArea designArea = GetDesignArea (); - ActionTreeNode node = new ActionTreeNode (Gtk.UIManagerItemType.Menuitem, "", action); - ActionMenuItem aitem = new ActionMenuItem (designArea, project, this, node); - aitem.KeyPressEvent += OnItemKeyPress; - aitem.MinWidth = 150; - aitem.Attach (table, row, col); - - Gtk.Frame fr = new Gtk.Frame (); - fr.Shadow = Gtk.ShadowType.Out; - aitem.Add (fr); - - items.Add (aitem); - return aitem; - } - - void PlaceAddLabel (int n) - { - HideAddLabel (); - - uint r = (uint) n / columns; - uint c = (uint) (n % columns) * 3; - - emptyLabel = new Gtk.EventBox (); - emptyLabel.VisibleWindow = false; - Gtk.Label label = new Gtk.Label (); - label.Xalign = 0; - label.Markup = "" + Catalog.GetString ("Click to create action") + ""; - emptyLabel.Add (label); - emptyLabel.ButtonPressEvent += OnAddClicked; - table.Attach (emptyLabel, c, c+3, r, r+1); - } - - void HideAddLabel () - { - if (emptyLabel != null) { - table.Remove (emptyLabel); - emptyLabel.ButtonPressEvent -= OnAddClicked; - } - emptyLabel = null; - } - - void OnGroupChanged (object s, ObjectWrapperEventArgs args) - { - headerLabel.Text = actionGroup.Name; - NotifyModified (); - } - - void OnActionAdded (object s, ActionEventArgs args) - { - args.Action.ObjectChanged += changedEvent; - Fill (); - NotifyModified (); - } - - void OnActionRemoved (object s, ActionEventArgs args) - { - args.Action.ObjectChanged -= changedEvent; - Fill (); - NotifyModified (); - } - - void OnActionChanged (object s, ObjectWrapperEventArgs args) - { - NotifyModified (); - } - - void NotifyModified () - { - modified = true; - if (GroupModified != null) - GroupModified (this, EventArgs.Empty); - } - - void OnAddClicked (object s, Gtk.ButtonPressEventArgs args) - { - Wrapper.Action ac = (Wrapper.Action) ObjectWrapper.Create (project, new Gtk.Action ("", "", null, null)); - ActionMenuItem item = InsertAction (ac, actionGroup.Actions.Count); - item.EditingDone += OnEditDone; - item.Select (); - item.StartEditing (); - HideAddLabel (); - ShowAll (); - } - - void OnEditDone (object sender, EventArgs args) - { - ActionMenuItem item = (ActionMenuItem) sender; - item.EditingDone -= OnEditDone; - if (item.Node.Action.GtkAction.Label.Length > 0 || item.Node.Action.GtkAction.StockId != null) { - actionGroup.Actions.Add (item.Node.Action); - } else { - IDesignArea designArea = GetDesignArea (); - designArea.ResetSelection (item); - item.Detach (); - item.Node.Dispose (); - items.Remove (item); - item.Destroy (); - PlaceAddLabel (actionGroup.Actions.Count); - ShowAll (); - } - } - - protected override bool OnButtonPressEvent (Gdk.EventButton ev) - { - IDesignArea designArea = GetDesignArea (); - designArea.SetSelection (null, null); - return true; - } - - void OnItemKeyPress (object s, Gtk.KeyPressEventArgs args) - { - int pos = items.IndexOf (s); - - switch (args.Event.Key) { - case Gdk.Key.Up: - pos -= (int) columns; - break; - case Gdk.Key.Down: - pos += (int) columns; - break; - case Gdk.Key.Right: - pos ++; - break; - case Gdk.Key.Left: - pos --; - break; - } - if (pos >= 0 && pos < items.Count) { - ((ActionMenuItem)items[pos]).Select (); - args.RetVal = true; - } - else if (pos == items.Count) { - OnAddClicked (null, null); - args.RetVal = true; - } - } - - void OnGroupNameChanged (object s, EventArgs args) - { - if (actionGroup != null) - actionGroup.Name = headerLabel.Text; - } - - void OnSelectionChanged (object s, EventArgs args) - { - if (SelectionChanged != null) - SelectionChanged (this, args); - } - - public void Cut () - { - ActionMenuItem menuItem = SelectedActionMenuItem; - if (menuItem != null) - Cut (SelectedActionMenuItem); - } - - public void Copy () - { - ActionMenuItem menuItem = SelectedActionMenuItem; - if (menuItem != null) - Copy (SelectedActionMenuItem); - } - - public void Paste () - { - } - - public void Delete () - { - ActionMenuItem menuItem = SelectedActionMenuItem; - if (menuItem != null) - Delete (SelectedActionMenuItem); - } - - void Cut (ActionMenuItem menuItem) - { - } - - void Copy (ActionMenuItem menuItem) - { - } - - void Paste (ActionMenuItem menuItem) - { - } - - void Delete (ActionMenuItem menuItem) - { - string msg = string.Format (Catalog.GetString ("Are you sure you want to delete the action '{0}'? It will be removed from all menus and toolbars."), menuItem.Node.Action.Name); - Gtk.MessageDialog md = new Gtk.MessageDialog (null, Gtk.DialogFlags.Modal, Gtk.MessageType.Question, Gtk.ButtonsType.YesNo, msg); - md.TransientFor = this.Toplevel as Gtk.Window; - if (md.Run () == (int) Gtk.ResponseType.Yes) { - menuItem.Node.Action.Delete (); - darea.SetSelection (null, null); - } - md.Destroy (); - } - - void IMenuItemContainer.ShowContextMenu (ActionItem aitem) - { - ActionMenuItem menuItem = aitem as ActionMenuItem; - - Gtk.Menu m = new Gtk.Menu (); - Gtk.MenuItem item = new Gtk.ImageMenuItem (Gtk.Stock.Cut, null); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - Cut (menuItem); - }; - item.Visible = false; // No copy & paste for now - item = new Gtk.ImageMenuItem (Gtk.Stock.Copy, null); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - Copy (menuItem); - }; - item.Visible = false; // No copy & paste for now - item = new Gtk.ImageMenuItem (Gtk.Stock.Paste, null); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - Paste (menuItem); - }; - item.Visible = false; // No copy & paste for now - item = new Gtk.ImageMenuItem (Gtk.Stock.Delete, null); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - Delete (menuItem); - }; - m.ShowAll (); - m.Popup (); - } - - IDesignArea GetDesignArea () - { - if (darea != null) - return darea; - - darea = WidgetUtils.GetDesignArea (this); - darea.SelectionChanged += OnSelectionChanged; - return darea; - } - - ActionMenu IMenuItemContainer.OpenSubmenu { - get { return null; } - set { } - } - - bool IMenuItemContainer.IsTopMenu { - get { return false; } - } - - Gtk.Widget IMenuItemContainer.Widget { - get { return this; } - } - - class ActionComparer: IComparer - { - public int Compare (object x, object y) - { - return string.Compare (((Wrapper.Action)x).GtkAction.Label, ((Wrapper.Action)y).GtkAction.Label); - } - } - } - - public class EditableLabel: Gtk.EventBox - { - string text; - string markup; - - public EditableLabel (): this ("") - { - } - - public EditableLabel (string txt) - { - VisibleWindow = false; - text = txt; - Add (CreateLabel ()); - } - - public string Text { - get { return text; } - set { - text = value; - if (Child is Gtk.Entry) - ((Gtk.Entry)Child).Text = text; - else - ((Gtk.Label)Child).Markup = Markup; - } - } - - public string MarkupTemplate { - get { return markup; } - set { - markup = value; - if (Child is Gtk.Label) - ((Gtk.Label)Child).Markup = Markup; - } - } - - public string Markup { - get { return markup != null ? markup.Replace ("$TEXT",text) : text; } - } - - protected override bool OnButtonPressEvent (Gdk.EventButton ev) - { - IDesignArea d = WidgetUtils.GetDesignArea (this); - if (d.IsSelected (this)) { - if (Child is Gtk.Label) { - StartEditing (); - return true; - } - } else { - d.SetSelection (this, null); - return true; - } - return false; - } - - void SelectionDisposed (object s, EventArgs args) - { - EndEditing (); - } - - public void StartEditing () - { - if (Child is Gtk.Label) { - IDesignArea d = WidgetUtils.GetDesignArea (this); - IObjectSelection sel = d.GetSelection (this); - if (sel == null) - sel = d.SetSelection (this, null); - - sel.Disposed += SelectionDisposed; - - Remove (Child); - Add (CreateEntry ()); - ShowAll (); - Child.GrabFocus (); - } - } - - public void EndEditing () - { - if (Child is Gtk.Entry) { - Remove (Child); - Add (CreateLabel ()); - ShowAll (); - } - } - - Gtk.Label CreateLabel () - { - Gtk.Label label = new Gtk.Label (); - label.Markup = Markup; - label.Xalign = 0; - return label; - } - - Gtk.Entry CreateEntry () - { - Gtk.Entry e = new Gtk.Entry (text); - e.Changed += delegate (object s, EventArgs a) { - text = e.Text; - if (Changed != null) - Changed (this, a); - }; - e.Activated += delegate (object s, EventArgs a) { - EndEditing (); - }; - return e; - } - - public event EventHandler Changed; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionItem.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionItem.cs deleted file mode 100644 index 755ce1392c7..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionItem.cs +++ /dev/null @@ -1,209 +0,0 @@ - -using System; -using Stetic.Wrapper; - -namespace Stetic.Editor -{ - abstract class ActionItem: Gtk.EventBox, IEditableObject - { - protected IMenuItemContainer parentMenu; - protected ActionTreeNode node; - protected Widget wrapper; - protected bool localUpdate; - protected bool editOnRelease; - protected bool editing; - protected uint itemSpacing; - protected int minWidth; - - // To use in the action editor - protected IDesignArea designArea; - protected IProject project; - bool disposed; - - public ActionItem (ActionTreeNode node, IMenuItemContainer parent, uint itemSpacing) - { - DND.SourceSet (this); - this.parentMenu = parent; - this.node = node; - this.VisibleWindow = false; - this.CanFocus = true; - this.Events |= Gdk.EventMask.KeyPressMask; - this.itemSpacing = itemSpacing; - if (node.Action != null) - node.Action.ObjectChanged += OnActionChanged; - } - - public ActionTreeNode Node { - get { return node; } - } - - public uint ItemSpacing { - get { return itemSpacing; } - set { itemSpacing = value; } - } - - public int MinWidth { - get { return minWidth; } - set { minWidth = value; } - } - - public bool IsSelected { - get { - IDesignArea area = GetDesignArea (); - return area.IsSelected (this); - } - } - - protected void UpdateSelectionStatus () - { - IDesignArea area = GetDesignArea (); - IObjectSelection sel = area.GetSelection (); - sel.Disposed -= OnSelectionDisposed; - sel.Drag -= HandleItemDrag; - - area.ResetSelection (this); - - sel = area.SetSelection (this, this); - sel.Drag += HandleItemDrag; - sel.Disposed += OnSelectionDisposed; - } - - public virtual void Select () - { - IDesignArea area = GetDesignArea (); - if (area.IsSelected (this)) - return; - IObjectSelection sel = area.SetSelection (this, node.Action != null ? node.Action.GtkAction : null); - sel.Drag += HandleItemDrag; - sel.Disposed += OnSelectionDisposed; - GrabFocus (); - } - - void OnSelectionDisposed (object ob, EventArgs a) - { - if (!disposed) - EndEditing (Gdk.Key.Return); - } - - protected virtual void EndEditing (Gdk.Key exitKey) - { - } - - public override void Dispose () - { - disposed = true; - base.Dispose (); - } - - - void HandleItemDrag (Gdk.EventMotion evt, int dx, int dy) - { - ProcessDragBegin (null, evt); - } - - protected IDesignArea GetDesignArea () - { - if (wrapper != null) - return wrapper.GetDesignArea (); - else - return designArea; - } - - protected IProject GetProject () - { - if (wrapper != null) - return wrapper.Project; - else - return project; - } - - void OnActionChanged (object ob, ObjectWrapperEventArgs a) - { - if (!localUpdate) - Refresh (); - } - - public abstract void Refresh (); - - protected override bool OnButtonPressEvent (Gdk.EventButton ev) - { - return ProcessButtonPress (ev); - } - - public bool ProcessButtonPress (Gdk.EventButton ev) - { - if (GtkWorkarounds.TriggersContextMenu (ev)) { - parentMenu.ShowContextMenu (this); - } else if (ev.Button == 1) { - IDesignArea area = GetDesignArea (); - if (area == null) - return true; - - // Clicking a selected item starts the edit mode - if (area.IsSelected (this)) { - editOnRelease = true; - return true; - } - } - - Select (); - return true; - } - - protected override void OnDragBegin (Gdk.DragContext ctx) - { - ProcessDragBegin (ctx, null); - } - - public virtual void ProcessDragBegin (Gdk.DragContext ctx, Gdk.EventMotion evt) - { - editOnRelease = false; - ActionPaletteItem item = new ActionPaletteItem (node); - if (ctx != null) - DND.Drag (parentMenu.Widget, ctx, item); - else - DND.Drag (parentMenu.Widget, evt, item); - } - - public bool CanCopy { - get { return !editing; } - } - - public bool CanCut { - get { return false; } - } - - public bool CanPaste { - get { return false; } - } - - public bool CanDelete { - get { return !editing; } - } - - public void Copy () - { - } - - public void Cut () - { - } - - public void Paste () - { - } - - public void Delete () - { - if (node.ParentNode != null) - node.ParentNode.Children.Remove (node); - Destroy (); - } - - void IEditableObject.Delete () - { - if (!editing) - Delete (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionMenu.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionMenu.cs deleted file mode 100644 index 5c45ed9bcd0..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionMenu.cs +++ /dev/null @@ -1,648 +0,0 @@ - -using System; -using System.Collections; -using Stetic.Wrapper; -using Mono.Unix; - -namespace Stetic.Editor -{ - public class ActionMenu: Gtk.EventBox, IMenuItemContainer - { - ActionTreeNode parentNode; - ActionTreeNodeCollection nodes; - ArrayList menuItems = new ArrayList (); - Gtk.Table table; - ActionMenu openSubmenu; - Widget wrapper; - int dropPosition = -1; - int dropIndex; - Gtk.EventBox emptyLabel; - IMenuItemContainer parentMenu; - - public ActionMenu (IntPtr p): base (p) - {} - - internal ActionMenu (Widget wrapper, IMenuItemContainer parentMenu, ActionTreeNode node) - { - DND.DestSet (this, true); - parentNode = node; - this.parentMenu = parentMenu; - this.wrapper = wrapper; - this.nodes = node.Children; - table = new Gtk.Table (0, 0, false); - table.ColumnSpacing = 5; - table.RowSpacing = 5; - table.BorderWidth = 5; - this.AppPaintable = true; - - Add (table); - - Fill (); - - parentNode.ChildNodeAdded += OnChildAdded; - parentNode.ChildNodeRemoved += OnChildRemoved; - } - - protected override void OnDestroyed () - { - parentNode.ChildNodeAdded -= OnChildAdded; - parentNode.ChildNodeRemoved -= OnChildRemoved; - parentNode = null; - - base.OnDestroyed (); - } - - public void Select (ActionTreeNode node) - { - if (node != null) { - ActionMenuItem item = FindMenuItem (node); - if (item != null) - item.Select (); - } else { - if (menuItems.Count > 0) - ((ActionMenuItem)menuItems [0]).Select (); - else - InsertAction (0); - } - } - - public ActionTreeNode ParentNode { - get { return parentNode; } - } - - bool IMenuItemContainer.IsTopMenu { - get { return false; } - } - - Gtk.Widget IMenuItemContainer.Widget { - get { return this; } - } - - public void TrackWidgetPosition (Gtk.Widget refWidget, bool topMenu) - { - IDesignArea area = wrapper.GetDesignArea (); - Gdk.Rectangle rect = area.GetCoordinates (refWidget); - if (topMenu) - area.MoveWidget (this, rect.X, rect.Bottom); - else - area.MoveWidget (this, rect.Right, rect.Top); - - GLib.Timeout.Add (50, new GLib.TimeoutHandler (RepositionSubmenu)); - } - - public bool RepositionSubmenu () - { - if (openSubmenu == null) - return false; - - ActionMenuItem item = FindMenuItem (openSubmenu.parentNode); - if (item != null) - openSubmenu.TrackWidgetPosition (item, false); - return false; - } - - void Fill () - { - menuItems.Clear (); - - uint n = 0; - ActionMenuItem editItem = null; - - if (nodes.Count > 0) { - foreach (ActionTreeNode node in nodes) { - ActionMenuItem item = new ActionMenuItem (wrapper, this, node); - item.KeyPressEvent += OnItemKeyPress; - item.Attach (table, n++, 0); - menuItems.Add (item); - // If adding an action with an empty name, select and start editing it -// if (node.Action != null && node.Action.Name.Length == 0) -// editItem = item; - } - } - - emptyLabel = new Gtk.EventBox (); - emptyLabel.VisibleWindow = false; - Gtk.Label label = new Gtk.Label (); - label.Xalign = 0; - label.Markup = "" + Catalog.GetString ("Click to create action") + ""; - emptyLabel.Add (label); - emptyLabel.ButtonPressEvent += OnAddClicked; - table.Attach (emptyLabel, 1, 2, n, n + 1); - - ShowAll (); - - if (editItem != null) { - // If there is an item with an empty action, it means that it was an item that was - // being edited. Restart the editing now. - GLib.Timeout.Add (200, delegate { - editItem.Select (); - editItem.EditingDone += OnEditingDone; - editItem.StartEditing (); - return false; - }); - } - } - - void Refresh () - { - IDesignArea area = wrapper.GetDesignArea (); - ActionTreeNode selNode = null; - - foreach (Gtk.Widget w in table.Children) { - ActionMenuItem ami = w as ActionMenuItem; - if (area.IsSelected (w) && ami != null) { - selNode = ami.Node; - area.ResetSelection (w); - } - table.Remove (w); - } - - Fill (); - - ActionMenuItem mi = FindMenuItem (selNode); - if (mi != null) - mi.Select (); - - GLib.Timeout.Add (50, new GLib.TimeoutHandler (RepositionSubmenu)); - } - - public ActionMenu OpenSubmenu { - get { return openSubmenu; } - set { - if (openSubmenu != null) { - openSubmenu.OpenSubmenu = null; - IDesignArea area = wrapper.GetDesignArea (); - area.RemoveWidget (openSubmenu); - openSubmenu.Destroy (); - } - openSubmenu = value; - } - } - - internal void ResetSelection () - { - if (OpenSubmenu != null) - OpenSubmenu.ResetSelection (); - IDesignArea area = wrapper.GetDesignArea (); - if (area != null) { - foreach (Gtk.Widget w in table.Children) { - ActionMenuItem ami = w as ActionMenuItem; - if (ami != null) - area.ResetSelection (w); - } - } - } - - ActionTreeNode InsertAction (int pos) - { - using (wrapper.UndoManager.AtomicChange) { - Wrapper.Action ac = (Wrapper.Action) ObjectWrapper.Create (wrapper.Project, new Gtk.Action ("", "", null, null)); - ActionTreeNode newNode = new ActionTreeNode (Gtk.UIManagerItemType.Menuitem, null, ac); - nodes.Insert (pos, newNode); - ActionMenuItem item = FindMenuItem (newNode); - item.EditingDone += OnEditingDone; - item.Select (); - item.StartEditing (); - emptyLabel.Hide (); - - if (wrapper.LocalActionGroups.Count == 0) - wrapper.LocalActionGroups.Add (new ActionGroup ("Default")); - wrapper.LocalActionGroups [0].Actions.Add (ac); - return newNode; - } - } - - void DeleteAction (ActionMenuItem item) - { - int pos = menuItems.IndexOf (item); - item.Delete (); - if (pos >= menuItems.Count) - SelectLastItem (); - else - ((ActionMenuItem)menuItems [pos]).Select (); - } - - void OnEditingDone (object ob, MenuItemEditEventArgs args) - { - ActionMenuItem item = (ActionMenuItem) ob; - item.EditingDone -= OnEditingDone; - if (item.Node.Action.GtkAction.Label.Length == 0 && item.Node.Action.GtkAction.StockId == null) { - IDesignArea area = wrapper.GetDesignArea (); - area.ResetSelection (item); - using (wrapper.UndoManager.AtomicChange) { - nodes.Remove (item.Node); - wrapper.LocalActionGroups [0].Actions.Remove (item.Node.Action); - } - SelectLastItem (); - } - else { - if (args.ExitKey == Gdk.Key.Up || args.ExitKey == Gdk.Key.Down) - ProcessKey (item, args.ExitKey, Gdk.ModifierType.None); - } - } - - void SelectLastItem () - { - if (menuItems.Count > 0) - ((ActionMenuItem)menuItems [menuItems.Count - 1]).Select (); - else if (parentMenu.Widget is ActionMenuBar) { - ActionMenuBar bar = (ActionMenuBar) parentMenu.Widget; - bar.Select (parentNode); - } - else if (parentMenu.Widget is ActionMenu) { - ActionMenu parentAM = (ActionMenu) parentMenu.Widget; - parentAM.Select (parentNode); - } - } - - void OnChildAdded (object ob, ActionTreeNodeArgs args) - { - Refresh (); - } - - void OnChildRemoved (object ob, ActionTreeNodeArgs args) - { - IDesignArea area = wrapper.GetDesignArea (); - IObjectSelection asel = area.GetSelection (); - ActionMenuItem curSel = asel != null ? asel.DataObject as ActionMenuItem : null; - int pos = menuItems.IndexOf (curSel); - - ActionMenuItem mi = FindMenuItem (args.Node); - if (mi != null) { - // Remove the table row that contains the menu item - Gtk.Table.TableChild tc = (Gtk.Table.TableChild) table [mi]; - uint row = tc.TopAttach; - mi.Detach (); - menuItems.Remove (mi); - foreach (Gtk.Widget w in table.Children) { - tc = (Gtk.Table.TableChild) table [w]; - if (tc.TopAttach >= row) - tc.TopAttach--; - if (tc.BottomAttach > row) - tc.BottomAttach--; - } - if (pos != -1 && pos < menuItems.Count) - ((ActionMenuItem)menuItems[pos]).Select (); - else - SelectLastItem (); - GLib.Timeout.Add (50, new GLib.TimeoutHandler (RepositionSubmenu)); - } - } - - protected override bool OnExposeEvent (Gdk.EventExpose ev) - { - int w, h; - this.GdkWindow.GetSize (out w, out h); - Gdk.Rectangle clip = new Gdk.Rectangle (0,0,w,h); - Gtk.Style.PaintBox (this.Style, this.GdkWindow, Gtk.StateType.Normal, Gtk.ShadowType.Out, clip, this, "menu", 0, 0, w, h); - - bool r = base.OnExposeEvent (ev); - - if (dropPosition != -1) { - GdkWindow.DrawRectangle (this.Style.BlackGC, true, 0, dropPosition - 1, w - 2, 3); - } - - return r; - } - - protected override bool OnButtonPressEvent (Gdk.EventButton ev) - { - return true; - } - - void OnAddClicked (object s, Gtk.ButtonPressEventArgs args) - { - InsertAction (menuItems.Count); - args.RetVal = true; - } - - protected override bool OnDragMotion (Gdk.DragContext context, int x, int y, uint time) - { - ActionPaletteItem dragItem = DND.DragWidget as ActionPaletteItem; - if (dragItem == null) - return false; - - if (nodes.Count > 0) { - ActionMenuItem item = LocateWidget (x, y); - if (item != null) { - - // Show the submenu to allow droping to it, but avoid - // droping a submenu inside itself - if (item.HasSubmenu && item.Node != dragItem.Node) - item.ShowSubmenu (wrapper.GetDesignArea(), item); - - // Look for the index where to insert the new item - dropIndex = nodes.IndexOf (item.Node); - int mpos = item.Allocation.Y + item.Allocation.Height / 2; - if (y > mpos) - dropIndex++; - - // Calculate the drop position, used to show the drop bar - if (dropIndex == 0) - dropPosition = item.Allocation.Y; - else if (dropIndex == menuItems.Count) - dropPosition = item.Allocation.Bottom; - else { - item = (ActionMenuItem) menuItems [dropIndex]; - ActionMenuItem prevItem = (ActionMenuItem) menuItems [dropIndex - 1]; - dropPosition = prevItem.Allocation.Bottom + (item.Allocation.Y - prevItem.Allocation.Bottom)/2; - } - } - } else - dropIndex = 0; - - QueueDraw (); - return base.OnDragMotion (context, x, y, time); - } - - protected override void OnDragLeave (Gdk.DragContext context, uint time) - { - dropPosition = -1; - QueueDraw (); - base.OnDragLeave (context, time); - } - - protected override void OnDragDataReceived (Gdk.DragContext context, int x, int y, Gtk.SelectionData data, uint info, uint time) - { - } - - protected override bool OnDragDrop (Gdk.DragContext context, int x, int y, uint time) - { - ActionPaletteItem dropped = DND.Drop (context, null, time) as ActionPaletteItem; - if (dropped == null) - return false; - - if (dropped.Node.Type != Gtk.UIManagerItemType.Menuitem && - dropped.Node.Type != Gtk.UIManagerItemType.Menu && - dropped.Node.Type != Gtk.UIManagerItemType.Toolitem && - dropped.Node.Type != Gtk.UIManagerItemType.Separator) - return false; - - ActionTreeNode newNode = null; - - // Toolitems are copied, not moved - - using (wrapper.UndoManager.AtomicChange) { - if (dropped.Node.ParentNode != null && dropped.Node.Type != Gtk.UIManagerItemType.Toolitem) { - if (dropIndex < nodes.Count) { - // Do nothing if trying to drop the node over the same node - ActionTreeNode dropNode = nodes [dropIndex]; - if (dropNode == dropped.Node) - return false; - - dropped.Node.ParentNode.Children.Remove (dropped.Node); - - // The drop position may have changed after removing the dropped node, - // so get it again. - dropIndex = nodes.IndexOf (dropNode); - nodes.Insert (dropIndex, dropped.Node); - } else { - dropped.Node.ParentNode.Children.Remove (dropped.Node); - nodes.Add (dropped.Node); - dropIndex = nodes.Count - 1; - } - } else { - newNode = new ActionTreeNode (Gtk.UIManagerItemType.Menuitem, null, dropped.Node.Action); - nodes.Insert (dropIndex, newNode); - } - // Select the dropped node - ActionMenuItem mi = (ActionMenuItem) menuItems [dropIndex]; - mi.Select (); - } - - return base.OnDragDrop (context, x, y, time); - } - - [GLib.ConnectBefore] - void OnItemKeyPress (object s, Gtk.KeyPressEventArgs args) - { - ActionMenuItem item = (ActionMenuItem) s; - ProcessKey (item, args.Event.Key, args.Event.State); - args.RetVal = true; - } - - void ProcessKey (ActionMenuItem item, Gdk.Key key, Gdk.ModifierType modifier) - { - int pos = menuItems.IndexOf (item); - - switch (key) { - case Gdk.Key.Up: - if (pos > 0) - ((ActionMenuItem)menuItems[pos - 1]).Select (); - else if (parentMenu.Widget is ActionMenuBar) { - ActionMenuBar bar = (ActionMenuBar) parentMenu.Widget; - bar.Select (parentNode); - } - break; - case Gdk.Key.Down: - if (pos < menuItems.Count - 1) - ((ActionMenuItem)menuItems[pos + 1]).Select (); - else if (pos == menuItems.Count - 1) { - InsertAction (menuItems.Count); - } - break; - case Gdk.Key.Right: - if ((modifier & Gdk.ModifierType.ControlMask) != 0 && item.Node.Type == Gtk.UIManagerItemType.Menuitem) { - // Create a submenu - using (item.Node.Action.UndoManager.AtomicChange) { - item.Node.Type = Gtk.UIManagerItemType.Menu; - } - item.Node.Action.NotifyChanged (); - } - if (item.HasSubmenu) { - item.ShowSubmenu (); - if (openSubmenu != null) - openSubmenu.Select (null); - } else if (parentNode != null) { - ActionMenuBar parentMB = parentMenu.Widget as ActionMenuBar; - if (parentMB != null) { - int i = parentNode.ParentNode.Children.IndexOf (parentNode); - if (i < parentNode.ParentNode.Children.Count - 1) - parentMB.DropMenu (parentNode.ParentNode.Children [i + 1]); - } - } - break; - case Gdk.Key.Left: - if ((modifier & Gdk.ModifierType.ControlMask) != 0 && item.Node.Type == Gtk.UIManagerItemType.Menu) { - // Remove the submenu - OpenSubmenu = null; - using (item.Node.Action.UndoManager.AtomicChange) { - item.Node.Type = Gtk.UIManagerItemType.Menuitem; - item.Node.Children.Clear (); - } - item.Node.Action.NotifyChanged (); - break; - } - if (parentNode != null) { - ActionMenu parentAM = parentMenu.Widget as ActionMenu; - if (parentAM != null) { - parentAM.Select (parentNode); - } - ActionMenuBar parentMB = parentMenu.Widget as ActionMenuBar; - if (parentMB != null) { - int i = parentNode.ParentNode.Children.IndexOf (parentNode); - if (i > 0) - parentMB.DropMenu (parentNode.ParentNode.Children [i - 1]); - } - } - break; - case Gdk.Key.Return: - item.EditingDone += OnEditingDone; - item.StartEditing (); - break; - case Gdk.Key.Insert: - if ((modifier & Gdk.ModifierType.ControlMask) != 0) - InsertActionAt (item, true, true); - else - InsertActionAt (item, false, false); - break; - case Gdk.Key.Delete: - DeleteAction (item); - break; - } - } - - void InsertActionAt (ActionMenuItem item, bool after, bool separator) - { - int pos = menuItems.IndexOf (item); - if (pos == -1) - return; - - if (after) - pos++; - - if (separator) { - ActionTreeNode newNode = new ActionTreeNode (Gtk.UIManagerItemType.Separator, null, null); - nodes.Insert (pos, newNode); - Select (newNode); - } else - InsertAction (pos); - } - - void Paste (ActionMenuItem item) - { - } - - void IMenuItemContainer.ShowContextMenu (ActionItem aitem) - { - ActionMenuItem menuItem = aitem as ActionMenuItem; - Gtk.Menu m = new Gtk.Menu (); - Gtk.MenuItem item = new Gtk.MenuItem (Catalog.GetString ("Insert Before")); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - InsertActionAt (menuItem, false, false); - }; - item = new Gtk.MenuItem (Catalog.GetString ("Insert After")); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - InsertActionAt (menuItem, true, false); - }; - item = new Gtk.MenuItem (Catalog.GetString ("Insert Separator Before")); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - InsertActionAt (menuItem, false, true); - }; - item = new Gtk.MenuItem (Catalog.GetString ("Insert Separator After")); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - InsertActionAt (menuItem, true, true); - }; - - m.Add (new Gtk.SeparatorMenuItem ()); - - item = new Gtk.ImageMenuItem (Gtk.Stock.Cut, null); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - menuItem.Cut (); - }; - item.Visible = false; // No copy & paste for now - item = new Gtk.ImageMenuItem (Gtk.Stock.Copy, null); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - menuItem.Copy (); - }; - item.Visible = false; - item = new Gtk.ImageMenuItem (Gtk.Stock.Paste, null); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - Paste (menuItem); - }; - item.Visible = false; - - item = new Gtk.ImageMenuItem (Gtk.Stock.Delete, null); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - DeleteAction (menuItem); - }; - m.ShowAll (); - m.Popup (); - } - - internal void SaveStatus (ArrayList status) - { - for (int n=0; n= menuItems.Count) - return; - - ActionMenuItem item = (ActionMenuItem)menuItems [pos]; - if (index == status.Count - 1) { - // The last position in the status is the selected item - item.Select (); - if (item.Node.Action != null && item.Node.Action.Name.Length == 0) { - // Then only case when there can have an action when an empty name - // is when the user clicked on the "add action" link. In this case, - // start editing the item again - item.EditingDone += OnEditingDone; - item.StartEditing (); - } - } - else { - item.ShowSubmenu (); - if (OpenSubmenu != null) - OpenSubmenu.RestoreStatus (status, index + 1); - } - } - - ActionMenuItem LocateWidget (int x, int y) - { - foreach (ActionMenuItem mi in menuItems) { - if (mi.Allocation.Contains (x, y)) - return mi; - } - return null; - } - - ActionMenuItem FindMenuItem (ActionTreeNode node) - { - foreach (ActionMenuItem mi in menuItems) { - if (mi.Node == node) - return mi; - } - return null; - } - } - - interface IMenuItemContainer - { - ActionMenu OpenSubmenu { get; set; } - bool IsTopMenu { get; } - Gtk.Widget Widget { get; } - void ShowContextMenu (ActionItem item); - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionMenuBar.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionMenuBar.cs deleted file mode 100644 index e1db3bb2864..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionMenuBar.cs +++ /dev/null @@ -1,553 +0,0 @@ - -using System; -using System.Xml; -using System.Collections; -using Stetic.Wrapper; -using Mono.Unix; - -namespace Stetic.Editor -{ - class ActionMenuBar: Gtk.MenuBar, IMenuItemContainer - { - ActionMenu openSubmenu; - ActionTree actionTree; - int dropPosition = -1; - int dropIndex; - ArrayList menuItems = new ArrayList (); - bool showPlaceholder; - Gtk.Widget addLabel; - Gtk.Widget spacerItem; - - public ActionMenuBar () - { - DND.DestSet (this, true); - } - - public void FillMenu (ActionTree actionTree) - { - addLabel = null; - - if (this.actionTree != null) { - this.actionTree.ChildNodeAdded -= OnChildAdded; - this.actionTree.ChildNodeRemoved -= OnChildRemoved; - } - - this.actionTree = actionTree; - if (actionTree == null) { - AddSpacerItem (); - return; - } - - actionTree.ChildNodeAdded += OnChildAdded; - actionTree.ChildNodeRemoved += OnChildRemoved; - - HideSpacerItem (); - menuItems.Clear (); - Widget wrapper = Widget.Lookup (this); - - foreach (Gtk.Widget w in Children) { - Remove (w); - w.Destroy (); - } - - foreach (ActionTreeNode node in actionTree.Children) { - ActionMenuItem aitem = new ActionMenuItem (wrapper, this, node); - AddItem (aitem, -1); - menuItems.Add (aitem); - } - - if (showPlaceholder) { - AddCreateItemLabel (); - } else if (actionTree.Children.Count == 0) { - // Give some height to the toolbar - AddSpacerItem (); - } - } - - public object SaveStatus () - { - ArrayList status = new ArrayList (); - - for (int n=0; n= menuItems.Count) - return; - - ActionMenuItem item = (ActionMenuItem) menuItems [pos]; - if (status.Count == 1) { - // The last position in the status is the selected item - item.Select (); - if (item.Node.Action != null && item.Node.Action.Name.Length == 0) { - // Then only case when there can have an action when an empty name - // is when the user clicked on the "add action" link. In this case, - // start editing the item again - item.EditingDone += OnEditingDone; - item.StartEditing (); - } - } else { - item.ShowSubmenu (); - if (OpenSubmenu != null) - OpenSubmenu.RestoreStatus (status, 1); - } - } - - void AddCreateItemLabel () - { - HideSpacerItem (); - Gtk.Label emptyLabel = new Gtk.Label (); - emptyLabel.Xalign = 0; - emptyLabel.Markup = "" + Catalog.GetString ("Click to create menu") + ""; - Gtk.MenuItem mit = new Gtk.MenuItem (); - mit.Child = emptyLabel; - mit.ButtonPressEvent += OnNewItemPress; - Insert (mit, -1); - mit.ShowAll (); - addLabel = mit; - } - - void AddSpacerItem () - { - if (spacerItem == null) { - Gtk.Label emptyLabel = new Gtk.Label (); - emptyLabel.Xalign = 0; - emptyLabel.Markup = "" + Catalog.GetString ("Empty menu bar") + ""; - Gtk.MenuItem mit = new Gtk.MenuItem (); - mit.Child = emptyLabel; - Insert (mit, -1); - spacerItem = mit; - ShowAll (); - } - } - - void HideSpacerItem () - { - if (spacerItem != null) { - Remove (spacerItem); - spacerItem = null; - } - } - - void AddItem (ActionMenuItem aitem, int pos) - { - Gtk.Table t = new Gtk.Table (1, 3, false); - aitem.Attach (t, 0, 0); - aitem.KeyPressEvent += OnItemKeyPress; - t.ShowAll (); - - CustomMenuBarItem it = new CustomMenuBarItem (); - it.ActionMenuItem = aitem; - aitem.Bind (it); - it.Child = t; - it.ShowAll (); - Insert (it, pos); - } - - public bool ShowInsertPlaceholder { - get { return showPlaceholder; } - set { - showPlaceholder = value; - if (value && addLabel == null) { - AddCreateItemLabel (); - } else if (!value && addLabel != null) { - Remove (addLabel); - addLabel = null; - if (menuItems.Count == 0) - AddSpacerItem (); - } - } - } - - public void Unselect () - { - // Unselects any selected item and hides any open submenu menu - Widget wrapper = Widget.Lookup (this); - if (OpenSubmenu != null) - OpenSubmenu.ResetSelection (); - IDesignArea area = wrapper.GetDesignArea (); - if (area != null) { - foreach (Gtk.Widget w in Children) { - CustomMenuBarItem it = w as CustomMenuBarItem; - if (it != null) - area.ResetSelection (it.ActionMenuItem); - } - } - OpenSubmenu = null; - } - - void OnChildAdded (object ob, ActionTreeNodeArgs args) - { - Refresh (); - } - - void OnChildRemoved (object ob, ActionTreeNodeArgs args) - { - OpenSubmenu = null; - - Widget wrapper = Widget.Lookup (this); - IDesignArea area = wrapper.GetDesignArea (); - IObjectSelection asel = area.GetSelection (); - ActionMenuItem curSel = asel != null ? asel.DataObject as ActionMenuItem : null; - int pos = menuItems.IndexOf (curSel); - - foreach (Gtk.Widget w in Children) { - if (w is CustomMenuBarItem && ((CustomMenuBarItem)w).ActionMenuItem.Node == args.Node) { - Remove (w); - menuItems.Remove (((CustomMenuBarItem)w).ActionMenuItem); - if (menuItems.Count == 0 && !showPlaceholder) - AddSpacerItem (); - break; - } - } - if (pos != -1 && pos < menuItems.Count) - ((ActionMenuItem)menuItems[pos]).Select (); - else if (menuItems.Count > 0) - ((ActionMenuItem)menuItems[menuItems.Count-1]).Select (); - } - - void Refresh () - { - Widget wrapper = Widget.Lookup (this); - IDesignArea area = wrapper.GetDesignArea (); - if (area == null) - return; - - ActionTreeNode selNode = null; - - foreach (Gtk.Widget w in Children) { - CustomMenuBarItem it = w as CustomMenuBarItem; - if (it != null && area.IsSelected (it.ActionMenuItem)) { - selNode = it.ActionMenuItem.Node; - area.ResetSelection (it.ActionMenuItem); - } - Remove (w); - } - - FillMenu (actionTree); - - if (selNode != null) { - ActionMenuItem mi = FindMenuItem (selNode); - if (mi != null) - mi.Select (); - } - } - - [GLib.ConnectBeforeAttribute] - void OnNewItemPress (object ob, Gtk.ButtonPressEventArgs args) - { - InsertAction (menuItems.Count); - args.RetVal = true; - } - - void InsertAction (int pos) - { - Widget wrapper = Widget.Lookup (this); - using (wrapper.UndoManager.AtomicChange) { - Wrapper.Action ac = (Wrapper.Action) ObjectWrapper.Create (wrapper.Project, new Gtk.Action ("", "", null, null)); - ActionTreeNode node = new ActionTreeNode (Gtk.UIManagerItemType.Menu, "", ac); - actionTree.Children.Insert (pos, node); - - ActionMenuItem aitem = FindMenuItem (node); - aitem.EditingDone += OnEditingDone; - aitem.Select (); - aitem.StartEditing (); - - if (wrapper.LocalActionGroups.Count == 0) - wrapper.LocalActionGroups.Add (new ActionGroup ("Default")); - wrapper.LocalActionGroups[0].Actions.Add (ac); - } - } - - void OnEditingDone (object ob, EventArgs args) - { - ActionMenuItem item = (ActionMenuItem) ob; - item.EditingDone -= OnEditingDone; - Widget wrapper = Widget.Lookup (this); - - if (item.Node.Action.GtkAction.Label.Length == 0 && item.Node.Action.GtkAction.StockId == null) { - IDesignArea area = wrapper.GetDesignArea (); - area.ResetSelection (item); - using (wrapper.UndoManager.AtomicChange) { - actionTree.Children.Remove (item.Node); - wrapper.LocalActionGroups [0].Actions.Remove (item.Node.Action); - } - } - } - - public void Select (ActionTreeNode node) - { - ActionMenuItem item = FindMenuItem (node); - if (item != null) - item.Select (); - } - - public void DropMenu (ActionTreeNode node) - { - ActionMenuItem item = FindMenuItem (node); - if (item != null) { - if (item.HasSubmenu) { - item.ShowSubmenu (); - if (openSubmenu != null) - openSubmenu.Select (null); - } - else - item.Select (); - } - } - - public ActionMenu OpenSubmenu { - get { return openSubmenu; } - set { - if (openSubmenu != null) { - openSubmenu.OpenSubmenu = null; - Widget wrapper = Widget.Lookup (this); - IDesignArea area = wrapper.GetDesignArea (); - if (area != null) - area.RemoveWidget (openSubmenu); - openSubmenu.Destroy (); - } - openSubmenu = value; - } - } - - bool IMenuItemContainer.IsTopMenu { - get { return true; } - } - - Gtk.Widget IMenuItemContainer.Widget { - get { return this; } - } - - protected override bool OnDragMotion (Gdk.DragContext context, int x, int y, uint time) - { - ActionPaletteItem dragItem = DND.DragWidget as ActionPaletteItem; - if (dragItem == null) - return false; - - if (actionTree.Children.Count > 0) { - ActionMenuItem item = LocateWidget (x, y); - if (item != null) { - Widget wrapper = Widget.Lookup (this); - - // Show the submenu to allow droping to it, but avoid - // droping a submenu inside itself - if (item.HasSubmenu && item.Node != dragItem.Node) - item.ShowSubmenu (wrapper.GetDesignArea(), item); - - // Look for the index where to insert the new item - dropIndex = actionTree.Children.IndexOf (item.Node); - int mpos = item.Allocation.X + item.Allocation.Width / 2; - if (x > mpos) - dropIndex++; - - // Calculate the drop position, used to show the drop bar - if (dropIndex == 0) - dropPosition = item.Allocation.X; - else if (dropIndex == menuItems.Count) - dropPosition = item.Allocation.Right; - else { - item = (ActionMenuItem) menuItems [dropIndex]; - ActionMenuItem prevItem = (ActionMenuItem) menuItems [dropIndex - 1]; - dropPosition = prevItem.Allocation.Right + (item.Allocation.X - prevItem.Allocation.Right)/2; - } - } - } else - dropIndex = 0; - - QueueDraw (); - return base.OnDragMotion (context, x, y, time); - } - - protected override void OnDragLeave (Gdk.DragContext context, uint time) - { - dropPosition = -1; - QueueDraw (); - base.OnDragLeave (context, time); - } - - protected override bool OnDragDrop (Gdk.DragContext context, int x, int y, uint time) - { - ActionPaletteItem dropped = DND.Drop (context, null, time) as ActionPaletteItem; - if (dropped == null) - return false; - - if (dropped.Node.Type != Gtk.UIManagerItemType.Menuitem && - dropped.Node.Type != Gtk.UIManagerItemType.Menu && - dropped.Node.Type != Gtk.UIManagerItemType.Toolitem && - dropped.Node.Type != Gtk.UIManagerItemType.Separator) - return false; - - ActionTreeNode newNode = dropped.Node; - if (dropped.Node.Type == Gtk.UIManagerItemType.Toolitem) { - newNode = newNode.Clone (); - newNode.Type = Gtk.UIManagerItemType.Menuitem; - } - - Widget wrapper = Widget.Lookup (this); - using (wrapper.UndoManager.AtomicChange) { - if (dropIndex < actionTree.Children.Count) { - // Do nothing if trying to drop the node over the same node - ActionTreeNode dropNode = actionTree.Children [dropIndex]; - if (dropNode == dropped.Node) - return false; - - if (newNode.ParentNode != null) - newNode.ParentNode.Children.Remove (newNode); - - // The drop position may have changed after removing the dropped node, - // so get it again. - dropIndex = actionTree.Children.IndexOf (dropNode); - actionTree.Children.Insert (dropIndex, newNode); - } else { - if (newNode.ParentNode != null) - newNode.ParentNode.Children.Remove (newNode); - actionTree.Children.Add (newNode); - dropIndex = actionTree.Children.Count - 1; - } - - // Select the dropped node - ActionMenuItem mi = (ActionMenuItem) menuItems [dropIndex]; - mi.Select (); - } - - return base.OnDragDrop (context, x, y, time); - } - protected override bool OnExposeEvent (Gdk.EventExpose ev) - { - bool r = base.OnExposeEvent (ev); - int w, h; - this.GdkWindow.GetSize (out w, out h); - if (dropPosition != -1) - GdkWindow.DrawRectangle (this.Style.BlackGC, true, dropPosition, 0, 3, h); - return r; - } - - void OnItemKeyPress (object s, Gtk.KeyPressEventArgs args) - { - int pos = menuItems.IndexOf (s); - ActionMenuItem item = (ActionMenuItem) s; - - switch (args.Event.Key) { - case Gdk.Key.Left: - if (pos > 0) - ((ActionMenuItem)menuItems[pos - 1]).Select (); - break; - case Gdk.Key.Right: - if (pos < menuItems.Count - 1) - ((ActionMenuItem)menuItems[pos + 1]).Select (); - else if (pos == menuItems.Count - 1) - InsertAction (menuItems.Count); - break; - case Gdk.Key.Down: - if (item.HasSubmenu) { - item.ShowSubmenu (); - if (openSubmenu != null) - openSubmenu.Select (null); - } - break; - case Gdk.Key.Up: - OpenSubmenu = null; - break; - } - args.RetVal = true; - } - - void InsertActionAt (ActionMenuItem item, bool after, bool separator) - { - int pos = menuItems.IndexOf (item); - if (pos == -1) - return; - - if (after) - pos++; - - if (separator) { - ActionTreeNode newNode = new ActionTreeNode (Gtk.UIManagerItemType.Separator, null, null); - actionTree.Children.Insert (pos, newNode); - } else - InsertAction (pos); - } - - void Paste (ActionMenuItem item) - { - } - - public void ShowContextMenu (ActionItem aitem) - { - ActionMenuItem menuItem = (ActionMenuItem) aitem; - - Gtk.Menu m = new Gtk.Menu (); - Gtk.MenuItem item = new Gtk.MenuItem (Catalog.GetString ("Insert Before")); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - InsertActionAt (menuItem, false, false); - }; - item = new Gtk.MenuItem (Catalog.GetString ("Insert After")); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - InsertActionAt (menuItem, true, false); - }; - - m.Add (new Gtk.SeparatorMenuItem ()); - - item = new Gtk.ImageMenuItem (Gtk.Stock.Cut, null); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - menuItem.Cut (); - }; - item.Visible = false; // No copy & paste for now - item = new Gtk.ImageMenuItem (Gtk.Stock.Copy, null); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - menuItem.Copy (); - }; - item.Visible = false; // No copy & paste for now - item = new Gtk.ImageMenuItem (Gtk.Stock.Paste, null); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - Paste (menuItem); - }; - item.Visible = false; // No copy & paste for now - item = new Gtk.ImageMenuItem (Gtk.Stock.Delete, null); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - menuItem.Delete (); - }; - m.ShowAll (); - m.Popup (); - } - - ActionMenuItem LocateWidget (int x, int y) - { - foreach (ActionMenuItem mi in menuItems) { - if (mi.Allocation.Contains (x, y)) - return mi; - } - return null; - } - - ActionMenuItem FindMenuItem (ActionTreeNode node) - { - foreach (ActionMenuItem mi in menuItems) { - if (mi.Node == node) - return mi; - } - return null; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionMenuItem.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionMenuItem.cs deleted file mode 100644 index 9ac08166b0f..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionMenuItem.cs +++ /dev/null @@ -1,588 +0,0 @@ - -using System; -using Stetic.Wrapper; -using Mono.Unix; - -namespace Stetic.Editor -{ - class ActionMenuItem: ActionItem - { - Gtk.Widget icon; - Gtk.Widget label; - Gtk.Widget accel; - bool motionDrag; - CustomMenuBarItem menuBarItem; - - static Gdk.Pixbuf addMenuImage; - static Gdk.Pixbuf removeMenuImage; - - public event MenuItemEditEventHandler EditingDone; - - static ActionMenuItem () - { - try { - addMenuImage = Gdk.Pixbuf.LoadFromResource ("add-menu.png"); - removeMenuImage = Gdk.Pixbuf.LoadFromResource ("remove-menu.png"); - } catch (Exception e) { - Console.WriteLine ("Error while loading pixbuf: " + e); - } - } - - internal ActionMenuItem (Widget wrapper, IMenuItemContainer parent, ActionTreeNode node) - : this (wrapper, parent, node, 0) - { - } - - internal ActionMenuItem (IDesignArea designArea, IProject project, IMenuItemContainer parent, ActionTreeNode node) - : this (null, parent, node, 6) - { - this.project = project; - this.designArea = designArea; - } - - internal ActionMenuItem (Widget wrapper, IMenuItemContainer parent, ActionTreeNode node, uint itemSpacing): base (node, parent, itemSpacing) - { - this.wrapper = wrapper; - CreateControls (); - } - - bool disposed; - - public override void Dispose () - { - if (disposed) - return; - disposed = true; - if (menuBarItem != null) { - menuBarItem.ButtonPressEvent -= OnMenuItemPress; - menuBarItem.ButtonReleaseEvent -= OnMemuItemRelease; - menuBarItem.MotionNotifyEvent -= OnMotionNotify; - } - if (node.Action != null) - node.Action.ObjectChanged -= OnActionChanged; - base.Dispose (); - } - - public bool HasSubmenu { - get { return node.Type == Gtk.UIManagerItemType.Menu; } - } - - public void StartEditing () - { - if (!editing) { - editing = true; - - Refresh (); - if (node.Type == Gtk.UIManagerItemType.Menu) - HideSubmenu (); - - UpdateSelectionStatus (); - } - } - - - protected override void EndEditing (Gdk.Key exitKey) - { - if (editing) { - Gtk.Entry entry = label as Gtk.Entry; - if (entry != null && exitKey != Gdk.Key.Escape) { - localUpdate = true; - if (entry.Text.Trim().Length > 0 || node.Action.GtkAction.StockId != null) { - using (node.Action.UndoManager.AtomicChange) { - node.Action.Label = entry.Text; - node.Action.NotifyChanged (); - } - } - localUpdate = false; - } - - editing = false; - Refresh (); - while (Gtk.Application.EventsPending ()) - Gtk.Application.RunIteration (); - if (node.Type == Gtk.UIManagerItemType.Menu) { - if (wrapper != null) { - IDesignArea area = wrapper.GetDesignArea (); - if (area != null) - ShowSubmenu (area, this); - } - } - GrabFocus (); - UpdateSelectionStatus (); - - if (EditingDone != null) { - MenuItemEditEventArgs args = new MenuItemEditEventArgs (); - args.ExitKey = exitKey; - EditingDone (this, args); - } - } - } - - public override void Select () - { - base.Select (); - - if (!IsSubmenuVisible) { - parentMenu.OpenSubmenu = null; - if (HasSubmenu) - ShowSubmenu (GetDesignArea (), this); - } - GrabFocus (); - } - - public void Attach (Gtk.Table table, uint row, uint col) - { - table.Attach (this, col, col + 3, row, row + 1); - Show (); - AttachChildren (table, row, col); - } - - void AttachChildren (Gtk.Table table, uint row, uint col) - { - if (icon != null) { - table.Attach (icon, col, col + 1, row, row + 1); - Gtk.Table.TableChild tc = (Gtk.Table.TableChild) table [icon]; - if (!editing) - tc.YPadding = itemSpacing; - } - if (label != null) { - table.Attach (label, col + 1, col + 2, row, row + 1); - Gtk.Table.TableChild tc = (Gtk.Table.TableChild) table [label]; - if (!editing) - tc.YPadding = itemSpacing; - label.GrabFocus (); - } - if (accel != null) - table.Attach (accel, col + 2, col + 3, row, row + 1); - - if (minWidth > 0 && label != null) { - if (label.SizeRequest().Width < minWidth) - label.WidthRequest = minWidth; - } - - bool sens = editing || node.Action == null || node.Action.GtkAction.Sensitive; - if (icon != null) - icon.Sensitive = sens; - if (label != null) - label.Sensitive = sens; - if (accel != null) - accel.Sensitive = sens; - } - - void CreateControls () - { - if (node.Type == Gtk.UIManagerItemType.Separator) { - Gtk.Widget sep; - if (parentMenu.IsTopMenu) { - sep = new Gtk.VSeparator (); - sep.WidthRequest = 6; - } else { - sep = new Gtk.HSeparator (); - sep.HeightRequest = 6; - } - Add (sep); - ShowAll (); - return; - } else { - if (Child != null && Child is Gtk.Separator) - Remove (Child); - } - - if (node.Action == null) - return; - - bool isGlobal = wrapper != null && wrapper.Project.ActionGroups.IndexOf (node.Action.ActionGroup) != -1; - - Gtk.Action gaction = node.Action.GtkAction; - bool barItem = parentMenu.IsTopMenu; - - string text = gaction.Label; - string stock = gaction.StockId; - - if (barItem) { - icon = null; - } else if (node.Action.Type == Stetic.Wrapper.Action.ActionType.Radio) { - icon = new CheckActionIcon (true, node.Action.Active); - } else if (node.Action.Type == Stetic.Wrapper.Action.ActionType.Toggle) { - icon = new CheckActionIcon (node.Action.DrawAsRadio, node.Action.Active); - } - - if (stock != null) { - Gtk.StockItem item = Gtk.Stock.Lookup (stock); - if (text == null || text.Length == 0) - text = item.Label; - - if (item.Keyval != 0 && !editing && !barItem) { - Gtk.Label lac = new Gtk.Label (); - string accelName = Gtk.Accelerator.Name (item.Keyval, item.Modifier).ToUpper (); - accelName = accelName.Replace ("", "Ctrl+"); - accelName = accelName.Replace ("", "Shift+"); - accelName = accelName.Replace ("", "Alt+"); - lac.Text = accelName; - accel = lac; - } - - if (icon == null && !barItem) - icon = node.Action.CreateIcon (Gtk.IconSize.Menu); - } - - if (editing && !isGlobal) { - if (!barItem) { - Gtk.HBox bbox = new Gtk.HBox (); - if (icon != null) { - bbox.PackStart (icon, false, false, 0); - } - bbox.PackStart (new Gtk.Arrow (Gtk.ArrowType.Down, Gtk.ShadowType.In), false, false, 0); - Gtk.Button b = new Gtk.Button (bbox); - b.TooltipText = Catalog.GetString ("Select action type"); - b.Relief = Gtk.ReliefStyle.None; - b.ButtonPressEvent += OnSelectIcon; - icon = b; - } else - icon = null; - - Gtk.Entry entry = new Gtk.Entry (); - entry.Text = text; - entry.Activated += OnLabelActivated; - entry.KeyPressEvent += OnEntryKeyPress; - entry.HasFrame = false; - this.label = entry; - entry.TooltipText = Catalog.GetString ("Action label"); - } else { - Gtk.Label label = new Gtk.Label (text); - label.Xalign = 0; - this.label = label; - } - - if (editing && wrapper != null) { - // Add a button for creating / deleting a submenu - Gdk.Pixbuf img; - string tip; - if (node.Type != Gtk.UIManagerItemType.Menu) { - img = addMenuImage; - tip = Catalog.GetString ("Add submenu (Ctrl+Right)"); - } else { - img = removeMenuImage; - tip = Catalog.GetString ("Remove submenu (Ctrl+Left)"); - } - - Gtk.Button sb = new Gtk.Button (new Gtk.Image (img)); - sb.TooltipText = tip; - sb.Relief = Gtk.ReliefStyle.None; - sb.Clicked += OnCreateDeleteSubmenu; - - // Make sure the button is alligned to the right of the column - Gtk.HBox bbox = new Gtk.HBox (); - bbox.PackEnd (sb, false, false, 0); - accel = bbox; - } - - - if (node.Type == Gtk.UIManagerItemType.Menu && !editing && !barItem) { - Gtk.Arrow arrow = new Gtk.Arrow (Gtk.ArrowType.Right, Gtk.ShadowType.None); - arrow.Xalign = 1; - this.accel = arrow; - } - - if (itemSpacing > 0 && icon != null) { - // Add some padding to the left of the icon - Gtk.Alignment a = new Gtk.Alignment (0, 0.5f, 0, 0); - a.LeftPadding = itemSpacing; - a.Add (icon); - icon = a; - } - } - - public void Detach () - { - if (disposed) - return; - - Gtk.Table table = (Gtk.Table)Parent; - if (table == null) - return; - if (icon != null) - table.Remove (icon); - if (label != null) - table.Remove (label); - if (accel != null) - table.Remove (accel); - table.Remove (this); - } - - void OnCreateDeleteSubmenu (object ob, EventArgs args) - { - using (node.Action.UndoManager.AtomicChange) { - if (node.Type == Gtk.UIManagerItemType.Menu) { - node.Type = Gtk.UIManagerItemType.Menuitem; - node.Children.Clear (); - } else { - node.Type = Gtk.UIManagerItemType.Menu; - } - - EndEditing (Gdk.Key.Return); - node.Action.NotifyChanged (); - } - } - - void OnLabelActivated (object ob, EventArgs args) - { - EndEditing (Gdk.Key.Return); - } - - [GLib.ConnectBefore] - void OnEntryKeyPress (object ob, Gtk.KeyPressEventArgs args) - { - switch (args.Event.Key) { - case Gdk.Key.Down: - case Gdk.Key.Escape: - case Gdk.Key.Up: - EndEditing (args.Event.Key); - args.RetVal = true; - break; - } - args.RetVal = false; - } - - [GLib.ConnectBeforeAttribute] - void OnSelectIcon (object sender, Gtk.ButtonPressEventArgs e) - { - Gtk.Menu menu = new Gtk.Menu (); - - Gtk.CheckMenuItem item = new Gtk.CheckMenuItem (Catalog.GetString ("Action")); - item.DrawAsRadio = true; - item.Active = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Action); - item.Activated += OnSetActionType; - menu.Insert (item, -1); - - item = new Gtk.CheckMenuItem (Catalog.GetString ("Radio Action")); - item.DrawAsRadio = true; - item.Active = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Radio); - item.Activated += OnSetRadioType; - menu.Insert (item, -1); - - item = new Gtk.CheckMenuItem (Catalog.GetString ("Toggle Action")); - item.DrawAsRadio = true; - item.Active = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Toggle); - item.Activated += OnSetToggleType; - menu.Insert (item, -1); - - menu.Insert (new Gtk.SeparatorMenuItem (), -1); - - Gtk.MenuItem itIcons = new Gtk.MenuItem (Catalog.GetString ("Select Icon")); - menu.Insert (itIcons, -1); - IconSelectorMenu menuIcons = new IconSelectorMenu (GetProject ()); - menuIcons.IconSelected += OnStockSelected; - itIcons.Submenu = menuIcons; - - Gtk.MenuItem it = new Gtk.MenuItem (Catalog.GetString ("Clear Icon")); - it.Sensitive = (node.Action.GtkAction.StockId != null); - it.Activated += OnClearIcon; - menu.Insert (it, -1); - - menu.ShowAll (); - menu.Popup (null, null, new Gtk.MenuPositionFunc (OnDropMenuPosition), 3, Gtk.Global.CurrentEventTime); - e.RetVal = false; - } - - void OnDropMenuPosition (Gtk.Menu menu, out int x, out int y, out bool pushIn) - { - this.ParentWindow.GetOrigin (out x, out y); - x += this.Allocation.X; - y += this.Allocation.Y + this.Allocation.Height; - pushIn = true; - } - - void OnStockSelected (object s, IconEventArgs args) - { - using (node.Action.UndoManager.AtomicChange) { - node.Action.StockId = args.IconId; - node.Action.NotifyChanged (); - } - } - - void OnSetToggleType (object ob, EventArgs args) - { - using (node.Action.UndoManager.AtomicChange) { - node.Action.Type = Stetic.Wrapper.Action.ActionType.Toggle; - node.Action.NotifyChanged (); - } - } - - void OnSetRadioType (object ob, EventArgs args) - { - using (node.Action.UndoManager.AtomicChange) { - node.Action.Type = Stetic.Wrapper.Action.ActionType.Radio; - node.Action.NotifyChanged (); - } - } - - void OnSetActionType (object ob, EventArgs args) - { - using (node.Action.UndoManager.AtomicChange) { - node.Action.Type = Stetic.Wrapper.Action.ActionType.Action; - node.Action.NotifyChanged (); - } - } - - void OnClearIcon (object on, EventArgs args) - { - using (node.Action.UndoManager.AtomicChange) { - node.Action.StockId = null; - node.Action.NotifyChanged (); - } - } - - public override void Refresh () - { - Gtk.Table table = (Gtk.Table)Parent; - if (table == null) - return; - - if (icon != null && icon.Parent != null) - table.Remove (icon); - if (label != null && label.Parent != null) - table.Remove (label); - if (accel != null && accel.Parent != null) - table.Remove (accel); - - icon = label = accel = null; - CreateControls (); - Gtk.Table.TableChild tc = (Gtk.Table.TableChild)table[this]; - AttachChildren (table, tc.TopAttach, tc.LeftAttach); - - table.ShowAll (); - } - - internal void Bind (CustomMenuBarItem item) - { - // When embedding the action menu in a MenuBar, - // the parent menu item intercepts the mouse events, - // so those events must be manually bound here - menuBarItem = item; - item.ButtonPressEvent += OnMenuItemPress; - item.ButtonReleaseEvent += OnMemuItemRelease; - item.MotionNotifyEvent += OnMotionNotify; - } - - [GLib.ConnectBeforeAttribute] - void OnMenuItemPress (object ob, Gtk.ButtonPressEventArgs args) - { - Gtk.Widget mit = (Gtk.Widget) ob; - if (wrapper != null && wrapper.Project.Selection != mit.Parent) { - wrapper.Select (); - args.RetVal = true; - return; - } - motionDrag = true; - args.RetVal = ProcessButtonPress (args.Event); - } - - [GLib.ConnectBeforeAttribute] - void OnMemuItemRelease (object ob, Gtk.ButtonReleaseEventArgs args) - { - args.RetVal = ProcessButtonRelease (args.Event); - motionDrag = false; - } - - void OnMotionNotify (object ob, Gtk.MotionNotifyEventArgs args) - { - if (motionDrag) { - // Looks like drag begin can be intercepted, so the motion notify - // has to be used. - ProcessDragBegin (null, args.Event); - motionDrag = false; - } - } - - protected override bool OnButtonReleaseEvent (Gdk.EventButton ev) - { - return ProcessButtonRelease (ev); - } - - public bool ProcessButtonRelease (Gdk.EventButton ev) - { - // Clicking a selected item starts the edit mode - if (editOnRelease) - StartEditing (); - - editOnRelease = false; - return true; - } - - public override void ProcessDragBegin (Gdk.DragContext ctx, Gdk.EventMotion evt) - { - if (HasSubmenu) - HideSubmenu (); - base.ProcessDragBegin (ctx, evt); - } - - void OnActionChanged (object ob, ObjectWrapperEventArgs a) - { - if (!localUpdate) - Refresh (); - } - - public bool IsSubmenuVisible { - get { - ActionMenu menu = parentMenu.OpenSubmenu; - return (menu != null && menu.ParentNode == node); - } - } - - public void ShowSubmenu () - { - ShowSubmenu (wrapper.GetDesignArea (), this); - } - - public void ShowSubmenu (IDesignArea area, Gtk.Widget refWidget) - { - HideSubmenu (); - Gdk.Rectangle rect = area.GetCoordinates (refWidget); - ActionMenu menu = new ActionMenu (wrapper, parentMenu, node); - menu.ShowAll (); - area.AddWidget (menu, rect.Right, rect.Top); - menu.TrackWidgetPosition (refWidget, parentMenu.IsTopMenu); - - parentMenu.OpenSubmenu = menu; - } - - void HideSubmenu () - { - parentMenu.OpenSubmenu = null; - } - } - - class CheckActionIcon: Gtk.EventBox - { - readonly bool isRadio; - readonly bool active; - - public CheckActionIcon (bool isRadio, bool active) - { - this.isRadio = isRadio; - this.active = active; - WidthRequest = HeightRequest = 16; - } - - protected override bool OnExposeEvent (Gdk.EventExpose ev) - { - Gdk.Rectangle rect = Allocation; - rect.X = rect.Y = 0; - - Gtk.ShadowType sh = active ? Gtk.ShadowType.In : Gtk.ShadowType.Out; - if (isRadio) - Gtk.Style.PaintOption (this.Style, this.GdkWindow, this.State, sh, rect, this, "", rect.X, rect.Y, rect.Width, rect.Height); - else - Gtk.Style.PaintCheck (this.Style, this.GdkWindow, this.State, sh, rect, this, "", rect.X, rect.Y, rect.Width, rect.Height); - return true; - } - } - - delegate void MenuItemEditEventHandler (object s, MenuItemEditEventArgs args); - - class MenuItemEditEventArgs: EventArgs - { - public Gdk.Key ExitKey; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionToolItem.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionToolItem.cs deleted file mode 100644 index b0372cda879..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionToolItem.cs +++ /dev/null @@ -1,371 +0,0 @@ - -using System; -using Stetic.Wrapper; -using Mono.Unix; - -namespace Stetic.Editor -{ - class ActionToolItem: ActionItem - { - ActionToolbar parentToolbar; - - bool motionDrag; - bool showingText; - Gtk.Widget dropButton; - - public event EventHandler EditingDone; - - internal ActionToolItem (Widget wrapper, ActionToolbar parent, ActionTreeNode node) - : this (wrapper, parent, node, 0) - { - } - - internal ActionToolItem (Widget wrapper, ActionToolbar parent, ActionTreeNode node, uint itemSpacing): base (node, parent, itemSpacing) - { - this.parentToolbar = parent; - this.wrapper = wrapper; - CreateControls (); - } - - public void StartEditing (bool doClick) - { - if (!editing && node.Action != null) { - // Don't allow efiting global actions - if (wrapper != null && wrapper.Project.ActionGroups.IndexOf (node.Action.ActionGroup) != -1) - return; - editing = true; - Refresh (); - - if (doClick && dropButton != null) { - // Make sure the dropButton is properly shown - while (Gtk.Application.EventsPending ()) - Gtk.Application.RunIteration (); - OnSelectIcon (null, null); - } - } - } - - protected override void EndEditing (Gdk.Key exitKey) - { - if (editing) { - editing = false; - Refresh (); - while (Gtk.Application.EventsPending ()) - Gtk.Application.RunIteration (); - GrabFocus (); - if (EditingDone != null) - EditingDone (this, EventArgs.Empty); - } - } - - void CreateControls () - { - Gtk.Widget icon = null; - Gtk.Widget label = null; - dropButton = null; - - if (Child != null) { - Gtk.Widget w = Child; - Remove (w); - w.Destroy (); - } - - if (node.Type == Gtk.UIManagerItemType.Separator) { - Gtk.Widget sep; - if (parentToolbar.Orientation == Gtk.Orientation.Horizontal) { - sep = new Gtk.VSeparator (); - } else { - sep = new Gtk.HSeparator (); - } - Gtk.HBox box = new Gtk.HBox (); - box.BorderWidth = 6; - box.PackStart (sep, true, true, 0); - Add (box); - return; - } - - if (node.Action == null) - return; - - Gtk.Action gaction = node.Action.GtkAction; - - bool showText = parentToolbar.ToolbarStyle == Gtk.ToolbarStyle.Text; - bool showIcon = parentToolbar.ToolbarStyle == Gtk.ToolbarStyle.Icons; - if (parentToolbar.ToolbarStyle == Gtk.ToolbarStyle.Both) { - showText = showIcon = true; - } - else if (parentToolbar.ToolbarStyle == Gtk.ToolbarStyle.BothHoriz) { - showText = parentToolbar.Orientation == Gtk.Orientation.Vertical || gaction.IsImportant; - showIcon = true; - } - - string text = node.Action.ToolLabel; - showingText = showText; - - if (showIcon) - { - if (gaction.StockId != null) { - icon = node.Action.CreateIcon (parentToolbar.IconSize); - } else if (!gaction.IsImportant) { - icon = CreateFakeItem (); - } - } - - if (editing) { - Gtk.HBox bbox = new Gtk.HBox (); - bbox.Spacing = 3; - if (icon != null) { - bbox.PackStart (icon, false, false, 0); - } - bbox.PackStart (new Gtk.Arrow (Gtk.ArrowType.Down, Gtk.ShadowType.In), false, false, 0); - Gtk.Button b = new Gtk.Button (bbox); - b.TooltipText = Catalog.GetString ("Select action type"); - b.Relief = Gtk.ReliefStyle.None; - b.ButtonPressEvent += OnSelectIcon; - dropButton = b; - icon = b; - - if (showText) { - Gtk.Entry entry = new Gtk.Entry (); - entry.Text = text; - entry.Changed += OnLabelChanged; - entry.Activated += OnLabelActivated; - entry.HasFrame = false; - label = entry; - entry.TooltipText = Catalog.GetString ("Action label"); - } - } else if (showText && text != null && text.Length > 0) { - label = new Gtk.Label (text); - label.Sensitive = editing || node.Action == null || node.Action.GtkAction.Sensitive; - } - - if (icon != null && label != null) { - if (parentToolbar.ToolbarStyle == Gtk.ToolbarStyle.BothHoriz) { - Gtk.HBox box = new Gtk.HBox (); - box.PackStart (icon, false, false, 0); - box.PackStart (label, true, true, 0); - icon = box; - } else if (parentToolbar.ToolbarStyle == Gtk.ToolbarStyle.Both) { - Gtk.VBox box = new Gtk.VBox (); - Gtk.Alignment al = new Gtk.Alignment (0.5f, 0f, 0f, 0f); - al.Add (icon); - box.PackStart (al, false, false, 0); - box.PackStart (label, true, true, 0); - icon = box; - } - } else if (label != null) { - icon = label; - } - - if (icon == null) { - icon = CreateFakeItem (); - } - - icon.Sensitive = editing || node.Action == null || node.Action.GtkAction.Sensitive; - - if (!editing) { - Gtk.Button but = new Gtk.Button (icon); - but.Relief = Gtk.ReliefStyle.None; - but.ButtonPressEvent += OnToolItemPress; - but.ButtonReleaseEvent += OnMemuItemRelease; - but.MotionNotifyEvent += OnMotionNotify; - but.Events |= Gdk.EventMask.PointerMotionMask; - icon = but; - } - - Add (icon); - - ShowAll (); - } - - Gtk.Widget CreateFakeItem () - { - Gtk.Frame frm = new Gtk.Frame (); - frm.ShadowType = Gtk.ShadowType.Out; - int w, h; - Gtk.Icon.SizeLookup (parentToolbar.IconSize, out w, out h); - frm.WidthRequest = w; - frm.HeightRequest = h; - return frm; - } - - void OnLabelChanged (object ob, EventArgs args) - { - localUpdate = true; - - Gtk.Entry entry = ob as Gtk.Entry; - if (entry.Text.Length > 0 || node.Action.GtkAction.StockId != null) { - using (node.Action.UndoManager.AtomicChange) { - node.Action.Label = entry.Text; - node.Action.NotifyChanged (); - } - } - localUpdate = false; - } - - void OnLabelActivated (object ob, EventArgs args) - { - EndEditing (Gdk.Key.Return); - } - - [GLib.ConnectBeforeAttribute] - void OnSelectIcon (object s, Gtk.ButtonPressEventArgs args) - { - Gtk.Menu menu = new Gtk.Menu (); - - Gtk.CheckMenuItem item = new Gtk.CheckMenuItem (Catalog.GetString ("Action")); - item.DrawAsRadio = true; - item.Active = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Action); - item.Activated += OnSetActionType; - menu.Insert (item, -1); - - item = new Gtk.CheckMenuItem (Catalog.GetString ("Radio Action")); - item.DrawAsRadio = true; - item.Active = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Radio); - item.Activated += OnSetRadioType; - menu.Insert (item, -1); - - item = new Gtk.CheckMenuItem (Catalog.GetString ("Toggle Action")); - item.DrawAsRadio = true; - item.Active = (node.Action.Type == Stetic.Wrapper.Action.ActionType.Toggle); - item.Activated += OnSetToggleType; - menu.Insert (item, -1); - - menu.Insert (new Gtk.SeparatorMenuItem (), -1); - - Gtk.MenuItem itIcons = new Gtk.MenuItem (Catalog.GetString ("Select Icon")); - menu.Insert (itIcons, -1); - IconSelectorMenu menuIcons = new IconSelectorMenu (GetProject ()); - menuIcons.IconSelected += OnStockSelected; - itIcons.Submenu = menuIcons; - - Gtk.MenuItem it = new Gtk.MenuItem (Catalog.GetString ("Clear Icon")); - it.Sensitive = (node.Action.GtkAction.StockId != null); - it.Activated += OnClearIcon; - menu.Insert (it, -1); - - menu.ShowAll (); - - uint but = args != null ? args.Event.Button : 1; - menu.Popup (null, null, new Gtk.MenuPositionFunc (OnDropMenuPosition), but, Gtk.Global.CurrentEventTime); - - // Make sure we get the focus after closing the menu, so we can keep browsing buttons - // using the keyboard. - menu.Hidden += delegate (object sender, EventArgs a) { - GrabFocus (); - }; - - if (args != null) - args.RetVal = false; - } - - void OnDropMenuPosition (Gtk.Menu menu, out int x, out int y, out bool pushIn) - { - dropButton.ParentWindow.GetOrigin (out x, out y); - x += dropButton.Allocation.X; - y += dropButton.Allocation.Y + dropButton.Allocation.Height; - pushIn = true; - } - - void OnSetToggleType (object ob, EventArgs args) - { - using (node.Action.UndoManager.AtomicChange) { - node.Action.Type = Stetic.Wrapper.Action.ActionType.Toggle; - node.Action.NotifyChanged (); - } - } - - void OnSetRadioType (object ob, EventArgs args) - { - using (node.Action.UndoManager.AtomicChange) { - node.Action.Type = Stetic.Wrapper.Action.ActionType.Radio; - node.Action.NotifyChanged (); - } - } - - void OnSetActionType (object ob, EventArgs args) - { - using (node.Action.UndoManager.AtomicChange) { - node.Action.Type = Stetic.Wrapper.Action.ActionType.Action; - node.Action.NotifyChanged (); - } - } - - void OnStockSelected (object s, IconEventArgs args) - { - using (node.Action.UndoManager.AtomicChange) { - node.Action.StockId = args.IconId; - node.Action.NotifyChanged (); - } - } - - void OnClearIcon (object on, EventArgs args) - { - using (node.Action.UndoManager.AtomicChange) { - node.Action.StockId = null; - node.Action.NotifyChanged (); - } - } - - public override void Refresh () - { - CreateControls (); - } - - [GLib.ConnectBeforeAttribute] - void OnToolItemPress (object ob, Gtk.ButtonPressEventArgs args) - { - if (wrapper != null && wrapper.Project.Selection != wrapper.Wrapped) { - wrapper.Select (); - args.RetVal = true; - return; - } - if (args.Event.Button == 1 && !GtkWorkarounds.TriggersContextMenu (args.Event)) - motionDrag = true; - args.RetVal = ProcessButtonPress (args.Event); - } - - [GLib.ConnectBeforeAttribute] - void OnMemuItemRelease (object ob, Gtk.ButtonReleaseEventArgs args) - { - args.RetVal = ProcessButtonRelease (args.Event); - motionDrag = false; - } - - [GLib.ConnectBeforeAttribute] - void OnMotionNotify (object ob, Gtk.MotionNotifyEventArgs args) - { - if (motionDrag) { - // Looks like drag begin can be intercepted, so the motion notify - // has to be used. - ProcessDragBegin (null, args.Event); - motionDrag = false; - } - } - - protected override bool OnButtonReleaseEvent (Gdk.EventButton ev) - { - return ProcessButtonRelease (ev); - } - - public bool ProcessButtonRelease (Gdk.EventButton ev) - { - // Clicking a selected item starts the edit mode - if (editOnRelease) { - StartEditing (!showingText); - } - - editOnRelease = false; - return true; - } - - protected override bool OnKeyPressEvent (Gdk.EventKey e) - { - if (e.Key == Gdk.Key.Return) - EndEditing (Gdk.Key.Return); - else if (e.Key == Gdk.Key.Escape) - EndEditing (Gdk.Key.Escape); - return base.OnKeyPressEvent (e); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionToolbar.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionToolbar.cs deleted file mode 100644 index ee497b40a89..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ActionToolbar.cs +++ /dev/null @@ -1,540 +0,0 @@ - -using System; -using System.Xml; -using System.Collections; -using Stetic.Wrapper; -using Mono.Unix; - -namespace Stetic.Editor -{ - class ActionToolbar: Gtk.Toolbar, IMenuItemContainer - { - ActionTree actionTree; - int dropPosition = -1; - int dropIndex; - ArrayList toolItems = new ArrayList (); - bool showPlaceholder = true; - Gtk.Widget addLabel; - Gtk.Widget spacerItem; - - public ActionToolbar () - { - DND.DestSet (this, true); - this.ShowArrow = false; - } - - public void FillMenu (ActionTree actionTree) - { - addLabel = null; - - if (this.actionTree != null) { - this.actionTree.ChildNodeAdded -= OnChildAdded; - this.actionTree.ChildNodeRemoved -= OnChildRemoved; - } - - this.actionTree = actionTree; - if (actionTree == null) { - AddSpacerItem (); - return; - } - - actionTree.ChildNodeAdded += OnChildAdded; - actionTree.ChildNodeRemoved += OnChildRemoved; - - HideSpacerItem (); - toolItems.Clear (); - Widget wrapper = Stetic.Wrapper.Widget.Lookup (this); - - foreach (Gtk.Widget w in Children) { - Remove (w); - w.Destroy (); - } - - foreach (ActionTreeNode node in actionTree.Children) { - ActionToolItem aitem = new ActionToolItem (wrapper, this, node); - AddItem (aitem, -1); - toolItems.Add (aitem); - } - - if (actionTree.Children.Count == 0) { - // If there are no buttons in the toolbar, give it some height so it is selectable. - AddSpacerItem (); - } - - if (showPlaceholder) { - AddCreateItemLabel (); - } - } - - void AddCreateItemLabel () - { - HideSpacerItem (); - Gtk.EventBox ebox = new Gtk.EventBox (); - ebox.VisibleWindow = false; - Gtk.Label emptyLabel = new Gtk.Label (); - emptyLabel.Xalign = 0; - if (this.Orientation == Gtk.Orientation.Vertical) - emptyLabel.Markup = "" + Catalog.GetString ("New\nbutton") + ""; - else - emptyLabel.Markup = "" + Catalog.GetString ("New button") + ""; - ebox.BorderWidth = 3; - ebox.Add (emptyLabel); - Gtk.ToolItem mit = new Gtk.ToolItem (); - mit.Child = ebox; - ebox.ButtonPressEvent += OnNewItemPress; - Insert (mit, -1); - mit.ShowAll (); - addLabel = mit; - } - - void AddSpacerItem () - { - if (spacerItem == null) { - Gtk.ToolItem tb = new Gtk.ToolItem (); - Gtk.Label emptyLabel = new Gtk.Label (); - emptyLabel.Xalign = 0; - emptyLabel.Xpad = 3; - emptyLabel.Ypad = 3; - if (this.Orientation == Gtk.Orientation.Vertical) - emptyLabel.Markup = "" + Catalog.GetString ("Empty\ntoolbar") + ""; - else - emptyLabel.Markup = "" + Catalog.GetString ("Empty toolbar") + ""; - tb.Child = emptyLabel; - Insert (tb, -1); - ShowAll (); - spacerItem = tb; - } - } - - void HideSpacerItem () - { - if (spacerItem != null) { - Remove (spacerItem); - spacerItem = null; - } - } - - void AddItem (ActionToolItem aitem, int pos) - { - aitem.KeyPressEvent += OnItemKeyPress; - - CustomToolbarItem it = new CustomToolbarItem (); - it.ActionToolItem = aitem; - it.Child = aitem; - it.ShowAll (); - Insert (it, pos); - } - - public bool ShowInsertPlaceholder { - get { return showPlaceholder; } - set { - showPlaceholder = value; - if (value && addLabel == null) { - AddCreateItemLabel (); - } else if (!value && addLabel != null) { - Remove (addLabel); - addLabel.Destroy (); - addLabel = null; - if (actionTree.Children.Count == 0) - AddSpacerItem (); - } - } - } - - public Stetic.Editor.ActionMenu OpenSubmenu { - get { return null; } - set { } - } - - public bool IsTopMenu { - get { return true; } - } - - public Gtk.Widget Widget { - get { return this; } - } - - public void Unselect () - { - // Unselects any selected item - Widget wrapper = Stetic.Wrapper.Widget.Lookup (this); - IDesignArea area = wrapper.GetDesignArea (); - if (area != null) { - foreach (Gtk.Widget w in Children) { - CustomToolbarItem it = w as CustomToolbarItem; - if (it != null) - area.ResetSelection (it.ActionToolItem); - } - } - } - - void OnChildAdded (object ob, ActionTreeNodeArgs args) - { - Refresh (); - } - - void OnChildRemoved (object ob, ActionTreeNodeArgs args) - { - Widget wrapper = Stetic.Wrapper.Widget.Lookup (this); - IDesignArea area = wrapper.GetDesignArea (); - IObjectSelection asel = area.GetSelection (); - ActionToolItem curSel = asel != null ? asel.DataObject as ActionToolItem : null; - int pos = toolItems.IndexOf (curSel); - - foreach (Gtk.Widget w in Children) { - if (w is CustomToolbarItem && ((CustomToolbarItem)w).ActionToolItem.Node == args.Node) { - Remove (w); - toolItems.Remove (((CustomToolbarItem)w).ActionToolItem); - w.Destroy (); - if (!showPlaceholder && toolItems.Count == 0) - AddSpacerItem (); - break; - } - } - - if (pos != -1 && pos < toolItems.Count) - ((ActionToolItem)toolItems[pos]).Select (); - else if (toolItems.Count > 0) - ((ActionToolItem)toolItems[toolItems.Count-1]).Select (); - } - - void Refresh () - { - Widget wrapper = Stetic.Wrapper.Widget.Lookup (this); - IDesignArea area = wrapper.GetDesignArea (); - if (area == null) - return; - - ActionTreeNode selNode = null; - - foreach (Gtk.Widget w in Children) { - CustomToolbarItem it = w as CustomToolbarItem; - if (it != null && area.IsSelected (it.ActionToolItem)) { - selNode = it.ActionToolItem.Node; - area.ResetSelection (it.ActionToolItem); - } - Remove (w); - w.Destroy (); - } - - FillMenu (actionTree); - - if (selNode != null) { - ActionToolItem mi = FindMenuItem (selNode); - if (mi != null) - mi.Select (); - } - } - - [GLib.ConnectBeforeAttribute] - void OnNewItemPress (object ob, Gtk.ButtonPressEventArgs args) - { - InsertAction (toolItems.Count); - args.RetVal = true; - } - - void InsertAction (int pos) - { - Widget wrapper = Stetic.Wrapper.Widget.Lookup (this); - using (wrapper.UndoManager.AtomicChange) { - Wrapper.Action ac = (Wrapper.Action) ObjectWrapper.Create (wrapper.Project, new Gtk.Action ("", "", null, null)); - ActionTreeNode node = new ActionTreeNode (Gtk.UIManagerItemType.Toolitem, "", ac); - actionTree.Children.Insert (pos, node); - - ActionToolItem aitem = FindMenuItem (node); - aitem.EditingDone += OnEditingDone; - aitem.Select (); - aitem.StartEditing (false); - //ShowInsertPlaceholder = false; - - if (wrapper.LocalActionGroups.Count == 0) - wrapper.LocalActionGroups.Add (new ActionGroup ("Default")); - wrapper.LocalActionGroups[0].Actions.Add (ac); - } - } - - void OnEditingDone (object ob, EventArgs args) - { - Widget wrapper = Stetic.Wrapper.Widget.Lookup (this); - if (wrapper == null) - return; - - IDesignArea area = wrapper.GetDesignArea (); - if (area == null) // The toolbar may be disposed before ending editing - return; - - ActionToolItem item = (ActionToolItem) ob; - item.EditingDone -= OnEditingDone; - - if (item.Node.Action.GtkAction.Label.Length == 0 && item.Node.Action.GtkAction.StockId == null) { - area.ResetSelection (item); - using (wrapper.UndoManager.AtomicChange) { - actionTree.Children.Remove (item.Node); - wrapper.LocalActionGroups [0].Actions.Remove (item.Node.Action); - } - } - } - - public void Select (ActionTreeNode node) - { - ActionToolItem item = FindMenuItem (node); - if (item != null) - item.Select (); - } - - protected override bool OnDragMotion (Gdk.DragContext context, int x, int y, uint time) - { - ActionPaletteItem dragItem = DND.DragWidget as ActionPaletteItem; - if (dragItem == null) - return false; - - x += Allocation.X; - y += Allocation.Y; - - if (actionTree.Children.Count > 0) { - ActionToolItem item = LocateWidget (x, y); - if (item != null) { - // Look for the index where to insert the new item - dropIndex = actionTree.Children.IndexOf (item.Node); - int spos = (Orientation == Gtk.Orientation.Horizontal) ? x : y; - int mpos = GetButtonPos (item) + GetButtonSize (item) / 2; - if (spos > mpos) - dropIndex++; - - // Calculate the drop position, used to show the drop bar - if (dropIndex == 0) - dropPosition = GetButtonPos (item); - else if (dropIndex == toolItems.Count) - dropPosition = GetButtonEndPos (item); - else { - item = (ActionToolItem) toolItems [dropIndex]; - ActionToolItem prevItem = (ActionToolItem) toolItems [dropIndex - 1]; - dropPosition = GetButtonEndPos (prevItem) + (GetButtonPos (item) - GetButtonEndPos (prevItem))/2; - } - } - } else - dropIndex = 0; - - QueueDraw (); - return base.OnDragMotion (context, x, y, time); - } - - int GetButtonPos (Gtk.Widget w) - { - return (Orientation == Gtk.Orientation.Horizontal) ? w.Allocation.X : w.Allocation.Y; - } - - int GetButtonEndPos (Gtk.Widget w) - { - return (Orientation == Gtk.Orientation.Horizontal) ? w.Allocation.Right : w.Allocation.Bottom; - } - - int GetButtonSize (Gtk.Widget w) - { - return (Orientation == Gtk.Orientation.Horizontal) ? w.Allocation.Width : w.Allocation.Height; - } - - protected override void OnDragLeave (Gdk.DragContext context, uint time) - { - dropPosition = -1; - QueueDraw (); - base.OnDragLeave (context, time); - } - - protected override bool OnDragDrop (Gdk.DragContext context, int x, int y, uint time) - { - ActionPaletteItem dropped = DND.Drop (context, null, time) as ActionPaletteItem; - if (dropped == null) - return false; - - if (dropped.Node.Type != Gtk.UIManagerItemType.Menuitem && - dropped.Node.Type != Gtk.UIManagerItemType.Toolitem && - dropped.Node.Type != Gtk.UIManagerItemType.Separator) - return false; - - ActionTreeNode newNode = dropped.Node; - if (dropped.Node.Type == Gtk.UIManagerItemType.Menuitem) { - newNode = newNode.Clone (); - newNode.Type = Gtk.UIManagerItemType.Toolitem; - } - - Widget wrapper = Stetic.Wrapper.Widget.Lookup (this); - using (wrapper.UndoManager.AtomicChange) { - if (dropIndex < actionTree.Children.Count) { - // Do nothing if trying to drop the node over the same node - ActionTreeNode dropNode = actionTree.Children [dropIndex]; - if (dropNode == newNode) - return false; - - if (newNode.ParentNode != null) - newNode.ParentNode.Children.Remove (newNode); - - // The drop position may have changed after removing the dropped node, - // so get it again. - dropIndex = actionTree.Children.IndexOf (dropNode); - actionTree.Children.Insert (dropIndex, newNode); - } else { - if (newNode.ParentNode != null) - newNode.ParentNode.Children.Remove (newNode); - actionTree.Children.Add (newNode); - dropIndex = actionTree.Children.Count - 1; - } - } - // Select the dropped node - ActionToolItem mi = (ActionToolItem) toolItems [dropIndex]; - mi.Select (); - - return base.OnDragDrop (context, x, y, time); - } - protected override bool OnExposeEvent (Gdk.EventExpose ev) - { - bool r = base.OnExposeEvent (ev); - if (dropPosition != -1) { - if (this.Orientation == Gtk.Orientation.Horizontal) - GdkWindow.DrawRectangle (this.Style.BlackGC, true, dropPosition, Allocation.Y, 3, Allocation.Height); - else - GdkWindow.DrawRectangle (this.Style.BlackGC, true, Allocation.X, dropPosition, Allocation.Width, 3); - } - return r; - } - - void OnItemKeyPress (object s, Gtk.KeyPressEventArgs args) - { - int pos = toolItems.IndexOf (s); - args.RetVal = false; - - switch (args.Event.Key) { - case Gdk.Key.Left: - args.RetVal = true; - if (pos > 0) - ((ActionToolItem)toolItems[pos - 1]).Select (); - break; - case Gdk.Key.Right: - args.RetVal = true; - if (pos < toolItems.Count - 1) - ((ActionToolItem)toolItems[pos + 1]).Select (); - else if (pos == toolItems.Count - 1) - InsertAction (toolItems.Count); - break; - } - } - - void InsertActionAt (ActionToolItem item, bool after, bool separator) - { - int pos = toolItems.IndexOf (item); - if (pos == -1) - return; - - if (after) - pos++; - - if (separator) { - ActionTreeNode newNode = new ActionTreeNode (Gtk.UIManagerItemType.Separator, null, null); - actionTree.Children.Insert (pos, newNode); - } else - InsertAction (pos); - } - - void Paste (ActionToolItem item) - { - } - - public void ShowContextMenu (ActionItem aitem) - { - ActionToolItem menuItem = aitem as ActionToolItem; - - Gtk.Menu m = new Gtk.Menu (); - Gtk.MenuItem item = new Gtk.MenuItem (Catalog.GetString ("Insert Before")); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - InsertActionAt (menuItem, false, false); - }; - item = new Gtk.MenuItem (Catalog.GetString ("Insert After")); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - InsertActionAt (menuItem, true, false); - }; - item = new Gtk.MenuItem (Catalog.GetString ("Insert Separator Before")); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - InsertActionAt (menuItem, false, true); - }; - item = new Gtk.MenuItem (Catalog.GetString ("Insert Separator After")); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - InsertActionAt (menuItem, true, true); - }; - - m.Add (new Gtk.SeparatorMenuItem ()); - - item = new Gtk.ImageMenuItem (Gtk.Stock.Cut, null); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - menuItem.Cut (); - }; - item = new Gtk.ImageMenuItem (Gtk.Stock.Copy, null); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - menuItem.Copy (); - }; - item = new Gtk.ImageMenuItem (Gtk.Stock.Paste, null); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - Paste (menuItem); - }; - item = new Gtk.ImageMenuItem (Gtk.Stock.Delete, null); - m.Add (item); - item.Activated += delegate (object s, EventArgs a) { - menuItem.Delete (); - }; - m.ShowAll (); - m.Popup (); - } - - public object SaveStatus () - { - for (int n=0; n bounds.Height) - s = bounds.Height; - if (s > bounds.Width) - s = bounds.Width; - Gtk.Style.PaintCheck (Container.Style, window, state, sh, bounds, Container, "checkbutton", bounds.X + indicatorSpacing - 1, bounds.Y + (bounds.Height - s)/2, s, s); - } - - protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state) - { - return new BooleanEditor (); - } - } - - [PropertyEditor ("Active", "Toggled")] - public class BooleanEditor : Gtk.CheckButton, IPropertyEditor - { - public void Initialize (PropertyDescriptor descriptor) - { - if (descriptor.PropertyType != typeof(bool)) - throw new ApplicationException ("Boolean editor does not support editing values of type " + descriptor.PropertyType); - } - - public void AttachObject (object obj) - { - } - - public object Value { - get { return Active; } - set { Active = (bool) value; } - } - - protected override void OnToggled () - { - base.OnToggled (); - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } - - public event EventHandler ValueChanged; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/CellRendererComboBox.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/CellRendererComboBox.cs deleted file mode 100644 index 186f446729a..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/CellRendererComboBox.cs +++ /dev/null @@ -1,111 +0,0 @@ -// -// CellRendererComboBox.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using Gtk; -using Gdk; - -namespace Stetic.Editor -{ - public class CellRendererComboBox: CellRendererText - { - string[] values; - string path; - int rowHeight; - - public CellRendererComboBox () - { - Mode |= Gtk.CellRendererMode.Editable; - Entry dummyEntry = new Gtk.Entry (); - rowHeight = dummyEntry.SizeRequest ().Height; - } - - public string[] Values { - get { return values; } - set { values = value; } - } - - public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - if (height < rowHeight) - height = rowHeight; - } - - public override CellEditable StartEditing (Gdk.Event ev, Widget widget, string path, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, CellRendererState flags) - { - this.path = path; - - Gtk.ComboBox combo = Gtk.ComboBox.NewText (); - foreach (string s in values) - combo.AppendText (s); - - combo.Active = Array.IndexOf (values, Text); - combo.Changed += new EventHandler (SelectionChanged); - return new TreeViewCellContainer (combo); - } - - void SelectionChanged (object s, EventArgs a) - { - Gtk.ComboBox combo = (Gtk.ComboBox) s; - if (Changed != null) - Changed (this, new ComboSelectionChangedArgs (path, combo.Active, (combo.Active != -1 ? values [combo.Active] : null))); - } - - // Fired when the selection changes - public event ComboSelectionChangedHandler Changed; - } - - public delegate void ComboSelectionChangedHandler (object sender, ComboSelectionChangedArgs args); - - public class ComboSelectionChangedArgs: EventArgs - { - string path; - int active; - string activeText; - - internal ComboSelectionChangedArgs (string path, int active, string activeText) - { - this.path = path; - this.active = active; - this.activeText = activeText; - } - - public string Path { - get { return path; } - } - - public int Active { - get { return active; } - } - - public string ActiveText { - get { return activeText; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Char.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Char.cs deleted file mode 100644 index e27b1b7662e..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Char.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; - -namespace Stetic.Editor { - - public class Char : Gtk.Entry, IPropertyEditor { - - public Char () - { - MaxLength = 1; - } - - public void Initialize (PropertyDescriptor descriptor) - { - if (descriptor.PropertyType != typeof(char)) - throw new ApplicationException ("Char editor does not support editing values of type " + descriptor.PropertyType); - } - - public void AttachObject (object obj) - { - } - - char last; - - public object Value { - get { - if (Text.Length == 0) - return last; - else - return Text[0]; - } - set { - Text = value.ToString (); - last = (char) value; - } - } - - protected override void OnChanged () - { - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } - - public event EventHandler ValueChanged; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Color.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Color.cs deleted file mode 100644 index e36b8eff729..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Color.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; - -namespace Stetic.Editor { - - public class Color: PropertyEditorCell - { - public override void GetSize (int availableWidth, out int width, out int height) - { - width = 16; - height = 16; - } - - public override void Render (Gdk.Drawable window, Gdk.Rectangle bounds, Gtk.StateType state) - { - using (Gdk.GC gc = new Gdk.GC (window)) { - gc.RgbFgColor = (Gdk.Color)Value; - window.DrawRectangle (gc, true, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); - window.DrawRectangle (Container.Style.BlackGC, false, bounds.X, bounds.Y, bounds.Width - 1, bounds.Height - 1); - } - } - - protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state) - { - return new ColorEditor (); - } - } - - [PropertyEditor ("Color", "ColorSet")] - public class ColorEditor : Gtk.ColorButton, IPropertyEditor - { - public void Initialize (PropertyDescriptor descriptor) - { - if (descriptor.PropertyType != typeof(Gdk.Color)) - throw new ApplicationException ("Color editor does not support editing values of type " + descriptor.PropertyType); - } - - public void AttachObject (object obj) - { - } - - public object Value { - get { return Color; } - set { Color = (Gdk.Color) value; } - } - - protected override void OnColorSet () - { - base.OnColorSet (); - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } - - public event EventHandler ValueChanged; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/DateTimeEditor.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/DateTimeEditor.cs deleted file mode 100644 index f338b8c54e6..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/DateTimeEditor.cs +++ /dev/null @@ -1,72 +0,0 @@ - -using System; -using Gtk; -using Gdk; -using System.Text; - -namespace Stetic.Editor -{ - public class DateTimeEditorCell: PropertyEditorCell - { - protected override string GetValueText () - { - return ((DateTime)Value).ToLongDateString (); - } - - protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state) - { - return new DateTimeEditor (); - } - } - - public class DateTimeEditor: Gtk.HBox, IPropertyEditor - { - Gtk.Entry entry; - DateTime time; - - public DateTimeEditor() - { - entry = new Gtk.Entry (); - entry.Changed += OnChanged; - PackStart (entry, true, true, 0); - ShowAll (); - } - - public void Initialize (PropertyDescriptor descriptor) - { - } - - public void AttachObject (object ob) - { - } - - public object Value { - get { return time; } - set { - time = (DateTime) value; - entry.Changed -= OnChanged; - entry.Text = time.ToString ("G"); - entry.Changed += OnChanged; - } - } - - void OnChanged (object o, EventArgs a) - { - string s = entry.Text; - - foreach (string form in formats) { - try { - time = DateTime.ParseExact (s, form, null); - if (ValueChanged != null) - ValueChanged (this, a); - break; - } catch { - } - } - } - - public event EventHandler ValueChanged; - - static string[] formats = {"u", "G", "g", "d", "T", "t"}; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/EditIconDialog.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/EditIconDialog.cs deleted file mode 100644 index 8910359bf68..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/EditIconDialog.cs +++ /dev/null @@ -1,285 +0,0 @@ - -using System; -using Mono.Unix; - -namespace Stetic.Editor -{ - public class EditIconDialog: IDisposable - { - #pragma warning disable 649 // never assigned - [Glade.Widget] Gtk.Entry nameEntry; - [Glade.Widget] Gtk.TreeView sourceList; - [Glade.Widget] Gtk.RadioButton radioSingle; - [Glade.Widget] Gtk.RadioButton radioMultiple; - [Glade.Widget] Gtk.Label imageLabel; - [Glade.Widget] Gtk.Image imageImage; - [Glade.Widget] Gtk.Button okButton; - [Glade.Widget] Gtk.HBox hboxSingle; - [Glade.Widget] Gtk.HBox hboxMultiple; - [Glade.Widget ("EditIconDialog")] Gtk.Dialog dialog; - #pragma warning restore 649 - - Gtk.ListStore sourceListStore; - - ProjectIconSet iconSet; - IProject project; - - ImageInfo singleIcon; - - string[] sizes = { Catalog.GetString ("All Sizes"), "Menu", "SmallToolbar", "LargeToolbar", "Button", "Dnd", "Dialog" }; - string[] states = { Catalog.GetString ("All States"), "Normal", "Active", "Prelight", "Selected", "Insensitive" }; - string[] directions = { Catalog.GetString ("All Directions"), "Ltr", "Rtl" }; - - public EditIconDialog (IProject project, ProjectIconSet iconSet) - { - Glade.XML xml = new Glade.XML (null, "stetic.glade", "EditIconDialog", null); - xml.Autoconnect (this); - dialog.Response += OnResponse; - - this.project = project; - this.iconSet = iconSet; - - nameEntry.Text = iconSet.Name; - - if (iconSet.Sources.Count == 0) { - radioSingle.Active = true; - imageLabel.Text = ""; - } - else if (iconSet.Sources.Count == 1 && iconSet.Sources[0].AllWildcarded) { - radioSingle.Active = true; - singleIcon = iconSet.Sources[0].Image; - if (singleIcon != null) { - imageLabel.Text = singleIcon.Label; - imageImage.Pixbuf = singleIcon.GetThumbnail (project, 16); - } else - imageLabel.Text = ""; - } else { - radioMultiple.Active = true; - } - - hboxSingle.Sensitive = radioSingle.Active; - hboxMultiple.Sensitive = !radioSingle.Active; - - // Build the tree - - sourceListStore = new Gtk.ListStore (typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(object)); - sourceList.Model = sourceListStore; - - Gtk.TreeViewColumn col = new Gtk.TreeViewColumn (); - - Gtk.CellRendererPixbuf pr = new Gtk.CellRendererPixbuf (); - col.Title = Catalog.GetString ("Image"); - col.PackStart (pr, false); - col.AddAttribute (pr, "pixbuf", 0); - - Gtk.CellRendererText crt = new Gtk.CellRendererText (); - col.PackStart (crt, true); - col.AddAttribute (crt, "text", 1); - sourceList.AppendColumn (col); - - col = new Gtk.TreeViewColumn (); - col.Expand = true; - col.Title = Catalog.GetString ("Size"); - CellRendererComboBox crtb = new CellRendererComboBox (); - crtb.Changed += new ComboSelectionChangedHandler (OnSizeComboChanged); - crtb.Values = sizes; - col.PackStart (crtb, true); - col.AddAttribute (crtb, "text", 2); - sourceList.AppendColumn (col); - - col = new Gtk.TreeViewColumn (); - col.Expand = true; - col.Title = Catalog.GetString ("State"); - crtb = new CellRendererComboBox (); - crtb.Changed += new ComboSelectionChangedHandler (OnStateComboChanged); - crtb.Values = states; - col.PackStart (crtb, true); - col.AddAttribute (crtb, "text", 3); - sourceList.AppendColumn (col); - - col = new Gtk.TreeViewColumn (); - col.Expand = true; - col.Title = Catalog.GetString ("Direction"); - crtb = new CellRendererComboBox (); - crtb.Changed += new ComboSelectionChangedHandler (OnDirComboChanged); - crtb.Values = directions; - col.PackStart (crtb, true); - col.AddAttribute (crtb, "text", 4); - sourceList.AppendColumn (col); - - foreach (ProjectIconSource source in iconSet.Sources) - AddSource (source); - - UpdateButtons (); - } - - public Gtk.Window TransientFor { - set { dialog.TransientFor = value; } - } - - public int Run () - { - return dialog.Run (); - } - - public void Dispose () - { - dialog.Destroy (); - } - - void AddSource (ProjectIconSource source) - { - string size = source.SizeWildcarded ? sizes[0] : source.Size.ToString (); - string state = source.StateWildcarded ? states[0] : source.State.ToString (); - string dir = source.DirectionWildcarded ? directions[0] : source.Direction.ToString (); - sourceListStore.AppendValues (source.Image.GetThumbnail (project, 16), source.Image.Label, size, state, dir, source.Image); - } - - ProjectIconSource GetSource (Gtk.TreeIter iter) - { - ProjectIconSource src = new ProjectIconSource (); - src.Image = (ImageInfo) sourceListStore.GetValue (iter, 5); - string s = (string) sourceListStore.GetValue (iter, 2); - if (s == sizes[0]) - src.SizeWildcarded = true; - else { - src.SizeWildcarded = false; - src.Size = (Gtk.IconSize) Enum.Parse (typeof(Gtk.IconSize), s); - } - - s = (string) sourceListStore.GetValue (iter, 3); - if (s == states[0]) - src.StateWildcarded = true; - else { - src.StateWildcarded = false; - src.State = (Gtk.StateType) Enum.Parse (typeof(Gtk.StateType), s); - } - - s = (string) sourceListStore.GetValue (iter, 4); - if (s == directions[0]) - src.DirectionWildcarded = true; - else { - src.DirectionWildcarded = false; - src.Direction = (Gtk.TextDirection) Enum.Parse (typeof(Gtk.TextDirection), s); - } - - return src; - } - - void Save () - { - iconSet.Name = nameEntry.Text; - iconSet.Sources.Clear (); - - if (radioSingle.Active) { - ProjectIconSource src = new ProjectIconSource (); - src.AllWildcarded = true; - src.Image = singleIcon; - iconSet.Sources.Add (src); - } else { - Gtk.TreeIter iter; - if (sourceListStore.GetIterFirst (out iter)) { - do { - iconSet.Sources.Add (GetSource (iter)); - } - while (sourceListStore.IterNext (ref iter)); - } - } - } - - void OnResponse (object o, Gtk.ResponseArgs args) - { - if (args.ResponseId == Gtk.ResponseType.Ok) - Save (); - } - - protected void OnSelectImage (object s, EventArgs args) - { - using (SelectImageDialog dlg = new SelectImageDialog (dialog, project)) { - if (dlg.Run () == (int) Gtk.ResponseType.Ok) { - singleIcon = dlg.Icon; - imageLabel.Text = singleIcon.Label; - imageImage.Pixbuf = singleIcon.GetThumbnail (project, 16); - UpdateButtons (); - } - } - } - - protected void OnAddSource (object s, EventArgs args) - { - using (SelectImageDialog dlg = new SelectImageDialog (dialog, project)) { - if (dlg.Run () == (int) Gtk.ResponseType.Ok) { - ProjectIconSource src = new ProjectIconSource (); - src.Image = dlg.Icon; - src.AllWildcarded = true; - AddSource (src); - UpdateButtons (); - } - } - } - - protected void OnRemoveSource (object s, EventArgs args) - { - Gtk.TreeIter iter; - Gtk.TreeModel model; - if (sourceList.Selection.GetSelected (out model, out iter)) { - sourceListStore.Remove (ref iter); - UpdateButtons (); - } - } - - protected void OnSingleClicked (object s, EventArgs args) - { - hboxSingle.Sensitive = true; - hboxMultiple.Sensitive = false; - UpdateButtons (); - } - - protected void OnMultipleClicked (object s, EventArgs args) - { - hboxSingle.Sensitive = false; - hboxMultiple.Sensitive = true; - UpdateButtons (); - } - - protected void OnNameChanged (object s, EventArgs args) - { - UpdateButtons (); - } - - void OnSizeComboChanged (object s, ComboSelectionChangedArgs args) - { - UpdateComboValue (args.Path, 2, args.ActiveText); - } - - void OnStateComboChanged (object s, ComboSelectionChangedArgs args) - { - UpdateComboValue (args.Path, 3, args.ActiveText); - } - - void OnDirComboChanged (object s, ComboSelectionChangedArgs args) - { - UpdateComboValue (args.Path, 4, args.ActiveText); - } - - void UpdateComboValue (string path, int col, string activeText) - { - Gtk.TreeIter iter; - if (sourceListStore.GetIter (out iter, new Gtk.TreePath (path))) { - sourceListStore.SetValue (iter, col, activeText); - } - } - - void UpdateButtons () - { - if (nameEntry.Text.Length == 0) { - okButton.Sensitive = false; - } else if (radioSingle.Active) { - okButton.Sensitive = singleIcon != null; - } else { - Gtk.TreeIter iter; - okButton.Sensitive = sourceListStore != null && sourceListStore.GetIterFirst (out iter); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/EditIconFactoryDialog.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/EditIconFactoryDialog.cs deleted file mode 100644 index bc803b84aa6..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/EditIconFactoryDialog.cs +++ /dev/null @@ -1,97 +0,0 @@ - -using System; -using System.Collections; -using System.IO; -using Gtk; -using Mono.Unix; - -namespace Stetic.Editor -{ - public class EditIconFactoryDialog: IDisposable - { - #pragma warning disable 649 // never assigned - [Glade.Widget] Gtk.ScrolledWindow iconListScrolledwindow; - [Glade.Widget ("EditIconFactoryDialog")] Gtk.Dialog dialog; - #pragma warning restore 649 - - ProjectIconList customIconList; - - Gtk.Window parent; - Stetic.IProject project; - ProjectIconFactory iconFactory; - - public EditIconFactoryDialog (Gtk.Window parent, Stetic.IProject project, ProjectIconFactory iconFactory) - { - this.iconFactory = iconFactory; - this.parent = parent; - this.project = project; - - Glade.XML xml = new Glade.XML (null, "stetic.glade", "EditIconFactoryDialog", null); - xml.Autoconnect (this); - - customIconList = new ProjectIconList (project, iconFactory); - iconListScrolledwindow.AddWithViewport (customIconList); - } - - public int Run () - { - dialog.ShowAll (); - dialog.TransientFor = parent; - return dialog.Run (); - } - - public void Dispose () - { - dialog.Destroy (); - } - - protected void OnAddIcon (object ob, EventArgs args) - { - ProjectIconSet icon = new ProjectIconSet (); - using (EditIconDialog dlg = new EditIconDialog (project, icon)) { - if (parent != null) - dlg.TransientFor = parent.Toplevel as Gtk.Window; - if (dlg.Run () == (int) Gtk.ResponseType.Ok) { - iconFactory.Icons.Add (icon); - customIconList.Refresh (); - customIconList.Selection = icon.Name; - project.Modified = true; - } - } - } - - protected void OnRemoveIcon (object ob, EventArgs args) - { - string name = customIconList.Selection; - ProjectIconSet icon = iconFactory.GetIcon (name); - if (icon != null) { - Gtk.MessageDialog md = new Gtk.MessageDialog (dialog, Gtk.DialogFlags.Modal, Gtk.MessageType.Question, Gtk.ButtonsType.YesNo, string.Format (Catalog.GetString ("Are you sure you want to delete the icon '{0}'"), icon.Name)); - if (parent != null) - md.TransientFor = parent.Toplevel as Gtk.Window; - if (md.Run () == (int) Gtk.ResponseType.Yes) { - iconFactory.Icons.Remove (icon); - customIconList.Refresh (); - project.Modified = true; - } - md.Destroy (); - } - } - - protected void OnEditIcon (object ob, EventArgs args) - { - string name = customIconList.Selection; - ProjectIconSet icon = iconFactory.GetIcon (name); - if (icon != null) { - using (EditIconDialog dlg = new EditIconDialog (project, icon)) { - if (parent != null) - dlg.TransientFor = parent.Toplevel as Gtk.Window; - if (dlg.Run () == (int) Gtk.ResponseType.Ok) { - customIconList.Refresh (); - customIconList.Selection = icon.Name; - project.Modified = true; - } - } - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Enumeration.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Enumeration.cs deleted file mode 100644 index fd2237d02a3..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Enumeration.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Collections; - -namespace Stetic.Editor { - - public class Enumeration: PropertyEditorCell - { - protected override string GetValueText () - { - if (Value == null) - return ""; - - EnumDescriptor enm = Registry.LookupEnum (Property.PropertyType.FullName); - EnumValue ev = enm [(Enum)Value]; - if (ev != null) - return ev.Label; - else - return ""; - } - - protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state) - { - return new EnumerationEditor (); - } - } - - public class EnumerationEditor : Gtk.HBox, IPropertyEditor { - - Gtk.EventBox ebox; - Gtk.ComboBoxEntry combo; - EnumDescriptor enm; - - public EnumerationEditor () : base (false, 0) - { - } - - public void Initialize (PropertyDescriptor prop) - { - if (!prop.PropertyType.IsEnum) - throw new ApplicationException ("Enumeration editor does not support editing values of type " + prop.PropertyType); - - ebox = new Gtk.EventBox (); - ebox.Show (); - PackStart (ebox, true, true, 0); - - combo = Gtk.ComboBoxEntry.NewText (); - combo.Changed += combo_Changed; - combo.Entry.IsEditable = false; - combo.Entry.HasFrame = false; - combo.Entry.HeightRequest = combo.SizeRequest ().Height; // The combo does not set the entry to the correct size when it does not have a frame - combo.Show (); - ebox.Add (combo); - - enm = Registry.LookupEnum (prop.PropertyType.FullName); - foreach (Enum value in enm.Values) - combo.AppendText (enm[value].Label); - } - - public void AttachObject (object obj) - { - } - - public object Value { - get { - return enm.Values[combo.Active]; - } - set { - int i = Array.IndexOf (enm.Values, (Enum)value); - if (i != -1) - combo.Active = i; - } - } - - public event EventHandler ValueChanged; - - void combo_Changed (object o, EventArgs args) - { - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - EnumValue value = enm[(Enum)Value]; - if (value != null) - ebox.TooltipText = value.Description; - else - ebox.TooltipText = string.Empty; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Flags.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Flags.cs deleted file mode 100644 index 031d7a1319e..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Flags.cs +++ /dev/null @@ -1,174 +0,0 @@ -using Gtk; -using System; -using System.Collections; - -namespace Stetic.Editor { - - public class Flags: PropertyEditorCell - { - protected override string GetValueText () - { - if (Value == null) - return ""; - - uint value = (uint)(int)Value; - EnumDescriptor enm = Registry.LookupEnum (Property.PropertyType.FullName); - string txt = ""; - foreach (Enum val in enm.Values) { - EnumValue eval = enm[val]; - if (eval.Label == "") - continue; - - if ((value & (uint) Convert.ToInt32 (eval.Value)) != 0) { - if (txt.Length > 0) txt += ", "; - txt += eval.Label; - } - } - return txt; - } - - protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state) - { - return new FlagsEditor (); - } - } - - public class FlagsEditor : Gtk.HBox, IPropertyEditor { - - EnumDescriptor enm; - Hashtable flags; - Gtk.Entry flagsLabel; - string property; - - public FlagsEditor () - { - } - - public void Initialize (PropertyDescriptor prop) - { - if (!prop.PropertyType.IsEnum) - throw new ApplicationException ("Flags editor does not support editing values of type " + prop.PropertyType); - - property = prop.Label; - Spacing = 3; - - // For small enums, the editor is a list of checkboxes inside a frame - // For large enums (>5), use a selector dialog. - - enm = Registry.LookupEnum (prop.PropertyType.FullName); - - if (enm.Values.Length < 6) - { - Gtk.VBox vbox = new Gtk.VBox (true, 3); - - flags = new Hashtable (); - - foreach (Enum value in enm.Values) { - EnumValue eval = enm[value]; - if (eval.Label == "") - continue; - - Gtk.CheckButton check = new Gtk.CheckButton (eval.Label); - check.TooltipText = eval.Description; - uint uintVal = (uint) Convert.ToInt32 (eval.Value); - flags[check] = uintVal; - flags[uintVal] = check; - - check.Toggled += FlagToggled; - vbox.PackStart (check, false, false, 0); - } - - Gtk.Frame frame = new Gtk.Frame (); - frame.Add (vbox); - frame.ShowAll (); - PackStart (frame, true, true, 0); - } - else - { - flagsLabel = new Gtk.Entry (); - flagsLabel.IsEditable = false; - flagsLabel.HasFrame = false; - flagsLabel.ShowAll (); - PackStart (flagsLabel, true, true, 0); - - Gtk.Button but = new Gtk.Button ("..."); - but.Clicked += OnSelectFlags; - but.ShowAll (); - PackStart (but, false, false, 0); - } - } - - public void AttachObject (object ob) - { - } - - public object Value { - get { - return Enum.ToObject (enm.EnumType, UIntValue); - } - set { - uint newVal = (uint)(int)value; - if (flagsLabel != null) { - string txt = ""; - foreach (Enum val in enm.Values) { - EnumValue eval = enm[val]; - if (eval.Label == "") - continue; - - if ((newVal & (uint) Convert.ToInt32 (eval.Value)) != 0) { - if (txt.Length > 0) txt += ", "; - txt += eval.Label; - } - } - flagsLabel.Text = txt; - UIntValue = newVal; - } - else { - for (uint i = 1; i <= uintValue || i <= newVal; i = i << 1) { - if ((uintValue & i) != (newVal & i)) { - Gtk.CheckButton check = (Gtk.CheckButton)flags[i]; - if (check != null) - check.Active = !check.Active; - } - } - } - } - } - - public event EventHandler ValueChanged; - - uint uintValue; - uint UIntValue { - get { - return uintValue; - } - set { - if (uintValue != value) { - uintValue = value; - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } - } - } - - void FlagToggled (object o, EventArgs args) - { - Gtk.CheckButton check = (Gtk.CheckButton)o; - uint val = (uint)flags[o]; - - if (check.Active) - UIntValue |= val; - else - UIntValue &= ~val; - } - - void OnSelectFlags (object o, EventArgs args) - { - using (FlagsSelectorDialog dialog = new FlagsSelectorDialog (null, enm, UIntValue, property)) { - if (dialog.Run () == (int) ResponseType.Ok) { - Value = Enum.ToObject (enm.EnumType, dialog.Value); - } - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/FlagsSelectorDialog.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/FlagsSelectorDialog.cs deleted file mode 100644 index b3b6a8d5cd7..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/FlagsSelectorDialog.cs +++ /dev/null @@ -1,82 +0,0 @@ - -using System; - -namespace Stetic.Editor -{ - public class FlagsSelectorDialog: IDisposable - { - #pragma warning disable 649 // never assigned - [Glade.Widget] Gtk.TreeView treeView; - [Glade.Widget ("FlagsSelectorDialog")] Gtk.Dialog dialog; - #pragma warning restore 649 - - Gtk.ListStore store; - Gtk.Window parent; - uint flags; - - public FlagsSelectorDialog (Gtk.Window parent, EnumDescriptor enumDesc, uint flags, string title) - { - this.flags = flags; - this.parent = parent; - - Glade.XML xml = new Glade.XML (null, "stetic.glade", "FlagsSelectorDialog", null); - xml.Autoconnect (this); - - store = new Gtk.ListStore (typeof(bool), typeof(string), typeof(uint)); - treeView.Model = store; - - Gtk.TreeViewColumn col = new Gtk.TreeViewColumn (); - - Gtk.CellRendererToggle tog = new Gtk.CellRendererToggle (); - tog.Toggled += new Gtk.ToggledHandler (OnToggled); - col.PackStart (tog, false); - col.AddAttribute (tog, "active", 0); - - Gtk.CellRendererText crt = new Gtk.CellRendererText (); - col.PackStart (crt, true); - col.AddAttribute (crt, "text", 1); - - treeView.AppendColumn (col); - - foreach (Enum value in enumDesc.Values) { - EnumValue eval = enumDesc[value]; - if (eval.Label == "") - continue; - uint val = (uint) Convert.ToInt32 (eval.Value); - store.AppendValues (((flags & val) != 0), eval.Label, val); - } - } - - public int Run () - { - dialog.ShowAll (); - dialog.TransientFor = parent; - return dialog.Run (); - } - - public void Dispose () - { - dialog.Destroy (); - } - - void OnToggled (object s, Gtk.ToggledArgs args) - { - Gtk.TreeIter iter; - if (!store.GetIterFromString (out iter, args.Path)) - return; - - bool oldValue = (bool) store.GetValue (iter, 0); - uint flag = (uint) store.GetValue (iter, 2); - store.SetValue (iter, 0, !oldValue); - - if (oldValue) - flags &= ~flag; - else - flags |= flag; - } - - public uint Value { - get { return flags; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/FloatRange.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/FloatRange.cs deleted file mode 100644 index 2b8894dbf34..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/FloatRange.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; - -namespace Stetic.Editor { - - public class FloatRange : Gtk.SpinButton, IPropertyEditor - { - Type propType; - - public FloatRange (): base (0, 0, 0.01) - { - } - - public void Initialize (PropertyDescriptor prop) - { - propType = prop.PropertyType; - - double min, max; - - if (propType == typeof(double)) { - min = Double.MinValue; - max = Double.MaxValue; - } else if (propType == typeof(float)) { - min = float.MinValue; - max = float.MaxValue; - } else - throw new ApplicationException ("FloatRange editor does not support editing values of type " + propType); - - if (prop.Minimum != null) - min = (double) Convert.ChangeType (prop.Minimum, typeof(double)); - if (prop.Maximum != null) - max = (double) Convert.ChangeType (prop.Maximum, typeof(double)); - - SetRange (min, max); - - Digits = 2; - } - - public void AttachObject (object ob) - { - } - - object IPropertyEditor.Value { - get { return Convert.ChangeType (base.Value, propType); } - set { base.Value = (double) Convert.ChangeType (value, typeof(double)); } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/GroupPicker.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/GroupPicker.cs deleted file mode 100644 index fd9d4b24cc1..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/GroupPicker.cs +++ /dev/null @@ -1,175 +0,0 @@ -using Gtk; -using Gdk; -using GLib; -using System; -using System.Collections; -using System.Reflection; -using Mono.Unix; - -namespace Stetic.Editor { - - [PropertyEditor ("Group", "Changed")] - class GroupPicker : Gtk.HBox, IPropertyEditor { - - Gtk.ComboBox combo; - IRadioGroupManager manager; - ArrayList values; - string group; - - const BindingFlags flags = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; - - public GroupPicker () : base (false, 0) - { - } - - public void Initialize (PropertyDescriptor prop) - { - } - - public void AttachObject (object ob) - { - ob = ObjectWrapper.Lookup (ob); - - IRadioGroupManagerProvider provider = ob as IRadioGroupManagerProvider; - - if (provider == null) - throw new ArgumentException ("The class " + ob.GetType() + " does not implement IRadioGroupManagerProvider"); - - manager = provider.GetGroupManager (); - manager.GroupsChanged += GroupsChanged; - GroupsChanged (); - } - - public override void Dispose () - { - manager.GroupsChanged -= GroupsChanged; - base.Dispose (); - } - - void GroupsChanged () - { - if (combo != null) { - combo.Changed -= combo_Changed; - Remove (combo); - } - - combo = Gtk.ComboBox.NewText (); - combo.Changed += combo_Changed; -#if GTK_SHARP_2_6 - combo.RowSeparatorFunc = RowSeparatorFunc; -#endif - combo.Show (); - PackStart (combo, true, true, 0); - - values = new ArrayList (); - int i = 0; - foreach (string name in manager.GroupNames) { - values.Add (name); - combo.AppendText (name); - if (name == group) - combo.Active = i; - i++; - } - -#if GTK_SHARP_2_6 - combo.AppendText (""); -#endif - - combo.AppendText (Catalog.GetString ("Rename Group...")); - combo.AppendText (Catalog.GetString ("New Group...")); - } - -#if GTK_SHARP_2_6 - bool RowSeparatorFunc (Gtk.TreeModel model, Gtk.TreeIter iter) - { - GLib.Value val = new GLib.Value (); - model.GetValue (iter, 0, ref val); - bool sep = ((string)val) == ""; - val.Dispose (); - return sep; - } -#endif - - public object Value { - get { - return group; - } - set { - int index = values.IndexOf ((string) value); - if (index != -1) { - combo.Active = index; - group = values[index] as string; - } - } - } - - public event EventHandler ValueChanged; - - void combo_Changed (object o, EventArgs args) - { - if (combo.Active >= values.Count) { - doDialog (); - return; - } - - group = values[combo.Active] as string; - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } - - void doDialog () - { -#if GTK_SHARP_2_6 - bool rename = combo.Active == values.Count + 1; -#else - bool rename = combo.Active == values.Count; -#endif - Gtk.Dialog dialog = new Gtk.Dialog ( - rename ? Catalog.GetString ("Rename Group") : Catalog.GetString ("New Group"), - combo.Toplevel as Gtk.Window, - Gtk.DialogFlags.Modal | Gtk.DialogFlags.NoSeparator, - Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, - Gtk.Stock.Ok, Gtk.ResponseType.Ok); - dialog.DefaultResponse = Gtk.ResponseType.Ok; - dialog.HasSeparator = false; - dialog.BorderWidth = 12; - dialog.VBox.Spacing = 18; - dialog.VBox.BorderWidth = 0; - - Gtk.HBox hbox = new Gtk.HBox (false, 12); - Gtk.Label label = new Gtk.Label (rename ? Catalog.GetString ("_New name:") : Catalog.GetString ("_Name:")); - Gtk.Entry entry = new Gtk.Entry (); - label.MnemonicWidget = entry; - hbox.PackStart (label, false, false, 0); - entry.ActivatesDefault = true; - if (rename) - entry.Text = group; - hbox.PackStart (entry, true, true, 0); - dialog.VBox.PackStart (hbox, false, false, 0); - - dialog.ShowAll (); - // Have to set this *after* ShowAll - dialog.ActionArea.BorderWidth = 0; - dialog.TransientFor = this.Toplevel as Gtk.Window; - Gtk.ResponseType response = (Gtk.ResponseType)dialog.Run (); - if (response == Gtk.ResponseType.Cancel || entry.Text.Length == 0) { - dialog.Destroy (); - Value = group; // reset combo.Active - return; - } - - string oldname = group; - group = entry.Text; - dialog.Destroy (); - - // FIXME: check that the new name doesn't already exist - - // This will trigger a GroupsChanged, which will eventually - // update combo.Active - if (rename) - manager.Rename (oldname, group); - else - manager.Add (group); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/GtkWorkarounds.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/GtkWorkarounds.cs deleted file mode 100644 index ec408a7f3c8..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/GtkWorkarounds.cs +++ /dev/null @@ -1,255 +0,0 @@ -// -// GtkWorkarounds.cs -// -// Author: -// Michael Hutchinson -// -// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using System.Runtime.InteropServices; -using System.Collections.Generic; -using System.Reflection; -using System.Reflection.Emit; - -namespace Stetic.Editor -{ - //from Mono.TextEditor/GtkWorkarounds.cs - public static class GtkWorkarounds - { - public static bool TriggersContextMenu (Gdk.EventButton evt) - { - return evt.Type == Gdk.EventType.ButtonPress && IsContextMenuButton (evt); - } - - public static bool IsContextMenuButton (Gdk.EventButton evt) - { - if (evt.Button == 3 && - (evt.State & (Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button2Mask)) == 0) - return true; - - if (Platform.IsMac) { - if (evt.Button == 1 && - (evt.State & Gdk.ModifierType.ControlMask) != 0 && - (evt.State & (Gdk.ModifierType.Button2Mask | Gdk.ModifierType.Button3Mask)) == 0) - return true; - } - - return false; - } - - - [DllImport ("gtksharpglue-2", CallingConvention = CallingConvention.Cdecl)] - static extern void gtksharp_container_leak_fixed_marker (); - - static HashSet fixedContainerTypes; - static Dictionary forallCallbacks; - static bool containerLeakFixed; - - // Works around BXC #3801 - Managed Container subclasses are incorrectly resurrected, then leak. - // It does this by registering an alternative callback for gtksharp_container_override_forall, which - // ignores callbacks if the wrapper no longer exists. This means that the objects no longer enter a - // finalized->release->dispose->re-wrap resurrection cycle. - // We use a dynamic method to access internal/private GTK# API in a performant way without having to track - // per-instance delegates. - public static void FixContainerLeak (Gtk.Container c) - { - if (containerLeakFixed) { - return; - } - FixContainerLeak (c.GetType ()); - } - - static void FixContainerLeak (Type t) - { - if (containerLeakFixed) { - return; - } - - if (fixedContainerTypes == null) { - try { - gtksharp_container_leak_fixed_marker (); - containerLeakFixed = true; - return; - } catch (EntryPointNotFoundException) { - } - fixedContainerTypes = new HashSet(); - forallCallbacks = new Dictionary (); - } - - if (!fixedContainerTypes.Add (t)) { - return; - } - - //need to fix the callback for the type and all the managed supertypes - var lookupGType = typeof (GLib.Object).GetMethod ("LookupGType", BindingFlags.Static | BindingFlags.NonPublic); - do { - var gt = (GLib.GType) lookupGType.Invoke (null, new[] { t }); - var cb = CreateForallCallback (gt.Val); - forallCallbacks[gt.Val] = cb; - gtksharp_container_override_forall (gt.Val, cb); - t = t.BaseType; - } while (fixedContainerTypes.Add (t) && t.Assembly != typeof (Gtk.Container).Assembly); - } - - static ForallDelegate CreateForallCallback (IntPtr gtype) - { - var dm = new DynamicMethod ( - "ContainerForallCallback", - typeof(void), - new Type[] { typeof(IntPtr), typeof(bool), typeof(IntPtr), typeof(IntPtr) }, - typeof(GtkWorkarounds).Module, - true); - - var invokerType = typeof(Gtk.Container.CallbackInvoker); - - //this was based on compiling a similar method and disassembling it - ILGenerator il = dm.GetILGenerator (); - var IL_002b = il.DefineLabel (); - var IL_003f = il.DefineLabel (); - var IL_0060 = il.DefineLabel (); - var label_return = il.DefineLabel (); - - var loc_container = il.DeclareLocal (typeof(Gtk.Container)); - var loc_obj = il.DeclareLocal (typeof(object)); - var loc_invoker = il.DeclareLocal (invokerType); - var loc_ex = il.DeclareLocal (typeof(Exception)); - - //check that the type is an exact match - // prevent stack overflow, because the callback on a more derived type will handle everything - il.Emit (OpCodes.Ldarg_0); - il.Emit (OpCodes.Call, typeof(GLib.ObjectManager).GetMethod ("gtksharp_get_type_id", BindingFlags.Static | BindingFlags.NonPublic)); - - il.Emit (OpCodes.Ldc_I8, gtype.ToInt64 ()); - il.Emit (OpCodes.Newobj, typeof (IntPtr).GetConstructor (new Type[] { typeof (Int64) })); - il.Emit (OpCodes.Call, typeof (IntPtr).GetMethod ("op_Equality", BindingFlags.Static | BindingFlags.Public)); - il.Emit (OpCodes.Brfalse, label_return); - - il.BeginExceptionBlock (); - il.Emit (OpCodes.Ldnull); - il.Emit (OpCodes.Stloc, loc_container); - il.Emit (OpCodes.Ldsfld, typeof (GLib.Object).GetField ("Objects", BindingFlags.Static | BindingFlags.NonPublic)); - il.Emit (OpCodes.Ldarg_0); - il.Emit (OpCodes.Box, typeof (IntPtr)); - il.Emit (OpCodes.Callvirt, typeof (System.Collections.Hashtable).GetProperty ("Item").GetGetMethod ()); - il.Emit (OpCodes.Stloc, loc_obj); - il.Emit (OpCodes.Ldloc, loc_obj); - il.Emit (OpCodes.Brfalse, IL_002b); - - var tref = typeof (GLib.Object).Assembly.GetType ("GLib.ToggleRef"); - il.Emit (OpCodes.Ldloc, loc_obj); - il.Emit (OpCodes.Castclass, tref); - il.Emit (OpCodes.Callvirt, tref.GetProperty ("Target").GetGetMethod ()); - il.Emit (OpCodes.Isinst, typeof (Gtk.Container)); - il.Emit (OpCodes.Stloc, loc_container); - - il.MarkLabel (IL_002b); - il.Emit (OpCodes.Ldloc, loc_container); - il.Emit (OpCodes.Brtrue, IL_003f); - - il.Emit (OpCodes.Ldarg_0); - il.Emit (OpCodes.Ldarg_1); - il.Emit (OpCodes.Ldarg_2); - il.Emit (OpCodes.Ldarg_3); - il.Emit (OpCodes.Call, typeof (Gtk.Container).GetMethod ("gtksharp_container_base_forall", BindingFlags.Static | BindingFlags.NonPublic)); - il.Emit (OpCodes.Br, IL_0060); - - il.MarkLabel (IL_003f); - il.Emit (OpCodes.Ldloca_S, 2); - il.Emit (OpCodes.Ldarg_2); - il.Emit (OpCodes.Ldarg_3); - il.Emit (OpCodes.Call, invokerType.GetConstructor ( - BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[] { typeof (IntPtr), typeof (IntPtr) }, null)); - il.Emit (OpCodes.Ldloc, loc_container); - il.Emit (OpCodes.Ldarg_1); - il.Emit (OpCodes.Ldloc, loc_invoker); - il.Emit (OpCodes.Box, invokerType); - il.Emit (OpCodes.Ldftn, invokerType.GetMethod ("Invoke")); - il.Emit (OpCodes.Newobj, typeof (Gtk.Callback).GetConstructor ( - BindingFlags.Instance | BindingFlags.Public, null, new Type[] { typeof (object), typeof (IntPtr) }, null)); - var forallMeth = typeof (Gtk.Container).GetMethod ("ForAll", - BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[] { typeof (bool), typeof (Gtk.Callback) }, null); - il.Emit (OpCodes.Callvirt, forallMeth); - - il.MarkLabel (IL_0060); - - il.BeginCatchBlock (typeof (Exception)); - il.Emit (OpCodes.Stloc, loc_ex); - il.Emit (OpCodes.Ldloc, loc_ex); - il.Emit (OpCodes.Ldc_I4_0); - il.Emit (OpCodes.Call, typeof (GLib.ExceptionManager).GetMethod ("RaiseUnhandledException")); - il.Emit (OpCodes.Leave, label_return); - il.EndExceptionBlock (); - - il.MarkLabel (label_return); - il.Emit (OpCodes.Ret); - - return (ForallDelegate) dm.CreateDelegate (typeof (ForallDelegate)); - } - - [UnmanagedFunctionPointer (CallingConvention.Cdecl)] - delegate void ForallDelegate (IntPtr container, bool include_internals, IntPtr cb, IntPtr data); - - [DllImport("gtksharpglue-2", CallingConvention = CallingConvention.Cdecl)] - static extern void gtksharp_container_override_forall (IntPtr gtype, ForallDelegate cb); - } - - //from Mono.TextEditor/Platform.cs - public static class Platform - { - static Platform () - { - IsWindows = System.IO.Path.DirectorySeparatorChar == '\\'; - IsMac = !IsWindows && IsRunningOnMac(); - IsX11 = !IsMac && System.Environment.OSVersion.Platform == PlatformID.Unix; - } - - static Gdk.Keymap keymap = Gdk.Keymap.Default; - - public static bool IsMac { get; private set; } - public static bool IsX11 { get; private set; } - public static bool IsWindows { get; private set; } - - //From Managed.Windows.Forms/XplatUI - static bool IsRunningOnMac () - { - IntPtr buf = IntPtr.Zero; - try { - buf = Marshal.AllocHGlobal (8192); - // This is a hacktastic way of getting sysname from uname () - if (uname (buf) == 0) { - string os = Marshal.PtrToStringAnsi (buf); - if (os == "Darwin") - return true; - } - } catch { - } finally { - if (buf != IntPtr.Zero) - Marshal.FreeHGlobal (buf); - } - - return false; - } - - [DllImport ("libc")] - static extern int uname (IntPtr buf); - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconList.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconList.cs deleted file mode 100644 index 0803726b234..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconList.cs +++ /dev/null @@ -1,205 +0,0 @@ - -using System; -using System.Collections; -using Gtk; - -namespace Stetic.Editor -{ - // This is the internal class the represents the actual two-column - // icon list. This can't just be handled as an HBox inside the main - // window, because we need to override SetScrollAdjustments. - class IconList : Gtk.HBox - { - ThemedIconColumn left, right; - ArrayList IconNames = new ArrayList (); - - public event EventHandler Activated; - - protected IconList () - { - left = new ThemedIconColumn (); - PackStart (left); - right = new ThemedIconColumn (); - PackStart (right); - - left.Selection.Changed += LeftSelectionChanged; - right.Selection.Changed += RightSelectionChanged; - left.RowActivated += RowActivated; - right.RowActivated += RowActivated; - left.KeyPressEvent += ColumnKeyPressEvent; - right.KeyPressEvent += ColumnKeyPressEvent; - } - - protected void AddIcon (string name, Gdk.Pixbuf pixbuf, string label) - { - int i = IconNames.Count; - IconNames.Add (name); - - if (i % 2 == 0) - left.Append (pixbuf, name); - else - right.Append (pixbuf, name); - } - - protected void Clear () - { - IconNames.Clear (); - left.Clear (); - right.Clear (); - } - - void RowActivated (object obj, RowActivatedArgs args) - { - if (Activated != null) - Activated (this, EventArgs.Empty); - } - - public int SelectionIndex { - get { - Gtk.TreePath[] selection; - selection = left.Selection.GetSelectedRows (); - if (selection.Length > 0) - return selection[0].Indices[0] * 2; - selection = right.Selection.GetSelectedRows (); - if (selection.Length > 0) - return selection[0].Indices[0] * 2 + 1; - return -1; - } - set { - if (value != -1) { - if (value % 2 == 0) - left.SelectRow (value / 2); - else - right.SelectRow (value / 2); - } else { - left.Selection.UnselectAll (); - right.Selection.UnselectAll (); - } - } - } - - public string Selection { - get { - int i = SelectionIndex; - if (i != -1) - return (string) IconNames [i]; - else - return null; - } - set { - if (value != null) - SelectionIndex = IconNames.IndexOf (value); - else - SelectionIndex = -1; - } - } - - public event EventHandler SelectionChanged; - - public void Find (string text) - { - int selection = SelectionIndex; - for (int i = (selection + 1) % IconNames.Count; i != selection; i = (i + 1) % IconNames.Count) { - if (((string)IconNames[i]).IndexOf (text) != -1) { - SelectionIndex = i; - return; - } - } - SelectionIndex = -1; - } - - void LeftSelectionChanged (object obj, EventArgs args) - { - if (left.Selection.GetSelectedRows().Length != 0) - right.Selection.UnselectAll (); - if (SelectionChanged != null) - SelectionChanged (this, EventArgs.Empty); - } - - void RightSelectionChanged (object obj, EventArgs args) - { - if (right.Selection.GetSelectedRows().Length != 0) - left.Selection.UnselectAll (); - if (SelectionChanged != null) - SelectionChanged (this, EventArgs.Empty); - } - - [GLib.ConnectBefore] - void ColumnKeyPressEvent (object obj, KeyPressEventArgs args) - { - if (args.Event.Key == Gdk.Key.Right) { - if (obj == (object)left) { - SelectionIndex++; - right.GrabFocus (); - } - args.RetVal = true; - } else if (args.Event.Key == Gdk.Key.Left) { - if (obj == (object)right) { - SelectionIndex--; - left.GrabFocus (); - } - args.RetVal = true; - } - } - - protected override void OnSetScrollAdjustments (Gtk.Adjustment hadj, Gtk.Adjustment vadj) - { - left.SetScrollAdjustments (null, vadj); - right.SetScrollAdjustments (null, vadj); - } - } - - // Another internal class. This is a single column of the ThemedIconList - class ThemedIconColumn : Gtk.TreeView - { - public ThemedIconColumn () - { - Model = store = new Gtk.ListStore (typeof (Gdk.Pixbuf), - typeof (string)); - HeadersVisible = false; - EnableSearch = false; - - TreeViewColumn col; - CellRenderer renderer; - - col = new TreeViewColumn (); - renderer = new CellRendererPixbuf (); - col.PackStart (renderer, false); - col.AddAttribute (renderer, "pixbuf", 0); - renderer = new CellRendererText (); - col.PackStart (renderer, false); - col.AddAttribute (renderer, "text", 1); - AppendColumn (col); - } - - Gtk.ListStore store; - - public void Append (Gdk.Pixbuf pixbuf, string name) - { - if (name.Length > 30) - name = name.Substring (0, 30) + "..."; - store.AppendValues (pixbuf, name); - } - - public void SelectRow (int row) - { - Gtk.TreeIter iter; - if (store.IterNthChild (out iter, row)) { - Gtk.TreePath path = store.GetPath (iter); - - SetCursor (path, null, false); - - // We want the initial selection to be centered - if (!IsRealized) - ScrollToCell (path, null, true, 0.5f, 0.0f); - } - } - - public void Clear () - { - store.Clear (); - } - } -} - - diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconSelectorItem.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconSelectorItem.cs deleted file mode 100644 index 5846ecadb93..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconSelectorItem.cs +++ /dev/null @@ -1,284 +0,0 @@ - -using System; -using System.Reflection; -using System.Collections; - -namespace Stetic.Editor -{ - public class IconSelectorItem: Gtk.EventBox - { - ArrayList icons = new ArrayList (); - ArrayList labels = new ArrayList (); - ArrayList names = new ArrayList (); - int columns = 12; - int iconSize = 16; - int spacing = 3; - int selIndex = -1; - int sectionGap = 10; - int lastSel = -1; - int xmax; - int ymax; - string title; - Gtk.Window tipWindow; - bool inited; - - public IconSelectorItem (IntPtr ptr): base (ptr) - { - } - - public IconSelectorItem (string title) - { - this.title = title; - - int w, h; - Gtk.Icon.SizeLookup (Gtk.IconSize.Menu, out w, out h); - iconSize = w; - - this.Events |= Gdk.EventMask.PointerMotionMask; - } - - protected override void OnSizeRequested (ref Gtk.Requisition req) - { - if (!inited) { - CreateIcons (); - inited = true; - } - - base.OnSizeRequested (ref req); - CalcSize (); - - Gtk.Requisition nr = new Gtk.Requisition (); - nr.Width = xmax; - nr.Height = ymax; - req = nr; - } - - protected virtual void CreateIcons () - { - } - - public int SelectedIndex { - get { return selIndex; } - } - - public string SelectedIcon { - get { - if (selIndex != -1) - return (string) names [selIndex]; - else - return null; - } - } - - protected void AddIcon (string name, Gdk.Pixbuf pix, string label) - { - icons.Add (pix); - labels.Add (label); - names.Add (name); - } - - protected void AddSeparator (string separator) - { - icons.Add (null); - labels.Add (null); - names.Add (separator); - } - - protected override bool OnMotionNotifyEvent (Gdk.EventMotion ev) - { - ProcessMotionEvent ((int) ev.X, (int) ev.Y); - return true; - } - - internal void ProcessMotionEvent (int x, int y) - { - int ix, iy; - GetIconIndex (x, y, out selIndex, out ix, out iy); - if (selIndex != -1) { - string name = labels [selIndex] as string; - if (name == null || name.Length == 0) - name = names [selIndex] as string; - if (selIndex != lastSel) { - HideTip (); - ShowTip (ix, iy + iconSize + spacing*2, name); - } - } else - HideTip (); - - lastSel = selIndex; - - QueueDraw (); - } - - void ShowTip (int x, int y, string text) - { - if (GdkWindow == null) - return; - if (tipWindow == null) { - tipWindow = new TipWindow (); - Gtk.Label lab = new Gtk.Label (text); - lab.Xalign = 0; - lab.Xpad = 3; - lab.Ypad = 3; - tipWindow.Add (lab); - } - ((Gtk.Label)tipWindow.Child).Text = text; - int w = tipWindow.Child.SizeRequest().Width; - int ox, oy; - GdkWindow.GetOrigin (out ox, out oy); - tipWindow.Move (ox + x - (w/2) + (iconSize/2), oy + y); - tipWindow.ShowAll (); - } - - void HideTip () - { - if (tipWindow != null) { - tipWindow.Destroy (); - tipWindow = null; - } - } - - public override void Dispose () - { - HideTip (); - base.Dispose (); - } - - protected override bool OnLeaveNotifyEvent (Gdk.EventCrossing ev) - { - HideTip (); - return base.OnLeaveNotifyEvent (ev); - } - - internal void ProcessLeaveNotifyEvent (Gdk.EventCrossing ev) - { - HideTip (); - } - - protected override bool OnExposeEvent (Gdk.EventExpose ev) - { - Draw (); - return true; - } - - void Draw () - { - int a,b; - Expose (true, -1, -1, out a, out b); - } - - void CalcSize () - { - int a,b; - Expose (false, -1, -1, out a, out b); - } - - void GetIconIndex (int x, int y, out int index, out int ix, out int iy) - { - index = Expose (false, x, y, out ix, out iy); - } - - int Expose (bool draw, int testx, int testy, out int ix, out int iy) - { - int x = spacing; - int y = spacing; - int sx = spacing; - int maxx = columns * (iconSize + spacing) + spacing; - bool calcSize = (testx == -1); - int w, h, tborder = 1; - using (var layout = new Pango.Layout (this.PangoContext)) { - Pango.FontDescription des = this.Style.FontDescription.Copy (); - des.Size = 10 * (int)Pango.Scale.PangoScale; - layout.FontDescription = des; - layout.SetMarkup (title); - layout.Width = -1; - layout.GetPixelSize (out w, out h); - if (draw) { - GdkWindow.DrawRectangle (this.Style.DarkGC (Gtk.StateType.Normal), true, x, y, Allocation.Width + tborder * 2, h + tborder * 2); - GdkWindow.DrawLayout (this.Style.ForegroundGC (Gtk.StateType.Normal), x + tborder + 2, y + tborder, layout); - } - } - - if (calcSize) - xmax = 0; - - y += h + spacing*2 + tborder*2; - - for (int n=0; n sx) { - y += iconSize + spacing; - } - x = sx; - y -= spacing; - if (draw) { - Gdk.Rectangle rect = new Gdk.Rectangle (0, y+(sectionGap/2), Allocation.Width - x, 1); - Gtk.Style.PaintHline (this.Style, this.GdkWindow, Gtk.StateType.Normal, rect, this, "", rect.X, rect.Right, rect.Y); - } - y += sectionGap; - continue; - } - - if (cmd == "|") { - if (x == sx) - continue; - x += spacing; - if (draw) { - Gdk.Rectangle rect = new Gdk.Rectangle (x, y, 1, iconSize); - Gtk.Style.PaintVline (this.Style, this.GdkWindow, Gtk.StateType.Normal, rect, this, "", rect.Y, rect.Bottom, rect.X); - } - x += spacing*2; - continue; - } - - if (testx != -1 && testx >= (x - spacing/2) && testx < (x + iconSize + spacing) && testy >= (y - spacing/2) && testy < (y + iconSize + spacing)) { - ix = x; - iy = y; - return n; - } - - if (draw) { - Gtk.StateType state = (n == selIndex) ? Gtk.StateType.Selected : Gtk.StateType.Normal; - if (n == selIndex) - GdkWindow.DrawRectangle (this.Style.BackgroundGC (state), true, x-spacing, y-spacing, iconSize + spacing*2, iconSize + spacing*2); - GdkWindow.DrawPixbuf (this.Style.ForegroundGC (state), pix, 0, 0, x, y, pix.Width, pix.Height, Gdk.RgbDither.None, 0, 0); - } - - x += (iconSize + spacing); - if (calcSize && x > xmax) - xmax = x; - - if (x >= maxx) { - x = sx; - y += iconSize + spacing; - } - } - if (calcSize) { - if (x > sx) - y += iconSize + spacing; - ymax = y; - } - - ix = iy = 0; - return -1; - } - } - - class TipWindow: Gtk.Window - { - public TipWindow (): base (Gtk.WindowType.Popup) - { - } - - protected override bool OnExposeEvent (Gdk.EventExpose ev) - { - base.OnExposeEvent (ev); - Gtk.Requisition req = SizeRequest (); - Gtk.Style.PaintFlatBox (this.Style, this.GdkWindow, Gtk.StateType.Normal, Gtk.ShadowType.Out, Gdk.Rectangle.Zero, this, "tooltip", 0, 0, req.Width, req.Height); - return true; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconSelectorMenu.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconSelectorMenu.cs deleted file mode 100644 index ab6af38d281..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconSelectorMenu.cs +++ /dev/null @@ -1,56 +0,0 @@ - -using System; -using System.Reflection; -using System.Collections; -using Mono.Unix; - -namespace Stetic.Editor -{ - public class IconSelectorMenu: Gtk.Menu - { - IProject project; - - public event IconEventHandler IconSelected; - - public IconSelectorMenu (IProject project) - { - this.project = project; - - // Stock icon selector - IconSelectorMenuItem selStock = new IconSelectorMenuItem (new StockIconSelectorItem ()); - selStock.IconSelected += OnStockSelected; - Insert (selStock, -1); - - // Project icon selector - if (project != null && project.IconFactory.Icons.Count > 0) { - IconSelectorMenuItem selProject = new IconSelectorMenuItem (new ProjectIconSelectorItem (project)); - selProject.IconSelected += OnStockSelected; - Insert (selProject, -1); - } - - Insert (new Gtk.SeparatorMenuItem (), -1); - - Gtk.MenuItem it = new Gtk.MenuItem (Catalog.GetString ("More...")); - it.Activated += OnSetStockActionType; - Insert (it, -1); - } - - void OnStockSelected (object s, IconEventArgs args) - { - if (IconSelected != null) - IconSelected (this, args); - } - - void OnSetStockActionType (object ob, EventArgs args) - { - Stetic.Editor.SelectIconDialog dialog = new Stetic.Editor.SelectIconDialog (this.Toplevel as Gtk.Window, project); - using (dialog) - { - if (dialog.Run () != (int) Gtk.ResponseType.Ok) - return; - if (IconSelected != null) - IconSelected (this, new IconEventArgs (dialog.Icon)); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconSelectorMenuItem.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconSelectorMenuItem.cs deleted file mode 100644 index 5ac94883eb3..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IconSelectorMenuItem.cs +++ /dev/null @@ -1,59 +0,0 @@ - -using System; - -namespace Stetic.Editor -{ - public class IconSelectorMenuItem: Gtk.MenuItem - { - IconSelectorItem selector; - - public event IconEventHandler IconSelected; - - public IconSelectorMenuItem (IconSelectorItem item) - { - selector = item; - Add (selector); - } - - protected override bool OnButtonPressEvent (Gdk.EventButton ev) - { - if (IconSelected != null) - IconSelected (this, new IconEventArgs (selector.SelectedIcon)); - selector.Destroy (); - return base.OnButtonPressEvent (ev); - } - - protected override bool OnEnterNotifyEvent (Gdk.EventCrossing ev) - { - return true; - } - - protected override bool OnLeaveNotifyEvent (Gdk.EventCrossing ev) - { - selector.ProcessLeaveNotifyEvent (ev); - return true; - } - - protected override bool OnMotionNotifyEvent (Gdk.EventMotion ev) - { - selector.ProcessMotionEvent ((int)ev.X - selector.Allocation.X + Allocation.X, (int)ev.Y - selector.Allocation.Y + Allocation.Y); - return true; - } - } - - public delegate void IconEventHandler (object s, IconEventArgs args); - - public class IconEventArgs: EventArgs - { - string iconId; - - public IconEventArgs (string iconId) - { - this.iconId = iconId; - } - - public string IconId { - get { return iconId; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Identifier.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Identifier.cs deleted file mode 100644 index 6b7c42101ee..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Identifier.cs +++ /dev/null @@ -1,78 +0,0 @@ - -using System; -using System.Text; -using Gtk; -using Gdk; - -namespace Stetic.Editor -{ - public class Identifier: Gtk.Entry, IPropertyEditor - { - string id; - int min = -1; - int max = -1; - - public Identifier() - { - ShowAll (); - HasFrame = false; - } - - public void Initialize (PropertyDescriptor descriptor) - { - if (descriptor.PropertyType != typeof(string)) - throw new InvalidOperationException ("TextEditor only can edit string properties"); - - try { - if (descriptor.Minimum != null) - min = Convert.ToInt32 (descriptor.Minimum); - } catch {} - - try { - if (descriptor.Maximum != null) - max = Convert.ToInt32 (descriptor.Maximum); - } catch {} - } - - public void AttachObject (object obj) - { - } - - protected override bool OnFocusOutEvent (Gdk.EventFocus e) - { - DoChanged (); - return base.OnFocusOutEvent (e); - } - - void DoChanged () - { - StringBuilder sb = new StringBuilder (); - foreach (char c in Text) { - if (char.IsLetterOrDigit (c) || c == '_') - sb.Append (c); - } - - string s = sb.ToString (); - if (min != -1 && s.Length < min) - return; - if (max != -1 && s.Length > max) - return; - - if (s == Text) { - id = Text; - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } else { - Text = s; - } - } - - public object Value { - get { return id; } - set { id = Text = (value != null ? (string) value : ""); } - } - - // To be fired when the edited value changes. - public event EventHandler ValueChanged; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Image.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Image.cs deleted file mode 100644 index 0dbd5ed7e02..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Image.cs +++ /dev/null @@ -1,265 +0,0 @@ -using System; -using System.Collections; -using System.Reflection; -using Mono.Unix; - -namespace Stetic.Editor { - - [PropertyEditor ("Value", "Changed")] - public class Image : Gtk.HBox, IPropertyEditor { - Gtk.Image image; - Gtk.ComboBoxEntry combo; - Gtk.Entry entry; - Gtk.Button button; - Gtk.ListStore store; - - const int IconColumn = 0; - const int LabelColumn = 1; - - static string[] stockIds, stockLabels; - static int imgWidth, imgHeight; - - static Image () - { - ArrayList tmpIds = new ArrayList (); - - // We can't use Gtk.Stock.ListIds, because that returns different - // values depending on what version of libgtk you have installed... - foreach (PropertyInfo info in typeof (Gtk.Stock).GetProperties (BindingFlags.Public | BindingFlags.Static)) { - if (info.CanRead && info.PropertyType == typeof (string)) - tmpIds.Add (info.GetValue (null, null)); - } - foreach (PropertyInfo info in GnomeStock.Properties) { - if (info.CanRead && info.PropertyType == typeof (string)) - tmpIds.Add (info.GetValue (null, null)); - } - - ArrayList items = new ArrayList (), nonItems = new ArrayList (); - foreach (string id in tmpIds) { - Gtk.StockItem item = Gtk.Stock.Lookup (id); - if (item.StockId == null) - nonItems.Add (id); - else { - item.Label = item.Label.Replace ("_", ""); - items.Add (item); - } - } - items.Sort (new StockItemSorter ()); - nonItems.Sort (); - - stockIds = new string[items.Count + nonItems.Count]; - stockLabels = new string[items.Count + nonItems.Count]; - for (int i = 0; i < items.Count; i++) { - stockIds[i] = ((Gtk.StockItem)items[i]).StockId; - stockLabels[i] = ((Gtk.StockItem)items[i]).Label; - } - for (int i = 0; i < nonItems.Count; i++) { - stockIds[i + items.Count] = nonItems[i] as string; - stockLabels[i + items.Count] = nonItems[i] as string; - } - - Gtk.Icon.SizeLookup (Gtk.IconSize.Button, out imgWidth, out imgHeight); - } - - class StockItemSorter : IComparer { - public int Compare (object itemx, object itemy) - { - Gtk.StockItem x = (Gtk.StockItem)itemx; - Gtk.StockItem y = (Gtk.StockItem)itemy; - - return string.Compare (x.Label, y.Label); - } - } - - public Image () : this (true, true) {} - - public Image (bool allowStock, bool allowFile) : base (false, 6) - { - image = new Gtk.Image (GnomeStock.Blank, Gtk.IconSize.Button); - PackStart (image, false, false, 0); - - if (allowStock) { - store = new Gtk.ListStore (typeof (string), typeof (string)); - store.AppendValues (GnomeStock.Blank, Catalog.GetString ("(None)")); - for (int i = 0; i < stockIds.Length; i++) - store.AppendValues (stockIds[i], stockLabels[i]); - - combo = new Gtk.ComboBoxEntry (store, LabelColumn); - Gtk.CellRendererPixbuf iconRenderer = new Gtk.CellRendererPixbuf (); - iconRenderer.StockSize = (uint)Gtk.IconSize.Menu; - combo.PackStart (iconRenderer, false); - combo.Reorder (iconRenderer, 0); - combo.AddAttribute (iconRenderer, "stock-id", IconColumn); - combo.Changed += combo_Changed; - - // Pack the combo non-expandily into a VBox so it doesn't - // get stretched to the file button's height - Gtk.VBox vbox = new Gtk.VBox (false, 0); - vbox.PackStart (combo, true, false, 0); - PackStart (vbox, true, true, 0); - - entry = (Gtk.Entry)combo.Child; - entry.Changed += entry_Changed; - - useStock = true; - } - - if (allowFile) { - if (!allowStock) { - entry = new Gtk.Entry (); - PackStart (entry, true, true, 0); - entry.Changed += entry_Changed; - } - - button = new Gtk.Button (); - Gtk.Image icon = new Gtk.Image (Gtk.Stock.Open, Gtk.IconSize.Button); - button.Add (icon); - PackStart (button, false, false, 0); - button.Clicked += button_Clicked; - } - ShowAll (); - } - - public void Initialize (PropertyDescriptor prop) - { - if (prop.PropertyType != typeof(string)) - throw new ApplicationException ("Image editor does not support editing values of type " + prop.PropertyType); - } - - public void AttachObject (object ob) - { - } - - public event EventHandler ValueChanged; - - bool syncing; - - void combo_Changed (object obj, EventArgs args) - { - if (syncing) - return; - - useStock = true; - syncing = true; - if (combo.Active > 0) - StockId = stockIds[combo.Active - 1]; - else - StockId = null; - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - syncing = false; - } - - void entry_Changed (object obj, EventArgs args) - { - if (syncing) - return; - - useStock = true; - syncing = true; - StockId = entry.Text; - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - syncing = false; - } - - void button_Clicked (object obj, EventArgs args) - { - Gtk.FileChooserDialog dialog = - new Gtk.FileChooserDialog (Catalog.GetString ("Image"), null, Gtk.FileChooserAction.Open, - Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, - Gtk.Stock.Open, Gtk.ResponseType.Ok); - dialog.TransientFor = this.Toplevel as Gtk.Window; - int response = dialog.Run (); - string file = dialog.Filename; - dialog.Destroy (); - - if (response == (int)Gtk.ResponseType.Ok) { - syncing = true; - useStock = false; - entry.Text = file; - File = file; - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - syncing = false; - } - } - - bool useStock; - - string stockId; - public string StockId { - get { - return stockId; - } - set { - useStock = true; - stockId = value; - file = null; - - image.SetFromStock (stockId, Gtk.IconSize.Button); - - if (!syncing) { - int id = Array.IndexOf (stockIds, value); - if (id != -1) { - syncing = true; - combo.Active = id + 1; - syncing = false; - } - } - } - } - - string file; - public string File { - get { - return file; - } - set { - useStock = false; - stockId = null; - file = value; - - if (value == null) - value = ""; - - try { - image.Pixbuf = new Gdk.Pixbuf (value, imgWidth, imgHeight); - } catch { - image.SetFromStock (GnomeStock.Blank, Gtk.IconSize.Button); - } - - if (!syncing) { - syncing = true; - entry.Text = value; - syncing = false; - } - } - } - - public virtual object Value { - get { - if (useStock) { - if (StockId != null) - return "stock:" + StockId; - else - return null; - } else { - if (File != null) - return "file:" + File; - else - return null; - } - } - set { - string val = value as string; - if (val == null) - File = null; - else if (val.StartsWith ("stock:")) - StockId = val.Substring (6); - else if (val.StartsWith ("file:")) - File = val.Substring (5); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ImageFile.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ImageFile.cs deleted file mode 100644 index 4d9ad3211a2..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ImageFile.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace Stetic.Editor { - - [PropertyEditor ("File", "Changed")] - public class ImageFile : Image { - - public ImageFile () : base (false, true) { } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ImageSelector.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ImageSelector.cs deleted file mode 100644 index d983c521ec5..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ImageSelector.cs +++ /dev/null @@ -1,177 +0,0 @@ - -using System; - -namespace Stetic.Editor -{ - public class BaseImageCell: PropertyEditorCell - { - const int imgSize = 24; - const int imgPad = 2; - const int spacing = 5; - Gdk.Pixbuf image; - - protected Gdk.Pixbuf Image { - get { return image; } - set { image = value; } - } - - protected int ImageSize { - get { return 16; }//imgSize - imgPad*2; } - } - - public override void GetSize (int availableWidth, out int width, out int height) - { - base.GetSize (availableWidth, out width, out height); - width += imgSize + spacing; - height = Math.Max (imgSize, height); - } - - public override void Render (Gdk.Drawable window, Gdk.Rectangle bounds, Gtk.StateType state) - { - int iy = bounds.Y + (bounds.Height - imgSize) / 2; - - if (image != null) { - int dy = (imgSize - image.Height) / 2; - int dx = (imgSize - image.Width) / 2; - window.DrawPixbuf (Container.Style.BackgroundGC (state), image, 0, 0, bounds.X + dx, iy + dy, -1, -1, Gdk.RgbDither.None, 0, 0); - } - - window.DrawRectangle (Container.Style.DarkGC (state), false, bounds.X, iy, imgSize - 1, imgSize - 1); - - bounds.X += imgSize + spacing; - base.Render (window, bounds, state); - } - } - - public class ImageSelector: BaseImageCell - { - IProject project; - ImageInfo imageInfo; - - protected override void Initialize () - { - base.Initialize (); - - if (Property.PropertyType != typeof(ImageInfo)) - throw new ApplicationException ("ImageSelector editor does not support editing values of type " + Property.PropertyType); - - if (Instance == null) - return; - - Stetic.ObjectWrapper w = Stetic.ObjectWrapper.Lookup (Instance); - project = w.Project; - imageInfo = (ImageInfo)Value; - if (imageInfo != null) - Image = imageInfo.GetThumbnail (project, ImageSize); - else - Image = null; - } - - protected override string GetValueText () - { - if (imageInfo == null) - return ""; - return imageInfo.Label; - } - - protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state) - { - return new ImageSelectorEditor (); - } - } - - public class ImageSelectorEditor: Gtk.HBox, IPropertyEditor - { - Gtk.Image image; - Gtk.Label entry; - Gtk.Button button; - Gtk.Button clearButton; - ImageInfo icon; - IProject project; - Gtk.Frame imageFrame; - - public ImageSelectorEditor() - { - Spacing = 3; - imageFrame = new Gtk.Frame (); - imageFrame.Shadow = Gtk.ShadowType.In; - imageFrame.BorderWidth = 2; - PackStart (imageFrame, false, false, 0); - - image = new Gtk.Image (GnomeStock.Blank, Gtk.IconSize.Button); - imageFrame.Add (image); - - Gtk.Frame frame = new Gtk.Frame (); - entry = new Gtk.Label (); - entry.Xalign = 0; - frame.Shadow = Gtk.ShadowType.In; - frame.BorderWidth = 2; - frame.Add (entry); - PackStart (frame, true, true, 0); - - clearButton = new Gtk.Button (new Gtk.Image (Gtk.Stock.Clear, Gtk.IconSize.Menu)); - clearButton.Clicked += OnClearImage; - PackStart (clearButton, false, false, 0); - - button = new Gtk.Button ("..."); - PackStart (button, false, false, 0); - button.Clicked += button_Clicked; - ShowAll (); - } - - void button_Clicked (object obj, EventArgs args) - { - Gtk.Window parent = (Gtk.Window)GetAncestor (Gtk.Window.GType); - using (SelectImageDialog dlg = new SelectImageDialog (parent, project)) { - dlg.Icon = (ImageInfo) Value; - if (dlg.Run () == (int) Gtk.ResponseType.Ok) - Value = dlg.Icon; - } - } - - void OnClearImage (object obj, EventArgs args) - { - Value = null; - } - - // Called once to initialize the editor. - public void Initialize (PropertyDescriptor prop) - { - if (prop.PropertyType != typeof(ImageInfo)) - throw new ApplicationException ("ImageSelector editor does not support editing values of type " + prop.PropertyType); - } - - // Called when the object to be edited changes. - public void AttachObject (object obj) - { - Stetic.ObjectWrapper w = Stetic.ObjectWrapper.Lookup (obj); - project = w.Project; - } - - // Gets/Sets the value of the editor. If the editor supports - // several value types, it is the responsibility of the editor - // to return values with the expected type. - public object Value { - get { return icon; } - set { - icon = (ImageInfo) value; - if (icon != null) { - entry.Text = icon.Label; - image.Pixbuf = icon.GetThumbnail (project, 16); - imageFrame.Show (); - clearButton.Show (); - } else { - imageFrame.Hide (); - clearButton.Hide (); - entry.Text = ""; - } - - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } - } - - // To be fired when the edited value changes. - public event EventHandler ValueChanged; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IntRange.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IntRange.cs deleted file mode 100644 index 415becc0dcc..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/IntRange.cs +++ /dev/null @@ -1,120 +0,0 @@ -using System; - -namespace Stetic.Editor { - - public class IntRange : PropertyEditorCell - { - bool optInteger; - - bool HasValue { - get { - if (!optInteger) return true; - int val = (int) Convert.ChangeType (Value, typeof(int)); - return (val != -1); - } - } - - protected override void Initialize () - { - base.Initialize (); - - if (Property.Minimum != null && Property.PropertyType == typeof(int)) { - int min = (int) Convert.ChangeType (Property.Minimum, typeof(int)); - optInteger = (min == -1); - } else - optInteger = false; - } - - public override void GetSize (int availableWidth, out int width, out int height) - { - if (HasValue) - base.GetSize (availableWidth, out width, out height); - else - width = height = 0; - } - - public override void Render (Gdk.Drawable window, Gdk.Rectangle bounds, Gtk.StateType state) - { - if (HasValue) - base.Render (window, bounds, state); - } - - protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state) - { - if (optInteger) - return new OptIntRange (0, null); - else - return new IntRangeEditor (); - } - } - - public class IntRangeEditor : Gtk.SpinButton, IPropertyEditor { - - Type propType; - - public IntRangeEditor () : base (0, 0, 1.0) - { - this.HasFrame = false; - } - - public void Initialize (PropertyDescriptor prop) - { - propType = prop.PropertyType; - - double min, max; - - switch (Type.GetTypeCode (propType)) { - case TypeCode.Int16: - min = (double) Int16.MinValue; - max = (double) Int16.MaxValue; - break; - case TypeCode.UInt16: - min = (double) UInt16.MinValue; - max = (double) UInt16.MaxValue; - break; - case TypeCode.Int32: - min = (double) Int32.MinValue; - max = (double) Int32.MaxValue; - break; - case TypeCode.UInt32: - min = (double) UInt32.MinValue; - max = (double) UInt32.MaxValue; - break; - case TypeCode.Int64: - min = (double) Int64.MinValue; - max = (double) Int64.MaxValue; - break; - case TypeCode.UInt64: - min = (double) UInt64.MinValue; - max = (double) UInt64.MaxValue; - break; - case TypeCode.Byte: - min = (double) Byte.MinValue; - max = (double) Byte.MaxValue; - break; - case TypeCode.SByte: - min = (double) SByte.MinValue; - max = (double) SByte.MaxValue; - break; - default: - throw new ApplicationException ("IntRange editor does not support editing values of type " + prop.PropertyType); - } - - if (prop.Minimum != null) - min = (double) Convert.ChangeType (prop.Minimum, typeof(double)); - if (prop.Maximum != null) - max = (double) Convert.ChangeType (prop.Maximum, typeof(double)); - - SetRange (min, max); - } - - public void AttachObject (object ob) - { - } - - object IPropertyEditor.Value { - get { return Convert.ChangeType (base.Value, propType); } - set { base.Value = (double) Convert.ChangeType (value, typeof(double)); } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/NonContainerWarningDialog.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/NonContainerWarningDialog.cs deleted file mode 100644 index bca392b89c1..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/NonContainerWarningDialog.cs +++ /dev/null @@ -1,53 +0,0 @@ - -using System; -using Mono.Unix; - -namespace Stetic.Editor -{ - public delegate void ShowUrlDelegate (string url); - - public class NonContainerWarningDialog: IDisposable - { - #pragma warning disable 649 // never assigned - [Glade.Widget] Gtk.CheckButton showCheck; - [Glade.Widget] Gtk.Button linkButton; - [Glade.Widget] Gtk.Button okbutton; - [Glade.Widget ("AddNonContainerDialog")] Gtk.Dialog dialog; - #pragma warning restore 649 - - public static ShowUrlDelegate ShowUrl; - - public NonContainerWarningDialog() - { - Glade.XML xml = new Glade.XML (null, "stetic.glade", "AddNonContainerDialog", null); - xml.Autoconnect (this); - - ((Gtk.Label)linkButton.Child).Markup = "" + Catalog.GetString ("GTK# Widget Layout and Packing") + ""; - - linkButton.Clicked += delegate { - if (ShowUrl != null) - ShowUrl ("http://www.mono-project.com/GtkSharp:_Widget_Layout_and_Packing"); - }; - okbutton.HasFocus = true; - } - - public bool ShowAgain { - get { return !showCheck.Active; } - set { showCheck.Active = !value; } - } - - public Gtk.Window TransientFor { - set { dialog.TransientFor = value; } - } - - public int Run () - { - return dialog.Run (); - } - - public void Dispose () - { - dialog.Destroy (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/OptIntRange.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/OptIntRange.cs deleted file mode 100644 index 784c41f33b8..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/OptIntRange.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; - -namespace Stetic.Editor { - - public class OptIntRange : Gtk.HBox, IPropertyEditor { - - Gtk.CheckButton check; - Gtk.SpinButton spin; - object omin, omax; - - public OptIntRange () : base (false, 6) - { - } - - public OptIntRange (object omin, object omax) : base (false, 6) - { - this.omin = omin; - this.omax = omax; - } - - public void Initialize (PropertyDescriptor prop) - { - if (prop.PropertyType != typeof(int)) - throw new ApplicationException ("OptIntRange editor does not support editing values of type " + prop.PropertyType); - - double min = (double) Int32.MinValue; - double max = (double) Int32.MaxValue; - - if (omin == null) - omin = prop.Minimum; - if (omax == null) - omax = prop.Maximum; - - if (omin != null) - min = (double) Convert.ChangeType (omin, typeof(double)); - if (omax != null) - max = (double) Convert.ChangeType (omax, typeof(double)); - - check = new Gtk.CheckButton (); - check.Show (); - check.Toggled += check_Toggled; - PackStart (check, false, false, 0); - - spin = new Gtk.SpinButton (min, max, 1.0); - spin.Show (); - spin.HasFrame = false; - spin.ValueChanged += spin_ValueChanged; - PackStart (spin, true, true, 0); - } - - public void AttachObject (object ob) - { - } - - void check_Toggled (object o, EventArgs args) - { - spin.Sensitive = check.Active; - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } - - void spin_ValueChanged (object o, EventArgs args) - { - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } - - public object Value { - get { - if (check.Active) - return (int)spin.Value; - else - return -1; - } - set { - int val = (int) value; - if (val == -1) { - check.Active = false; - spin.Sensitive = false; - } else { - check.Active = true; - spin.Sensitive = true; - spin.Value = (double)val; - } - } - } - - public event EventHandler ValueChanged; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ProjectIconList.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ProjectIconList.cs deleted file mode 100644 index ff6a2fcce9a..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ProjectIconList.cs +++ /dev/null @@ -1,29 +0,0 @@ - -using System; -using System.Collections; -using Gtk; - -namespace Stetic.Editor -{ - class ProjectIconList : IconList - { - IProject project; - ProjectIconFactory icons; - - public ProjectIconList (IProject project, ProjectIconFactory icons) - { - this.project = project; - this.icons = icons; - Refresh (); - } - - public void Refresh () - { - Clear (); - foreach (ProjectIconSet icon in icons.Icons) - AddIcon (icon.Name, icon.Sources [0].Image.GetThumbnail (project, 16), icon.Name); - } - } -} - - diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ProjectIconSelectorItem.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ProjectIconSelectorItem.cs deleted file mode 100644 index fe5683918c2..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ProjectIconSelectorItem.cs +++ /dev/null @@ -1,21 +0,0 @@ - -using System; - -namespace Stetic.Editor -{ - public class ProjectIconSelectorItem: IconSelectorItem - { - IProject project; - - public ProjectIconSelectorItem (IProject project): base ("Project Icons") - { - this.project = project; - } - - protected override void CreateIcons () - { - foreach (ProjectIconSet icon in project.IconFactory.Icons) - AddIcon (icon.Name, icon.Sources [0].Image.GetScaledImage (project, Gtk.IconSize.Menu), icon.Name); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/PropertyTextEditor.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/PropertyTextEditor.cs deleted file mode 100644 index 6f8c996c110..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/PropertyTextEditor.cs +++ /dev/null @@ -1,83 +0,0 @@ - -using System; -using Gtk; -using Gdk; - -namespace Stetic.Editor -{ - public class PropertyTextEditor: Gtk.HBox, IPropertyEditor - { - protected Gtk.Entry entry; - protected Gtk.Button button; - PropertyDescriptor prop; - object obj; - - public PropertyTextEditor() - { - Spacing = 3; - entry = new Entry (); - entry.HasFrame = false; - PackStart (entry, true, true, 0); - button = new Button ("..."); - button.Relief = ReliefStyle.Half; - PackStart (button, false, false, 0); - button.Clicked += ButtonClicked; - entry.Activated += TextChanged; - ShowAll (); - } - - void ButtonClicked (object s, EventArgs a) - { - using (TextEditorDialog dlg = new TextEditorDialog ()) { - dlg.Text = entry.Text; - dlg.SetTranslatable (prop.Translatable); - dlg.TransientFor = this.Toplevel as Gtk.Window; - if (prop.Translatable) { - dlg.Translated = prop.IsTranslated (obj); - dlg.ContextHint = prop.TranslationContext (obj); - dlg.Comment = prop.TranslationComment (obj); - } - if (dlg.Run () == (int) ResponseType.Ok) { - if (prop.Translatable) { - prop.SetTranslated (obj, dlg.Translated); - if (dlg.Translated) { - prop.SetTranslationComment (obj, dlg.Comment); - prop.SetTranslationContext (obj, dlg.ContextHint); - } - } - entry.Text = dlg.Text; - TextChanged (null, null); - } - } - } - - void TextChanged (object s, EventArgs a) - { - if (ValueChanged != null) - ValueChanged (this, a); - } - - public void Initialize (PropertyDescriptor descriptor) - { - if (descriptor.PropertyType != typeof(string)) - throw new InvalidOperationException ("TextEditor only can edit string properties"); - prop = descriptor; - } - - public void AttachObject (object obj) - { - this.obj = obj; - } - - // Gets/Sets the value of the editor. If the editor supports - // several value types, it is the responsibility of the editor - // to return values with the expected type. - public object Value { - get { return entry.Text; } - set { entry.Text = value != null ? (string) value : ""; } - } - - // To be fired when the edited value changes. - public event EventHandler ValueChanged; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ResponseId.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ResponseId.cs deleted file mode 100644 index bc7ef54bab9..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ResponseId.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using System.Collections; -using System.Reflection; - -namespace Stetic.Editor -{ - public class ResponseId: PropertyEditorCell - { - protected override string GetValueText () - { - if (Value == null) - return ""; - - int val = (int) Value; - EnumDescriptor enm = Registry.LookupEnum ("Gtk.ResponseType"); - foreach (Enum value in enm.Values) { - if (Convert.ToInt32 (enm[value].Value) == val) { - return enm[value].Label; - } - } - return val.ToString (); - } - - protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state) - { - return new ResponseIdEditor (); - } - } - - public class ResponseIdEditor : Gtk.HBox, IPropertyEditor { - - Gtk.ComboBoxEntry combo; - Gtk.Entry entry; - EnumDescriptor enm; - ArrayList values; - - public ResponseIdEditor () - { - combo = Gtk.ComboBoxEntry.NewText (); - combo.Changed += combo_Changed; - combo.Show (); - PackStart (combo, true, true, 0); - - entry = combo.Child as Gtk.Entry; - entry.Changed += entry_Changed; - - enm = Registry.LookupEnum ("Gtk.ResponseType"); - values = new ArrayList (); - foreach (Enum value in enm.Values) { - if (enm[value].Label != "") { - combo.AppendText (enm[value].Label); - values.Add (Convert.ToInt32 (enm[value].Value)); - } - } - } - - public void Initialize (PropertyDescriptor prop) - { - if (prop.PropertyType != typeof(int)) - throw new ApplicationException ("ResponseId editor does not support editing values of type " + prop.PropertyType); - } - - public void AttachObject (object ob) - { - } - - public object Value { - get { - if (combo.Active != -1) - return (int)values[combo.Active]; - else { - try { - return Int32.Parse (entry.Text); - } catch { - return 0; - } - } - } - set { - combo.Active = values.IndexOf ((int)value); - if (combo.Active == -1) - entry.Text = value.ToString (); - } - } - - public event EventHandler ValueChanged; - - void combo_Changed (object o, EventArgs args) - { - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } - - void entry_Changed (object o, EventArgs args) - { - if (combo.Active == -1 && ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/SelectIconDialog.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/SelectIconDialog.cs deleted file mode 100644 index 75499beb269..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/SelectIconDialog.cs +++ /dev/null @@ -1,178 +0,0 @@ - -using System; -using Mono.Unix; - -namespace Stetic.Editor -{ - public class SelectIconDialog: IDisposable - { - #pragma warning disable 649 // never assigned - [Glade.Widget] Gtk.Entry stockIconEntry; - [Glade.Widget] Gtk.Notebook notebook; - [Glade.Widget] Gtk.ScrolledWindow iconScrolledwindow; - [Glade.Widget] Gtk.ScrolledWindow customIconScrolledwindow; - [Glade.Widget] Gtk.Image previewIcon; - [Glade.Widget] Gtk.Button okButton; - [Glade.Widget] Gtk.Widget labelWarningIcon; - [Glade.Widget ("SelectIconDialog")] Gtk.Dialog dialog; - #pragma warning restore 649 - - StockIconList iconList; - ProjectIconList customIconList; - - Gtk.Window parent; - Stetic.IProject project; - - public SelectIconDialog (Gtk.Window parent, Stetic.IProject project) - { - this.parent = parent; - this.project = project; - - Glade.XML xml = new Glade.XML (null, "stetic.glade", "SelectIconDialog", null); - xml.Autoconnect (this); - - // Stock icon list - - iconList = new StockIconList (); - iconList.SelectionChanged += new EventHandler (OnIconSelectionChanged); - iconScrolledwindow.AddWithViewport (iconList); - - // Custom icon list - - customIconList = new ProjectIconList (project, project.IconFactory); - customIconList.SelectionChanged += new EventHandler (OnCustomIconSelectionChanged); - customIconScrolledwindow.AddWithViewport (customIconList); - dialog.ShowAll (); - - UpdateIconSelection (); - UpdateButtons (); - } - - public int Run () - { - dialog.Show (); - dialog.TransientFor = parent; - return dialog.Run (); - } - - public void Dispose () - { - dialog.Destroy (); - } - - public string Icon { - get { - if (notebook.Page == 0) { - if (stockIconEntry.Text.Length == 0) - return null; - return stockIconEntry.Text; - } else { - return customIconList.Selection; - } - } - set { - if (value == null) - return; - - if (project.IconFactory.GetIcon (value) != null) { - notebook.Page = 1; - customIconList.Selection = value; - } else { - stockIconEntry.Text = value; - iconList.Selection = value; - notebook.Page = 0; - } - } - } - - void UpdateButtons () - { - okButton.Sensitive = Icon != null; - } - - protected void OnCurrentPageChanged (object s, Gtk.SwitchPageArgs args) - { - UpdateButtons (); - } - - void OnIconSelectionChanged (object s, EventArgs args) - { - if (iconList.Selection != null) { - stockIconEntry.Text = iconList.Selection; - } - } - - void OnCustomIconSelectionChanged (object s, EventArgs args) - { - UpdateButtons (); - } - - void UpdateIconSelection () - { - labelWarningIcon.Visible = stockIconEntry.Text.Length > 0 && (!stockIconEntry.Text.StartsWith ("gtk-")); - - Gdk.Pixbuf icon = null; - if (stockIconEntry.Text.Length > 0) { - icon = WidgetUtils.LoadIcon (stockIconEntry.Text, Gtk.IconSize.Menu); - } - if (icon == null) - icon = WidgetUtils.MissingIcon; - previewIcon.Pixbuf = icon; - } - - protected void OnIconNameChanged (object ob, EventArgs args) - { - UpdateIconSelection (); - UpdateButtons (); - } - - protected void OnAddIcon (object ob, EventArgs args) - { - ProjectIconSet icon = new ProjectIconSet (); - using (EditIconDialog dlg = new EditIconDialog (project, icon)) { - if (parent != null) - dlg.TransientFor = parent.Toplevel as Gtk.Window; - if (dlg.Run () == (int) Gtk.ResponseType.Ok) { - project.IconFactory.Icons.Add (icon); - customIconList.Refresh (); - customIconList.Selection = icon.Name; - project.Modified = true; - } - } - } - - protected void OnRemoveIcon (object ob, EventArgs args) - { - string name = customIconList.Selection; - ProjectIconSet icon = project.IconFactory.GetIcon (name); - if (icon != null) { - Gtk.MessageDialog md = new Gtk.MessageDialog (dialog, Gtk.DialogFlags.Modal, Gtk.MessageType.Question, Gtk.ButtonsType.YesNo, string.Format (Catalog.GetString ("Are you sure you want to delete the icon '{0}'"), icon.Name)); - if (parent != null) - md.TransientFor = parent.Toplevel as Gtk.Window; - if (md.Run () == (int) Gtk.ResponseType.Yes) { - project.IconFactory.Icons.Remove (icon); - customIconList.Refresh (); - project.Modified = true; - } - md.Destroy (); - } - } - - protected void OnEditIcon (object ob, EventArgs args) - { - string name = customIconList.Selection; - ProjectIconSet icon = project.IconFactory.GetIcon (name); - if (icon != null) { - using (EditIconDialog dlg = new EditIconDialog (project, icon)) { - if (parent != null) - dlg.TransientFor = parent.Toplevel as Gtk.Window; - if (dlg.Run () == (int) Gtk.ResponseType.Ok) { - customIconList.Refresh (); - customIconList.Selection = icon.Name; - project.Modified = true; - } - } - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/SelectImageDialog.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/SelectImageDialog.cs deleted file mode 100644 index c8d7db902cb..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/SelectImageDialog.cs +++ /dev/null @@ -1,317 +0,0 @@ - -using System; -using System.Collections; -using System.IO; -using Gtk; - -namespace Stetic.Editor -{ - public class SelectImageDialog: IDisposable - { - #pragma warning disable 649 // never assigned - [Glade.Widget] Gtk.TreeView resourceList; - [Glade.Widget] Gtk.FileChooserWidget fileChooser; - [Glade.Widget] Gtk.Entry iconNameEntry; - [Glade.Widget] Gtk.Notebook notebook; - [Glade.Widget] Gtk.ScrolledWindow iconScrolledwindow; - [Glade.Widget] Gtk.Image previewIcon; - [Glade.Widget] Gtk.Image previewResource; - [Glade.Widget] Gtk.ComboBox iconSizeCombo; - [Glade.Widget] Gtk.Entry resourceNameEntry; - [Glade.Widget] Gtk.Button okButton; - [Glade.Widget] Gtk.Button buttonAdd; - [Glade.Widget] Gtk.Button buttonRemove; - [Glade.Widget ("SelectImageDialog")] Gtk.Dialog dialog; - #pragma warning restore 649 - - ThemedIconList iconList; - - Gtk.ListStore resourceListStore; - Gtk.Window parent; - - int thumbnailSize = 30; - Hashtable resources = new Hashtable (); // Stores resourceName -> thumbnail pixbuf - Gdk.Pixbuf missingThumbnail; - IResourceProvider resourceProvider; - string importedImageFile; - Stetic.IProject project; - - public SelectImageDialog (Gtk.Window parent, Stetic.IProject project) - { - this.parent = parent; - this.project = project; - Glade.XML xml = new Glade.XML (null, "stetic.glade", "SelectImageDialog", null); - xml.Autoconnect (this); - - // Stock icon list - - iconList = new ThemedIconList (); - iconList.SelectionChanged += new EventHandler (OnIconSelectionChanged); - iconScrolledwindow.AddWithViewport (iconList); - - // Icon Sizes - - foreach (IconSize s in Enum.GetValues (typeof(Gtk.IconSize))) { - if (s != IconSize.Invalid) - iconSizeCombo.AppendText (s.ToString ()); - } - iconSizeCombo.Active = 0; - - // Resource list - - resourceListStore = new Gtk.ListStore (typeof(Gdk.Pixbuf), typeof(string), typeof(string)); - resourceList.Model = resourceListStore; - - Gtk.TreeViewColumn col = new Gtk.TreeViewColumn (); - - Gtk.CellRendererPixbuf pr = new Gtk.CellRendererPixbuf (); - pr.Xpad = 3; - col.PackStart (pr, false); - col.AddAttribute (pr, "pixbuf", 0); - - Gtk.CellRendererText crt = new Gtk.CellRendererText (); - col.PackStart (crt, true); - col.AddAttribute (crt, "markup", 1); - - resourceList.AppendColumn (col); - resourceProvider = project.ResourceProvider; - if (resourceProvider == null) { - buttonAdd.Sensitive = false; - buttonRemove.Sensitive = false; - } - FillResources (); - resourceList.Selection.Changed += OnResourceSelectionChanged; - - if (project.FileName != null) - fileChooser.SetCurrentFolder (project.ImagesRootPath); - - fileChooser.SelectionChanged += delegate (object s, EventArgs a) { - UpdateButtons (); - }; - - fileChooser.FileActivated += delegate (object s, EventArgs a) { - if (Icon != null) { - if (Validate ()) - dialog.Respond (Gtk.ResponseType.Ok); - } - }; - - okButton.Clicked += OnOkClicked; - - UpdateButtons (); - } - - public int Run () - { - dialog.ShowAll (); - dialog.TransientFor = parent; - return dialog.Run (); - } - - public void Dispose () - { - dialog.Destroy (); - } - - public ImageInfo Icon { - get { - if (notebook.Page == 0) { - if (iconNameEntry.Text.Length == 0) - return null; - return ImageInfo.FromTheme (iconNameEntry.Text, SelectedIconSize); - } else if (notebook.Page == 1) { - if (resourceNameEntry.Text.Length == 0) - return null; - return ImageInfo.FromResource (resourceNameEntry.Text); - } else { - if (importedImageFile != null) - return ImageInfo.FromFile (importedImageFile); - if (fileChooser.Filename == null || fileChooser.Filename.Length == 0 || !File.Exists (fileChooser.Filename)) - return null; - return ImageInfo.FromFile (fileChooser.Filename); - } - } - set { - if (value == null) - return; - if (value.Source == ImageSource.Theme) { - iconNameEntry.Text = value.Name; - SelectedIconSize = value.ThemeIconSize; - notebook.Page = 0; - } else if (value.Source == ImageSource.Resource) { - notebook.Page = 1; - resourceNameEntry.Text = value.Name; - } else { - fileChooser.SetFilename (value.Name); - notebook.Page = 2; - } - } - } - - Gtk.IconSize SelectedIconSize { - get { return (IconSize) iconSizeCombo.Active + 1; } - set { iconSizeCombo.Active = ((int) value) - 1; } - } - - void UpdateButtons () - { - okButton.Sensitive = Icon != null; - } - - protected void OnCurrentPageChanged (object s, Gtk.SwitchPageArgs args) - { - UpdateButtons (); - } - - void OnIconSelectionChanged (object s, EventArgs args) - { - if (iconList.Selection != null) { - iconNameEntry.Text = iconList.Selection; - } - } - - void UpdateIconSelection () - { - Gdk.Pixbuf icon = null; - if (iconNameEntry.Text.Length > 0) { - icon = WidgetUtils.LoadIcon (iconNameEntry.Text, SelectedIconSize); - } - if (icon == null) - icon = WidgetUtils.MissingIcon; - previewIcon.Pixbuf = icon; - } - - protected void OnIconSizeChanged (object ob, EventArgs args) - { - UpdateIconSelection (); - } - - protected void OnIconNameChanged (object ob, EventArgs args) - { - UpdateIconSelection (); - UpdateButtons (); - } - - void FillResources () - { - resourceListStore.Clear (); - resources.Clear (); - if (resourceProvider != null) { - foreach (ResourceInfo res in resourceProvider.GetResources ()) { - if (res.MimeType.StartsWith ("image/")) { - AppendResource (resourceProvider.GetResourceStream (res.Name), res.Name); - } - } - } - } - - void AppendResource (Stream stream, string name) - { - try { - Gdk.Pixbuf pix = new Gdk.Pixbuf (stream); - string txt = name + "\n" + pix.Width + " x " + pix.Height + ""; - pix = GetThumbnail (pix); - resourceListStore.AppendValues (pix, txt, name); - resources [name] = pix; - } catch { - // Doesn't look like a valid image. Just ignore it. - } finally { - stream.Dispose (); - } - } - - Gdk.Pixbuf GetThumbnail (Gdk.Pixbuf pix) - { - if (pix.Width > pix.Height) { - if (pix.Width > thumbnailSize) { - float prop = (float) pix.Height / (float) pix.Width; - return pix.ScaleSimple (thumbnailSize, (int)(thumbnailSize * prop), Gdk.InterpType.Bilinear); - } - } else { - if (pix.Height > thumbnailSize) { - float prop = (float) pix.Width / (float) pix.Height; - return pix.ScaleSimple ((int)(thumbnailSize * prop), thumbnailSize, Gdk.InterpType.Bilinear); - } - } - return pix; - } - - void OnResourceSelectionChanged (object obj, EventArgs args) - { - Gtk.TreeIter iter; - Gtk.TreeModel model; - if (!resourceList.Selection.GetSelected (out model, out iter)) { - resourceNameEntry.Text = ""; - } else { - resourceNameEntry.Text = (string) resourceListStore.GetValue (iter, 2); - } - } - - protected void OnResourceNameChanged (object ob, EventArgs args) - { - Gdk.Pixbuf pix = (Gdk.Pixbuf) resources [resourceNameEntry.Text]; - if (pix != null) - previewResource.Pixbuf = pix; - else { - if (missingThumbnail == null) - missingThumbnail = WidgetUtils.MissingIcon; - previewResource.Pixbuf = missingThumbnail; - } - UpdateButtons (); - } - - protected void OnAddResource (object ob, EventArgs args) - { - FileChooserDialog dialog = - new FileChooserDialog ("Open File", null, FileChooserAction.Open, - Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, - Gtk.Stock.Open, Gtk.ResponseType.Ok); - if (parent != null) - dialog.TransientFor = parent.Toplevel as Gtk.Window; - int response = dialog.Run (); - if (response == (int)Gtk.ResponseType.Ok) { - ResourceInfo rinfo = resourceProvider.AddResource (dialog.Filename); - AppendResource (resourceProvider.GetResourceStream (rinfo.Name), rinfo.Name); - resourceNameEntry.Text = rinfo.Name; - } - dialog.Destroy (); - } - - protected void OnRemoveResource (object ob, EventArgs args) - { - Gtk.TreeIter iter; - Gtk.TreeModel model; - if (resourceList.Selection.GetSelected (out model, out iter)) { - string res = (string) resourceListStore.GetValue (iter, 2); - Gtk.MessageDialog msg = new Gtk.MessageDialog (dialog, DialogFlags.Modal, MessageType.Question, ButtonsType.YesNo, "Are you sure you want to delete the resource '{0}'?", res); - if (parent != null) - msg.TransientFor = parent.Toplevel as Gtk.Window; - if (msg.Run () == (int) ResponseType.Yes) { - resourceProvider.RemoveResource (res); - resourceListStore.Remove (ref iter); - } - msg.Destroy (); - } - } - - bool Validate () - { - if (notebook.Page == 2) { - if (fileChooser.Filename == null || fileChooser.Filename.Length == 0 || !File.Exists (fileChooser.Filename)) - return true; - - importedImageFile = project.ImportFile (fileChooser.Filename); - if (importedImageFile != null) - importedImageFile = WidgetUtils.AbsoluteToRelativePath (project.ImagesRootPath, importedImageFile); - return importedImageFile != null; - } - return true; - } - - void OnOkClicked (object s, EventArgs args) - { - if (Validate ()) - dialog.Respond (Gtk.ResponseType.Ok); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/StockIconList.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/StockIconList.cs deleted file mode 100644 index b8c56769909..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/StockIconList.cs +++ /dev/null @@ -1,27 +0,0 @@ - -using System; -using System.Reflection; -using System.Collections; -using Gtk; - -namespace Stetic.Editor -{ - class StockIconList : IconList - { - public StockIconList () - { - foreach (PropertyInfo info in typeof (Gtk.Stock).GetProperties (BindingFlags.Public | BindingFlags.Static)) { - if (info.CanRead && info.PropertyType == typeof (string)) { - string name = (string) info.GetValue (null, null); - AddIcon (name, WidgetUtils.LoadIcon (name, Gtk.IconSize.Menu), name); - } - } - foreach (PropertyInfo info in GnomeStock.Properties) { - if (info.CanRead && info.PropertyType == typeof (string)) { - string name = (string) info.GetValue (null, null); - AddIcon (name, WidgetUtils.LoadIcon (name, Gtk.IconSize.Menu), name); - } - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/StockIconSelectorItem.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/StockIconSelectorItem.cs deleted file mode 100644 index bf18e604f44..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/StockIconSelectorItem.cs +++ /dev/null @@ -1,134 +0,0 @@ - -using System; -using Mono.Unix; - -namespace Stetic.Editor -{ - public class StockIconSelectorItem: IconSelectorItem - { - public StockIconSelectorItem (IntPtr ptr): base (ptr) - { - } - - public StockIconSelectorItem (): base (Catalog.GetString ("Stock Icons")) - { - } - - protected override void CreateIcons () - { - foreach (string s in StockIconHelper.StockIcons) { - if (s != "-" && s != "|") { - Gdk.Pixbuf pix = WidgetUtils.LoadIcon (s, Gtk.IconSize.Menu); - if (pix != null) AddIcon (s, pix, s); - } - else - AddSeparator (s); - } - } - } - - class StockIconHelper - { - public static string[] StockIcons = { - // Commands - "gtk-new", - "gtk-open", - "gtk-save", - "gtk-save-as", - "gtk-revert-to-saved", - "gtk-quit", - "gtk-print", - "gtk-print-preview", - "gtk-properties", - "|", - "gtk-cut", - "gtk-copy", - "gtk-paste", - "gtk-delete", - "gtk-undelete", - "gtk-undo", - "gtk-redo", - "gtk-preferences", - "|", - "gtk-execute", - "gtk-stop", - "gtk-refresh", - "gtk-find", - "gtk-find-and-replace", - "|", - "gtk-spell-check", - "gtk-convert", - "gtk-help", - "|", - "gtk-add", - "gtk-remove", - "gtk-clear", - "-", - - // Formatting - "gtk-bold", - "gtk-italic", - "gtk-underline", - "gtk-strikethrough", - "gtk-select-color", - "gtk-select-font", - "|", - "gtk-indent", - "gtk-unindent", - "gtk-justify-center", - "gtk-justify-fill", - "gtk-justify-left", - "gtk-justify-right", - "|", - "gtk-sort-ascending", - "gtk-sort-descending", - "|", - "gtk-zoom-100", - "gtk-zoom-fit", - "gtk-zoom-in", - "gtk-zoom-out", - "-", - - - // Dialog - "gtk-yes", - "gtk-no", - "gtk-cancel", - "gtk-ok", - "gtk-apply", - "gtk-close", - "|", - "gtk-dialog-error", - "gtk-dialog-info", - "gtk-dialog-question", - "gtk-dialog-warning", - "-", - - // Navigation - "gtk-goto-bottom", - "gtk-goto-first", - "gtk-goto-last", - "gtk-goto-top", - "|", - "gtk-go-back", - "gtk-go-down", - "gtk-go-forward", - "gtk-go-up", - "|", - "gtk-home", - "gtk-jump-to", - "-", - - // Misc - "gtk-cdrom", - "gtk-floppy", - "gtk-harddisk", - "gtk-network", - "gtk-color-picker", - "gtk-dnd", - "gtk-dnd-multiple", - "gtk-missing-image", - "gtk-index" - }; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/StockItem.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/StockItem.cs deleted file mode 100644 index 5d9ed308da6..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/StockItem.cs +++ /dev/null @@ -1,200 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; - -namespace Stetic.Editor { - - internal static class GnomeStock { - - static string blank; - static List props = new List (); - - static GnomeStock () - { - try { - Assembly assm = Assembly.Load ("gnome-sharp, Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f"); - if (assm == null) - return; - - Type type = assm.GetType ("Gnome.Stock"); - if (type == null) - return; - - foreach (PropertyInfo info in type.GetProperties (BindingFlags.Static | BindingFlags.Public)) { - if (info.Name == "Blank") - blank = (string) info.GetValue (null, null); - props.Add (info); - } - } catch { - } - } - - public static string Blank { - get { return blank == null ? Gtk.Stock.New : blank; } - } - - public static List Properties { - get { return props; } - } - } - - public class StockItem: BaseImageCell - { - string label; - - protected override void Initialize () - { - base.Initialize (); - string name = (string)Value; - if (name != null) { - Stetic.ObjectWrapper w = Stetic.ObjectWrapper.Lookup (Instance); - Stetic.IProject project = w.Project; - Gdk.Pixbuf px = project.IconFactory.RenderIcon (project, name, ImageSize); - if (px != null) { - Image = px; - label = name; - return; - } - - Gtk.StockItem item = Gtk.Stock.Lookup (name); - label = item.Label != null && item.Label.Length > 0 ? item.Label : name; - label = label.Replace ("_", ""); - - Gtk.IconSet iset = Gtk.IconFactory.LookupDefault (name); - if (iset == null) - Image = WidgetUtils.MissingIcon; - else - Image = iset.RenderIcon (new Gtk.Style (), Gtk.TextDirection.Ltr, Gtk.StateType.Normal, Gtk.IconSize.Menu, null, ""); - } else { - Image = null; - label = ""; - } - } - - protected override string GetValueText () - { - return label; - } - - protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state) - { - return new StockItemEditor (); - } - } - -/* [PropertyEditor ("StockId", "Changed")] - public class StockItemEditor : Image { - - public StockItemEditor () : base (true, false) { } - - public override object Value { - get { return StockId; } - set { StockId = (string) value; } - } - } - */ - - public class StockItemEditor: Gtk.HBox, IPropertyEditor - { - Gtk.Image image; - Gtk.Entry entry; - Gtk.Button button; - string icon; - IProject project; - Gtk.Frame imageFrame; - - public StockItemEditor() - { - Spacing = 3; - imageFrame = new Gtk.Frame (); - imageFrame.Shadow = Gtk.ShadowType.In; - imageFrame.BorderWidth = 2; - PackStart (imageFrame, false, false, 0); - - image = new Gtk.Image (GnomeStock.Blank, Gtk.IconSize.Button); - imageFrame.Add (image); - - entry = new Gtk.Entry (); - entry.Changed += OnTextChanged; - entry.HasFrame = false; - PackStart (entry, true, true, 0); - - button = new Gtk.Button (); - button.Add (new Gtk.Arrow (Gtk.ArrowType.Down, Gtk.ShadowType.Out)); - PackStart (button, false, false, 0); - button.Clicked += button_Clicked; - ShowAll (); - } - - void button_Clicked (object obj, EventArgs args) - { - IconSelectorMenu menu = new IconSelectorMenu (project); - menu.IconSelected += OnStockSelected; - menu.ShowAll (); - menu.Popup (null, null, new Gtk.MenuPositionFunc (OnDropMenuPosition), 3, Gtk.Global.CurrentEventTime); - } - - void OnDropMenuPosition (Gtk.Menu menu, out int x, out int y, out bool pushIn) - { - button.ParentWindow.GetOrigin (out x, out y); - x += button.Allocation.X; - y += button.Allocation.Y + button.Allocation.Height; - pushIn = true; - } - - void OnStockSelected (object s, IconEventArgs args) - { - Value = args.IconId; - } - - void OnTextChanged (object s, EventArgs a) - { - if (entry.Text.Length == 0) - Value = null; - else - Value = entry.Text; - } - - // Called once to initialize the editor. - public void Initialize (PropertyDescriptor prop) - { - if (prop.PropertyType != typeof(string)) - throw new ApplicationException ("StockItem editor does not support editing values of type " + prop.PropertyType); - } - - // Called when the object to be edited changes. - public void AttachObject (object obj) - { - Stetic.ObjectWrapper w = Stetic.ObjectWrapper.Lookup (obj); - project = w.Project; - } - - // Gets/Sets the value of the editor. If the editor supports - // several value types, it is the responsibility of the editor - // to return values with the expected type. - public object Value { - get { return icon; } - set { - icon = (string) value; - if (icon != null && icon.Length > 0) { - entry.Text = icon; - Gdk.Pixbuf px = project.IconFactory.RenderIcon (project, icon, Gtk.IconSize.Menu); - if (px == null) - px = WidgetUtils.LoadIcon (icon, Gtk.IconSize.Menu); - image.Pixbuf = px; - imageFrame.Show (); - } else { - imageFrame.Hide (); - entry.Text = ""; - } - - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } - } - - // To be fired when the edited value changes. - public event EventHandler ValueChanged; - } - -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/String.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/String.cs deleted file mode 100644 index dafbb3922a5..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/String.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; - -namespace Stetic.Editor { - - [PropertyEditor ("Text", "Changed")] - public class String : Translatable { - - Gtk.Entry entry; - - public override void Initialize (PropertyDescriptor prop) - { - base.Initialize (prop); - - entry = new Gtk.Entry (); - entry.HasFrame = false; - entry.Show (); - entry.Changed += EntryChanged; - Add (entry); - } - - protected override void CheckType (PropertyDescriptor prop) - { - if (prop.PropertyType != typeof(string)) - throw new ApplicationException ("String editor does not support editing values of type " + prop.PropertyType); - } - - public override object Value { - get { - return entry.Text; - } - set { - if (value == null) - entry.Text = ""; - else - entry.Text = (string) value; - } - } - - void EntryChanged (object obj, EventArgs args) - { - OnValueChanged (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/StringArray.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/StringArray.cs deleted file mode 100644 index ca8d5bd0641..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/StringArray.cs +++ /dev/null @@ -1,99 +0,0 @@ - -using System; -using Gtk; -using Gdk; -using System.Text; - -namespace Stetic.Editor -{ - public class StringArray: PropertyEditorCell - { - protected override string GetValueText () - { - string[] val = (string[]) Value; - return val == null ? string.Empty : "(Collection)"; - } - - protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state) - { - return new StringArrayEditor (); - } - } - - public class StringArrayEditor: Gtk.HBox, IPropertyEditor - { - Gtk.Entry label; - Gtk.Button button; - PropertyDescriptor prop; - object obj; - string[] strings; - - public StringArrayEditor() - { - label = new Gtk.Entry (); - label.IsEditable = false; - PackStart (label, true, true, 0); - button = new Button ("..."); - PackStart (button, false, false, 3); - button.Clicked += ButtonClicked; - ShowAll (); - } - - void ButtonClicked (object s, EventArgs a) - { - using (TextEditorDialog dlg = new TextEditorDialog ()) { - dlg.Text = strings != null ? string.Join ("\n", strings) : ""; - dlg.SetTranslatable (prop.Translatable); - dlg.TransientFor = this.Toplevel as Gtk.Window; - if (prop.Translatable) { - dlg.Translated = prop.IsTranslated (obj); - dlg.ContextHint = prop.TranslationContext (obj); - dlg.Comment = prop.TranslationComment (obj); - } - if (dlg.Run () == (int) ResponseType.Ok) { - if (prop.Translatable) { - prop.SetTranslated (obj, dlg.Translated); - if (dlg.Translated) { - prop.SetTranslationComment (obj, dlg.Comment); - prop.SetTranslationContext (obj, dlg.ContextHint); - } - } - if (dlg.Text.Length == 0) - strings = null; - else - strings = dlg.Text.Split ('\n'); - UpdateLabel (); - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } - } - } - - public void Initialize (PropertyDescriptor descriptor) - { - if (descriptor.PropertyType != typeof(string[])) - throw new InvalidOperationException ("StringArrayEditor can only edit string[] properties"); - prop = descriptor; - } - - public void AttachObject (object obj) - { - this.obj = obj; - } - - public object Value { - get { return strings; } - set { - strings = (string[]) value; - UpdateLabel (); - } - } - - void UpdateLabel () - { - label.Text = strings != null ? "(Collection)" : System.String.Empty; - } - - public event EventHandler ValueChanged; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Text.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Text.cs deleted file mode 100644 index 4bb92de6289..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Text.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace Stetic.Editor -{ - public class Text : PropertyTextEditor - { - public Text () - { - // Don't allow editing the text in the editor - // since there is no room for multiline edit in the grid. - entry.Sensitive = false; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TextBox.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TextBox.cs deleted file mode 100644 index 6dd84a878ca..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TextBox.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; - -namespace Stetic.Editor { - - public class TextBox : Gtk.ScrolledWindow { - - Gtk.TextView textview; - - public TextBox (int nlines) - { - ShadowType = Gtk.ShadowType.In; - SetPolicy (Gtk.PolicyType.Never, Gtk.PolicyType.Automatic); - - textview = new Gtk.TextView (); - textview.WrapMode = Gtk.WrapMode.Word; - textview.Show (); - Add (textview); - - Pango.Context ctx = textview.PangoContext; - Pango.FontMetrics metrics = ctx.GetMetrics (textview.Style.FontDescription, - ctx.Language); - int lineHeight = (metrics.Ascent + metrics.Descent) / (int)Pango.Scale.PangoScale; - SetSizeRequest (-1, lineHeight * nlines); - - textview.Buffer.Changed += Buffer_Changed; - } - - public Gtk.TextView TextView { - get { - return textview; - } - } - - public string Text { - get { - return textview.Buffer.Text; - } - set { - textview.Buffer.Text = value; - } - } - - void Buffer_Changed (object obj, EventArgs args) - { - if (Changed != null) - Changed (this, EventArgs.Empty); - } - - public event EventHandler Changed; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TextEditorDialog.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TextEditorDialog.cs deleted file mode 100644 index e0c05c9283a..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TextEditorDialog.cs +++ /dev/null @@ -1,72 +0,0 @@ - -using System; - -namespace Stetic.Editor -{ - public class TextEditorDialog: IDisposable - { - #pragma warning disable 649 // never assigned - [Glade.Widget] Gtk.TextView textview; - [Glade.Widget] Gtk.CheckButton checkTranslatable; - [Glade.Widget] Gtk.Entry entryContext; - [Glade.Widget] Gtk.Entry entryComment; - [Glade.Widget] Gtk.Table translationTable; - [Glade.Widget ("TextEditorDialog")] Gtk.Dialog dialog; - #pragma warning restore 649 - - public TextEditorDialog () - { - Glade.XML xml = new Glade.XML (null, "stetic.glade", "TextEditorDialog", null); - xml.Autoconnect (this); - entryContext.Sensitive = entryComment.Sensitive = false; - } - - public string Text { - get { return textview.Buffer.Text; } - set { textview.Buffer.Text = value; } - } - - public string ContextHint { - get { return entryContext.Text; } - set { entryContext.Text = value != null ? value : ""; } - } - - public string Comment { - get { return entryComment.Text; } - set { entryComment.Text = value != null ? value : ""; } - } - - public bool Translated { - get { return checkTranslatable.Active; } - set { checkTranslatable.Active = value; } - } - - public Gtk.Window TransientFor { - set { dialog.TransientFor = value; } - } - - public void SetTranslatable (bool translatable) - { - if (!translatable) { - translationTable.Visible = false; - checkTranslatable.Visible = false; - } - } - - protected void OnTranslatableToggled (object s, EventArgs a) - { - entryContext.Sensitive = checkTranslatable.Active; - entryComment.Sensitive = checkTranslatable.Active; - } - - public int Run () - { - return dialog.Run (); - } - - public void Dispose () - { - dialog.Destroy (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ThemedIcon.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ThemedIcon.cs deleted file mode 100644 index 3da369f94c1..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ThemedIcon.cs +++ /dev/null @@ -1,162 +0,0 @@ -using Gtk; -using System; - -namespace Stetic.Editor { - - [PropertyEditor ("Value", "Changed")] - public class ThemedIcon : Gtk.HBox, IPropertyEditor { - Gtk.Image image; - Gtk.Entry entry; - Gtk.Button button; - - public ThemedIcon () : base (false, 6) - { - image = new Gtk.Image (GnomeStock.Blank, Gtk.IconSize.Button); - PackStart (image, false, false, 0); - - entry = new Gtk.Entry (); - PackStart (entry, true, true, 0); - entry.Changed += entry_Changed; - - button = new Gtk.Button ("..."); - PackStart (button, false, false, 0); - button.Clicked += button_Clicked; - } - - public void Initialize (PropertyDescriptor prop) - { - if (prop.PropertyType != typeof(string)) - throw new ApplicationException ("ThemedIcon editor does not support editing values of type " + prop.PropertyType); - } - - public void AttachObject (object ob) - { - } - - public event EventHandler ValueChanged; - - bool syncing; - - void entry_Changed (object obj, EventArgs args) - { - if (!syncing) - Value = entry.Text; - } - - void button_Clicked (object obj, EventArgs args) - { - Gtk.Window parent = (Gtk.Window)GetAncestor (Gtk.Window.GType); - Value = ThemedIconBrowser.Browse (parent, (string) Value); - } - - string icon; - public object Value { - get { - return icon; - } - set { - string val = (string) value; - if (icon == val) - return; - - icon = val; - Gdk.Pixbuf pix = WidgetUtils.LoadIcon (icon, Gtk.IconSize.Menu); - if (pix != null) { - image.Pixbuf = pix; - } else { - image.Stock = GnomeStock.Blank; - } - - syncing = true; - entry.Text = icon; - syncing = false; - - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } - } - } - - public class ThemedIconBrowser : Gtk.Dialog { - - public ThemedIconBrowser (Gtk.Window parent) : - base ("Select a Themed Icon", parent, Gtk.DialogFlags.Modal, - Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, - Gtk.Stock.Ok, Gtk.ResponseType.Ok) - { - HasSeparator = false; - BorderWidth = 12; - VBox.Spacing = 18; - VBox.BorderWidth = 0; - - DefaultResponse = Gtk.ResponseType.Ok; - - Gtk.HBox hbox = new Gtk.HBox (false, 12); - VBox.PackStart (hbox, false, false, 0); - - entry = new Gtk.Entry (); - entry.Activated += DoFind; - hbox.PackStart (entry); - - Gtk.Button button = new Gtk.Button (Gtk.Stock.Find); - button.Clicked += DoFind; - hbox.PackStart (button, false, false, 0); - - ScrolledWindow scwin = new Gtk.ScrolledWindow (); - scwin.SizeRequested += ScrolledWindowSizeRequested; - VBox.PackStart (scwin, true, true, 0); - scwin.SetPolicy (Gtk.PolicyType.Never, Gtk.PolicyType.Automatic); - scwin.ShadowType = Gtk.ShadowType.In; - - list = new ThemedIconList (); - scwin.Add (list); - list.SelectionChanged += ListSelectionChanged; - list.Activated += ListActivated; - SetResponseSensitive (Gtk.ResponseType.Ok, false); - - VBox.ShowAll (); - } - - public static string Browse (Gtk.Window parent, string selection) - { - ThemedIconBrowser browser = new ThemedIconBrowser (parent); - browser.list.Selection = selection; - int response = browser.Run (); - if (response == (int)Gtk.ResponseType.Ok) - selection = browser.list.Selection; - browser.Destroy (); - return selection; - } - - Gtk.Entry entry; - ThemedIconList list; - - void ScrolledWindowSizeRequested (object obj, SizeRequestedArgs args) - { - Gtk.Requisition req = list.SizeRequest (); - if (req.Width <= 0) - return; - - Gtk.ScrolledWindow scwin = ((Gtk.ScrolledWindow)obj); - scwin.SizeRequested -= ScrolledWindowSizeRequested; - scwin.SetSizeRequest (req.Width, req.Width * 2 / 3); - ActionArea.BorderWidth = 0; // has to happen post-realize - } - - void ListSelectionChanged (object obj, EventArgs args) - { - SetResponseSensitive (Gtk.ResponseType.Ok, list.Selection != null); - } - - void ListActivated (object obj, EventArgs args) - { - Respond (Gtk.ResponseType.Ok); - } - - void DoFind (object obj, EventArgs args) - { - list.Find (entry.Text); - } - - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ThemedIconList.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ThemedIconList.cs deleted file mode 100644 index dd1dc1a12b5..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/ThemedIconList.cs +++ /dev/null @@ -1,1018 +0,0 @@ - -using System; -using System.Collections; -using Gtk; - -namespace Stetic.Editor -{ - class ThemedIconList : IconList - { - public ThemedIconList () - { - Gtk.IconTheme theme = Gtk.IconTheme.Default; - foreach (string icon in ThemeIconNames) - AddIcon (icon, GetPixbuf (theme, icon), icon); - } - - Gdk.Pixbuf GetPixbuf (Gtk.IconTheme theme, string name) - { - try { - return theme.LoadIcon (name, 16, 0); - } catch { - return RenderIcon (name, Gtk.IconSize.Menu, null); - } - } - - public static string[] ThemeIconNames = new string[] { - // Gtk 2.6 stock icons - "gtk-about", - "gtk-add", - "gtk-apply", - "gtk-bold", - "gtk-cancel", - "gtk-cdrom", - "gtk-clear", - "gtk-close", - "gtk-color-picker", - "gtk-connect", - "gtk-convert", - "gtk-copy", - "gtk-cut", - "gtk-delete", - "gtk-dialog-authentication", - "gtk-dialog-error", - "gtk-dialog-info", - "gtk-dialog-question", - "gtk-dialog-warning", - "gtk-directory", - "gtk-disconnect", - "gtk-dnd", - "gtk-dnd-multiple", - "gtk-edit", - "gtk-execute", - "gtk-file", - "gtk-find", - "gtk-find-and-replace", - "gtk-floppy", - "gtk-go-back", - "gtk-go-down", - "gtk-go-forward", - "gtk-go-up", - "gtk-goto-bottom", - "gtk-goto-first", - "gtk-goto-last", - "gtk-goto-top", - "gtk-harddisk", - "gtk-help", - "gtk-home", - "gtk-indent", - "gtk-index", - "gtk-italic", - "gtk-jump-to", - "gtk-justify-center", - "gtk-justify-fill", - "gtk-justify-left", - "gtk-justify-right", - "gtk-media-forward", - "gtk-media-next", - "gtk-media-pause", - "gtk-media-play", - "gtk-media-previous", - "gtk-media-record", - "gtk-media-rewind", - "gtk-media-stop", - "gtk-missing-image", - "gtk-network", - "gtk-new", - "gtk-no", - "gtk-ok", - "gtk-open", - "gtk-paste", - "gtk-preferences", - "gtk-print", - "gtk-print-preview", - "gtk-properties", - "gtk-quit", - "gtk-redo", - "gtk-refresh", - "gtk-remove", - "gtk-revert-to-saved", - "gtk-save", - "gtk-save-as", - "gtk-select-color", - "gtk-select-font", - "gtk-sort-ascending", - "gtk-sort-descending", - "gtk-spell-check", - "gtk-stop", - "gtk-strikethrough", - "gtk-undelete", - "gtk-underline", - "gtk-undo", - "gtk-unindent", - "gtk-yes", - "gtk-zoom-100", - "gtk-zoom-fit", - "gtk-zoom-in", - "gtk-zoom-out", - - // Themable stock icons - "stock_about", - "stock_active", - "stock_add-bookmark", - "stock_add-decimal-place", - "stock_addressbook", - "stock_advanced-filter", - "stock_alarm", - "stock_alignment", - "stock_alignment-bottom", - "stock_alignment-centered", - "stock_alignment-centered-vertically", - "stock_alignment-left", - "stock_alignment-right", - "stock_alignment-top", - "stock_allow-effects", - "stock_anchor", - "stock_animation", - "stock_appointment-reminder", - "stock_appointment-reminder-excl", - "stock_arrowstyle", - "stock_attach", - "stock_auto-contour", - "stock_autocompletion", - "stock_autofilter", - "stock_autoformat", - "stock_autopilot", - "stock_autopilot-24", - "stock_autospellcheck", - "stock_autotext", - "stock_bell", - "stock_bluetooth", - "stock_book_blue", - "stock_book_green", - "stock_book_open", - "stock_book_red", - "stock_book_yellow", - "stock_bookmark", - "stock_bottom", - "stock_briefcase", - "stock_brightness", - "stock_bring-backward", - "stock_bring-forward", - "stock_bucketfill", - "stock_calc-accept", - "stock_calc-cancel", - "stock_calendar", - "stock_calendar-and-tasks", - "stock_calendar-view-day", - "stock_calendar-view-list", - "stock_calendar-view-month", - "stock_calendar-view-week", - "stock_calendar-view-work-week", - "stock_calendar-view-year", - "stock_cell-align-bottom", - "stock_cell-align-center", - "stock_cell-align-top", - "stock_cell-phone", - "stock_certificate", - "stock_channel", - "stock_channel-blue", - "stock_channel-green", - "stock_channel-red", - "stock_chart", - "stock_chart-autoformat", - "stock_chart-data-in-columns", - "stock_chart-data-in-rows", - "stock_chart-edit-type", - "stock_chart-reorganize", - "stock_chart-scale-text", - "stock_chart-toggle-axes", - "stock_chart-toggle-axes-title", - "stock_chart-toggle-hgrid", - "stock_chart-toggle-legend", - "stock_chart-toggle-title", - "stock_chart-toggle-vgrid", - "stock_check-filled", - "stock_choose-themes", - "stock_close", - "stock_color", - "stock_compile", - "stock_connect", - "stock_connect-to-url", - "stock_contact", - "stock_contact-list", - "stock_contrast", - "stock_copy", - "stock_create-with-attributes", - "stock_creditcard", - "stock_crop", - "stock_cut", - "stock_data-delete-link", - "stock_data-delete-query", - "stock_data-delete-record", - "stock_data-delete-sql-query", - "stock_data-delete-table", - "stock_data-edit-link", - "stock_data-edit-query", - "stock_data-edit-sql-query", - "stock_data-edit-table", - "stock_data-explorer", - "stock_data-first", - "stock_data-last", - "stock_data-link", - "stock_data-linked-table", - "stock_data-links", - "stock_data-new-link", - "stock_data-new-query", - "stock_data-new-record", - "stock_data-new-sql-query", - "stock_data-new-table", - "stock_data-next", - "stock_data-previous", - "stock_data-queries", - "stock_data-query", - "stock_data-query-rename", - "stock_data-save", - "stock_data-sources", - "stock_data-sources-delete", - "stock_data-sources-hand", - "stock_data-sources-modified", - "stock_data-sources-new", - "stock_data-table", - "stock_data-tables", - "stock_data-undo", - "stock_datapilot", - "stock_decrease-font", - "stock_default-folder", - "stock_delete", - "stock_delete-autofilter", - "stock_delete-bookmark", - "stock_delete-column", - "stock_delete-decimal-place", - "stock_delete-row", - "stock_dialog-error", - "stock_dialog-info", - "stock_dialog-question", - "stock_dialog-warning", - "stock_directcursor", - "stock_directory-server", - "stock_disconnect", - "stock_display-grid", - "stock_display-guides", - "stock_distort", - "stock_down", - "stock_down-with-subpoints", - "stock_drag-mode", - "stock_draw-arc", - "stock_draw-callouts", - "stock_draw-circle", - "stock_draw-circle-arc", - "stock_draw-circle-pie", - "stock_draw-circle-pie-unfilled", - "stock_draw-circle-segment", - "stock_draw-circle-segment-unfilled", - "stock_draw-circle-unfilled", - "stock_draw-cone", - "stock_draw-connector", - "stock_draw-connector-ends-with-arrow", - "stock_draw-connector-ends-with-circle", - "stock_draw-connector-starts-with-arrow", - "stock_draw-connector-starts-with-circle", - "stock_draw-connector-with-arrows", - "stock_draw-connector-with-circles", - "stock_draw-cube", - "stock_draw-curve", - "stock_draw-curve-filled", - "stock_draw-curved-connector", - "stock_draw-curved-connector-ends-with-arrow", - "stock_draw-curved-connector-ends-with-circle", - "stock_draw-curved-connector-starts-with-arrow", - "stock_draw-curved-connector-starts-with-circle", - "stock_draw-curved-connector-with-arrows", - "stock_draw-curved-connector-with-circles", - "stock_draw-cylinder", - "stock_draw-dimension-line", - "stock_draw-ellipse", - "stock_draw-ellipse-pie", - "stock_draw-ellipse-pie-unfilled", - "stock_draw-ellipse-segment", - "stock_draw-ellipse-segment-unfilled", - "stock_draw-ellipse-unfilled", - "stock_draw-freeform-line", - "stock_draw-freeform-line-filled", - "stock_draw-half-sphere", - "stock_draw-line", - "stock_draw-line-45", - "stock_draw-line-connector", - "stock_draw-line-connector-ends-with-arrow", - "stock_draw-line-connector-ends-with-circle", - "stock_draw-line-connector-starts-with-arrow", - "stock_draw-line-connector-starts-with-circle", - "stock_draw-line-connector-with-arrows", - "stock_draw-line-connector-with-circles", - "stock_draw-line-ends-with-arrow", - "stock_draw-line-starts-with-arrow", - "stock_draw-line-with-arrow-circle", - "stock_draw-line-with-arrow-square", - "stock_draw-line-with-arrows", - "stock_draw-line-with-circle-arrow", - "stock_draw-line-with-square-arrow", - "stock_draw-polygon", - "stock_draw-polygon-45", - "stock_draw-polygon-45-filled", - "stock_draw-polygon-filled", - "stock_draw-pyramid", - "stock_draw-rectangle", - "stock_draw-rectangle-unfilled", - "stock_draw-rounded-rectangle", - "stock_draw-rounded-rectangle-unfilled", - "stock_draw-rounded-square", - "stock_draw-rounded-square-unfilled", - "stock_draw-selection", - "stock_draw-shell", - "stock_draw-sphere", - "stock_draw-square", - "stock_draw-square-unfilled", - "stock_draw-straight-connector", - "stock_draw-straight-connector-ends-with-arrow", - "stock_draw-straight-connector-ends-with-circle", - "stock_draw-straight-connector-starts-with-arrow", - "stock_draw-straight-connector-starts-with-circle", - "stock_draw-straight-connector-with-arrows", - "stock_draw-straight-connector-with-circles", - "stock_draw-text", - "stock_draw-text-animation", - "stock_draw-text-frame", - "stock_draw-torus", - "stock_draw-vertical-callouts", - "stock_draw-vertical-text", - "stock_draw-vertical-text-frame", - "stock_edit", - "stock_edit-bookmark", - "stock_edit-contour", - "stock_edit-headers-and-footers", - "stock_edit-points", - "stock_effects", - "stock_effects-more-options", - "stock_effects-object", - "stock_effects-object-colorize", - "stock_effects-object-hide", - "stock_effects-play-in-full", - "stock_effects-preview", - "stock_effects-sound", - "stock_effects-text", - "stock_enter-group", - "stock_equals", - "stock_error-next", - "stock_error-next-16", - "stock_error-previous", - "stock_error-previous-16", - "stock_euro", - "stock_example", - "stock_exchange-columns", - "stock_exchange-connector", - "stock_exchange-rows", - "stock_exit", - "stock_exit-group", - "stock_export", - "stock_extended-help", - "stock_file-properties", - "stock_file-with-objects", - "stock_filter-data-by-criteria", - "stock_filter-navigator", - "stock_filters", - "stock_filters-aging", - "stock_filters-charcoal", - "stock_filters-invert", - "stock_filters-pixelize", - "stock_filters-pop-art", - "stock_filters-posterize", - "stock_filters-relief", - "stock_filters-remove-noise", - "stock_filters-sharpen", - "stock_filters-smooth", - "stock_filters-solarize", - "stock_first", - "stock_first-page", - "stock_flip", - "stock_flip-horizontally", - "stock_flip-vertically", - "stock_folder", - "stock_folder-copy", - "stock_folder-move", - "stock_folder-properties", - "stock_font", - "stock_font-formatting-toggle", - "stock_font-size", - "stock_fontwork", - "stock_fontwork-2dshadow", - "stock_fontwork-3dshadow", - "stock_fontwork-adaptation-off", - "stock_fontwork-adaptation-rotate", - "stock_fontwork-adaptation-slant-h", - "stock_fontwork-adaptation-slant-v", - "stock_fontwork-adaptation-straight", - "stock_fontwork-align-fill", - "stock_fontwork-noshadow", - "stock_fontwork-preview-spline", - "stock_fontwork-reverse-text-flow", - "stock_fontwork-shadow-angle", - "stock_fontwork-shadow-length", - "stock_fontwork-shadow-x-offset", - "stock_fontwork-shadow-y-offset", - "stock_fontwork-spline-distance", - "stock_fontwork-spline-indent", - "stock_fontwork-text-border", - "stock_form-activation-order", - "stock_form-add-field", - "stock_form-automatic-control-focus", - "stock_form-autopilots", - "stock_form-button", - "stock_form-checkbox", - "stock_form-combobox", - "stock_form-control-properties", - "stock_form-currency-field", - "stock_form-date-field", - "stock_form-design-mode", - "stock_form-file-selection", - "stock_form-formatted-field", - "stock_form-frame", - "stock_form-image-button", - "stock_form-image-control", - "stock_form-label", - "stock_form-letter-dialog", - "stock_form-line-horizontal", - "stock_form-line-vertical", - "stock_form-listbox", - "stock_form-navigator", - "stock_form-numerical-field", - "stock_form-open-in-design-mode", - "stock_form-pattern-field", - "stock_form-progressbar", - "stock_form-properties", - "stock_form-radio", - "stock_form-table-control", - "stock_form-text-box", - "stock_form-time-field", - "stock_format-character", - "stock_format-default", - "stock_format-numbering-bullets", - "stock_format-object", - "stock_format-page", - "stock_format-paragraph", - "stock_format-percent", - "stock_format-scientific", - "stock_formula-cursor", - "stock_frame", - "stock_fullscreen", - "stock_function-autopilot", - "stock_gamma", - "stock_glue", - "stock_gluepoint-down", - "stock_gluepoint-horizontal-center", - "stock_gluepoint-horizontal-left", - "stock_gluepoint-horizontal-right", - "stock_gluepoint-left", - "stock_gluepoint-relative", - "stock_gluepoint-right", - "stock_gluepoint-up", - "stock_gluepoint-vertical-bottom", - "stock_gluepoint-vertical-center", - "stock_gluepoint-vertical-top", - "stock_goal-seek", - "stock_gradient", - "stock_graphic-styles", - "stock_graphics-align-bottom", - "stock_graphics-align-center", - "stock_graphics-align-centered", - "stock_graphics-align-left", - "stock_graphics-align-right", - "stock_graphics-align-top", - "stock_group", - "stock_group-cells", - "stock_groupwise-connector", - "stock_guides", - "stock_hand-signed", - "stock_handles-big", - "stock_handles-simple", - "stock_headphones", - "stock_help", - "stock_help-add-bookmark", - "stock_help-agent", - "stock_help-book", - "stock_help-book-open", - "stock_help-chat", - "stock_help-document", - "stock_help-pane-off", - "stock_help-pane-on", - "stock_home", - "stock_hyperlink", - "stock_hyperlink-internet-search", - "stock_hyperlink-target", - "stock_hyperlink-toolbar", - "stock_id", - "stock_imagemap-editor", - "stock_inbox", - "stock_increase-font", - "stock_init", - "stock_insert-applet", - "stock_insert-caption", - "stock_insert-cells", - "stock_insert-cells-down", - "stock_insert-cells-right", - "stock_insert-chart", - "stock_insert-columns", - "stock_insert-cross-reference", - "stock_insert-fields", - "stock_insert-fields-author", - "stock_insert-fields-subject", - "stock_insert-fields-title", - "stock_insert-file", - "stock_insert-floating-frame", - "stock_insert-footer", - "stock_insert-form", - "stock_insert-gluepoint", - "stock_insert-header", - "stock_insert-math-object", - "stock_insert-names-define", - "stock_insert-note", - "stock_insert-ole-object", - "stock_insert-plugin", - "stock_insert-rows", - "stock_insert-rule", - "stock_insert-single-column-text-frame", - "stock_insert-slide", - "stock_insert-sound-plugin", - "stock_insert-table", - "stock_insert-text-frame", - "stock_insert-url", - "stock_insert-video-plugin", - "stock_insert_endnote", - "stock_insert_footnote", - "stock_insert_graphic", - "stock_insert_image", - "stock_insert_index_marker", - "stock_insert_section", - "stock_insert_special_character", - "stock_interaction", - "stock_internet", - "stock_keyring", - "stock_landline-phone", - "stock_last", - "stock_last-page", - "stock_left", - "stock_left-with-subpoints", - "stock_line-spacing-1", - "stock_line-spacing-1.5", - "stock_line-spacing-2", - "stock_line_in", - "stock_linepen", - "stock_link", - "stock_list-insert-unnumbered", - "stock_list_bullet", - "stock_list_enum", - "stock_list_enum-off", - "stock_list_enum-restart", - "stock_live-mode", - "stock_lock", - "stock_lock-broken", - "stock_lock-ok", - "stock_lock-open", - "stock_macro-check-brackets", - "stock_macro-controls", - "stock_macro-insert", - "stock_macro-insert-breakpoint", - "stock_macro-jump-back", - "stock_macro-objects", - "stock_macro-organizer", - "stock_macro-stop-after-command", - "stock_macro-stop-after-procedure", - "stock_macro-stop-watching", - "stock_macro-watch-variable", - "stock_mail", - "stock_mail-accounts", - "stock_mail-compose", - "stock_mail-copy", - "stock_mail-druid", - "stock_mail-druid-account", - "stock_mail-filters-apply", - "stock_mail-flag-for-followup", - "stock_mail-flag-for-followup-done", - "stock_mail-forward", - "stock_mail-handling", - "stock_mail-hide-deleted", - "stock_mail-hide-read", - "stock_mail-hide-selected", - "stock_mail-import", - "stock_mail-merge", - "stock_mail-move", - "stock_mail-open", - "stock_mail-open-multiple", - "stock_mail-priority-high", - "stock_mail-receive", - "stock_mail-replied", - "stock_mail-reply", - "stock_mail-reply-to-all", - "stock_mail-send", - "stock_mail-send-receive", - "stock_mail-unread", - "stock_mail-unread-multiple", - "stock_mark", - "stock_media-fwd", - "stock_media-next", - "stock_media-pause", - "stock_media-play", - "stock_media-prev", - "stock_media-rec", - "stock_media-rew", - "stock_media-shuffle", - "stock_media-stop", - "stock_message-display", - "stock_mic", - "stock_midi", - "stock_modify-layout", - "stock_music-library", - "stock_my-documents", - "stock_navigate-next", - "stock_navigate-prev", - "stock_navigator", - "stock_navigator-all-or-sel-toggle", - "stock_navigator-database-ranges", - "stock_navigator-drag-mode", - "stock_navigator-edit-entry", - "stock_navigator-foonote-body-toggle", - "stock_navigator-footer-body-toggle", - "stock_navigator-header-body-toggle", - "stock_navigator-headings", - "stock_navigator-indexes", - "stock_navigator-insert-as-copy", - "stock_navigator-insert-as-link", - "stock_navigator-insert-index", - "stock_navigator-insert-linked", - "stock_navigator-levels", - "stock_navigator-list-box-toggle", - "stock_navigator-master-toggle", - "stock_navigator-next-object", - "stock_navigator-open-toolbar", - "stock_navigator-previous-object", - "stock_navigator-range-names", - "stock_navigator-references", - "stock_navigator-reminder", - "stock_navigator-scenarios", - "stock_navigator-sections", - "stock_navigator-shift-down", - "stock_navigator-shift-left", - "stock_navigator-shift-right", - "stock_navigator-shift-up", - "stock_navigator-table-formula", - "stock_navigator-text", - "stock_navigator-update-entry", - "stock_navigator-wrong-table-formula", - "stock_network-printer", - "stock_new", - "stock_new", - "stock_new-24h-appointment", - "stock_new-appointment", - "stock_new-bcard", - "stock_new-dir", - "stock_new-drawing", - "stock_new-formula", - "stock_new-html", - "stock_new-labels", - "stock_new-master-document", - "stock_new-meeting", - "stock_new-presentation", - "stock_new-spreadsheet", - "stock_new-tab", - "stock_new-template", - "stock_new-text", - "stock_new-window", - "stock_news", - "stock_next", - "stock_next-page", - "stock_node-add", - "stock_node-close-path", - "stock_node-convert", - "stock_node-corner", - "stock_node-corner-to-smooth", - "stock_node-curve-split", - "stock_node-delete", - "stock_node-mark-for-deletion", - "stock_node-move", - "stock_node-smooth-to-symmetrical", - "stock_nonprinting-chars", - "stock_not", - "stock_not-spam", - "stock_notebook", - "stock_notes", - "stock_object-behind", - "stock_object-infront", - "stock_online-layout", - "stock_open", - "stock_open-read-only", - "stock_openoffice", - "stock_opensave", - "stock_outbox", - "stock_page-number", - "stock_page-total-number", - "stock_paragraph-spacing-decrease", - "stock_paragraph-spacing-increase", - "stock_paste", - "stock_people", - "stock_person", - "stock_pin", - "stock_placeholder-graphic", - "stock_placeholder-line-contour", - "stock_placeholder-picture", - "stock_placeholder-text", - "stock_playlist", - "stock_position-size", - "stock_post-message", - "stock_presentation-box", - "stock_presentation-styles", - "stock_preview-four-pages", - "stock_preview-two-pages", - "stock_previous", - "stock_previous-page", - "stock_print", - "stock_print-driver", - "stock_print-duplex", - "stock_print-duplex-no-tumble", - "stock_print-duplex-tumble", - "stock_print-layout", - "stock_print-non-duplex", - "stock_print-options", - "stock_print-preview", - "stock_print-preview-print", - "stock_print-resolution", - "stock_print-setup", - "stock_printers", - "stock_properties", - "stock_proxy", - "stock_quickmask", - "stock_record-macro", - "stock_record-number", - "stock_redo", - "stock_refresh", - "stock_reload", - "stock_repeat", - "stock_reverse-order", - "stock_right", - "stock_right-with-subpoints", - "stock_rotate", - "stock_rotate-3d", - "stock_rotation-mode", - "stock_run-macro", - "stock_samples", - "stock_save", - "stock_save-as", - "stock_save-pdf", - "stock_save-template", - "stock_save_as", - "stock_score-high", - "stock_score-higher", - "stock_score-highest", - "stock_score-low", - "stock_score-lower", - "stock_score-lowest", - "stock_score-normal", - "stock_scores", - "stock_script", - "stock_script", - "stock_scripts", - "stock_search", - "stock_search-and-replace", - "stock_select-all", - "stock_select-cell", - "stock_select-column", - "stock_select-row", - "stock_select-table", - "stock_send-fax", - "stock_sent-mail", - "stock_shadow", - "stock_show-all", - "stock_show-draw-functions", - "stock_show-form-dialog", - "stock_show-hidden-controls", - "stock_shuffle", - "stock_signature", - "stock_signature-bad", - "stock_signature-ok", - "stock_slide-design", - "stock_slide-duplicate", - "stock_slide-expand", - "stock_slide-reherse-timings", - "stock_slide-show", - "stock_slide-showhide", - "stock_smart-playlist", - "stock_smiley-1", - "stock_smiley-2", - "stock_smiley-3", - "stock_smiley-4", - "stock_smiley-5", - "stock_smiley-6", - "stock_smiley-7", - "stock_smiley-8", - "stock_smiley-9", - "stock_smiley-10", - "stock_smiley-11", - "stock_smiley-12", - "stock_smiley-13", - "stock_smiley-14", - "stock_smiley-15", - "stock_smiley-16", - "stock_smiley-17", - "stock_smiley-18", - "stock_smiley-19", - "stock_smiley-20", - "stock_smiley-21", - "stock_smiley-22", - "stock_smiley-23", - "stock_smiley-24", - "stock_smiley-25", - "stock_smiley-26", - "stock_snap-grid", - "stock_snap-guides", - "stock_snap-margins", - "stock_snap-object", - "stock_snap-object-points", - "stock_sort-ascending", - "stock_sort-column-ascending", - "stock_sort-criteria", - "stock_sort-descending", - "stock_sort-row-ascending", - "stock_sort-table-column-ascending", - "stock_sort-table-row-ascending", - "stock_sound", - "stock_spam", - "stock_spellcheck", - "stock_standard-filter", - "stock_stop", - "stock_styles", - "stock_styles-character-styles", - "stock_styles-fill-format-mode", - "stock_styles-frame-styles", - "stock_styles-new-style-from-selection", - "stock_styles-numbering-styles", - "stock_styles-page-styles", - "stock_styles-paragraph-styles", - "stock_styles-update-style", - "stock_subscript", - "stock_sum", - "stock_summary", - "stock_superscript", - "stock_symbol-selection", - "stock_table-align-bottom", - "stock_table-align-center", - "stock_table-align-top", - "stock_table-borders", - "stock_table-combine", - "stock_table-fit-height", - "stock_table-fit-width", - "stock_table-fixed", - "stock_table-fixed-proportional", - "stock_table-line-color", - "stock_table-line-style", - "stock_table-optimize", - "stock_table-same-height", - "stock_table-same-width", - "stock_table-split", - "stock_table-variable", - "stock_table_borders", - "stock_table_fill", - "stock_task", - "stock_task-assigned", - "stock_task-assigned-to", - "stock_task-recurring", - "stock_test-mode", - "stock_text-direction-ltr", - "stock_text-direction-ttb", - "stock_text-double-click-to-edit", - "stock_text-monospaced", - "stock_text-outline", - "stock_text-quickedit", - "stock_text-select-text-only", - "stock_text-shadow", - "stock_text-spacing", - "stock_text-strikethrough", - "stock_text_bold", - "stock_text_center", - "stock_text_color_background", - "stock_text_color_foreground", - "stock_text_color_hilight", - "stock_text_indent", - "stock_text_italic", - "stock_text_justify", - "stock_text_left", - "stock_text_right", - "stock_text_underlined", - "stock_text_underlined-double", - "stock_text_unindent", - "stock_thesaurus", - "stock_3d-3d-attributes-only", - "stock_3d-all-attributes", - "stock_3d-color-picker", - "stock_3d-colors", - "stock_3d-custom-color", - "stock_3d-effects", - "stock_3d-favourites", - "stock_3d-geometry", - "stock_3d-light", - "stock_3d-off", - "stock_3d-on", - "stock_3d-material", - "stock_3d-normals-double-sided", - "stock_3d-normals-double-sided-closed-body", - "stock_3d-normals-flat", - "stock_3d-normals-flip-illumination", - "stock_3d-normals-object-specific", - "stock_3d-normals-spherical", - "stock_3d-perspective", - "stock_3d-shading", - "stock_3d-texture", - "stock_3d-texture-and-shading", - "stock_3d-texture-object-specific", - "stock_3d-texture-only", - "stock_3d-texture-parallel", - "stock_3d-texture-spherical", - "stock_3dsound", - "stock_timer", - "stock_timer_stopped", - "stock_timezone", - "stock_to-3d", - "stock_to-3d-rotation-object", - "stock_to-background", - "stock_to-bottom", - "stock_to-curve", - "stock_to-foreground", - "stock_to-polygon", - "stock_to-top", - "stock_todo", - "stock_toggle-graphics", - "stock_toggle-info", - "stock_toggle-preview", - "stock_toilet-paper", - "stock_tools-hyphenation", - "stock_tools-macro", - "stock_top", - "stock_transform-circle-perspective", - "stock_transform-circle-slant", - "stock_transparency", - "stock_trash_full", - "stock_undelete", - "stock_undo", - "stock_undo-history", - "stock_ungroup", - "stock_ungroup-cells", - "stock_unknown", - "stock_unlink", - "stock_up", - "stock_up-one-dir", - "stock_up-with-subpoints", - "stock_update-data", - "stock_update-fields", - "stock_video-conferencing", - "stock_view-details", - "stock_view-field-shadings", - "stock_view-fields", - "stock_view-function-selection", - "stock_view-html-source", - "stock_volume", - "stock_wallpaper-center", - "stock_wallpaper-fill", - "stock_wallpaper-scale", - "stock_wallpaper-tile", - "stock_weather-cloudy", - "stock_weather-few-clouds", - "stock_weather-fog", - "stock_weather-night-clear", - "stock_weather-night-few-clouds", - "stock_weather-showers", - "stock_weather-snow", - "stock_weather-storm", - "stock_weather-sunny", - "stock_web-calendar", - "stock_web-support", - "stock_wrap-around", - "stock_wrap-behind", - "stock_wrap-contour", - "stock_wrap-interrupt", - "stock_wrap-left", - "stock_wrap-optimal", - "stock_wrap-right", - "stock_zoom", - "stock_zoom-1", - "stock_zoom-in", - "stock_zoom-next", - "stock_zoom-object", - "stock_zoom-optimal", - "stock_zoom-out", - "stock_zoom-page", - "stock_zoom-page-width", - "stock_zoom-previous", - "stock_zoom-shift", - }; - } -} - - diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TimeSpanEditor.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TimeSpanEditor.cs deleted file mode 100644 index fb40194da33..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TimeSpanEditor.cs +++ /dev/null @@ -1,67 +0,0 @@ - -using System; -using Gtk; -using Gdk; -using System.Text; - -namespace Stetic.Editor -{ - public class TimeSpanEditorCell: PropertyEditorCell - { - protected override string GetValueText () - { - return ((TimeSpan)Value).ToString (); - } - - protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state) - { - return new TimeSpanEditor (); - } - } - - public class TimeSpanEditor: Gtk.HBox, IPropertyEditor - { - Gtk.Entry entry; - TimeSpan time; - - public TimeSpanEditor() - { - entry = new Gtk.Entry (); - entry.Changed += OnChanged; - PackStart (entry, true, true, 0); - ShowAll (); - } - - public void Initialize (PropertyDescriptor descriptor) - { - } - - public void AttachObject (object ob) - { - } - - public object Value { - get { return time; } - set { - time = (TimeSpan) value; - entry.Changed -= OnChanged; - entry.Text = time.ToString (); - entry.Changed += OnChanged; - } - } - - void OnChanged (object o, EventArgs a) - { - string s = entry.Text; - - try { - time = TimeSpan.Parse (s); - if (ValueChanged != null) - ValueChanged (this, a); - } catch { - } - } - - public event EventHandler ValueChanged; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Translatable.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Translatable.cs deleted file mode 100644 index c04192620ff..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Translatable.cs +++ /dev/null @@ -1,233 +0,0 @@ -using System; - -namespace Stetic.Editor { - - public abstract class Translatable : Gtk.VBox, IPropertyEditor { - - PropertyDescriptor prop; - object obj; - - Gtk.Box mainHBox, contextBox, commentBox; - Gtk.Button button; - Gdk.Pixbuf globe, globe_not; - Gtk.Image image; - Gtk.Menu menu; - Gtk.CheckMenuItem markItem; - Gtk.MenuItem addContextItem, remContextItem, addCommentItem, remCommentItem; - Gtk.Entry contextEntry; - TextBox commentText; - bool initializing; - - public virtual void Initialize (PropertyDescriptor prop) - { - CheckType (prop); - - this.prop = prop; - - mainHBox = new Gtk.HBox (false, 6); - PackStart (mainHBox, false, false, 0); - - if (!prop.Translatable) - return; - - button = new Gtk.Button (); - try { - globe = Gdk.Pixbuf.LoadFromResource ("globe.png"); - globe_not = Gdk.Pixbuf.LoadFromResource ("globe-not.png"); - } catch (Exception e) { - Console.WriteLine ("Error while loading pixbuf: " + e); - } - image = new Gtk.Image (globe); - button.Add (image); - button.ButtonPressEvent += ButtonPressed; - mainHBox.PackEnd (button, false, false, 0); - mainHBox.ShowAll (); - - menu = new Gtk.Menu (); - - markItem = new Gtk.CheckMenuItem ("Mark for Translation"); - markItem.Toggled += ToggleMark; - markItem.Show (); - menu.Add (markItem); - - addContextItem = new Gtk.MenuItem ("Add Translation Context Hint"); - addContextItem.Activated += AddContext; - menu.Add (addContextItem); - remContextItem = new Gtk.MenuItem ("Remove Translation Context Hint"); - remContextItem.Activated += RemoveContext; - menu.Add (remContextItem); - - addCommentItem = new Gtk.MenuItem ("Add Comment for Translators"); - addCommentItem.Activated += AddComment; - menu.Add (addCommentItem); - remCommentItem = new Gtk.MenuItem ("Remove Comment for Translators"); - remCommentItem.Activated += RemoveComment; - menu.Add (remCommentItem); - - contextBox = new Gtk.HBox (false, 6); - Gtk.Label contextLabel = new Gtk.Label ("Translation context"); - contextLabel.Xalign = 0.0f; - contextBox.PackStart (contextLabel, false, false, 0); - contextEntry = new Gtk.Entry (); - contextEntry.WidthChars = 8; - contextBox.PackStart (contextEntry, true, true, 0); - contextBox.ShowAll (); - contextEntry.Changed += ContextChanged; - - commentBox = new Gtk.VBox (false, 3); - Gtk.Label commentLabel = new Gtk.Label ("Comment for Translators:"); - commentLabel.Xalign = 0.0f; - commentBox.PackStart (commentLabel, false, false, 0); - commentText = new TextBox (3); - commentBox.PackStart (commentText, false, false, 0); - commentBox.ShowAll (); - commentText.Changed += CommentChanged; - } - - protected virtual void CheckType (PropertyDescriptor prop) - { - } - - public virtual void AttachObject (object ob) - { - this.obj = ob; - - if (!prop.Translatable) - return; - - initializing = true; - - if (contextBox.Parent != null) - Remove (contextBox); - if (commentBox.Parent != null) - Remove (commentBox); - - markItem.Active = prop.IsTranslated (obj); - image.Pixbuf = markItem.Active ? globe : globe_not; - - if (prop.IsTranslated (obj)) { - if (prop.TranslationContext (obj) != null) { - remContextItem.Show (); - PackStart (contextBox, false, false, 0); - contextEntry.Text = prop.TranslationContext (obj); - } else - addContextItem.Show (); - } else { - addContextItem.Show (); - addContextItem.Sensitive = false; - } - - if (prop.IsTranslated (obj)) { - if (prop.TranslationComment (obj) != null) { - remCommentItem.Show (); - PackEnd (commentBox, false, false, 0); - commentText.Text = prop.TranslationComment (obj); - } else - addCommentItem.Show (); - } else { - addCommentItem.Show (); - addCommentItem.Sensitive = false; - } - - initializing = false; - } - - - public abstract object Value { get; set; } - - public event EventHandler ValueChanged; - - protected virtual void OnValueChanged () - { - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } - - protected override void OnAdded (Gtk.Widget child) - { - mainHBox.PackStart (child, true, true, 0); - } - - void MenuPosition (Gtk.Menu menu, out int x, out int y, out bool push_in) - { - button.GdkWindow.GetOrigin (out x, out y); - Gdk.Rectangle alloc = button.Allocation; - x += alloc.X; - y += alloc.Y + alloc.Height; - push_in = true; - } - - [GLib.ConnectBefore] - void ButtonPressed (object o, Gtk.ButtonPressEventArgs args) - { - menu.Popup (null, null, MenuPosition, 1, args.Event.Time); - args.RetVal = true; - } - - void ToggleMark (object o, EventArgs args) - { - if (initializing) return; - if (!markItem.Active) { - // Make sure we're showing the "Add" menu items - // rather than the "Remove" ones - if (prop.TranslationContext (obj) != null) - RemoveContext (remContextItem, EventArgs.Empty); - if (prop.TranslationComment (obj) != null) - RemoveComment (remCommentItem, EventArgs.Empty); - } - - prop.SetTranslated (obj, markItem.Active); - image.Pixbuf = markItem.Active ? globe : globe_not; - addContextItem.Sensitive = markItem.Active; - addCommentItem.Sensitive = markItem.Active; - } - - void AddContext (object o, EventArgs args) - { - prop.SetTranslationContext (obj, contextEntry.Text); - PackStart (contextBox, false, false, 0); - - addContextItem.Hide (); - remContextItem.Show (); - } - - void RemoveContext (object o, EventArgs args) - { - prop.SetTranslationContext (obj, null); - Remove (contextBox); - - remContextItem.Hide (); - addContextItem.Show (); - } - - void ContextChanged (object o, EventArgs args) - { - if (initializing) return; - prop.SetTranslationContext (obj, contextEntry.Text); - } - - void AddComment (object o, EventArgs args) - { - prop.SetTranslationComment (obj, commentText.Text); - PackEnd (commentBox, false, false, 0); - - addCommentItem.Hide (); - remCommentItem.Show (); - } - - void RemoveComment (object o, EventArgs args) - { - prop.SetTranslationComment (obj, null); - Remove (commentBox); - - remCommentItem.Hide (); - addCommentItem.Show (); - } - - void CommentChanged (object o, EventArgs args) - { - if (initializing) return; - prop.SetTranslationComment (obj, commentText.Text); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TreeViewCellContainer.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TreeViewCellContainer.cs deleted file mode 100644 index c027a029865..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TreeViewCellContainer.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -// TreeViewCellContainer.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using Gtk; -using Gdk; - -namespace Stetic.Editor -{ - class TreeViewCellContainer: Entry - { - EventBox box; - - public TreeViewCellContainer (Gtk.Widget child) - { - box = new EventBox (); - box.ButtonPressEvent += new ButtonPressEventHandler (OnClickBox); - box.ModifyBg (StateType.Normal, Style.White); - box.Add (child); - child.Show (); - Show (); - } - - [GLib.ConnectBefore] - void OnClickBox (object s, ButtonPressEventArgs args) - { - // Avoid forwarding the button press event to the - // tree, since it would hide the cell editor. - args.RetVal = true; - } - - protected override void OnParentSet (Gtk.Widget parent) - { - base.OnParentSet (parent); - - if (Parent != null) { - if (ParentWindow != null) - box.ParentWindow = ParentWindow; - box.Parent = Parent; - box.Show (); - } - else - box.Unparent (); - } - - protected override void OnShown () - { - // Do nothing. - } - - protected override void OnSizeAllocated (Gdk.Rectangle allocation) - { - base.OnSizeAllocated (allocation); - box.SizeRequest (); - box.Allocation = allocation; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/WidgetSelector.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/WidgetSelector.cs deleted file mode 100644 index 68991a32e6e..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/WidgetSelector.cs +++ /dev/null @@ -1,98 +0,0 @@ - -using System; -using System.Collections; -using Gtk; -using Gdk; - -namespace Stetic.Editor -{ - public class WidgetSelector: ComboBox, IPropertyEditor - { - Gtk.Widget obj; - ListStore store; - Hashtable widgets = new Hashtable (); - - public void Initialize (PropertyDescriptor descriptor) - { - store = new ListStore (typeof(Pixbuf), typeof(string)); - Model = store; - store.SetSortColumnId (1, SortType.Ascending); - CellRendererPixbuf crp = new CellRendererPixbuf (); - CellRendererText crt = new CellRendererText (); - PackStart (crp, false); - PackStart (crt, true); - SetAttributes (crp, "pixbuf", 0); - SetAttributes (crt, "text", 1); - } - - public void AttachObject (object obj) - { - this.obj = obj as Gtk.Widget; - FillWidgets (); - } - - void FillWidgets () - { - store.Clear (); - widgets.Clear (); - - Stetic.Wrapper.Widget widget = Stetic.Wrapper.Widget.Lookup (obj); - if (widget == null) - return; - - while (!widget.IsTopLevel) - widget = widget.ParentWrapper; - - store.AppendValues (null, "(None)"); - FillWidgets (widget, 0); - } - - void FillWidgets (Stetic.Wrapper.Widget widget, int level) - { - if (!widget.Unselectable) { - TreeIter iter = store.AppendValues (widget.ClassDescriptor.Icon, widget.Wrapped.Name); - widgets [widget.Wrapped.Name] = iter; - } - Gtk.Container cont = widget.Wrapped as Gtk.Container; - if (cont != null && widget.ClassDescriptor.AllowChildren) { - foreach (Gtk.Widget child in cont.AllChildren) { - Stetic.Wrapper.Widget cwidget = Stetic.Wrapper.Widget.Lookup (child); - if (cwidget != null) - FillWidgets (cwidget, level+1); - } - } - } - - - public object Value { - get { - if (Active <= 0) - return null; - else { - TreeIter iter; - if (!GetActiveIter (out iter)) - return null; - return (string) store.GetValue (iter, 1); - } - } - set { - if (value == null) - Active = 0; - else if (widgets.Contains ((string) value)) { - TreeIter iter = (TreeIter) widgets [value]; - SetActiveIter (iter); - } - } - } - - protected override void OnChanged () - { - base.OnChanged (); - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } - - // To be fired when the edited value changes. - public event EventHandler ValueChanged; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.csproj b/main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.csproj deleted file mode 100644 index 95bf4e5964c..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.csproj +++ /dev/null @@ -1,272 +0,0 @@ - - - - Debug - AnyCPU - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9} - Stetic - $(MDFrameworkVersion) - ..\..\..\..\build\AddIns\MonoDevelop.GtkCore - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - - - - diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.dll.config b/main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.dll.config deleted file mode 100644 index 8c4c6ab9a9d..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.dll.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/stetic.glade b/main/src/addins/MonoDevelop.GtkCore/libstetic/stetic.glade deleted file mode 100644 index 9f58816ce17..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/stetic.glade +++ /dev/null @@ -1,2107 +0,0 @@ - - - - - - - True - Select Image - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 650 - 450 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - 0 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - True - True - True - GTK_POS_TOP - False - False - - - - - 6 - True - False - 6 - - - - True - True - GTK_POLICY_NEVER - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - - - - 0 - True - True - - - - - - True - False - 6 - - - - True - 4 - gtk-missing-image - 0.5 - 0.5 - 3 - 3 - - - 0 - False - False - - - - - - True - False - 0 - - - - True - False - 6 - - - - True - _Icon Name: - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - iconNameEntry - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - * - False - - - - 0 - True - True - - - - - - True - - False - True - - - - 0 - False - False - - - - - 0 - False - False - GTK_PACK_END - - - - - - - - - 0 - True - True - - - - - 0 - False - False - - - - - False - True - - - - - - True - Themed Icons - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 6 - True - False - 6 - - - - True - False - 6 - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - True - False - False - False - - - - - 0 - True - True - - - - - - True - GTK_BUTTONBOX_START - 6 - - - - True - True - True - gtk-add - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-delete - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - False - False - - - - - 0 - True - True - - - - - - True - False - 6 - - - - 30 - 30 - True - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Resource Name: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - * - False - - - - 0 - True - True - - - - - 0 - False - False - - - - - False - True - - - - - - True - Resources - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 12 - True - GTK_FILE_CHOOSER_ACTION_OPEN - True - False - False - - - False - True - - - - - - True - Files - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - 0 - True - True - - - - - - - - True - Flags - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 500 - 450 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - False - True - False - False - False - - - - - 0 - True - True - - - - - - - - True - Text - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 600 - 350 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - False - 6 - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - False - True - GTK_JUSTIFY_LEFT - GTK_WRAP_CHAR - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 0 - True - True - - - - - - True - True - Translatable - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - False - - - - - - True - 2 - 2 - False - 6 - 6 - - - - True - Translation Context Hint: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - Comment for Translators - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - True - True - True - 0 - - True - * - False - - - 1 - 2 - 0 - 1 - - - - - - - True - True - True - True - 0 - - True - * - False - - - 1 - 2 - 1 - 2 - - - - - - 0 - False - False - - - - - 0 - True - True - - - - - - - - True - Select Image - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 650 - 450 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - True - True - True - GTK_POS_TOP - False - False - - - - - 6 - True - False - 6 - - - - True - True - GTK_POLICY_NEVER - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - - - - 0 - True - True - - - - - - True - False - 6 - - - - True - 4 - gtk-missing-image - 0.5 - 0 - 3 - 3 - - - 0 - False - False - - - - - - True - False - 0 - - - - True - False - 6 - - - - True - _Icon Name: - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - stockIconEntry - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - * - False - - - - 0 - True - True - - - - - 0 - False - False - GTK_PACK_END - - - - - - - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - False - 0 - - - - True - - - 0 - True - True - - - - - - 3 - True - False - 3 - - - - True - gtk-dialog-warning - 1 - 0.5 - 0 - 0 - 0 - - - 0 - False - False - - - - - - 513 - True - The selected icon may not show at run time if the required icon factory is not properly initialized. - False - False - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - False - False - - - - - 0 - False - False - - - - - False - True - - - - - - True - Stock Icons - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - - 6 - True - False - 6 - - - - True - False - 6 - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - - - - - - - 0 - True - True - - - - - - True - GTK_BUTTONBOX_START - 6 - - - - True - True - True - gtk-add - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-edit - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-delete - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - False - False - - - - - 0 - True - True - - - - - False - True - - - - - - True - Project Icons - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - tab - - - - - 0 - True - True - - - - - - - - True - Edit Icon - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 650 - 400 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - False - 6 - - - - True - False - 6 - - - - True - Icon name: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - * - False - 20 - - - - 0 - False - False - - - - - 0 - False - False - - - - - - True - - - 0 - False - False - - - - - - True - True - Single source icon - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - False - - - - - - True - False - 6 - - - - 12 - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - Image: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - 0 - 0.5 - GTK_SHADOW_ETCHED_IN - - - - True - False - 6 - - - - True - 0.5 - 0.5 - 0 - 0 - - - 6 - False - False - - - - - - True - image name - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - 0 - True - True - - - - - - True - True - Select Image... - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False - - - - - 0 - False - False - - - - - - True - True - Multiple source icon - True - GTK_RELIEF_NORMAL - True - False - False - True - radioSingle - - - - 3 - False - False - - - - - - True - False - 0 - - - - 12 - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - False - False - True - False - False - False - - - - - 0 - True - True - - - - - - True - GTK_BUTTONBOX_START - 3 - - - - True - True - True - gtk-add - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-delete - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - - True - Edit Icon Factory - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 450 - 460 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - -7 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 12 - True - False - 6 - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - - - - - - - 0 - True - True - - - - - - True - GTK_BUTTONBOX_START - 6 - - - - True - True - True - gtk-add - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-edit - True - GTK_RELIEF_NORMAL - True - - - - - - - True - True - True - gtk-delete - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - False - False - - - - - 0 - True - True - - - - - - - - True - Widget Designer - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - True - False - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - False - 0 - - - - True - gtk-dialog-warning - 6 - 0 - 0 - 0 - 0 - - - 0 - False - False - - - - - - 6 - True - False - 6 - - - - 449 - True - You are trying to add a non-container widget into the main window. In <b>GTK#</b>, widget positioning is controlled by a special type of widgets called <b>Container</b> widgets. If you don't place the widget into a container, it will fill the all the available space in the window. Are you sure you want to continue? - False - True - GTK_JUSTIFY_LEFT - True - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 6 - - - - True - To know more about this topic see the article: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - GTK# Widget Layout and Packing - True - GTK_RELIEF_NONE - True - - - 0 - False - False - - - - - 0 - True - True - - - - - - True - True - Don't show this message again - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - GTK_PACK_END - - - - - 0 - True - True - - - - - 0 - False - False - - - - - - - diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/undo/ActionDiffAdaptor.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/undo/ActionDiffAdaptor.cs deleted file mode 100644 index 880aaea21a6..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/undo/ActionDiffAdaptor.cs +++ /dev/null @@ -1,273 +0,0 @@ - -using System; -using System.Xml; -using System.Collections; -using Stetic.Wrapper; - -namespace Stetic.Undo -{ - class ActionDiffAdaptor: IDiffAdaptor - { - IProject project; - - public ActionDiffAdaptor (IProject project) - { - this.project = project; - } - - public IEnumerable GetChildren (object parent) - { - if (parent is Wrapper.Action) - yield break; - else if (parent is ActionGroup) { - foreach (Wrapper.Action ac in ((ActionGroup)parent).Actions) - if (ac.Name.Length > 0) - yield return ac; - } - else if (parent is ActionGroupCollection) { - foreach (ActionGroup ag in (ActionGroupCollection) parent) - yield return ag; - } - else - throw new NotImplementedException (); - } - - public string GetUndoId (object childObject) - { - if (childObject is ActionGroup) - return ((ActionGroup)childObject).UndoId; - if (childObject is Wrapper.Action) - return ((Wrapper.Action)childObject).UndoId; - - throw new NotImplementedException (); - } - - public object FindChild (object parent, string undoId) - { - foreach (object ob in GetChildren (parent)) - if (GetUndoId (ob) == undoId) { - if ((ob is Wrapper.Action) && ((Wrapper.Action)ob).Name.Length == 0) - continue; - return ob; - } - return null; - } - - public void RemoveChild (object parent, string undoId) - { - object child = FindChild (parent, undoId); - if (child == null) - return; - if (parent is ActionGroup) { - ((ActionGroup)parent).Actions.Remove ((Wrapper.Action)child); - } else if (parent is ActionGroupCollection) { - ((ActionGroupCollection)parent).Remove ((ActionGroup)child); - } else - throw new NotImplementedException (); - } - - public void AddChild (object parent, XmlElement node, string insertAfter) - { - object data = DeserializeChild (node); - if (parent is ActionGroup) { - ActionGroup group = (ActionGroup) parent; - if (insertAfter == null) - group.Actions.Insert (0, (Wrapper.Action) data); - else { - for (int n=0; n 0) { - object newChild = newStatusAdaptor.FindChild (newStatus, cid); - if (newChild != null) { - // ChildCreate will work even if the packing element is null - ObjectDiff odiff = GetChildDiff (oldChild, newChild); - if (odiff != null) { - ChildDiff cdiff = new ChildDiff (); - cdiff.Id = cid; - cdiff.Operation = DiffOperation.Update; - cdiff.Diff = odiff; - changes.Add (cdiff); - } - foundChildren [cid] = cid; - } else { - ChildDiff cdiff = new ChildDiff (); - cdiff.Id = cid; - cdiff.Operation = DiffOperation.Remove; - changes.Add (cdiff); - } - } else { - throw new InvalidOperationException ("Found an element of type '" + oldChild.GetType () + "' without ID"); - } - } - - // Register new elements - - string lastWidgetId = null; - foreach (object newChildElem in newStatusAdaptor.GetChildren (newStatus)) { - string cid = newStatusAdaptor.GetUndoId (newChildElem); - if (cid.Length > 0) { - if (!foundChildren.ContainsKey (cid)) { - ChildDiff cdiff = new ChildDiff (); - cdiff.Id = cid; - cdiff.Operation = DiffOperation.Add; - cdiff.AddContent = newStatusAdaptor.SerializeChild (newChildElem); - cdiff.InsertAfter = lastWidgetId; - changes.Add (cdiff); - } - } else - throw new InvalidOperationException ("Found an element of type '" + newChildElem.GetType () + "' without ID"); - - lastWidgetId = cid; - } - - ChildDiff[] childChanges = null; - if (changes.Count > 0) - childChanges = (ChildDiff[]) changes.ToArray (typeof(ChildDiff)); - - if (childChanges != null || propChanges != null || signalChanges != null) { - ObjectDiff dif = new ObjectDiff (); - dif.PropertyChanges = propChanges; - dif.SignalChanges = signalChanges; - dif.ChildChanges = childChanges; - return dif; - } - else - return null; - } - - public void ApplyDiff (object status, ObjectDiff diff) - { - if (diff.PropertyChanges != null) - ApplyPropertyChanges (diff.PropertyChanges, currentStatusAdaptor, status); - - if (diff.SignalChanges != null) - ApplySignalChanges (diff.SignalChanges, currentStatusAdaptor, status); - - if (diff.ChildChanges != null) { - foreach (ChildDiff cdiff in diff.ChildChanges) { - if (cdiff.Operation == DiffOperation.Update) { - object statusChild = currentStatusAdaptor.FindChild (status, cdiff.Id); - ApplyChildDiff (statusChild, cdiff.Diff); - } else if (cdiff.Operation == DiffOperation.Remove) { - // Remove the child - currentStatusAdaptor.RemoveChild (status, cdiff.Id); - } else { - // Add the child at the correct position - currentStatusAdaptor.AddChild (status, cdiff.AddContent, cdiff.InsertAfter); - } - } - } - } - - protected virtual ObjectDiff GetChildDiff (object oldChild, object newChild) - { - DiffGenerator childGenerator = new DiffGenerator (); - childGenerator.CurrentStatusAdaptor = currentStatusAdaptor.GetChildAdaptor (oldChild); - childGenerator.NewStatusAdaptor = newStatusAdaptor.GetChildAdaptor (newChild); - - return childGenerator.GetDiff (oldChild, newChild); - } - - protected virtual void ApplyChildDiff (object child, ObjectDiff cdiff) - { - DiffGenerator childGenerator = new DiffGenerator (); - childGenerator.CurrentStatusAdaptor = currentStatusAdaptor.GetChildAdaptor (child); - childGenerator.ApplyDiff (child, cdiff); - } - - protected virtual PropertyDiff[] GetPropertyDiff (IDiffAdaptor currentAdaptor, object currentObject, IDiffAdaptor newAdaptor, object newObject) - { - ArrayList changes = new ArrayList (); - Hashtable found = new Hashtable (); - - // Look for modified and deleted elements - if (currentObject != null) { - foreach (object oldProp in currentAdaptor.GetProperties (currentObject)) { - string name = currentAdaptor.GetPropertyName (oldProp); - object newProp = newObject != null ? newAdaptor.GetPropertyByName (newObject, name) : null; - if (newProp == null) - changes.Add (new PropertyDiff (DiffOperation.Remove, name, null)); - else { - found [name] = found; - string newValue = newAdaptor.GetPropertyValue (newObject, newProp); - if (newValue != currentAdaptor.GetPropertyValue (currentObject, oldProp)) - changes.Add (new PropertyDiff (DiffOperation.Update, name, newValue)); - } - } - } - - // Look for new elements - if (newObject != null) { - foreach (object newProp in newAdaptor.GetProperties (newObject)) { - string name = newAdaptor.GetPropertyName (newProp); - if (!found.ContainsKey (name)) - changes.Add (new PropertyDiff (DiffOperation.Add, name, newAdaptor.GetPropertyValue (newObject, newProp))); - } - } - - if (changes.Count == 0) - return null; - return (PropertyDiff[]) changes.ToArray (typeof(PropertyDiff)); - } - - protected virtual PropertyDiff[] GetSignalDiff (IDiffAdaptor currentAdaptor, object currentObject, IDiffAdaptor newAdaptor, object newObject) - { - ArrayList changes = new ArrayList (); - Hashtable found = new Hashtable (); - - // Look for modified and deleted elements - if (currentObject != null) { - foreach (object oldProp in currentAdaptor.GetSignals (currentObject)) { - string name; - string handler; - currentAdaptor.GetSignalInfo (oldProp, out name, out handler); - object newProp = newObject != null ? newAdaptor.GetSignal (newObject, name, handler) : null; - if (newProp == null) - changes.Add (new PropertyDiff (DiffOperation.Remove, name, handler)); - found [name + " " + handler] = found; - } - } - - // Look for new elements - if (newObject != null) { - foreach (object newProp in newAdaptor.GetSignals (newObject)) { - string name; - string handler; - newAdaptor.GetSignalInfo (newProp, out name, out handler); - if (!found.ContainsKey (name + " " + handler)) - changes.Add (new PropertyDiff (DiffOperation.Add, name, handler)); - } - } - - if (changes.Count == 0) - return null; - return (PropertyDiff[]) changes.ToArray (typeof(PropertyDiff)); - } - - public virtual void ApplyPropertyChanges (PropertyDiff[] changes, IDiffAdaptor adaptor, object obj) - { - foreach (PropertyDiff pdif in changes) { - if (pdif.Operation == DiffOperation.Add || pdif.Operation == DiffOperation.Update) - adaptor.SetPropertyValue (obj, pdif.Name, pdif.Text); - else - adaptor.ResetPropertyValue (obj, pdif.Name); - } - } - - public virtual void ApplySignalChanges (PropertyDiff[] changes, IDiffAdaptor adaptor, object obj) - { - foreach (PropertyDiff pdif in changes) { - if (pdif.Operation == DiffOperation.Add) - adaptor.AddSignal (obj, pdif.Name, pdif.Text); - else - adaptor.RemoveSignal (obj, pdif.Name, pdif.Text); - } - } - } - - - class PropertyDiff - { - public PropertyDiff (DiffOperation Operation, string Name, string Text) - { - this.Operation = Operation; - this.Name = Name; - this.Text = Text; - } - - public DiffOperation Operation; - public string Name; - public string Text; - } - - enum DiffOperation - { - Add, - Remove, - Update - } - - class ChildDiff - { - public string Id; - public DiffOperation Operation; - public XmlElement AddContent; - public string InsertAfter; - public ObjectDiff Diff; - - public string ToString (int indent) - { - string ind = new string (' ', indent); - string s = ind + Operation + " id:" + Id + "\n"; - if (Operation == DiffOperation.Update) - s += Diff.ToString (indent + 2) + "\n"; - if (Operation == DiffOperation.Add) { - s += ind + " InsertAfter: " + InsertAfter + "\n"; - s += ind + " Content: " + AddContent.OuterXml + "\n"; - } - return s; - } - } - - class ObjectDiff - { - public PropertyDiff[] PropertyChanges; - public PropertyDiff[] SignalChanges; - public ChildDiff[] ChildChanges; - - public override string ToString () - { - return ToString (0); - } - - internal string ToString (int indent) - { - string ind = new string (' ', indent); - string s = ind + "ObjectDiff:\n"; - - if (PropertyChanges != null) { - s += ind + " Properties:\n"; - foreach (PropertyDiff d in PropertyChanges) { - s += ind + " " + d.Operation + ": " + d.Name; - if (d.Operation != DiffOperation.Remove) - s += " = " + d.Text; - s += "\n"; - } - } - - if (SignalChanges != null) { - s += ind + " Signals:\n"; - foreach (PropertyDiff d in SignalChanges) - s += ind + " " + d.Operation + ": " + d.Name + " - " + d.Text + "\n"; - } - - if (ChildChanges != null) { - s += ind + " Children:\n"; - foreach (ChildDiff cd in ChildChanges) - s += cd.ToString (indent + 4); - } - - return s; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/undo/IDiffAdaptor.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/undo/IDiffAdaptor.cs deleted file mode 100644 index aab6567c810..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/undo/IDiffAdaptor.cs +++ /dev/null @@ -1,31 +0,0 @@ - -using System; -using System.Collections; -using System.Xml; - -namespace Stetic.Undo -{ - interface IDiffAdaptor - { - IEnumerable GetChildren (object parent); - string GetUndoId (object childObject); - object FindChild (object parent, string undoId); - void RemoveChild (object parent, string undoId); - void AddChild (object parent, XmlElement data, string insertAfter); - XmlElement SerializeChild (object child); - IDiffAdaptor GetChildAdaptor (object child); - - IEnumerable GetProperties (object obj); - object GetPropertyByName (object obj, string name); - string GetPropertyName (object property); - string GetPropertyValue (object obj, object property); - void SetPropertyValue (object obj, string name, string value); - void ResetPropertyValue (object obj, string name); - - IEnumerable GetSignals (object obj); - object GetSignal (object obj, string name, string handler); - void GetSignalInfo (object signal, out string name, out string handler); - void AddSignal (object obj, string name, string handler); - void RemoveSignal (object obj, string name, string handler); - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/undo/UndoManager.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/undo/UndoManager.cs deleted file mode 100644 index 8bd5d12183e..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/undo/UndoManager.cs +++ /dev/null @@ -1,315 +0,0 @@ - -using System; -using System.Xml; -using System.Collections; -using Stetic.Wrapper; - -namespace Stetic -{ - // This class holds an xml tree which describes the whole widget structure being designed. - // It is used by the Undo/Redo infrastructure to keep track of changes in widgets. - public class UndoManager - { - Hashtable elements = new Hashtable (); - XmlDocument doc; - ObjectWrapper root; - AtomicChangeTracker atomicChangeTracker; - bool isDefaultManager; - - public event UndoCheckpointHandler UndoCheckpoint; - - public UndoManager () - { - atomicChangeTracker = new AtomicChangeTracker (); - atomicChangeTracker.undoManager = this; - } - - internal UndoManager (bool isDefaultManager): this () - { - this.isDefaultManager = isDefaultManager; - } - - public void SetRoot (ObjectWrapper wrapper) - { - root = wrapper; - wrapper.UndoManager = this; - elements.Clear (); - - doc = new XmlDocument (); - UndoWriter writer = new UndoWriter (doc, this); - writer.WriteObject (wrapper); - } - - internal bool CanNotifyChanged (ObjectWrapper wrapper) - { - if (!InAtomicChange) { - if (IsRegistered (wrapper) && UndoCheckpoint != null) - UndoCheckpoint (this, new UndoCheckpointEventArgs (new ObjectWrapper[] { wrapper })); - return true; - } else - return atomicChangeTracker.ProcessChange (wrapper); - } - - public IAtomicChange AtomicChange { - get { - atomicChangeTracker.Count++; - return atomicChangeTracker; - } - } - - public bool InAtomicChange { - get { return atomicChangeTracker.InAtomicChange; } - } - - // This method can be called by containers to register new objects in the tree. - // Unless an object is registered in this way, no status will be tracked for it. - // The provided status element must be a direct or indirect child of the parent status. - internal void RegisterObject (ObjectWrapper w, XmlElement status) - { - VerifyManager (); - - if (IsRegistered (w)) - throw new InvalidOperationException ("Object already registered: " + w.GetType ()); - - elements [w] = GetLocalElement (status); - - w.Disposed += OnObjectDisposed; - } - - void OnObjectDisposed (object s, EventArgs a) - { - ObjectWrapper w = (ObjectWrapper) s; - UnregisterObject (w); - w.Disposed -= OnObjectDisposed; - } - - // This method can be called to update the xml tree, for example when a change in the - // object is detected. - internal void UpdateObjectStatus (ObjectWrapper w, XmlElement status) - { - VerifyManager (); - - XmlElement oldElem = (XmlElement) elements [w]; - if (oldElem == null) - throw new InvalidOperationException ("Could not update unregistered object of type " + w.GetType ()); - - if (oldElem != status) { - XmlElement newElem = GetLocalElement (status); - if (oldElem.ParentNode != null) { - oldElem.ParentNode.ReplaceChild (newElem, oldElem); - elements [w] = newElem; - } else { - if (w != root) - throw new InvalidOperationException ("Root element does not match the root widget: " + w.GetType ()); - elements [w] = newElem; - } - } - } - - // Returns the xml that describes the specified widget (including information for all - // children of the widget). - internal XmlElement GetObjectStatus (ObjectWrapper w) - { - VerifyManager (); - - XmlElement elem = (XmlElement) elements [w]; - if (elem == null) - throw new InvalidOperationException ("No status found for object of type " + w.GetType ()); - return elem; - } - - internal bool IsRegistered (ObjectWrapper w) - { - return elements.ContainsKey (w); - } - - internal void UnregisterObject (ObjectWrapper w) - { - VerifyManager (); - elements.Remove (w); - } - - void VerifyManager () - { - if (isDefaultManager) - throw new InvalidOperationException ("The default UndoManager can't track changes in objects."); - } - - XmlElement GetLocalElement (XmlElement elem) - { - if (elem.OwnerDocument != doc) - throw new InvalidOperationException ("Invalid document owner."); - return elem; - } - - internal void NotifyUndoCheckpoint (ObjectWrapper[] obs) - { - if (UndoCheckpoint != null) - UndoCheckpoint (this, new UndoCheckpointEventArgs (obs)); - } - - internal void Dump () - { - Console.WriteLine ("--------------------------------------"); - Console.WriteLine ("UNDO STATUS:"); - Console.WriteLine (GetObjectStatus (root).OuterXml); - Console.WriteLine ("--------------------------------------"); - } - } - - public delegate void UndoCheckpointHandler (object sender, UndoCheckpointEventArgs args); - - public class UndoCheckpointEventArgs: EventArgs - { - ObjectWrapper[] objects; - - internal UndoCheckpointEventArgs (ObjectWrapper[] objects) - { - this.objects = objects; - } - - public ObjectWrapper[] ModifiedObjects { - get { return objects; } - } - } - - // This is a special writer use to generate status info from widgets. - // This writer won't recurse through objects which are already registered - // in the provided UndoManager. - class UndoWriter: ObjectWriter - { - UndoManager undoManager; - bool allowMarkers = true; - - public UndoWriter (XmlDocument doc, UndoManager undoManager): base (doc, FileFormat.Native) - { - this.undoManager = undoManager; - CreateUndoInfo = true; - } - - public override XmlElement WriteObject (ObjectWrapper wrapper) - { - Wrapper.Widget ww = wrapper as Wrapper.Widget; - - // If the object is already registered, skip it (just create a dummy object) - if (allowMarkers && ww != null && undoManager.IsRegistered (ww) && !ww.RequiresUndoStatusUpdate) { - XmlElement marker = XmlDocument.CreateElement ("widget"); - marker.SetAttribute ("unchanged_marker","yes"); - return marker; - } - - // Don't allow markers in indirect children, since those are not checked - // when creating the diff - bool oldAllow = allowMarkers; - allowMarkers = false; - XmlElement elem = base.WriteObject (wrapper); - allowMarkers = oldAllow; - - if (ww != null) { - ww.RequiresUndoStatusUpdate = false; - } - - // Register the object, so it is correctly bound to this xml element - if (undoManager.IsRegistered (wrapper)) - undoManager.UnregisterObject (wrapper); - undoManager.RegisterObject (wrapper, elem); - - return elem; - } - } - - class UndoReader: ObjectReader - { - UndoManager undoManager; - - public UndoReader (IProject proj, FileFormat format, UndoManager undoManager): base (proj, format) - { - this.undoManager = undoManager; - } - - public override ObjectWrapper ReadObject (XmlElement elem) - { - ObjectWrapper ww = base.ReadObject (elem); - if (ww is Widget) - undoManager.RegisterObject ((Widget)ww, elem); - return ww; - } - - public override void ReadObject (ObjectWrapper wrapper, XmlElement elem) - { - base.ReadObject (wrapper, elem); - if (wrapper is Widget) - undoManager.RegisterObject ((Widget)wrapper, elem); - } - } - - public interface IAtomicChange: IDisposable - { - void Delay (); - } - - class AtomicChangeTracker: IAtomicChange - { - public int Count; - public ArrayList ChangeEventPending = new ArrayList (); - public UndoManager undoManager; - bool delayed; - - public bool InAtomicChange { - get { return Count > 0; } - } - - public bool ProcessChange (ObjectWrapper wrapper) - { - if (!ChangeEventPending.Contains (wrapper)) { - ChangeEventPending.Add (wrapper); - delayed = false; - } - return false; - } - - public void Delay () - { - delayed = true; - } - - public void Dispose () - { - if (Count == 0) - return; - - if (Count == 1) { - // The change events fired here may generate changes in other - // objects. Those changes will also be included in the transaction. - // So, the ChangeEventPending array may grow while calling NotifyChanged, - // and that's ok. - - for (int n=0; n < ChangeEventPending.Count; n++) { - ((ObjectWrapper)ChangeEventPending[n]).FireObjectChangedEvent (); - } - - // Remove from the list the widgets that have been disposed. It means that - // they have been deleted. That change will be recorded by their parents. - // Remove as well wrappers that are not registered, since there won't be - // status information for them. - for (int n=0; n 0) - return GtkAction.Label; - - if (GtkAction.StockId == null) - return ""; - - Gtk.StockItem item = Gtk.Stock.Lookup (GtkAction.StockId); - if (item.Label != null) - return item.Label; - - return ""; - } - } - - public string ToolLabel { - get { - if (GtkAction.ShortLabel != null && GtkAction.ShortLabel.Length > 0) - return GtkAction.ShortLabel; - else - return MenuLabel; - } - } - - public ActionGroup ActionGroup { - get { return group; } - } - - public string Group { - get { - return GroupManager.GetGroup (this); - } - set { - if (value != null && value.Length > 0) - Type = ActionType.Radio; - GroupManager.SetGroup (this, value); - EmitNotify ("Group"); - } - } - - public void Delete () - { - if (group != null) - group.Actions.Remove (this); - if (Deleted != null) - Deleted (this, EventArgs.Empty); - Dispose (); - } - - protected override void EmitNotify (string propertyName) - { - if (propertyName == "Label" || propertyName == "StockId") { - // If the current name is a name generated from label or stockid, - // we update here the name again - if (nameRoot == oldDefaultName) - Name = GetDefaultName (); - oldDefaultName = GetDefaultName (); - } - base.EmitNotify (propertyName); - } - - public override XmlElement Write (ObjectWriter writer) - { - XmlElement elem = writer.XmlDocument.CreateElement ("action"); - elem.SetAttribute ("id", Name); - WidgetUtils.GetProps (this, elem); - WidgetUtils.GetSignals (this, elem); - if (writer.CreateUndoInfo) - elem.SetAttribute ("undoId", UndoId); - return elem; - } - - public override void Read (ObjectReader reader, XmlElement elem) - { - Gtk.Action ac = new Gtk.Action ("", ""); - - ClassDescriptor klass = Registry.LookupClassByName ("Gtk.Action"); - ObjectWrapper.Bind (reader.Project, klass, this, ac, true); - - WidgetUtils.ReadMembers (klass, this, ac, elem); - name = nameRoot = oldDefaultName = elem.GetAttribute ("id"); - - string uid = elem.GetAttribute ("undoId"); - if (uid.Length > 0) - UndoId = uid; - } - - public Action Clone () - { - Action a = (Action) ObjectWrapper.Create (Project, new Gtk.Action ("", "")); - a.CopyFrom (this); - return a; - } - - public void CopyFrom (Action action) - { - type = action.type; - drawAsRadio = action.drawAsRadio; - radioValue = action.radioValue; - active = action.active; - name = action.name; - GtkAction.HideIfEmpty = action.GtkAction.HideIfEmpty; - GtkAction.IsImportant = action.GtkAction.IsImportant; - GtkAction.Label = action.GtkAction.Label; - GtkAction.Sensitive = action.GtkAction.Sensitive; - GtkAction.ShortLabel = action.GtkAction.ShortLabel; - GtkAction.StockId = action.GtkAction.StockId; - GtkAction.Tooltip = action.GtkAction.Tooltip; - GtkAction.Visible = action.GtkAction.Visible; - GtkAction.VisibleHorizontal = action.GtkAction.VisibleHorizontal; - GtkAction.VisibleVertical = action.GtkAction.VisibleVertical; - - Signals.Clear (); - foreach (Signal s in action.Signals) - Signals.Add (new Signal (s.SignalDescriptor, s.Handler, s.After)); - - NotifyChanged (); - } - - public Gtk.Widget CreateIcon (Gtk.IconSize size) - { - if (GtkAction.StockId == null) - return null; - - Gdk.Pixbuf px = Project.IconFactory.RenderIcon (Project, GtkAction.StockId, size); - if (px != null) - return new Gtk.Image (px); - else - return GtkAction.CreateIcon (size); - } - - public Gdk.Pixbuf RenderIcon (Gtk.IconSize size) - { - if (GtkAction.StockId == null) - return null; - - Gdk.Pixbuf px = Project.IconFactory.RenderIcon (Project, GtkAction.StockId, size); - if (px != null) - return px; - - Gtk.IconSet iset = Gtk.IconFactory.LookupDefault (GtkAction.StockId); - if (iset == null) - return WidgetUtils.MissingIcon; - else - return iset.RenderIcon (new Gtk.Style (), Gtk.TextDirection.Ltr, Gtk.StateType.Normal, size, null, ""); - } - - internal protected override CodeExpression GenerateObjectCreation (GeneratorContext ctx) - { - CodeObjectCreateExpression exp = new CodeObjectCreateExpression (); - - PropertyDescriptor prop = (PropertyDescriptor) ClassDescriptor ["Name"]; - exp.Parameters.Add (ctx.GenerateValue (prop.GetValue (Wrapped), prop.RuntimePropertyType)); - - prop = (PropertyDescriptor) ClassDescriptor ["Label"]; - string lab = (string) prop.GetValue (Wrapped); - if (lab == "") lab = null; - exp.Parameters.Add (ctx.GenerateValue (lab, prop.RuntimePropertyType, prop.Translatable)); - - prop = (PropertyDescriptor) ClassDescriptor ["Tooltip"]; - exp.Parameters.Add (ctx.GenerateValue (prop.GetValue (Wrapped), prop.RuntimePropertyType, prop.Translatable)); - - prop = (PropertyDescriptor) ClassDescriptor ["StockId"]; - exp.Parameters.Add (ctx.GenerateValue (prop.GetValue (Wrapped), prop.RuntimePropertyType, prop.Translatable)); - - if (type == ActionType.Action) - exp.CreateType = new CodeTypeReference ("Gtk.Action", CodeTypeReferenceOptions.GlobalReference); - else if (type == ActionType.Toggle) - exp.CreateType = new CodeTypeReference ("Gtk.ToggleAction", CodeTypeReferenceOptions.GlobalReference); - else { - exp.CreateType = new CodeTypeReference ("Gtk.RadioAction", CodeTypeReferenceOptions.GlobalReference); - prop = (PropertyDescriptor) ClassDescriptor ["Value"]; - exp.Parameters.Add (ctx.GenerateValue (prop.GetValue (Wrapped), typeof(int))); - } - return exp; - } - - internal protected override void GenerateBuildCode (GeneratorContext ctx, CodeExpression var) - { - if (Type == ActionType.Radio) { - CodeExpression groupExp = GroupManager.GenerateGroupExpression (ctx, this); - ctx.Statements.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression (var, "Group"), - groupExp) - ); - } - else if (type == ActionType.Toggle) { - if (Active) { - ctx.Statements.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression (var, "Active"), - new CodePrimitiveExpression (true)) - ); - } - if (DrawAsRadio) { - ctx.Statements.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression (var, "DrawAsRadio"), - new CodePrimitiveExpression (true)) - ); - } - } - base.GenerateBuildCode (ctx, var); - } - - internal void SetActionGroup (ActionGroup g) - { - group = g; - } - - string GetIdentifier (string name) - { - StringBuilder sb = new StringBuilder (); - - bool wstart = false; - foreach (char c in name) { - if (c == '_' || (int)c > 127) // No underline, no unicode - continue; - if (c == '-' || c == ' ' || !char.IsLetterOrDigit (c)) { - wstart = true; - continue; - } - if (wstart) { - sb.Append (char.ToUpper (c)); - wstart = false; - } else - sb.Append (c); - } - return sb.ToString () + "Action"; - } - - internal override UndoManager GetUndoManagerInternal () - { - if (group != null) - return group.GetUndoManagerInternal (); - else - return base.GetUndoManagerInternal (); - } - - DiffGenerator GetDiffGenerator () - { - DiffGenerator gen = new DiffGenerator (); - gen.CurrentStatusAdaptor = new ActionDiffAdaptor (Project); - gen.NewStatusAdaptor = new XmlDiffAdaptor (); - return gen; - } - - public override object GetUndoDiff () - { - XmlElement oldElem = UndoManager.GetObjectStatus (this); - UndoWriter writer = new UndoWriter (oldElem.OwnerDocument, UndoManager); - XmlElement newElem = Write (writer); - ObjectDiff actionsDiff = GetDiffGenerator().GetDiff (this, oldElem); - UndoManager.UpdateObjectStatus (this, newElem); - return actionsDiff; - } - - public override object ApplyUndoRedoDiff (object diff) - { - ObjectDiff actionsDiff = (ObjectDiff) diff; - - XmlElement status = UndoManager.GetObjectStatus (this); - - DiffGenerator differ = GetDiffGenerator(); - differ.ApplyDiff (this, actionsDiff); - actionsDiff = differ.GetDiff (this, status); - - UndoWriter writer = new UndoWriter (status.OwnerDocument, UndoManager); - XmlElement newElem = Write (writer); - UndoManager.UpdateObjectStatus (this, newElem); - - return actionsDiff; - } - } - - [Serializable] - public class ActionCollection: CollectionBase - { - [NonSerialized] - ActionGroup group; - - public ActionCollection () - { - } - - internal ActionCollection (ActionGroup group) - { - this.group = group; - } - - public void Add (Action action) - { - List.Add (action); - } - - public void Insert (int i, Action action) - { - List.Insert (i, action); - } - - public Action this [int n] { - get { return (Action) List [n]; } - } - - public void Remove (Action action) - { - List.Remove (action); - } - - public bool Contains (Action action) - { - return List.Contains (action); - } - - public void CopyTo (Action[] array, int index) - { - List.CopyTo (array, index); - } - - protected override void OnInsertComplete (int index, object val) - { - if (group != null) - group.NotifyActionAdded ((Action) val); - } - - protected override void OnRemoveComplete (int index, object val) - { - if (group != null) - group.NotifyActionRemoved ((Action)val); - } - - protected override void OnSetComplete (int index, object oldv, object newv) - { - if (group != null) { - group.NotifyActionRemoved ((Action) oldv); - group.NotifyActionAdded ((Action) newv); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ActionGroup.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ActionGroup.cs deleted file mode 100644 index 42ac4832073..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ActionGroup.cs +++ /dev/null @@ -1,425 +0,0 @@ - -using System; -using System.CodeDom; -using System.Xml; -using System.Collections; -using Stetic.Undo; - -namespace Stetic.Wrapper -{ - public sealed class ActionGroup: ObjectWrapper - { - string name; - ActionCollection actions; - ObjectWrapper owner; - bool generatePublic = true; - - public event ActionEventHandler ActionAdded; - public event ActionEventHandler ActionRemoved; - public event ActionEventHandler ActionChanged; - - public ActionGroup () - { - actions = new ActionCollection (this); - } - - public ActionGroup (string name): this () - { - this.name = name; - } - - public override void Dispose () - { - foreach (Action a in actions) - a.Dispose (); - base.Dispose (); - } - - public ActionCollection Actions { - get { return actions; } - } - - public string Name { - get { return name; } - set { - name = value; - NotifyChanged (); - } - } - - public bool GeneratePublic { - get { return generatePublic; } - set { generatePublic = value; } - } - - public Action GetAction (string name) - { - foreach (Action ac in actions) - if (ac.Name == name) - return ac; - return null; - } - - internal string GetValidName (Action reqAction, string name) - { - int max = 0; - bool found = false; - foreach (Action ac in Actions) { - if (ac == reqAction) - continue; - - string bname; - int index; - WidgetUtils.ParseWidgetName (ac.Name, out bname, out index); - - if (name == ac.Name) - found = true; - if (name == bname && index > max) - max = index; - } - if (found) - return name + (max+1); - else - return name; - } - - public override XmlElement Write (ObjectWriter writer) - { - XmlElement group = writer.XmlDocument.CreateElement ("action-group"); - group.SetAttribute ("name", name); - if (writer.CreateUndoInfo) - group.SetAttribute ("undoId", UndoId); - foreach (Action ac in actions) { - if (ac.Name.Length > 0) - group.AppendChild (writer.WriteObject (ac)); - } - return group; - } - - public override void Read (ObjectReader reader, XmlElement elem) - { - name = elem.GetAttribute ("name"); - string uid = elem.GetAttribute ("undoId"); - if (uid.Length > 0) - UndoId = uid; - foreach (XmlElement child in elem.SelectNodes ("action")) { - Action ac = new Action (); - ac.Read (reader, child); - actions.Add (ac); - } - } - - internal protected override CodeExpression GenerateObjectCreation (GeneratorContext ctx) - { - return new CodeObjectCreateExpression ( - typeof(Gtk.ActionGroup).ToGlobalTypeRef (), - new CodePrimitiveExpression (Name) - ); - } - - internal protected override void GenerateBuildCode (GeneratorContext ctx, CodeExpression var) - { - foreach (Action action in Actions) { - // Create the action - CodeExpression acVarExp = ctx.GenerateInstanceExpression (action, action.GenerateObjectCreation (ctx)); - ctx.GenerateBuildCode (action, acVarExp); - ctx.Statements.Add ( - new CodeMethodInvokeExpression ( - var, - "Add", - acVarExp, - new CodePrimitiveExpression (action.Accelerator) - ) - ); - } - } - - internal void SetOwner (ObjectWrapper owner) - { - this.owner = owner; - } - - internal override UndoManager GetUndoManagerInternal () - { - if (owner != null) - return owner.UndoManager; - else - return base.GetUndoManagerInternal (); - } - - public override ObjectWrapper FindObjectByUndoId (string id) - { - ObjectWrapper ow = base.FindObjectByUndoId (id); - if (ow != null) return ow; - - foreach (Action ac in Actions) { - ow = ac.FindObjectByUndoId (id); - if (ow != null) - return ow; - } - return null; - } - - DiffGenerator GetDiffGenerator () - { - DiffGenerator gen = new DiffGenerator (); - gen.CurrentStatusAdaptor = new ActionDiffAdaptor (Project); - XmlDiffAdaptor xad = new XmlDiffAdaptor (); - xad.ChildElementName = "action"; - gen.NewStatusAdaptor = xad; - return gen; - } - - public override object GetUndoDiff () - { - XmlElement oldElem = UndoManager.GetObjectStatus (this); - UndoWriter writer = new UndoWriter (oldElem.OwnerDocument, UndoManager); - - XmlElement newElem = Write (writer); - ObjectDiff actionsDiff = GetDiffGenerator().GetDiff (this, oldElem); - UndoManager.UpdateObjectStatus (this, newElem); - return actionsDiff; - } - - public override object ApplyUndoRedoDiff (object diff) - { - ObjectDiff actionsDiff = (ObjectDiff) diff; - - XmlElement status = UndoManager.GetObjectStatus (this); - - DiffGenerator differ = GetDiffGenerator(); - differ.ApplyDiff (this, actionsDiff); - actionsDiff = differ.GetDiff (this, status); - - UndoWriter writer = new UndoWriter (status.OwnerDocument, UndoManager); - XmlElement newElem = Write (writer); - UndoManager.UpdateObjectStatus (this, newElem); - - return actionsDiff; - } - - internal void NotifyActionAdded (Action ac) - { - ac.SetActionGroup (this); - ac.ObjectChanged += OnActionChanged; - ac.SignalAdded += OnSignalAdded; - ac.SignalRemoved += OnSignalRemoved; - ac.SignalChanged += OnSignalChanged; - - ac.UpdateNameIndex (); - - NotifyChanged (); - - if (ActionAdded != null) - ActionAdded (this, new ActionEventArgs (ac)); - } - - internal void NotifyActionRemoved (Action ac) - { - ac.SetActionGroup (null); - ac.ObjectChanged -= OnActionChanged; - ac.SignalAdded -= OnSignalAdded; - ac.SignalRemoved -= OnSignalRemoved; - ac.SignalChanged -= OnSignalChanged; - - NotifyChanged (); - - if (ActionRemoved != null) - ActionRemoved (this, new ActionEventArgs (ac)); - } - - void OnActionChanged (object s, ObjectWrapperEventArgs args) - { - NotifyChanged (); - if (ActionChanged != null) - ActionChanged (this, new ActionEventArgs ((Action) args.Wrapper)); - } - - void OnSignalAdded (object s, SignalEventArgs args) - { - OnSignalAdded (args); - } - - void OnSignalRemoved (object s, SignalEventArgs args) - { - OnSignalRemoved (args); - } - - void OnSignalChanged (object s, SignalChangedEventArgs args) - { - OnSignalChanged (args); - } - } - - public class ActionGroupCollection: CollectionBase - { - ActionGroup[] toClear; - ObjectWrapper owner; - - internal void SetOwner (ObjectWrapper owner) - { - this.owner = owner; - } - - public void Add (ActionGroup group) - { - List.Add (group); - } - - public void Insert (int n, ActionGroup group) - { - List.Insert (n, group); - } - - public ActionGroup this [int n] { - get { return (ActionGroup) List [n]; } - } - - public ActionGroup this [string name] { - get { - foreach (ActionGroup grp in List) - if (grp.Name == name) - return grp; - return null; - } - } - - internal ObjectWrapper FindObjectByUndoId (string id) - { - foreach (ActionGroup ag in List) { - ObjectWrapper ow = ag.FindObjectByUndoId (id); - if (ow != null) - return ow; - } - return null; - } - - DiffGenerator GetDiffGenerator (IProject prj) - { - DiffGenerator gen = new DiffGenerator (); - gen.CurrentStatusAdaptor = new ActionDiffAdaptor (prj); - XmlDiffAdaptor xad = new XmlDiffAdaptor (); - xad.ChildElementName = "action-group"; - xad.ProcessProperties = false; - xad.ChildAdaptor = new XmlDiffAdaptor (); - xad.ChildAdaptor.ChildElementName = "action"; - gen.NewStatusAdaptor = xad; - return gen; - } - - internal ObjectDiff GetDiff (IProject prj, XmlElement elem) - { - return GetDiffGenerator (prj).GetDiff (this, elem); - } - - internal void ApplyDiff (IProject prj, ObjectDiff diff) - { - GetDiffGenerator (prj).ApplyDiff (this, diff); - } - - public int IndexOf (ActionGroup group) - { - return List.IndexOf (group); - } - - public void Remove (ActionGroup group) - { - List.Remove (group); - } - - protected override void OnInsertComplete (int index, object val) - { - NotifyGroupAdded ((ActionGroup) val); - } - - protected override void OnRemoveComplete (int index, object val) - { - NotifyGroupRemoved ((ActionGroup)val); - } - - protected override void OnSetComplete (int index, object oldv, object newv) - { - NotifyGroupRemoved ((ActionGroup) oldv); - NotifyGroupAdded ((ActionGroup) newv); - } - - protected override void OnClear () - { - toClear = new ActionGroup [Count]; - List.CopyTo (toClear, 0); - } - - protected override void OnClearComplete () - { - foreach (ActionGroup a in toClear) - NotifyGroupRemoved (a); - toClear = null; - } - - void NotifyGroupAdded (ActionGroup grp) - { - grp.SetOwner (owner); - grp.ObjectChanged += OnGroupChanged; - if (ActionGroupAdded != null) - ActionGroupAdded (this, new ActionGroupEventArgs (grp)); - } - - void NotifyGroupRemoved (ActionGroup grp) - { - grp.SetOwner (null); - grp.ObjectChanged -= OnGroupChanged; - if (ActionGroupRemoved != null) - ActionGroupRemoved (this, new ActionGroupEventArgs (grp)); - } - - void OnGroupChanged (object s, ObjectWrapperEventArgs a) - { - if (ActionGroupChanged != null) - ActionGroupChanged (this, new ActionGroupEventArgs ((ActionGroup)s)); - } - - public ActionGroup[] ToArray () - { - ActionGroup[] groups = new ActionGroup [Count]; - List.CopyTo (groups, 0); - return groups; - } - - public event ActionGroupEventHandler ActionGroupAdded; - public event ActionGroupEventHandler ActionGroupRemoved; - public event ActionGroupEventHandler ActionGroupChanged; - } - - - public delegate void ActionEventHandler (object sender, ActionEventArgs args); - - public class ActionEventArgs: EventArgs - { - readonly Action action; - - public ActionEventArgs (Action ac) - { - action = ac; - } - - public Action Action { - get { return action; } - } - } - - public delegate void ActionGroupEventHandler (object sender, ActionGroupEventArgs args); - - public class ActionGroupEventArgs: EventArgs - { - readonly ActionGroup action; - - public ActionGroupEventArgs (ActionGroup ac) - { - action = ac; - } - - public ActionGroup ActionGroup { - get { return action; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ActionToolbarWrapper.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ActionToolbarWrapper.cs deleted file mode 100644 index 9b65f1432ce..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ActionToolbarWrapper.cs +++ /dev/null @@ -1,337 +0,0 @@ - -using System; -using System.CodeDom; -using System.Xml; -using System.Collections; -using Stetic.Editor; - -namespace Stetic.Wrapper -{ - public class ActionToolbarWrapper: Container - { - ActionTree actionTree; - XmlElement toolbarInfo; - ToolbarStyle toolbarStyle = ToolbarStyle.Default; - ToolbarIconSize iconSize = ToolbarIconSize.Default; - bool treeChanged; - - static Gtk.ToolbarStyle defaultStyle; - static Gtk.IconSize defaultSize; - static bool gotDefault; - - public enum ToolbarStyle { - Icons, - Text, - Both, - BothHoriz, - Default - } - - public enum ToolbarIconSize { - Menu = Gtk.IconSize.Menu, - SmallToolbar = Gtk.IconSize.SmallToolbar, - LargeToolbar = Gtk.IconSize.LargeToolbar, - Button = Gtk.IconSize.Button, - Dnd = Gtk.IconSize.Dnd, - Dialog = Gtk.IconSize.Dialog, - Default = -1 - } - - public ActionToolbarWrapper() - { - } - - public override void Dispose () - { - DisposeTree (); - base.Dispose (); - } - - public static Gtk.Toolbar CreateInstance () - { - ActionToolbar t = new ActionToolbar (); - // Looks like the default size and style are set when adding the toolbar to the window, - // so we have to explicitly get the defaults to make sure the toolbar is properly initialized - GetDefaults (); - t.IconSize = defaultSize; - t.ToolbarStyle = defaultStyle; - return t; - } - - ActionToolbar toolbar { - get { return (ActionToolbar) Wrapped; } - } - - protected override bool AllowPlaceholders { - get { return false; } - } - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - CreateTree (); - toolbar.FillMenu (actionTree); - } - - public override bool HExpandable { - get { - return toolbar.Orientation == Gtk.Orientation.Horizontal; - } - } - - public override bool VExpandable { - get { - return toolbar.Orientation == Gtk.Orientation.Vertical; - } - } - - public Gtk.Orientation Orientation { - get { - return toolbar.Orientation; - } - set { - toolbar.Orientation = value; - EmitContentsChanged (); - } - } - - public ToolbarIconSize ButtonIconSize { - get { return iconSize; } - set { - iconSize = value; - if (value == ToolbarIconSize.Default) { - GetDefaults (); - toolbar.IconSize = defaultSize; - } else { - toolbar.IconSize = (Gtk.IconSize) ((int)value); - } - EmitNotify ("ButtonIconSize"); - } - } - - public ToolbarStyle ButtonStyle { - get { return toolbarStyle; } - set { - toolbarStyle = value; - if (value == ToolbarStyle.Default) { - GetDefaults (); - toolbar.ToolbarStyle = defaultStyle; - } else { - toolbar.ToolbarStyle = (Gtk.ToolbarStyle) ((int)value); - } - EmitNotify ("ButtonStyle"); - } - } - - static void GetDefaults () - { - if (!gotDefault) { - // Is there a better way of getting the default? - Gtk.Window d = new Gtk.Window (""); - Gtk.Toolbar t = new Gtk.Toolbar (); - d.Add (t); - defaultStyle = t.ToolbarStyle; - defaultSize = t.IconSize; - d.Destroy (); - gotDefault = true; - } - } - - internal protected override void OnSelected () - { - Loading = true; - toolbar.ShowInsertPlaceholder = true; - Loading = false; - } - - internal protected override void OnUnselected () - { - base.OnUnselected (); - Loading = true; - toolbar.ShowInsertPlaceholder = false; - toolbar.Unselect (); - Loading = false; - } - - protected override XmlElement WriteProperties (ObjectWriter writer) - { - XmlElement elem = base.WriteProperties (writer); - if (writer.Format == FileFormat.Native) { - // The style and icon size is already stored in ButtonStyle and ButtonIconSize - GladeUtils.ExtractProperty (elem, "ToolbarStyle", ""); - GladeUtils.ExtractProperty (elem, "IconSize", ""); - - // Store ButtonIconSize as IconSize, for backwards compat - GladeUtils.RenameProperty (elem, "ButtonIconSize", "IconSize"); - - if (toolbarInfo != null) - elem.AppendChild (writer.XmlDocument.ImportNode (toolbarInfo, true)); - else - elem.AppendChild (actionTree.Write (writer.XmlDocument, writer.Format)); - } - return elem; - } - - protected override void ReadProperties (ObjectReader reader, XmlElement elem) - { - // ButtonIconSize is stored as IconSize - GladeUtils.RenameProperty (elem, "IconSize", "ButtonIconSize"); - - base.ReadProperties (reader, elem); - toolbarInfo = elem ["node"]; - } - - protected override void OnNameChanged (WidgetNameChangedArgs args) - { - base.OnNameChanged (args); - if (actionTree != null) - actionTree.Name = Name; - } - - internal protected override CodeExpression GenerateObjectCreation (GeneratorContext ctx) - { - BuildTree (); - actionTree.Type = Gtk.UIManagerItemType.Toolbar; - actionTree.Name = Name; - - CodeExpression exp = GenerateUiManagerElement (ctx, actionTree); - if (exp != null) - return new CodeCastExpression (typeof(Gtk.Toolbar).ToGlobalTypeRef (), exp); - else - return base.GenerateObjectCreation (ctx); - } - - protected override void GeneratePropertySet (GeneratorContext ctx, CodeExpression var, PropertyDescriptor prop) - { - if (toolbarStyle == ToolbarStyle.Default && prop.Name == "ToolbarStyle") - return; - else if (iconSize == ToolbarIconSize.Default && prop.Name == "IconSize") - return; - else - base.GeneratePropertySet (ctx, var, prop); - } - - internal protected override void OnDesignerAttach (IDesignArea designer) - { - base.OnDesignerAttach (designer); - BuildTree (); - - Loading = true; - toolbar.FillMenu (actionTree); - Loading = false; - - if (LocalActionGroups.Count == 0) - LocalActionGroups.Add (new ActionGroup ("Default")); - } - - protected override void EmitNotify (string propertyName) - { - base.EmitNotify (propertyName); - toolbar.FillMenu (actionTree); - } - - public override object GetUndoDiff () - { - XmlElement oldElem = treeChanged ? UndoManager.GetObjectStatus (this) ["node"] : null; - if (oldElem != null) - oldElem = (XmlElement) oldElem.CloneNode (true); - - treeChanged = false; - object baseDiff = base.GetUndoDiff (); - - if (oldElem != null) { - XmlElement newElem = UndoManager.GetObjectStatus (this) ["node"]; - if (newElem != null && oldElem.OuterXml == newElem.OuterXml) - oldElem = null; - } - - if (baseDiff == null && oldElem == null) - return null; - else { - object stat = toolbar.SaveStatus (); - return new object[] { baseDiff, oldElem, stat }; - } - } - - public override object ApplyUndoRedoDiff (object diff) - { - object[] data = (object[]) diff; - object retBaseDiff; - XmlElement oldNode = null; - - if (actionTree != null) { - XmlElement status = UndoManager.GetObjectStatus (this); - oldNode = status ["node"]; - if (oldNode != null) - oldNode = (XmlElement) oldNode.CloneNode (true); - } - object oldStat = toolbar.SaveStatus (); - - if (data [0] != null) - retBaseDiff = base.ApplyUndoRedoDiff (data [0]); - else - retBaseDiff = null; - - XmlElement xdiff = (XmlElement) data [1]; - - if (xdiff != null) { - XmlElement status = UndoManager.GetObjectStatus (this); - XmlElement prevNode = status ["node"]; - if (prevNode != null) - status.RemoveChild (prevNode); - status.AppendChild (xdiff); - - if (actionTree != null) { - Loading = true; - DisposeTree (); - CreateTree (); - actionTree.Read (this, xdiff); - toolbar.FillMenu (actionTree); - Loading = false; - } - } - - // Restore the status after all menu structure has been properly built - GLib.Timeout.Add (50, delegate { - toolbar.RestoreStatus (data[2]); - return false; - }); - - return new object [] { retBaseDiff, oldNode, oldStat }; - } - - - void BuildTree () - { - if (toolbarInfo != null) { - DisposeTree (); - CreateTree (); - actionTree.Read (this, toolbarInfo); - toolbarInfo = null; - } - } - - void CreateTree () - { - actionTree = new ActionTree (); - actionTree.Name = Name; - actionTree.Type = Gtk.UIManagerItemType.Toolbar; - actionTree.Changed += OnTreeChanged; - } - - void DisposeTree () - { - if (actionTree != null) { - actionTree.Dispose (); - actionTree.Changed -= OnTreeChanged; - actionTree = null; - } - } - - void OnTreeChanged (object s, EventArgs a) - { - treeChanged = true; - NotifyChanged (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ActionTree.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ActionTree.cs deleted file mode 100644 index 3caceadeb16..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ActionTree.cs +++ /dev/null @@ -1,351 +0,0 @@ - -using System; -using System.Text; -using System.Xml; -using System.CodeDom; -using System.Collections; - -namespace Stetic.Wrapper -{ - - public class ActionTree: ActionTreeNode - { - public event EventHandler Changed; - - public ActionTree() - { - } - - public void GenerateBuildCode (GeneratorContext ctx, CodeFieldReferenceExpression uiManager) - { - StringBuilder sb = new StringBuilder (); - sb.Append (""); - GenerateUiString (sb); - sb.Append (""); - - CodeMethodInvokeExpression exp = new CodeMethodInvokeExpression ( - uiManager, - "AddUiFromString", - new CodePrimitiveExpression (sb.ToString ()) - ); - ctx.Statements.Add (exp); - } - - public ActionGroup[] GetRequiredGroups () - { - ArrayList list = new ArrayList (); - GetRequiredGroups (list); - return (ActionGroup[]) list.ToArray (typeof(ActionGroup)); - } - - internal override void NotifyChanged () - { - if (Changed != null) - Changed (this, EventArgs.Empty); - } - } - - public class ActionTreeNode: IDisposable - { - Gtk.UIManagerItemType type; - string name; - Action action; - ActionTreeNodeCollection children; - ActionTreeNode parentNode; - bool loading; - string lastActionName; - - public ActionTreeNode () - { - } - - public ActionTreeNode Clone () - { - return new ActionTreeNode (type, name, action); - } - - public ActionTreeNode (Gtk.UIManagerItemType type, string name, Action action) - { - this.type = type; - this.name = name; - this.action = action; - if (this.action != null) { - lastActionName = this.action.Name; - this.action.Deleted += OnActionDeleted; - this.action.ObjectChanged += OnActionChanged; - } - } - - public virtual void Dispose () - { - if (action != null) { - action.Deleted -= OnActionDeleted; - action.ObjectChanged -= OnActionChanged; - } - if (children != null) - foreach (ActionTreeNode node in children) - node.Dispose (); - } - - void OnActionDeleted (object s, EventArgs args) - { - if (parentNode != null) - parentNode.Children.Remove (this); - } - - void OnActionChanged (object s, ObjectWrapperEventArgs args) - { - // If the name of the action changes, consider it a change in - // the node, since the generated xml will be different - - Action ac = (Action) args.Wrapper; - if (ac.Name != lastActionName) { - lastActionName = ac.Name; - NotifyChanged (); - } - } - - internal virtual void NotifyChanged () - { - if (parentNode != null) - parentNode.NotifyChanged (); - } - - public XmlElement Write (XmlDocument doc, FileFormat format) - { - XmlElement elem = doc.CreateElement ("node"); - if (name != null && name.Length > 0) - elem.SetAttribute ("name", name); - elem.SetAttribute ("type", type.ToString ()); - if (action != null) - elem.SetAttribute ("action", action.Name); - - if (children != null) { - foreach (ActionTreeNode child in children) { - if (child.Action != null && child.Action.Name.Length == 0) - continue; - elem.AppendChild (child.Write (doc, format)); - } - } - return elem; - } - - public void Read (Wrapper.Widget baseWidget, XmlElement elem) - { - name = elem.GetAttribute ("name"); - if (elem.HasAttribute ("type")) - type = (Gtk.UIManagerItemType) Enum.Parse (typeof(Gtk.UIManagerItemType), elem.GetAttribute ("type")); - - // The name of an action may be empty in some situations (e.g. when adding a new action but before entering the name) - XmlAttribute actionAt = elem.Attributes ["action"]; - if (actionAt != null) { - string aname = actionAt.Value; - foreach (ActionGroup grp in baseWidget.LocalActionGroups) { - action = grp.GetAction (aname); - if (action != null) - break; - } - if (action == null) { - foreach (ActionGroup group in baseWidget.Project.ActionGroups) { - action = group.GetAction (aname); - if (action != null) - break; - } - } - if (action != null) { - lastActionName = action.Name; - action.Deleted += OnActionDeleted; - action.ObjectChanged += OnActionChanged; - } - } - - try { - loading = true; - foreach (XmlElement child in elem.SelectNodes ("node")) { - ActionTreeNode node = new ActionTreeNode (); - node.Read (baseWidget, child); - Children.Add (node); - } - } finally { - loading = false; - } - } - - public virtual void GenerateBuildCode (GeneratorContext ctx, CodeVariableReferenceExpression uiManager, string path) - { - CodeMethodInvokeExpression exp = new CodeMethodInvokeExpression ( - uiManager, - "AddUi", - new CodePrimitiveExpression (0), - new CodePrimitiveExpression (path), - new CodePrimitiveExpression (name), - new CodePrimitiveExpression (action != null ? action.Name : null), - new CodeFieldReferenceExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (typeof(Gtk.UIManagerItemType), CodeTypeReferenceOptions.GlobalReference)), - type.ToString() - ), - new CodePrimitiveExpression (false) - ); - ctx.Statements.Add (exp); - - string localName = (name != null && name.Length > 0 ? name : (action != null ? action.Name : null)); - if (localName != null) { - if (path != "/") - path = path + "/" + localName; - else - path += localName; - } - - foreach (ActionTreeNode node in Children) - node.GenerateBuildCode (ctx, uiManager, path); - } - - public void GenerateUiString (StringBuilder sb) - { - sb.Append ('<').Append (type.ToString().ToLower()); - - string name = this.name; - if (String.IsNullOrEmpty (name) && action != null) - name = action.Name; - - if (!String.IsNullOrEmpty (name)) - sb.Append (" name='").Append (name).Append ("'"); - if (action != null) - sb.Append (" action='").Append (action.Name).Append ("'"); - - if (Children.Count > 0) { - sb.Append ('>'); - foreach (ActionTreeNode node in Children) - node.GenerateUiString (sb); - sb.Append ("'); - } else - sb.Append ("/>"); - } - - protected void GetRequiredGroups (ArrayList list) - { - if (action != null && action.ActionGroup != null && !list.Contains (action.ActionGroup)) - list.Add (action.ActionGroup); - foreach (ActionTreeNode node in Children) - node.GetRequiredGroups (list); - } - - public Gtk.UIManagerItemType Type { - get { return type; } - set { type = value; NotifyChanged (); } - } - - public string Name { - get { return name; } - set { name = value; NotifyChanged (); } - } - - public Action Action { - get { return action; } - } - - public ActionTreeNode ParentNode { - get { return parentNode; } - } - - public ActionTreeNodeCollection Children { - get { - if (children == null) - children = new ActionTreeNodeCollection (this); - return children; - } - } - - internal void NotifyChildAdded (ActionTreeNode node) - { - node.parentNode = this; - if (!loading) { - NotifyChanged (); - if (ChildNodeAdded != null) - ChildNodeAdded (this, new ActionTreeNodeArgs (node)); - } - } - - internal void NotifyChildRemoved (ActionTreeNode node) - { - node.parentNode = null; - if (!loading) { - NotifyChanged (); - if (ChildNodeRemoved != null) - ChildNodeRemoved (this, new ActionTreeNodeArgs (node)); - } - } - - public event ActionTreeNodeHanlder ChildNodeAdded; - public event ActionTreeNodeHanlder ChildNodeRemoved; - } - - public class ActionTreeNodeCollection: CollectionBase - { - ActionTreeNode parent; - - public ActionTreeNodeCollection (ActionTreeNode parent) - { - this.parent = parent; - } - - public void Add (ActionTreeNode node) - { - List.Add (node); - } - - public void Insert (int index, ActionTreeNode node) - { - List.Insert (index, node); - } - - public int IndexOf (ActionTreeNode node) - { - return List.IndexOf (node); - } - - public void Remove (ActionTreeNode node) - { - if (List.Contains (node)) - List.Remove (node); - } - - public ActionTreeNode this [int n] { - get { return (ActionTreeNode) List [n]; } - set { List [n] = value; } - } - - protected override void OnInsertComplete (int index, object val) - { - parent.NotifyChildAdded ((ActionTreeNode) val); - } - - protected override void OnRemoveComplete (int index, object val) - { - parent.NotifyChildRemoved ((ActionTreeNode)val); - } - - protected override void OnSetComplete (int index, object oldv, object newv) - { - parent.NotifyChildRemoved ((ActionTreeNode) oldv); - parent.NotifyChildAdded ((ActionTreeNode) newv); - } - } - - public delegate void ActionTreeNodeHanlder (object ob, ActionTreeNodeArgs args); - - public class ActionTreeNodeArgs: EventArgs - { - readonly ActionTreeNode node; - - public ActionTreeNodeArgs (ActionTreeNode node) - { - this.node = node; - } - - public ActionTreeNode Node { - get { return node; } - } - } - -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Bin.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Bin.cs deleted file mode 100644 index d40169e9eda..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Bin.cs +++ /dev/null @@ -1,378 +0,0 @@ -using System; -using System.CodeDom; -using System.Reflection; - -namespace Stetic.Wrapper -{ - public class Bin: Container - { - public static Gtk.Bin CreateInstance (ClassDescriptor klass) - { - if (klass.Name == "Gtk.Bin") - return new CustomWidget (); - else - return null; - } - - internal protected override void GenerateBuildCode (GeneratorContext ctx, CodeExpression var) - { - if (ClassDescriptor.WrappedTypeName == "Gtk.Bin") { - - // Gtk.Bin needs a helper class which handles child allocation. - // This class needs to be generated since Stetic won't be linked with - // the app. - - bool found = false; - foreach (CodeTypeDeclaration dec in ctx.GlobalCodeNamespace.Types) { - if (dec.Name == "BinContainer") { - found = true; - break; - } - } - - if (!found) - GenerateHelperClass (ctx); - - CodeMethodInvokeExpression attachExp = new CodeMethodInvokeExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (ctx.GlobalCodeNamespace.Name + ".BinContainer", CodeTypeReferenceOptions.GlobalReference)), - "Attach", - var - ); - - // If the Bin has its own action groups, we need to register - // the resulting UIManager in the BinContainer, but it needs to be done - // after generating it. Right now, we only keep a reference to - // the BinContainer. - - string binContainerVar = null; - - if (IsTopLevel && LocalActionGroups.Count > 0) { - binContainerVar = ctx.NewId (); - ctx.Statements.Add ( - new CodeVariableDeclarationStatement ( - (ctx.GlobalCodeNamespace.Name + ".BinContainer"), - binContainerVar, - attachExp - ) - ); - } else { - ctx.Statements.Add (attachExp); - } - - base.GenerateBuildCode (ctx, var); - - // Register the UIManager, if the Bin has one - - if (binContainerVar != null && UIManagerName != null) { - ctx.Statements.Add ( - new CodeMethodInvokeExpression ( - new CodeVariableReferenceExpression (binContainerVar), - "SetUiManager", - new CodeVariableReferenceExpression (UIManagerName) - ) - ); - } - - } else - base.GenerateBuildCode (ctx, var); - } - - void GenerateHelperClass (GeneratorContext ctx) - { - CodeTypeDeclaration type = new CodeTypeDeclaration ("BinContainer"); - type.Attributes = MemberAttributes.Private; - type.TypeAttributes = TypeAttributes.NestedAssembly; - ctx.GlobalCodeNamespace.Types.Add (type); - - CodeMemberField field = new CodeMemberField ("Gtk.Widget", "child"); - field.Attributes = MemberAttributes.Private; - type.Members.Add (field); - - field = new CodeMemberField ("Gtk.UIManager", "uimanager"); - field.Attributes = MemberAttributes.Private; - type.Members.Add (field); - - CodeExpression child = new CodeFieldReferenceExpression ( - new CodeThisReferenceExpression (), - "child" - ); - - CodeExpression uimanager = new CodeFieldReferenceExpression ( - new CodeThisReferenceExpression (), - "uimanager" - ); - - // Attach method - - CodeMemberMethod met = new CodeMemberMethod (); - type.Members.Add (met); - met.Name = "Attach"; - met.Attributes = MemberAttributes.Public | MemberAttributes.Static; - met.ReturnType = new CodeTypeReference ("BinContainer"); - met.Parameters.Add (new CodeParameterDeclarationExpression ("Gtk.Bin", "bin")); - - CodeVariableDeclarationStatement bcDec = new CodeVariableDeclarationStatement ("BinContainer", "bc"); - bcDec.InitExpression = new CodeObjectCreateExpression ("BinContainer"); - met.Statements.Add (bcDec); - CodeVariableReferenceExpression bc = new CodeVariableReferenceExpression ("bc"); - CodeArgumentReferenceExpression bin = new CodeArgumentReferenceExpression ("bin"); - - met.Statements.Add ( - new CodeAttachEventStatement ( - bin, - "SizeRequested", - new CodeDelegateCreateExpression ( - new CodeTypeReference ("Gtk.SizeRequestedHandler"), bc, "OnSizeRequested" - ) - ) - ); - - met.Statements.Add ( - new CodeAttachEventStatement ( - bin, - "SizeAllocated", - new CodeDelegateCreateExpression ( - new CodeTypeReference ("Gtk.SizeAllocatedHandler"), bc, "OnSizeAllocated" - ) - ) - ); - - met.Statements.Add ( - new CodeAttachEventStatement ( - bin, - "Added", - new CodeDelegateCreateExpression ( - new CodeTypeReference ("Gtk.AddedHandler"), bc, "OnAdded" - ) - ) - ); - met.Statements.Add (new CodeMethodReturnStatement (bc)); - - // OnSizeRequested override - - met = new CodeMemberMethod (); - type.Members.Add (met); - met.Name = "OnSizeRequested"; - met.ReturnType = new CodeTypeReference (typeof(void)); - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(object), "sender")); - met.Parameters.Add (new CodeParameterDeclarationExpression ("Gtk.SizeRequestedArgs", "args")); - - CodeConditionStatement cond = new CodeConditionStatement (); - cond.Condition = new CodeBinaryOperatorExpression ( - child, - CodeBinaryOperatorType.IdentityInequality, - new CodePrimitiveExpression (null) - ); - cond.TrueStatements.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression ( - new CodeArgumentReferenceExpression ("args"), - "Requisition" - ), - new CodeMethodInvokeExpression ( - child, - "SizeRequest" - ) - ) - ); - met.Statements.Add (cond); - - // OnSizeAllocated method - - met = new CodeMemberMethod (); - type.Members.Add (met); - met.Name = "OnSizeAllocated"; - met.ReturnType = new CodeTypeReference (typeof(void)); - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(object), "sender")); - met.Parameters.Add (new CodeParameterDeclarationExpression ("Gtk.SizeAllocatedArgs", "args")); - - cond = new CodeConditionStatement (); - cond.Condition = new CodeBinaryOperatorExpression ( - child, - CodeBinaryOperatorType.IdentityInequality, - new CodePrimitiveExpression (null) - ); - cond.TrueStatements.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression ( - child, - "Allocation" - ), - new CodePropertyReferenceExpression ( - new CodeArgumentReferenceExpression ("args"), - "Allocation" - ) - ) - ); - met.Statements.Add (cond); - - // OnAdded method - - met = new CodeMemberMethod (); - type.Members.Add (met); - met.Name = "OnAdded"; - met.ReturnType = new CodeTypeReference (typeof(void)); - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(object), "sender")); - met.Parameters.Add (new CodeParameterDeclarationExpression ("Gtk.AddedArgs", "args")); - - met.Statements.Add ( - new CodeAssignStatement ( - child, - new CodePropertyReferenceExpression ( - new CodeArgumentReferenceExpression ("args"), - "Widget" - ) - ) - ); - - // SetUiManager method - - met = new CodeMemberMethod (); - type.Members.Add (met); - met.Name = "SetUiManager"; - met.Attributes = MemberAttributes.Public | MemberAttributes.Final; - met.ReturnType = new CodeTypeReference (typeof(void)); - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(Gtk.UIManager), "uim")); - - met.Statements.Add ( - new CodeAssignStatement ( - uimanager, - new CodeArgumentReferenceExpression ("uim") - ) - ); - met.Statements.Add ( - new CodeAttachEventStatement ( - child, - "Realized", - new CodeDelegateCreateExpression ( - new CodeTypeReference ("System.EventHandler"), new CodeThisReferenceExpression(), "OnRealized" - ) - ) - ); - - // OnRealized method - - met = new CodeMemberMethod (); - type.Members.Add (met); - met.Name = "OnRealized"; - met.ReturnType = new CodeTypeReference (typeof(void)); - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(object), "sender")); - met.Parameters.Add (new CodeParameterDeclarationExpression ("System.EventArgs", "args")); - - cond = new CodeConditionStatement (); - cond.Condition = new CodeBinaryOperatorExpression ( - uimanager, - CodeBinaryOperatorType.IdentityInequality, - new CodePrimitiveExpression (null) - ); - - cond.TrueStatements.Add ( - new CodeVariableDeclarationStatement ( - typeof(Gtk.Widget), - "w" - ) - ); - - CodeExpression wexp = new CodeVariableReferenceExpression ("w"); - - cond.TrueStatements.Add ( - new CodeAssignStatement ( - wexp, - new CodePropertyReferenceExpression ( - child, - "Toplevel" - ) - ) - ); - - CodeConditionStatement cond2 = new CodeConditionStatement (); - cond2.Condition = new CodeBinaryOperatorExpression ( - new CodeBinaryOperatorExpression ( - wexp, - CodeBinaryOperatorType.IdentityInequality, - new CodePrimitiveExpression (null) - ), - CodeBinaryOperatorType.BooleanAnd, - new CodeMethodInvokeExpression ( - new CodeTypeOfExpression ("Gtk.Window"), - "IsInstanceOfType", - wexp - ) - ); - - cond2.TrueStatements.Add ( - new CodeMethodInvokeExpression ( - new CodeCastExpression ("Gtk.Window", wexp), - "AddAccelGroup", - new CodePropertyReferenceExpression ( - uimanager, - "AccelGroup" - ) - ) - ); - cond2.TrueStatements.Add ( - new CodeAssignStatement ( - uimanager, - new CodePrimitiveExpression (null) - ) - ); - cond.TrueStatements.Add (cond2); - - met.Statements.Add (cond); - } - } - -/* - This is a model of what GenerateHelperClass generates: - - class BinContainer - { - Gtk.Widget child; - UIManager uimanager; - - public static BinContainer Attach (Gtk.Bin bin) - { - BinContainer bc = new BinContainer (); - bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested); - bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated); - bin.Added += new Gtk.AddedHandler (bc.OnAdded); - return bin; - } - - void OnSizeRequested (object s, Gtk.SizeRequestedArgs args) - { - if (child != null) - args.Requisition = child.SizeRequest (); - } - - void OnSizeAllocated (object s, Gtk.SizeAllocatedArgs args) - { - if (child != null) - child.Allocation = args.Allocation; - } - - void OnAdded (object s, Gtk.AddedArgs args) - { - child = args.Widget; - } - - public void SetUiManager (UIManager manager) - { - uimanager = manager; - child.Realized += new System.EventHandler (OnRealized); - } - - void OnRealized () - { - if (uimanager != null) { - Gtk.Widget w = child.Toplevel; - if (w != null && w is Gtk.Window) { - ((Gtk.Window)w).AddAccelGroup (uimanager.AccelGroup); - uimanager = null; - } - } - } - } -*/ - -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Box.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Box.cs deleted file mode 100644 index 8e57f4b80f6..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Box.cs +++ /dev/null @@ -1,276 +0,0 @@ -using System; -using System.Collections; - -namespace Stetic.Wrapper { - - public class Box : Container { - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - if (!initialized && AllowPlaceholders) { - Placeholder ph = CreatePlaceholder (); - box.PackStart (ph); - NotifyChildAdded (ph); - ph = CreatePlaceholder (); - box.PackStart (ph); - NotifyChildAdded (ph); - box.Spacing = 6; - } - box.SizeAllocated += box_SizeAllocated; - ContainerOrientation = obj is Gtk.HBox ? Gtk.Orientation.Horizontal : Gtk.Orientation.Vertical; - DND.ClearFaults (this); - } - - public override void Dispose () - { - box.SizeAllocated -= box_SizeAllocated; - base.Dispose (); - } - - protected Gtk.Box box { - get { - return (Gtk.Box)Wrapped; - } - } - -/* - FIXME: why was this needed? - protected override bool AllowPlaceholders { - get { - return InternalChildProperty != null; - } - } -*/ - // DoSync() does two things: first, it makes sure that all of the - // PackStart widgets have Position numbers less than all of the - // PackEnd widgets. Second, it creates faults anywhere two widgets - // could be split apart. The fault IDs correspond to the Position - // a widget would have to be assigned to end up in that slot - // (negated for PackEnd slots). - // - // Position/PackType: 0S 1S 2S 4E 3E - // +----------------------+ - // | AA BB CC DD EE | - // +----------------------+ - // Fault Id: 0 1 2 3 -5 -4 -3 - - protected override void DoSync () - { - if (!box.IsRealized) - return; - - DND.ClearFaults (this); - - Gtk.Widget[] children = box.Children; - if (children.Length == 0) - return; - - Gtk.Widget[] sorted = new Gtk.Widget[children.Length]; - int last_start = -1; - bool hbox = ContainerOrientation == Gtk.Orientation.Horizontal; - - foreach (Gtk.Widget child in children) { - Gtk.Box.BoxChild bc = box[child] as Gtk.Box.BoxChild; - if (AutoSize[child]) { - bool exp = hbox ? ChildHExpandable (child) : ChildVExpandable (child); - if (bc.Expand != exp) - bc.Expand = exp; - if (bc.Fill != exp) - bc.Fill = exp; - } - - // Make sure all of the PackStart widgets are before - // any PackEnd widgets in the list. - if (bc.PackType == Gtk.PackType.Start) { - if (bc.Position != ++last_start) { - Array.Copy (sorted, last_start, sorted, last_start + 1, bc.Position - last_start); - box.ReorderChild (child, last_start); - } - } - - if (!(child is Placeholder)) - sorted[bc.Position] = child; - } - - // The orientation of the faults is the opposite of the - // orientation of the box - Gtk.Orientation orientation = hbox ? Gtk.Orientation.Vertical : Gtk.Orientation.Horizontal; - Gtk.SideType before = hbox ? Gtk.SideType.Left : Gtk.SideType.Top; - Gtk.SideType after = hbox ? Gtk.SideType.Right : Gtk.SideType.Bottom; - - if (!Unselectable) { - // If there are no PackStart widgets, we need a fault at the leading - // edge. Otherwise if there's a widget at the leading edge, we need a - // fault before it. - if (last_start == -1) - DND.AddFault (this, 0, before, null); - else if (sorted[0] != null) - DND.AddFault (this, 0, before, sorted[0]); - - // Add a fault between each pair of (non-placeholder) start widgets - for (int i = 1; i <= last_start; i++) { - if (sorted[i - 1] != null && sorted[i] != null) - DND.AddFault (this, i, orientation, sorted[i - 1], sorted[i]); - } - - // If there's a non-placeholder at the end of the PackStart - // range, add a fault after it - if (last_start > -1 && sorted[last_start] != null) - DND.AddFault (this, last_start + 1, after, sorted[last_start]); - - // Now the PackEnd widgets - if (last_start == sorted.Length - 1) - DND.AddFault (this, -(last_start + 1), after, null); - else if (sorted[last_start + 1] != null) - DND.AddFault (this, -(last_start + 1), after, sorted[last_start + 1]); - - for (int i = last_start + 2; i < sorted.Length; i++) { - if (sorted[i - 1] != null && sorted[i] != null) - DND.AddFault (this, -i, orientation, sorted[i - 1], sorted[i]); - } - - if (sorted.Length > last_start + 1 && sorted[sorted.Length - 1] != null) - DND.AddFault (this, -sorted.Length, before, sorted[sorted.Length - 1]); - } - } - - internal void InsertBefore (Gtk.Widget context) - { - int position; - Gtk.PackType type; - - if (context == box) { - position = 0; - type = Gtk.PackType.Start; - } else { - Gtk.Box.BoxChild bc = (Gtk.Box.BoxChild)ContextChildProps (context); - position = bc.Position; - type = bc.PackType; - } - - Placeholder ph = CreatePlaceholder (); - if (type == Gtk.PackType.Start) { - box.PackStart (ph); - box.ReorderChild (ph, position); - } else { - box.PackEnd (ph); - box.ReorderChild (ph, position + 1); - } - NotifyChildAdded (ph); - } - - internal void InsertAfter (Gtk.Widget context) - { - int position; - Gtk.PackType type; - - if (context == box) { - position = 0; - type = Gtk.PackType.End; - } else { - Gtk.Box.BoxChild bc = (Gtk.Box.BoxChild)ContextChildProps (context); - position = bc.Position; - type = bc.PackType; - } - - Placeholder ph = CreatePlaceholder (); - if (type == Gtk.PackType.Start) { - box.PackStart (ph); - box.ReorderChild (ph, position + 1); - } else { - box.PackEnd (ph); - box.ReorderChild (ph, position); - } - NotifyChildAdded (ph); - } - - protected override void ChildContentsChanged (Container child) { - Gtk.Widget widget = child.Wrapped; - - if (widget != null && AutoSize[widget]) { - Gtk.Box.BoxChild bc = box[widget] as Gtk.Box.BoxChild; - bool newExp = (ContainerOrientation == Gtk.Orientation.Horizontal) ? ChildHExpandable (widget) : ChildVExpandable (widget); - if (newExp != bc.Expand) - bc.Expand = newExp; - if (newExp != bc.Fill) - bc.Fill = newExp; - } - base.ChildContentsChanged (child); - } - - protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild) - { - base.ReplaceChild (oldChild, newChild); - - Container container = Stetic.Wrapper.Container.Lookup (newChild); - if (container != null) - ChildContentsChanged (container); - } - - void box_SizeAllocated (object obj, Gtk.SizeAllocatedArgs args) - { - Sync (); - } - - public override IEnumerable GladeChildren { - get { - // Return childs using the position order. - // This is needed to make sure children are - // added in the right order to the box while loading - // or building the box. - object[] obs = new object [box.Children.Length]; - foreach (Gtk.Widget child in box.Children) { - Gtk.Box.BoxChild bc = (Gtk.Box.BoxChild) box [child]; - obs [bc.Position] = child; - } - return obs; - } - } - - public override void Drop (Gtk.Widget w, object faultId) - { - AutoSize[w] = true; - int pos = (int)faultId; - - Freeze (); - if (pos >= 0) { - box.Add (w); - box.ReorderChild (w, pos); - } else { - box.Add (w); - box.ReorderChild (w, -pos); - } - EmitContentsChanged (); - Thaw (); - } - - public class BoxChild : Container.ContainerChild { - - public bool BoxExpand { - get { return ((Gtk.Box.BoxChild)Wrapped).Expand; } - set { - AutoSize = false; - ((Gtk.Box.BoxChild)Wrapped).Expand = value; - } - } - - public bool BoxFill { - get { return ((Gtk.Box.BoxChild)Wrapped).Fill; } - set { - AutoSize = false; - ((Gtk.Box.BoxChild)Wrapped).Fill = value; - } - } - - protected override void EmitNotify (string propertyName) - { - if (propertyName == "AutoSize") { - base.EmitNotify ("Expand"); - base.EmitNotify ("Fill"); - } - base.EmitNotify (propertyName); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Button.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Button.cs deleted file mode 100644 index 1bfbb0bd3a8..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Button.cs +++ /dev/null @@ -1,324 +0,0 @@ -using System; -using System.CodeDom; -using System.Collections; -using System.Xml; - -namespace Stetic.Wrapper { - - public class Button : Container { - - ImageInfo imageInfo; - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - - if (!initialized) - UseUnderline = true; - - if (button.UseStock) { - type = ButtonType.StockItem; - StockId = button.Label; - } else if (!initialized) { - type = ButtonType.TextOnly; - Label = button.Name; - } else if (button.Child is Gtk.Label) { - type = ButtonType.TextOnly; - label = button.Label; - useUnderline = button.UseUnderline; - } else { - type = ButtonType.Custom; - FixupGladeChildren (); - } - } - - public override void Read (ObjectReader reader, XmlElement elem) - { - base.Read (reader, elem); - if (reader.Format == FileFormat.Glade) - UseUnderline = true; - } - protected override ObjectWrapper ReadChild (ObjectReader reader, XmlElement child_elem) - { - ObjectWrapper ret = null; - if (Type == ButtonType.Custom || reader.Format == FileFormat.Glade) { - if (button.Child != null) - button.Remove (button.Child); - ret = base.ReadChild (reader, child_elem); - FixupGladeChildren (); - } else if (Type == ButtonType.TextAndIcon) { - UpdateImage (); - } - return ret; - } - - protected override XmlElement WriteChild (ObjectWriter writer, Widget wrapper) - { - if (writer.Format == FileFormat.Glade || Type == ButtonType.Custom) - return base.WriteChild (writer, wrapper); - else - return null; - } - - void FixupGladeChildren () - { - Gtk.Alignment alignment = button.Child as Gtk.Alignment; - if (alignment == null) - return; - Gtk.HBox box = alignment.Child as Gtk.HBox; - if (box == null) - return; - - Gtk.Widget[] children = box.Children; - if (children == null || children.Length != 2) - return; - - Gtk.Image image = children[0] as Gtk.Image; - Gtk.Label label = children[1] as Gtk.Label; - if (image == null || label == null) - return; - Stetic.Wrapper.Image iwrap = Stetic.ObjectWrapper.Lookup (image) as Stetic.Wrapper.Image; - if (iwrap == null) - return; - - this.label = label.LabelProp; - button.UseUnderline = label.UseUnderline; - - imageInfo = iwrap.Pixbuf; - Type = ButtonType.TextAndIcon; - } - - protected override XmlElement WriteProperties (ObjectWriter writer) - { - XmlElement elem = base.WriteProperties (writer); - if (Type == ButtonType.StockItem) - GladeUtils.SetProperty (elem, "label", stockId); - return elem; - } - - public override IEnumerable RealChildren { - get { - if (type == ButtonType.Custom) - return base.RealChildren; - else - return new Gtk.Widget[0]; - } - } - - public override IEnumerable GladeChildren { - get { - if (type == ButtonType.StockItem || type == ButtonType.TextOnly) - return new Gtk.Widget[0]; - else - return base.GladeChildren; - } - } - - private Gtk.Button button { - get { - return (Gtk.Button)Wrapped; - } - } - - public enum ButtonType { - StockItem, - TextOnly, - TextAndIcon, - Custom - }; - - ButtonType type; - public ButtonType Type { - get { - return type; - } - set { - type = value; - EmitNotify ("Type"); - switch (type) { - case ButtonType.StockItem: - button.UseStock = true; - StockId = stockId; - break; - case ButtonType.TextOnly: - button.UseStock = false; - Label = label; - UseUnderline = useUnderline; - break; - case ButtonType.TextAndIcon: - button.UseStock = false; - Label = label; - UseUnderline = useUnderline; - break; - case ButtonType.Custom: - button.UseStock = false; - if (button.Child != null) - ReplaceChild (button.Child, CreatePlaceholder (), true); - break; - } - if (!Loading) { - UpdateImage (); - } - } - } - - public ImageInfo Icon { - get { return imageInfo; } - set { - imageInfo = value; - if (!Loading) { - UpdateImage (); - EmitNotify ("Image"); - } - } - } - - protected override void OnEndRead (FileFormat format) - { - base.OnEndRead (format); - if (format == FileFormat.Native && Type == ButtonType.TextAndIcon) { - Loading = true; - UpdateImage (); - Loading = false; - } - } - - void UpdateImage () - { - if (type != ButtonType.TextAndIcon) { - button.Image = null; - return; - } - var imageWidget = button.Image as Gtk.Image; - if (imageWidget == null) { - button.Image = imageWidget = (Gtk.Image)Registry.NewInstance ("Gtk.Image", proj); - // force them to display even if hidden by the theme - button.Image.Show (); - } - Image imageWrapper = (Image)Widget.Lookup (imageWidget); - imageWrapper.Unselectable = true; - imageWrapper.Pixbuf = imageInfo; - } - - string stockId = Gtk.Stock.Ok; - public string StockId { - get { - return stockId; - } - set { - if (responseId == ResponseIdForStockId (stockId)) - responseId = 0; - - if (value != null) { - string sid = value; - if (sid.StartsWith ("stock:")) - sid = sid.Substring (6); - button.Label = stockId = sid; - button.UseStock = true; - Gtk.StockItem item = Gtk.Stock.Lookup (sid); - if (item.StockId == sid) { - label = item.Label; - useUnderline = true; - } - } else { - stockId = value; - } - - EmitNotify ("StockId"); - - if (responseId == 0) - ResponseId = ResponseIdForStockId (stockId); - } - } - - string label; - public string Label { - get { - return label; - } - set { - label = value; - button.Label = value; - } - } - - bool useUnderline; - public bool UseUnderline { - get { - return useUnderline; - } - set { - useUnderline = value; - button.UseUnderline = value; - } - } - - public bool IsDialogButton { - get { - ButtonBox box = this.ParentWrapper as ButtonBox; - return (box != null && box.InternalChildProperty != null && box.InternalChildProperty.Name == "ActionArea"); - } - } - - int responseId; - public int ResponseId { - get { - return responseId; - } - set { - responseId = value; - EmitNotify ("ResponseId"); - } - } - - int ResponseIdForStockId (string stockId) - { - if (stockId == Gtk.Stock.Ok) - return (int)Gtk.ResponseType.Ok; - else if (stockId == Gtk.Stock.Cancel) - return (int)Gtk.ResponseType.Cancel; - else if (stockId == Gtk.Stock.Close) - return (int)Gtk.ResponseType.Close; - else if (stockId == Gtk.Stock.Yes) - return (int)Gtk.ResponseType.Yes; - else if (stockId == Gtk.Stock.No) - return (int)Gtk.ResponseType.No; - else if (stockId == Gtk.Stock.Apply) - return (int)Gtk.ResponseType.Apply; - else if (stockId == Gtk.Stock.Help) - return (int)Gtk.ResponseType.Help; - else - return 0; - } - - internal protected override void GenerateBuildCode (GeneratorContext ctx, CodeExpression var) - { - base.GenerateBuildCode (ctx, var); - - string text = button.Label; - if (!string.IsNullOrEmpty (text)) { - CodePropertyReferenceExpression cprop = new CodePropertyReferenceExpression (var, "Label"); - PropertyDescriptor prop = (PropertyDescriptor)this.ClassDescriptor ["Label"]; - bool trans = Type != ButtonType.StockItem && prop.IsTranslated (Wrapped); - CodeExpression val = ctx.GenerateValue (text, typeof(string), trans); - ctx.Statements.Add (new CodeAssignStatement (cprop, val)); - } - - if (Type == ButtonType.TextAndIcon) { - var imageWidget = (Gtk.Image) button.Image; - if (imageWidget != null) { - Image imageWrapper = (Image)Widget.Lookup (imageWidget); - var imgVar = ctx.GenerateNewInstanceCode (imageWrapper); - var imgProp = new CodePropertyReferenceExpression (var, "Image"); - ctx.Statements.Add (new CodeAssignStatement (imgProp, imgVar)); - } - } - } - - protected override void GeneratePropertySet (GeneratorContext ctx, CodeExpression var, PropertyDescriptor prop) - { - if (prop.Name != "Label") - base.GeneratePropertySet (ctx, var, prop); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ButtonBox.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ButtonBox.cs deleted file mode 100644 index 37b8b60e7f6..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ButtonBox.cs +++ /dev/null @@ -1,161 +0,0 @@ -using System; -using System.Xml; -using System.Collections; -using System.CodeDom; - -namespace Stetic.Wrapper { - - public class ButtonBox : Box { - - Dialog actionDialog; - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - foreach (Gtk.Widget child in buttonbox.Children) { - if (child is Placeholder) - ReplaceChild (child, NewButton (), true); - } - } - - public void SetActionDialog (Dialog dialog) - { - actionDialog = dialog; - } - - Gtk.Button NewButton () - { - Gtk.Button button = (Gtk.Button)Registry.NewInstance ("Gtk.Button", proj); - button.CanDefault = true; - return button; - } - - protected Gtk.ButtonBox buttonbox { - get { - return (Gtk.ButtonBox)Wrapped; - } - } - - protected override bool AllowPlaceholders { - get { - return false; - } - } - internal new void InsertBefore (Gtk.Widget context) - { - int position; - bool secondary; - - if (context == buttonbox) { - position = 0; - secondary = false; - } else { - Gtk.ButtonBox.ButtonBoxChild bbc = (Gtk.ButtonBox.ButtonBoxChild)ContextChildProps (context); - position = bbc.Position; - secondary = bbc.Secondary; - } - - Gtk.Button button = NewButton (); - buttonbox.PackStart (button, false, false, 0); - buttonbox.ReorderChild (button, position); - buttonbox.SetChildSecondary (button, secondary); - EmitContentsChanged (); - } - - internal new void InsertAfter (Gtk.Widget context) - { - int position; - bool secondary; - - if (context == buttonbox) { - position = buttonbox.Children.Length - 1; - secondary = false; - } else { - Gtk.ButtonBox.ButtonBoxChild bbc = (Gtk.ButtonBox.ButtonBoxChild)ContextChildProps (context); - position = bbc.Position; - secondary = bbc.Secondary; - } - - Gtk.Button button = NewButton (); - buttonbox.PackStart (button, false, false, 0); - buttonbox.ReorderChild (button, position + 1); - buttonbox.SetChildSecondary (button, secondary); - EmitContentsChanged (); - } - - public int Size { - get { - return buttonbox.Children.Length; - } - set { - Gtk.Widget[] children = buttonbox.Children; - int cursize = children.Length; - - while (cursize > value) { - Gtk.Widget w = children[--cursize]; - buttonbox.Remove (w); - w.Destroy (); - } - while (cursize < value) { - buttonbox.PackStart (NewButton (), false, false, 0); - cursize++; - } - } - } - - protected override void ReadChildren (ObjectReader reader, XmlElement elem) - { - // Reset the button count - Size = 0; - base.ReadChildren (reader, elem); - } - - protected override void GenerateChildBuildCode (GeneratorContext ctx, CodeExpression parentVar, Widget wrapper) - { - if (actionDialog != null && wrapper is Button) { - - // If this is the action area of a dialog, buttons must be added using AddActionWidget, - // so they are properly registered. - - ObjectWrapper childwrapper = ChildWrapper (wrapper); - Button button = wrapper as Button; - - if (childwrapper != null) { - CodeExpression dialogVar = ctx.WidgetMap.GetWidgetExp (actionDialog); - ctx.Statements.Add (new CodeCommentStatement ("Container child " + Wrapped.Name + "." + childwrapper.Wrapped.GetType ())); - CodeExpression var = ctx.GenerateNewInstanceCode (wrapper); - if (button.ResponseId != (int) Gtk.ResponseType.None) { - CodeMethodInvokeExpression invoke = new CodeMethodInvokeExpression ( - dialogVar, - "AddActionWidget", - var, - new CodePrimitiveExpression (button.ResponseId) - ); - ctx.Statements.Add (invoke); - } - else { - CodeMethodInvokeExpression invoke = new CodeMethodInvokeExpression ( - parentVar, - "Add", - var - ); - ctx.Statements.Add (invoke); - } - GenerateSetPacking (ctx, parentVar, var, childwrapper); - } - } else - base.GenerateChildBuildCode (ctx, parentVar, wrapper); - } - - public class ButtonBoxChild : Box.BoxChild { - - public bool InDialog { - get { - if (ParentWrapper == null) - return false; - return ParentWrapper.InternalChildProperty != null && ParentWrapper.InternalChildProperty.Name == "ActionArea"; - } - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/CheckButton.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/CheckButton.cs deleted file mode 100644 index cd2fd6e88b2..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/CheckButton.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Xml; -using System.CodeDom; - -namespace Stetic.Wrapper { - - public class CheckButton : Container { - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - if (!initialized) - checkbutton.UseUnderline = true; - } - - public override void Read (ObjectReader reader, XmlElement elem) - { - base.Read (reader, elem); - if (reader.Format == FileFormat.Glade) - checkbutton.UseUnderline = true; - } - protected override ObjectWrapper ReadChild (ObjectReader reader, XmlElement child_elem) - { - hasLabel = false; - if (checkbutton.Child != null) - checkbutton.Remove (checkbutton.Child); - return base.ReadChild (reader, child_elem); - } - - public Gtk.CheckButton checkbutton { - get { - return (Gtk.CheckButton)Wrapped; - } - } - - bool hasLabel = true; - public bool HasLabel { - get { - return hasLabel; - } - set { - hasLabel = value; - EmitNotify ("HasLabel"); - } - } - - internal void RemoveLabel () - { - AddPlaceholder (); - HasLabel = false; - } - - public override Placeholder AddPlaceholder () - { - if (checkbutton.Child != null) - checkbutton.Remove (checkbutton.Child); - return base.AddPlaceholder (); - } - - internal void RestoreLabel () - { - checkbutton.Label = checkbutton.Name; - HasLabel = true; - } - - protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild) - { - base.ReplaceChild (oldChild, newChild); - EmitNotify ("HasContents"); - } - - protected override void GenerateChildBuildCode (GeneratorContext ctx, CodeExpression parentVar, Widget wrapper) - { - if (!HasLabel) { - // CheckButton generates a label by default. Remove it if it is not required. - ctx.Statements.Add ( - new CodeMethodInvokeExpression ( - parentVar, - "Remove", - new CodePropertyReferenceExpression ( - parentVar, - "Child" - ) - ) - ); - } - base.GenerateChildBuildCode (ctx, parentVar, wrapper); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ColorButton.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ColorButton.cs deleted file mode 100644 index 1cf71351aa6..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ColorButton.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.CodeDom; - -namespace Stetic.Wrapper { - - public class ColorButton : Container { - - public int Alpha { - get { - Gtk.ColorButton cb = (Gtk.ColorButton)Wrapped; - - if (cb.UseAlpha) - return cb.Alpha; - else - return -1; - } - set { - Gtk.ColorButton cb = (Gtk.ColorButton)Wrapped; - - if (value == -1) - cb.UseAlpha = false; - else { - cb.UseAlpha = true; - cb.Alpha = (ushort)value; - } - } - } - - protected override void GeneratePropertySet (GeneratorContext ctx, CodeExpression var, PropertyDescriptor prop) - { - if (prop.Name == "Alpha" && Alpha == -1) - return; - else - base.GeneratePropertySet (ctx, var, prop); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ComboBox.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ComboBox.cs deleted file mode 100644 index d878014ba86..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ComboBox.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using System.Xml; -using System.CodeDom; -using System.Runtime.InteropServices; - -namespace Stetic.Wrapper { - - public class ComboBox : Container { - - public static Gtk.ComboBox CreateInstance () - { - Gtk.ComboBox c = Gtk.ComboBox.NewText (); - // Make sure all children are created, so the mouse events can be - // bound and the widget can be selected. - c.EnsureStyle (); - try { - FixSensitivity (c); - } catch { - } - return c; - } - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - if (!initialized) - textCombo = true; - } - - - string[] items = new string[0]; - bool textCombo; - - public string[] Items { - get { return items; } - set { - Gtk.ComboBox combobox = (Gtk.ComboBox)Wrapped; - int active = combobox.Active; - - int row = 0, oi = 0, ni = 0; - while (value != null && oi < items.Length && ni < value.Length) { - if (items [oi] == value [ni]) { - oi++; - ni++; - row++; - } else if (ni < value.Length - 1 && - items [oi] == value [ni + 1]) { - combobox.InsertText (row++, value [ni++]); - if (active > row) - active++; - } else { - combobox.RemoveText (row); - if (active > row) - active--; - oi++; - } - } - - while (oi < items.Length) { - combobox.RemoveText (row); - oi++; - } - - while (value != null && ni < value.Length) - combobox.InsertText (row++, value [ni++]); - - items = value == null ? new string [0] : value; - combobox.Active = active; - - EmitNotify ("Items"); - } - } - - public bool IsTextCombo { - get { return textCombo; } - set { textCombo = value; EmitNotify ("IsTextCombo"); } - } - - internal protected override CodeExpression GenerateObjectCreation (GeneratorContext ctx) - { - if (textCombo) { - return new CodeMethodInvokeExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference ("Gtk.ComboBox", CodeTypeReferenceOptions.GlobalReference)), - "NewText" - ); - } else - return base.GenerateObjectCreation (ctx); - } - - internal protected override void GenerateBuildCode (GeneratorContext ctx, CodeExpression var) - { - if (textCombo && Items != null && Items.Length > 0) { - foreach (string str in Items) { - ctx.Statements.Add (new CodeMethodInvokeExpression ( - var, - "AppendText", - ctx.GenerateValue (str, typeof(string), true) - )); - } - } - - base.GenerateBuildCode (ctx, var); - } - - public override void Read (ObjectReader reader, XmlElement element) - { - base.Read (reader, element); - if (reader.Format == FileFormat.Glade && items.Length > 0) - IsTextCombo = true; - } - - internal static void FixSensitivity (Gtk.ComboBox c) - { - // Since gtk+ 2.14, empty combos are disabled by default - // This method disables this behavior - gtk_combo_box_set_button_sensitivity (c.Handle, 1); - } - - [DllImport ("libgtk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] - extern static void gtk_combo_box_set_button_sensitivity (IntPtr combo, int mode); - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ComboBoxEntry.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ComboBoxEntry.cs deleted file mode 100644 index 9461b7422f6..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ComboBoxEntry.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.CodeDom; - -namespace Stetic.Wrapper { - - public class ComboBoxEntry : ComboBox { - - public static new Gtk.ComboBoxEntry CreateInstance () - { - Gtk.ComboBoxEntry c = Gtk.ComboBoxEntry.NewText (); - // Make sure all children are created, so the mouse events can be - // bound and the widget can be selected. - c.EnsureStyle (); - try { - FixSensitivity (c); - } catch { - } - return c; - } - - internal protected override CodeExpression GenerateObjectCreation (GeneratorContext ctx) - { - if (IsTextCombo) { - return new CodeMethodInvokeExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference ("Gtk.ComboBoxEntry", CodeTypeReferenceOptions.GlobalReference)), - "NewText" - ); - } else - return base.GenerateObjectCreation (ctx); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Container.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Container.cs deleted file mode 100644 index a2c101ccd36..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Container.cs +++ /dev/null @@ -1,1454 +0,0 @@ -using System; -using System.CodeDom; -using System.Collections; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Xml; -using Stetic.Undo; -using Stetic.Editor; - -namespace Stetic.Wrapper -{ - public class Container : Widget - { - int designWidth; - int designHeight; - IDesignArea designer; - CodeExpression generatedTooltips; - bool internalAdd; - - static DiffGenerator containerDiffGenerator; - static bool showNonContainerWarning = true; - - static Container () - { - XmlDiffAdaptor adaptor = new XmlDiffAdaptor (); - adaptor.ChildElementName = "child"; - adaptor.ChildAdaptor = new XmlDiffAdaptor (); - adaptor.ChildAdaptor.PropsElementName = "packing"; - - containerDiffGenerator = new DiffGenerator (); - containerDiffGenerator.CurrentStatusAdaptor = adaptor; - containerDiffGenerator.NewStatusAdaptor = adaptor; - } - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - - ClassDescriptor klass = this.ClassDescriptor; - foreach (PropertyDescriptor prop in klass.InternalChildren) { - Gtk.Widget child = prop.GetValue (container) as Gtk.Widget; - if (child == null) - continue; - Widget wrapper = ObjectWrapper.Create (proj, child) as Stetic.Wrapper.Widget; - wrapper.InternalChildProperty = prop; - if (child.Name == ((GLib.GType)child.GetType ()).ToString ()) - child.Name = container.Name + "_" + prop.Name; - } - - container.Removed += ChildRemoved; - container.Added += OnChildAdded; - - if (!initialized && container.Children.Length == 0 && AllowPlaceholders) - AddPlaceholder (); - - if (Wrapped.GetType ().ToString ()[0] == 'H') - ContainerOrientation = Gtk.Orientation.Horizontal; - else - ContainerOrientation = Gtk.Orientation.Vertical; - - if (!Loading) - ValidateChildNames (Wrapped); - } - - public override void Dispose () - { - container.Removed -= ChildRemoved; - container.Added -= OnChildAdded; - AutoSize.Clear (); - base.Dispose (); - } - - void OnChildAdded (object o, Gtk.AddedArgs args) - { - if (!internalAdd) - HandleNewChild (args.Widget); - } - - protected void NotifyChildAdded (Gtk.Widget child) - { - HandleNewChild (child); - EmitContentsChanged (); - } - - void HandleNewChild (Gtk.Widget child) - { - // Make sure children's IDs don't conflict with other widgets - // in the parent container. - if (!Loading) - ValidateChildNames (child); - - Widget w = Widget.Lookup (child); - if (w != null) { - w.RequiresUndoStatusUpdate = true; - if (designer != null) - w.OnDesignerAttach (designer); - - // If the ShowScrollbars flag is set, make sure the scrolled window is created. - if (w.ShowScrollbars) - w.UpdateScrolledWindow (); - } - - Placeholder ph = child as Placeholder; - if (ph != null) { - ph.DragDrop += PlaceholderDragDrop; - ph.DragDataReceived += PlaceholderDragDataReceived; - ph.ButtonPressEvent += PlaceholderButtonPress; - AutoSize[ph] = true; - } - } - - Gtk.Container container { - get { - return (Gtk.Container)Wrapped; - } - } - - protected virtual bool AllowPlaceholders { - get { - return true && this.ClassDescriptor.AllowChildren; - } - } - - public int DesignWidth { - get { return designWidth; } - set { designWidth = value; NotifyChanged (); } - } - - public int DesignHeight { - get { return designHeight; } - set { designHeight = value; NotifyChanged (); } - } - - public void IncreaseBorderWidth () - { - container.BorderWidth += 3; - } - - public void DecreaseBorderWidth () - { - if (container.BorderWidth >= 3) - container.BorderWidth -= 3; - else - container.BorderWidth = 0; - } - - internal bool ChildrenAllowed () - { - return this.ClassDescriptor.AllowChildren; - } - - int freeze; - protected void Freeze () - { - freeze++; - } - - protected void Thaw () - { - if (--freeze == 0) - Sync (); - } - - protected virtual void DoSync () - { - ; - } - - protected void Sync () - { - if (freeze > 0 || Loading) - return; - freeze = 1; - DoSync (); - freeze = 0; - } - - public override object GetUndoDiff () - { - XmlElement oldElem = UndoManager.GetObjectStatus (this); - -// Console.WriteLine ("UNDO status: "); -// Console.WriteLine (oldElem.OuterXml); - - // Write the new status of the object. This is going to replace the old status in undoManager. - // In the process, register new objects found. - - UndoWriter writer = new UndoWriter (oldElem.OwnerDocument, UndoManager); - XmlElement newElem = Write (writer); - -// Console.WriteLine ("CURRENT status: "); -// Console.WriteLine (newElem.OuterXml); - - // Get the changes since the last undo checkpoint - - ObjectDiff actionsDiff = null; - ObjectDiff objectDiff = containerDiffGenerator.GetDiff (newElem, oldElem); - - // If there are child changes there is no need to look for changes in the - // actions, since the whole widget will be read again - - if (IsTopLevel && (objectDiff == null || objectDiff.ChildChanges == null)) - actionsDiff = LocalActionGroups.GetDiff (Project, oldElem); - - // The undo writer skips children which are already registered in the undo manager - // to avoid writing information we already have. Now it's the moment to fill the gaps - - foreach (XmlElement newChild in newElem.SelectNodes ("child[widget/@unchanged_marker='yes']")) { - string cid = newChild.GetAttribute ("undoId"); - XmlElement oldChild = (XmlElement) oldElem.SelectSingleNode ("child[@undoId='" + cid + "']"); - if (oldChild == null) - throw new InvalidOperationException ("Child not found when filling widget info gaps."); - - XmlElement oldWidgetChild = oldChild ["widget"]; - XmlElement newWidgetChild = newChild ["widget"]; - - oldChild.RemoveChild (oldWidgetChild); - if (newWidgetChild != null) - newChild.ReplaceChild (oldWidgetChild, newWidgetChild); - } - - // Update the status tree - - UndoManager.UpdateObjectStatus (this, newElem); - -// UndoManager.Dump (); - - if (objectDiff != null || actionsDiff != null) - return new ObjectDiff[] { objectDiff, actionsDiff }; - else - return null; - } - - public override object ApplyUndoRedoDiff (object data) - { - ObjectDiff diff = ((ObjectDiff[]) data)[0]; - ObjectDiff actionsDiff = ((ObjectDiff[]) data)[1]; - - ObjectDiff reverseDiff = null; - ObjectDiff reverseActionsDiff = null; - - XmlElement status = UndoManager.GetObjectStatus (this); - XmlElement oldStatus = (XmlElement) status.CloneNode (true); - UndoReader reader = new UndoReader (Project, FileFormat.Native, UndoManager); - - // Only apply the actions diff if the widget has not been completely reloaded - if (actionsDiff != null && !(diff != null && diff.ChildChanges != null)) { - // Apply the patch - LocalActionGroups.ApplyDiff (Project, actionsDiff); - - // Get the redo patch - reverseActionsDiff = LocalActionGroups.GetDiff (Project, oldStatus); - - // Update the status of the action group list in the undo status tree. - // It has to remove all action groups and then write them again - foreach (XmlElement group in status.SelectNodes ("action-group")) - status.RemoveChild (group); - - UndoWriter writer = new UndoWriter (status.OwnerDocument, UndoManager); - foreach (ActionGroup actionGroup in LocalActionGroups) - status.InsertBefore (actionGroup.Write (writer), status.FirstChild); - } - - if (diff != null) { - containerDiffGenerator.ApplyDiff (status, diff); - reverseDiff = containerDiffGenerator.GetDiff (status, oldStatus); - - // Avoid reading the whole widget tree if only the properties have changed. - if (diff.ChildChanges == null) { - ReadProperties (reader, status); - } else { -// Console.WriteLine ("BEFORE PATCH: " + status.OuterXml); - Read (reader, status); -// Console.WriteLine ("\nAFTER PATCH:"); -// UndoManager.Dump (); - EmitContentsChanged (); - } - } - - if (reverseDiff != null || reverseActionsDiff != null) - return new ObjectDiff[] { reverseDiff, reverseActionsDiff }; - else - return null; - } - - public override void Read (ObjectReader reader, XmlElement elem) - { - // Remove all existing children - if (ClassDescriptor.AllowChildren && Wrapped != null) { - foreach (Gtk.Widget child in GladeChildren) { - Widget wrapper = Widget.Lookup (child); - - if (wrapper != null) { - if (wrapper.InternalChildProperty != null) - continue; - container.Remove (child); - child.Destroy (); - } else if (child is Stetic.Placeholder) { - container.Remove (child); - child.Destroy (); - } - } - } - - try { - Loading = true; - ReadActionGroups (reader, elem); - ReadProperties (reader, elem); - ReadChildren (reader, elem); - DoSync (); - } finally { - Loading = false; - } - } - - protected virtual void ReadChildren (ObjectReader reader, XmlElement elem) - { - int gladeChildStackPos = reader.GladeChildStack.Count; - - foreach (XmlElement child_elem in elem.SelectNodes ("./child")) { - try { - if (child_elem.HasAttribute ("internal-child")) - ReadInternalChild (reader, child_elem); - else if (child_elem["widget"] == null) - ReadPlaceholder (reader, child_elem); - else { - ObjectWrapper cw = ReadChild (reader, child_elem); - - // Set a temporary id used for the undo/redo operations - ObjectWrapper ccw = ChildWrapper ((Widget)cw); - if (ccw != null) { - string cid = child_elem.GetAttribute ("undoId"); - if (cid.Length > 0) - ChildWrapper ((Widget)cw).UndoId = cid; - else - child_elem.SetAttribute ("undoId", ChildWrapper ((Widget)cw).UndoId); - } - } - } catch (GladeException ge) { - Console.Error.WriteLine (ge.Message); - } - } - - if (reader.Format == FileFormat.Glade) { - for (int n = reader.GladeChildStack.Count - 1; n >= gladeChildStackPos; n--) { - ObjectWrapper ob = ReadInternalChild (reader, (XmlElement) reader.GladeChildStack [n]); - if (ob != null) - reader.GladeChildStack.RemoveAt (n); - } - } - - string ds = elem.GetAttribute ("design-size"); - if (ds.Length > 0) { - int i = ds.IndexOf (' '); - DesignWidth = int.Parse (ds.Substring (0, i)); - DesignHeight = int.Parse (ds.Substring (i+1)); - } - - Sync (); - } - - protected virtual ObjectWrapper ReadChild (ObjectReader reader, XmlElement child_elem) - { - ObjectWrapper wrapper = reader.ReadObject (child_elem["widget"]); - Container.ContainerChild childwrapper = null; - - try { - wrapper.Loading = true; - - Gtk.Widget child = (Gtk.Widget)wrapper.Wrapped; - - AutoSize[child] = false; - container.Add (child); - - childwrapper = ChildWrapper ((Widget)wrapper); - if (childwrapper != null) - childwrapper.Loading = true; - - if (reader.Format == FileFormat.Glade) - GladeUtils.SetPacking (childwrapper, child_elem); - else - WidgetUtils.SetPacking (childwrapper, child_elem); - return wrapper; - } finally { - wrapper.Loading = false; - if (childwrapper != null) - childwrapper.Loading = false; - } - } - - void ReadPlaceholder (ObjectReader reader, XmlElement child_elem) - { - Placeholder ph = AddPlaceholder (); - if (ph != null) { - string cid = child_elem.GetAttribute ("undoId"); - if (cid.Length > 0) - ph.UndoId = cid; - else - child_elem.SetAttribute ("undoId", ph.UndoId); - } - } - - protected virtual ObjectWrapper ReadInternalChild (ObjectReader reader, XmlElement child_elem) - { - ClassDescriptor klass = base.ClassDescriptor; - string childId = child_elem.GetAttribute ("internal-child"); - - foreach (PropertyDescriptor prop in klass.InternalChildren) { - if (reader.Format == FileFormat.Glade && ((TypedPropertyDescriptor)prop).GladeName != childId) - continue; - else if (reader.Format == FileFormat.Native && prop.Name != childId) - continue; - - Gtk.Widget child = prop.GetValue (container) as Gtk.Widget; - Widget wrapper = Widget.Lookup (child); - if (wrapper != null) { - reader.ReadObject (wrapper, child_elem["widget"]); - if (reader.Format == FileFormat.Glade) - GladeUtils.SetPacking (ChildWrapper (wrapper), child_elem); - else - WidgetUtils.SetPacking (ChildWrapper (wrapper), child_elem); - return wrapper; - } - } - - // In Glade, internal children may not be direct children of the root container. This is handled in a special way. - if (reader.Format == FileFormat.Glade) { - if (!reader.GladeChildStack.Contains (child_elem)) - reader.GladeChildStack.Add (child_elem); - return null; - } - else - throw new GladeException ("Unrecognized internal child name", Wrapped.GetType ().FullName, false, "internal-child", childId); - } - - public override XmlElement Write (ObjectWriter writer) - { - XmlElement elem = WriteProperties (writer); - WriteActionGroups (writer, elem); - XmlElement child_elem; - - if (ClassDescriptor.AllowChildren) { - foreach (Gtk.Widget child in GladeChildren) { - Widget wrapper = Widget.Lookup (child); - - if (wrapper != null) { - // Iternal children are written later - if (wrapper.InternalChildProperty != null) - continue; - child_elem = WriteChild (writer, wrapper); - if (child_elem != null) - elem.AppendChild (child_elem); - } else if (child is Stetic.Placeholder) { - child_elem = writer.XmlDocument.CreateElement ("child"); - if (writer.CreateUndoInfo) - child_elem.SetAttribute ("undoId", ((Stetic.Placeholder)child).UndoId); - child_elem.AppendChild (writer.XmlDocument.CreateElement ("placeholder")); - elem.AppendChild (child_elem); - } - } - } - - foreach (PropertyDescriptor prop in this.ClassDescriptor.InternalChildren) { - Gtk.Widget child = prop.GetValue (Wrapped) as Gtk.Widget; - if (child == null) - continue; - - child_elem = writer.XmlDocument.CreateElement ("child"); - Widget wrapper = Widget.Lookup (child); - if (wrapper == null) { - child_elem.AppendChild (writer.XmlDocument.CreateElement ("placeholder")); - elem.AppendChild (child_elem); - continue; - } - - string cid = writer.Format == FileFormat.Glade ? prop.InternalChildId : prop.Name; - - XmlElement widget_elem = writer.WriteObject (wrapper); - child_elem.SetAttribute ("internal-child", cid); - // Sets the child Id to be used in undo/redo operations - if (writer.CreateUndoInfo) - child_elem.SetAttribute ("undoId", cid); - - child_elem.AppendChild (widget_elem); - elem.AppendChild (child_elem); - } - - if (DesignWidth != 0 || DesignHeight != 0) - elem.SetAttribute ("design-size", DesignWidth + " " + DesignHeight); - - return elem; - } - - protected virtual XmlElement WriteChild (ObjectWriter writer, Widget wrapper) - { - XmlElement child_elem = writer.XmlDocument.CreateElement ("child"); - XmlElement widget_elem = writer.WriteObject (wrapper); - child_elem.AppendChild (widget_elem); - - Container.ContainerChild childwrapper = ChildWrapper (wrapper); - if (childwrapper != null) { - XmlElement packing_elem; - - if (writer.Format == FileFormat.Glade) - packing_elem = GladeUtils.CreatePacking (writer.XmlDocument, childwrapper); - else - packing_elem = WidgetUtils.CreatePacking (writer.XmlDocument, childwrapper); - - // Sets the child Id to be used in undo/redo operations - if (writer.CreateUndoInfo) - child_elem.SetAttribute ("undoId", childwrapper.UndoId); - - if (packing_elem.HasChildNodes) - child_elem.AppendChild (packing_elem); - } else { - // There is no container child, so make up an id. - if (writer.CreateUndoInfo) - child_elem.SetAttribute ("undoId", "0"); - } - - return child_elem; - } - - public XmlElement WriteContainerChild (ObjectWriter writer, Widget wrapper) - { - return WriteChild (writer, wrapper); - } - - internal protected override void GenerateBuildCode (GeneratorContext ctx, CodeExpression var) - { - generatedTooltips = null; - - base.GenerateBuildCode (ctx, var); - - if (ClassDescriptor.AllowChildren) { - foreach (Gtk.Widget child in GladeChildren) { - Widget wrapper = Widget.Lookup (child); - - if (wrapper != null && wrapper.InternalChildProperty == null) - // Iternal children are written later - GenerateChildBuildCode (ctx, var, wrapper); - } - } - - foreach (TypedPropertyDescriptor prop in this.ClassDescriptor.InternalChildren) { - GenerateSetInternalChild (ctx, var, prop); - } - - - if (IsTopLevel && Wrapped is Gtk.Bin) { - CodeExpression childExp = new CodePropertyReferenceExpression (var, "Child"); - CodeConditionStatement cond = new CodeConditionStatement (); - cond.Condition = - new CodeBinaryOperatorExpression ( - childExp, - CodeBinaryOperatorType.IdentityInequality, - new CodePrimitiveExpression (null) - ); - cond.TrueStatements.Add ( - new CodeMethodInvokeExpression ( - childExp, - "ShowAll" - ) - ); - ctx.Statements.Add (cond); - } - } - - protected virtual void GenerateChildBuildCode (GeneratorContext ctx, CodeExpression parentVar, Widget wrapper) - { - ObjectWrapper childwrapper = ChildWrapper (wrapper); - if (childwrapper != null) { - ctx.Statements.Add (new CodeCommentStatement ("Container child " + Wrapped.Name + "." + childwrapper.Wrapped.GetType ())); - CodeExpression var = ctx.GenerateNewInstanceCode (wrapper); - CodeMethodInvokeExpression invoke = new CodeMethodInvokeExpression ( - parentVar, - "Add", - var - ); - ctx.Statements.Add (invoke); - - GenerateSetPacking (ctx, parentVar, var, childwrapper); - } - } - - void GenerateSetInternalChild (GeneratorContext ctx, CodeExpression parentVar, TypedPropertyDescriptor prop) - { - Gtk.Widget child = prop.GetValue (container) as Gtk.Widget; - Widget cwrapper = Widget.Lookup (child); - if (cwrapper != null) { - ctx.Statements.Add (new CodeCommentStatement ("Internal child " + Wrapped.Name + "." + prop.Name)); - string childVar = ctx.NewId (); - CodeVariableDeclarationStatement varDec = new CodeVariableDeclarationStatement (child.GetType().ToGlobalTypeRef (), childVar); - ctx.Statements.Add (varDec); - varDec.InitExpression = new CodePropertyReferenceExpression (parentVar, prop.Name); - - ctx.GenerateBuildCode (cwrapper, new CodeVariableReferenceExpression (childVar)); - return; - } - } - - protected void GenerateSetPacking (GeneratorContext ctx, CodeExpression parentVar, CodeExpression childVar, ObjectWrapper containerChildWrapper) - { - Gtk.Container.ContainerChild cc = containerChildWrapper.Wrapped as Gtk.Container.ContainerChild; - ClassDescriptor klass = containerChildWrapper.ClassDescriptor; - - // Generate a variable that holds the container child - - string contChildVar = ctx.NewId (); - CodeVariableDeclarationStatement varDec = new CodeVariableDeclarationStatement (cc.GetType().ToGlobalTypeRef (), contChildVar); - varDec.InitExpression = new CodeCastExpression ( - cc.GetType ().ToGlobalTypeRef (), - new CodeIndexerExpression (parentVar, childVar) - ); - - CodeVariableReferenceExpression var = new CodeVariableReferenceExpression (contChildVar); - - // Set the container child properties - - ctx.Statements.Add (varDec); - int count = ctx.Statements.Count; - - foreach (ItemGroup group in klass.ItemGroups) { - foreach (ItemDescriptor item in group) { - PropertyDescriptor prop = item as PropertyDescriptor; - if (prop == null || !prop.IsRuntimeProperty) - continue; - GenerateChildPropertySet (ctx, var, klass, prop, cc); - } - } - - if (ctx.Statements.Count == count) { - ctx.Statements.Remove (varDec); - } - } - - protected virtual void GenerateChildPropertySet (GeneratorContext ctx, CodeVariableReferenceExpression var, ClassDescriptor containerChildClass, PropertyDescriptor prop, object child) - { - if (containerChildClass.InitializationProperties != null && Array.IndexOf (containerChildClass.InitializationProperties, prop) != -1) - return; - - // Design time - if (prop.Name == "AutoSize") - return; - - object oval = prop.GetValue (child); - if (oval == null || (prop.HasDefault && prop.IsDefaultValue (oval))) - return; - - CodePropertyReferenceExpression cprop = new CodePropertyReferenceExpression (var, prop.Name); - CodeExpression val = ctx.GenerateValue (oval, prop.RuntimePropertyType, prop.Translatable); - ctx.Statements.Add (new CodeAssignStatement (cprop, val)); - } - - internal protected override void GeneratePostBuildCode (GeneratorContext ctx, CodeExpression var) - { - base.GeneratePostBuildCode (ctx, var); - - if (IsTopLevel && (Wrapped is Gtk.Bin) && Visible) { - ctx.Statements.Add ( - new CodeMethodInvokeExpression ( - var, - "Show" - ) - ); - } - } - - internal void GenerateTooltip (GeneratorContext ctx, Widget widget) - { - if (WidgetUtils.CompareVersions (Project.TargetGtkVersion, "2.12") <= 0) { - ctx.Statements.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression (ctx.WidgetMap.GetWidgetExp (widget), "TooltipMarkup"), - new CodePrimitiveExpression (widget.Tooltip) - ) - ); - return; - } - - if (generatedTooltips == null) { - string tid = ctx.NewId (); - Type t = typeof(Gtk.Widget).Assembly.GetType ("Gtk.Tooltips"); - CodeVariableDeclarationStatement vardec = new CodeVariableDeclarationStatement ( - t.ToGlobalTypeRef (), tid, new CodeObjectCreateExpression (t) - ); - ctx.Statements.Add (vardec); - generatedTooltips = new CodeVariableReferenceExpression (tid); - } - ctx.Statements.Add ( - new CodeMethodInvokeExpression ( - generatedTooltips, - "SetTip", - ctx.WidgetMap.GetWidgetExp (widget), - new CodePrimitiveExpression (widget.Tooltip), - new CodePrimitiveExpression (widget.Tooltip) - ) - ); - } - - internal protected override void OnDesignerAttach (IDesignArea designer) - { - base.OnDesignerAttach (designer); - this.designer = designer; - foreach (Gtk.Widget w in RealChildren) { - ObjectWrapper wr = ObjectWrapper.Lookup (w); - if (wr != null) - wr.OnDesignerAttach (designer); - } - } - - internal protected override void OnDesignerDetach (IDesignArea designer) - { - base.OnDesignerDetach (designer); - foreach (Gtk.Widget w in RealChildren) { - ObjectWrapper wr = ObjectWrapper.Lookup (w); - if (wr != null) - wr.OnDesignerDetach (designer); - } - this.designer = null; - } - - public virtual Placeholder AddPlaceholder () - { - Placeholder ph = CreatePlaceholder (); - container.Add (ph); - return ph; - } - - public virtual void Add (Gtk.Widget child) - { - container.Add (child); - } - - public static new Container Lookup (GLib.Object obj) - { - return Stetic.ObjectWrapper.Lookup (obj) as Stetic.Wrapper.Container; - } - - public static Container LookupParent (Gtk.Widget widget) - { - if (widget == null) - return null; - Gtk.Widget parent = widget.Parent; - Container wrapper = null; - while ((wrapper == null || wrapper.Unselectable) && parent != null) { - wrapper = Lookup (parent); - parent = parent.Parent; - } - return wrapper; - } - - public static Stetic.Wrapper.Container.ContainerChild ChildWrapper (Stetic.Wrapper.Widget wrapper) { - Stetic.Wrapper.Container parentWrapper = wrapper.ParentWrapper; - if (parentWrapper == null) - return null; - - Gtk.Container parent = parentWrapper.Wrapped as Gtk.Container; - if (parent == null) - return null; - - Gtk.Widget child = (Gtk.Widget)wrapper.Wrapped; - while (child != null && child.Parent != parent) - child = child.Parent; - if (child == null) - return null; - - Gtk.Container.ContainerChild cc = parent[child]; - Container.ContainerChild cwrap = ObjectWrapper.Lookup (cc) as Container.ContainerChild; - if (cwrap != null) - return cwrap; - else - return Stetic.ObjectWrapper.Create (parentWrapper.proj, cc) as ContainerChild; - } - - protected Gtk.Container.ContainerChild ContextChildProps (Gtk.Widget context) - { - if (context == container) - return null; - - do { - if (context.Parent == container) - return container[context]; - context = context.Parent; - } while (context != null); - - return null; - } - - public delegate void ContentsChangedHandler (Container container); - public event ContentsChangedHandler ContentsChanged; - - protected void EmitContentsChanged () - { - if (Loading) - return; - if (ContentsChanged != null) - ContentsChanged (this); - if (ParentWrapper != null) - ParentWrapper.ChildContentsChanged (this); - if (Project != null) - Project.NotifyWidgetContentsChanged (this); - NotifyChanged (); - } - - protected Set AutoSize = new Set (); - - protected virtual Placeholder CreatePlaceholder () - { - Placeholder ph = new Placeholder (); - ph.Show (); - return ph; - } - - void PlaceholderButtonPress (object obj, Gtk.ButtonPressEventArgs args) - { - if (args.Event.Type != Gdk.EventType.ButtonPress) - return; - - Placeholder ph = obj as Placeholder; - - if (GtkWorkarounds.TriggersContextMenu (args.Event)) { - proj.PopupContextMenu (ph); - args.RetVal = true; - } else if (args.Event.Button == 1) { - proj.Selection = ph; - args.RetVal = true; - } - } - - public static bool ShowNonContainerWarning { - get { return showNonContainerWarning; } - set { showNonContainerWarning = value; } - } - - static IList nonContainers = new string[] { - "Gtk.Button", "Gtk.Entry", "Gtk.Label", "Gtk.Arrow", "Gtk.Calendar", "Gtk.CheckButton", - "Gtk.ColorButton", "Gtk.ComboBox", "Gtk.ComboBoxEntry", "Gtk.Entry", "Gtk.FontButton", - "Gtk.HScale", "Gtk.VScale", "Gtk.Image", "Gtk.MenuBar", "Gtk.Toolbar", "Gtk.RadioButton", - "Gtk.ProgressBar", "Stetic.Editor.ActionToolbar", "Stetic.Editor.ActionMenuBar", - "Gtk.ToggleButton", "Gtk.TextView", "Gtk.VScrollbar", "Gtk.HScrollbar", "Gtk.SpinButton", - "Gtk.Statusbar", "Gtk.HSeparator", "Gtk.VSeparator" - }; - - void PlaceholderDrop (Placeholder ph, Stetic.Wrapper.Widget wrapper) - { - Gtk.Dialog parentDialog = Wrapped.Parent as Gtk.Dialog; - if (showNonContainerWarning && (IsTopLevel || (parentDialog != null && parentDialog.VBox == Wrapped))) { - if (nonContainers.Contains (wrapper.Wrapped.GetType ().ToString ())) { - using (NonContainerWarningDialog dlg = new NonContainerWarningDialog ()) { - int res = dlg.Run (); - showNonContainerWarning = dlg.ShowAgain; - if (res != (int) Gtk.ResponseType.Ok) - return; - } - } - } - using (UndoManager.AtomicChange) { - ReplaceChild (ph, wrapper.Wrapped, true); - wrapper.Select (); - } - } - - void PlaceholderDragDrop (object obj, Gtk.DragDropArgs args) - { - Placeholder ph = (Placeholder)obj; - // This Drop call will end calling DropObject() - DND.Drop (args.Context, args.Time, this, ph.UndoId); - args.RetVal = true; - } - - internal protected override void DropObject (string data, Gtk.Widget w) - { - Placeholder ph = FindPlaceholder (container, data); - if (ph != null) { - Widget dropped = Stetic.Wrapper.Widget.Lookup (w); - if (dropped != null) - PlaceholderDrop (ph, dropped); - } - } - - Placeholder FindPlaceholder (Gtk.Container c, string pid) - { - foreach (Gtk.Widget cw in c.AllChildren) { - Placeholder ph = cw as Placeholder; - if (ph != null && ph.UndoId == pid) - return ph; - Gtk.Container cc = cw as Gtk.Container; - if (cc != null) { - ph = FindPlaceholder (cc, pid); - if (ph != null) - return ph; - } - } - return null; - } - - void PlaceholderDragDataReceived (object obj, Gtk.DragDataReceivedArgs args) - { - Widget dropped = WidgetUtils.Paste (proj, args.SelectionData); - Gtk.Drag.Finish (args.Context, dropped != null, - dropped != null, args.Time); - if (dropped != null) { - dropped.RequiresUndoStatusUpdate = true; - PlaceholderDrop ((Placeholder)obj, dropped); - } - } - - protected virtual void ChildContentsChanged (Container child) - { - } - - void ChildRemoved (object obj, Gtk.RemovedArgs args) - { - NotifyChildRemoved (args.Widget); - } - - protected void NotifyChildRemoved (Gtk.Widget child) - { - if (Loading) - return; - - ObjectWrapper w = ObjectWrapper.Lookup (child); - if (w != null) { - if (w.Loading) - return; - if (designer != null) - w.OnDesignerDetach (designer); - } - ChildRemoved (child); - } - - protected virtual void ChildRemoved (Gtk.Widget w) - { - AutoSize[w] = false; - EmitContentsChanged (); - } - - public virtual IEnumerable RealChildren { - get { - ArrayList children = new ArrayList (); - foreach (Gtk.Widget widget in container.AllChildren) { - if (!(widget is Placeholder)) - children.Add (widget); - } - return children; - } - } - - public virtual IEnumerable GladeChildren { - get { - return container.AllChildren; - } - } - - public void PasteChild (Gtk.Widget oldChild, Gtk.Widget newChild) - { - using (UndoManager.AtomicChange) { - Widget w = Widget.Lookup (newChild); - w.RequiresUndoStatusUpdate = true; - ReplaceChild (oldChild, newChild, true); - } - } - - internal protected void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild, bool destroyOld) - { - ReplaceChild (oldChild, newChild); - if (destroyOld) - oldChild.Destroy (); - } - - protected virtual void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild) - { - using (UndoManager.AtomicChange) - { - Gtk.Container.ContainerChild cc; - Hashtable props = new Hashtable (); - - cc = container[oldChild]; - foreach (PropertyInfo pinfo in cc.GetType ().GetProperties ()) { - if (!pinfo.IsDefined (typeof (Gtk.ChildPropertyAttribute), true)) - continue; - props[pinfo] = pinfo.GetValue (cc, null); - } - - container.Remove (oldChild); - AutoSize[oldChild] = false; - AutoSize[newChild] = true; - - try { - // Don't fire the child added event until the packing info is set - internalAdd = true; - container.Add (newChild); - } finally { - internalAdd = false; - } - - cc = container[newChild]; - foreach (PropertyInfo pinfo in props.Keys) - pinfo.SetValue (cc, props[pinfo], null); - - Sync (); - NotifyChildAdded (newChild); - if (Project != null) - Project.Selection = newChild; - } - } - - Gtk.Widget selection; - - public virtual void Select (Gtk.Widget widget) - { - if (widget == null) { - Select (null, false); - } else { - Widget wrapper = Widget.Lookup (widget); - bool allowDrag = wrapper != null && wrapper.InternalChildProperty == null && !wrapper.IsTopLevel; - Select (widget, allowDrag); - } - } - - public virtual void UnSelect (Gtk.Widget widget) - { - if (selection == widget) - Select (null, false); - } - - void Select (Gtk.Widget widget, bool dragHandles) - { - if (widget == selection) - return; - - Gtk.Window win = GetParentWindow (); - - if (selection != null) { - selection.Destroyed -= SelectionDestroyed; - HideSelectionBox (selection); - Widget wr = Widget.Lookup (selection); - if (wr != null) - wr.OnUnselected (); - } - - selection = widget; - if (win != null) { - if (widget != null) { - if (widget.CanFocus) - win.Focus = widget; - else { - // Look for a focusable parent container - Widget wr = GetTopLevel (); - Gtk.Widget w = wr.Wrapped; - while (w != null && !w.CanFocus) - w = w.Parent; - - // If the widget is not focusable, - // remove the focus from the window. In this way we ensure - // that the current selected widget will lose the focus, - // even if the new selection is not focusable. - win.Focus = w; - } - } else { - if (designer != null) - designer.ResetSelection (null); - } - } - - if (selection != null) { - selection.Destroyed += SelectionDestroyed; - - // FIXME: if the selection isn't mapped, we should try to force it - // to be. (Eg, if you select a widget in a hidden window, the window - // should map. If you select a widget on a non-current notebook - // page, the notebook should switch pages, etc.) - if (selection.IsDrawable && selection.Visible) { - ShowSelectionBox (selection, dragHandles); - } - - Widget wr = Widget.Lookup (selection); - if (wr != null) - wr.OnSelected (); - } - } - - void ShowSelectionBox (Gtk.Widget widget, bool dragHandles) - { - HideSelectionBox (selection); - - IDesignArea designArea = GetDesignArea (widget); - if (designArea != null) { - IObjectSelection sel = designArea.SetSelection (widget, widget, dragHandles); - sel.Drag += HandleWindowDrag; - return; - } - } - - void HideSelectionBox (Gtk.Widget widget) - { - if (widget != null) { - IDesignArea designArea = GetDesignArea (widget); - if (designArea != null) - designArea.ResetSelection (widget); - } - } - - Gtk.Window GetParentWindow () - { - Gtk.Container cc = Wrapped as Gtk.Container; - while (cc.Parent != null) - cc = cc.Parent as Gtk.Container; - return cc as Gtk.Window; - } - - void SelectionDestroyed (object obj, EventArgs args) - { - if (!IsDisposed) - UnSelect (selection); - } - - Gtk.Widget dragSource; - - void HandleWindowDrag (Gdk.EventMotion evt, int dx, int dy) - { - Gtk.Widget dragWidget = selection; - - Project.Selection = null; - - using (UndoManager.AtomicChange) { - dragSource = CreateDragSource (dragWidget); - } - - DND.Drag (dragSource, evt, dragWidget); - } - - protected virtual Gtk.Widget CreateDragSource (Gtk.Widget dragWidget) - { - Placeholder ph = CreatePlaceholder (); - Gdk.Rectangle alloc = dragWidget.Allocation; - ph.SetSizeRequest (alloc.Width, alloc.Height); - ph.DragEnd += DragEnd; - ReplaceChild (dragWidget, ph, false); - return ph; - } - - void DragEnd (object obj, Gtk.DragEndArgs args) - { - using (UndoManager.AtomicChange) { - Placeholder ph = obj as Placeholder; - ph.DragEnd -= DragEnd; - - dragSource = null; - if (DND.DragWidget == null) { - if (AllowPlaceholders) - ph.SetSizeRequest (-1, -1); - else - container.Remove (ph); - Sync (); - } else - ReplaceChild (ph, DND.Cancel (), true); - } - } - - public virtual void Delete (Stetic.Wrapper.Widget wrapper) - { - using (UndoManager.AtomicChange) { - if (AllowPlaceholders) - ReplaceChild (wrapper.Wrapped, CreatePlaceholder (), true); - else { - container.Remove (wrapper.Wrapped); - wrapper.Wrapped.Destroy (); - } - } - } - - public virtual void Delete (Stetic.Placeholder ph) - { - if (AllowPlaceholders) { - // Don't allow deleting the only placeholder of a top level container - if (IsTopLevel && container.Children.Length == 1) - return; - using (UndoManager.AtomicChange) { - container.Remove (ph); - ph.Destroy (); - // If there aren't more placeholders in this container, just delete the container - if (container.Children.Length == 0) - Delete (); - } - } - } - - protected bool ChildHExpandable (Gtk.Widget child) - { - if (child == dragSource) - child = DND.DragWidget; - else if (child is Placeholder) - return true; - - Stetic.Wrapper.Widget wrapper = Stetic.Wrapper.Widget.Lookup (child); - if (wrapper != null) - return wrapper.HExpandable; - else - return false; - } - - protected bool ChildVExpandable (Gtk.Widget child) - { - if (child == dragSource) - child = DND.DragWidget; - else if (child is Placeholder) - return true; - - Stetic.Wrapper.Widget wrapper = Stetic.Wrapper.Widget.Lookup (child); - if (wrapper != null) - return wrapper.VExpandable; - else - return false; - } - - // Note that this will be invalid/random for non-H/V-paired classes - protected Gtk.Orientation ContainerOrientation; - - public override bool HExpandable { - get { - if (base.HExpandable) - return true; - - // A horizontally-oriented container is HExpandable if any - // child is. A vertically-oriented container is HExpandable - // if *every* child is. - - foreach (Gtk.Widget w in container) { - if (ChildHExpandable (w)) { - if (ContainerOrientation == Gtk.Orientation.Horizontal) - return true; - } else if (ContainerOrientation == Gtk.Orientation.Vertical) - return false; - } - return (ContainerOrientation == Gtk.Orientation.Vertical); - } - } - - public override bool VExpandable { - get { - if (base.VExpandable) - return true; - - // Opposite of above - - foreach (Gtk.Widget w in container) { - if (ChildVExpandable (w)) { - if (ContainerOrientation == Gtk.Orientation.Vertical) - return true; - } else if (ContainerOrientation == Gtk.Orientation.Horizontal) - return false; - } - return (ContainerOrientation == Gtk.Orientation.Horizontal); - } - } - - void ValidateChildNames (Gtk.Widget newWidget) - { - // newWidget is the widget which triggered the name check. - // It will be the last widget to check, so if there are - // name conflicts, the name to change to avoid the conflict - // will be the name of that widget. - - if (!IsTopLevel) { - ParentWrapper.ValidateChildNames (newWidget); - return; - } - - Hashtable names = new Hashtable (); - - // Validate all names excluding the new widget - ValidateChildName (names, container, newWidget); - - if (newWidget != null) { - // Now validate names in the new widget. - ValidateChildName (names, newWidget, null); - } - } - - void ValidateChildName (Hashtable names, Gtk.Widget w, Gtk.Widget newWidget) - { - if (w == newWidget) - return; - - if (names.Contains (w.Name)) { - // There is a widget with the same name. If the widget - // has a numeric suffix, just increase it. - string name; int idx; - WidgetUtils.ParseWidgetName (w.Name, out name, out idx); - - string compName = idx != 0 ? name + idx : name; - while (names.Contains (compName)) { - idx++; - compName = name + idx; - } - w.Name = compName; - Widget ww = Widget.Lookup (w); - if (ww != null) - ww.InitializeName (compName); - else - w.Name = compName; - - } - - names [w.Name] = w; - - if (w is Gtk.Container) { - foreach (Gtk.Widget cw in ((Gtk.Container)w).AllChildren) - ValidateChildName (names, cw, newWidget); - } - } - - internal string GetValidWidgetName (Gtk.Widget widget) - { - // Get a valid name for a widget (a name that doesn't - // exist in the parent container. - - if (!IsTopLevel) - return ParentWrapper.GetValidWidgetName (widget); - - string name; - int idx; - - WidgetUtils.ParseWidgetName (widget.Name, out name, out idx); - - string compName = idx != 0 ? name + idx : name; - - Gtk.Widget fw = FindWidget (compName, widget); - while (fw != null) { - idx++; - compName = name + idx; - fw = FindWidget (compName, widget); - } - - return compName; - } - - public Widget FindChild (string name) - { - Gtk.Widget w = FindWidget (name, null); - return Widget.Lookup (w); - } - - Gtk.Widget FindWidget (string name, Gtk.Widget skipwidget) - { - if (Wrapped != skipwidget && Wrapped.Name == name) - return Wrapped; - else - return FindWidget ((Gtk.Container)Wrapped, name, skipwidget); - } - - Gtk.Widget FindWidget (Gtk.Container parent, string name, Gtk.Widget skipwidget) - { - foreach (Gtk.Widget w in parent.AllChildren) { - if (w.Name == name && w != skipwidget) - return w; - if (w is Gtk.Container) { - Gtk.Widget res = FindWidget ((Gtk.Container)w, name, skipwidget); - if (res != null) - return res; - } - } - return null; - } - - public override ObjectWrapper FindObjectByUndoId (string id) - { - ObjectWrapper c = base.FindObjectByUndoId (id); - if (c != null) - return c; - - foreach (Gtk.Widget w in container.AllChildren) { - Widget ww = Widget.Lookup (w); - if (ww == null) - continue; - ObjectWrapper ow = ww.FindObjectByUndoId (id); - if (ow != null) - return ow; - } - return null; - } - - - - public class ContainerChild : Stetic.ObjectWrapper - { - internal static void Register () - { - // FIXME? - } - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - cc.Child.ChildNotified += ChildNotifyHandler; - cc.Child.ParentSet += OnParentSet; - } - - [GLib.ConnectBefore] - void OnParentSet (object ob, Gtk.ParentSetArgs args) - { - // Dispose the wrapper if the child is removed from the parent - Gtk.Widget w = (Gtk.Widget)ob; - if (w.Parent == null) { - Dispose (); - w.ParentSet -= OnParentSet; - } - } - - public override void Dispose () - { - cc.Child.ChildNotified -= ChildNotifyHandler; - base.Dispose (); - } - - protected virtual void ChildNotifyHandler (object obj, Gtk.ChildNotifiedArgs args) - { - ParamSpec pspec = new ParamSpec (args.Pspec); - EmitNotify (pspec.Name); - } - - protected override void EmitNotify (string propertyName) - { - base.EmitNotify (propertyName); - ParentWrapper.Sync (); - ParentWrapper.NotifyChanged (); - } - - Gtk.Container.ContainerChild cc { - get { - return (Gtk.Container.ContainerChild)Wrapped; - } - } - - protected Stetic.Wrapper.Container ParentWrapper { - get { - return Stetic.Wrapper.Container.Lookup (cc.Parent); - } - } - - public bool AutoSize { - get { - return ParentWrapper.AutoSize[cc.Child]; - } - set { - ParentWrapper.AutoSize[cc.Child] = value; - EmitNotify ("AutoSize"); - } - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Custom.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Custom.cs deleted file mode 100644 index 5f73164b8ea..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Custom.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System; -using Gtk; - -namespace Stetic -{ - public class Custom : Gtk.DrawingArea - { - public Custom () {} - - public Custom (IntPtr raw) : base (raw) {} - - // from glade - static private string[] custom_bg_xpm = { - "8 8 4 1", - " c None", - ". c #BBBBBB", - "+ c #D6D6D6", - "@ c #6B5EFF", - ".+..+...", - "+..@@@..", - "..@...++", - "..@...++", - "+.@..+..", - ".++@@@..", - "..++....", - "..++...." - }; - - Gdk.Pixmap pixmap; - - protected override void OnRealized () - { - base.OnRealized (); - - Gdk.Pixmap mask; - pixmap = Gdk.Pixmap.CreateFromXpmD (GdkWindow, out mask, new Gdk.Color (99, 99, 99), custom_bg_xpm); - } - - string creationFunction, string1, string2; - int int1, int2; - - public string CreationFunction { - get { - return creationFunction; - } - set { - creationFunction = value; - } - } - - public string LastModificationTime { - get { - return null; - } - set { - ; - } - } - - public string String1 { - get { - return string1; - } - set { - string1 = value; - } - } - - public string String2 { - get { - return string2; - } - set { - string2 = value; - } - } - - public int Int1 { - get { - return int1; - } - set { - int1 = value; - } - } - - public int Int2 { - get { - return int2; - } - set { - int2 = value; - } - } - - protected override bool OnExposeEvent (Gdk.EventExpose evt) - { - if (!IsDrawable) - return false; - - int width, height; - GdkWindow.GetSize (out width, out height); - - Gdk.GC light, dark; - light = Style.LightGC (StateType.Normal); - dark = Style.DarkGC (StateType.Normal); - - // Looks like GdkWindow.SetBackPixmap doesn't work very well, - // so draw the pixmap manually. - light.Fill = Gdk.Fill.Tiled; - light.Tile = pixmap; - GdkWindow.DrawRectangle (light, true, 0, 0, width, height); - light.Fill = Gdk.Fill.Solid; - - GdkWindow.DrawLine (light, 0, 0, width - 1, 0); - GdkWindow.DrawLine (light, 0, 0, 0, height - 1); - GdkWindow.DrawLine (dark, 0, height - 1, width - 1, height - 1); - GdkWindow.DrawLine (dark, width - 1, 0, width - 1, height - 1); - - return base.OnExposeEvent (evt); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Dialog.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Dialog.cs deleted file mode 100644 index 82312cfd4dc..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Dialog.cs +++ /dev/null @@ -1,183 +0,0 @@ -using System; -using System.Xml; -using System.Collections; - -namespace Stetic.Wrapper { - - public class Dialog : Window { - - Stetic.Wrapper.ButtonBox actionArea; - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - - actionArea = (ButtonBox)Container.Lookup (dialog.ActionArea); - actionArea.SetActionDialog (this); - - if (!initialized) { - dialog.HasSeparator = false; - if (!initialized && dialog.VBox.Children.Length == 1) { - Container vbox = Container.Lookup (dialog.VBox); - Placeholder ph = vbox.AddPlaceholder (); - ph.SetSizeRequest (200, 200); - Buttons = 1; - } - } else - ButtonsChanged (actionArea); - - actionArea.ContentsChanged += ButtonsChanged; - } - - internal static new TopLevelDialog CreateInstance ( ) - { - return new TopLevelDialog (); - } - - public override void Dispose ( ) - { - actionArea.ContentsChanged -= ButtonsChanged; - actionArea.SetActionDialog (null); - base.Dispose (); - } - - protected override void ReadChildren (ObjectReader reader, XmlElement elem) - { - // Ignore changes in the buttons while loading - actionArea.ContentsChanged -= ButtonsChanged; - base.ReadChildren (reader, elem); - actionArea.ContentsChanged += ButtonsChanged; - actionArea.SetActionDialog (this); - } - - TopLevelDialog dialog { - get { - return (TopLevelDialog) Wrapped; - } - } - - public Gtk.HButtonBox ActionArea { - get { return dialog.ActionArea; } - } - - public Gtk.VBox VBox - { - get { return dialog.VBox; } - } - - public bool HasSeparator { - get { return dialog.HasSeparator; } - set { dialog.HasSeparator = value; EmitNotify ("HasSeparator"); } - } - - public int Buttons - { - get { - return actionArea.Size - ExtraButtons; - } - set { - actionArea.Size = value + ExtraButtons; - EmitNotify ("Buttons"); - } - } - - int ExtraButtons { - get { - return helpButton == null ? 0 : 1; - } - } - - Gtk.Button helpButton; - - public bool HelpButton { - get { - return helpButton != null; - } - set { - if (HelpButton == value) - return; - - if (value) { - helpButton = AddButton (Gtk.Stock.Help, Gtk.ResponseType.Help, false); - // Make it the first child, so that decreasing - // Buttons won't delete it - dialog.ActionArea.ReorderChild (helpButton, 0); - } else { - helpButton.Destroy (); - helpButton = null; - } - - EmitNotify ("HelpButton"); - } - } - - // Check that a button is the Help button - bool ButtonIsHelp (Gtk.Button button) - { - return (button.UseStock && - button.Label == Gtk.Stock.Help && - dialog.ActionArea.GetChildSecondary (button)); - } - - Gtk.Button AddButton (string stockId, Gtk.ResponseType response, bool hasDefault) - { - Stetic.Wrapper.Button wrapper; - Gtk.Button button; - - button = (Gtk.Button)Registry.NewInstance ("Gtk.Button", proj); - wrapper = (Stetic.Wrapper.Button) ObjectWrapper.Lookup (button); - if (stockId != null) { - wrapper.Type = Button.ButtonType.StockItem; - wrapper.StockId = stockId; - } else { - wrapper.Type = Button.ButtonType.TextOnly; - wrapper.Label = button.Name; - } - wrapper.ResponseId = (int)response; - - Stetic.Wrapper.Container actionArea = Stetic.Wrapper.Container.Lookup (dialog.ActionArea); - actionArea.Add (button); - - button.CanDefault = true; - wrapper.HasDefault = hasDefault; - - if (stockId == Gtk.Stock.Help) - ((Gtk.ButtonBox)actionArea.Wrapped).SetChildSecondary (button, true); - - return button; - } - - void ButtonsChanged (Container container) - { - Gtk.Widget[] children = dialog.ActionArea.Children; - - // If the user manually removes (or breaks) the Help button, - // uncheck the corresponding property - if (helpButton != null) { - if (Array.IndexOf (children, helpButton) == -1 || - !ButtonIsHelp (helpButton)) { - helpButton = null; - EmitNotify ("HelpButton"); - } - } - - // If the user manually creates a Help button, set the property - if (helpButton == null) { - foreach (Gtk.Widget w in children) { - Gtk.Button button = w as Gtk.Button; - if (button != null && ButtonIsHelp (button)) { - helpButton = button; - dialog.ActionArea.ReorderChild (helpButton, 0); - EmitNotify ("HelpButton"); - break; - } - } - } - - // If the user removed all (non-Secondary) buttons, add back a - // single custom button - if (Buttons == 0) - Buttons = 1; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Entry.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Entry.cs deleted file mode 100644 index 64a9b068b21..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Entry.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.ComponentModel; - -namespace Stetic.Wrapper -{ - public class Entry: Widget - { - [DefaultValue ('*')] - public char InvisibleChar { - get { return ((Gtk.Entry)Wrapped).InvisibleChar; } - set { ((Gtk.Entry)Wrapped).InvisibleChar = value; } - } - } - -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Expander.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Expander.cs deleted file mode 100644 index fcf22505d78..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Expander.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections; -using System.Xml; -using System.CodeDom; - -namespace Stetic.Wrapper { - - public class Expander : Container { - - public static Gtk.Expander CreateInstance () - { - return new Gtk.Expander (""); - } - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - if (!initialized) { - expander.Label = expander.Name; - if (AllowPlaceholders) - AddPlaceholder (); - } - if (expander.LabelWidget != null) - ObjectWrapper.Create (proj, expander.LabelWidget); - } - - protected override ObjectWrapper ReadChild (ObjectReader reader, XmlElement child_elem) - { - if ((string)GladeUtils.GetChildProperty (child_elem, "type", "") == "label_item") { - ObjectWrapper wrapper = reader.ReadObject (child_elem["widget"]); - expander.LabelWidget = (Gtk.Widget)wrapper.Wrapped; - return wrapper; - } else - return base.ReadChild (reader, child_elem); - } - - protected override XmlElement WriteChild (ObjectWriter writer, Widget wrapper) - { - XmlElement child_elem = base.WriteChild (writer, wrapper); - if (wrapper.Wrapped == expander.LabelWidget) - GladeUtils.SetChildProperty (child_elem, "type", "label_item"); - return child_elem; - } - - Gtk.Expander expander { - get { - return (Gtk.Expander)Wrapped; - } - } - - protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild) - { - if (oldChild == expander.LabelWidget) - expander.LabelWidget = newChild; - else - base.ReplaceChild (oldChild, newChild); - } - - internal protected override CodeExpression GenerateObjectCreation (GeneratorContext ctx) - { - return new CodeObjectCreateExpression (ClassDescriptor.WrappedTypeName.ToGlobalTypeRef (), new CodePrimitiveExpression (null)); - } - - protected override void GenerateChildBuildCode (GeneratorContext ctx, CodeExpression parentVar, Widget wrapper) - { - if (wrapper.Wrapped == expander.LabelWidget) { - CodeExpression var = ctx.GenerateNewInstanceCode (wrapper); - CodeAssignStatement assign = new CodeAssignStatement ( - new CodePropertyReferenceExpression ( - parentVar, - "LabelWidget" - ), - var - ); - ctx.Statements.Add (assign); - } else - base.GenerateChildBuildCode (ctx, parentVar, wrapper); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Fixed.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Fixed.cs deleted file mode 100644 index 840c050dcce..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Fixed.cs +++ /dev/null @@ -1,91 +0,0 @@ - -using System; - -namespace Stetic.Wrapper -{ - public class Fixed: Container - { - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - - DND.DestSet (gtkfixed, true); - gtkfixed.DragDrop += FixedDragDrop; - gtkfixed.DragDataReceived += FixedDragDataReceived; - } - - public override void Dispose () - { - gtkfixed.DragDrop -= FixedDragDrop; - gtkfixed.DragDataReceived -= FixedDragDataReceived; - } - - Gtk.Fixed gtkfixed { - get { - return (Gtk.Fixed)Wrapped; - } - } - - protected override bool AllowPlaceholders { - get { - return false; - } - } - - void FixedDragDrop (object obj, Gtk.DragDropArgs args) - { - Gtk.Widget w = DND.Drop (args.Context, gtkfixed, args.Time); - Widget ww = Widget.Lookup (w); - if (ww != null) { - gtkfixed.Put (w, args.X - DND.DragHotX, args.Y - DND.DragHotY); - NotifyChildAdded (w); - args.RetVal = true; - ww.Select (); - } - } - - void FixedDragDataReceived (object obj, Gtk.DragDataReceivedArgs args) - { - Widget dropped = WidgetUtils.Paste (proj, args.SelectionData); - Gtk.Drag.Finish (args.Context, dropped != null, dropped != null, args.Time); - if (dropped != null) { - gtkfixed.Put (dropped.Wrapped, 0, 0); - NotifyChildAdded (dropped.Wrapped); - dropped.Select (); - } - } - - int dragX, dragY; - - protected override Gtk.Widget CreateDragSource (Gtk.Widget dragWidget) - { - Gtk.Fixed.FixedChild fc = (Gtk.Fixed.FixedChild) gtkfixed [dragWidget]; - if (fc == null) - return null; - - dragX = fc.X; - dragY = fc.Y; - - gtkfixed.Remove (dragWidget); - gtkfixed.DragEnd += DragEnd; - return gtkfixed; - } - - void DragEnd (object obj, Gtk.DragEndArgs args) - { - using (UndoManager.AtomicChange) { - gtkfixed.DragEnd -= DragEnd; - if (DND.DragWidget != null) { - DND.DragWidget.Unparent (); - gtkfixed.Put (DND.DragWidget, dragX, dragY); - NotifyChildAdded (DND.DragWidget); - Widget ww = Widget.Lookup (DND.DragWidget); - ww.Select (); - } - } - } - - public class FixedChild : Container.ContainerChild { - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/FontButton.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/FontButton.cs deleted file mode 100644 index c005e23e4e1..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/FontButton.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; - -namespace Stetic.Wrapper { - - public class FontButton : Widget { - - public bool UseFont { - get { - return ((Gtk.FontButton)Wrapped).UseFont; - } - set { - Gtk.FontButton fb = (Gtk.FontButton)Wrapped; - - fb.UseFont = value; - - // Force it to update - fb.ShowSize = !fb.ShowSize; - fb.ShowSize = !fb.ShowSize; - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/FontSelectionDialog.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/FontSelectionDialog.cs deleted file mode 100644 index f0b1cf000e1..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/FontSelectionDialog.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace Stetic.Wrapper { - - public class FontSelectionDialog : Dialog { - - public Gtk.FontSelection FontSelection { - get { - Gtk.Dialog dialog = (Gtk.Dialog)Wrapped; - - foreach (Gtk.Widget w in dialog.VBox) { - if (w is Gtk.FontSelection) - return (Gtk.FontSelection)w; - } - return null; - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Frame.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Frame.cs deleted file mode 100644 index a0bc0850f5c..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Frame.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Collections; -using System.Xml; -using System.CodeDom; - -namespace Stetic.Wrapper { - - public class Frame : Container { - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - if (!initialized) { - frame.Label = "" + frame.Name + ""; - ((Gtk.Label)frame.LabelWidget).UseMarkup = true; - frame.Shadow = Gtk.ShadowType.None; - if (AllowPlaceholders) { - Gtk.Alignment align = new Gtk.Alignment (0, 0, 1, 1); - align.LeftPadding = 12; - Container align_wrapper = (Container)ObjectWrapper.Create (proj, align); - align_wrapper.AddPlaceholder (); - ReplaceChild (frame.Child, (Gtk.Widget)align_wrapper.Wrapped, true); - } - } - - if (frame.LabelWidget != null) - ObjectWrapper.Create (proj, frame.LabelWidget); - NotifyWorkaround.AddNotification (frame, "label-widget", LabelWidgetChanged); - } - - void LabelWidgetChanged (object obj, GLib.NotifyArgs args) - { - if (!IsDisposed && frame.LabelWidget != null && !(frame.LabelWidget is Stetic.Placeholder)) - ObjectWrapper.Create (proj, frame.LabelWidget); - } - - Gtk.Frame frame { - get { - return (Gtk.Frame)Wrapped; - } - } - - protected override ObjectWrapper ReadChild (ObjectReader reader, XmlElement child_elem) - { - if ((string)GladeUtils.GetChildProperty (child_elem, "type", "") == "label_item") { - ObjectWrapper wrapper = reader.ReadObject (child_elem["widget"]); - frame.LabelWidget = (Gtk.Widget)wrapper.Wrapped; - return wrapper; - } else - return base.ReadChild (reader, child_elem); - } - - protected override XmlElement WriteChild (ObjectWriter writer, Widget wrapper) - { - XmlElement child_elem = base.WriteChild (writer, wrapper); - if (wrapper.Wrapped == frame.LabelWidget) - GladeUtils.SetChildProperty (child_elem, "type", "label_item"); - return child_elem; - } - - protected override void GenerateChildBuildCode (GeneratorContext ctx, CodeExpression parentVar, Widget wrapper) - { - if (wrapper.Wrapped == frame.LabelWidget) { - CodeExpression var = ctx.GenerateNewInstanceCode (wrapper); - CodeAssignStatement assign = new CodeAssignStatement ( - new CodePropertyReferenceExpression ( - parentVar, - "LabelWidget" - ), - var - ); - ctx.Statements.Add (assign); - } else - base.GenerateChildBuildCode (ctx, parentVar, wrapper); - } - - protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild) - { - if (oldChild == frame.LabelWidget) - frame.LabelWidget = newChild; - else - base.ReplaceChild (oldChild, newChild); - } - - public override void Delete (Stetic.Placeholder ph) - { - using (UndoManager.AtomicChange) { - Delete (); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/HScale.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/HScale.cs deleted file mode 100644 index 0af92c7a5fe..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/HScale.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.CodeDom; - -namespace Stetic.Wrapper { - - public class HScale : Scale { - - public static Gtk.HScale CreateInstance () - { - return new Gtk.HScale (0.0, 100.0, 1.0); - } - - internal protected override CodeExpression GenerateObjectCreation (GeneratorContext ctx) - { - return new CodeObjectCreateExpression (ClassDescriptor.WrappedTypeName.ToGlobalTypeRef (), new CodePrimitiveExpression (null)); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/HScrollbar.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/HScrollbar.cs deleted file mode 100644 index 696ccee6b88..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/HScrollbar.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.CodeDom; - -namespace Stetic.Wrapper { - - public class HScrollbar : Range { - - public static Gtk.HScrollbar CreateInstance () - { - return new Gtk.HScrollbar (new Gtk.Adjustment (0.0, 0.0, 100.0, 1.0, 10.0, 10.0)); - } - - internal protected override CodeExpression GenerateObjectCreation (GeneratorContext ctx) - { - return new CodeObjectCreateExpression (ClassDescriptor.WrappedTypeName.ToGlobalTypeRef (), new CodePrimitiveExpression (null)); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/IconView.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/IconView.cs deleted file mode 100644 index 592b005e540..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/IconView.cs +++ /dev/null @@ -1,39 +0,0 @@ -// IconView.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (c) 2007 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -// - -namespace Stetic.Wrapper -{ - public class IconView: Container - { - protected override bool AllowPlaceholders { - get { - return false; - } - } - } -} - diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Image.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Image.cs deleted file mode 100644 index 786de64f6e7..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Image.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Xml; -using System.Collections; - -namespace Stetic.Wrapper { - - public class Image : Misc { - - ImageInfo imageInfo; - - public static new Gtk.Image CreateInstance () - { - return new Gtk.Image (Gtk.Stock.Execute, Gtk.IconSize.Dialog); - } - - protected override void ReadProperties (ObjectReader reader, XmlElement elem) - { - if (reader.Format == FileFormat.Glade) { - string file = (string)GladeUtils.ExtractProperty (elem, "pixbuf", ""); - string stock = (string)GladeUtils.ExtractProperty (elem, "stock", ""); - string iconSize = (string)GladeUtils.ExtractProperty (elem, "icon_size", ""); - base.ReadProperties (reader, elem); - - if (stock != null && stock.Length > 0) { - Pixbuf = ImageInfo.FromTheme (stock, (Gtk.IconSize) int.Parse (iconSize)); - } else if (file != null && file != "") { - Pixbuf = ImageInfo.FromFile (file); - } - } else - base.ReadProperties (reader, elem); - } - - protected override XmlElement WriteProperties (ObjectWriter writer) - { - XmlElement elem = base.WriteProperties (writer); - if (imageInfo != null) { - if (writer.Format == FileFormat.Glade) { - // The generated pixbuf property doesn't have a valid value, it needs to be replaced. - GladeUtils.ExtractProperty (elem, "pixbuf", ""); - switch (imageInfo.Source) { - case ImageSource.File: - GladeUtils.SetProperty (elem, "pixbuf", imageInfo.Name); - break; - case ImageSource.Theme: - GladeUtils.SetProperty (elem, "stock", imageInfo.Name); - GladeUtils.SetProperty (elem, "icon_size", ((int)imageInfo.ThemeIconSize).ToString ()); - break; - default: - throw new System.NotSupportedException ("Image source not supported by Glade."); - } - } - } - return elem; - } - - Gtk.Image image { - get { - return (Gtk.Image)Wrapped; - } - } - - void BreakImage () - { - image.IconSize = (int)Gtk.IconSize.Button; - image.Stock = Gtk.Stock.MissingImage; - } - - public ImageInfo Pixbuf { - get { return imageInfo; } - set { - imageInfo = value; - if (imageInfo == null) - BreakImage (); - else - image.Pixbuf = imageInfo.GetImage (Project); - EmitNotify ("Pixbuf"); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ImageMenuItem.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ImageMenuItem.cs deleted file mode 100644 index 24cfd01465e..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ImageMenuItem.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.Xml; - -namespace Stetic.Wrapper { - - public class ImageMenuItem : MenuItem { - - public static new Gtk.ImageMenuItem CreateInstance () - { - // Use the ctor that will create an AccelLabel - return new Gtk.ImageMenuItem (""); - } - - protected override void ReadProperties (ObjectReader reader, XmlElement elem) - { - Gtk.StockItem stockItem = Gtk.StockItem.Zero; - bool use_stock = (bool)GladeUtils.ExtractProperty (elem, "use_stock", false); - if (use_stock) { - string label = (string)GladeUtils.GetProperty (elem, "label", ""); - stockItem = Gtk.Stock.Lookup (label); - if (stockItem.Label != null) - GladeUtils.ExtractProperty (elem, "label", ""); - } - base.ReadProperties (reader, elem); - - if (stockItem.StockId != null) - Image = "stock:" + stockItem.StockId; - if (stockItem.Keyval != 0) - Accelerator = Gtk.Accelerator.Name (stockItem.Keyval, stockItem.Modifier); - } - - string image; - - public string Image { - get { - return image; - } - set { - image = value; - - Gtk.Widget icon; - Gtk.StockItem stockItem = Gtk.StockItem.Zero; - - if (image.StartsWith ("stock:")) - stockItem = Gtk.Stock.Lookup (image.Substring (6)); - - if (stockItem.StockId != null) { - icon = new Gtk.Image (stockItem.StockId, Gtk.IconSize.Menu); - Label = stockItem.Label; - UseUnderline = true; - } else if (image.StartsWith ("file:")) - icon = new Gtk.Image (image.Substring (5)); - else - icon = new Gtk.Image (WidgetUtils.MissingIcon); - - ((Gtk.ImageMenuItem)Wrapped).Image = icon; - - EmitNotify ("Image"); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Label.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Label.cs deleted file mode 100644 index e12944c6f15..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Label.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.CodeDom; -using System.Collections; - -namespace Stetic.Wrapper { - - public class Label : Misc { - - public Label () {} - - string mnem; - public string MnemonicWidget { - get { - return mnem; - } - set { - mnem = value; - } - } - - protected override void GeneratePropertySet (GeneratorContext ctx, CodeExpression var, PropertyDescriptor prop) - { - if (prop.Name != "MnemonicWidget") - base.GeneratePropertySet (ctx, var, prop); - } - - internal protected override void GeneratePostBuildCode (GeneratorContext ctx, CodeExpression var) - { - if (mnem != null) { - Widget targetWidget = GetTopLevel ().FindChild (mnem); - if (targetWidget != null) { - CodeExpression memVar = ctx.WidgetMap.GetWidgetExp (targetWidget); - if (memVar != null) { - ctx.Statements.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression ( - var, - "MnemonicWidget" - ), - memVar - ) - ); - } - } - } - base.GeneratePostBuildCode (ctx, var); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/MenuBar.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/MenuBar.cs deleted file mode 100644 index fec2f295099..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/MenuBar.cs +++ /dev/null @@ -1,261 +0,0 @@ - -using System; -using System.CodeDom; -using System.Xml; -using System.Collections; -using Stetic.Editor; - -namespace Stetic.Wrapper -{ - public class MenuBar: Container - { - ActionTree actionTree; - XmlElement menuInfo; - bool treeChanged; - - public MenuBar() - { - } - - public override void Dispose () - { - DisposeTree (); - base.Dispose (); - } - - public static Gtk.MenuBar CreateInstance () - { - return new ActionMenuBar (); - } - - protected override bool AllowPlaceholders { - get { return false; } - } - - ActionMenuBar menu { - get { return (ActionMenuBar) Wrapped; } - } - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - CreateTree (); - } - - internal protected override void OnSelected () - { - Loading = true; - menu.ShowInsertPlaceholder = true; - Loading = false; - } - - internal protected override void OnUnselected () - { - base.OnUnselected (); - Loading = true; - menu.ShowInsertPlaceholder = false; - menu.Unselect (); - Loading = false; - } - - protected override XmlElement WriteProperties (ObjectWriter writer) - { - XmlElement elem = base.WriteProperties (writer); - if (menuInfo != null) - elem.AppendChild (writer.XmlDocument.ImportNode (menuInfo, true)); - else - elem.AppendChild (actionTree.Write (writer.XmlDocument, writer.Format)); - return elem; - } - - protected override void ReadProperties (ObjectReader reader, XmlElement elem) - { - base.ReadProperties (reader, elem); - menuInfo = elem ["node"]; - treeChanged = false; - } - - public override object GetUndoDiff () - { - XmlElement oldElem = treeChanged ? UndoManager.GetObjectStatus (this) ["node"] : null; - if (oldElem != null) - oldElem = (XmlElement) oldElem.CloneNode (true); - - treeChanged = false; - object baseDiff = base.GetUndoDiff (); - - if (oldElem != null) { - XmlElement newElem = UndoManager.GetObjectStatus (this) ["node"]; - if (newElem != null && oldElem.OuterXml == newElem.OuterXml) - oldElem = null; - } - - if (baseDiff == null && oldElem == null) - return null; - else { - object stat = menu.SaveStatus (); - return new object[] { baseDiff, oldElem, stat }; - } - } - - public override object ApplyUndoRedoDiff (object diff) - { - object[] data = (object[]) diff; - object retBaseDiff; - XmlElement oldNode = null; - - if (actionTree != null) { - XmlElement status = UndoManager.GetObjectStatus (this); - oldNode = status ["node"]; - if (oldNode != null) - oldNode = (XmlElement) oldNode.CloneNode (true); - } - object oldStat = menu.SaveStatus (); - - if (data [0] != null) - retBaseDiff = base.ApplyUndoRedoDiff (data [0]); - else - retBaseDiff = null; - - XmlElement xdiff = (XmlElement) data [1]; - - if (xdiff != null) { - XmlElement status = UndoManager.GetObjectStatus (this); - XmlElement prevNode = status ["node"]; - if (prevNode != null) - status.RemoveChild (prevNode); - status.AppendChild (xdiff); - - if (actionTree != null) { - Loading = true; - menu.OpenSubmenu = null; - DisposeTree (); - CreateTree (); - actionTree.Read (this, xdiff); - menu.FillMenu (actionTree); - Loading = false; - } else - menuInfo = xdiff; - } - - // Restore the status after all menu structure has been properly built - GLib.Timeout.Add (50, delegate { - menu.RestoreStatus (data[2]); - return false; - }); - - return new object [] { retBaseDiff, oldNode, oldStat }; - } - - protected override void OnNameChanged (WidgetNameChangedArgs args) - { - base.OnNameChanged (args); - if (actionTree != null) - actionTree.Name = Name; - } - - internal protected override CodeExpression GenerateObjectCreation (GeneratorContext ctx) - { - BuildTree (); - actionTree.Name = Name; - CodeExpression exp = GenerateUiManagerElement (ctx, actionTree); - if (exp != null) - return new CodeCastExpression (typeof(Gtk.MenuBar).ToGlobalTypeRef (), exp); - else - return base.GenerateObjectCreation (ctx); - } - - internal protected override void OnDesignerAttach (IDesignArea designer) - { - base.OnDesignerAttach (designer); - BuildTree (); - Loading = true; - menu.FillMenu (actionTree); - Loading = false; - - if (LocalActionGroups.Count == 0) - LocalActionGroups.Add (new ActionGroup ("Default")); - } - - void BuildTree () - { - if (menuInfo != null) { - DisposeTree (); - CreateTree (); - actionTree.Read (this, menuInfo); - menuInfo = null; - } - } - - void CreateTree () - { - actionTree = new ActionTree (); - actionTree.Name = Name; - actionTree.Type = Gtk.UIManagerItemType.Menubar; - actionTree.Changed += OnTreeChanged; - } - - void DisposeTree () - { - if (actionTree != null) { - actionTree.Dispose (); - actionTree.Changed -= OnTreeChanged; - actionTree = null; - } - } - - void OnTreeChanged (object s, EventArgs a) - { - treeChanged = true; - NotifyChanged (); - } - } - - class CustomMenuBarItem: Gtk.MenuItem - { - public ActionMenuItem ActionMenuItem; -// public ActionTreeNode Node; - } - - public class ActionPaletteItem: Gtk.HBox - { - ActionTreeNode node; - bool disposeNode; - - public ActionPaletteItem (Gtk.UIManagerItemType type, string name, Action action) - : this (new ActionTreeNode (type, name, action)) - { - disposeNode = true; - } - - public ActionPaletteItem (ActionTreeNode node) - { - this.node = node; - Spacing = 3; - if (node.Type == Gtk.UIManagerItemType.Menu) { - PackStart (new Gtk.Label ("Menu"), true, true, 0); - } else if (node.Action != null && node.Action.GtkAction != null) { - if (node.Action.GtkAction.StockId != null) - PackStart (node.Action.CreateIcon (Gtk.IconSize.Menu), true, true, 0); - PackStart (new Gtk.Label (node.Action.GtkAction.Label), true, true, 0); - } else if (node.Type == Gtk.UIManagerItemType.Separator) { - PackStart (new Gtk.Label ("Separator"), true, true, 0); - } else { - PackStart (new Gtk.Label ("Empty Action"), true, true, 0); - } - ShowAll (); - } - - public ActionTreeNode Node { - get { return node; } - } - - public override void Dispose () - { - if (disposeNode) - node.Dispose (); - base.Dispose (); - } - - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/MenuItem.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/MenuItem.cs deleted file mode 100644 index 7ebbc545c30..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/MenuItem.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System; -using System.Xml; - -namespace Stetic.Wrapper { - - public class MenuItem : Container { - - public static Gtk.MenuItem CreateInstance () - { - // Use the ctor that will create an AccelLabel - return new Gtk.MenuItem (""); - } - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - } - - protected override ObjectWrapper ReadChild (ObjectReader reader, XmlElement child_elem) - { - ObjectWrapper wrapper = reader.ReadObject (child_elem["widget"]); - menuitem.Submenu = (Gtk.Menu)wrapper.Wrapped; - return wrapper; - } - - Gtk.MenuItem menuitem { - get { - return (Gtk.MenuItem)Wrapped; - } - } - - Gtk.Label label { - get { - Gtk.AccelLabel label = menuitem.Child as Gtk.AccelLabel; - if (label != null) - return label; - - if (menuitem.Child != null) - menuitem.Child.Destroy (); - - label = new Gtk.AccelLabel (""); - label.MnemonicWidget = menuitem; - label.AccelWidget = menuitem; - label.Xalign = 0.0f; - label.Show (); - menuitem.Add (label); - - return label; - } - } - - public bool HasSubmenu { - get { - return menuitem.Submenu != null; - } - } - - string labelText; - - public string Label { - get { - return labelText; - } - set { - label.LabelProp = labelText = value; - EmitNotify ("Label"); - } - } - - public bool UseUnderline { - get { - return label.UseUnderline; - } - set { - label.UseUnderline = value; - EmitNotify ("UseUnderline"); - } - } - - Gtk.AccelGroup accelGroup; - string accelerator; - public string Accelerator { - get { - return accelerator; - } - set { - uint key; - Gdk.ModifierType mods; - - if (accelGroup != null && accelerator != null) { - Gtk.Accelerator.Parse (accelerator, out key, out mods); - menuitem.RemoveAccelerator (accelGroup, key, mods); - } - - accelerator = value; - - if (accelerator != null) { - if (accelGroup == null) - accelGroup = new Gtk.AccelGroup (); - - Gtk.Accelerator.Parse (accelerator, out key, out mods); - menuitem.AddAccelerator ("activate", accelGroup, key, mods, - Gtk.AccelFlags.Visible); - } - - EmitNotify ("Accelerator"); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/MessageDialog.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/MessageDialog.cs deleted file mode 100644 index 805b02932ce..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/MessageDialog.cs +++ /dev/null @@ -1,141 +0,0 @@ -using System; - -namespace Stetic { - - public class MessageDialog : Gtk.Dialog { - - public MessageDialog () - { - Resizable = false; - HasSeparator = false; - BorderWidth = 12; - - label = new Gtk.Label (); - label.LineWrap = true; - label.Selectable = true; - label.UseMarkup = true; - label.SetAlignment (0.0f, 0.0f); - - secondaryLabel = new Gtk.Label (); - secondaryLabel.LineWrap = true; - secondaryLabel.Selectable = true; - secondaryLabel.UseMarkup = true; - secondaryLabel.SetAlignment (0.0f, 0.0f); - - icon = new Gtk.Image (Gtk.Stock.DialogInfo, Gtk.IconSize.Dialog); - icon.SetAlignment (0.5f, 0.0f); - - Gtk.StockItem item = Gtk.Stock.Lookup (icon.Stock); - Title = item.Label; - - Gtk.HBox hbox = new Gtk.HBox (false, 12); - Gtk.VBox vbox = new Gtk.VBox (false, 12); - - vbox.PackStart (label, false, false, 0); - vbox.PackStart (secondaryLabel, true, true, 0); - - hbox.PackStart (icon, false, false, 0); - hbox.PackStart (vbox, true, true, 0); - - VBox.PackStart (hbox, false, false, 0); - hbox.ShowAll (); - - Buttons = Gtk.ButtonsType.OkCancel; - } - - Gtk.Label label, secondaryLabel; - Gtk.Image icon; - - public Gtk.MessageType MessageType { - get { - if (icon.Stock == Gtk.Stock.DialogInfo) - return Gtk.MessageType.Info; - else if (icon.Stock == Gtk.Stock.DialogQuestion) - return Gtk.MessageType.Question; - else if (icon.Stock == Gtk.Stock.DialogWarning) - return Gtk.MessageType.Warning; - else - return Gtk.MessageType.Error; - } - set { - Gtk.StockItem item = Gtk.Stock.Lookup (icon.Stock); - bool setTitle = (Title == "") || (Title == item.Label); - - if (value == Gtk.MessageType.Info) - icon.Stock = Gtk.Stock.DialogInfo; - else if (value == Gtk.MessageType.Question) - icon.Stock = Gtk.Stock.DialogQuestion; - else if (value == Gtk.MessageType.Warning) - icon.Stock = Gtk.Stock.DialogWarning; - else - icon.Stock = Gtk.Stock.DialogError; - - if (setTitle) { - item = Gtk.Stock.Lookup (icon.Stock); - Title = item.Label; - } - } - } - - public string primaryText; - public string PrimaryText { - get { - return primaryText; - } - set { - primaryText = value; - label.Markup = "" + value + ""; - } - } - - public string SecondaryText { - get { - return secondaryLabel.Text; - } - set { - secondaryLabel.Markup = value; - } - } - - Gtk.ButtonsType buttons; - public Gtk.ButtonsType Buttons { - get { - return buttons; - } - set { - Gtk.Widget[] oldButtons = ActionArea.Children; - foreach (Gtk.Widget w in oldButtons) - ActionArea.Remove (w); - - buttons = value; - switch (buttons) { - case Gtk.ButtonsType.None: - // nothing - break; - - case Gtk.ButtonsType.Ok: - AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok); - break; - - case Gtk.ButtonsType.Close: - AddButton (Gtk.Stock.Close, Gtk.ResponseType.Close); - break; - - case Gtk.ButtonsType.Cancel: - AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel); - break; - - case Gtk.ButtonsType.YesNo: - AddButton (Gtk.Stock.No, Gtk.ResponseType.No); - AddButton (Gtk.Stock.Yes, Gtk.ResponseType.Yes); - break; - - case Gtk.ButtonsType.OkCancel: - AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel); - AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok); - break; - } - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Misc.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Misc.cs deleted file mode 100644 index 757ab62afd9..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Misc.cs +++ /dev/null @@ -1,40 +0,0 @@ - -using System; - -namespace Stetic.Wrapper -{ - public class Misc: Widget - { - public bool AlignLeft { - get { - return ((Gtk.Misc)Wrapped).Xalign == 0; - } - set { - ((Gtk.Misc)Wrapped).Xalign = 0; - } - } - - public bool AlignRight { - get { - return ((Gtk.Misc)Wrapped).Xalign == 1; - } - set { - ((Gtk.Misc)Wrapped).Xalign = 1; - } - } - - public bool AlignCenter { - get { - return ((Gtk.Misc)Wrapped).Xalign == 0.5f; - } - set { - ((Gtk.Misc)Wrapped).Xalign = 0.5f; - } - } - - public static Gtk.Image CreateInstance () - { - return new Gtk.Image (Gtk.Stock.MissingImage, Gtk.IconSize.Menu); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Notebook.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Notebook.cs deleted file mode 100644 index 3627734022c..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Notebook.cs +++ /dev/null @@ -1,269 +0,0 @@ -using System; -using System.CodeDom; -using System.Collections; -using System.Xml; - -namespace Stetic.Wrapper { - - public class Notebook : Container { - - ArrayList tabs = new ArrayList (); - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - if (!initialized && AllowPlaceholders) { - if (notebook.Children.Length != 0) { - // Remove the dummy page Container.Wrap added - notebook.Remove (notebook.Children[0]); - } - InsertPage (0); - } - notebook.SwitchPage += OnPageChanged; - } - - public override void Dispose () - { - notebook.SwitchPage -= OnPageChanged; - base.Dispose (); - } - - protected override ObjectWrapper ReadChild (ObjectReader reader, XmlElement child_elem) - { - if ((string)GladeUtils.GetChildProperty (child_elem, "type", "") == "tab") { - ObjectWrapper wrapper = reader.ReadObject (child_elem["widget"]); - Gtk.Widget widget = (Gtk.Widget)wrapper.Wrapped; - notebook.SetTabLabel (notebook.GetNthPage (notebook.NPages - 1), widget); - tabs.Add (widget); - return wrapper; - } else - return base.ReadChild (reader, child_elem); - } - - protected override XmlElement WriteChild (ObjectWriter writer, Widget wrapper) - { - XmlElement child_elem = base.WriteChild (writer, wrapper); - if (tabs.Contains (wrapper.Wrapped)) - GladeUtils.SetChildProperty (child_elem, "type", "tab"); - return child_elem; - } - public override void Read (ObjectReader reader, XmlElement element) - { - object cp = GladeUtils.ExtractProperty (element, "CurrentPage", 0); - base.Read (reader, element); - notebook.CurrentPage = (int) cp; - } - - protected override void GenerateChildBuildCode (GeneratorContext ctx, CodeExpression parentExp, Widget wrapper) - { - Gtk.Widget child = (Gtk.Widget) wrapper.Wrapped; - - if (notebook.PageNum (child) == -1) { - // It's a tab - - ctx.Statements.Add (new CodeCommentStatement ("Notebook tab")); - Gtk.Widget page = null; - CodeExpression pageVar; - - // Look for the page widget contained in this tab - for (int n=0; n < notebook.NPages; n++) { - if (notebook.GetTabLabel (notebook.GetNthPage (n)) == child) { - page = notebook.GetNthPage (n); - break; - } - } - - // If the page contains a placeholder, generate a dummy page - if (page is Stetic.Placeholder) { - CodeVariableDeclarationStatement dvar = new CodeVariableDeclarationStatement ( - "Gtk.Label".ToGlobalTypeRef (), - ctx.NewId (), - new CodeObjectCreateExpression ("Gtk.Label".ToGlobalTypeRef ()) - ); - ctx.Statements.Add (dvar); - ctx.Statements.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression ( - new CodeVariableReferenceExpression (dvar.Name), - "Visible" - ), - new CodePrimitiveExpression (true) - ) - ); - ctx.Statements.Add ( - new CodeMethodInvokeExpression ( - parentExp, - "Add", - new CodeVariableReferenceExpression (dvar.Name) - ) - ); - pageVar = new CodeVariableReferenceExpression (dvar.Name); - } else - pageVar = ctx.WidgetMap.GetWidgetExp (page); - - // Generate code for the tab - CodeExpression var = ctx.GenerateNewInstanceCode (wrapper); - - // Assign the tab to the page - CodeMethodInvokeExpression invoke = new CodeMethodInvokeExpression ( - parentExp, - "SetTabLabel", - pageVar, - var - ); - ctx.Statements.Add (invoke); - - // Workaround for GTK bug. ShowAll is not propagated to tab labels. - invoke = new CodeMethodInvokeExpression ( - var, - "ShowAll" - ); - ctx.Statements.Add (invoke); - } else - base.GenerateChildBuildCode (ctx, parentExp, wrapper); - } - - - private Gtk.Notebook notebook { - get { - return (Gtk.Notebook)Wrapped; - } - } - - public override void Select (Gtk.Widget widget) - { - if (widget != null) { - int index = tabs.IndexOf (widget); - if (index != -1 && index != notebook.CurrentPage) - notebook.CurrentPage = index; - } - base.Select (widget); - } - - protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild) - { - int index = tabs.IndexOf (oldChild); - if (index != -1) { - tabs[index] = newChild; - Gtk.Widget page = notebook.GetNthPage (index); - notebook.SetTabLabel (page, newChild); - } else { - Gtk.Widget tab = notebook.GetTabLabel (oldChild); - int current = notebook.CurrentPage; - int oldPageNum = ((Gtk.Notebook.NotebookChild)notebook [oldChild]).Position; - base.ReplaceChild (oldChild, newChild); - // Get the widget again because it may have changed (for example, if it is a text view - // and has the ShowScrollbars option set. - newChild = notebook.GetNthPage (oldPageNum); - notebook.CurrentPage = current; - notebook.SetTabLabel (newChild, tab); - Widget ww = Widget.Lookup (tab); - if (ww != null) - ww.RequiresUndoStatusUpdate = true; - } - } - - int InsertPage (int position) - { - Gtk.Label label = (Gtk.Label)Registry.NewInstance ("Gtk.Label", proj); - label.LabelProp = "page" + (notebook.NPages + 1).ToString (); - tabs.Insert (position, label); - - Placeholder ph = CreatePlaceholder (); - int i = notebook.InsertPage (ph, label, position); - NotifyChildAdded (ph); - return i; - } - - internal void PreviousPage () - { - notebook.PrevPage (); - } - - internal bool CheckPreviousPage () - { - return notebook.CurrentPage > 0; - } - - internal void NextPage () - { - notebook.NextPage (); - } - - internal bool CheckNextPage () - { - return notebook.CurrentPage < notebook.NPages - 1; - } - - internal void DeletePage () - { - tabs.RemoveAt (notebook.CurrentPage); - notebook.RemovePage (notebook.CurrentPage); - } - - internal bool CheckDeletePage () - { - return notebook.NPages > 0; - } - - internal void SwapPrevious () - { - object ob = tabs [notebook.CurrentPage]; - tabs [notebook.CurrentPage] = tabs [notebook.CurrentPage - 1]; - tabs [notebook.CurrentPage - 1] = ob; - - Gtk.Widget cp = notebook.GetNthPage (notebook.CurrentPage); - notebook.ReorderChild (cp, notebook.CurrentPage - 1); - } - - internal void SwapNext () - { - object ob = tabs [notebook.CurrentPage]; - tabs [notebook.CurrentPage] = tabs [notebook.CurrentPage + 1]; - tabs [notebook.CurrentPage + 1] = ob; - - Gtk.Widget cp = notebook.GetNthPage (notebook.CurrentPage); - notebook.ReorderChild (cp, notebook.CurrentPage + 1); - } - - internal void InsertBefore () - { - notebook.CurrentPage = InsertPage (notebook.CurrentPage); - } - - internal bool CheckInsertBefore () - { - return notebook.NPages > 0; - } - - internal void InsertAfter () - { - notebook.CurrentPage = InsertPage (notebook.CurrentPage + 1); - } - - public override bool HExpandable { - get { - foreach (Gtk.Widget w in notebook) { - if (ChildHExpandable (w)) - return true; - } - return false; - } - } - - public override bool VExpandable { - get { - foreach (Gtk.Widget w in notebook) { - if (ChildVExpandable (w)) - return true; - } - return false; - } - } - - void OnPageChanged (object s, Gtk.SwitchPageArgs args) - { - EmitNotify ("CurrentPage"); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/NotifyWorkaround.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/NotifyWorkaround.cs deleted file mode 100644 index 05a5c078c39..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/NotifyWorkaround.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -// NotifyWorkaround.cs -// -// Author: -// Mike Krüger -// -// Copyright (c) 2011 Xamarin -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -using GLib; -using System; -using System.Runtime.InteropServices; - - -namespace Stetic.Wrapper -{ - /// - /// This class contains a notification work around for a gtk 3 bug where notifications could yield a - /// System.NullReferenceException: Object reference not set to an instance of an object at GLib.Object.NotifyCallback (IntPtr handle, IntPtr pspec, IntPtr gch) - /// - static class NotifyWorkaround - { - [UnmanagedFunctionPointer (CallingConvention.Cdecl)] - delegate void NotifyDelegate (IntPtr handle, IntPtr pspec, IntPtr gch); - - static NotifyDelegate delegateInstance = new NotifyDelegate (NotifyCallback); - - static void NotifyCallback (IntPtr handle, IntPtr pspec, IntPtr gch) - { - try { - var sig = ((GCHandle) gch).Target as GLib.Signal; - if (sig == null) - throw new Exception("Unknown signal GC handle received " + gch); - - var handler = sig.Handler as NotifyHandler; - if (handler != null) { - handler (GLib.Object.GetObject (handle), new NotifyArgs () { - Args = new object[] { pspec } - }); - } - } catch (Exception e) { - ExceptionManager.RaiseUnhandledException (e, false); - } - } - - static void ConnectNotification (GLib.Object w, string signal, NotifyHandler handler) - { - var sig = GLib.Signal.Lookup (w, signal, delegateInstance); - sig.AddDelegate (handler); - } - - public static void AddNotification (GLib.Object w, NotifyHandler handler) - { - ConnectNotification (w, "notify", handler); - } - - public static void AddNotification (GLib.Object w, string property, NotifyHandler handler) - { - ConnectNotification (w, "notify::" + property, handler); - } - - static void DisconnectNotification (GLib.Object w, string signal, NotifyHandler handler) - { - var sig = GLib.Signal.Lookup (w, signal, delegateInstance); - sig.RemoveDelegate (handler); - } - - public static void RemoveNotification (GLib.Object w, NotifyHandler handler) - { - DisconnectNotification (w, "notify", handler); - } - - } -} - diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Object.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Object.cs deleted file mode 100644 index 54972fed3d0..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Object.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections; - -namespace Stetic.Wrapper { - public abstract class Object : Stetic.ObjectWrapper { - - public override void Dispose () - { - if (Wrapped == null) - return; - NotifyWorkaround.RemoveNotification (( GLib.Object)Wrapped, NotifyHandler); - base.Dispose (); - } - - internal protected override void OnDesignerAttach (IDesignArea designer) - { - base.OnDesignerAttach (designer); - NotifyWorkaround.AddNotification ((GLib.Object)Wrapped, NotifyHandler); - } - - internal protected override void OnDesignerDetach (IDesignArea designer) - { - base.OnDesignerDetach (designer); - NotifyWorkaround.RemoveNotification ((GLib.Object)Wrapped, NotifyHandler); - } - - public static Object Lookup (GLib.Object obj) - { - return Stetic.ObjectWrapper.Lookup (obj) as Stetic.Wrapper.Object; - } - - void NotifyHandler (object obj, GLib.NotifyArgs args) - { - if (Loading) - return; - - // Translate gtk names into descriptor names. - foreach (ItemGroup group in ClassDescriptor.ItemGroups) { - foreach (ItemDescriptor item in group) { - TypedPropertyDescriptor prop = item as TypedPropertyDescriptor; - if (prop != null && prop.GladeName == args.Property) { - EmitNotify (prop.Name); - return; - } - } - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/OptionMenu.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/OptionMenu.cs deleted file mode 100644 index f376554ecea..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/OptionMenu.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Collections; -using System.Xml; - -// Don't warn that OptionMenu is deprecated. We know that. -#pragma warning disable 612 - -namespace Stetic.Wrapper { - - public class OptionMenu : Container { - - public override void Wrap (object obj, bool initialized) - { - Gtk.OptionMenu omenu = (Gtk.OptionMenu)obj; - if (omenu.Menu == null) { - Gtk.Menu menu = new Gtk.Menu (); - menu.Show (); - omenu.Menu = menu; - } - - base.Wrap (obj, initialized); - } - - protected override void ReadProperties (ObjectReader reader, XmlElement elem) - { - int history = (int)GladeUtils.ExtractProperty (elem, "history", -1); - base.ReadProperties (reader, elem); - - // Fiddle with things to make the optionmenu resize itself correctly - Gtk.Widget menu = optionmenu.Menu; - optionmenu.Menu = new Gtk.Menu (); - optionmenu.Menu = menu; - - if (history != -1) - Active = history; - else - Active = 0; - } - - // Some versions of glade call the menu an internal child, some don't - - protected override ObjectWrapper ReadInternalChild (ObjectReader reader, XmlElement child_elem) - { - if (child_elem.GetAttribute ("internal-child") == "menu") - return ReadChild (reader, child_elem); - else - return base.ReadInternalChild (reader, child_elem); - } - - protected override ObjectWrapper ReadChild (ObjectReader reader, XmlElement child_elem) - { - Widget wrapper = Stetic.Wrapper.Widget.Lookup (optionmenu.Menu); - reader.ReadObject (wrapper, child_elem["widget"]); - return wrapper; - } - - public override IEnumerable GladeChildren { - get { - return new Gtk.Widget[] { optionmenu.Menu }; - } - } - - Gtk.OptionMenu optionmenu { - get { - return (Gtk.OptionMenu)Wrapped; - } - } - - public int Active { - get { - return optionmenu.History; - } - set { - optionmenu.SetHistory ((uint)value); - EmitNotify ("Active"); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Paned.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Paned.cs deleted file mode 100644 index 477923a27c2..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Paned.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; - -namespace Stetic.Wrapper { - - public class Paned : Container { - - int position; - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - if (!initialized && AllowPlaceholders) { - Placeholder ph = CreatePlaceholder (); - paned.Pack1 (ph, true, false); - NotifyChildAdded (ph); - ph = CreatePlaceholder (); - paned.Pack2 (ph, true, false); - NotifyChildAdded (ph); - } - position = paned.Position; - paned.Realized += PanedRealized; - } - - void PanedRealized (object sender, EventArgs e) - { - // The position may be reset while realizing the object, so - // we set it now here. See bug #542227. This seems to be Windows only. - bool old = Loading; - Loading = true; - paned.Position = position; - Loading = old; - } - - public override void Dispose () - { - base.Dispose (); - paned.Realized -= PanedRealized; - } - - protected Gtk.Paned paned { - get { - return (Gtk.Paned)Wrapped; - } - } - - public int Position { - get { - return paned.Position; - } - set { - position = value; - paned.Position = value; - } - } - - protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild) - { - if (oldChild == paned.Child1) { - paned.Remove (oldChild); - paned.Add1 (newChild); - } else if (oldChild == paned.Child2) { - paned.Remove (oldChild); - paned.Add2 (newChild); - } - NotifyChildAdded (newChild); - } - - public override void Delete (Stetic.Placeholder ph) - { - // Don't allow deleting placeholders - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/RadioActionGroupManager.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/RadioActionGroupManager.cs deleted file mode 100644 index 0f67944ce4a..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/RadioActionGroupManager.cs +++ /dev/null @@ -1,144 +0,0 @@ - -using System; -using System.Collections; -using System.CodeDom; - -namespace Stetic.Wrapper -{ - public class RadioActionGroupManager: IRadioGroupManager - { - public event GroupsChangedDelegate GroupsChanged; - Hashtable actions = new Hashtable (); - ArrayList groups = new ArrayList (); - - public IEnumerable GroupNames { - get { - foreach (string grp in groups) - yield return grp; - } - } - - public void Rename (string oldName, string newName) - { - int i = groups.IndexOf (oldName); - if (i == -1) - return; - - groups [i] = newName; - - ArrayList list = new ArrayList (); - foreach (Action a in FindActionsInGroup (oldName)) - list.Add (a); - - foreach (Action a in list) - actions [a] = newName; - - EmitGroupsChanged (); - } - - public void Add (string name) - { - groups.Add (name); - EmitGroupsChanged (); - } - - public RadioGroup FindGroup (string name) - { - for (int i = 0; i < groups.Count; i++) { - RadioGroup group = groups[i] as RadioGroup; - if (group.Name == name) - return group; - } - return null; - } - - public string GetGroup (Action action) - { - return actions [action] as string; - } - - public void SetGroup (Action action, string group) - { - if (group == null) { - if (actions.Contains (action)) { - actions.Remove (action); - action.Disposed -= OnActionDisposed; - } - return; - } - - if (!actions.Contains (action)) - action.Disposed += OnActionDisposed; - actions [action] = group; - if (!groups.Contains (group)) - groups.Add (group); - } - - void OnActionDisposed (object s, EventArgs a) - { - Action ac = (Action) s; - if (ac != null) { - ac.Disposed -= OnActionDisposed; - actions.Remove (ac); - } - } - - public string LastGroup { - get { - if (groups.Count == 0) - Add ("group1"); - return groups [groups.Count - 1] as string; - } - } - - void EmitGroupsChanged () - { - if (GroupsChanged != null) - GroupsChanged (); - } - - IEnumerable FindActionsInGroup (string grp) - { - foreach (DictionaryEntry e in actions) - if (((string)e.Value) == grp) - yield return e.Key; - } - - public CodeExpression GenerateGroupExpression (GeneratorContext ctx, Action action) - { - // Returns and expression that represents the group to which the radio belongs. - // This expression can be an empty SList, if this is the first radio of the - // group that has been generated, or an SList taken from previously generated - // radios from the same group. - - string group = actions [action] as string; - if (group == null) - return new CodePrimitiveExpression (null); - - CodeExpression var = null; - - foreach (Action a in FindActionsInGroup (group)) { - if (a == action) - continue; - var = ctx.WidgetMap.GetWidgetExp (a); - if (var != null) - break; - } - - if (var == null) { - return new CodeObjectCreateExpression ( - "GLib.SList".ToGlobalTypeRef (), - new CodePropertyReferenceExpression ( - new CodeTypeReferenceExpression (typeof(IntPtr).ToGlobalTypeRef ()), - "Zero" - ) - ); - } else { - return new CodePropertyReferenceExpression ( - var, - "Group" - ); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/RadioButton.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/RadioButton.cs deleted file mode 100644 index a58d70f31ca..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/RadioButton.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections; -using System.Xml; -using System.CodeDom; - -namespace Stetic.Wrapper { - - public class RadioButton : CheckButton, IRadioGroupManagerProvider { - - static RadioGroupManager GroupManager = new RadioGroupManager (typeof (Gtk.RadioButton)); - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - - Gtk.RadioButton radiobutton = (Gtk.RadioButton)Wrapped; - if (!initialized) - Group = GroupManager.LastGroup; - else if (radiobutton.Group == null) - Group = radiobutton.Name; - } - - IRadioGroupManager IRadioGroupManagerProvider.GetGroupManager () - { - return GroupManager; - } - - protected override void ReadProperties (ObjectReader reader, XmlElement elem) - { - bool active = (bool)GladeUtils.ExtractProperty (elem, "active", false); - string group = (string)GladeUtils.ExtractProperty (elem, "group", ""); - base.ReadProperties (reader, elem); - - if (reader.Format == FileFormat.Glade) { - if (group != "") - Group = group; - else - Group = Wrapped.Name; - } - - if (active) - ((Gtk.RadioButton)Wrapped).Active = true; - } - - protected override XmlElement WriteProperties (ObjectWriter writer) - { - XmlElement elem = base.WriteProperties (writer); - if (writer.Format == FileFormat.Glade) { - string group = GroupManager.GladeGroupName (Wrapped); - if (group != Wrapped.Name) - GladeUtils.SetProperty (elem, "group", group); - } - return elem; - } - - protected override void GeneratePropertySet (GeneratorContext ctx, CodeExpression var, PropertyDescriptor prop) - { - if (prop.Name == "Group") { - CodeExpression groupExp = GroupManager.GenerateGroupExpression (ctx, (Gtk.Widget) Wrapped); - ctx.Statements.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression (var, "Group"), - groupExp) - ); - } - else - base.GeneratePropertySet (ctx, var, prop); - } - - public string Group { - get { - return GroupManager[Wrapped]; - } - set { - GroupManager[Wrapped] = value; - EmitNotify ("Group"); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/RadioMenuItem.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/RadioMenuItem.cs deleted file mode 100644 index d8a232584b3..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/RadioMenuItem.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using System.Collections; -using System.Xml; -using System.CodeDom; - -namespace Stetic.Wrapper { - - public class RadioMenuItem : MenuItem, IRadioGroupManagerProvider { - - static RadioGroupManager GroupManager = new RadioGroupManager (typeof (Gtk.RadioMenuItem)); - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - - Gtk.RadioMenuItem radio = (Gtk.RadioMenuItem)Wrapped; - if (!initialized) - Group = GroupManager.LastGroup; - else if (radio.Group == null) - Group = radio.Name; - } - - IRadioGroupManager IRadioGroupManagerProvider.GetGroupManager () - { - return GroupManager; - } - - protected override void ReadProperties (ObjectReader reader, XmlElement elem) - { - string group = (string)GladeUtils.ExtractProperty (elem, "group", ""); - bool active = (bool)GladeUtils.ExtractProperty (elem, "active", false); - base.ReadProperties (reader, elem); - - if (group != "") - Group = group; - else - Group = Wrapped.Name; - if (active) - ((Gtk.RadioMenuItem)Wrapped).Active = true; - } - - protected override XmlElement WriteProperties (ObjectWriter writer) - { - XmlElement elem = base.WriteProperties (writer); - string group = GroupManager.GladeGroupName (Wrapped); - if (group != Wrapped.Name) - GladeUtils.SetProperty (elem, "group", group); - return elem; - } - - protected override void GeneratePropertySet (GeneratorContext ctx, CodeExpression var, PropertyDescriptor prop) - { - if (prop.Name == "Group") { - CodeExpression groupExp = GroupManager.GenerateGroupExpression (ctx, (Gtk.Widget) Wrapped); - ctx.Statements.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression (var, "Group"), - groupExp) - ); - } - else - base.GeneratePropertySet (ctx, var, prop); - } - - public string Group { - get { - return GroupManager[Wrapped]; - } - set { - GroupManager[Wrapped] = value; - EmitNotify ("Group"); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/RadioToolButton.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/RadioToolButton.cs deleted file mode 100644 index 986d2476cce..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/RadioToolButton.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections; -using System.Xml; -using System.CodeDom; - -namespace Stetic.Wrapper { - - public class RadioToolButton : ToggleToolButton, IRadioGroupManagerProvider { - - public static new Gtk.ToolButton CreateInstance () - { - return new Gtk.RadioToolButton (new GLib.SList (IntPtr.Zero), Gtk.Stock.SortAscending); - } - - static RadioGroupManager GroupManager = new RadioGroupManager (typeof (Gtk.RadioToolButton)); - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - - Gtk.RadioToolButton radio = (Gtk.RadioToolButton)Wrapped; - if (!initialized) - Group = GroupManager.LastGroup; - else if (radio.Group == null) - Group = radio.Name; - } - - IRadioGroupManager IRadioGroupManagerProvider.GetGroupManager () - { - return GroupManager; - } - - protected override void ReadProperties (ObjectReader reader, XmlElement elem) - { - string group = (string)GladeUtils.ExtractProperty (elem, "group", ""); - bool active = (bool)GladeUtils.ExtractProperty (elem, "active", false); - base.ReadProperties (reader, elem); - - if (group != "") - Group = group; - else - Group = Wrapped.Name; - if (active) - ((Gtk.RadioToolButton)Wrapped).Active = true; - } - - protected override XmlElement WriteProperties (ObjectWriter writer) - { - XmlElement elem = base.WriteProperties (writer); - string group = GroupManager.GladeGroupName (Wrapped); - if (group != Wrapped.Name) - GladeUtils.SetProperty (elem, "group", group); - return elem; - } - - protected override void GeneratePropertySet (GeneratorContext ctx, CodeExpression var, PropertyDescriptor prop) - { - if (prop.Name == "Group") { - CodeExpression groupExp = GroupManager.GenerateGroupExpression (ctx, (Gtk.Widget) Wrapped); - ctx.Statements.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression (var, "Group"), - groupExp) - ); - } - else - base.GeneratePropertySet (ctx, var, prop); - } - - public string Group { - get { - return GroupManager[Wrapped]; - } - set { - GroupManager[Wrapped] = value; - EmitNotify ("Group"); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Range.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Range.cs deleted file mode 100644 index c93d606d3ba..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Range.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace Stetic.Wrapper { - - public abstract class Range : Widget { - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - NotifyWorkaround.AddNotification (((Gtk.Range)Wrapped).Adjustment, AdjustmentNotifyHandler); - } - - public override void Dispose () - { - NotifyWorkaround.RemoveNotification (((Gtk.Range)Wrapped).Adjustment, AdjustmentNotifyHandler); - base.Dispose (); - } - - void AdjustmentNotifyHandler (object obj, GLib.NotifyArgs args) - { - EmitNotify (args.Property); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Scale.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Scale.cs deleted file mode 100644 index fa37ae0dbb3..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Scale.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace Stetic.Wrapper { - - public abstract class Scale : Widget { - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - NotifyWorkaround.AddNotification (((Gtk.Scale)Wrapped).Adjustment, AdjustmentNotifyHandler); - } - - public override void Dispose () - { - NotifyWorkaround.RemoveNotification (((Gtk.Scale)Wrapped).Adjustment, AdjustmentNotifyHandler); - base.Dispose (); - } - - void AdjustmentNotifyHandler (object obj, GLib.NotifyArgs args) - { - EmitNotify (args.Property); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ScrolledWindow.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ScrolledWindow.cs deleted file mode 100644 index 5cc8bd3b943..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ScrolledWindow.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System; -using System.Collections; -using System.CodeDom; - -namespace Stetic.Wrapper { - - public class ScrolledWindow : Container { - - Gtk.PolicyType hpolicy = Gtk.PolicyType.Automatic; - Gtk.PolicyType vpolicy = Gtk.PolicyType.Automatic; - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - if (!initialized) { - if (scrolled.Child == null && AllowPlaceholders) - AddPlaceholder (); - HscrollbarPolicy = VscrollbarPolicy = Gtk.PolicyType.Automatic; - scrolled.ShadowType = Gtk.ShadowType.In; - } - scrolled.SetPolicy (Gtk.PolicyType.Always, Gtk.PolicyType.Always); - } - - public Gtk.ScrolledWindow scrolled { - get { - return (Gtk.ScrolledWindow)Wrapped; - } - } - - public Gtk.PolicyType HscrollbarPolicy { - get { return hpolicy; } - set { - hpolicy = value; - EmitNotify ("HscrollbarPolicy"); - } - } - - public Gtk.PolicyType VscrollbarPolicy { - get { return vpolicy; } - set { - vpolicy = value; - EmitNotify ("VscrollbarPolicy"); - } - } - - public override IEnumerable RealChildren { - get { - if (scrolled.Child is Gtk.Viewport) - return ((Gtk.Viewport)scrolled.Child).Children; - else - return base.RealChildren; - } - } - - internal void AddWithViewport (Gtk.Widget child) - { - Gtk.Viewport viewport = new Gtk.Viewport (scrolled.Hadjustment, scrolled.Vadjustment); - ObjectWrapper.Create (proj, viewport); - viewport.ShadowType = Gtk.ShadowType.None; - viewport.Add (child); - viewport.Show (); - scrolled.Add (viewport); - } - - protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild) - { - Widget ww = Widget.Lookup (oldChild); - if (ww != null && ww.ShowScrollbars && ParentWrapper != null) { - // The viewport is bound to the child widget. Remove it together with the child - ParentWrapper.ReplaceChild (Wrapped, newChild, false); - return; - } - - if (scrolled.Child is Gtk.Viewport && oldChild != scrolled.Child) { - Gtk.Viewport vp = (Gtk.Viewport)scrolled.Child; - vp.Remove (oldChild); - scrolled.Remove (vp); - vp.Destroy (); - } - else - scrolled.Remove (scrolled.Child); - - if (newChild.SetScrollAdjustments (null, null)) - scrolled.Add (newChild); - else - AddWithViewport (newChild); - - NotifyChildAdded (scrolled.Child); - } - - public override Placeholder AddPlaceholder () - { - Placeholder ph = CreatePlaceholder (); - AddWithViewport (ph); - return ph; - } - - protected override void GenerateChildBuildCode (GeneratorContext ctx, CodeExpression parentVar, Widget wrapper) - { - Gtk.Viewport vp = wrapper.Wrapped as Gtk.Viewport; - if (vp == null || (vp.Child != null && !(vp.Child is Placeholder))) - base.GenerateChildBuildCode (ctx, parentVar, wrapper); - } - - public override void Delete (Stetic.Placeholder ph) - { - using (UndoManager.AtomicChange) { - Delete (); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Signal.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Signal.cs deleted file mode 100644 index 3c1700e8058..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Signal.cs +++ /dev/null @@ -1,60 +0,0 @@ - -using System; - -namespace Stetic -{ - [Serializable] - public class Signal - { - SignalDescriptor descriptor; - string handlerName; - bool after; - - [NonSerialized] - internal ObjectWrapper Owner; - - public Signal (SignalDescriptor descriptor): this (descriptor, null, false) - { - } - - public Signal (SignalDescriptor descriptor, string handlerName, bool after) - { - this.descriptor = descriptor; - this.handlerName = handlerName; - this.after = after; - } - - void NotifyChanged (Signal oldData) - { - if (Owner != null) - Owner.OnSignalChanged (new SignalChangedEventArgs (Owner, oldData, this)); - } - - Signal Clone () - { - return new Signal (descriptor, handlerName, after); - } - - public SignalDescriptor SignalDescriptor { - get { return descriptor; } - } - - public string Handler { - get { return handlerName; } - set { - Signal data = Clone (); - handlerName = value; - NotifyChanged (data); - } - } - - public bool After { - get { return after; } - set { - Signal data = Clone (); - after = value; - NotifyChanged (data); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/SignalChangedEventHandler.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/SignalChangedEventHandler.cs deleted file mode 100644 index 1c2d1382608..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/SignalChangedEventHandler.cs +++ /dev/null @@ -1,19 +0,0 @@ - -namespace Stetic -{ - public delegate void SignalChangedEventHandler (object sender, SignalChangedEventArgs args); - - public class SignalChangedEventArgs: SignalEventArgs - { - Signal oldSignal; - - public SignalChangedEventArgs (ObjectWrapper wrapper, Signal oldSignal, Signal signal): base (wrapper, signal) - { - this.oldSignal = oldSignal; - } - - public Signal OldSignal { - get { return oldSignal; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/SignalCollection.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/SignalCollection.cs deleted file mode 100644 index c8b04ab33cd..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/SignalCollection.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System; -using System.Collections; - -namespace Stetic -{ - [Serializable] - public class SignalCollection: CollectionBase - { - [NonSerialized] - ObjectWrapper owner; - - [NonSerialized] - Signal[] clearedData; - - public SignalCollection () - { - } - - internal SignalCollection (ObjectWrapper owner) - { - this.owner = owner; - } - - public int Add (Signal signal) - { - return List.Add (signal); - } - - public Signal this [int n] { - get { return (Signal) List [n]; } - } - - public void Remove (Signal signal) - { - List.Remove (signal); - } - - public void CopyTo (Signal[] signals, int index) - { - List.CopyTo (signals, index); - } - - protected override void OnClear () - { - if (owner != null) { - clearedData = new Signal [Count]; - List.CopyTo (clearedData, 0); - } - } - - protected override void OnClearComplete () - { - if (owner != null) { - Signal[] data = clearedData; - clearedData = null; - foreach (Signal s in data) { - s.Owner = null; - owner.OnSignalRemoved (new SignalEventArgs (owner, s)); - } - } - } - - protected override void OnInsertComplete (int index, object value) - { - if (owner != null) { - ((Signal)value).Owner = owner; - owner.OnSignalAdded (new SignalEventArgs (owner, (Signal) value)); - } - } - - protected override void OnRemoveComplete (int index, object value) - { - if (owner != null) { - ((Signal)value).Owner = null; - owner.OnSignalRemoved (new SignalEventArgs (owner, (Signal) value)); - } - } - - protected override void OnSetComplete (int index, object oldValue, object newValue) - { - if (owner != null) { - ((Signal)oldValue).Owner = null; - owner.OnSignalRemoved (new SignalEventArgs (owner, (Signal) oldValue)); - ((Signal)newValue).Owner = owner; - owner.OnSignalAdded (new SignalEventArgs (owner, (Signal) newValue)); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/SignalEventHandler.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/SignalEventHandler.cs deleted file mode 100644 index da56c35156d..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/SignalEventHandler.cs +++ /dev/null @@ -1,19 +0,0 @@ - -namespace Stetic -{ - public delegate void SignalEventHandler (object sender, SignalEventArgs args); - - public class SignalEventArgs: ObjectWrapperEventArgs - { - Signal signal; - - public SignalEventArgs (ObjectWrapper wrapper, Signal signal): base (wrapper) - { - this.signal = signal; - } - - public Signal Signal { - get { return signal; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/SpinButton.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/SpinButton.cs deleted file mode 100644 index fa9e200f7ba..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/SpinButton.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace Stetic.Wrapper { - - public class SpinButton : Widget { - - public static Gtk.SpinButton CreateInstance () - { - return new Gtk.SpinButton (0.0, 100.0, 1.0); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Table.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Table.cs deleted file mode 100644 index f765aa847d2..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Table.cs +++ /dev/null @@ -1,520 +0,0 @@ -using System; -using System.Collections; -using System.Text.RegularExpressions; -using System.Xml; - -namespace Stetic.Wrapper { - - public class Table : Container { - - const Gtk.AttachOptions expandOpts = Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill; - const Gtk.AttachOptions fillOpts = Gtk.AttachOptions.Fill; - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - if (!initialized) { - table.NRows = 3; - table.NColumns = 3; - table.RowSpacing = 6; - table.ColumnSpacing = 6; - } - DoSync (); - } - - private Gtk.Table table { - get { - return (Gtk.Table)Wrapped; - } - } - - public override void Delete (Stetic.Placeholder ph) - { - // Placeholders are deleted using commands. - } - - protected override void DoSync () - { - if (!AllowPlaceholders) - return; - using (UndoManager.AtomicChange) { - uint left, right, top, bottom; - uint row, col; - Gtk.Widget w; - Gtk.Widget[,] grid; - Gtk.Table.TableChild tc; - Gtk.Widget[] children; - bool addedPlaceholders = false; - - children = table.Children; - grid = new Gtk.Widget[NRows,NColumns]; - - // First fill in the placeholders in the grid. If we find any - // placeholders covering more than one grid square, remove them. - // (New ones will be created below.) - foreach (Gtk.Widget child in children) { - if (!(child is Placeholder)) - continue; - - tc = table[child] as Gtk.Table.TableChild; - left = tc.LeftAttach; - right = tc.RightAttach; - top = tc.TopAttach; - bottom = tc.BottomAttach; - - if (right == left + 1 && bottom == top + 1) - grid[top,left] = child; - else { - table.Remove (child); - child.Destroy (); - } - } - - // Now fill in the real widgets, knocking out any placeholders - // they overlap. (If there are real widgets that overlap - // placeholders, neither will be knocked out, and the layout - // will probably end up wrong as well. But this situation - // happens at least temporarily during glade import.) - foreach (Gtk.Widget child in children) { - if (child is Placeholder) - continue; - - tc = table[child] as Gtk.Table.TableChild; - left = tc.LeftAttach; - right = tc.RightAttach; - top = tc.TopAttach; - bottom = tc.BottomAttach; - - for (row = top; row < bottom; row++) { - for (col = left; col < right; col++) { - w = grid[row,col]; - if (w is Placeholder) { - table.Remove (w); - w.Destroy (); - } - grid[row,col] = child; - } - } - } - - // Scan each row; if there are any empty cells, fill them in - // with placeholders. If a row contains only placeholders, then - // set them all to expand vertically so the row won't collapse. - // OTOH, if the row contains any real widget, set any placeholders - // in that row to not expand vertically, so they don't force the - // real widgets to expand further than they should. If any row - // is vertically expandable, then the table as a whole is. - vexpandable = false; - for (row = 0; row < NRows; row++) { - bool allPlaceholders = true; - - for (col = 0; col < NColumns; col++) { - w = grid[row,col]; - if (w == null) { - w = CreatePlaceholder (); - table.Attach (w, col, col + 1, row, row + 1); - NotifyChildAdded (w); - grid[row,col] = w; - addedPlaceholders = true; - } else if (!ChildVExpandable (w) || !AutoSize[w]) - allPlaceholders = false; - } - - for (col = 0; col < NColumns; col++) { - w = grid[row,col]; - if (!AutoSize[w]) - continue; - tc = table[w] as Gtk.Table.TableChild; - // We can't play with the vertical expansion property of - // widgets which span more than one row - if (tc.BottomAttach != tc.TopAttach + 1) - continue; - Gtk.AttachOptions opts = allPlaceholders ? expandOpts : fillOpts; - if (tc.YOptions != opts) - tc.YOptions = opts; - } - - if (allPlaceholders) - vexpandable = true; - } - - // Now do the same for columns and horizontal expansion (but we - // don't have to worry about empty cells this time). - hexpandable = false; - for (col = 0; col < NColumns; col++) { - bool allPlaceholders = true; - - for (row = 0; row < NRows; row++) { - w = grid[row,col]; - if (!ChildHExpandable (w) || !AutoSize[w]) { - allPlaceholders = false; - break; - } - } - - for (row = 0; row < NRows; row++) { - w = grid[row,col]; - if (!AutoSize[w]) - continue; - tc = table[w] as Gtk.Table.TableChild; - // We can't play with the horizontal expansion property of - // widgets which span more than one column - if (tc.RightAttach != tc.LeftAttach + 1) - continue; - Gtk.AttachOptions opts = allPlaceholders ? expandOpts : fillOpts; - if (tc.XOptions != opts) - tc.XOptions = opts; - } - - if (allPlaceholders) - hexpandable = true; - } - - if (addedPlaceholders) - EmitContentsChanged (); - } - } - - public override Placeholder AddPlaceholder () - { - // Placeholders are added by Sync () - return null; - } - - public uint NRows { - get { - return table.NRows; - } - set { - using (UndoManager.AtomicChange) { - Freeze (); - while (value < table.NRows) - DeleteRow (table.NRows - 1); - table.NRows = value; - Thaw (); - } - } - } - - public uint NColumns { - get { - return table.NColumns; - } - set { - using (UndoManager.AtomicChange) { - Freeze (); - while (value < table.NColumns) - DeleteColumn (table.NColumns - 1); - table.NColumns = value; - Thaw (); - } - } - } - - void AddRow (uint row) - { - using (UndoManager.AtomicChange) { - Freeze (); - table.NRows++; - foreach (Gtk.Widget w in table.Children) { - Gtk.Table.TableChild tc = table[w] as Gtk.Table.TableChild; - - if (tc.BottomAttach > row) - tc.BottomAttach++; - if (tc.TopAttach >= row) - tc.TopAttach++; - } - Thaw (); - } - } - - void DeleteRow (uint row) - { - Gtk.Widget[] children = table.Children; - Gtk.Table.TableChild tc; - - using (UndoManager.AtomicChange) { - Freeze (); - foreach (Gtk.Widget child in children) { - tc = table[child] as Gtk.Table.TableChild; - - if (tc.TopAttach == row) { - if (tc.BottomAttach == tc.TopAttach + 1) { - table.Remove (child); - child.Destroy (); - } - else - tc.BottomAttach--; - } else { - if (tc.TopAttach > row) - tc.TopAttach--; - if (tc.BottomAttach > row) - tc.BottomAttach--; - } - } - table.NRows--; - Thaw (); - } - } - - void AddColumn (uint col) - { - using (UndoManager.AtomicChange) { - Freeze (); - table.NColumns++; - foreach (Gtk.Widget w in table.Children) { - Gtk.Table.TableChild tc = table[w] as Gtk.Table.TableChild; - - if (tc.RightAttach > col) - tc.RightAttach++; - if (tc.LeftAttach >= col) - tc.LeftAttach++; - } - Thaw (); - } - } - - void DeleteColumn (uint col) - { - using (UndoManager.AtomicChange) { - Gtk.Widget[] children = table.Children; - Gtk.Table.TableChild tc; - - Freeze (); - foreach (Gtk.Widget child in children) { - tc = table[child] as Gtk.Table.TableChild; - - if (tc.LeftAttach == col) { - if (tc.RightAttach == tc.LeftAttach + 1) { - table.Remove (child); - child.Destroy (); - } - else - tc.RightAttach--; - } else { - if (tc.LeftAttach > col) - tc.LeftAttach--; - if (tc.RightAttach > col) - tc.RightAttach--; - } - } - table.NColumns--; - Thaw (); - } - } - - public override IEnumerable GladeChildren { - get { - ArrayList list = new ArrayList (); - foreach (object ob in base.GladeChildren) - list.Add (ob); - list.Sort (new NameComparer ()); - return list; - } - } - - class NameComparer: IComparer - { - public int Compare (object x, object y) - { - return string.Compare (((Gtk.Widget)x).Name, ((Gtk.Widget)y).Name); - } - } - - internal void InsertRowBefore (Gtk.Widget context) - { - Gtk.Table.TableChild tc = table[context] as Gtk.Table.TableChild; - AddRow (tc.TopAttach); - } - - internal void InsertRowAfter (Gtk.Widget context) - { - Gtk.Table.TableChild tc = table[context] as Gtk.Table.TableChild; - AddRow (tc.BottomAttach); - } - - internal void InsertColumnBefore (Gtk.Widget context) - { - Gtk.Table.TableChild tc = table[context] as Gtk.Table.TableChild; - AddColumn (tc.LeftAttach); - } - - internal void InsertColumnAfter (Gtk.Widget context) - { - Gtk.Table.TableChild tc = table[context] as Gtk.Table.TableChild; - AddColumn (tc.RightAttach); - } - - internal void DeleteRow (Gtk.Widget context) - { - Gtk.Table.TableChild tc = table[context] as Gtk.Table.TableChild; - DeleteRow (tc.TopAttach); - } - - internal void DeleteColumn (Gtk.Widget context) - { - Gtk.Table.TableChild tc = table[context] as Gtk.Table.TableChild; - DeleteColumn (tc.LeftAttach); - } - - private bool hexpandable, vexpandable; - public override bool HExpandable { get { return hexpandable; } } - public override bool VExpandable { get { return vexpandable; } } - - protected override void ChildContentsChanged (Container child) - { - using (UndoManager.AtomicChange) { - Gtk.Widget widget = child.Wrapped; - Freeze (); - if (AutoSize[widget]) { - Gtk.Table.TableChild tc = table[widget] as Gtk.Table.TableChild; - tc.XOptions = 0; - tc.YOptions = 0; - } - Thaw (); - } - - base.ChildContentsChanged (child); - } - - public class TableChild : Container.ContainerChild { - - bool freeze; - - Gtk.Table.TableChild tc { - get { - return (Gtk.Table.TableChild)Wrapped; - } - } - - public bool XExpand { - get { - return (tc.XOptions & Gtk.AttachOptions.Expand) != 0; - } - set { - freeze = true; - if (value) - tc.XOptions |= Gtk.AttachOptions.Expand; - else - tc.XOptions &= ~Gtk.AttachOptions.Expand; - freeze = false; - EmitNotify ("XExpand"); - } - } - - public bool XFill { - get { - return (tc.XOptions & Gtk.AttachOptions.Fill) != 0; - } - set { - freeze = true; - if (value) - tc.XOptions |= Gtk.AttachOptions.Fill; - else - tc.XOptions &= ~Gtk.AttachOptions.Fill; - freeze = false; - EmitNotify ("XFill"); - } - } - - public bool XShrink { - get { - return (tc.XOptions & Gtk.AttachOptions.Shrink) != 0; - } - set { - freeze = true; - if (value) - tc.XOptions |= Gtk.AttachOptions.Shrink; - else - tc.XOptions &= ~Gtk.AttachOptions.Shrink; - freeze = false; - EmitNotify ("XShrink"); - } - } - - public bool YExpand { - get { - return (tc.YOptions & Gtk.AttachOptions.Expand) != 0; - } - set { - freeze = true; - if (value) - tc.YOptions |= Gtk.AttachOptions.Expand; - else - tc.YOptions &= ~Gtk.AttachOptions.Expand; - freeze = false; - EmitNotify ("YExpand"); - } - } - - public bool YFill { - get { - return (tc.YOptions & Gtk.AttachOptions.Fill) != 0; - } - set { - freeze = true; - if (value) - tc.YOptions |= Gtk.AttachOptions.Fill; - else - tc.YOptions &= ~Gtk.AttachOptions.Fill; - freeze = false; - EmitNotify ("YFill"); - } - } - - public bool YShrink { - get { - return (tc.YOptions & Gtk.AttachOptions.Shrink) != 0; - } - set { - freeze = true; - if (value) - tc.YOptions |= Gtk.AttachOptions.Shrink; - else - tc.YOptions &= ~Gtk.AttachOptions.Shrink; - freeze = false; - EmitNotify ("YShrink"); - } - } - - protected override void EmitNotify (string propertyName) - { - if (freeze || Loading) return; - - if (propertyName == "x-options" || propertyName == "AutoSize") { - base.EmitNotify ("XExpand"); - base.EmitNotify ("XFill"); - base.EmitNotify ("XShrink"); - } - if (propertyName == "y-options" || propertyName == "AutoSize") { - base.EmitNotify ("YExpand"); - base.EmitNotify ("YFill"); - base.EmitNotify ("YShrink"); - } - base.EmitNotify (propertyName); - } - - // Properties to be used by the wrapper commands - - public bool CellXExpand { - get { return XExpand; } - set { AutoSize = false; XExpand = value; } - } - - public bool CellXFill{ - get { return XFill; } - set { AutoSize = false; XFill = value; } - } - - public bool CellYExpand { - get { return YExpand; } - set { AutoSize = false; YExpand = value; } - } - - public bool CellYFill{ - get { return YFill; } - set { AutoSize = false; YFill = value; } - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/TextView.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/TextView.cs deleted file mode 100644 index f5440de8d29..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/TextView.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.CodeDom; -using System.Collections; - -namespace Stetic.Wrapper { - - public class TextView : Container { - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - ((Gtk.TextView)Wrapped).Buffer.Changed += Buffer_Changed; - if (!initialized) - ShowScrollbars = true; - } - - public override void Dispose () - { - ((Gtk.TextView)Wrapped).Buffer.Changed -= Buffer_Changed; - base.Dispose (); - } - - public string Text { - get { - return ((Gtk.TextView)Wrapped).Buffer.Text; - } - set { - ((Gtk.TextView)Wrapped).Buffer.Text = value; - } - } - - public void Buffer_Changed (object obj, EventArgs args) - { - EmitNotify ("Text"); - } - - protected override bool AllowPlaceholders { - get { - return false; - } - } - - internal protected override void GenerateBuildCode (GeneratorContext ctx, CodeExpression var) - { - if (Text.Length > 0) { - PropertyDescriptor prop = (PropertyDescriptor)this.ClassDescriptor ["Text"]; - bool trans = prop.IsTranslated (Wrapped); - - ctx.Statements.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression ( - new CodePropertyReferenceExpression ( - var, - "Buffer" - ), - "Text" - ), - ctx.GenerateValue (Text, typeof(string), trans) - ) - ); - } - base.GenerateBuildCode (ctx, var); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ToggleToolButton.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ToggleToolButton.cs deleted file mode 100644 index a8a0654f1fc..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ToggleToolButton.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace Stetic.Wrapper { - - public class ToggleToolButton : ToolButton { - - public static new Gtk.ToolButton CreateInstance () - { - return new Gtk.ToggleToolButton (Gtk.Stock.Bold); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ToolButton.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ToolButton.cs deleted file mode 100644 index 76bb51faf7c..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/ToolButton.cs +++ /dev/null @@ -1,147 +0,0 @@ -using System; -using System.CodeDom; -using System.Xml; - -namespace Stetic.Wrapper { - - public class ToolButton : Widget { - - ButtonType type; - string stockId; - string label; - ImageInfo imageInfo; - - public enum ButtonType { - StockItem, - TextAndIcon - }; - - public static Gtk.ToolButton CreateInstance () - { - return new Gtk.ToolButton (Gtk.Stock.New); - } - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - Gtk.ToolButton toolbutton = (Gtk.ToolButton)Wrapped; - - if (toolbutton.StockId != null) { - stockId = toolbutton.StockId; - type = ButtonType.StockItem; - } else { - type = ButtonType.TextAndIcon; - } - } - - protected override void ReadProperties (ObjectReader reader, XmlElement elem) - { - if (reader.Format == FileFormat.Glade) { - string icon = (string)GladeUtils.ExtractProperty (elem, "icon", ""); - stockId = (string)GladeUtils.ExtractProperty (elem, "stock_id", ""); - label = (string)GladeUtils.ExtractProperty (elem, "label", ""); - base.ReadProperties (reader, elem); - - if (stockId != null && stockId.Length > 0) { - Type = ButtonType.StockItem; - } else if (icon != null && icon != "") { - imageInfo = ImageInfo.FromFile (icon); - Type = ButtonType.TextAndIcon; - } - } else - base.ReadProperties (reader, elem); - } - - protected override XmlElement WriteProperties (ObjectWriter writer) - { - XmlElement elem = base.WriteProperties (writer); - if (type != ButtonType.StockItem && imageInfo != null) { - if (writer.Format == FileFormat.Glade) { - switch (imageInfo.Source) { - case ImageSource.File: - GladeUtils.SetProperty (elem, "icon", imageInfo.Name); - break; - case ImageSource.Theme: - GladeUtils.SetProperty (elem, "stock_id", imageInfo.Name); - break; - default: - throw new System.NotSupportedException ("Image source not supported by Glade."); - } - } - } - return elem; - } - - internal protected override CodeExpression GenerateObjectCreation (GeneratorContext ctx) - { - return new CodeObjectCreateExpression ( - ClassDescriptor.WrappedTypeName.ToGlobalTypeRef (), - new CodePrimitiveExpression (null), - new CodePrimitiveExpression (null) - ); - } - - Gtk.ToolButton button { - get { return (Gtk.ToolButton) Wrapped; } - } - - public ButtonType Type { - get { - return type; - } - set { - type = value; - switch (type) { - case ButtonType.StockItem: - button.IconWidget = null; - StockId = stockId; - Label = label; - break; - case ButtonType.TextAndIcon: - button.StockId = null; - Icon = imageInfo; - Label = label; - break; - } - EmitNotify ("Type"); - } - } - - public string Label { - get { return label; } - set { - if (type == ButtonType.StockItem && value != null) { - label = value.Length == 0 ? null : value; - } else - label = value; - - button.Label = label; - } - } - - public string StockId { - get { return stockId; } - set { - stockId = value; - if (stockId != null && stockId.StartsWith ("stock:")) - stockId = stockId.Substring (6); - button.StockId = stockId; - button.ShowAll (); - } - } - - public ImageInfo Icon { - get { return imageInfo; } - set { - imageInfo = value; - if (imageInfo != null) { - button.IconWidget = new Gtk.Image (imageInfo.GetImage (Project)); - button.ShowAll (); - } - else - button.IconWidget = null; - EmitNotify ("Icon"); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Toolbar.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Toolbar.cs deleted file mode 100644 index cc155438888..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Toolbar.cs +++ /dev/null @@ -1,178 +0,0 @@ -using System; -using System.Collections; - -namespace Stetic.Wrapper { - - public class Toolbar : Container { - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - toolbar.SizeAllocated += toolbar_SizeAllocated; - } - - public override void Dispose () - { - toolbar.SizeAllocated -= toolbar_SizeAllocated; - base.Dispose (); - } - - public override IEnumerable RealChildren { - get { - // Don't return Gtk.ToolItems that are only being used - // to hold other non-ToolItem widgets. Just return the - // contained widgets themselves. - - Gtk.Widget[] children = toolbar.Children; - for (int i = 0; i < children.Length; i++) { - if (children[i].GetType () == typeof (Gtk.ToolItem)) - children[i] = ((Gtk.ToolItem)children[i]).Child; - } - return children; - } - } - - Gtk.Toolbar toolbar { - get { - return (Gtk.Toolbar)Wrapped; - } - } - - public override bool HExpandable { - get { - return toolbar.Orientation == Gtk.Orientation.Horizontal; - } - } - - public override bool VExpandable { - get { - return toolbar.Orientation == Gtk.Orientation.Vertical; - } - } - - public Gtk.Orientation Orientation { - get { - return toolbar.Orientation; - } - set { - toolbar.Orientation = value; - EmitContentsChanged (); - } - } - - protected override void DoSync () - { - DND.ClearFaults (this); - Gtk.Orientation faultOrientation = - Orientation == Gtk.Orientation.Horizontal ? Gtk.Orientation.Vertical : Gtk.Orientation.Horizontal; - Gdk.Rectangle tbAlloc = toolbar.Allocation; - - Gtk.Widget[] children = toolbar.Children; - if (children.Length == 0) { - DND.AddFault (this, 0, faultOrientation, tbAlloc); - return; - } - - if (faultOrientation == Gtk.Orientation.Horizontal) { - DND.AddHFault (this, 0, null, children[0]); - DND.AddHFault (this, children.Length, children[children.Length - 1], null); - } else { - DND.AddVFault (this, 0, null, children[0]); - DND.AddVFault (this, children.Length, children[children.Length - 1], null); - } - - for (int i = 1; i < children.Length; i++) { - if (faultOrientation == Gtk.Orientation.Horizontal) - DND.AddHFault (this, i, children[i - 1], children[i]); - else - DND.AddVFault (this, i, children[i - 1], children[i]); - } - } - - void toolbar_SizeAllocated (object obj, Gtk.SizeAllocatedArgs args) - { - Sync (); - } - - // Insert widget at index, wrapping a ToolItem around it if needed - void ToolItemize (Gtk.Widget widget, int index) - { - Gtk.ToolItem toolItem = widget as Gtk.ToolItem; - if (toolItem == null) { - toolItem = new Gtk.ToolItem (); - toolItem.Show (); - toolItem.Add (widget); - } - toolbar.Insert (toolItem, index); - } - - // Remove widget (or its ToolItem parent), returning its position - int ToolDeItemize (Gtk.Widget widget) - { - Gtk.ToolItem toolItem = widget as Gtk.ToolItem; - if (toolItem == null) { - toolItem = (Gtk.ToolItem)widget.Parent; - toolItem.Remove (widget); - } - - int index = toolbar.GetItemIndex (toolItem); - - toolbar.Remove (toolItem); - if (toolItem != (widget as Gtk.ToolItem)) - toolItem.Destroy (); - - return index; - } - - protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild) - { - ToolItemize (newChild, ToolDeItemize (oldChild)); - } - - public override Placeholder AddPlaceholder () - { - Placeholder ph = CreatePlaceholder (); - ToolItemize (ph, 0); - return ph; - } - - int dragIndex; - - protected override Gtk.Widget CreateDragSource (Gtk.Widget dragWidget) - { - Gtk.Invisible invis = new Gtk.Invisible (); - invis.Show (); - invis.DragEnd += DragEnd; - - dragIndex = ToolDeItemize (dragWidget); - return invis; - } - - void DragEnd (object obj, Gtk.DragEndArgs args) - { - Gtk.Invisible invis = obj as Gtk.Invisible; - invis.DragEnd -= DragEnd; - invis.Destroy (); - - if (DND.DragWidget != null) - ToolItemize (DND.Cancel (), dragIndex); - dragIndex = -1; - } - - public override void Drop (Gtk.Widget w, object faultId) - { - ToolItemize (w, (int)faultId); - EmitContentsChanged (); - Sync (); - } - - public class ToolbarChild : Container.ContainerChild { - public Gtk.ToolItem ToolItem { - get { - Gtk.Container.ContainerChild cc = (Gtk.Container.ContainerChild)Wrapped; - return (Gtk.ToolItem)cc.Child; - } - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/TreeView.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/TreeView.cs deleted file mode 100644 index 0444f4f4b13..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/TreeView.cs +++ /dev/null @@ -1,21 +0,0 @@ - -using System; - -namespace Stetic.Wrapper -{ - public class TreeView: Container - { - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - if (!initialized) - ShowScrollbars = true; - } - - protected override bool AllowPlaceholders { - get { - return false; - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/VScale.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/VScale.cs deleted file mode 100644 index e0fb10677cc..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/VScale.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.CodeDom; - -namespace Stetic.Wrapper { - - public class VScale : Scale { - - public static Gtk.VScale CreateInstance () - { - return new Gtk.VScale (0.0, 100.0, 1.0); - } - - internal protected override CodeExpression GenerateObjectCreation (GeneratorContext ctx) - { - return new CodeObjectCreateExpression (ClassDescriptor.WrappedTypeName.ToGlobalTypeRef (), new CodePrimitiveExpression (null)); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/VScrollbar.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/VScrollbar.cs deleted file mode 100644 index 8270c97a4e5..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/VScrollbar.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.CodeDom; - -namespace Stetic.Wrapper { - - public class VScrollbar : Range { - - public static Gtk.VScrollbar CreateInstance () - { - return new Gtk.VScrollbar (new Gtk.Adjustment (0.0, 0.0, 100.0, 1.0, 10.0, 10.0)); - } - - internal protected override CodeExpression GenerateObjectCreation (GeneratorContext ctx) - { - return new CodeObjectCreateExpression (ClassDescriptor.WrappedTypeName.ToGlobalTypeRef (), new CodePrimitiveExpression (null)); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Viewport.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Viewport.cs deleted file mode 100644 index 41dbacc1611..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Viewport.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections; - -namespace Stetic.Wrapper { - - public class Viewport : Container { - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - Unselectable = true; - } - - protected override void ReplaceChild (Gtk.Widget oldChild, Gtk.Widget newChild) - { - Widget ww = Widget.Lookup (oldChild); - if ((oldChild is Placeholder) && (ParentWrapper is ScrolledWindow) && newChild.SetScrollAdjustments (null, null)) { - Widget wrapper = Widget.Lookup (newChild); - wrapper.ShowScrollbars = false; - ParentWrapper.ReplaceChild (Wrapped, newChild, false); - } else if (ww != null && ww.ShowScrollbars && (ParentWrapper is ScrolledWindow) && ParentWrapper.ParentWrapper != null) { - // The viewport is bound to the child widget. Remove it together with the child - ParentWrapper.ParentWrapper.ReplaceChild (ParentWrapper.Wrapped, newChild, false); - } else - base.ReplaceChild (oldChild, newChild); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Widget.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Widget.cs deleted file mode 100644 index 76c1b581cf8..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Widget.cs +++ /dev/null @@ -1,1098 +0,0 @@ -using System; -using System.Collections; -using System.Xml; -using System.CodeDom; -using Stetic.Undo; - -namespace Stetic.Wrapper { - - public class Widget : Object, IEditableObject - { - static DiffGenerator propDiffGenerator; - - string oldName; - string oldMemberName; - bool hexpandable, vexpandable; - bool generatePublic = true; - - bool window_visible = true; - bool hasDefault; - bool canDefault; - Gdk.EventMask events; - bool canFocus; - - ActionGroupCollection actionGroups; - string member; - string tooltip; - - bool requiresUndoStatusUpdate; - - // List of groups added to the UIManager - ArrayList includedActionGroups; - - bool unselectable; - bool boundToScrollWindow; - - public event EventHandler Destroyed; - - // Fired when the name of the widget changes. - public event WidgetNameChangedHandler NameChanged; - // Fired when the member name of the widget changes. - public event WidgetNameChangedHandler MemberNameChanged; - - static Widget () - { - propDiffGenerator = new DiffGenerator (); - propDiffGenerator.CurrentStatusAdaptor = new XmlDiffAdaptor (); - propDiffGenerator.NewStatusAdaptor = propDiffGenerator.CurrentStatusAdaptor; - } - - public override void Wrap (object obj, bool initialized) - { - base.Wrap (obj, initialized); - - oldName = ((Gtk.Widget)obj).Name; - - if (!initialized) { - events = Wrapped.Events; - canFocus = Wrapped.CanFocus; - } - - if (!(Wrapped is Gtk.Window)) - Wrapped.ShowAll (); - - Wrapped.PopupMenu += PopupMenu; - Wrapped.FocusInEvent += OnFocusIn; - InterceptClicks (Wrapped); - - hexpandable = this.ClassDescriptor.HExpandable; - vexpandable = this.ClassDescriptor.VExpandable; - - if (ParentWrapper != null) { - // Make sure the widget's name is not already being used. - string nn = ParentWrapper.GetValidWidgetName (Wrapped); - if (nn != Wrapped.Name) - Wrapped.Name = nn; - } - - Wrapped.Destroyed += OnDestroyed; - - if (Wrapped.Parent != null) { - // The object was added to the parent before creating the wrapper. - // Since it's now a wrapped object, the parent don't need to - // intercept clicks for it anymore - Widget w = GetInterceptorParent (); - if (w != null) - w.UninterceptClicks (Wrapped); - } - } - - void OnDestroyed (object on, EventArgs a) - { - if (Destroyed != null) - Destroyed (this, a); - Dispose (); - } - - public override void Dispose () - { - if (Wrapped == null) - return; - - if (Project != null && Project.Selection == Wrapped) - Project.Selection = null; - - Wrapped.Destroyed -= OnDestroyed; - Wrapped.PopupMenu -= PopupMenu; - Wrapped.FocusInEvent -= OnFocusIn; - UninterceptClicks (Wrapped); - - if (actionGroups != null) { - foreach (ActionGroup ag in actionGroups) - ag.Dispose (); - actionGroups = null; - } - base.Dispose (); - } - - void OnFocusIn (object s, Gtk.FocusInEventArgs a) - { - if (!Unselectable) - Select (); - else if (ParentWrapper != null) - ParentWrapper.Select (); - } - - internal override UndoManager GetUndoManagerInternal () - { - if (ParentWrapper != null) - return ParentWrapper.UndoManager; - else - return base.GetUndoManagerInternal (); - } - - public bool GeneratePublic { - get { return generatePublic; } - set { generatePublic = value; } - } - - public bool Unselectable { - get { - return unselectable; - } - set { - if (value == unselectable) - return; - unselectable = value; - Widget w = GetInterceptorParent (); - if (w != null) { - // If a widget becomes unselectable, then the parent must intercept - // their clicks. - if (unselectable) - w.InterceptClicks (Wrapped); - else - w.UninterceptClicks (Wrapped); - } - } - } - - Widget GetInterceptorParent () - { - Gtk.Widget wp = Wrapped.Parent; - while (wp != null && Lookup (wp) == null) - wp = wp.Parent; - return Lookup (wp); - } - - void InterceptClicks (Gtk.Widget widget) - { - if (widget is Stetic.Placeholder) - return; - - if (!widget.IsRealized) - widget.Events |= Gdk.EventMask.ButtonPressMask; - widget.WidgetEvent += WidgetEvent; - - Gtk.Container container = widget as Gtk.Container; - if (container != null) { - container.Added += OnInterceptedChildAdded; - container.Removed += OnInterceptedChildRemoved; - foreach (Gtk.Widget child in container.AllChildren) { - Widget w = Lookup (child); - if (w == null || w.Unselectable) - InterceptClicks (child); - } - } - } - - [GLib.ConnectBefore] - void OnInterceptedChildAdded (object o, Gtk.AddedArgs args) - { - Widget w = Lookup (args.Widget); - if (w == null || w.Unselectable) - InterceptClicks (args.Widget); - } - - void OnInterceptedChildRemoved (object o, Gtk.RemovedArgs args) - { - UninterceptClicks (args.Widget); - } - - void UninterceptClicks (Gtk.Widget widget) - { - widget.WidgetEvent -= WidgetEvent; - - Gtk.Container container = widget as Gtk.Container; - if (container != null) { - container.Added -= OnInterceptedChildAdded; - container.Removed -= OnInterceptedChildRemoved; - foreach (Gtk.Widget child in container.AllChildren) { - if (Lookup (child) == null) - UninterceptClicks (child); - } - } - } - - public new Gtk.Widget Wrapped { - get { - return base.Wrapped as Gtk.Widget; - } - } - - public Stetic.Wrapper.Container ParentWrapper { - get { - return Container.LookupParent (Wrapped); - } - } - - public bool IsTopLevel { - get { return Wrapped.Parent == null || Widget.Lookup (Wrapped.Parent) == null; } - } - - public string UIManagerName { - get { - return actionGroups != null && actionGroups.Count > 0 ? "UIManager" : String.Empty; - } - } - - internal void InitializeName (string name) - { - oldName = name; - Wrapped.Name = name; - } - - public string Name { - get { return Wrapped.Name; } - set { Wrapped.Name = value; EmitNotify ("Name"); } - } - - public string MemberName { - get { return member != null ? member : ""; } - set { member = value; EmitNotify ("MemberName"); } - } - - public Container GetTopLevel () - { - Widget c = this; - while (!c.IsTopLevel) - c = c.ParentWrapper; - return c as Container; - } - - public ActionGroupCollection LocalActionGroups { - get { - if (IsTopLevel) { - if (actionGroups == null) { - actionGroups = new ActionGroupCollection (); - actionGroups.SetOwner (this); - actionGroups.ActionGroupAdded += OnGroupAdded; - actionGroups.ActionGroupRemoved += OnGroupRemoved; - actionGroups.ActionGroupChanged += OnGroupChanged; - } - return actionGroups; - } else { - return ParentWrapper.LocalActionGroups; - } - } - } - - void OnGroupAdded (object s, Stetic.Wrapper.ActionGroupEventArgs args) - { - args.ActionGroup.SignalAdded += OnSignalAdded; - args.ActionGroup.SignalRemoved += OnSignalRemoved; - args.ActionGroup.SignalChanged += OnSignalChanged; - NotifyChanged (); - } - - void OnGroupRemoved (object s, Stetic.Wrapper.ActionGroupEventArgs args) - { - args.ActionGroup.SignalAdded -= OnSignalAdded; - args.ActionGroup.SignalRemoved -= OnSignalRemoved; - args.ActionGroup.SignalChanged -= OnSignalChanged; - NotifyChanged (); - } - - void OnGroupChanged (object s, Stetic.Wrapper.ActionGroupEventArgs args) - { - NotifyChanged (); - } - - void OnSignalAdded (object sender, SignalEventArgs args) - { - OnSignalAdded (args); - } - - void OnSignalRemoved (object sender, SignalEventArgs args) - { - OnSignalRemoved (args); - } - - void OnSignalChanged (object sender, SignalChangedEventArgs args) - { - OnSignalChanged (args); - } - - [GLib.ConnectBefore] - void WidgetEvent (object obj, Gtk.WidgetEventArgs args) - { - if (args.Event.Type == Gdk.EventType.ButtonPress) - args.RetVal = HandleClick ((Gdk.EventButton)args.Event); - } - - internal bool HandleClick (Gdk.EventButton evb) - { - int x = (int)evb.X, y = (int)evb.Y; - int erx, ery, wrx, wry; - - // Translate from event window to widget window coords - evb.Window.GetOrigin (out erx, out ery); - Wrapped.GdkWindow.GetOrigin (out wrx, out wry); - x += erx - wrx; - y += ery - wry; - - Widget wrapper = FindWrapper (Wrapped, x, y); - if (wrapper == null) - return false; - - bool handled = false; - if (wrapper.Wrapped != proj.Selection) { - wrapper.Select (); - handled = true; - } - - if (Stetic.Editor.GtkWorkarounds.TriggersContextMenu (evb)) { - proj.PopupContextMenu (wrapper); - return true; - } - - return handled; - } - - Widget FindWrapper (Gtk.Widget top, int x, int y) - { - Widget wrapper; - - Gtk.Container container = top as Gtk.Container; - if (container != null) { - foreach (Gtk.Widget child in container.AllChildren) { - if (!child.IsDrawable) - continue; - - Gdk.Rectangle alloc = child.Allocation; - if (alloc.Contains (x, y)) { - if (child.GdkWindow == top.GdkWindow) - wrapper = FindWrapper (child, x, y); - else - wrapper = FindWrapper (child, x - alloc.X, y - alloc.Y); - if (wrapper != null) - return wrapper; - } - } - } - - wrapper = Lookup (top); - if (wrapper == null || wrapper.Unselectable) - return null; - return wrapper; - } - - void PopupMenu (object obj, EventArgs args) - { - proj.PopupContextMenu (this); - } - - public void Select () - { - proj.Selection = Wrapped; - } - - public void Unselect () - { - if (proj.Selection == Wrapped) - proj.Selection = null; - } - - internal protected virtual void OnSelected () - { - } - - internal protected virtual void OnUnselected () - { - } - - public void Delete () - { - if (Project.Selection == Wrapped) - Project.Selection = null; - - if (ParentWrapper != null) - ParentWrapper.Delete (this); - else - Wrapped.Destroy (); - } - - internal bool RequiresUndoStatusUpdate { - get { return requiresUndoStatusUpdate; } - set { requiresUndoStatusUpdate = value; } - } - - public override ObjectWrapper FindObjectByUndoId (string id) - { - ObjectWrapper c = base.FindObjectByUndoId (id); - if (c != null) - return c; - - if (actionGroups != null) - return actionGroups.FindObjectByUndoId (id); - else - return null; - } - - public override object GetUndoDiff () - { - XmlElement oldElem = UndoManager.GetObjectStatus (this); - XmlElement newElem = WriteProperties (new ObjectWriter (oldElem.OwnerDocument, FileFormat.Native)); - - ObjectDiff propsDiff = propDiffGenerator.GetDiff (newElem, oldElem); - ObjectDiff actionsDiff = LocalActionGroups.GetDiff (Project, oldElem); - - UndoManager.UpdateObjectStatus (this, newElem); - - if (propsDiff == null && actionsDiff == null) - return null; - else - return new ObjectDiff[] { propsDiff, actionsDiff }; - } - - public override object ApplyUndoRedoDiff (object diff) - { - ObjectDiff[] data = (ObjectDiff[]) diff; - - XmlElement status = UndoManager.GetObjectStatus (this); - XmlElement oldElem = (XmlElement) status.CloneNode (true); - - ObjectDiff propsDiff = data [0]; - - if (propsDiff != null) { - propDiffGenerator.ApplyDiff (status, propsDiff); - ReadProperties (new ObjectReader (Project, FileFormat.Native), status); - data [0] = propDiffGenerator.GetDiff (status, oldElem); - } - - ObjectDiff actionsDiff = data [1]; - if (actionsDiff != null) { - LocalActionGroups.ApplyDiff (Project, actionsDiff); - data [1] = LocalActionGroups.GetDiff (Project, oldElem); - } - - return data; - } - - public override void Read (ObjectReader reader, XmlElement elem) - { - ReadActionGroups (reader, elem); - ReadProperties (reader, elem); - } - - protected void ReadActionGroups (ObjectReader reader, XmlElement elem) - { - if (reader.Format == FileFormat.Native) { - if (actionGroups == null) { - actionGroups = new ActionGroupCollection (); - actionGroups.SetOwner (this); - actionGroups.ActionGroupAdded += OnGroupAdded; - actionGroups.ActionGroupRemoved += OnGroupRemoved; - actionGroups.ActionGroupChanged += OnGroupChanged; - } else - actionGroups.Clear (); - foreach (XmlElement groupElem in elem.SelectNodes ("action-group")) { - ActionGroup actionGroup = new ActionGroup (); - actionGroup.Read (reader, groupElem); - actionGroups.Add (actionGroup); - } - } - } - - protected virtual void ReadProperties (ObjectReader reader, XmlElement elem) - { - if (Wrapped != null) { - // There is already an instance. Load the default values. - this.ClassDescriptor.ResetInstance (Wrapped); - Signals.Clear (); - } - - if (reader.Format == FileFormat.Native) - WidgetUtils.Read (this, elem); - else - GladeUtils.ImportWidget (this, elem); - - string uid = elem.GetAttribute ("undoId"); - if (uid.Length > 0) - UndoId = uid; - oldName = Wrapped.Name; - } - - public override XmlElement Write (ObjectWriter writer) - { - XmlElement elem = WriteProperties (writer); - WriteActionGroups (writer, elem); - return elem; - } - - protected virtual XmlElement WriteProperties (ObjectWriter writer) - { - if (writer.Format == FileFormat.Native) { - XmlElement elem = WidgetUtils.Write (this, writer.XmlDocument); - if (writer.CreateUndoInfo) - elem.SetAttribute ("undoId", UndoId); - return elem; - } - else { - XmlElement elem = GladeUtils.ExportWidget (this, writer.XmlDocument); - GladeUtils.ExtractProperty (elem, "name", ""); - return elem; - } - } - - protected void WriteActionGroups (ObjectWriter writer, XmlElement elem) - { - if (writer.Format == FileFormat.Native) { - if (actionGroups != null) { - foreach (ActionGroup actionGroup in actionGroups) - elem.InsertBefore (actionGroup.Write (writer), elem.FirstChild); - } - } - } - - internal protected override void GenerateBuildCode (GeneratorContext ctx, CodeExpression var) - { - if (!String.IsNullOrEmpty (UIManagerName)) { - // Create an UI manager - CodeFieldReferenceExpression uixp = new CodeFieldReferenceExpression (new CodeThisReferenceExpression (), UIManagerName); - CodeAssignStatement uim_init = new CodeAssignStatement (uixp, new CodeObjectCreateExpression (typeof (Gtk.UIManager).ToGlobalTypeRef ())); - ctx.Statements.Add (uim_init); - - includedActionGroups = new ArrayList (); - - // Generate action group creation - foreach (ActionGroup actionGroup in actionGroups) { - - // Create the action group - string grpVar = ctx.NewId (); - CodeVariableDeclarationStatement uidec = new CodeVariableDeclarationStatement ( - typeof (Gtk.ActionGroup).ToGlobalTypeRef (), - grpVar, - actionGroup.GenerateObjectCreation (ctx) - ); - ctx.Statements.Add (uidec); - actionGroup.GenerateBuildCode (ctx, new CodeVariableReferenceExpression (grpVar)); - - // Insert the action group in the UIManager - CodeMethodInvokeExpression mi = new CodeMethodInvokeExpression ( - uixp, - "InsertActionGroup", - new CodeVariableReferenceExpression (grpVar), - new CodePrimitiveExpression (includedActionGroups.Count) - ); - ctx.Statements.Add (mi); - - includedActionGroups.Add (actionGroup); - } - - // Adds the accel group to the window - Window w = GetTopLevel () as Window; - if (w != null) { - CodeMethodInvokeExpression ami = new CodeMethodInvokeExpression ( - ctx.WidgetMap.GetWidgetExp (w), - "AddAccelGroup", - new CodePropertyReferenceExpression ( - uixp, - "AccelGroup" - ) - ); - ctx.Statements.Add (ami); - } else { - // There is no top level window, this must be a custom widget. - // The only option is to register the accel group when - // the widget is realized. This is done by the Bin wrapper. - } - } - - if (tooltip != null && tooltip.Length > 0) - GetTopLevel().GenerateTooltip (ctx, this); - - base.GenerateBuildCode (ctx, var); - } - - internal protected override void GeneratePostBuildCode (GeneratorContext ctx, CodeExpression var) - { - base.GeneratePostBuildCode (ctx, var); - - // The visible property is generated here to ensure that widgets are made visible - // after they have been fully built - - PropertyDescriptor prop = ClassDescriptor ["Visible"] as PropertyDescriptor; - if (prop != null && prop.PropertyType == typeof(bool) && !(bool) prop.GetValue (Wrapped)) { - ctx.Statements.Add ( - new CodeMethodInvokeExpression ( - var, - "Hide" - ) - ); - } - - // The HasDefault property can only be assigned when the widget is added to the window - prop = ClassDescriptor ["HasDefault"] as PropertyDescriptor; - if (prop != null && (bool) prop.GetValue (Wrapped)) { - ctx.Statements.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression ( - var, - "HasDefault" - ), - new CodePrimitiveExpression (true) - ) - ); - } - } - - protected override void GeneratePropertySet (GeneratorContext ctx, CodeExpression var, PropertyDescriptor prop) - { - // Those properties are handled in GeneratePostBuildCode - if (prop.Name == "Visible" || prop.Name == "HasDefault") - return; - - // Don't generate a name for unselectable widgets - if (prop.Name == "Name" && Unselectable) - return; - - base.GeneratePropertySet (ctx, var, prop); - } - - protected CodeExpression GenerateUiManagerElement (GeneratorContext ctx, ActionTree tree) - { - Widget topLevel = GetTopLevel (); - string uiName = topLevel.UIManagerName; - if (uiName != null) { - CodeFieldReferenceExpression uiManager = new CodeFieldReferenceExpression (new CodeThisReferenceExpression (), uiName); - if (topLevel.includedActionGroups == null) - topLevel.includedActionGroups = new ArrayList (); - - // Add to the uimanager all action groups required by the - // actions of the tree - - foreach (ActionGroup grp in tree.GetRequiredGroups ()) { - if (!topLevel.includedActionGroups.Contains (grp)) { - // Insert the action group in the UIManager - CodeMethodInvokeExpression mi = new CodeMethodInvokeExpression ( - uiManager, - "InsertActionGroup", - ctx.GenerateValue (grp, typeof(ActionGroup)), - new CodePrimitiveExpression (topLevel.includedActionGroups.Count) - ); - ctx.Statements.Add (mi); - topLevel.includedActionGroups.Add (grp); - } - } - - tree.GenerateBuildCode (ctx, uiManager); - return new CodeMethodInvokeExpression ( - uiManager, - "GetWidget", - new CodePrimitiveExpression ("/" + Wrapped.Name) - ); - } - return null; - } - - public static new Widget Lookup (GLib.Object obj) - { - return Stetic.ObjectWrapper.Lookup (obj) as Stetic.Wrapper.Widget; - } - - PropertyDescriptor internalChildProperty; - public PropertyDescriptor InternalChildProperty { - get { - return internalChildProperty; - } - set { - internalChildProperty = value; - } - } - - public virtual void Drop (Gtk.Widget widget, object faultId) - { - widget.Destroy (); - } - - public virtual bool HExpandable { get { return hexpandable; } } - public virtual bool VExpandable { get { return vexpandable; } } - - public bool Visible { - get { - return window_visible; - } - set { - window_visible = value; - EmitNotify ("Visible"); - } - } - - public bool HasDefault { - get { - return hasDefault; - } - set { - hasDefault = value; - EmitNotify ("HasDefault"); - if (hasDefault && !CanDefault) - CanDefault = true; - } - } - - public bool CanDefault { - get { - return canDefault; - } - set { - canDefault = value; - EmitNotify ("CanDefault"); - if (!canDefault && HasDefault) - HasDefault = false; - } - } - - public bool Sensitive { - get { - return Wrapped.Sensitive; - } - set { - if (Wrapped.Sensitive == value) - return; - - Wrapped.Sensitive = value; - if (Wrapped.Sensitive) - InsensitiveManager.Remove (this); - else - InsensitiveManager.Add (this); - EmitNotify ("Sensitive"); - } - } - - public Gdk.EventMask Events { - get { - return events; - } - set { - events = value; - EmitNotify ("Events"); - } - } - - public bool CanFocus { - get { - return canFocus; - } - set { - canFocus = value; - EmitNotify ("CanFocus"); - } - } - - public string Tooltip { - get { - return tooltip; - } - set { - tooltip = value; - } - } - - public bool ShowScrollbars { - get { - return boundToScrollWindow; - } - set { - if (boundToScrollWindow != value) { - boundToScrollWindow = value; - UpdateScrolledWindow (); - EmitNotify ("ShowScrollbars"); - } - } - } - - internal void UpdateScrolledWindow () - { - if (ParentWrapper == null) - return; - if (boundToScrollWindow) { - if (!(Wrapped.Parent is Gtk.Viewport) && !(Wrapped.Parent is Gtk.ScrolledWindow)) { - Gtk.ScrolledWindow scw = new Gtk.ScrolledWindow (); - scw.HscrollbarPolicy = scw.VscrollbarPolicy = Gtk.PolicyType.Automatic; - scw.ShadowType = Gtk.ShadowType.In; - ScrolledWindow wrapper = (ScrolledWindow) ObjectWrapper.Create (Project, scw); - ParentWrapper.ReplaceChild (Wrapped, scw, false); - if (Wrapped.SetScrollAdjustments (null, null)) - scw.Add (Wrapped); - else - wrapper.AddWithViewport (Wrapped); - Select (); - } - } - else if (((Wrapped.Parent is Gtk.Viewport) || (Wrapped.Parent is Gtk.ScrolledWindow)) && ParentWrapper.ParentWrapper != null) { - Gtk.Container parent = (Gtk.Container) Wrapped.Parent; - parent.Remove (Wrapped); - Container grandParent; - if (parent is Gtk.Viewport) { - parent = (Gtk.Container) parent.Parent; - grandParent = Container.LookupParent (parent); - } - else - grandParent = Container.LookupParent (parent); - grandParent.ReplaceChild (parent, Wrapped, true); - } - } - - public bool InWindow { - get { - return this.GetTopLevel ().Wrapped is TopLevelWindow; - } - } - - public bool IsScrollable { - get { - return !IsTopLevel && !(Wrapped is Gtk.ScrolledWindow); - } - } - - public override string ToString () - { - if (Wrapped == null) - return base.ToString (); - else if (Wrapped.Name != null) - return "[" + Wrapped.GetType ().Name + " '" + Wrapped.Name + "' " + Wrapped.GetHashCode ().ToString () + "]"; - else - return "[" + Wrapped.GetType ().Name + " " + Wrapped.GetHashCode ().ToString () + "]"; - } - - public IDesignArea GetDesignArea () - { - return GetDesignArea (Wrapped); - } - - protected IDesignArea GetDesignArea (Gtk.Widget w) - { - while (w != null && !(w is IDesignArea)) - w = w.Parent; - return w as IDesignArea; - } - - protected override void EmitNotify (string propertyName) - { - // Don't notify parent change for top level widgets. - if (propertyName == "parent" || propertyName == "has-focus" || - propertyName == "has-toplevel-focus" || propertyName == "is-active" || - propertyName == "is-focus" || propertyName == "style" || - propertyName == "Visible" || propertyName == "scroll-offset") - return; - - if (propertyName == "Name") { - if (Wrapped.Name != oldName) { - if (ParentWrapper != null) { - string nn = ParentWrapper.GetValidWidgetName (Wrapped); - if (nn != Wrapped.Name) { - // The name was not valid, so it has to be changed again. - // Don't fire the changed event now, will be fired after the following change - Wrapped.Name = nn; - return; - } - } - - // This fires the changed event - base.EmitNotify (propertyName); - - string on = oldName; - oldName = Wrapped.Name; - if (!Loading) - OnNameChanged (new WidgetNameChangedArgs (this, on, Wrapped.Name)); - - // Keep the member name in sync with the widget name - if (on == MemberName) - MemberName = Wrapped.Name; - } - } - else if (propertyName == "MemberName") { - if (MemberName != oldMemberName) { - base.EmitNotify (propertyName); - string on = oldMemberName; - oldMemberName = MemberName; - if (!Loading) - OnMemberNameChanged (new WidgetNameChangedArgs (this, on, MemberName)); - } - } - else { -// Console.WriteLine ("PROP: " + propertyName); - base.EmitNotify (propertyName); - } - } - - protected virtual void OnNameChanged (WidgetNameChangedArgs args) - { - if (Project != null) - Project.NotifyNameChanged (args); - if (NameChanged != null) - NameChanged (this, args); - } - - protected virtual void OnMemberNameChanged (WidgetNameChangedArgs args) - { - if (MemberNameChanged != null) - MemberNameChanged (this, args); - } - - bool IEditableObject.CanCopy { - get { return ClipboardCanCopy; } - } - - bool IEditableObject.CanCut { - get { return ClipboardCanCut; } - } - - bool IEditableObject.CanPaste { - get { return ClipboardCanPaste; } - } - - bool IEditableObject.CanDelete { - get { return CanDelete; } - } - - void IEditableObject.Copy () - { - ClipboardCopy (); - } - - void IEditableObject.Cut () - { - ClipboardCut (); - } - - void IEditableObject.Paste () - { - ClipboardPaste (); - } - - void IEditableObject.Delete () - { - Delete (); - } - - protected virtual bool ClipboardCanCopy { - get { return !IsTopLevel; } - } - - protected virtual bool ClipboardCanCut { - get { return InternalChildProperty == null && !IsTopLevel; } - } - - protected virtual bool ClipboardCanPaste { - get { return false; } - } - - protected virtual bool CanDelete { - get { return ClipboardCanCut; } - } - - protected virtual void ClipboardCopy () - { - Clipboard.Copy (Wrapped); - } - - protected virtual void ClipboardCut () - { - Clipboard.Cut (Wrapped); - } - - protected virtual void ClipboardPaste () - { - } - } - - internal static class InsensitiveManager { - - static Gtk.Invisible invis; - static Hashtable map; - - static InsensitiveManager () - { - map = new Hashtable (); - invis = new Gtk.Invisible (); - invis.ButtonPressEvent += ButtonPress; - } - - static void ButtonPress (object obj, Gtk.ButtonPressEventArgs args) - { - Gtk.Widget widget = (Gtk.Widget)map[args.Event.Window]; - if (widget == null) - return; - - Widget wrapper = Widget.Lookup (widget); - args.RetVal = wrapper.HandleClick (args.Event); - } - - public static void Add (Widget wrapper) - { - Gtk.Widget widget = wrapper.Wrapped; - - widget.SizeAllocated += Insensitive_SizeAllocate; - widget.Realized += Insensitive_Realized; - widget.Unrealized += Insensitive_Unrealized; - widget.Mapped += Insensitive_Mapped; - widget.Unmapped += Insensitive_Unmapped; - - if (widget.IsRealized) - Insensitive_Realized (widget, EventArgs.Empty); - if (widget.IsMapped) - Insensitive_Mapped (widget, EventArgs.Empty); - } - - public static void Remove (Widget wrapper) - { - Gtk.Widget widget = wrapper.Wrapped; - Gdk.Window win = (Gdk.Window)map[widget]; - if (win != null) { - map.Remove (widget); - map.Remove (win); - win.Destroy (); - } - widget.SizeAllocated -= Insensitive_SizeAllocate; - widget.Realized -= Insensitive_Realized; - widget.Unrealized -= Insensitive_Unrealized; - widget.Mapped -= Insensitive_Mapped; - widget.Unmapped -= Insensitive_Unmapped; - } - - static void Insensitive_SizeAllocate (object obj, Gtk.SizeAllocatedArgs args) - { - Gdk.Window win = (Gdk.Window)map[obj]; - if (win != null) - win.MoveResize (args.Allocation); - } - - static void Insensitive_Realized (object obj, EventArgs args) - { - Gtk.Widget widget = (Gtk.Widget)obj; - - Gdk.WindowAttr attributes = new Gdk.WindowAttr (); - attributes.WindowType = Gdk.WindowType.Child; - attributes.Wclass = Gdk.WindowClass.InputOnly; - attributes.Mask = Gdk.EventMask.ButtonPressMask; - - Gdk.Window win = new Gdk.Window (widget.GdkWindow, attributes, 0); - win.UserData = invis.Handle; - win.MoveResize (widget.Allocation); - - map[widget] = win; - map[win] = widget; - } - - static void Insensitive_Mapped (object obj, EventArgs args) - { - Gdk.Window win = (Gdk.Window)map[obj]; - win.Show (); - } - - static void Insensitive_Unmapped (object obj, EventArgs args) - { - Gdk.Window win = (Gdk.Window)map[obj]; - win.Hide (); - } - - static void Insensitive_Unrealized (object obj, EventArgs args) - { - Gdk.Window win = (Gdk.Window)map[obj]; - win.Destroy (); - map.Remove (obj); - map.Remove (win); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/WidgetEventHandler.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/WidgetEventHandler.cs deleted file mode 100644 index e6af45e1f64..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/WidgetEventHandler.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; - -namespace Stetic.Wrapper -{ - public delegate void WidgetEventHandler (object sender, WidgetEventArgs args); - - public class WidgetEventArgs: EventArgs - { - Stetic.Wrapper.Widget wrapper; - Gtk.Widget widget; - - public WidgetEventArgs (Gtk.Widget widget) - { - this.widget = widget; - wrapper = Stetic.Wrapper.Widget.Lookup (widget); - } - - public WidgetEventArgs (Stetic.Wrapper.Widget wrapper) - { - this.wrapper = wrapper; - if (wrapper != null) - this.widget = wrapper.Wrapped; - } - - public Gtk.Widget Widget { - get { return widget; } - } - - public Widget WidgetWrapper { - get { return wrapper; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/WidgetNameChangedHandler.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/WidgetNameChangedHandler.cs deleted file mode 100644 index 0d2df191149..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/WidgetNameChangedHandler.cs +++ /dev/null @@ -1,25 +0,0 @@ - -namespace Stetic.Wrapper -{ - public delegate void WidgetNameChangedHandler (object sender, WidgetNameChangedArgs args); - - public class WidgetNameChangedArgs: WidgetEventArgs - { - string oldName; - string newName; - - public WidgetNameChangedArgs (Stetic.Wrapper.Widget widget, string oldName, string newName): base (widget) - { - this.oldName = oldName; - this.newName = newName; - } - - public string OldName { - get { return oldName; } - } - - public string NewName { - get { return newName; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Window.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Window.cs deleted file mode 100644 index db3baddac2f..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Window.cs +++ /dev/null @@ -1,221 +0,0 @@ -using GLib; -using System; -using System.CodeDom; -using System.Collections; - -namespace Stetic.Wrapper { - - public class Window : Container { - - public override void Wrap (object obj, bool initialized) - { - TopLevelWindow window = (TopLevelWindow) obj; - - base.Wrap (obj, initialized); - - if (!initialized) { - if (window.Child is Placeholder) - window.Child.SetSizeRequest (200, 200); - } - - window.DeleteEvent += DeleteEvent; - } - - public static TopLevelWindow CreateInstance ( ) - { - TopLevelWindow t = new TopLevelWindow (); - return t; - } - - public override void Dispose ( ) - { - Wrapped.DeleteEvent -= DeleteEvent; - base.Dispose (); - } - - [ConnectBefore] - void DeleteEvent (object obj, Gtk.DeleteEventArgs args) - { - Wrapped.Hide (); - args.RetVal = true; - } - - public override bool HExpandable { get { return true; } } - public override bool VExpandable { get { return true; } } - - public bool Modal { - get { - return window.Modal; - } - set { - window.Modal = value; - EmitNotify ("Modal"); - } - } - - public Gdk.WindowTypeHint TypeHint { - get { - return window.TypeHint; - } - set { - window.TypeHint = value; - EmitNotify ("TypeHint"); - } - } - - Gtk.WindowType type; - public Gtk.WindowType Type { - get { - return type; - } - set { - type = value; - EmitNotify ("Type"); - } - } - - Gtk.WindowPosition windowPosition; - public Gtk.WindowPosition WindowPosition { - get { - return windowPosition; - } - set { - windowPosition = value; - EmitNotify ("WindowPosition"); - } - } - - ImageInfo icon; - public ImageInfo Icon { - get { - return icon; - } - set { - icon = value; - EmitNotify ("Icon"); - } - } - - TopLevelWindow window { - get { return (TopLevelWindow) Wrapped; } - } - - public string Title { - get { return window.Title; } - set { window.Title = value; EmitNotify ("Title"); } - } - - public bool Resizable - { - get { return window.Resizable; } - set { window.Resizable = value; EmitNotify ("Resizable"); } - } - - bool allowGrow = true; - public bool AllowGrow { - get { return allowGrow; } - set { allowGrow = value; EmitNotify ("AllowGrow"); } - } - - bool allowShrink = false; - public bool AllowShrink { - get { return allowShrink; } - set { allowShrink = value; EmitNotify ("AllowShrink"); } - } - - int defaultWidth = -1; - public int DefaultWidth { - get { return defaultWidth; } - set { defaultWidth = value; EmitNotify ("DefaultWidth"); } - } - - int defaultHeight = -1; - public int DefaultHeight { - get { return defaultHeight; } - set { defaultHeight = value; EmitNotify ("DefaultHeight"); } - } - - bool acceptFocus = true; - public bool AcceptFocus { - get { return acceptFocus; } - set { acceptFocus = value; EmitNotify ("AcceptFocus"); } - } - - bool decorated = true; - public bool Decorated { - get { return decorated; } - set { decorated = value; EmitNotify ("Decorated"); } - } - - bool destroyWithParent; - public bool DestroyWithParent { - get { return destroyWithParent; } - set { destroyWithParent = value; EmitNotify ("DestroyWithParent"); } - } - - Gdk.Gravity gravity = Gdk.Gravity.NorthWest; - public Gdk.Gravity Gravity { - get { return gravity; } - set { gravity = value; EmitNotify ("Gravity"); } - } - - string role; - public string Role { - get { return role; } - set { role = value; EmitNotify ("Role"); } - } - - bool skipPagerHint; - public bool SkipPagerHint { - get { return skipPagerHint; } - set { skipPagerHint = value; EmitNotify ("SkipPagerHint"); } - } - - bool skipTaskbarHint; - public bool SkipTaskbarHint { - get { return skipTaskbarHint; } - set { skipTaskbarHint = value; EmitNotify ("SkipTaskbarHint"); } - } - - bool focusOnMap = true; - public bool FocusOnMap { - get { return focusOnMap; } - set { focusOnMap = value; EmitNotify ("FocusOnMap"); } - } - - internal protected override void GenerateBuildCode (GeneratorContext ctx, CodeExpression var) - { - base.GenerateBuildCode (ctx, var); - - if (DefaultWidth == -1) { - ctx.Statements.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression ( - var, - "DefaultWidth" - ), - new CodePrimitiveExpression (DesignWidth) - ) - ); - } - - if (DefaultHeight == -1) { - ctx.Statements.Add ( - new CodeAssignStatement ( - new CodePropertyReferenceExpression ( - var, - "DefaultHeight" - ), - new CodePrimitiveExpression (DesignHeight) - ) - ); - } - } - - protected override void GeneratePropertySet (GeneratorContext ctx, CodeExpression var, PropertyDescriptor prop) - { - if (prop.Name != "Type") - base.GeneratePropertySet (ctx, var, prop); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/objects.xml b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/objects.xml deleted file mode 100644 index ea3407f81d9..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/objects.xml +++ /dev/null @@ -1,2292 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | - - - - - - - - - - - - - - - - - - - - - - | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | - - - - - - GTK_ - - - - - - - - - - - - - - - - - - - | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/COPIED b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/COPIED deleted file mode 100644 index d693b81e9a5..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/COPIED +++ /dev/null @@ -1 +0,0 @@ -These were stolen from glade3 and are GPLed. \ No newline at end of file diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/accellabel.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/accellabel.png deleted file mode 100644 index 6ba42ba220279c225192a200b841f44f7f359c99..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 489 zcmVW-hm%+10Qh$Z%Qd0Cy`*{>?55!;tB8iVyQL70(Y)*K0-AbW|YuPggCRskU{t#x~D+XIE>d%8G=Se$-3+*?u3WLo^+QI>L(Q2__o@hMKHoI4X?9$uO@_+lJExUZi<{?X zhQC_r$%wOP7^xm+9LP?0esQX~a*8yDS)Br^a20sl!v zK~y-)osz$c+F%^UpGY|n6t{D*r1&Ec7jcM#!%-a7v2+m5QCgQ|k0OUi1-Gh;+@jP! z;f^lG4pPM^_+vQ8nF=n|BzP5- z?1(1+lq>+i)7RkXYv|CsPZ0n>vLo)iOR@+v6=ih^9cYxkF00G4X?BT>uzi))CHSY` z7Zbe!04~*paDV%6=bag{{E$R8o4p94_R8ILbXWUvFg(1!rOqbO%iV{W)V!Z M07*qoM6N<$f;IsbQUCw| diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/add-menu.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/add-menu.png deleted file mode 100644 index 19a98613c22eb8de20559cde900a7711814ab7bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 381 zcmV-@0fPRCP)a*5Cpozye0qu0SZY( zK~y-)rISHU!!QsOc7Tj1m2q>O}x$ z(HZakmoK8pKNtlbwBVdWRZ-Q8TbQJQ_kK7FiRpjE@hl-CXZos&i0C)SuWN8=3Xp)2 bG7bADwzPU*&ADqc00000NkvXXu0mjfAd;S8 diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/alignment.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/alignment.png deleted file mode 100644 index 5d7d311d9604c518fc1077d950eef157d898a08c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 213 zcmeAS@N?(olHy`uVBq!ia0vp^q9Dw{1|(OCFP#RY*pj^6T^Rm@;DWu&Cj&(|3p^r= z85p>QL70(Y)*K0-V5z5zV~EA+w^IVS4k++AOMm>g{l(0xIX_;r#a=Dj&~GbXKSjVd zBt_m$dV)ZUh(r1`ufpkS`WJ-we%@U0O3T$qj8QMD_UNpcJF{2)k`O8H+cC*5KfJN0 zfIp7Ie{NEddH>^ECeL@A`Le<>&kwOjgwJ8DP{IGE1=MQPZ!4!i_>Q(+43DS;Ax#7IN_Gh z+t?z;cNhBvufI^-m3sEsRPK`Vg1a^?4KhC>!gghq*MA3&BeR80*KOO+a%18pGmTtk zJ0KNv$28_n>Gd}oQa^dUS-UdM(Bi>;m&>AaG>=usUf*0gL(=!M&b1ERj?~CS@2j6w z^1Zj6Q8{s;F)QcN+!g2485~-dKfK|};i36(Z~K&@Z&jCf#olmfG4XYDnO%8kX44~2 zwyn9{DxMQkC3mfpe(Zd2iyu$>3}It^qfSxt|NH9xZ9eK{6L{<1BlUYpo6IiWo#~|0 eU|To$B6E9gS;~Q!m#ILnGI+ZBxvX=l|1v&s)D(BCpUF&dro7qHd?(i~(1yd$P z7hl|Aa@e5f{6vv8Unac&{W$S{pY-Z7+co>==bZnXR(oJ}U}z}EVF49+YYwIfM>6-b xc$UPnPkQlNPG#W~CQlRJ&n8}%zuYf8BpYg!WS7-;Wi`gD5W@`&v>4PQVIa8?_!o^ z_`Xk;WdQiTf1`c$8pLtT;cy_1<2H9Xo$j8@`pr6`C}OwU-BmmNX{P{9)1bA!(V{2_ zf`IjU-PT{PSDL2jH_%#RjA`Q}NeF^~BuUzQSG(tL4K9}p#u$t-Sk}k(!Z0KZ!*-fH z&u_HLY&QF9VB0oA2t3alxp#diF-0gO0wOY#8YPCu(m;08N&*uTGut5+6l*{Fh zwn89;KuU>W7~xpgbw;BRj^m)~dg%B2eO%WKYlIM_(`f)}1&^j_;l$-;pS?|W3xA>5 z;-%N?0T2WMQpztQ+7{CgQKeE*aQMEDWmyW2!C*itl~U^3?KYn0DRqfNVinQywlz(Q z#1ZAKAd*sscsAj%E7u&|-l$%-zys&eh-$T(l7#VijN>>8j`+nH?&XQHNT+m9{OV4r zvu%47(Yhq8!?yNB?Sjbn{m8`F*#eYQL{HfQkBvq&qI$iqBw;ull1wHQY@JRA&+`-< z&1REKCZo(XO>;A%r~|ZX+7v|F`0k?^Fau73<2kaQ(hD$KTsX!7e%mwP_3z)w@3TO; UdX3#eDgXcg07*qoM6N<$f@_Q1TL1t6 diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/cell-expand-h.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/cell-expand-h.png deleted file mode 100644 index 539a6f71b5c55d615b989a2c14eb43b5691a9681..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 332 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|wj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwOO_YJr*8IHeUSxw}Sf)rxQzcyw7~@u{oc( zmesi3D8?sxLcr9xSGPqO0v;>w*u}x9sk&zCgdn?#j0vZ^+k9O-E{nKqxvdUVX5V?( zfX8DJOXRe~SY8JROj+VlU_{`r&IePj9En2o2O+;LGnq&=}et%O}Z XBen2-`$0FLCmB3l{an^LB{Ts50M~;# diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/cell-expand-v.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/cell-expand-v.png deleted file mode 100644 index 658e63d82c831e3b9345a507dfda60ec7d422173..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 341 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|wj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwOO_YI2Jn-U!TR@>lo-U3d7N^e!?dCmXAY!AeY`Jby z>>h?{m8D0eB$Z;L%GakhevwnuovXamIb<1w`_CCHEe?OT^%f}xq zUefiO((5-p_uYJV)=BL<(ZPF@HXPpH*c;Zc_VdFbBaq_iur<0bxIs?*)D08%;Pz!!EjsD@!Yxk zYMdFj#hf^nWOl84&1QF{x70@FnWbQ$$z;oCXZQEd|DW@(Mcixl={KE!m4&~Za|w@r hZX@*O-)qUc3|}8+r!t&geG}+g22WQ%mvv4FO#l)7gz^9Y diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/cell-fill-h.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/cell-fill-h.png deleted file mode 100644 index 30162bf7ea48c8eebfc965833549c4ad22f6c390..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 296 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|wj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwOO_YH}XIsO%3ZT$dPZ!4!i_=%9Y~*b=5ODo(&zPiZ z#Grg(+2WH-Iu6fuV^oTdoPXth%f;>A%vhJ96^;zkLEqTsEbt2R_O-xt_#Wnk#AZruh4^4(r91f!C+) z_N+;pdn0PM?-un6b<>&kwOO_YIEqc-dGj?H2(^flqFemWjk?_|RTvZQWt>XVTIRUf?N@1S<*8$* zPLxUZ?mO$V;HsNbN3M4?@2g$s_)?@!ob?L!(k=ImuJQX8B5r#=+N|nc-{KpOtA5n> z$sBi_>3VJQTPBClP>v=BmG-y4?K~dU-D_02wT;#DOD+E-0jCC)S<5P$C#gjKeqO=& XS;Aq-)5r&)uww9Z^>bP0l+XkKLYRRF diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/checkbutton.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/checkbutton.png deleted file mode 100644 index 71565b0b1f7108b3c225816043c4b83fb1502043..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 360 zcmV-u0hj)XP))s`;zBWYuA|$1{F!Y{MJ>9v_b;Pp8uks3z#7hr=Oz zv@q+~P;EAwQOd>`wASCiBm)2}%jy-sUazcHE40>~oX=-_tCS)P!$IEc8F48k=kpmU zI(AFah^U8_HYzPRg#t=x0SN>LB>n(C4%}KKE=U}D zqe2KS5g;LM95{mj(TI{3wL)#x&<~L&gnpUSN#i()KeFr3-Su$T;3QI2RFxx-^hz`H zj-KazX5Jb2ANK(PXn+Ldz`%f99c!z(2O{8ow4N z|$0y_>R3-R#|#!ig#*y9#jK{BB&tf?u16SCW&`-Q7kGdb70?rJueB`z6S{W#tOs3&+_NxUjxFHkK;IazE6H` zmUtq*=3p70Sv+#IxJ{EBE%GSlfxLix8*(i;c5D<)hR9t#54y?Eqdx?%RTEfU2H{W$ z1Vl`OQn|9`pn%I?)aj-{5+4_dkA{N)0aXbl4UQgt8P)btO5rsf_Gbo}ygEh8^=K;( zL>O1Wm5Hn95q-_U0!?OVv4lpEFpEg?2<`xLz=D7!39rBZ6{%DY*~_PaHe#c?%s z!@#j^ZqF}}Oj?YcI!(RNTGyrs%IHYKfTV@MK@eWew*)vEnA_iEx%d`2M`PyvWnz}a z+{`UMh!u9T_3wZU4X3xE)E@ft|R`> zG3-B(Vc&sFY5c;(rCqys9PygX`Hp~>YtXPuREeS?@$hI+M^XXX#4A9f0M!MUbDm)5 zYm+SAxXJRws|*LE=T>U9BUdg?X90ZWQZBol$EhALHehJz5e5hE{mVWu`uqC<5Sh$Q z(BRT<(}DWFUH46|C=KcnuC$D7%5Pg3D0000I(AFah^U8_HYzPRg#t=x0SN>LB>n(C4%}KKE=U}D zqe2KS5g;LM95{mj(TI{3wL)#x&<~L&gnpUSN#i()KeFr3-Su$T;3QI2RFxx-^hz`H zj-KazX5Jb2ANK(PXn+Ldz`%f99c!z(2O{8ow4N z|$0y_>R3-R#|#!ig#*y9#jK{BB&tf?u16SCW&`-Q7kGdb70?rJueB`z6S{W#tOs3&+_NxUjxFHkK;IazE6H` zmUtq*=3p70Sv+#IxJ{EBE%GSlfxLix8*(i;c5D<)hR9t#54y?Eqdx?%RTEfU2H{W$ z1Vl`OQn|9`pn%I?)aj-{5+4_dkA{N)0aXbl4UQgt8P)btO5rsf_Gbo}ygEh8^=K;( zL>O1Wm5Hn95q-_U0!?OVv4lpEFpEg?2<`xLz=D7!39rBZ6{%DY*~_PaHe#c?%s z!@#j^ZqF}}Oj?YcI!(RNTGyrs%IHYKfTV@MK@eWew*)vEnA_iEx%d`2M`PyvWnz}a z+{`UMh!u9T_3wZU4X3xE)E@ft|R`> zG3-B(Vc&sFY5c;(rCqys9PygX`Hp~>YtXPuREeS?@$hI+M^XXX#4A9f0M!MUbDm)5 zYm+SAxXJRws|*LE=T>U9BUdg?X90ZWQZBol$EhALHehJz5e5hE{mVWu`uqC<5Sh$Q z(BRT<(}DWFUH46|C=KcnuC$D7%5Pg3D0000I(AFah^U8_HYzPRg#t=x0SN>LB>n(C4%}KKE=U}D zqe2KS5g;LM95{mj(TI{3wL)#x&<~L&gnpUSN#i()KeFr3-Su$T;3QI2RFxx-^hz`H zj-KazX5Jb2ANK(PXn+Ldz`%f99c!z(2O{8ow4N z|$0y_>R3-R#|#!ig#*y9#jK{BB&tf?u16SCW&`-Q7kGdb70?rJueB`z6S{W#tOs3&+_NxUjxFHkK;IazE6H` zmUtq*=3p70Sv+#IxJ{EBE%GSlfxLix8*(i;c5D<)hR9t#54y?Eqdx?%RTEfU2H{W$ z1Vl`OQn|9`pn%I?)aj-{5+4_dkA{N)0aXbl4UQgt8P)btO5rsf_Gbo}ygEh8^=K;( zL>O1Wm5Hn95q-_U0!?OVv4lpEFpEg?2<`xLz=D7!39rBZ6{%DY*~_PaHe#c?%s z!@#j^ZqF}}Oj?YcI!(RNTGyrs%IHYKfTV@MK@eWew*)vEnA_iEx%d`2M`PyvWnz}a z+{`UMh!u9T_3wZU4X3xE)E@ft|R`> zG3-B(Vc&sFY5c;(rCqys9PygX`Hp~>YtXPuREeS?@$hI+M^XXX#4A9f0M!MUbDm)5 zYm+SAxXJRws|*LE=T>U9BUdg?X90ZWQZBol$EhALHehJz5e5hE{mVWu`uqC<5Sh$Q z(BRT<(}DWFUH46|C=KcnuC$D7%5Pg3D00000ll688*hP%j*L*~1*G_#z@e6c zhFe%#asr$ozxhER;R7nZ873r|?CyIT9zf3_0KnyP`AL$*_$06-N&b93Ukm{tNfN^_ zK8g?D_YDAx!8;(M(FkD}0syYpE5_q-KBqDKlww`ik)|oL{#FK$#{&S6rYXWO>?Z?F z)AEs*!H_!sXG%ZUl*ajdCW@l8J}inN;yA`^He>cY&%<)L6u2dlW%;Q<5b~!wpG+oY zwSoXbNV5l<%_cuk1t^ZE(}}xRB;gWlx7(6Zp86_zmSxOZErDfOjIydq+qU!dD2i%* z;u7q3yH4t-(0iH=j zK~zY`y;VD|fN$8jWIyWK_@hLT?*ST2`OM{v8{003ba z;&eKp)9GNh+d6c7?U;<{F=CDjrF##nZd0bnwjLU9 diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/custom.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/custom.png deleted file mode 100644 index df619249819eba8d29bf72180ccb189af1ab4a40..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 212 zcmeAS@N?(olHy`uVBq!ia0vp^q9Dw{1|(OCFP#RYSc;uILpXq-h9ji|$nW-aaSXBO zy*kB{?|=e_>(Y-#U+=|n_Bn@}PFoR>A^z{kkxupIS(o&hb{{??!^CJ3_fEXy1nZiu zcE{S!uiv_9+rlZI4c)FRj;zvZ+-zyQ#oTSlHJt?0t+F!O77||@DAsZ1e}4QwvpC1={C}4--(%aw&}*tUCCgz>G|*WLp00i_ I>zopr0DenR3IG5A diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/dec-border.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/dec-border.png deleted file mode 100644 index c5e5ae5b9e935e34ce1e7eeef24a5e195c981dc5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 363 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|wj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwOjgyg0pKX(T08r?Mr;B5V#p$yl)_lzdJhf#;8w#fB zy;&jtfQ2VEVEsYGh*j%yB6o+sv1Q6OpRmhlsWYSMgem=2Up%MDoUW`Zvtw9L?L1|w z!FAiP^=BW%-H-_kd-Sb>@03~NqBSugUv@0pGDVqD!CrnZ=g+5oi!|0Gd1;1(rcTPX zRH=8KwM;=tKycQw#-OZqC#J}zs`|B0_nY+Oa{2zstaXB(;UOG}f}Dyv_sx}g4`>;O z++E=D`AG=_L!v}e$AL2mX{XcE)-Q_WOlzA`6q4|3-nEXs;%6>TTWFVdQ&MBb@ E01_yQ>Hq)$ diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/dialog.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/dialog.png deleted file mode 100644 index 6e81b2fd601a91602c6880a1a52728a76dff4de0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 671 zcmV;Q0$}}#P)%Z&^E?KF0h*@K>2$Ddn@XiZKA&IM3n?X=o0|Y7;OmsYb=`$z zh{8xINvG3Of{;Y*cAKlKD|U8vVm*i>i8a}_ZR+(pwOS3+G&wsv3nj8Fi+a62*2>iNhwvo-&co+hw5QCj-!r_ zj+78W2_a%Jx3*#`l zuFpTFx3{;9Mx%vq@jT;w-)DV&efAXfdOecKBmnpK_X`n)I-2i?D_Bu0cm;eng68}T zNC$n?2#A-BF)##v08$H*tpQI1GUGpY{tNgC_`!d*@f+oB{m3gC>v#YF002ovPDHLk FV1mmPD|Y|@ diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/drawingarea.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/drawingarea.png deleted file mode 100644 index ee65bba5983a9d727a06b1721f9f7739203d5d72..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 926 zcmV;P17ZA$P)mx zS71cMGlNnVA_k9(Kp=qQl<4Z}+P&-q&;>ZE7E2lei-3q>a&n4PD#haBB1ewI86N(K zlP6DbXLXgIZ~cM-GIpBJzL>Cq=YW+!s~uN>MTCioNv6L|@#A-w>F8+VpREVHIW$T> zzsYN_o~HZ2e%9C5$!**Ncmil^=ptiu4X~64jE|2qckME5CQET+84LLQ!f9SS^A#U{ z@IK+rPMl(aC-;Q_x?2#GfrG(NT|ByDr^wwt?~fzcwp zRHAtIY!Ww<_UEEgv+O^5p07Vm@Y1t!9&Q#meE4aclH-4KsOPClS2ZTk8lgn*cdVg7>gMYRT(`vTl991j5Cnxn5WnD6oA~_} zE^-{l-w_@l3bZjOr4SL6+R2y-Fdku9MGFP_e10bes=Ry4vM>z@6d)d`t_0aDF-^0` zwrvoDh-vBqsqR`-N2OXccS81Z)Oo&WNj^8H-_HDb8+>u-Me zcE|V3V_y2L>>O|u2&r9a4tUo7AOB=Zzy`4KFUUxmXK*hcg8%>k07*qoM6N<$f)+Qw AH2?qr diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/entry.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/entry.png deleted file mode 100644 index d97bb9f378955ad145ed0f2646bce6f85bd0fb05..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 606 zcmV-k0-^nhP)B*@^!P> zynI$*MN!^LrP4PRj;XHeR4f+3IY&Gm|8StmWP)C=hik;AV3fV zn5KzpwTf!B3ez+r9soSg!{KnicsxeC-H!OsC&cdrL{S9i9Gr6)h5=Pop{gnj!-#kQ z(fxEfp;D>5<3kMGH8~UzMG=?F1&-rD*LB=(H?&$U+-|q1H_2o&@}Ewp5JfSF4tqzVBl;o1xik{&|V!^En2C0fHbv5CrJ=`4*@BN0ImQ40m4Z{ zK~zY`)t0|Y96=PvKW}FCT$>bL5-n6bOe2IqkR(JfBBV~EScqLnWnv}Rq_(!qACn@j zfhY+G7Kd0^X$EgEL{#o}EY3N1Z}-kSe-u7=%CrGy|5f0~!0GI$+ zH;kQIbWFX=0w?uSion6O1p9lc30~-Pyn5RnSVV~9*u!an6oGTuQ0(qp^(WteF^)Kn zn-*lUM$-9ltp&R~S0K}~bliQ5i_!#n6OXO%_pq^`_ynqv@UIFYfH($H8G=CdPLTBR>nVQ@;K%ny z0*s6a%d1&%zpgd#rX6@v|7<(rI!rtlK7BD13M%)I^&A7QTR$ByUJ4(V4O**?o9Q`C zPyWNxAz^+|qqVwunzkdT)nH*scLm&$pj<8!hG8af0M<&^;MUsQ``|vx^#|a$N!0Ff z;IS`Kx0E_yfm3fm2s{G%?%+1_9ytT5_kLwQ_(ug7h52f$27EZH00000NkvXXu0mjf DQ!wx~ diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/expander.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/expander.png deleted file mode 100644 index 35d1c41d8b610a40e293ce534755f792616c0658..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 536 zcmV+z0_XjSP)g@C=3`sX2Jjf0i{Vq zK~zY`)t0+%!Y~wuzvG0GsY@$$M(sNkv9(f{0Nshyp)ZFY0Yt^tvUf#1LLxz@b|CHm z4sjAfuLDQ294Gew9iQV%;Mh%awW@gkQ#0E-mBNd^vboXf%YziQ7jhl|3g(LaWsRxB?c+iB~~fMDUc)aQbyOwHiVuexfNr;o=XuUJrBpSbxM8Y1vf?5; z@tS>51{@OCdgFP&-{0%Z!4Q@5uuX*48l@Cr7}kn^8(_r&dc9t)a4lf5SP%q3X`{8< z*I7G`p-0)~Jwz&v__ z!N7`eI2?GQtQRf}=MN6XJDXb@m(|tP{_R3z<1Y3z?Pv7CcxYhY&g4|k{|tLhQSn;^ z1*yu~+9>e{*K-DAvVN9C7m#r?#N(rDqS5fdzP`9WBYKj_^xNCN+cpotNjW5wDI6z_ z>t^sgk9m<&YMy(VqEO*GQWnpusHm`o5St#Q&;}C}n9`Dx^?#i0mXA?XT|Ixixuq#I za{mU&R0^dG(z1}YMIaDB2*HWY9u6NmIo#RNJBSd)TI-s&L#@2a6zkDWVq6CW9UtWZ+gIept_pR#sE9TnlZRMoDgqvHsRA|aG9gv-lmSY5|~ z{mrXH|`G7#BAJWjUmj2$(tiy~Vkx1Yx z#qgaWLd7AbQd6W-4rkBwQ&v{W)xqQc+IAm(ya7wv+&p)J`O)S4zPE|0$XqN-P&7M_ zfNg_-{DM5j#wW^MhCbT5Ec``zbFkXYlqJlv4PYlat(v-J_(Wh_)l`IOz-mFfG6B;z-*mwrttVrEAA?*1R#JRcq?eFxGwgeAkkti{AHLH)aE*Q!cX# zf+Uj;zOPV9VGOw-T5Gg6U<|%e%!`z6BwV=Gyanh-w zp&`w(c25dzP^ zgfixy=OoAa`i3%qv4uztDL;Qq2m;1vq_k%oKr7z}A+*-o^*q;^c0Rp_MKp>?CbN6D sqM~xfYcUp+1Ohh+g)lumIm!U|6HSkEq_vy+n*aa+07*qoM6N<$f^UCHH~;_u diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/fixed.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/fixed.png deleted file mode 100644 index e6d5ece810e0fd5887a2017c10999fd86c3c4b9f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 122 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fj-D=#Ar`0KUR@}9z<}pSz*6s1 z!b^-(Z;4E|R(apTCt34op>7$^P$K ViDd?N>wTbM44$rjF6*2UngGp>D$xJ{ diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/fontbutton.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/fontbutton.png deleted file mode 100644 index fe7a790ad49c738ca2a7d2b592e94c577241df52..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 774 zcmV+h1Nr=kP)>n-#7mN)_@K$yCr=GG=Y171awYLPF`0k z6?~EO&(F#4bUG!9A~rTQJ^^olp@7+7FkmnkASt6r7=#Q+1`smB_~#NrATY)d$1y<= z06YbH2JAs%Ac=#61A-tRSYM~zZd->4W8{4Y!YUFn27pqjlmL7L+!rv5<2ZvL2m*S& z5D<+us!G9xOaP|oYRB> zUyPqHIoyYbpJ~+V)a!Nk(L6843kC^{GWK}~DPb<1?CtGwbo7NNijZXCx+o3$-Er7oxaPSi@!(K?I({bqJP-JYqOBYjQ z^85qTYHPGwEn2M>0Gls2+27wU7`NMRDVNJEFPGWf-A$2Xf&gZt(TKCNvqGa?rTLEc z<>KOk@pw$NS_N08g(_O4SC!ysbbcjezLflfjN z+1dG!K5uVtrxP`gY8J;algY%jyulbi#x;p^VB9#-f}(KR?RIH4o8V2;_s7S_ud3B5 ztE;O_roReZd2RW6a(a477={4ffGKu`vJQOY_IC1D;05pus0h299|BLXTc|{V?f;Sq za1MM2ek5D(F0kaB-MPW#0Kb7t;3shDM=DQmDk)`u0Q%;!5?g{w82|tP07*qoM6N<$ Ef{#&3z5oCK diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/fontselection.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/fontselection.png deleted file mode 100644 index fe7a790ad49c738ca2a7d2b592e94c577241df52..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 774 zcmV+h1Nr=kP)>n-#7mN)_@K$yCr=GG=Y171awYLPF`0k z6?~EO&(F#4bUG!9A~rTQJ^^olp@7+7FkmnkASt6r7=#Q+1`smB_~#NrATY)d$1y<= z06YbH2JAs%Ac=#61A-tRSYM~zZd->4W8{4Y!YUFn27pqjlmL7L+!rv5<2ZvL2m*S& z5D<+us!G9xOaP|oYRB> zUyPqHIoyYbpJ~+V)a!Nk(L6843kC^{GWK}~DPb<1?CtGwbo7NNijZXCx+o3$-Er7oxaPSi@!(K?I({bqJP-JYqOBYjQ z^85qTYHPGwEn2M>0Gls2+27wU7`NMRDVNJEFPGWf-A$2Xf&gZt(TKCNvqGa?rTLEc z<>KOk@pw$NS_N08g(_O4SC!ysbbcjezLflfjN z+1dG!K5uVtrxP`gY8J;algY%jyulbi#x;p^VB9#-f}(KR?RIH4o8V2;_s7S_ud3B5 ztE;O_roReZd2RW6a(a477={4ffGKu`vJQOY_IC1D;05pus0h299|BLXTc|{V?f;Sq za1MM2ek5D(F0kaB-MPW#0Kb7t;3shDM=DQmDk)`u0Q%;!5?g{w82|tP07*qoM6N<$ Ef{#&3z5oCK diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/fontselectiondialog.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/fontselectiondialog.png deleted file mode 100644 index 6936c47c05f2e95a041910926d5908198693448d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 605 zcmV-j0;2tiP)h+r57+wC@S zw@GT-HjPF@c~FS&UPKglxSK4%=RDAo2xhYxhG9^v)ozV)fX4|6@f=Jh6BdgFyWI{E zp<1mTEv{55%03KfE`n~itH7fnN=#rvC25*=K1AWiFb}<6FO^_07@+GqrBaFUc${dX zdWYwE!Fs(8L`3OmGzvr{Xti2_Wm$paI7i>(>id4MTCIXZ>v;`4KdGW<1&IjlcKfUc zuIo}Rmrp{LnuELQJ#L@0K9%6El1w8APj+gO^VE124-yYrRsvnuvlC<`iHc=eYTWPl z^CkIQOZI*LXui|wWIM^r<&t8tcmkRyd?JG5ILYn$KitW$fX{`<1^ohe3Ou+6@IQb9 r{0cpI1Uv>F9=y8rx8(-72KIjeMQNFz6dLV200000NkvXXu0mjfk_`og diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/frame.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/frame.png deleted file mode 100644 index 8a4c1f3a0e6ce0152fe5a538544e0ed50a41d258..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 307 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4%caKYZ?lYt_f1s;*b z3=G^tAk28_ZrvZCAbW|YuPgf%MtO04fwaZ!GC-jNo-U3d6?5KBGvqqtAmBP*X=h`s zLg9t{LZrSl|uo|pPAp0-~@%xiUhdkcxigk9Vg zAr%>-Yp#>YLYd)zGE{g2T>3jO9=p-G_+iI}>;tY@DhbiPU2<*{7_H93?m9;^Z7$$uR9^_}JG% zP<-t8bTPb|!k!1@b0mlUW@Y_BR(<#-=~SM^-rH2am|&uH2|<4wwx^E3bdc49vrLQO z3U1XrVDjlCYbx8RiEO0oxP)h)(RSw?%Lcmer@m&aeJit0hP}P_+4QiN{pAwC`guUX z>nEA*fZ}j7>ZD} zxXfthNt}{HJhp}IZ5>F-A@-o3?GNLKtK3=F#Fc0hz_MEZu~hf`U-A^Lb0ewK0_!wM)c+>>XQj( zd=(UJi*RO!@0|h)n-nVFd1YfPHI~JXKmSC?Ue5MgmuT+3NB8>8Of>naK691bQ+X`a zlBjkA-!AARF-CWa=m_XZ5pA$6^%zSPRwx`-h%5ZA5c@AXRw;a@uw2194!&iFIUq?w3Hsf=Y=E@~4*6c|BKi*~IFYTK@D1g#QUL=?0N z45B1jv}hF=3E@VRQd2Z!%xoN;8J+p&`?O@fx!M1UBL~}P++9a|T<|qD%lOGnQ#R z%%S9IV&NLr(qp_CevYY%u$V3~J-XtJ4?eXvAabL-sV~WN+qC7LNU)fgWyBsPTk@Iv zzDy`sMNu_VxhqclKFbnfYpw(kLYRx^&k|HYa&8gZ{lWagdnPgg)?;V*66qynrE#ib zNafJbeGVan*`^@aY~e%;OfOEboLS;%{Vj5(5Cvc1s}=HknFHY@5fSF(sap7@!rBBB z3#4X0)6sO5&XxJrEB9Zi+e zU^LQr#Dl%;m!qr&T~tEj=QHI)|E{1EtR$5gfuRiD-8WFtdN5@XHU2l8$!ARI0=BP- z3b}c|@(zT+o~$MkOAxK~nIC?HS6st)ZEV}7ke=t0uvrO8)&mlw1jl6^K0o-}A_=W+@hnHn4*<0G#q0YI<%28tXmp~8>>Ob?O^qzjS-Z~Ocq?yTe89>T xn0fd3(%*ieoRqR`5~V{m0*vcaGn)Va002ovPDHLkV1ih{Iza#c diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/handlebox.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/handlebox.png deleted file mode 100644 index be064c6f519623df677122658a0133c9a74fa3ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 339 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)2&R4m0e|)j7KoD8gCb z5n0T@z%2;EjP)t;6M=&4C7!;n>{l4&#bntz5AB%?GQiWtF{EP7+bOsC4mt?5?HBbw z$og)ARp=q%PWLZ7DtuS7TCG~S=Ox8%iH=&XA+GXw^UeCQWi!|3Zes3?^I#D9Wcjl- z&ilaLqVmmmzg}APYTY%NZ?6TSJAQB6&rw!re=en%rQ!0&12tyf<>&kwGiJ6_nQdlE+9s>iTl&6bhNX4zIQ!jcQHQ;I6zr^{2 z(~YBywY(o~YlPx&A5J*Dx^cm!io$DaqpfXpoecwC?7OJ;bF%IS@ozu=6mk3)ot%-+ ze(yHZ`vdLAuAB*5{rgHM^)>IW0j}OigWM7#6^qjO?y>@EJJx58Q$0Ge*Z0LF;_l(;*cK?t~NP3+JPNv*WZVK zQkeL(d(O`!?#g}LZHWtBTe+}2zf-eg%KMqJJLWZ9Hft8!!TxU1{LtRY1QxsP!f(^0 pgnZL(9gX~Vg!c!RaBqG7{gNdcnK*U);(!6i;OXk;vd$@?2>>37o%8?z diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/hbuttonbox.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/hbuttonbox.png deleted file mode 100644 index e38a4c5eed143302c5965fdb0195d6b6c288a730..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^5jA5L~c#`DCC7XMsm# zF#`j)AP6(or^HVL3bL1Y`ns}TVU*|6)O(uND+Cmp@9E+gQZeW4t z>+JhhZ)13#xJ>=QyRS?#+ncWz=KW-_X>31!{eHCm{j<&u(=Usw37gAL)b836Av_c0 OV+K!GKbLh*2~7Z^F=jOY diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/hpaned.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/hpaned.png deleted file mode 100644 index e2847abd0969134747ea794aa2e65a846e280b7f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 655 zcmV;A0&x9_P)&T05uU85Dg;1 zCJGCE1YP)Np}RhTS`&&1t?i;Fwsv&lxEai}GriNQJ;`K}d(Qp7bI$$lJp!=lj)j4r z8bGO3A`*%G7t~s0Dc$U19vG8|Qi@bWW1i*3q zD4E+=f(hJ2>&6sA$NB;l)C}%((8yNm*+?ao{TD*`f(N!pCBIhwW?x$s_+{1Z#S5$e z;8NND6}oMBk+2jKPgGH-U$o`Zb*^bYTytpG4GIKa-`Yn`cRYw0q> zdcUVNQp$$7k--7BSFS2mBmlc!uT!m7l`08^Lge##bX`}f$TUr&(I~(u@LsBP>|V2N zI}qIOHPrx$#Uim-4BNJ`EUV)o(>&2UE$Y%tJ^}1$&Tu{q#GNUmImCZ!7Vr%y1K))M p)&m@J$h3dV{1@;8s5$@c+HY^cld)(qY9{~y002ovPDHLkV1gs3CAI(n diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/hscale.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/hscale.png deleted file mode 100644 index 310e01cde244580441a4e9b19ff33e4c81b121ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^q9Dw{1|(OCFP#RY*pj^6T^Rm@;DWu&Cj&(|3p^r= z85p>QL70(Y)*K0-AbW|YuPggiWg-T< zPdppAL+H&8F1?ZqiAfvX#D54)GW+{iQzT+)nfbT&t&c}JXex`IcoRJcb#n=6Ni} z1D!?*73~8onnuoDDU3Eu&H+X&yjGpO3yx$ui5yp4;<4(7>9xO~_t#%yY;<_=T!0}Y zbSry6edV`>I;T&+3%lYPXmNL0rhx0j#k_|bY|hJ`jq2W(J2Ca<-n2A{0Z!d zi*@WZQj?Yebwp*WSIkm-|GwzSWW#4a?!4J`&UnwIurHUNEo(e5zkrqdi<7*1LlGzt O7(8A5T-G@yGywpMhksuH diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/hseparator.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/hseparator.png deleted file mode 100644 index b32843abecf96342234a567f7547d43837f0d15b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 315 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4%caKYZ?lYt_f1s;*b z3=G^tAk28_ZrvZCAbW|YuPgf%MtLzqhIP}OCIE#_c)B=-RLpsM$RloTzp?5l^i4Px^c@s zfkU$MKDLCHBscEKy**pt(BGiORjcF*8^v8p9_ybf?9+}(GClIF>O<%Dm)vDG2Tlh3 z;8|YhGhh2cQu337`!r7#nslChSlzYDagF_i*&cti_c8RkShxng(dGsEiNVv=&t;uc GLK6VK+ z0H~xGpC|wT010qNS#tmY3labT3lag+-G2N4000McNliru)dv(6DF#%uV4(m20ozGL zK~zY`)s``98!;5ee>#cKZXq~rhET|u4xvkieujLCeurl2l26jCp*94M275CF4<524 zg+k+cFeY(}$>JnF-RqFMLptlu*FcB<;qgw=)Bou`=}8CwJ5=F2D)c=U0wjPahdc=w zKBoQFnUsm!Zlv}))vtj&-~neq)}h^QSB`hPT>)-@_rNxwqhhL*Qb7S&EEWJ*n|Nc^ zdckX86W9Qh2_zd(oVRyRdrvdUzrl-VVlSM8u`Y_cG`po{U-k z{9d_>SJzWd7s$hnzrp_Aj;9@X`3gpmrKAjTY%xZA?J}%5DC9B-t)p6YD-JrH4)ggu z-%OeNBA*{o9sx4;pw3z*7H&dz_RzpPe( zEw`>r75VJPd7h>sK3<*y@P%&xjNhIF>maHkkM1w{eR)zENk(3BiH04x*@~^Tr8Xi$uh&~&2X$*9WHX!1);s9;`(DV|ssV<>A&o}E8#l(}4wuVimi9wn z3QWBBphA*0QnWn=-T~S;7t|Zz0C<%~rV3ABUBv05^9x8^l9%a2@xnc3&u}2XJun9r c|NO7w5B9-K>*#l`0ssI207*qoM6N<$g4GWNAOHXW diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/image.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/image.png deleted file mode 100644 index 7f790e56b37ca0029c06a20dddc0ecab497132c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 594 zcmV-Y0Q-#9D3}l&)Io5NEKv%6q*Wn+{{*@AFcrQ~+qV+jKge;Q;_2uEr3XwQfF{TVem9dG6l0!0F@D{4gxS z;V=L$mkTN7XaKQU!`^tmrS|;Q8;%{G;mQ3ti??5pNX+#<>&kwOjgyg8FKR{&D^Tdar;B5V#p$!bhFOOl1m;M_F1){^ zFn6N(6Xx(8hLx@d^b6$g?6N)~-cx1o=s)4W+Ew0yzawJbImra2I2i0+9eY+so2lam z%k|xt=RPj_vgcyRf4#72NB%wKl+1WNRpQj7{j77hCI@beoWJGX+@ynkhyK0odHZVD ziB^FN-}lPO-Tj-oTUna9;k%rQqtIgurIrs*o6nuvR(3Dme5GZ5m-VX1tXXQN&-Sp) z+}*G>GB`L;Bz5uWi^aQlJ*uf-^Ymz1!a6-9zopr0AmcBzW@LL diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/label.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/label.png deleted file mode 100644 index 9299f0fe243eff47aa7886e817a467c54035020d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 420 zcmV;V0bBlwP)otz!XuS}EY&QEG;CMXJY&IDVhe#=Pmr5lK2!en@p`h=q zR;%X$^?DuGb*WS;4|CUbnayU}!Ow_<5ae>X|G(%(0TJNq?E&AsbKLq$x O0000QL70(Y)*K0-AbW|YuPggiWGl)%`1b!@iCfqIwHs5U1gEAr zzMAsHVB62jHv`MK-rO%zVpTYHf8*>Q6E!FJ>y%bK+OhQA?BlL$Kgq>M9TLr4es%rQ aM@%}5j+{Kw3nl;^&EVWoECA0ATsMpWkEqo6N(6-n*xy)l{7=4G6eAr zEYXs}w^C9BFS;u5E%Z@$-4)EfLhg7myHC6AF1=4L+rJHf&4 z173Ic(f#T?xI2f>YqHK-q%7fxJ#bP z$v|&cT;9mr0m?mugk9h?g1?opniPHr_c2pA?S8Q|MNc3k$}LqZ7j3Jlil52+U+*ET#k*64GM)qW`Hro8X&82V58CCV1J*N z-;U5V1?#8Jo5}>w4THJ4IjYraibR&>h-_tLC7lEiIF3WB)uLQ3^Wx+qx~4<`tLt;{ z_!-;V+nHI%*Azv;^E_r|W&ldSmw^&Bn@x00q42KuH-*&_rfH^vWs$_^0S)?#Q&Uq| z4IfrZ13Sp)^CJn8|AvZe7zUM!%-ZpXOAWd{`wyRDtgRtQ64h!o!uq~{sidZj*T8jM zY}<~6-rL)|ESIjczP`@<{CsAnSwjfH^z?M3K}6s<&OdE`+z>*b>v~#bS(dMKV*wOJ z8G5o(B1@7)tyZI6Prpga%gZb*EC6tLc$kSPl}aovEk*YtZh;UYI6prRHa9neq*;~~ zY;A1?uImP_>yE_qdcDALoFHrgPk;xhr=r0ImNBs2FskIBi&!Bcd0c1A9j1HkwFD-oqSn&+i=a7#V;5%5C| zoAX^DANEl-B)+cofHq(PLJEUvz(h!<{%7XDfnR_Z&bMoS0Jy^o!Qw4>X8-^I07*qo IM6N<$f)M#fegFUf diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/missing.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/missing.png deleted file mode 100644 index 589da692bbebb0ddb0c6ede675a0ae763aa2d986..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 357 zcmV-r0h<1aP)e|K3p+62%Me#?NVh*-U@Yu#)%8by(TOa=jY zo?AVRV=c>4gCJ-raXJ8sqOi(aEEXh5LY8H0w_Cz61aMqNn5r_H&G0;r{r;CUO`Dok zfrt!(0M_d@zVF)=nC8QL%3(f5Rh!t<4G7?(yTfS_Ab-B&+#1&=Q$)D=_-^H|gD8tn8p8UZ(FbYJ3%ePfCH}NQds^U0KYmte& z;~?N%^XXIf0L$f)vMkRw1MGG?fS>N>Pb0sx@kfAvtF<1S8*f2y00000NkvXXu0mjf DDSn-) diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/notebook.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/notebook.png deleted file mode 100644 index 7d8f7067f4a570f88c8d5f26042b6d0047dc0e36..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 752 zcmVLBYl<2qM}kf{@12 zCWTm7iG|TCHHU?XkP9kNVseQj7w?ku?y?s9W^Z?I*9)QpkDJHNe!nx{nfLa@KnfFT!fG+x)1x8(=p;nk|FuY5x+Ay&d*kHntAN?}=5>odRx z;p{aKl_?J3?@0j{`>wTi1MJjY1YDB9X-GkcNTR+C0<zQL75#a~++clt#CnqJ##jznw-CeN~>zxxK zN*GbFS2e(o?|Jg`1we2dgQs~&xO^~<33{QK>K9OnKjgnEtS9)F-8%or&M83;Foge4 ip`9R~zcvr30EORsCyNq0T;fsy0000-AbWlTyNQ9Nh1BbUK}657@j+(C5Kc}&jzAFz2vHYsyNM1=8poVr0mh++gBX(KVIw{07~@8|DeG#aIDkPt%2 zecy-cx(LHiIoC{PpzU^B$b(X;^z$Buq22*27!HS-{{aB(_j@Jh`Y5QL70(Y)*K0-V3MbcV~EA+w^Izc4j6E_?pK|DQgZUede`v&q~%VW3%%b4OtSAh z<@`l?!`5|AxT3NrGOB1kofmL5Gx@!&N@807fhcW{MLn$L^|o(69`zG%pZ4+8%YaEc lpY?Z$eD3aeGyjwD+}Ukn*RqP6Oo6sBc)I$ztaD0e0sz=MMXmq< diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/radiobutton.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/radiobutton.png deleted file mode 100644 index c85d9492ad8444e2087cef880a83868b6028a6f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 560 zcmV-00?+-4P)OS+``BjjwD)y)XK5NT%yKR?BCGb3t@pz18 zvx!Qjf<~i(!C(LYs8*|RUAJx9cI{6&;adXBvRc_}797W6GMS*)>p_-fl*?s!o`+7S z0|2Pk>nIkBuq>+u;QiqW9LG^osT2~41aw`8EX#O%d&6inf?*h#&1UHL`v8DkE(gbP zl&4x01c4BX#SjjMv0kr{PNy-QPT{&PeBa06aKLJ{0sus#Q3OFCJSE_H-sLzBkw^rR zB*F8%k8sa*9y;YAi~|4w0p3YO zK~y-)m6AP+8c`I6-x(G`Q0&&iWfngM?=)hu7FNM#VYLh?EYcZBnn|xM;l>Cvm2D4g*FCOAt#NqI7Vm83kNRuob%lCak(ZF2z$xXXAVbFrCV3O zEgk@5;Tp1V?MSjAw$D>UgeDV+?(c~1@2JTHI(O%091%HQ2LSbD0mpgz>;tfKE9eb$ z46`AN_aAQn{8kiY%jNPx*Y&4hFnAhbn&yX4C^WS!>ua~$ zC7$Q4)oS%=@2d)eVA-+j^*ZhM`%iVM1)SKW94$WS39=f z?>{oeh(8?sZnsNon)Wyt3{b6B!Eqc#B9Wf}e1>6&05F+M#6%+DvvW+-%txb9I6(9H z{9UtN@)s4bSDfHiGnUxJwbOp?aY>b;f^&k=Gn_+14=1a%^Dx}#y}LAhvGJ_O4_`}^ zCl_5TdnG=x_9>mLBV<74&>z|RN%1GUz&-ENU2$$ufw=W}FPhW&nj z_bkgYOaNdyog#UA13-`fXl5vo0)PMsH8?>M92OR=X&R73nx<&m*80`B5CT+ykQj~= z2E_z4pvGlxVu40*07#MqG{GlsgED7n0T|pCmf;vmc?-(PRD2%Dv*dI>beF= zR8E*HV_xe(Yq;3Tvh)JLOB@~eun@=2GU7{}KJn?g8V-wTtR@#QtQG*M>-zlw<6#DY zTn_{d=Syd7x7+AFsCx0~d7E=|)&(=>9q zTtq}fYi)i0&{~UnmZZ`8zK2o@RaM=+`x$k1Jfcp1zi}3eh1GZ5o2KcVFE;foIWaT; z4e9^Dywu6B1X(VZ!ELYCYq0+r1AfxqmctW_!(VFz$MCd;KREyZ002ovPDHLkV1nDK B8WaEk diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/spinbutton.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/spinbutton.png deleted file mode 100644 index 9e98bb0ca3c1ddf083456b96c21d4eed3dfb1414..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 523 zcmV+m0`&cfP)q;y@UMznKggk`$)M11R_c*1myTX#_#B$fI2pB%p=a#TT%%4Qy*?nIa}6 zBDlp}=jtZSvUcl%Fga)bIscpq8F=H3e}w=z91h>(I3B#xxZCai==b~I6hIuugI=$P zQi?{S@sbAn{eA$T?t*1mv|6pdHflDT00D}`@q9{U2srmi6 z8w(+D9H-JqClErg-EIkjKsO75fFwx(a9x)qNi@G}cQeOv0I+SFJkP5M48y?pebO}j z?5q@Nnxd2QL70(Y)*K0-V7jM^V~EA+w^t5w9x&iwy^#OXXy$3dqOvJ#QjYz!-P-P;pvxI@ z!v3_gD@)n5HkG?`-<_Ldyx;10*Rw|pF1_1wjf=rUb8oYY-0L@@cYov`dtVmiHM5_o qVHKZq+BSc!Tb`c3SExlX7BN2jrsk-2J2DSwC4;A{pUXO@geCy?_9RpZvTm^#6kq&{xb#t6&pb<#6r-*G6XffTCJ850}-*tz*ZmSa+yx2!-rg?lzMlo(6i5)MaSbYla^5wv0N^x)oR8? z-}k9hDydKr;cz&-S`YHdN@l`KOXpRHY zAw=$Tw1;8HYPF(PtNj4J0RIG_9LK?NoEV(7&S5s24b^HD;2rSC0+3P~z}akeq$mi2 zBa$RhyWK_zfn`~d`xWqDCBc!^>-DRZ9Lxr!l?3XU2SH$vC(qH|>2!=F0SpC=Mk80P zvoM(i)9EyJhGCc*D6OR3Zuc~S{&BO}%-u1kaG44wlS%AUN*USewLYgRRY9xOy14h# zF8-u~Bp`3_iwLgi{meViok}T`QjEuAq?GJ-J42Ce+eW}%uZIu$+z% z%%i~bJc`94zz5*BQKI2+Xk?tn27^Iri3Fg0-^cg;oBLk~f$O>y3Wd`OMx)VD7HM4- zy_h;lzu!+)W&v!s+n6Bv%U{|x%jMD__%@%=viv!uS8-fGufJeXs9`#Ix ewr;h!Wd8xnai*mBy>U?h0000 z0Qw&M9)|z`010qNS#tmY3labT3lag+-G2N4000McNliru)Bzt8G%I$H{#R~qZ@Ij@{0ayKP*oLc zYinFzU*nvk*=!=E#5ordCrN_$9_JiU6yd$cdylmit#v3yN=did<>KN3fM{m5)?%&2 z7z2Qml4i5X{rx?Adwbm6++d8M*XyCRW@l%IcDv2W$_mC9wAL&yFXNn>>m~@Klo(?W zLZG$Adrw)G^!t6z&dxYGIwH$5y!UKxZ)2?`&vUA(qN*yU(%*0 z2e}XeDJ9-}_V@P@LJ-IC+<)iXtK*mx#Bm&E{d4(Yw!as!ySp3Wx~@aww~j#tQxx&^ z^u+4wYN*s0!*DocYioDTS1h$Hzys*2Hm4S(bD< z9ZpV8h@uEWP)AZXHX)(_?^K`}x+youC+;`8p-}61cxDWnyaRB!0 z-ldI=;QwIgi<~b2kA&IyKJ6!8d{9oO7q( zJFj2Qwpt$$6w1ix7|(k8Sy)&IWudB+m6d@CEoYmkt*r^1i5LK^weYd$hox^Yb_!| zCX=DMx|)uT4!RS4xUL&S573iHaPZK6VzC@)QG&vfh?vltpP!?vtBZkw0ru6^kxu^z zVY+)>(A<22$;pZJ2~;(R+O8}s)a>2M?94Qyqa%DyCb@a*P6#(WJHxi^TbY`k0ZR0s zFnTM3Rh!dUrJ}Ne*47rX*(?(i6U5{35boP}3NLF&rKUDW;Md<*BGwX%#c*Ahs;Wv9 z4dE6Smswi!c-i}I0|Z7eVsQN_QB|x6p66kV$Cg;EDApK5Iz7EUfwjW&@)D{RYt<*P zenx^Z9>y3PoHf|q-hNWw|4<@pEuQD0e*J?CtRNym^TW?cPLjzlcwTOFOHPq7g7LD5 z7(ZGsXu61?)?!79ViP@mw6$F*oq^{Wo<5BebzP#-NVt&-s`*1C5?O<9I9$*1lSfJu zT)WavTieC_^ZwXXak`-{BaxYjA%H0WN@)!JL9H@x9=cHmMx?f4lH+ z72kKj6L9tl!Ufpx_hy2JFbwJSdRFGeVnL_Vsd2mAj&8S`0H1&j@S{xN=uSFLr<272 zq-kpLNs^Sicnv%Nj%&>{&}y|B`OC#VQ4uN4N=r|7h@yxzO>tef3KGXLN+~PRYPGWX z*=$w@x8UUqu+i`LujVI{i2w)S3-BKBUOb|I#oZIsG#HP^91aIO?-#vZuNe#m*2L|0 z%WycXi9Mgsq4_=CRD*?Zz#Fu8b<+ge(Kf$>AP6`fkJa6F9EZ(jgYWx@NEJXS zMI6WYzF&I>VHlRCgHbeZqQPi167s_M4fx148Yrb2`KD5#-#&fiHB6_|%FeQkD2iye z+ol`K<&q!>s-Pm$RE=wivv4?wjiA#W0&fw$x(R~JdR9*VpkoiRGv uE8wyCnz!Ij5=asJ2{_-qC*L5}^Y{sg+<>&kwGiJ6^Q?E4OoMn)!27srr_TW_ZYW*s)*X|wlSxS`!K z-l@DdE=B!jVcDeEl;s(mD%IRP*Am|*8WswzKkM~Lta)Qg%FSP2r6t4Uj1KEb#`}l; zKhL=Dz|!vr)IYE;NM61BzUk{-eTsYsoI|?qi26M@W||?ns%zz3;p!C$ZPxmCbBA$s_q-(zho&_jk>ifBt9aABKaU{-+<>&kwGQJzbWr`|ov5GXX$)5S5QV$R#i8@Ub}@VLBR;*;6F zX6`4+zyIq$rZp?rKj1sc;=Dn`>KcE`!DkcvUogzKT5(p`djVtC+SsRaZeKoqS#Kg6 z!-Sxw4u{ahw70)rzI5V~QrT_1h~He{X6Td)9bTFS#uHjrIX#(HIQ^p7UfaSW2ix9n zv$@b;!dh_W&l^=`_TB3LOxag2pKDn#({hHT#Y{_yPxmcQL70(Y)*K0-AbW|YuPggiW{RAM6v(? diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/vpaned.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/vpaned.png deleted file mode 100644 index 60628f46ef09ccf5d8e7dd9186624fd085746e29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 787 zcmV+u1MK{XP)HE7ZL&zqbp4W5&|*0b0Hx} z;>Sz4@(FkX6%w(DRG`pydgr6lUN?7eY^SvvImyXn=H7dL_kZp=a|O_xjHQ5@4Y0Sj zM}L3+e~GG;B9qAg3<4z^AeBn7zrPQFh_v-?#=|g-SZ4v>iqo4H%q?#mFKiy4UR+Cr z$7~QtS)GD!=YKG}^txqidU1`dZ@Ww_thT_LEfEj}2iVRRm|0qH2@bHev&+5tSBa?t zdI3uSU8z(kl}asguTL%WVf|@hz9(+a^YQIc%Xg&|!^6V>SAb7elEhAj+Ud*^=R^w1 z<#NXg>9&eo*Nw{bmx68r|4j+U&5kb)f`HA#yyBKq!=m-@@s@5e#L$42G-i${hh_`WacbQ<7lVxx%&>q|3S z$ewEnE+UOL&mJ_!b0c-2K0Y>DfA{=h9cYM1J(|;e$7s*<^ufV_E*6XW@bFL{9UbXX zsiberF6(l++^AG4b;ogP)oRsON-5WMottwj70>f3zVACh5U5(M=7nMCSF6<;Py;Rl z!(sp^rP}4bVRlv*kuY+zYed8nkscATMWn~`JZoTJ0AK?6Yy%Vu1=8s>T5G~Ej0e{S z)`$TD5viGXfS!1{E2RMXemmq2{iA^f5E|J&-~j<}-i+tXuelF6WnewPB_MB`%lQnD zF}ILyz;Q?fio0c=Q9oI+Zw^odTrt6Vfzt+NC#Z;nB9E(=m}{d}8Koy{KLNDAA3i8o RmSX?_002ovPDHLkV1lb7Sl<8u diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/vscale.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/vscale.png deleted file mode 100644 index dbdc71e8ab3c11f92ae9ae44b1f53b687a46aff8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^q9Dw{1|(OCFP#RY*pj^6T^Rm@;DWu&Cj&(|3p^r= z85p>QL70(Y)*K0-AbW|YuPggiW)E;81fxf;Bnor&Gzoa zVuNClbu7~1h0~pwRSs&r6jgip}|U57r%79UD>-jvq!M}pg0=k#M)78&qol`;+03i8g5dZ)H diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/vscrollbar.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/vscrollbar.png deleted file mode 100644 index 09f8008ab13cbc0bb8d8981771c502d25d33aec4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 362 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4%caKYZ?lYt_f1s;*b z3=G^tAk28_ZrvZCAbW|YuPgf%MtLp+tCT$-%7H@PJzX3_D&}0By0N##K)`i=_;g2B zkAzbSOFD8J+4OdaneE{6;k?bUh*jy0Pyv_tMyt$;Gj>L^TTe8t`1kva1W)H-4>QZ> zc8%|w-M6oMz3<=KLzdfRTZ{9oSO1;hG%fX@g!8=TM$=c%|YZ^Q>i+Ys$Z0Hko^EWtxD~0g2}Cad(sq85Zbx@A)1QI+g9g-s4fH zZO&&hT#I6OwM*=JN4pIV^Xpw%e_k-S2HHH0tLpkE^`2kgyh6(au?ySY2KyPMT)qG0 z`|+*0%gcEe%sHs1B^u7W<&i@E#jWpu|91ShY|+vVd2OR8J>j%v#=sz8@O1TaS?83{ F1OSE5l@kB} diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/vseparator.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/vseparator.png deleted file mode 100644 index 6904fc2220370649ceb389fa537c3f4cc9787819..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 327 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4%caKYZ?lYt_f1s;*b z3=G^tAk28_ZrvZCAbW|YuPgf%MtLz)jsJf7c|f5no-U3d6?5KRRrEU&AaLwsyu3=t z0x6b0ZG~?_wjAaMlr5RrSFFjcmF1l7FsaR#mFWmmlDN~nS+QLTFQ@m+n4bUazmb0B z;ri==7s3_ZKKvinWg_49a8>SY-^(V~Esme$v*J&XIlg<>x~Zv^-J+`!a!-`Zc{<%f zSSI|1*i5Y{fu9u{R4o2$DCCFz>4;?5e~BrAfm?y?$B9qhW1l={XZE>Va{2q-b+6xj z?78kCyYauuO}&|-dLKI2Z4!;y7i_qjAnNzA$@Ct}F_FJz`^${}?=7{an^LB{Ts5liq)V diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/widget.png b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/pixmaps/widget.png deleted file mode 100644 index 7f5844bbfc1b2fa32871ef69da808b67a152e149..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 337 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYYs>cdx@v7EBiGj839%iVe{O%K%sk{E{-7{$KOtM_+7Qe9I|Z$TLej>gLQKRJy*^e=S2 zaoBVI&A0pq54=`Q-yIqLu3N5%^^EfB38|8qvy@s2{4}5bo}-Y~s^`^HHn`48bt`x2tnm*#9c!5$a>`0EM1eB(3bxxyU(mPKVx2@+kg zy7t(NTbWT`3|3A*aIwsQS?qv_L@7f(1KW<9d?E&n$DYax3a}Qi7X@zex~98`fwAHF c`}a@8*Ppezr`kK$66jL~Pgg&ebxsLQ0OZ7xUTyI zHMK7c!`yoCjpw=p%$&^I-2xgwr3Cm12!XvmfeX}tY6;a$J8}S$ub0ff|5R`VtpGG& T8^-zz00000NkvXXu0mjf#e{z- diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionComponent.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionComponent.cs deleted file mode 100644 index d5db89c4af7..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionComponent.cs +++ /dev/null @@ -1,75 +0,0 @@ - -using System; - -namespace Stetic -{ - public class ActionComponent: Component - { - Gdk.Pixbuf icon; - string label; - - internal static Gdk.Pixbuf DefaultActionIcon; - - static ActionComponent () - { - try { - DefaultActionIcon = Gdk.Pixbuf.LoadFromResource ("action.png"); - } catch (Exception e) { - Console.WriteLine ("Error while loading pixbuf 'action.png': " + e); - } - } - - public ActionComponent (Application owner, object backend, string name): base (owner, backend, name, owner.GetComponentType ("Gtk.Action")) - { - } - - public override string Name { - get { - if (name == null) - name = ((Wrapper.Action)backend).Name; - return name; - } - set { - name = value; - ((Wrapper.Action)backend).Name = value; - } - } - - public string Label { - get { - if (label == null) - label = ((Wrapper.Action)backend).Label; - return label; - } - set { - label = value; - ((Wrapper.Action)backend).Label = value; - } - } - - protected override void OnChanged () - { - name = null; - icon = null; - label = null; - base.OnChanged (); - } - - public Gdk.Pixbuf Icon { - get { - if (icon == null) { - byte[] data = app.Backend.GetActionIcon ((Wrapper.Action)backend); - if (data == null) - return DefaultActionIcon; - else - icon = new Gdk.Pixbuf (data); - } - return icon; - } - } - - public ActionGroupComponent ActionGroup { - get { return (ActionGroupComponent) app.GetComponent (((Wrapper.Action)backend).ActionGroup, null, null); } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionGroupComponent.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionGroupComponent.cs deleted file mode 100644 index 1b2a871d268..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionGroupComponent.cs +++ /dev/null @@ -1,58 +0,0 @@ - -using System; -using System.Collections; -using System.Collections.Specialized; - -namespace Stetic -{ - [Serializable] - public class ActionGroupComponent: Component - { - public ActionGroupComponent (Application app, object backend, string name): base (app, backend, name, app.GetComponentType ("Gtk.ActionGroup")) - { - } - - public override string Name { - get { - if (name == null) - name = ((Wrapper.ActionGroup)backend).Name; - return name; - } - set { - name = value; - ((Wrapper.ActionGroup)backend).Name = value; - } - } - - public override bool GeneratePublic { - get { return ((Wrapper.ActionGroup)backend).GeneratePublic; } - set { ((Wrapper.ActionGroup)backend).GeneratePublic = value; } - } - - protected override void OnChanged () - { - name = null; - base.OnChanged (); - } - - public ActionComponent[] GetActions () - { - Wrapper.ActionCollection acts = ((Wrapper.ActionGroup)backend).Actions; - - ArrayList comps = new ArrayList (acts.Count); - - for (int n=0; n { if (!disposed) designer.NotifyBindField (); } - ); - } - - public void NotifyModified () - { - Gtk.Application.Invoke ( - (o, args) => { if (!disposed) designer.NotifyModified (); } - ); - } - - public void NotifySignalAdded (Wrapper.Action action, string name, Signal signal) - { - Gtk.Application.Invoke ( - (o, args) => { if (!disposed) designer.NotifySignalAdded (action, name, signal); } - ); - } - - public void NotifySignalChanged (Wrapper.Action action, string name, Signal oldSignal, Signal signal) - { - Gtk.Application.Invoke ( - (o, args) => { if (!disposed) designer.NotifySignalChanged (action, name, oldSignal, signal); } - ); - } - - public override object InitializeLifetimeService () - { - // Will be disconnected when calling Dispose - return null; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionGroupDesignerBackend.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionGroupDesignerBackend.cs deleted file mode 100644 index f5e562e12ab..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionGroupDesignerBackend.cs +++ /dev/null @@ -1,45 +0,0 @@ - -using System; - -namespace Stetic -{ - internal class ActionGroupDesignerBackend: Gtk.VBox - { - Editor.ActionGroupEditor editor; - ActionGroupToolbar toolbar; - WidgetDesignerBackend groupDesign; - - internal ActionGroupDesignerBackend (WidgetDesignerBackend groupDesign, Editor.ActionGroupEditor editor, ActionGroupToolbar toolbar) - { - this.editor = editor; - this.toolbar = toolbar; - this.groupDesign = groupDesign; - - BorderWidth = 3; - PackStart (toolbar, false, false, 0); - PackStart (groupDesign, true, true, 3); - } - - public Editor.ActionGroupEditor Editor { - get { return editor; } - } - - public ActionGroupToolbar Toolbar { - get { return toolbar; } - } - - public void UpdateObjectViewers () - { - groupDesign.UpdateObjectViewers (); - } - - public override void Dispose () - { - this.editor = null; - this.toolbar = null; - this.groupDesign = null; - base.Dispose (); - } - - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionGroupEditSession.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionGroupEditSession.cs deleted file mode 100644 index a3339120100..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionGroupEditSession.cs +++ /dev/null @@ -1,352 +0,0 @@ - -using System; -using System.Xml; -using System.Collections; - -namespace Stetic -{ - internal class ActionGroupEditSession: MarshalByRefObject, IDisposable - { - ActionGroupDesignerBackend designer; - Gtk.Plug plug; - ActionGroupDesignerFrontend frontend; - bool autoCommitChanges; - string groupToEdit; - string containerName; - ProjectBackend project; - bool modified; - bool allowActionBinding; - bool designerRequested; - ActionGroupToolbar groupToolbar; - - Stetic.Wrapper.ActionGroup groupCopy; - Stetic.Wrapper.ActionGroup group; - Hashtable actionCopyMap = new Hashtable (); - - UndoRedoManager undoManager; - UndoQueue undoQueue; - - public ActionGroupEditSession (ActionGroupDesignerFrontend frontend, ProjectBackend project, string containerName, string groupToEdit, bool autoCommitChanges) - { - this.groupToEdit = groupToEdit; - this.containerName = containerName; - this.frontend = frontend; - this.project = project; - this.autoCommitChanges = autoCommitChanges; - - if (groupToEdit != null) { - group = project.ActionGroups [groupToEdit]; - if (group == null) - throw new InvalidOperationException ("Unknown action group: " + groupToEdit); - Load (group); - undoManager = new UndoRedoManager (); - undoQueue = new UndoQueue (); - undoManager.UndoQueue = undoQueue; - undoManager.RootObject = groupCopy; - - groupToolbar = new ActionGroupToolbar (frontend, groupCopy); - } - else { - if (!autoCommitChanges) - throw new System.NotSupportedException (); - - Stetic.Wrapper.Container container = project.GetTopLevelWrapper (containerName, true); - groupToolbar = new ActionGroupToolbar (frontend, container.LocalActionGroups); - } - - // Don't delay the creation of the designer because when used in combination with the - // widget designer, change events are subscribed since the begining - - designer = UserInterface.CreateActionGroupDesigner (project, groupToolbar); - designer.Editor.GroupModified += OnModified; - designer.Toolbar.AllowActionBinding = allowActionBinding; - designer.Destroyed += delegate { designer = null; Dispose (); }; - } - - public Wrapper.ActionGroup EditedActionGroup { - get { return groupCopy; } - } - - void Load (Stetic.Wrapper.ActionGroup group) - { - if (autoCommitChanges) { - groupCopy = group; - } - else { - actionCopyMap.Clear (); - - groupCopy = new Stetic.Wrapper.ActionGroup (); - groupCopy.Name = group.Name; - - foreach (Stetic.Wrapper.Action action in group.Actions) { - Stetic.Wrapper.Action dupaction = action.Clone (); - groupCopy.Actions.Add (dupaction); - actionCopyMap [dupaction] = action; - } - groupCopy.SignalAdded += new Stetic.SignalEventHandler (OnSignalAdded); - groupCopy.SignalChanged += new Stetic.SignalChangedEventHandler (OnSignalChanged); - } - } - - public void Save () - { - if (autoCommitChanges) - return; - - if (group.Name != groupCopy.Name) - group.Name = groupCopy.Name; - - foreach (Stetic.Wrapper.Action actionCopy in groupCopy.Actions) { - Stetic.Wrapper.Action action = (Stetic.Wrapper.Action) actionCopyMap [actionCopy]; - if (action != null) - action.CopyFrom (actionCopy); - else { - action = actionCopy.Clone (); - actionCopyMap [actionCopy] = action; - group.Actions.Add (action); - } - } - - ArrayList todelete = new ArrayList (); - foreach (Stetic.Wrapper.Action actionCopy in actionCopyMap.Keys) { - if (!groupCopy.Actions.Contains (actionCopy)) - todelete.Add (actionCopy); - } - - foreach (Stetic.Wrapper.Action actionCopy in todelete) { - Stetic.Wrapper.Action action = (Stetic.Wrapper.Action) actionCopyMap [actionCopy]; - group.Actions.Remove (action); - actionCopyMap.Remove (actionCopy); - } - Modified = false; - } - - public UndoQueue UndoQueue { - get { - if (undoQueue != null) - return undoQueue; - else - return UndoQueue.Empty; - } - } - - public void CopySelection () - { - if (designer != null) - designer.Editor.Copy (); - } - - public void CutSelection () - { - if (designer != null) - designer.Editor.Cut (); - } - - public void PasteToSelection () - { - if (designer != null) - designer.Editor.Paste (); - } - - public void DeleteSelection () - { - if (designer != null) - designer.Editor.Delete (); - } - - void OnProjectReloaded (object s, EventArgs a) - { - // Called when the underlying project has changed. Object references need to be updated. - if (autoCommitChanges) { - if (designer != null) { - if (groupToEdit != null) { - groupToolbar.ActiveGroup = project.ActionGroups [groupToEdit]; - } else { - Stetic.Wrapper.Container container = project.GetTopLevelWrapper (containerName, true); - groupToolbar.ActionGroups = container.LocalActionGroups; - } - } - } else { - // We only need to remap the actions - group = project.ActionGroups [groupToEdit]; - actionCopyMap.Clear (); - foreach (Wrapper.Action dupac in groupCopy.Actions) { - Wrapper.Action ac = group.GetAction (dupac.Name); - if (ac != null) - actionCopyMap [dupac] = ac; - } - } - } - - void OnModified (object ob, EventArgs args) - { - modified = true; - frontend.NotifyModified (); - } - - public bool HasData { - get { - if (groupToEdit != null) - return true; - Stetic.Wrapper.Container container = project.GetTopLevelWrapper (containerName, true); - return container.LocalActionGroups.Count > 0; - } - } - - public bool Modified { - get { return modified; } - set { modified = value; frontend.NotifyModified (); } - } - - public string ActiveGroup { - get { - if (designer != null) { - Wrapper.ActionGroup grp = designer.Toolbar.ActiveGroup; - if (grp != null) - return grp.Name; - } - return null; - } - set { - if (value != null || designer != null) { - // No need to create the designer if the active group is being set to null. - Wrapper.ActionGroup grp = Backend.Toolbar.ActionGroups [value]; - Backend.Toolbar.ActiveGroup = grp; - } - } - } - - public void SetSelectedAction (Wrapper.Action action) - { - // No need to create the designer if the active action is being set to null. - if (action != null || designer != null) - Backend.Editor.SelectedAction = action; - } - - public void GetSelectedAction (out Wrapper.Action action, out string name) - { - if (designer != null) { - action = designer.Editor.SelectedAction; - if (action != null) - name = action.Name; - else - name = null; - } else { - action = null; - name = null; - } - } - - public ActionGroupDesignerBackend Backend { - get { - designerRequested = true; - return designer; - } - } - - [NoGuiDispatch] - public void CreateBackendWidgetPlug (uint socketId) - { - Gdk.Threads.Enter (); - plug = new Gtk.Plug (socketId); - plug.Add (Backend); - plug.Decorated = false; - plug.ShowAll (); - Gdk.Threads.Leave (); - } - - public void DestroyBackendWidgetPlug () - { - if (designer != null) { - Gtk.Plug plug = (Gtk.Plug) designer.Parent; - plug.Remove (designer); - plug.Destroy (); - } - } - - public bool AllowActionBinding { - get { - return allowActionBinding; - } - set { - allowActionBinding = value; - if (designer != null) - designer.Toolbar.AllowActionBinding = value; - } - } - - public void Dispose () - { - if (designer != null) { - designer.Editor.GroupModified -= OnModified; - if (!designerRequested) - designer.Destroy (); - } - - project.ProjectReloaded -= OnProjectReloaded; - - if (plug != null) { - plug.Destroy (); - plug = null; - } - - System.Runtime.Remoting.RemotingServices.Disconnect (this); - } - - public override object InitializeLifetimeService () - { - // Will be disconnected when calling Dispose - return null; - } - - public object[] SaveState () - { - if (autoCommitChanges) - return null; - - XmlDocument doc = new XmlDocument (); - doc.AppendChild (groupCopy.Write (new ObjectWriter (doc, FileFormat.Native))); - - Hashtable nameMap = new Hashtable (); - foreach (DictionaryEntry e in actionCopyMap) - nameMap [((Wrapper.Action)e.Key).Name] = ((Wrapper.Action)e.Value).Name; - - return new object[] { groupCopy.Name, nameMap, doc.OuterXml }; - } - - public void RestoreState (object[] data) - { - if (data == null) - return; - - groupCopy = new Stetic.Wrapper.ActionGroup (); - groupCopy.Name = (string) data [0]; - - XmlDocument doc = new XmlDocument (); - doc.LoadXml ((string) data [2]); - - // Create the map which links edited action with source actions - actionCopyMap.Clear (); - foreach (DictionaryEntry e in (Hashtable) data [1]) { - Wrapper.Action dupaction = groupCopy.GetAction ((string)e.Key); - Wrapper.Action action = group.GetAction ((string)e.Value); - actionCopyMap [dupaction] = action; - } - - groupCopy.SignalAdded += new Stetic.SignalEventHandler (OnSignalAdded); - groupCopy.SignalChanged += new Stetic.SignalChangedEventHandler (OnSignalChanged); - } - - void OnSignalAdded (object s, Stetic.SignalEventArgs a) - { - Wrapper.Action action = (Wrapper.Action) a.Wrapper; - frontend.NotifySignalAdded (action, action.Name, a.Signal); - } - - void OnSignalChanged (object s, Stetic.SignalChangedEventArgs a) - { - Wrapper.Action action = (Wrapper.Action) a.Wrapper; - frontend.NotifySignalChanged (action, action.Name, a.OldSignal, a.Signal); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionGroupToolbar.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionGroupToolbar.cs deleted file mode 100644 index c41601509ca..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ActionGroupToolbar.cs +++ /dev/null @@ -1,275 +0,0 @@ - -using System; -using System.Collections; -using Stetic.Wrapper; -using Mono.Unix; - -namespace Stetic -{ - internal class ActionGroupToolbar: Gtk.Toolbar - { - Wrapper.ActionGroupCollection actionGroups; - Gtk.ComboBox combo; - bool updating; - ActionGroup currentGroup; - ArrayList internalButtons = new ArrayList (); - bool singleGroupMode; - bool allowBinding; - ActionGroupDesignerFrontend frontend; - Editor.ActionGroupEditor agroupEditor; - Gtk.ToolButton addButton; - Gtk.ToolButton removeButton; - - public event ActionGroupEventHandler ActiveGroupChanged; - public event ActionGroupEventHandler ActiveGroupCreated; - - public ActionGroupToolbar (ActionGroupDesignerFrontend frontend, bool singleGroupMode) - { - Initialize (frontend, null, singleGroupMode); - } - - public ActionGroupToolbar (ActionGroupDesignerFrontend frontend, Wrapper.ActionGroup actionGroup) - { - currentGroup = actionGroup; - Initialize (frontend, null, true); - } - - public ActionGroupToolbar (ActionGroupDesignerFrontend frontend, Wrapper.ActionGroupCollection actionGroups) - { - Initialize (frontend, actionGroups, false); - } - - public bool AllowActionBinding { - get { return allowBinding; } - set { allowBinding = value; } - } - - void Initialize (ActionGroupDesignerFrontend frontend, Wrapper.ActionGroupCollection actionGroups, bool singleGroupMode) - { - this.frontend = frontend; - this.singleGroupMode = singleGroupMode; - IconSize = Gtk.IconSize.SmallToolbar; - Orientation = Gtk.Orientation.Horizontal; - ToolbarStyle = Gtk.ToolbarStyle.BothHoriz; - - combo = Gtk.ComboBox.NewText (); - - if (!singleGroupMode) { - combo.Changed += OnActiveChanged; - - Gtk.ToolItem comboItem = new Gtk.ToolItem (); - Gtk.HBox cbox = new Gtk.HBox (); - cbox.PackStart (new Gtk.Label (Catalog.GetString ("Action Group:") + " "), false, false, 3); - cbox.PackStart (combo, true, true, 3); - comboItem.Add (cbox); - comboItem.ShowAll (); - Insert (comboItem, -1); - internalButtons.Add (comboItem); - - addButton = new Gtk.ToolButton (Gtk.Stock.Add); - addButton.Clicked += OnAddGroup; - Insert (addButton, -1); - internalButtons.Add (addButton); - - removeButton = new Gtk.ToolButton (Gtk.Stock.Remove); - removeButton.Clicked += OnRemoveGroup; - Insert (removeButton, -1); - internalButtons.Add (removeButton); - - ActionGroups = actionGroups; - - if (actionGroups != null && actionGroups.Count > 0) - combo.Active = 0; - } else { - UpdateActionCommands (null); - } - - ShowAll (); - } - - public override void Dispose () - { - if (combo == null) - return; - - combo.Changed -= OnActiveChanged; - combo = null; - if (addButton != null) { - addButton.Clicked -= OnAddGroup; - removeButton.Clicked -= OnRemoveGroup; - } - - if (agroupEditor != null) { - agroupEditor.SelectionChanged -= OnEditorSelectionChanged; - agroupEditor = null; - } - - if (!singleGroupMode) - ActionGroups = null; - base.Dispose (); - } - - public Wrapper.ActionGroupCollection ActionGroups { - get { return actionGroups; } - set { - if (singleGroupMode) - throw new InvalidOperationException ("ActionGroups can't be set in single group mode"); - - if (actionGroups != null) { - actionGroups.ActionGroupAdded -= OnCollectionChanged; - actionGroups.ActionGroupRemoved -= OnCollectionChanged; - actionGroups.ActionGroupChanged -= OnCollectionChanged; - } - - this.actionGroups = value; - - if (actionGroups != null) { - actionGroups.ActionGroupAdded += OnCollectionChanged; - actionGroups.ActionGroupRemoved += OnCollectionChanged; - actionGroups.ActionGroupChanged += OnCollectionChanged; - } - Refresh (); - } - } - - public void Bind (Editor.ActionGroupEditor agroupEditor) - { - this.agroupEditor = agroupEditor; - agroupEditor.SelectionChanged += OnEditorSelectionChanged; - agroupEditor.ActionGroup = ActiveGroup; - } - - public void OnEditorSelectionChanged (object s, EventArgs a) - { - UpdateActionCommands (agroupEditor.SelectedAction); - } - - public ActionGroup ActiveGroup { - get { - return currentGroup; - } - set { - if (singleGroupMode) { - currentGroup = value; - UpdateActionCommands (null); - NotifyActiveGroupChanged (); - } else { - int i = actionGroups.IndexOf (value); - if (i != -1) - combo.Active = i; - } - } - } - - void Refresh () - { - if (singleGroupMode || combo == null) - return; - - while (combo.Model.IterNChildren () > 0) - combo.RemoveText (0); - if (actionGroups != null) { - foreach (ActionGroup group in actionGroups) - combo.AppendText (group.Name); - } - } - - void OnCollectionChanged (object s, ActionGroupEventArgs args) - { - // Avoid firing the selection change event if the selected - // group is the same after the refresh - ActionGroup oldGroup = currentGroup; - updating = true; - - int i = combo.Active; - Refresh (); - if (actionGroups.Count == 0) { - combo.Sensitive = false; - currentGroup = null; - } - else { - combo.Sensitive = true; - if (i == -1) - i = 0; - if (i < actionGroups.Count) - combo.Active = i; - else - combo.Active = actionGroups.Count - 1; - currentGroup = (ActionGroup) actionGroups [combo.Active]; - } - updating = false; - if (currentGroup != oldGroup) - OnActiveChanged (null, null); - frontend.NotifyModified (); - } - - void OnAddGroup (object s, EventArgs args) - { - ActionGroup group = new ActionGroup (); - group.Name = Catalog.GetString ("New Action Group"); - actionGroups.Add (group); - combo.Active = actionGroups.Count - 1; - if (ActiveGroupCreated != null) - ActiveGroupCreated (this, new ActionGroupEventArgs (ActiveGroup)); - - if (agroupEditor != null) - agroupEditor.StartEditing (); - } - - void OnRemoveGroup (object s, EventArgs args) - { - if (combo.Active != -1) - actionGroups.RemoveAt (combo.Active); - } - - void OnActiveChanged (object s, EventArgs args) - { - if (!updating) { - UpdateActionCommands (null); - if (combo.Active != -1) - currentGroup = (ActionGroup) actionGroups [combo.Active]; - else - currentGroup = null; - NotifyActiveGroupChanged (); - } - } - - void NotifyActiveGroupChanged () - { - if (agroupEditor != null) - agroupEditor.ActionGroup = ActiveGroup; - if (ActiveGroupChanged != null) - ActiveGroupChanged (this, new ActionGroupEventArgs (ActiveGroup)); - } - - void UpdateActionCommands (Wrapper.Action action) - { - foreach (Gtk.Widget w in Children) { - if (!internalButtons.Contains (w)) { - Remove (w); - w.Destroy (); - } - } - AddActionCommands (action); - - if (internalButtons.Count > 0 && internalButtons.Count != Children.Length) { - Insert (new Gtk.SeparatorToolItem (), internalButtons.Count); - } - ShowAll (); - } - - protected virtual void AddActionCommands (Wrapper.Action action) - { - if (allowBinding) { - Gtk.ToolButton bindButton = new Gtk.ToolButton (null, Catalog.GetString ("Bind to Field")); - bindButton.IsImportant = true; - bindButton.Show (); - Insert (bindButton, -1); - if (action == null) - bindButton.Sensitive = false; - - bindButton.Clicked += delegate { frontend.NotifyBindField (); }; - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Application.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Application.cs deleted file mode 100644 index b8ee8d274a6..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Application.cs +++ /dev/null @@ -1,587 +0,0 @@ - -using System; -using System.Threading; -using System.Collections; -using System.CodeDom; -using System.CodeDom.Compiler; -using System.IO; -using System.Xml; -using System.Runtime.Serialization.Formatters.Binary; -using System.Runtime.Remoting; -using System.Runtime.Remoting.Channels; -using System.Runtime.Remoting.Channels.Tcp; -using System.Diagnostics; -using Mono.Remoting.Channels.Unix; -using Mono.Cecil; - -namespace Stetic -{ - public enum IsolationMode - { - None, - ProcessTcp, - ProcessUnix - } - - public delegate string AssemblyResolverCallback (string assemblyName); - - public static class ApplicationFactory { - - public static Application CreateApplication (IsolationMode mode) - { - switch (mode) { - case IsolationMode.None: - return new LocalApplication (); - case IsolationMode.ProcessTcp: - case IsolationMode.ProcessUnix: - return new IsolatedApplication (mode); - default: - throw new ArgumentException ("mode"); - } - } - } - - internal class IsolatedApplication : Application { - - string channelId; - ApplicationBackendController backendController; - - string RegisterRemotingChannel (IsolationMode mode) - { - string remotingChannel; - if (mode == IsolationMode.ProcessTcp) { - remotingChannel = "tcp"; - IChannel ch = ChannelServices.GetChannel ("tcp"); - if (ch == null) { - ChannelServices.RegisterChannel (new TcpChannel (0), false); - } - } else { - remotingChannel = "unix"; - IChannel ch = ChannelServices.GetChannel ("unix"); - if (ch == null) { - string unixRemotingFile = Path.GetTempFileName (); - ChannelServices.RegisterChannel (new UnixChannel (unixRemotingFile), false); - } - } - return remotingChannel; - } - - public IsolatedApplication (IsolationMode mode) - { - if (mode == IsolationMode.None) - throw new ArgumentException ("mode"); - channelId = RegisterRemotingChannel (mode); - backendController = new ApplicationBackendController (this, channelId); - backendController.StartBackend (); - OnBackendChanged (false); - } - - public override void Dispose () - { - base.Dispose (); - backendController.StopBackend (true); - } - - public event BackendChangingHandler BackendChanging; - public event BackendChangedHandler BackendChanged; - - void OnNewBackendStarted (object ob, EventArgs args) - { - OnBackendChanging (); - ApplicationBackendController oldBackend = backendController; - backendController = (ApplicationBackendController) ob; - OnBackendChanged (true); - oldBackend.StopBackend (false); - } - - void OnBackendStopped (object ob, EventArgs args) - { - // The backend process crashed, try to restart it - Backend = null; - backendController = new ApplicationBackendController (this, channelId); - backendController.StartBackend (); - OnBackendChanged (true); - } - - void OnBackendChanged (bool notify) - { - ApplicationBackend oldBackend = Backend; - - Backend = backendController.Backend; - backendController.Stopped += OnBackendStopped; - UpdateWidgetLibraries (false, false); - ClearCollections (); - if (notify && BackendChanged != null) - BackendChanged (oldBackend); - - Backend.ActiveProject = ActiveProject != null ? ActiveProject.ProjectBackend : null; - } - - void OnBackendChanging () - { - Backend.GlobalWidgetLibraries = widgetLibraries; - if (BackendChanging != null) - BackendChanging (); - } - - internal override void RestartBackend () - { - // The backend process needs to be restarted. - // This is done in background. - - ThreadPool.QueueUserWorkItem (delegate { - try { - // Start the new backend - ApplicationBackendController newController = new ApplicationBackendController (this, channelId); - newController.StartBackend (); - Gtk.Application.Invoke (newController, EventArgs.Empty, OnNewBackendStarted); - } catch { - // FIXME: show an error message - } - }); - } - - internal override ComponentType CreateComponentType (string typeName) - { - string desc = null, className = null, category = null, targetGtkVersion = null, library = null; - Gdk.Pixbuf px = null; - - byte[] icon; - - if (Backend.GetClassDescriptorInfo (typeName, out desc, out className, out category, out targetGtkVersion, out library, out icon) && icon != null) - px = new Gdk.Pixbuf (icon); - - if (px == null) - px = ComponentType.Unknown.Icon; - - if (desc == null) - desc = typeName; - - return new ComponentType (this, typeName, desc, className, category, targetGtkVersion, library, px); - } - } - - internal class LocalApplication : Application { - - public LocalApplication () - { - Backend = new ApplicationBackend (this); - } - - public override void Dispose () - { - base.Dispose (); - Backend.Dispose (); - } - - internal override ComponentType CreateComponentType (string typeName) - { - ClassDescriptor cls = Registry.LookupClassByName (typeName); - if (cls == null) - return null; - - return new ComponentType (this, typeName, cls.Label, cls.WrappedTypeName, cls.Category, cls.TargetGtkVersion, cls.Library.Name, cls.Icon); - } - } - - public abstract class Application : MarshalByRefObject, IDisposable { - - ApplicationBackend backend; - - Hashtable components = new Hashtable (); - Hashtable types = new Hashtable (); - internal ArrayList widgetLibraries = new ArrayList (); - ArrayList projects = new ArrayList (); - Project activeProject; - Designer activeDesigner; - - WidgetPropertyTree propertiesWidget; - Palette paletteWidget; - WidgetTree projectWidget; - SignalsEditor signalsWidget; - bool allowInProcLibraries = true; - bool disposed; - - public AssemblyResolverCallback WidgetLibraryResolver { - get { return Backend.WidgetLibraryResolver; } - set { Backend.WidgetLibraryResolver = value; } - } - - public MimeResolverDelegate MimeResolver { - set { Backend.MimeResolver = value; } - } - - public Editor.ShowUrlDelegate ShowUrl { - set { Backend.ShowUrl = value; } - } - - public bool ShowNonContainerWarning { - get { return Backend.ShowNonContainerWarning; } - set { Backend.ShowNonContainerWarning = value; } - } - - // Loads the libraries registered in the projects or in the application. - // It will reload the libraries if they have changed. Libraries won't be - // unloaded unless forceUnload is set to true - public void UpdateWidgetLibraries (bool forceUnload) - { - UpdateWidgetLibraries (true, forceUnload); - } - - internal virtual void RestartBackend () - { - } - - protected void ClearCollections () - { - lock (types) { - types.Clear (); - } - - Component[] comps; - lock (components) { - // All components should have been cleared by the backend, - // just make sure it did - comps = new Component [components.Count]; - components.Values.CopyTo (comps, 0); - components.Clear (); - } - - foreach (Component c in comps) { - c.Dispose (); - } - } - - internal void UpdateWidgetLibraries (bool allowBackendRestart, bool forceUnload) - { - // Collect libraries from the project and from the application - - ArrayList assemblies = new ArrayList (); - assemblies.AddRange (widgetLibraries); - - ArrayList projectBackends = new ArrayList (); - foreach (Project p in projects) - if (p.IsBackendLoaded) - projectBackends.Add (p.ProjectBackend); - - if (!Backend.UpdateLibraries (assemblies, projectBackends, allowBackendRestart, forceUnload)) - RestartBackend (); - } - - public virtual void Dispose () - { - if (disposed) - return; - - disposed = true; - ClearCollections (); - ArrayList copy = (ArrayList) projects.Clone (); - foreach (Project p in copy) - p.Dispose (); - if (propertiesWidget != null) - propertiesWidget.Destroy (); - if (paletteWidget != null) - paletteWidget.Destroy (); - if (projectWidget != null) - projectWidget.Destroy (); - if (signalsWidget != null) - signalsWidget.Destroy (); - widgetLibraries.Clear (); - System.Runtime.Remoting.RemotingServices.Disconnect (this); - } - - public override object InitializeLifetimeService () - { - // Will be disconnected when calling Dispose - return null; - } - - internal ApplicationBackend Backend { - get { return backend; } - set { backend = value; } - } - - void ProjectDisposed (object sender, EventArgs args) - { - projects.Remove (sender as Project); - if (!disposed) - UpdateWidgetLibraries (false, false); - } - - public Project LoadProject (string path) - { - Project p = new Project (this); - p.Load (path); - projects.Add (p); - p.Disposed += ProjectDisposed; - return p; - } - - public Project CreateProject () - { - Project p = new Project (this); - projects.Add (p); - p.Disposed += ProjectDisposed; - return p; - } - - public ComponentType[] GetComponentTypes (string fileName) - { - if (IsWidgetLibrary (fileName)) - return CecilWidgetLibrary.GetComponentTypes (this, fileName).ToArray (); - else - return new ComponentType [0]; - } - - public void AddWidgetLibrary (string assemblyPath) - { - if (!widgetLibraries.Contains (assemblyPath)) { - widgetLibraries.Add (assemblyPath); - Backend.GlobalWidgetLibraries = widgetLibraries; - UpdateWidgetLibraries (false, false); - } - } - - public void RemoveWidgetLibrary (string assemblyPath) - { - widgetLibraries.Remove (assemblyPath); - Backend.GlobalWidgetLibraries = widgetLibraries; - UpdateWidgetLibraries (false, false); - } - - public string[] GetWidgetLibraries () - { - return (string[]) widgetLibraries.ToArray (typeof(string)); - } - - public bool IsWidgetLibrary (string assemblyRef) - { - AssemblyResolver resolver = new AssemblyResolver (Backend); - return InternalIsWidgetLibrary (resolver, assemblyRef); - } - - internal static bool InternalIsWidgetLibrary (AssemblyResolver resolver, string assemblyRef) - { - string path; - - if (assemblyRef.EndsWith (".dll") || assemblyRef.EndsWith (".exe")) { - if (!File.Exists (assemblyRef)) - return false; - path = assemblyRef; - } - else { - path = resolver.Resolve (assemblyRef, null); - if (path == null) - return false; - } - - return CecilWidgetLibrary.IsWidgetLibrary (path); - } - - public CodeGenerationResult GenerateProjectCode (string file, string namespaceName, CodeDomProvider provider, GenerationOptions options, params Project[] projects) - { - ArrayList files = new ArrayList (); - CodeGenerationResult res = GenerateProjectCode (options, projects); - - string basePath = Path.GetDirectoryName (file); - string ext = Path.GetExtension (file); - - foreach (SteticCompilationUnit unit in res.Units) { - string fname; - if (unit.Name.Length == 0) { - if (provider is Microsoft.CSharp.CSharpCodeProvider && unit.Namespaces.Count > 0) { - var types = unit.Namespaces [0].Types; - if (types.Count > 0) { - types [0].Members.Insert (0, new CodeSnippetTypeMember ("#pragma warning disable 436")); - } - } - fname = file; - } else - fname = Path.Combine (basePath, unit.Name) + ext; - files.Add (fname); - unit.Name = fname; - StreamWriter fileStream = new StreamWriter (fname); - try { - provider.GenerateCodeFromCompileUnit (unit, fileStream, new CodeGeneratorOptions ()); - } finally { - fileStream.Close (); - } - } - return res; - } - - public CodeGenerationResult GenerateProjectCode (GenerationOptions options, params Project[] projects) - { - ProjectBackend[] pbs = new ProjectBackend [projects.Length]; - for (int n=0; n 0) ? desc : className - ); - } - else { - ClassDescriptor cls = Registry.LookupClassByName (className); - DND.Drag (source, ctx, cls.NewInstance (project) as Gtk.Widget); - } - } - - public string ResolveAssembly (string assemblyName) - { - if (widgetLibraryResolver != null) - return widgetLibraryResolver (assemblyName); - else - return null; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ApplicationBackendController.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/ApplicationBackendController.cs deleted file mode 100644 index 5fdbbea4d56..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ApplicationBackendController.cs +++ /dev/null @@ -1,105 +0,0 @@ - -using System; -using System.IO; -using System.Diagnostics; -using System.Threading; -using System.Runtime.Serialization.Formatters.Binary; -using System.Runtime.Remoting; -using System.Runtime.Remoting.Channels; -using System.Runtime.Remoting.Channels.Tcp; - -namespace Stetic -{ - internal class ApplicationBackendController: MarshalByRefObject - { - bool stopping; - ApplicationBackend backend; - string channelId; - IsolatedApplication app; - - ManualResetEvent runningEvent = new ManualResetEvent (false); - - public event EventHandler Stopped; - - public ApplicationBackendController (IsolatedApplication app, string channelId) - { - this.app = app; - this.channelId = channelId; - } - - public ApplicationBackend Backend { - get { return backend; } - } - - public Application Application { - get { return app; } - } - - public void StartBackend () - { - runningEvent.Reset (); - - string asm = GetType().Assembly.Location; - - BinaryFormatter bf = new BinaryFormatter (); - ObjRef oref = RemotingServices.Marshal (this); - MemoryStream ms = new MemoryStream (); - bf.Serialize (ms, oref); - string sref = Convert.ToBase64String (ms.ToArray ()); - - Process process = new Process (); - process.StartInfo = new ProcessStartInfo ("sh", "-c \"mono --debug " + asm + "\""); - process.StartInfo.WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory; - process.StartInfo.UseShellExecute = false; - process.StartInfo.RedirectStandardInput = true; - process.EnableRaisingEvents = true; - process.Start (); - process.StandardInput.WriteLine (channelId); - process.StandardInput.WriteLine (sref); - process.StandardInput.Flush (); - process.Exited += OnExited; - - if (!runningEvent.WaitOne (10000, false)) - throw new ApplicationException ("Couldn't create a remote process."); - } - - public void StopBackend (bool waitUntilDone) - { - stopping = true; - runningEvent.Reset (); - backend.Dispose (); - if (waitUntilDone) - runningEvent.WaitOne (9000, false); - } - - void OnExited (object o, EventArgs args) - { - Gtk.Application.Invoke (OnExitedInGui); - } - - void OnExitedInGui (object o, EventArgs args) - { - if (!stopping && Stopped != null) - Stopped (this, EventArgs.Empty); - System.Runtime.Remoting.RemotingServices.Disconnect (this); - } - - internal void Connect (ApplicationBackend backend) - { - this.backend = backend; - runningEvent.Set (); - } - - internal void Disconnect (ApplicationBackend backend) - { - this.backend = null; - runningEvent.Set (); - } - - public override object InitializeLifetimeService () - { - // Will be disconnected when calling Dispose - return null; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/AssemblyResolver.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/AssemblyResolver.cs deleted file mode 100644 index d2bfbdbcc86..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/AssemblyResolver.cs +++ /dev/null @@ -1,242 +0,0 @@ -// -// BaseAssemblyResolver.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -// This code is a modified version of the assembly resolver implemented in Cecil. -// Keep in synch as much as possible. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.IO; -using System.Text; -using Mono.Cecil; - -namespace Stetic { - - internal class AssemblyResolver : BaseAssemblyResolver { - - Dictionary _assemblies; - ApplicationBackend app; - - public IDictionary AssemblyCache { - get { return _assemblies; } - } - - public AssemblyResolver (ApplicationBackend app) - { - this.app = app; - _assemblies = new Dictionary (); - } - - public StringCollection Directories = new StringCollection (); - - public override AssemblyDefinition Resolve (AssemblyNameReference name) - { - return Resolve (name, (string)null); - } - - public AssemblyDefinition Resolve (AssemblyNameReference name, string basePath) - { - if (!_assemblies.TryGetValue (name.FullName, out var asm)) { - if (app != null) { - string ares = app.ResolveAssembly (name.Name); - if (ares != null) { - asm = AssemblyDefinition.ReadAssembly (ares, new ReaderParameters { AssemblyResolver = this }); - _assemblies [name.FullName] = asm; - return asm; - } - } - string file = Resolve (name.FullName, basePath); - if (file != null) - asm = AssemblyDefinition.ReadAssembly (file, new ReaderParameters { AssemblyResolver = this }); - else - asm = base.Resolve (name); - _assemblies [name.FullName] = asm; - } - - return asm; - } - - public void ClearCache () - { - foreach (AssemblyDefinition asm in _assemblies.Values) { - asm.Dispose (); - } - _assemblies.Clear (); - } - - public TypeDefinition Resolve (TypeReference type) - { - if (type is TypeDefinition) - return (TypeDefinition) type; - - AssemblyNameReference reference = type.Scope as AssemblyNameReference; - if (reference != null) { - AssemblyDefinition assembly = Resolve (reference); - return assembly.MainModule.GetType (type.FullName); - } - - ModuleDefinition module = type.Scope as ModuleDefinition; - if (module != null) - return module.GetType (type.FullName); - - throw new NotImplementedException (); - } - - public string Resolve (string assemblyName, string basePath) - { - if (Path.IsPathRooted (assemblyName) && (assemblyName.EndsWith (".dll") || assemblyName.EndsWith (".exe"))) - return Path.GetFullPath (assemblyName); - - if (app != null) { - string ares = app.ResolveAssembly (assemblyName); - if (ares != null) - return Path.GetFullPath (ares); - } - - StringCollection col = new StringCollection (); - col.Add (basePath); - foreach (string s in Directories) - col.Add (s); - - try { - return Resolve (AssemblyNameReference.Parse (assemblyName), col); - } catch { - } - return null; - } - - public string Resolve (AssemblyNameReference name, StringCollection basePaths) - { - string [] exts = new string [] { ".dll", ".exe" }; - - if (basePaths != null) { - foreach (string dir in basePaths) { - foreach (string ext in exts) { - string file = Path.Combine (dir, name.Name + ext); - if (File.Exists (file)) - return file; - } - } - } - - if (name.Name == "mscorlib") - return GetCorlib (name); - - string asm = GetAssemblyInGac (name); - if (asm != null) - return Path.GetFullPath (asm); - - throw new FileNotFoundException ("Could not resolve: " + name); - } - - string GetCorlib (AssemblyNameReference reference) - { - if (typeof (object).Assembly.GetName ().Version == reference.Version) - return typeof (object).Assembly.Location; - - string path = Directory.GetParent ( - Directory.GetParent ( - typeof (object).Module.FullyQualifiedName).FullName - ).FullName; - - if (OnMono ()) { - if (reference.Version.Major == 1) - path = Path.Combine (path, "1.0"); - else if (reference.Version.Major == 2) - path = Path.Combine (path, "2.0"); - else - throw new NotSupportedException ("Version not supported: " + reference.Version); - } else { - if (reference.Version.ToString () == "1.0.3300.0") - path = Path.Combine (path, "v1.0.3705"); - else if (reference.Version.ToString () == "1.0.5000.0") - path = Path.Combine (path, "v1.1.4322"); - else if (reference.Version.ToString () == "2.0.0.0") - path = Path.Combine (path, "v2.0.50727"); - else - throw new NotSupportedException ("Version not supported: " + reference.Version); - } - - return Path.GetFullPath (Path.Combine (path, "mscorlib.dll")); - } - - static string GetAssemblyInGac (AssemblyNameReference reference) - { - if (reference.PublicKeyToken == null || reference.PublicKeyToken.Length == 0) - return null; - - string currentGac = GetCurrentGacPath (); - if (OnMono ()) { - string s = GetAssemblyFile (reference, currentGac); - if (File.Exists (s)) - return s; - } else { - string [] gacs = new string [] {"GAC_MSIL", "GAC_32", "GAC"}; - for (int i = 0; i < gacs.Length; i++) { - string gac = Path.Combine (Directory.GetParent (currentGac).FullName, gacs [i]); - string asm = GetAssemblyFile (reference, gac); - if (Directory.Exists (gac) && File.Exists (asm)) - return asm; - } - } - - return null; - } - - static string GetAssemblyFile (AssemblyNameReference reference, string gac) - { - StringBuilder sb = new StringBuilder (); - sb.Append (reference.Version); - sb.Append ("__"); - for (int i = 0; i < reference.PublicKeyToken.Length; i++) - sb.Append (reference.PublicKeyToken [i].ToString ("x2")); - - return Path.Combine ( - Path.Combine ( - Path.Combine (gac, reference.Name), sb.ToString ()), - string.Concat (reference.Name, ".dll")); - } - - static string GetCurrentGacPath () - { - return Directory.GetParent ( - Directory.GetParent ( - Path.GetDirectoryName ( - typeof (Uri).Module.FullyQualifiedName) - ).FullName - ).FullName; - } - - static bool OnMono () - { - return Type.GetType ("Mono.Runtime") != null; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/AssemblyWidgetLibrary.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/AssemblyWidgetLibrary.cs deleted file mode 100644 index 642e48c1e06..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/AssemblyWidgetLibrary.cs +++ /dev/null @@ -1,141 +0,0 @@ -using System; -using System.Collections; -using System.Reflection; -using System.Xml; -using System.IO; - -namespace Stetic -{ - internal class AssemblyWidgetLibrary: WidgetLibrary - { - static LibraryCache Cache = LibraryCache.Cache; - - Assembly assembly; - string name; - AssemblyResolver resolver; - LibraryCache.LibraryInfo cache_info; - - public AssemblyWidgetLibrary (string name, Assembly assembly) - { - this.name = name; - this.assembly = assembly; - UpdateCache (); - } - - public AssemblyWidgetLibrary (AssemblyResolver resolver, string assemblyPath) - { - this.name = assemblyPath; - - string ares = resolver.Resolve (assemblyPath, null); - if (ares != null) - assemblyPath = ares; - - this.resolver = resolver; - if (assemblyPath.EndsWith (".dll") || assemblyPath.EndsWith (".exe")) { - if (File.Exists (assemblyPath)) - assembly = Assembly.LoadFrom (assemblyPath); - } else - assembly = Assembly.Load (assemblyPath); - - if (assembly == null) - throw new InvalidOperationException ("Couldn't load assembly at " + assemblyPath); - - UpdateCache (); - } - - void UpdateCache () - { - Cache.Refresh (resolver, assembly.Location); - cache_info = Cache [assembly.Location]; - } - - public override string Name { - get { return name; } - } - - public override bool NeedsReload { - get { - return File.Exists (assembly.Location) && !Cache.IsCurrent (assembly.Location); - } - } - - public override bool CanReload { - get { return false; } - } - - public override void Load () - { - Load (cache_info.ObjectsDocument); - } - - protected override ClassDescriptor LoadClassDescriptor (XmlElement element) - { - return new TypedClassDescriptor (assembly, element); - } - - public override Type GetType (string typeName) - { - Type t = assembly.GetType (typeName, false); - if (t != null) return t; - - // Look in referenced assemblies -/* - Disabled. The problem is that Assembly.Load tries to load the exact version - of the assembly, and loaded references may not have the same exact version. - - foreach (AssemblyName an in assembly.GetReferencedAssemblies ()) { - Assembly a = Assembly.Load (an); - t = a.GetType (typeName); - if (t != null) return t; - } -*/ - return null; - } - - public override System.IO.Stream GetResource (string name) - { - return assembly.GetManifestResourceStream (name); - } - - public override string[] GetLibraryDependencies () - { - if (!cache_info.HasWidgets) - return new string [0]; - - ArrayList list = new ArrayList (); - ScanLibraries (list, assembly); - return (string[]) list.ToArray (typeof(string)); - } - - void ScanLibraries (ArrayList list, Assembly asm) - { - foreach (AssemblyName aname in asm.GetReferencedAssemblies ()) { - Assembly depasm = null; - try { - depasm = Assembly.Load (aname); - } catch { - } - - if (depasm == null) { - string file = resolver != null ? resolver.Resolve (aname.FullName, Path.GetDirectoryName (asm.Location)) : null; - if (file != null) - depasm = Assembly.LoadFrom (file); - else - throw new InvalidOperationException ("Assembly not found: " + aname.FullName); - } - - ManifestResourceInfo res = depasm.GetManifestResourceInfo ("objects.xml"); - if (res != null) - list.Add (depasm.Location); - } - } - - public override void Flush () - { - base.Flush (); - if (resolver != null) - resolver.ClearCache (); - } - } - -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/CecilClassDescriptor.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/CecilClassDescriptor.cs deleted file mode 100644 index 28359999832..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/CecilClassDescriptor.cs +++ /dev/null @@ -1,398 +0,0 @@ -using System; -using System.Collections; -using System.IO; -using System.Xml; -using System.Reflection; -using Mono.Cecil; - -namespace Stetic -{ - internal class CecilClassDescriptor: Stetic.ClassDescriptor - { - string wrappedTypeName; - ClassDescriptor typeClassDescriptor; - ClassDescriptor wrapperClassDescriptor; - Gdk.Pixbuf icon; - TypeDefinition type; - XmlElement steticDefinition; - CecilWidgetLibrary cecilLib; - bool useCustomWidgetBox; - string widgetId; - bool canGenerateCode; - - public CecilClassDescriptor (CecilWidgetLibrary lib, XmlElement element, ClassDescriptor typeClassDescriptor, XmlElement steticDefinition, TypeDefinition cls) - { - this.cecilLib = lib; - this.steticDefinition = steticDefinition; - this.typeClassDescriptor = typeClassDescriptor; - wrappedTypeName = element.GetAttribute ("type"); - type = cls; - Load (element); - type = null; - canGenerateCode = true; - - string baseType = element.GetAttribute ("base-type"); - if (baseType.Length > 0) { - wrapperClassDescriptor = Registry.LookupClassByName (baseType); - if (wrapperClassDescriptor == null) - throw new InvalidOperationException ("Unknown base type: " + baseType); - } else { - wrapperClassDescriptor = typeClassDescriptor; - } - - if (steticDefinition == null && !AllowChildren && NeedsBlackBox (typeClassDescriptor.Name)) { - // It is not possible to create instances of that widget, instead we'll have - // to create the typical custom widget black box. - - if (!CanCreateWidgetInstance (wrapperClassDescriptor.Name)) - throw new InvalidOperationException ("Can't load widget type '" + Name + "'. Instances of that type can't be created because the type can't be loaded into the process."); - - useCustomWidgetBox = true; - } - - widgetId = Name.ToLower (); - int i = widgetId.LastIndexOf ('.'); - if (i != -1) { - if (i != widgetId.Length - 1) - widgetId = widgetId.Substring (i+1); - else - widgetId = widgetId.Replace (".", ""); - } - - string iconName = element.GetAttribute ("icon"); - icon = lib.GetEmbeddedIcon (iconName); - - // If the class is a custom widget created using stetic, it means that it has - // simple property and there is no custom logic, so it is safe to generate code - // for this class. - if (steticDefinition != null) - canGenerateCode = true; - - // If it has a custom wrapper, then it definitely has custom logic, so it can't generate code - if (element.HasAttribute ("wrapper")) - canGenerateCode = false; - } - - public override string WrappedTypeName { - get { return wrappedTypeName; } - } - - public override Gdk.Pixbuf Icon { - get { return icon; } - } - - public bool CanGenerateCode { - get { return canGenerateCode; } - } - - public override object CreateInstance (Stetic.IProject proj) - { - Gtk.Widget res; - - if (useCustomWidgetBox) { - res = CreateFakeWidget (wrapperClassDescriptor.Name); - res.ShowAll (); - } - else if (steticDefinition != null) { - Gtk.Container w = Stetic.WidgetUtils.ImportWidget (proj, steticDefinition) as Gtk.Container; - MakeChildrenUnselectable (w); - res = w; - } - else { - res = (Gtk.Widget) typeClassDescriptor.CreateInstance (proj); - - // If it is a custom widget and there is no stetic project for it, just - // show it as a regular custom widget. - Stetic.CustomWidget custom = res as Stetic.CustomWidget; - if (custom != null) { - Stetic.Custom c = new Stetic.Custom (); - // Give it some default size - c.WidthRequest = 20; - c.HeightRequest = 20; - custom.Add (c); - custom.ShowAll (); - res = custom; - } - } - - res.Name = widgetId; - return res; - } - - public override Stetic.ObjectWrapper CreateWrapper () - { - return wrapperClassDescriptor.CreateWrapper (); - } - - protected override Stetic.ItemDescriptor CreateItemDescriptor (XmlElement elem, Stetic.ItemGroup group) - { - string mname = elem.GetAttribute ("name"); - if (elem.Name == "property") { - if (type != null) { - PropertyDefinition propInfo = FindProperty (type, mname); - if (propInfo != null) - return new CecilPropertyDescriptor (cecilLib, elem, group, this, propInfo); - } - else - return new CecilPropertyDescriptor (cecilLib, elem, group, this, null); - } - else if (elem.Name == "signal") { - if (type != null) { - EventDefinition signalInfo = FindEvent (type, mname); - if (signalInfo != null) - return new CecilSignalDescriptor (cecilLib, elem, group, this, signalInfo); - } - else - return new CecilSignalDescriptor (cecilLib, elem, group, this, null); - } - else - return base.CreateItemDescriptor (elem, group); - - return null; - } - - PropertyDefinition FindProperty (TypeDefinition cls, string name) - { - foreach (PropertyDefinition propInfo in cls.Properties) - if (propInfo.Name == name) - return propInfo; - - if (cls.BaseType == null) - return null; - - string baseType = cls.BaseType.FullName; - Type t = Registry.GetType (baseType, false); - if (t != null) { - PropertyInfo prop = t.GetProperty (name); - if (prop != null) { - TypeReference tref = new TypeReference (prop.PropertyType.Namespace, prop.PropertyType.Name, cls.Module, cls.Module, prop.PropertyType.IsValueType); - PropertyDefinition pdef = new PropertyDefinition (name, Mono.Cecil.PropertyAttributes.None, tref); - CreateGetMethod (pdef); - CreateSetMethod (pdef); - return pdef; - } - } - - TypeDefinition bcls = cecilLib.FindTypeDefinition (baseType); - if (bcls != null) - return FindProperty (bcls, name); - else - return null; - } - - static MethodDefinition CreateGetMethod (PropertyDefinition prop) - { - MethodDefinition get = new MethodDefinition ( - string.Concat ("get_", prop.Name), (Mono.Cecil.MethodAttributes) 0, prop.PropertyType); - prop.GetMethod = get; - return get; - } - - static MethodDefinition CreateSetMethod (PropertyDefinition prop) - { - MethodDefinition set = new MethodDefinition ( - string.Concat ("set_", prop.Name), (Mono.Cecil.MethodAttributes) 0, prop.PropertyType); - prop.SetMethod = set; - return set; - } - - EventDefinition FindEvent (TypeDefinition cls, string name) - { - foreach (EventDefinition eventInfo in cls.Events) - if (eventInfo.Name == name) - return eventInfo; - - if (cls.BaseType == null) - return null; - - string baseType = cls.BaseType.FullName; - Type t = Registry.GetType (baseType, false); - if (t != null) { - EventInfo ev = t.GetEvent (name); - if (ev != null) { - TypeReference tref = new TypeReference (ev.EventHandlerType.Namespace, ev.EventHandlerType.Name, cls.Module, cls.Module, ev.EventHandlerType.IsValueType); - return new EventDefinition (name, Mono.Cecil.EventAttributes.None, tref); - } - } - - TypeDefinition bcls = cecilLib.FindTypeDefinition (baseType); - if (bcls != null) - return FindEvent (bcls, name); - else - return null; - } - - void MakeChildrenUnselectable (Gtk.Widget w) - { - // Remove the registered signals, since those signals are bound - // to the custom widget class, not the widget container class. - Stetic.Wrapper.Widget ww = Stetic.Wrapper.Widget.Lookup (w); - if (ww == null) - return; - ww.Signals.Clear (); - - foreach (Gtk.Widget child in (Gtk.Container)w) { - Stetic.Wrapper.Widget wrapper = Stetic.Wrapper.Widget.Lookup (child); - if (wrapper != null) { - wrapper.Signals.Clear (); - wrapper.Unselectable = true; - } - if (child is Gtk.Container) - MakeChildrenUnselectable (child); - } - } - - bool CanCreateWidgetInstance (string typeName) - { - switch (typeName) { - case "Gtk.Fixed": - return false; - } - return true; - } - - bool NeedsBlackBox (string typeName) - { - switch (typeName) { - case "Gtk.Widget": - case "Gtk.Container": - case "Gtk.Alignment": - case "Gtk.Fixed": - case "Gtk.Frame": - case "Gtk.HBox": - case "Gtk.VBox": - case "Gtk.Box": - case "Gtk.ButtonBox": - case "Gtk.Paned": - case "Gtk.VPaned": - case "Gtk.HPaned": - case "Gtk.Notebook": - case "Gtk.ScrolledWindow": - case "Gtk.Table": - case "Gtk.Bin": - return true; - } - return false; - } - - Gtk.Widget CreateFakeWidget (string typeName) - { - Stetic.Custom c = new Stetic.Custom (); - // Give it some default size - c.WidthRequest = 20; - c.HeightRequest = 20; - - Gtk.Container box = null; - - switch (typeClassDescriptor.Name) { - case "Gtk.Alignment": - box = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f); - break; - case "Gtk.Fixed": - box = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f); - break; - case "Gtk.Frame": - box = new Gtk.Frame (); - break; - case "Gtk.Box": - case "Gtk.HBox": { - Gtk.HBox cc = new Gtk.HBox (); - cc.PackStart (c, true, true, 0); - return cc; - } - case "Gtk.VBox": { - Gtk.VBox cc = new Gtk.VBox (); - cc.PackStart (c, true, true, 0); - return cc; - } - case "Gtk.Paned": - case "Gtk.VPaned": { - Gtk.VPaned cc = new Gtk.VPaned (); - cc.Add1 (c); - return cc; - } - case "Gtk.HPaned": { - Gtk.HPaned cc = new Gtk.HPaned (); - cc.Add1 (c); - return cc; - } - case "Gtk.Notebook": { - Gtk.Notebook nb = new Gtk.Notebook (); - nb.ShowTabs = false; - nb.AppendPage (c, null); - return nb; - } - case "Gtk.ScrolledWindow": { - Gtk.ScrolledWindow cc = new Gtk.ScrolledWindow (); - cc.VscrollbarPolicy = Gtk.PolicyType.Never; - cc.HscrollbarPolicy = Gtk.PolicyType.Never; - cc.AddWithViewport (c); - return cc; - } - case "Gtk.Table": { - Gtk.Table t = new Gtk.Table (1, 1, false); - t.Attach (c, 0, 1, 0, 1); - return t; - } - case "Gtk.ButtonBox": - return new Gtk.HButtonBox (); - } - if (box != null) { - box.Add (c); - return box; - } else { - Stetic.CustomWidget custom = new Stetic.CustomWidget (); - if (custom.Child != null) - custom.Remove (custom.Child); - custom.Add (c); - return custom; - } - } - } - - class CustomControlWrapper: Stetic.Wrapper.Container - { - protected override bool AllowPlaceholders { - get { - return false; - } - } - } - - class ClassDescriptorWrapper: Stetic.ClassDescriptor - { - ClassDescriptor wrapped; - - public ClassDescriptorWrapper (ClassDescriptor wrapped) - { - this.wrapped = wrapped; - label = wrapped.Label; - - } - - public override string WrappedTypeName { - get { return wrapped.WrappedTypeName; } - } - - public override Gdk.Pixbuf Icon { - get { return wrapped.Icon; } - } - - public override object CreateInstance (Stetic.IProject proj) - { - CustomWidget custom = new CustomWidget (); - Stetic.Custom c = new Stetic.Custom (); - // Give it some default size - c.WidthRequest = 20; - c.HeightRequest = 20; - custom.Add (c); - return c; - } - - public override Stetic.ObjectWrapper CreateWrapper () - { - return new Wrapper.Container (); - } - } -} - diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/CecilPropertyDescriptor.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/CecilPropertyDescriptor.cs deleted file mode 100644 index 292a99b7405..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/CecilPropertyDescriptor.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; -using System.Collections; -using System.Xml; -using Mono.Cecil; - -namespace Stetic -{ - class CecilPropertyDescriptor: Stetic.PropertyDescriptor - { - string name; - Type type; - object initialValue; - bool canWrite; - - public CecilPropertyDescriptor (CecilWidgetLibrary lib, XmlElement elem, Stetic.ItemGroup group, Stetic.ClassDescriptor klass, PropertyDefinition pinfo): base (elem, group, klass) - { - string tname; - - if (pinfo != null) { - name = pinfo.Name; - tname = pinfo.PropertyType.FullName; - canWrite = pinfo.SetMethod != null; - } - else { - name = elem.GetAttribute ("name"); - tname = elem.GetAttribute ("type"); - canWrite = elem.Attributes ["canWrite"] == null; - } - - Load (elem); - - type = Stetic.Registry.GetType (tname, false); - - if (type == null) { - Console.WriteLine ("Could not find type: " + tname); - type = typeof(string); - } - if (type.IsValueType) - initialValue = Activator.CreateInstance (type); - - // Consider all properties runtime-properties, since they have been created - // from class properties. - isRuntimeProperty = true; - - if (pinfo != null) - SaveCecilXml (elem); - } - - public CecilPropertyDescriptor (XmlElement elem, Stetic.ItemGroup group, Stetic.ClassDescriptor klass, PropertyDescriptor prop): base (elem, group, klass) - { - this.name = prop.Name; - this.type = prop.PropertyType; - this.canWrite = prop.CanWrite; - if (type.IsValueType) - initialValue = Activator.CreateInstance (type); - this.label = prop.Label; - this.description = prop.Description; - this.maximum = prop.Maximum; - this.minimum = prop.Minimum; - this.initWithName = prop.InitWithName; - this.translatable = prop.Translatable; - } - - internal void SaveCecilXml (XmlElement elem) - { - elem.SetAttribute ("name", name); - elem.SetAttribute ("type", type.FullName); - if (!canWrite) - elem.SetAttribute ("canWrite", "false"); - } - - public override string Name { - get { return name; } - } - - // The property's type - public override Type PropertyType { - get { return type; } - } - - public override bool IsDefaultValue (object value) - { - return false; - } - - // Gets the value of the property on @obj - public override object GetValue (object obj) - { - Stetic.ObjectWrapper wrapper = (Stetic.ObjectWrapper) Stetic.ObjectWrapper.Lookup (obj); - Hashtable props = (Hashtable) wrapper.ExtendedData [typeof(CecilPropertyDescriptor)]; - object val = props != null ? props [name] : null; - if (val == null && initialValue != null) - return initialValue; - else - return val; - } - - // Whether or not the property is writable - public override bool CanWrite { - get { return canWrite; } - } - - // Sets the value of the property on @obj - public override void SetValue (object obj, object value) - { - Stetic.ObjectWrapper wrapper = (Stetic.ObjectWrapper) Stetic.ObjectWrapper.Lookup (obj); - Hashtable props = (Hashtable) wrapper.ExtendedData [typeof(CecilPropertyDescriptor)]; - if (props == null) { - props = new Hashtable (); - wrapper.ExtendedData [typeof(CecilPropertyDescriptor)] = props; - } - - props [name] = value; - } - - public override object GetRuntimeValue (object obj) - { - return null; - } - - public override void SetRuntimeValue (object obj, object value) - { - } - - } -} - diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/CecilSignalDescriptor.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/CecilSignalDescriptor.cs deleted file mode 100644 index 3b002eabb13..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/CecilSignalDescriptor.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using System.Collections; -using System.Xml; -using System.Reflection; -using Mono.Cecil; - -namespace Stetic -{ - class CecilSignalDescriptor: Stetic.SignalDescriptor - { - public CecilSignalDescriptor (CecilWidgetLibrary lib, XmlElement elem, Stetic.ItemGroup group, Stetic.ClassDescriptor klass, EventDefinition sinfo) : base (elem, group, klass) - { - if (sinfo != null) { - string handler = sinfo.EventType.FullName; - handlerTypeName = handler.Replace ('/','+'); - Type t = Registry.GetType (handler, false); - if (t != null) { - MethodInfo mi = t.GetMethod ("Invoke"); - handlerReturnTypeName = mi.ReturnType.FullName; - ParameterInfo[] pars = mi.GetParameters (); - handlerParameters = new ParameterDescriptor [pars.Length]; - for (int n=0; n', ']'); - } - TypeDefinition td = lib.FindTypeDefinition (tn); - if (td != null) { - MethodDefinition mi = null; - foreach (MethodDefinition md in td.Methods) { - if (md.Name == "Invoke") { - mi = md; - break; - } - } - if (mi != null) { - handlerReturnTypeName = CecilWidgetLibrary.GetInstanceType (td, sinfo.EventType, mi.ReturnType); - handlerParameters = new ParameterDescriptor [mi.Parameters.Count]; - for (int n=0; n -// Mike Kestner -// -// Copyright (c) 2008 Novell, Inc -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -using System; -using System.IO; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Xml; -using Mono.Cecil; - -namespace Stetic -{ - internal class CecilWidgetLibrary: WidgetLibrary - { - static LibraryCache cache = LibraryCache.Cache; - - string name; - string filename; - string[] dependencies; - AssemblyResolver resolver; - bool canGenerateCode; - bool info_changed; - bool objects_dirty; - AssemblyDefinition assembly; - LibraryCache.LibraryInfo cache_info; - - public CecilWidgetLibrary (AssemblyResolver resolver, string path) - { - name = path; - this.resolver = resolver; - - if (System.IO.File.Exists (path)) - filename = path; - else if (resolver != null) - filename = resolver.Resolve (path, null); - - if (filename == null) - filename = path; - else - filename = System.IO.Path.GetFullPath (filename); - - RefreshFromCache (); - } - - public override string Name { - get { return name; } - } - - public override bool NeedsReload { - get { - cache.Refresh (resolver, filename); - return info_changed; - } - } - - public override bool CanReload { - get { return true; } - } - - public override bool CanGenerateCode { - get { return canGenerateCode; } - } - - public override void Load () - { - canGenerateCode = true; - - RefreshFromCache (); - if (cache_info == null || !File.Exists (filename)) - return; - - using (assembly = AssemblyDefinition.ReadAssembly (filename)) { - objects_dirty = false; - Load (cache_info.ObjectsDocument); - if (objects_dirty) - cache_info.WriteObjectsFile (); - - foreach (string dep in GetLibraryDependencies ()) { - WidgetLibrary lib = Registry.GetWidgetLibrary (dep); - if (lib != null && !lib.CanGenerateCode) - canGenerateCode = false; - } - } - assembly = null; - info_changed = false; - } - - void RefreshFromCache () - { - LibraryCache.LibraryInfo newInfo = cache.Refresh (resolver, filename); - if (newInfo != cache_info) { - if (cache_info != null) - cache_info.Changed -= OnCacheInfoChanged; - cache_info = newInfo; - cache_info.Changed += OnCacheInfoChanged; - } - } - - void OnCacheInfoChanged (object o, EventArgs a) - { - info_changed = true; - } - - public override void Dispose () - { - base.Dispose (); - if (cache_info != null) { - cache_info.Changed -= OnCacheInfoChanged; - cache_info = null; - } - } - - - protected override ClassDescriptor LoadClassDescriptor (XmlElement element) - { - string name = element.GetAttribute ("type"); - - TypeDefinition cls = null; - Stetic.ClassDescriptor typeClassDescriptor = null; - string tname; - - if (element.HasAttribute ("baseClassType")) { - tname = element.GetAttribute ("baseClassType"); - typeClassDescriptor = Stetic.Registry.LookupClassByName (tname); - } else { - cls = assembly.MainModule.GetType (name); - if (cls != null) { - // Find the nearest type that can be loaded - typeClassDescriptor = FindType (cls); - tname = cls.Name; - if (typeClassDescriptor != null) { - element.SetAttribute ("baseClassType", typeClassDescriptor.Name); - objects_dirty = true; - } - } - } - - if (typeClassDescriptor == null) { - Console.WriteLine ("Descriptor not found: " + name); - return null; - } - - XmlElement steticDefinition = null; - - XmlDocument gui = cache [filename].GuiDocument; - if (gui != null) { - string wrappedTypeName = element.GetAttribute ("type"); - steticDefinition = (XmlElement) gui.DocumentElement.SelectSingleNode ("widget[@id='" + wrappedTypeName + "']"); - } - - CecilClassDescriptor cd = new CecilClassDescriptor (this, element, typeClassDescriptor, steticDefinition, cls); - - if (canGenerateCode && !cd.CanGenerateCode) - canGenerateCode = false; - return cd; - } - - Stetic.ClassDescriptor FindType (TypeDefinition cls) - { - if (cls.BaseType == null) - return null; - Stetic.ClassDescriptor klass = Stetic.Registry.LookupClassByName (cls.BaseType.FullName); - if (klass != null) return klass; - - TypeDefinition bcls = FindTypeDefinition (cls.BaseType.FullName); - if (bcls == null) - return null; - - return FindType (bcls); - } - - AssemblyDefinition ResolveAssembly (AssemblyNameReference aref) - { - return resolver.Resolve (aref, Path.GetDirectoryName (filename)); - } - - internal TypeDefinition FindTypeDefinition (string fullName) - { - return FindTypeDefinition (assembly, fullName); - } - - TypeDefinition FindTypeDefinition (AssemblyDefinition asm, string fullName) - { - TypeDefinition cls = asm.MainModule.GetType (fullName); - if (cls != null) - return cls; - - foreach (AssemblyNameReference aref in asm.MainModule.AssemblyReferences) { - AssemblyDefinition basm = ResolveAssembly (aref); - if (basm != null) { - cls = basm.MainModule.GetType (fullName); - if (cls != null) - return cls; - } - } - return null; - } - - public override string[] GetLibraryDependencies () - { - if (NeedsReload || dependencies == null) - LoadDependencies (); - return dependencies; - } - - void LoadDependencies () - { - RefreshFromCache (); - if (cache_info == null || cache_info.ObjectsDocument == null) { - dependencies = new string[0]; - return; - } - XmlElement elem = cache_info.ObjectsDocument.DocumentElement ["dependencies"]; - if (elem != null) { - ArrayList list = new ArrayList (); - foreach (XmlElement dep in elem.SelectNodes ("dependency")) - list.Add (dep.InnerText); - dependencies = (string[]) list.ToArray (typeof(string)); - } else - dependencies = new string[0]; - } - - public static bool IsWidgetLibrary (string path) - { - // Info can be null if the library could not be scanned for some reason - var info = cache [path]; - return info != null && info.HasWidgets; - } - - public static string GetInstanceType (TypeDefinition td, TypeReference sourceType, TypeReference tref) - { - string tn = null; - if (sourceType is GenericInstanceType) { - GenericInstanceType it = (GenericInstanceType) sourceType; - foreach (GenericParameter gc in td.GenericParameters) { - if (gc.Name == tref.FullName) { - tn = it.GenericArguments [gc.Position].FullName; - break; - } - } - } - if (tn == null) - tn = tref.FullName; - tn = tn.Replace ('<', '['); - tn = tn.Replace ('>', ']'); - return tn; - } - - public static List GetComponentTypes (Application app, string filename) - { - List list = new List (); - - LibraryCache.LibraryInfo info = cache.Refresh (new AssemblyResolver (app.Backend), filename); - if (info.ObjectsDocument == null) - return list; - - string defTargetGtkVersion = info.ObjectsDocument.DocumentElement.GetAttribute ("gtk-version"); - if (defTargetGtkVersion.Length == 0) - defTargetGtkVersion = "2.4"; - - using (AssemblyDefinition adef = AssemblyDefinition.ReadAssembly (filename)) { - foreach (XmlElement elem in info.ObjectsDocument.SelectNodes ("objects/object")) { - if (elem.GetAttribute ("internal") == "true" || elem.HasAttribute ("deprecated") || !elem.HasAttribute ("palette-category")) - continue; - - string iconname = elem.GetAttribute ("icon"); - Gdk.Pixbuf icon = GetEmbeddedIcon (adef, iconname); - - string targetGtkVersion = elem.GetAttribute ("gtk-version"); - if (targetGtkVersion.Length == 0) - targetGtkVersion = defTargetGtkVersion; - - ComponentType ct = new ComponentType (app, - elem.GetAttribute ("type"), - elem.GetAttribute ("label"), - elem.GetAttribute ("type"), - elem.GetAttribute ("palette-category"), - targetGtkVersion, - filename, - icon); - - list.Add (ct); - } - } - - return list; - } - - public Gdk.Pixbuf GetEmbeddedIcon (string iconname) - { - return GetEmbeddedIcon (assembly, iconname); - } - - static Gdk.Pixbuf GetEmbeddedIcon (AssemblyDefinition asm, string iconname) - { - Gdk.Pixbuf icon = null; - if (iconname != null && iconname.Length > 0) { - try { - // Using the pixbuf resource constructor generates a gdk warning. - EmbeddedResource res = GetResource (asm, iconname); - Gdk.PixbufLoader loader = new Gdk.PixbufLoader (res.GetResourceData ()); - icon = loader.Pixbuf; - } catch { - // Ignore - } - } - - if (icon == null) { - ClassDescriptor cc = Registry.LookupClassByName ("Gtk.Bin"); - icon = cc.Icon; - } - return icon; - } - - static EmbeddedResource GetResource (AssemblyDefinition asm, string name) - { - foreach (Resource res in asm.MainModule.Resources) { - EmbeddedResource eres = res as EmbeddedResource; - if (eres != null && eres.Name == name) - return eres; - } - return null; - } - - public override void Flush () - { - base.Flush (); - if (resolver != null) - resolver.ClearCache (); - } - - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/CodeGenerationResult.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/CodeGenerationResult.cs deleted file mode 100644 index 3e2dedcd845..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/CodeGenerationResult.cs +++ /dev/null @@ -1,26 +0,0 @@ - -using System; - -namespace Stetic -{ - [Serializable] - public class CodeGenerationResult - { - SteticCompilationUnit[] units; - string[] warnings; - - internal CodeGenerationResult (SteticCompilationUnit[] units, string[] warnings) - { - this.units = units; - this.warnings = warnings; - } - - public SteticCompilationUnit[] Units { - get { return units; } - } - - public string[] Warnings { - get { return warnings; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/CodeGenerator.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/CodeGenerator.cs deleted file mode 100644 index fe65c5d8687..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/CodeGenerator.cs +++ /dev/null @@ -1,435 +0,0 @@ -using System; -using System.CodeDom; -using System.CodeDom.Compiler; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Text.RegularExpressions; - -namespace Stetic -{ - internal static class CodeGenerator - { - public static void GenerateProjectCode (string file, CodeDomProvider provider, GenerationOptions options, ProjectBackend[] projects) - { - CodeGenerationResult res = GenerateProjectCode (options, projects); - - string basePath = Path.GetDirectoryName (file); - - foreach (SteticCompilationUnit unit in res.Units) { - string fname; - if (unit.Name.Length == 0) - fname = file; - else - fname = Path.Combine (basePath, unit.Name); - StreamWriter fileStream = new StreamWriter (fname); - try { - provider.GenerateCodeFromCompileUnit (unit, fileStream, new CodeGeneratorOptions ()); - } finally { - fileStream.Close (); - } - } - } - - public static CodeGenerationResult GenerateProjectCode (GenerationOptions options, ProjectBackend[] projects) - { - ArrayList warningList = new ArrayList (); - - List units = new List (); - SteticCompilationUnit globalUnit = new SteticCompilationUnit (""); - units.Add (globalUnit); - - if (options == null) - options = new GenerationOptions (); - CodeNamespace globalNs = new CodeNamespace (options.GlobalNamespace); - globalUnit.Namespaces.Add (globalNs); - - // Global class - - CodeTypeDeclaration globalType = new CodeTypeDeclaration ("Gui"); - globalType.Attributes = MemberAttributes.Private; - globalType.TypeAttributes = TypeAttributes.NestedAssembly; - globalNs.Types.Add (globalType); - - // Create the project initialization method - // This method will only be added at the end if there - // is actually something to initialize - - CodeMemberMethod initMethod = new CodeMemberMethod (); - initMethod.Name = "Initialize"; - initMethod.ReturnType = new CodeTypeReference (typeof(void)); - initMethod.Attributes = MemberAttributes.Assembly | MemberAttributes.Static; - initMethod.Parameters.Add (new CodeParameterDeclarationExpression (typeof(Gtk.Widget), "iconRenderer")); - - GeneratorContext initContext = new ProjectGeneratorContext (globalNs, globalType, initMethod.Statements, options); - initContext.RootObject = new CodeArgumentReferenceExpression ("iconRenderer"); - - // Generate icon factory creation - - foreach (ProjectBackend gp in projects) { - if (gp.IconFactory.Icons.Count > 0) - gp.IconFactory.GenerateBuildCode (initContext); - } - warningList.AddRange (initContext.Warnings); - - // Generate the code - - if (options.UsePartialClasses) - CodeGeneratorPartialClass.GenerateProjectGuiCode (globalUnit, globalNs, globalType, options, units, projects, warningList); - else - CodeGeneratorInternalClass.GenerateProjectGuiCode (globalUnit, globalNs, globalType, options, units, projects, warningList); - - GenerateProjectActionsCode (globalNs, options, projects); - - // Final step. If there is some initialization code, add all needed infrastructure - - globalType.Members.Add (initMethod); - - CodeMemberField initField = new CodeMemberField (typeof(bool), "initialized"); - initField.Attributes = MemberAttributes.Private | MemberAttributes.Static; - globalType.Members.Add (initField); - - CodeFieldReferenceExpression initVar = new CodeFieldReferenceExpression ( - new CodeTypeReferenceExpression (globalNs.Name + ".Gui"), - "initialized" - ); - - CodeConditionStatement initCondition = new CodeConditionStatement (); - initCondition.Condition = new CodeBinaryOperatorExpression ( - initVar, - CodeBinaryOperatorType.IdentityEquality, - new CodePrimitiveExpression (false) - ); - initCondition.TrueStatements.Add (new CodeAssignStatement ( - initVar, - new CodePrimitiveExpression (true) - )); - initCondition.TrueStatements.AddRange (initMethod.Statements); - initMethod.Statements.Clear (); - initMethod.Statements.Add (initCondition); - - return new CodeGenerationResult (units.ToArray (), (string[]) warningList.ToArray (typeof(string))); - } - - internal static void BindSignalHandlers (CodeExpression targetObjectVar, ObjectWrapper wrapper, Stetic.WidgetMap map, CodeStatementCollection statements, GenerationOptions options) - { - foreach (Signal signal in wrapper.Signals) { - SignalDescriptor descriptor = signal.SignalDescriptor; - - CodeExpression createDelegate; - - if (options.UsePartialClasses) { - var rgx = new Regex (@"`\d+"); - createDelegate = - new CodeDelegateCreateExpression ( - new CodeTypeReference (rgx.Replace (descriptor.HandlerTypeName, ""), CodeTypeReferenceOptions.GlobalReference), - new CodeThisReferenceExpression (), - signal.Handler); - } else { - createDelegate = - new CodeMethodInvokeExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (typeof(Delegate), CodeTypeReferenceOptions.GlobalReference)), - "CreateDelegate", - new CodeTypeOfExpression (descriptor.HandlerTypeName), - targetObjectVar, - new CodePrimitiveExpression (signal.Handler)); - - createDelegate = new CodeCastExpression (descriptor.HandlerTypeName.ToGlobalTypeRef (), createDelegate); - } - - CodeAttachEventStatement cevent = new CodeAttachEventStatement ( - new CodeEventReferenceExpression ( - map.GetWidgetExp (wrapper), - descriptor.Name), - createDelegate); - - statements.Add (cevent); - } - - Wrapper.Widget widget = wrapper as Wrapper.Widget; - if (widget != null && widget.IsTopLevel) { - // Bind local action signals - foreach (Wrapper.ActionGroup grp in widget.LocalActionGroups) { - foreach (Wrapper.Action ac in grp.Actions) - BindSignalHandlers (targetObjectVar, ac, map, statements, options); - } - } - - Gtk.Container cont = wrapper.Wrapped as Gtk.Container; - if (cont != null) { - foreach (Gtk.Widget child in cont.AllChildren) { - Stetic.Wrapper.Widget ww = Stetic.Wrapper.Widget.Lookup (child); - if (ww != null) - BindSignalHandlers (targetObjectVar, ww, map, statements, options); - } - } - - } - - static void GenerateProjectActionsCode (CodeNamespace cns, GenerationOptions options, params ProjectBackend[] projects) - { - bool multiProject = projects.Length > 1; - - CodeTypeDeclaration type = new CodeTypeDeclaration ("ActionGroups"); - type.Attributes = MemberAttributes.Private; - type.TypeAttributes = TypeAttributes.NestedAssembly; - cns.Types.Add (type); - - // Generate the global action group getter - - CodeMemberMethod met = new CodeMemberMethod (); - met.Name = "GetActionGroup"; - type.Members.Add (met); - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(Type), "type")); - if (multiProject) - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(string), "file")); - met.ReturnType = new CodeTypeReference (typeof(Gtk.ActionGroup)); - met.Attributes = MemberAttributes.Public | MemberAttributes.Static; - - CodeMethodInvokeExpression call = new CodeMethodInvokeExpression ( - new CodeMethodReferenceExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (cns.Name + ".ActionGroups")), - "GetActionGroup" - ), - new CodePropertyReferenceExpression ( - new CodeArgumentReferenceExpression ("type"), - "FullName" - ) - ); - if (multiProject) - call.Parameters.Add (new CodeArgumentReferenceExpression ("file")); - - met.Statements.Add (new CodeMethodReturnStatement (call)); - - // Generate the global action group getter (overload) - - met = new CodeMemberMethod (); - met.Name = "GetActionGroup"; - type.Members.Add (met); - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(string), "name")); - if (multiProject) - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(string), "file")); - met.ReturnType = new CodeTypeReference (typeof(Gtk.ActionGroup)); - met.Attributes = MemberAttributes.Public | MemberAttributes.Static; - - CodeArgumentReferenceExpression cfile = new CodeArgumentReferenceExpression ("file"); - CodeArgumentReferenceExpression cid = new CodeArgumentReferenceExpression ("name"); - - CodeStatementCollection projectCol = met.Statements; - int n=1; - - foreach (ProjectBackend gp in projects) { - - CodeStatementCollection widgetCol; - - if (multiProject) { - CodeConditionStatement pcond = new CodeConditionStatement (); - pcond.Condition = new CodeBinaryOperatorExpression ( - cfile, - CodeBinaryOperatorType.IdentityEquality, - new CodePrimitiveExpression (gp.Id) - ); - projectCol.Add (pcond); - - widgetCol = pcond.TrueStatements; - projectCol = pcond.FalseStatements; - } else { - widgetCol = projectCol; - } - - foreach (Wrapper.ActionGroup grp in gp.ActionGroups) { - string fname = "group" + (n++); - CodeMemberField grpField = new CodeMemberField (new CodeTypeReference (typeof(Gtk.ActionGroup), CodeTypeReferenceOptions.GlobalReference), fname); - grpField.Attributes |= MemberAttributes.Static; - type.Members.Add (grpField); - CodeFieldReferenceExpression grpVar = new CodeFieldReferenceExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (cns.Name + ".ActionGroups", CodeTypeReferenceOptions.GlobalReference)), - fname - ); - - CodeConditionStatement pcond = new CodeConditionStatement (); - pcond.Condition = new CodeBinaryOperatorExpression ( - cid, - CodeBinaryOperatorType.IdentityEquality, - new CodePrimitiveExpression (grp.Name) - ); - widgetCol.Add (pcond); - - // If the group has not yet been created, create it - CodeConditionStatement pcondGrp = new CodeConditionStatement (); - pcondGrp.Condition = new CodeBinaryOperatorExpression ( - grpVar, - CodeBinaryOperatorType.IdentityEquality, - new CodePrimitiveExpression (null) - ); - - pcondGrp.TrueStatements.Add ( - new CodeAssignStatement ( - grpVar, - new CodeObjectCreateExpression (grp.Name) - ) - ); - - pcond.TrueStatements.Add (pcondGrp); - pcond.TrueStatements.Add (new CodeMethodReturnStatement (grpVar)); - - widgetCol = pcond.FalseStatements; - } - widgetCol.Add (new CodeMethodReturnStatement (new CodePrimitiveExpression (null))); - } - if (met.Statements.Count == 0) - met.Statements.Add (new CodeMethodReturnStatement (new CodePrimitiveExpression (null))); - } - - internal static List GetFieldsToBind (ObjectWrapper wrapper) - { - List tobind = new List (); - GetFieldsToBind (tobind, wrapper); - return tobind; - } - - static void GetFieldsToBind (List tobind, ObjectWrapper wrapper) - { - string memberName = null; - - if (wrapper is Wrapper.Widget) { - Wrapper.Widget ww = wrapper as Wrapper.Widget; - if (!String.IsNullOrEmpty (ww.UIManagerName)) - tobind.Add (new ObjectBindInfo ("Gtk.UIManager", ww.UIManagerName)); - - if (!ww.IsTopLevel && ww.InternalChildProperty == null && !ww.Unselectable) - memberName = ((Wrapper.Widget) wrapper).Wrapped.Name; - } - else if (wrapper is Wrapper.Action) - memberName = ((Wrapper.Action) wrapper).Name; - - if (memberName != null) { - ObjectBindInfo binfo = new ObjectBindInfo (wrapper.WrappedTypeName, memberName); - tobind.Add (binfo); - } - - Wrapper.ActionGroup agroup = wrapper as Wrapper.ActionGroup; - if (agroup != null) { - foreach (Wrapper.Action ac in agroup.Actions) - GetFieldsToBind (tobind, ac); - } - - Wrapper.Widget widget = wrapper as Wrapper.Widget; - if (widget != null && widget.IsTopLevel) { - // Generate fields for local actions - foreach (Wrapper.ActionGroup grp in widget.LocalActionGroups) { - GetFieldsToBind (tobind, grp); - } - } - - Gtk.Container cont = wrapper.Wrapped as Gtk.Container; - if (cont != null) { - foreach (Gtk.Widget child in cont.AllChildren) { - Stetic.Wrapper.Widget ww = Stetic.Wrapper.Widget.Lookup (child); - if (ww != null) - GetFieldsToBind (tobind, ww); - } - } - } - - public static WidgetMap GenerateCreationCode (CodeNamespace cns, CodeTypeDeclaration type, Gtk.Widget w, CodeExpression widgetVarExp, CodeStatementCollection statements, GenerationOptions options, ArrayList warnings) - { - statements.Add (new CodeCommentStatement ("Widget " + w.Name)); - GeneratorContext ctx = new ProjectGeneratorContext (cns, type, statements, options); - Stetic.Wrapper.Widget ww = Stetic.Wrapper.Widget.Lookup (w); - ctx.GenerateCreationCode (ww, widgetVarExp); - ctx.EndGeneration (); - warnings.AddRange (ctx.Warnings); - return ctx.WidgetMap; - } - - public static WidgetMap GenerateCreationCode (CodeNamespace cns, CodeTypeDeclaration type, Wrapper.ActionGroup grp, CodeExpression groupVarExp, CodeStatementCollection statements, GenerationOptions options, ArrayList warnings) - { - statements.Add (new CodeCommentStatement ("Action group " + grp.Name)); - GeneratorContext ctx = new ProjectGeneratorContext (cns, type, statements, options); - ctx.GenerateCreationCode (grp, groupVarExp); - ctx.EndGeneration (); - warnings.AddRange (ctx.Warnings); - return ctx.WidgetMap; - } - } - - class ProjectGeneratorContext: GeneratorContext - { - CodeTypeDeclaration type; - - public ProjectGeneratorContext (CodeNamespace cns, CodeTypeDeclaration type, CodeStatementCollection statements, GenerationOptions options): base (cns, "w", statements, options) - { - this.type = type; - } - - public override CodeExpression GenerateInstanceExpression (ObjectWrapper wrapper, CodeExpression newObject) - { - string typeName = wrapper.WrappedTypeName; - string memberName = null; - if (wrapper is Wrapper.Widget) - memberName = ((Wrapper.Widget) wrapper).Wrapped.Name; - else if (wrapper is Wrapper.Action) - memberName = ((Wrapper.Action) wrapper).Name; - - if (memberName == null) - return base.GenerateInstanceExpression (wrapper, newObject); - - if (Options.UsePartialClasses) { - // Don't generate fields for top level widgets and for widgets accessible - // through other widget's properties - Wrapper.Widget ww = wrapper as Wrapper.Widget; - if (ww == null || (!ww.IsTopLevel && ww.InternalChildProperty == null && !ww.Unselectable)) { - type.Members.Add ( - new CodeMemberField ( - new CodeTypeReference (typeName, CodeTypeReferenceOptions.GlobalReference), - memberName - ) - ); - CodeExpression var = new CodeFieldReferenceExpression ( - new CodeThisReferenceExpression (), - memberName - ); - - Statements.Add ( - new CodeAssignStatement ( - var, - newObject - ) - ); - return var; - } else - return base.GenerateInstanceExpression (wrapper, newObject); - } else { - CodeExpression var = base.GenerateInstanceExpression (wrapper, newObject); - Statements.Add ( - new CodeAssignStatement ( - new CodeIndexerExpression ( - new CodeVariableReferenceExpression ("bindings"), - new CodePrimitiveExpression (memberName) - ), - var - ) - ); - return var; - } - } - } - - [Serializable] - public class SteticCompilationUnit: CodeCompileUnit - { - string name; - - public SteticCompilationUnit (string name) - { - this.name = name; - } - - public string Name { - get { return name; } - internal set { name = value; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/CodeGeneratorInternalClass.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/CodeGeneratorInternalClass.cs deleted file mode 100644 index acc7436d20f..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/CodeGeneratorInternalClass.cs +++ /dev/null @@ -1,319 +0,0 @@ - -using System; -using System.Reflection; -using System.CodeDom; -using System.CodeDom.Compiler; -using System.Collections.Generic; -using System.IO; -using System.Xml.Serialization; -using System.Collections; - -namespace Stetic -{ - internal static class CodeGeneratorInternalClass - { - static CodeExpression bindingFlags; - - static CodeGeneratorInternalClass () - { - CodeTypeReferenceExpression flagsType = new CodeTypeReferenceExpression (new CodeTypeReference ("System.Reflection.BindingFlags", CodeTypeReferenceOptions.GlobalReference)); - bindingFlags = new CodeBinaryOperatorExpression ( - new CodeFieldReferenceExpression (flagsType, "Public"), - CodeBinaryOperatorType.BitwiseOr, - new CodeFieldReferenceExpression (flagsType, "NonPublic") - ); - - bindingFlags = new CodeBinaryOperatorExpression ( - bindingFlags, - CodeBinaryOperatorType.BitwiseOr, - new CodeFieldReferenceExpression (flagsType, "Instance") - ); - } - - public static void GenerateProjectGuiCode (SteticCompilationUnit globalUnit, CodeNamespace globalNs, CodeTypeDeclaration globalType, GenerationOptions options, List units, ProjectBackend[] projects, ArrayList warnings) - { - bool multiProject = projects.Length > 1; - - // Build method overload that takes a type as parameter. - - CodeMemberMethod met = new CodeMemberMethod (); - met.Name = "Build"; - globalType.Members.Add (met); - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(object), "cobj")); - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(Type), "type")); - if (multiProject) - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(string), "file")); - met.ReturnType = new CodeTypeReference (typeof(void)); - met.Attributes = MemberAttributes.Public | MemberAttributes.Static; - - CodeMethodInvokeExpression call = new CodeMethodInvokeExpression ( - new CodeMethodReferenceExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (globalNs.Name + ".Gui", CodeTypeReferenceOptions.GlobalReference)), - "Build" - ), - new CodeArgumentReferenceExpression ("cobj"), - new CodePropertyReferenceExpression ( - new CodeArgumentReferenceExpression ("type"), - "FullName" - ) - ); - if (multiProject) - call.Parameters.Add (new CodeArgumentReferenceExpression ("file")); - - met.Statements.Add (call); - - // Generate the build method - - met = new CodeMemberMethod (); - met.Name = "Build"; - globalType.Members.Add (met); - - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(object), "cobj")); - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(string), "id")); - if (multiProject) - met.Parameters.Add (new CodeParameterDeclarationExpression (typeof(string), "file")); - met.ReturnType = new CodeTypeReference (typeof(void)); - met.Attributes = MemberAttributes.Public | MemberAttributes.Static; - - if (options.GenerateEmptyBuildMethod) - return; - - CodeArgumentReferenceExpression cobj = new CodeArgumentReferenceExpression ("cobj"); - CodeArgumentReferenceExpression cfile = new CodeArgumentReferenceExpression ("file"); - CodeArgumentReferenceExpression cid = new CodeArgumentReferenceExpression ("id"); - - CodeStatementCollection projectCol = met.Statements; - - CodeConditionStatement tcond = new CodeConditionStatement (); - tcond.Condition = new CodeMethodInvokeExpression (new CodeTypeOfExpression (typeof(Gtk.Widget)), "IsAssignableFrom", cobj); - - tcond.TrueStatements.Add ( - new CodeMethodInvokeExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (globalNs.Name + ".Gui", CodeTypeReferenceOptions.GlobalReference)), - "Initialize", - cobj - ) - ); - - // Generate code for each project - - foreach (ProjectBackend gp in projects) { - - CodeStatementCollection widgetCol; - - if (multiProject) { - CodeConditionStatement pcond = new CodeConditionStatement (); - pcond.Condition = new CodeBinaryOperatorExpression ( - cfile, - CodeBinaryOperatorType.IdentityEquality, - new CodePrimitiveExpression (gp.Id) - ); - projectCol.Add (pcond); - - widgetCol = pcond.TrueStatements; - projectCol = pcond.FalseStatements; - } else { - widgetCol = projectCol; - } - - // Generate top levels - - CodeIdentifiers ids = new CodeIdentifiers (); - - foreach (Gtk.Widget w in gp.Toplevels) { - CodeConditionStatement cond = new CodeConditionStatement (); - cond.Condition = new CodeBinaryOperatorExpression ( - cid, - CodeBinaryOperatorType.IdentityEquality, - new CodePrimitiveExpression (w.Name) - ); - widgetCol.Add (cond); - - GenerateComponentCode (w, globalUnit, globalNs, cobj, cond.TrueStatements, globalType, options, units, ids, warnings); - - widgetCol = cond.FalseStatements; - } - - // Generate action groups - - foreach (Wrapper.ActionGroup agroup in gp.ActionGroups) { - CodeConditionStatement cond = new CodeConditionStatement (); - cond.Condition = new CodeBinaryOperatorExpression ( - cid, - CodeBinaryOperatorType.IdentityEquality, - new CodePrimitiveExpression (agroup.Name) - ); - widgetCol.Add (cond); - - GenerateComponentCode (agroup, globalUnit, globalNs, cobj, cond.TrueStatements, globalType, options, units, ids, warnings); - - widgetCol = cond.FalseStatements; - } - } - } - - static CodeMemberMethod GetBuildMethod (string name, string internalClassName, string typeName, SteticCompilationUnit globalUnit, GenerationOptions options, List units) - { - SteticCompilationUnit unit; - - if (options.GenerateSingleFile) - unit = globalUnit; - else { - unit = new SteticCompilationUnit (name); - units.Add (unit); - } - - CodeTypeDeclaration type = new CodeTypeDeclaration (internalClassName); - type.Attributes = MemberAttributes.Private; - type.TypeAttributes = TypeAttributes.NestedAssembly; - - CodeNamespace cns = new CodeNamespace (options.GlobalNamespace + ".SteticGenerated"); - cns.Types.Add (type); - unit.Namespaces.Add (cns); - - // Create the build method for the component - - CodeMemberMethod met = new CodeMemberMethod (); - met.Name = "Build"; - type.Members.Add (met); - - met.Parameters.Add (new CodeParameterDeclarationExpression (new CodeTypeReference (typeName), "cobj")); - met.ReturnType = new CodeTypeReference (typeof(void)); - met.Attributes = MemberAttributes.Public | MemberAttributes.Static; - - return met; - } - - static void GenerateComponentCode (object component, SteticCompilationUnit globalUnit, CodeNamespace globalNs, CodeExpression cobj, CodeStatementCollection statements, CodeTypeDeclaration globalType, GenerationOptions options, List units, CodeIdentifiers ids, ArrayList warnings) - { - Gtk.Widget widget = component as Gtk.Widget; - Wrapper.Widget wwidget = Stetic.Wrapper.Widget.Lookup (widget); - Wrapper.ActionGroup agroup = component as Wrapper.ActionGroup; - - string name = widget != null ? widget.Name : agroup.Name; - string internalClassName = ids.MakeUnique (CodeIdentifier.MakeValid (name)); - - string typeName = widget != null ? wwidget.WrappedTypeName : "Gtk.ActionGroup"; - // Create the build method for the top level - - CodeMemberMethod met; - met = GetBuildMethod (name, internalClassName, typeName, globalUnit, options, units); - - // Generate the build code - - CodeVariableDeclarationStatement varDecHash = new CodeVariableDeclarationStatement (typeof(System.Collections.Hashtable).ToGlobalTypeRef (), "bindings"); - met.Statements.Add (varDecHash); - varDecHash.InitExpression = new CodeObjectCreateExpression ( - typeof(System.Collections.Hashtable), - new CodeExpression [0] - ); - - CodeVariableReferenceExpression targetObjectVar = new CodeVariableReferenceExpression ("cobj"); - Stetic.WidgetMap map; - - if (widget != null) { - map = Stetic.CodeGenerator.GenerateCreationCode (globalNs, globalType, widget, targetObjectVar, met.Statements, options, warnings); - CodeGenerator.BindSignalHandlers (targetObjectVar, wwidget, map, met.Statements, options); - } else { - map = Stetic.CodeGenerator.GenerateCreationCode (globalNs, globalType, agroup, targetObjectVar, met.Statements, options, warnings); - foreach (Wrapper.Action ac in agroup.Actions) - CodeGenerator.BindSignalHandlers (targetObjectVar, ac, map, met.Statements, options); - } - - GenerateBindFieldCode (met.Statements, cobj); - - // Add a method call to the build method - - statements.Add ( - new CodeMethodInvokeExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (options.GlobalNamespace + ".SteticGenerated." + internalClassName, CodeTypeReferenceOptions.GlobalReference)), - "Build", - new CodeCastExpression (typeName.ToGlobalTypeRef (), cobj) - ) - ); - } - - static void GenerateBindFieldCode (CodeStatementCollection statements, CodeExpression cobj) - { - // Bind the fields - - CodeVariableDeclarationStatement varDecIndex = new CodeVariableDeclarationStatement (typeof(int), "n"); - varDecIndex.InitExpression = new CodePrimitiveExpression (0); - CodeExpression varIndex = new CodeVariableReferenceExpression ("n"); - - CodeVariableDeclarationStatement varDecArray = new CodeVariableDeclarationStatement (typeof(FieldInfo[]).ToGlobalTypeRef (), "fields"); - varDecArray.InitExpression = new CodeMethodInvokeExpression ( - new CodeMethodInvokeExpression ( - cobj, - "GetType", - new CodeExpression [0] - ), - "GetFields", - bindingFlags - ); - statements.Add (varDecArray); - CodeVariableReferenceExpression varArray = new CodeVariableReferenceExpression ("fields"); - - CodeIterationStatement iteration = new CodeIterationStatement (); - statements.Add (iteration); - - iteration.InitStatement = varDecIndex; - - iteration.TestExpression = new CodeBinaryOperatorExpression ( - varIndex, - CodeBinaryOperatorType.LessThan, - new CodePropertyReferenceExpression (varArray, "Length") - ); - iteration.IncrementStatement = new CodeAssignStatement ( - varIndex, - new CodeBinaryOperatorExpression ( - varIndex, - CodeBinaryOperatorType.Add, - new CodePrimitiveExpression (1) - ) - ); - - CodeVariableDeclarationStatement varDecField = new CodeVariableDeclarationStatement (typeof(FieldInfo).ToGlobalTypeRef (), "field"); - varDecField.InitExpression = new CodeArrayIndexerExpression (varArray, new CodeExpression [] {varIndex}); - CodeVariableReferenceExpression varField = new CodeVariableReferenceExpression ("field"); - iteration.Statements.Add (varDecField); - - CodeVariableDeclarationStatement varDecWidget = new CodeVariableDeclarationStatement (typeof(object), "widget"); - iteration.Statements.Add (varDecWidget); - varDecWidget.InitExpression = new CodeIndexerExpression ( - new CodeVariableReferenceExpression ("bindings"), - new CodePropertyReferenceExpression (varField, "Name") - ); - CodeVariableReferenceExpression varWidget = new CodeVariableReferenceExpression ("widget"); - - // Make sure the type of the field matches the type of the widget - - CodeConditionStatement fcond = new CodeConditionStatement (); - iteration.Statements.Add (fcond); - fcond.Condition = new CodeBinaryOperatorExpression ( - new CodeBinaryOperatorExpression ( - varWidget, - CodeBinaryOperatorType.IdentityInequality, - new CodePrimitiveExpression (null) - ), - CodeBinaryOperatorType.BooleanAnd, - new CodeMethodInvokeExpression ( - new CodePropertyReferenceExpression (varField, "FieldType"), - "IsInstanceOfType", - varWidget - ) - ); - - // Set the variable value - - fcond.TrueStatements.Add ( - new CodeMethodInvokeExpression ( - varField, - "SetValue", - cobj, - varWidget - ) - ); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/CodeGeneratorPartialClass.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/CodeGeneratorPartialClass.cs deleted file mode 100644 index 42394285f21..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/CodeGeneratorPartialClass.cs +++ /dev/null @@ -1,144 +0,0 @@ - -using System; -using System.Reflection; -using System.CodeDom; -using System.CodeDom.Compiler; -using System.Collections.Generic; -using System.Collections; -using System.IO; - -namespace Stetic -{ - internal static class CodeGeneratorPartialClass - { - public static void GenerateProjectGuiCode (SteticCompilationUnit globalUnit, CodeNamespace globalNs, CodeTypeDeclaration globalType, GenerationOptions options, List units, ProjectBackend[] projects, ArrayList warnings) - { - // Generate code for each project - foreach (ProjectBackend gp in projects) { - - // Generate top levels - foreach (Gtk.Widget w in gp.Toplevels) - GenerateWidgetCode (globalUnit, globalNs, options, units, w, warnings, !options.GenerateModifiedOnly || gp.IsWidgetModified (w.Name)); - - // Generate global action groups - foreach (Wrapper.ActionGroup agroup in gp.ActionGroups) - GenerateGlobalActionGroupCode (globalUnit, globalNs, options, units, agroup, warnings); - } - } - - static CodeTypeDeclaration CreatePartialClass (SteticCompilationUnit globalUnit, List units, GenerationOptions options, string name) - { - SteticCompilationUnit unit; - - if (options.GenerateSingleFile) - unit = globalUnit; - else { - unit = new SteticCompilationUnit (name); - if (units != null) - units.Add (unit); - } - - string ns = ""; - int i = name.LastIndexOf ('.'); - if (i != -1) { - ns = name.Substring (0, i); - name = name.Substring (i+1); - } - - CodeTypeDeclaration type = new CodeTypeDeclaration (name); - type.IsPartial = true; - type.Attributes = MemberAttributes.Public; - type.TypeAttributes = TypeAttributes.Public; - - CodeNamespace cns = new CodeNamespace (ns); - cns.Types.Add (type); - unit.Namespaces.Add (cns); - return type; - } - - - static void GenerateWidgetCode (SteticCompilationUnit globalUnit, CodeNamespace globalNs, GenerationOptions options, List units, Gtk.Widget w, ArrayList warnings, bool regenerateWidgetClass) - { - if (options.GenerateSingleFile) - regenerateWidgetClass = true; - - // Don't register this unit if the class doesn't need to be regenerated - if (!regenerateWidgetClass) - units = null; - - CodeTypeDeclaration type = CreatePartialClass (globalUnit, units, options, w.Name); - - // Generate the build method - CodeMemberMethod met = new CodeMemberMethod (); - met.Name = "Build"; - type.Members.Add (met); - met.ReturnType = new CodeTypeReference (typeof(void)); - met.Attributes = MemberAttributes.Family; - - Stetic.Wrapper.Widget wwidget = Stetic.Wrapper.Widget.Lookup (w); - - if (regenerateWidgetClass) { - - if (options.GenerateEmptyBuildMethod) { - GenerateWrapperFields (type, wwidget); - return; - } - - met.Statements.Add ( - new CodeMethodInvokeExpression ( - new CodeTypeReferenceExpression (new CodeTypeReference (globalNs.Name + ".Gui", CodeTypeReferenceOptions.GlobalReference)), - "Initialize", - new CodeThisReferenceExpression () - ) - ); - - if (wwidget.GeneratePublic) - type.TypeAttributes = TypeAttributes.Public; - else - type.TypeAttributes = TypeAttributes.NotPublic; - - if (!String.IsNullOrEmpty (wwidget.UIManagerName)) - type.Members.Add (new CodeMemberField (new CodeTypeReference ("Gtk.UIManager", CodeTypeReferenceOptions.GlobalReference), wwidget.UIManagerName)); - } - - // We need to generate the creation code even if regenerateWidgetClass is false because GenerateCreationCode - // may inject support classes or methods into the global namespace, which is always generated - - Stetic.WidgetMap map = Stetic.CodeGenerator.GenerateCreationCode (globalNs, type, w, new CodeThisReferenceExpression (), met.Statements, options, warnings); - - if (regenerateWidgetClass) - CodeGenerator.BindSignalHandlers (new CodeThisReferenceExpression (), wwidget, map, met.Statements, options); - } - - static void GenerateWrapperFields (CodeTypeDeclaration type, ObjectWrapper wrapper) - { - foreach (ObjectBindInfo binfo in CodeGenerator.GetFieldsToBind (wrapper)) { - type.Members.Add ( - new CodeMemberField ( - new CodeTypeReference (binfo.TypeName, CodeTypeReferenceOptions.GlobalReference), - binfo.Name - ) - ); - } - } - - - static void GenerateGlobalActionGroupCode (SteticCompilationUnit globalUnit, CodeNamespace globalNs, GenerationOptions options, List units, Wrapper.ActionGroup agroup, ArrayList warnings) - { - CodeTypeDeclaration type = CreatePartialClass (globalUnit, units, options, agroup.Name); - - // Generate the build method - - CodeMemberMethod met = new CodeMemberMethod (); - met.Name = "Build"; - type.Members.Add (met); - met.ReturnType = new CodeTypeReference (typeof(void)); - met.Attributes = MemberAttributes.Public; - - Stetic.WidgetMap map = Stetic.CodeGenerator.GenerateCreationCode (globalNs, type, agroup, new CodeThisReferenceExpression (), met.Statements, options, warnings); - - foreach (Wrapper.Action ac in agroup.Actions) - CodeGenerator.BindSignalHandlers (new CodeThisReferenceExpression (), ac, map, met.Statements, options); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Component.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Component.cs deleted file mode 100644 index 1a1d495ccf7..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Component.cs +++ /dev/null @@ -1,112 +0,0 @@ - -using System; -using System.Collections; - -namespace Stetic -{ - public class Component: MarshalByRefObject, IObjectFrontend - { - protected string name; - protected ComponentType type; - protected string typeName; - protected object backend; - protected Application app; - - public event EventHandler Changed; - - internal Component (Application app, object backend, string name, ComponentType type) - { - this.app = app; - this.backend = backend; - this.name = name; - this.type = type; - } - - public virtual void Dispose () - { - System.Runtime.Remoting.RemotingServices.Disconnect (this); - if (app != null) - app.DisposeComponent (this); - } - - public SignalCollection GetSignals () - { - if (backend is ObjectWrapper) - return ((ObjectWrapper)backend).Signals; - else - return new SignalCollection (); - } - - public void RemoveSignal (Signal signal) - { - if (backend is ObjectWrapper && app != null) - app.Backend.RemoveWidgetSignal ((ObjectWrapper) backend, signal); - } - - public virtual Component[] GetChildren () - { - return new Component [0]; - } - - void IObjectFrontend.NotifyChanged () - { - OnChanged (); - } - - protected virtual void OnChanged () - { - if (Changed != null) - Changed (this, EventArgs.Empty); - } - - public virtual string Name { - get { return name; } - set { name = value; } - } - - public virtual ComponentType Type { - get { - return type; - } - } - - public virtual bool GeneratePublic { - get { return true; } - set {} - } - - internal object Backend { - get { return backend; } - } - - internal static MarshalByRefObject GetSafeReference (MarshalByRefObject ob) - { - // Make sure we don't leak the wrapper type to the frontend process - - if (ob is Wrapper.Window) { - System.Runtime.Remoting.RemotingServices.Marshal (ob, null, typeof(Wrapper.Window)); - } else if (ob is Wrapper.Container) { - System.Runtime.Remoting.RemotingServices.Marshal (ob, null, typeof(Wrapper.Container)); - } else if (ob is Wrapper.Widget) { - System.Runtime.Remoting.RemotingServices.Marshal (ob, null, typeof(Wrapper.Widget)); - } else if (ob is ObjectWrapper) { - System.Runtime.Remoting.RemotingServices.Marshal (ob, null, typeof(ObjectWrapper)); - } - return ob; - } - - public override string ToString () - { - return base.ToString() + " " + backend; - } - - public ObjectBindInfo[] GetObjectBindInfo () - { - ObjectWrapper ww = backend as ObjectWrapper; - if (ww != null) - return app.Backend.GetBoundComponents (ww); - else - return new ObjectBindInfo [0]; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ComponentEventHandler.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/ComponentEventHandler.cs deleted file mode 100644 index d4226f0da72..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ComponentEventHandler.cs +++ /dev/null @@ -1,67 +0,0 @@ - -using System; - -namespace Stetic -{ - public delegate void ComponentEventHandler (object sender, ComponentEventArgs args); - public delegate void ComponentNameEventHandler (object sender, ComponentNameEventArgs args); - public delegate void ComponentRemovedEventHandler (object sender, ComponentRemovedEventArgs args); - - public class ComponentEventArgs: EventArgs - { - Project project; - Component component; - - internal ComponentEventArgs (Project p, Component c) - { - project = p; - component = c; - } - - public Project Project { - get { return project; } - } - - public Component Component { - get { return component; } - } - } - - public class ComponentNameEventArgs: ComponentEventArgs - { - string oldName; - - internal ComponentNameEventArgs (Project p, Component c, string oldName): base (p, c) - { - this.oldName = oldName; - } - - public string OldName { - get { return oldName; } - } - - public string NewName { - get { return Component.Name; } - } - } - - public class ComponentRemovedEventArgs: EventArgs - { - Project project; - string componentName; - - internal ComponentRemovedEventArgs (Project p, string name) - { - project = p; - componentName = name; - } - - public Project Project { - get { return project; } - } - - public string ComponentName { - get { return componentName; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ComponentSignalEventHandler.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/ComponentSignalEventHandler.cs deleted file mode 100644 index 07c6263a71e..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ComponentSignalEventHandler.cs +++ /dev/null @@ -1,27 +0,0 @@ - -using System; - -namespace Stetic -{ - public delegate void ComponentSignalEventHandler (object sender, ComponentSignalEventArgs args); - - public class ComponentSignalEventArgs: ComponentEventArgs - { - public Signal oldSignal; - public Signal signal; - - public ComponentSignalEventArgs (Project p, Component c, Signal oldSignal, Signal signal): base (p, c) - { - this.oldSignal = oldSignal; - this.signal = signal; - } - - public Signal Signal { - get { return signal; } - } - - public Signal OldSignal { - get { return oldSignal; } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ComponentType.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/ComponentType.cs deleted file mode 100644 index 47ed725282c..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ComponentType.cs +++ /dev/null @@ -1,94 +0,0 @@ - -using System; - -namespace Stetic -{ - public class ComponentType - { - Application app; - string name; - string description; - string className; - string category; - Gdk.Pixbuf icon; - ActionComponent action; - string targetGtkVersion; - string library; - static ComponentType unknown; - - internal ComponentType (Application app, string name, string desc, string className, string category, string targetGtkVersion, string library, Gdk.Pixbuf icon) - { - this.app = app; - this.name = name; - this.description = desc; - this.icon = icon; - this.className = className; - this.category = category; - this.targetGtkVersion = targetGtkVersion; - this.library = library; - } - - internal ComponentType (Application app, ActionComponent action) - { - this.action = action; - this.app = app; - this.name = action.Name; - this.description = action.Label != null ? action.Label.Replace ("_", "") : action.Name; - this.icon = action.Icon; - this.className = "Gtk.Action"; - this.category = "Actions / " + action.ActionGroup.Name; - this.targetGtkVersion = "2.4"; // Not version-specific - } - - public string Name { - get { return name; } - } - - public string ClassName { - get { return className; } - } - - public string Category { - get { return category; } - } - - public string Description { - get { return description; } - } - - public string Library { - get { return library; } - } - - public Gdk.Pixbuf Icon { - get { return icon; } - } - - internal ActionComponent Action { - get { return action; } - } - - internal static ComponentType Unknown { - get { - if (unknown == null) { - unknown = new ComponentType (null, "Unknown", "Unknown", "", "", "2.4", null, WidgetUtils.MissingIcon); - } - return unknown; - } - } - - public object[] InitializationValues { - get { - if (app == null) - return new object [0]; - return app.Backend.GetClassDescriptorInitializationValues (name); - } - } - - public string TargetGtkVersion { - get { - return targetGtkVersion; - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ContainerUndoRedoManager.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/ContainerUndoRedoManager.cs deleted file mode 100644 index ddfe62d2e74..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ContainerUndoRedoManager.cs +++ /dev/null @@ -1,18 +0,0 @@ - -using System; -using System.Xml; -using System.Collections; - -namespace Stetic -{ - class ContainerUndoRedoManager: UndoRedoManager - { - protected override object GetDiff (ObjectWrapper w) - { - // Only track changes in widgets. - Wrapper.Widget widget = w as Wrapper.Widget; - if (widget != null) return w.GetUndoDiff (); - else return null; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ContextMenu.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/ContextMenu.cs deleted file mode 100644 index 3b64a286f56..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ContextMenu.cs +++ /dev/null @@ -1,174 +0,0 @@ -using Gtk; -using System; -using System.Collections; -using System.Reflection; -using Mono.Unix; - -namespace Stetic { - - class ContextMenu : Gtk.Menu { - - Gtk.Widget widget; - IEditableObject editable; - - public ContextMenu (Placeholder ph) - { - MenuItem item; - - editable = ph; - this.widget = ph; - - item = LabelItem (ph); - item.Sensitive = false; - Add (item); - - item = new MenuItem (Catalog.GetString ("_Select")); - item.Sensitive = false; - Add (item); - - BuildContextMenu (Stetic.Wrapper.Container.LookupParent (ph), true, ph); - } - - public ContextMenu (Stetic.Wrapper.Widget wrapper) : this (wrapper, wrapper.Wrapped) {} - - public ContextMenu (Stetic.Wrapper.Widget wrapper, Gtk.Widget context) - { - MenuItem item; - - editable = wrapper; - widget = wrapper.Wrapped; - - if (widget == context) { - item = LabelItem (widget); - item.Sensitive = false; - Add (item); - } - - item = new MenuItem (Catalog.GetString ("_Select")); - item.Activated += DoSelect; - Add (item); - - ClassDescriptor klass = wrapper.ClassDescriptor; - if (klass != null) { - foreach (ItemDescriptor id in klass.ContextMenu) { - CommandDescriptor cmd = (CommandDescriptor)id; - if (!cmd.VisibleFor (widget)) - continue; - item = new MenuItem (cmd.Label); - if (cmd.Enabled (widget, context)) { - Gtk.Widget wdup = widget, cdup = context; // FIXME bxc 75689 - item.Activated += delegate (object o, EventArgs args) { - cmd.Run (wdup, cdup); - }; - } else - item.Sensitive = false; - Add (item); - } - } - - BuildContextMenu (wrapper.ParentWrapper, widget == context, context); - } - - void BuildContextMenu (Stetic.Wrapper.Widget parentWrapper, bool top, Widget context) - { - MenuItem item; - - item = new ImageMenuItem (Gtk.Stock.Cut, null); - if (editable.CanCut) - item.Activated += DoCut; - else - item.Sensitive = false; - Add (item); - - item = new ImageMenuItem (Gtk.Stock.Copy, null); - if (editable.CanCopy) - item.Activated += DoCopy; - else - item.Sensitive = false; - Add (item); - - item = new ImageMenuItem (Gtk.Stock.Paste, null); - if (editable.CanPaste) - item.Activated += DoPaste; - else - item.Sensitive = false; - Add (item); - - if (editable.CanDelete) { - item = new ImageMenuItem (Gtk.Stock.Delete, null); - item.Activated += DoDelete; - Add (item); - } - - if (top) { - for (; parentWrapper != null; parentWrapper = parentWrapper.ParentWrapper) { - Add (new SeparatorMenuItem ()); - - item = LabelItem (parentWrapper.Wrapped); - item.Submenu = new ContextMenu (parentWrapper, context); - Add (item); - } - } - - ShowAll (); - } - - protected override void OnSelectionDone () - { - Destroy (); - } - - void DoSelect (object obj, EventArgs args) - { - Stetic.Wrapper.Widget wrapper = Stetic.Wrapper.Widget.Lookup (widget); - if (wrapper != null) - wrapper.Select (); - } - - void DoCut (object obj, EventArgs args) - { - editable.Cut (); - } - - void DoCopy (object obj, EventArgs args) - { - editable.Copy (); - } - - void DoPaste (object obj, EventArgs args) - { - editable.Paste (); - } - - void DoDelete (object obj, EventArgs args) - { - editable.Delete (); - } - - static MenuItem LabelItem (Gtk.Widget widget) - { - ImageMenuItem item; - Label label; - - label = new Label (widget is Placeholder ? Catalog.GetString ("Placeholder") : widget.Name); - label.UseUnderline = false; - label.SetAlignment (0.0f, 0.5f); - item = new ImageMenuItem (); - item.Add (label); - - Wrapper.Widget wrapper = Stetic.Wrapper.Widget.Lookup (widget); - - if (wrapper != null) { - ClassDescriptor klass = wrapper.ClassDescriptor; - if (klass != null) { - Gdk.Pixbuf pixbuf = klass.Icon; - int width, height; - Gtk.Icon.SizeLookup (Gtk.IconSize.Menu, out width, out height); - item.Image = new Gtk.Image (pixbuf.ScaleSimple (width, height, Gdk.InterpType.Bilinear)); - } - } - - return item; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Designer.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Designer.cs deleted file mode 100644 index 21aaf500c73..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Designer.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Designer.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (c) 2007 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -// - -using System; - -namespace Stetic -{ - public abstract class Designer: PluggableWidget - { - protected Designer (Application app): base (app) - { - } - - internal virtual void SetActive () - { - } - - public abstract ProjectItemInfo ProjectItem { get; } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Glade.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Glade.cs deleted file mode 100644 index da4bd13d3f0..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Glade.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Xml; -using System.Collections; -using System.Reflection; -using System.Runtime.InteropServices; -using Mono.Unix; - -using Gtk; - -namespace Stetic { - - internal static class GladeFiles { - - public static void Import (ProjectBackend project, string filename) - { - XmlDocument doc = new XmlDocument (); - doc.PreserveWhitespace = true; - doc.XmlResolver = null; - doc.Load (filename); - project.SetFileName (filename); - project.Id = System.IO.Path.GetFileName (filename); - doc = GladeUtils.XslImportTransform (doc); - - XmlNode node = doc.SelectSingleNode ("/glade-interface"); - if (node == null) - throw new ApplicationException (Catalog.GetString ("Not a glade file according to node name.")); - - ObjectReader reader = new ObjectReader (project, FileFormat.Glade); - foreach (XmlElement toplevel in node.SelectNodes ("widget")) { - Wrapper.Container wrapper = Stetic.ObjectWrapper.ReadObject (reader, toplevel) as Wrapper.Container; - if (wrapper != null) - project.AddWidget ((Gtk.Widget)wrapper.Wrapped); - } - } - - public static void Export (ProjectBackend project, string filename) - { - XmlDocument doc = new XmlDocument (); - doc.PreserveWhitespace = true; - - XmlElement toplevel = doc.CreateElement ("glade-interface"); - doc.AppendChild (toplevel); - - ObjectWriter owriter = new ObjectWriter (doc, FileFormat.Glade); - foreach (Widget w in project.Toplevels) { - Stetic.Wrapper.Container wrapper = Stetic.Wrapper.Container.Lookup (w); - if (wrapper == null) - continue; - - XmlElement elem = wrapper.Write (owriter); - if (elem != null) - toplevel.AppendChild (elem); - } - - doc = GladeUtils.XslExportTransform (doc); - - XmlTextWriter writer = new XmlTextWriter (filename, EncodingUtility.UTF8NoBom); - writer.Formatting = Formatting.Indented; - doc.Save (writer); - writer.Close (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Grid.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Grid.cs deleted file mode 100644 index bb81cfb8d1e..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Grid.cs +++ /dev/null @@ -1,349 +0,0 @@ -using Gtk; -using System; -using System.Collections; - -namespace Stetic { - - internal class Grid : Gtk.Container { - - public Grid () : base () - { - Stetic.Editor.GtkWorkarounds.FixContainerLeak (this); - - BorderWidth = 2; - WidgetFlags |= WidgetFlags.NoWindow; - lines = new ArrayList (); - group = null; - } - - // Padding constants - const int groupPad = 6; - const int hPad = 6; - const int linePad = 3; - - // Theme-based sizes; computed at first SizeRequest - static int indent = -1; - static int lineHeight = -1; - - Grid[] group; - public static void Connect (params Grid[] grids) - { - for (int i = 0; i < grids.Length; i++) { - grids[i].group = new Grid[grids.Length - 1]; - Array.Copy (grids, 0, grids[i].group, 0, i); - Array.Copy (grids, i + 1, grids[i].group, i, grids.Length - i - 1); - } - } - - class Pair { - Gtk.Widget label; - Gtk.Widget editor; - - public Pair (Grid grid, string name, Widget editor) : this (grid, name, editor, null) {} - - public Pair (Grid grid, string name, Widget editor, string description) - { - Gtk.Label l = new Label (name); - l.UseMarkup = true; - l.Justify = Justification.Left; - l.Xalign = 0; - l.Show (); - - if (description == null) - label = l; - else { - Gtk.EventBox ebox = new Gtk.EventBox (); - ebox.Add (l); - ebox.Show (); - ebox.TooltipText = description; - label = ebox; - } - label.Parent = grid; - - this.editor = editor; - editor.Parent = grid; - editor.Show (); - } - - public Widget Label { - get { - return label; - } - } - - public Widget Editor { - get { - return editor; - } - } - } - - // list of widgets and Stetic.Grid.Pairs - ArrayList lines; - - public void Append (Widget w) - { - w.Parent = this; - w.Show (); - - lines.Add (w); - QueueDraw (); - } - - public void Append (Widget w, string description) - { - if ((w.WidgetFlags & WidgetFlags.NoWindow) != 0) { - Gtk.EventBox ebox = new Gtk.EventBox (); - ebox.Add (w); - ebox.Show (); - w = ebox; - } - w.Parent = this; - w.Show (); - w.TooltipText = description; - lines.Add (w); - QueueDraw (); - } - - public void AppendLabel (string text) - { - Gtk.Label label = new Label (text); - label.UseMarkup = true; - label.Justify = Justification.Left; - label.Xalign = 0; - Append (label); - } - - public void AppendGroup (string name, bool expanded) - { - Gtk.Expander exp = new Expander ("" + name + ""); - exp.UseMarkup = true; - exp.Expanded = expanded; - exp.AddNotification ("expanded", ExpansionChanged); - Append (exp); - } - - public void AppendPair (string label, Widget editor, string description) - { - Stetic.Grid.Pair pair = new Pair (this, label, editor, description); - lines.Add (pair); - QueueDraw (); - } - - protected override void OnRemoved (Widget w) - { - w.Unparent (); - } - - void ExpansionChanged (object obj, GLib.NotifyArgs args) - { - Gtk.Expander exp = obj as Gtk.Expander; - - int ind = lines.IndexOf (exp); - if (ind == -1) - return; - - ind++; - while (ind < lines.Count && !(lines[ind] is Gtk.Expander)) { - if (lines[ind] is Widget) { - Widget w = (Widget)lines[ind]; - if (exp.Expanded) - w.Show (); - else - w.Hide (); - } else if (lines[ind] is Pair) { - Pair p = (Pair)lines[ind]; - if (exp.Expanded) { - p.Label.Show (); - p.Editor.Show (); - } else { - p.Label.Hide (); - p.Editor.Hide (); - } - } - ind++; - } - - QueueDraw (); - } - - protected void Clear () - { - foreach (object obj in lines) { - if (obj is Widget) - ((Widget)obj).Destroy (); - else if (obj is Pair) { - Pair p = (Pair)obj; - p.Label.Destroy (); - p.Editor.Destroy (); - } - } - - lines.Clear (); - } - - protected override void ForAll (bool include_internals, Gtk.Callback callback) - { - if (!include_internals) - return; - - foreach (object obj in lines) { - if (obj is Widget) - callback ((Widget)obj); - else if (obj is Pair) { - Pair p = (Pair)obj; - callback (p.Label); - callback (p.Editor); - } - } - } - - // These are figured out at requisition time and used again at - // allocation time. - int lwidth, ewidth; - - void SizeRequestGrid (Grid grid, ref Gtk.Requisition req) - { - bool visible = true; - - req.Width = req.Height = 0; - foreach (object obj in grid.lines) { - if (obj is Expander) { - Gtk.Widget w = (Gtk.Widget)obj; - Gtk.Requisition childreq; - - childreq = w.SizeRequest (); - if (req.Width < childreq.Width) - req.Width = childreq.Width; - req.Height += groupPad + childreq.Height; - - visible = ((Gtk.Expander)obj).Expanded; - - if (indent == -1) { - // Seems like there should be an easier way... - int focusWidth = (int)w.StyleGetProperty ("focus-line-width"); - int focusPad = (int)w.StyleGetProperty ("focus-padding"); - int expanderSize = (int)w.StyleGetProperty ("expander-size"); - int expanderSpacing = (int)w.StyleGetProperty ("expander-spacing"); - indent = focusWidth + focusPad + expanderSize + 2 * expanderSpacing; - } - } else if (obj is Widget) { - Gtk.Widget w = (Gtk.Widget)obj; - Gtk.Requisition childreq; - - childreq = w.SizeRequest (); - if (lwidth < childreq.Width) - lwidth = childreq.Width; - if (visible) - req.Height += linePad + childreq.Height; - } else if (obj is Pair) { - Pair p = (Pair)obj; - Gtk.Requisition lreq, ereq; - - lreq = p.Label.SizeRequest (); - ereq = p.Editor.SizeRequest (); - - if (lineHeight == -1) - lineHeight = (int)(1.5 * lreq.Height); - - if (lreq.Width > lwidth) - lwidth = lreq.Width; - if (ereq.Width > ewidth) - ewidth = ereq.Width; - - if (visible) - req.Height += Math.Max (lineHeight, ereq.Height) + linePad; - } - } - - req.Width = Math.Max (req.Width, indent + lwidth + hPad + ewidth); - req.Height += 2 * (int)BorderWidth; - req.Width += 2 * (int)BorderWidth; - } - - protected override void OnSizeRequested (ref Gtk.Requisition req) - { - lwidth = ewidth = 0; - - if (group != null) { - foreach (Grid grid in group) - SizeRequestGrid (grid, ref req); - } - - SizeRequestGrid (this, ref req); - } - - protected override void OnSizeAllocated (Gdk.Rectangle alloc) - { - int xbase = alloc.X + (int)BorderWidth; - int ybase = alloc.Y + (int)BorderWidth; - - base.OnSizeAllocated (alloc); - - int y = ybase; - bool visible = true; - - foreach (object obj in lines) { - if (!visible && !(obj is Expander)) - continue; - - if (obj is Widget) { - Gtk.Widget w = (Gtk.Widget)obj; - if (!w.Visible) - continue; - - Gdk.Rectangle childalloc; - Gtk.Requisition childreq; - - childreq = w.ChildRequisition; - - if (obj is Expander) { - childalloc.X = xbase; - childalloc.Width = alloc.Width - 2 * (int)BorderWidth; - visible = ((Gtk.Expander)obj).Expanded; - y += groupPad; - } else { - childalloc.X = xbase + indent; - childalloc.Width = lwidth; - y += linePad; - } - childalloc.Y = y; - childalloc.Height = childreq.Height; - w.SizeAllocate (childalloc); - - y += childalloc.Height; - } else if (obj is Pair) { - Pair p = (Pair)obj; - if (!p.Editor.Visible) { - p.Label.Hide (); - continue; - } else if (!p.Label.Visible) - p.Label.Show (); - - Gtk.Requisition lreq, ereq; - Gdk.Rectangle lalloc, ealloc; - - lreq = p.Label.ChildRequisition; - ereq = p.Editor.ChildRequisition; - - lalloc.X = xbase + indent; - if (ereq.Height < lineHeight * 2) - lalloc.Y = y + (ereq.Height - lreq.Height) / 2; - else - lalloc.Y = y + (lineHeight - lreq.Height) / 2; - lalloc.Width = lwidth; - lalloc.Height = lreq.Height; - p.Label.SizeAllocate (lalloc); - - ealloc.X = lalloc.X + lwidth + hPad; - ealloc.Y = y + Math.Max (0, (lineHeight - ereq.Height) / 2); - ealloc.Width = Math.Max (ewidth, alloc.Width - 2 * (int)BorderWidth - ealloc.X); - ealloc.Height = ereq.Height; - p.Editor.SizeAllocate (ealloc); - - y += Math.Max (ereq.Height, lineHeight) + linePad; - } - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/GuiDispatchServerSink.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/GuiDispatchServerSink.cs deleted file mode 100644 index 9bf683e2337..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/GuiDispatchServerSink.cs +++ /dev/null @@ -1,142 +0,0 @@ - -using System; -using System.Threading; -using System.IO; -using System.Runtime.Remoting; -using System.Runtime.Remoting.Channels; -using System.Runtime.Remoting.Messaging; -using System.Collections; - -namespace Stetic -{ - public class GuiDispatchServerSink: IServerChannelSink, IChannelSinkBase - { - IServerChannelSink nextSink; - - public GuiDispatchServerSink (IServerChannelSink nextSink, IChannelReceiver receiver) - { - this.nextSink = nextSink; - } - - public IServerChannelSink NextChannelSink { - get { return nextSink; } - } - - public IDictionary Properties { - get { return null; } - } - - public void AsyncProcessResponse (IServerResponseChannelSinkStack sinkStack, object state, - IMessage msg, ITransportHeaders headers, Stream stream) - - { - sinkStack.AsyncProcessResponse (msg, headers, stream); - } - - public Stream GetResponseStream (IServerResponseChannelSinkStack sinkStack, object state, - IMessage msg, ITransportHeaders headers) - { - // this method shouldn't be called - throw new NotSupportedException (); - } - - public ServerProcessing ProcessMessage (IServerChannelSinkStack sinkStack, - IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, - out IMessage responseMsg, out ITransportHeaders responseHeaders, out Stream responseStream) - { - IMethodCallMessage msg = (IMethodCallMessage) requestMsg; -// Console.WriteLine ("MESSAGE: " + msg.TypeName + " - " + msg.MethodName); - - sinkStack.Push (this, null); - - if (Attribute.IsDefined (msg.MethodBase, typeof(NoGuiDispatchAttribute))) { - ServerProcessing ret; - try { - ret = nextSink.ProcessMessage (sinkStack, - requestMsg, - requestHeaders, - requestStream, - out responseMsg, - out responseHeaders, - out responseStream); - } finally { - sinkStack.Pop (this); - } - return ret; - } - else - { - Dispatcher d = new Dispatcher (); - d.nextSink = nextSink; - d.sinkStack = sinkStack; - d.requestMsg = requestMsg; - d.requestHeaders = requestHeaders; - d.requestStream = requestStream; - - Gtk.Application.Invoke (d.Dispatch); - responseMsg = null; - responseHeaders = null; - responseStream = null; - - return ServerProcessing.Async; - } - } - - class Dispatcher - { - public IServerChannelSink nextSink; - - public IServerChannelSinkStack sinkStack; - public IMessage requestMsg; - public ITransportHeaders requestHeaders; - public Stream requestStream; - - public void Dispatch (object o, EventArgs a) - { - IMessage responseMsg; - ITransportHeaders responseHeaders = null; - Stream responseStream = null; - - try { - nextSink.ProcessMessage (sinkStack, - requestMsg, - requestHeaders, - requestStream, - out responseMsg, - out responseHeaders, - out responseStream); - } - catch (Exception ex) { - responseMsg = new ReturnMessage (ex, (IMethodCallMessage)requestMsg); - } - - sinkStack.AsyncProcessResponse (responseMsg, responseHeaders, responseStream); - } - } - } - - class GuiDispatch - { - public static void InvokeSync (EventHandler h) - { - if (GLib.MainContext.Depth > 0) - h (null, null); - else { - object wo = new object (); - lock (wo) { - Gtk.Application.Invoke ((o, args) => { - try { - h (null, null); - } finally { - lock (wo) { - System.Threading.Monitor.PulseAll (wo); - } - } - }); - System.Threading.Monitor.Wait (wo); - } - } - } - } - -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/GuiDispatchServerSinkProvider.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/GuiDispatchServerSinkProvider.cs deleted file mode 100644 index d35c2b39503..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/GuiDispatchServerSinkProvider.cs +++ /dev/null @@ -1,30 +0,0 @@ - -using System; -using System.Runtime.Remoting; -using System.Runtime.Remoting.Channels; - -namespace Stetic -{ - public class GuiDispatchServerSinkProvider: IServerFormatterSinkProvider, IServerChannelSinkProvider - { - private IServerChannelSinkProvider next; - - public IServerChannelSinkProvider Next { - get { return next; } - set { next = value; } - } - - public IServerChannelSink CreateSink (IChannelReceiver channel) - { - IServerChannelSink chain = next.CreateSink (channel); - GuiDispatchServerSink sink = new GuiDispatchServerSink (chain, channel); - return sink; - } - - public void GetChannelData (IChannelDataStore channelData) - { - if(next != null) - next.GetChannelData(channelData); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/LibraryCache.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/LibraryCache.cs deleted file mode 100644 index 4185b16ae27..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/LibraryCache.cs +++ /dev/null @@ -1,798 +0,0 @@ -// LibraryCache.cs : Assembly file caching class -// -// Author: Mike Kestner -// -// Copyright (c) 2008 Novell, Inc -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.IO; -using System.Xml; -using System.Xml.Serialization; -using ENV = System.Environment; -using Mono.Cecil; - -namespace Stetic { - - public class LibraryCache { - - public class LibraryInfo { - - public LibraryInfo () {} - - string file; - Guid guid; - DateTime timestamp; - XmlDocument gui; - XmlDocument objects; - - string CacheDirectory { - get { return Path.Combine (dir, Guid.ToString ()); } - } - - [XmlAttribute] - public string File { - get { return file; } - set { file = value; } - } - - [XmlAttribute] - public Guid Guid { - get { return guid; } - set { - string path = Path.Combine (dir, guid.ToString ()); - if (Directory.Exists (path)) - Directory.Delete (path, true); - guid = value; - } - } - - public bool IsCurrent { - get { - return Timestamp == System.IO.File.GetLastWriteTime (file).ToUniversalTime (); - } - } - - [XmlIgnore] - public XmlDocument GuiDocument { - get { - if (gui == null) { - if (System.IO.File.Exists (GuiPath)) { - try { - gui = new XmlDocument (); - using (Stream stream = System.IO.File.Open (GuiPath, FileMode.Open)) - gui.Load (stream); - } catch (Exception) { - gui = null; - } - } - } - return gui; - } - set { - gui = value; - WriteGuiFile (); - } - } - - string GuiPath { - get { return Path.Combine (CacheDirectory, "steticGui"); } - } - - public bool HasWidgets { - get { return System.IO.File.Exists (ObjectsPath); } - } - - [XmlIgnore] - public XmlDocument ObjectsDocument { - get { - if (objects == null) { - if (System.IO.File.Exists (ObjectsPath)) { - try { - objects = new XmlDocument (); - using (Stream stream = System.IO.File.Open (ObjectsPath, FileMode.Open)) - objects.Load (stream); - } catch (Exception) { - objects = null; - } - } - } - return objects; - } - set { - objects = value; - WriteObjectsFile (); - if (objects == null && gui != null) - GuiDocument = null; - } - } - - internal ToolboxItemInfo GetToolboxItem (string name, string asmName) - { - XmlDocument doc = ObjectsDocument; - if (doc != null) { - XmlElement elem = (XmlElement) doc.SelectSingleNode ("/objects/object[@type='" + name + "']"); - if (elem == null) - elem = (XmlElement) doc.SelectSingleNode ("/objects/object[@type='" + name + "," + asmName + "']"); - if (elem != null) { - ToolboxItemInfo info = new ToolboxItemInfo (elem.GetAttribute ("base-type")); - info.PaletteCategory = elem.GetAttribute ("palette-category"); - return info; - } - - } - return null; - } - - string ObjectsPath { - get { return Path.Combine (CacheDirectory, "objects"); } - } - - [XmlAttribute] - public DateTime Timestamp { - get { return timestamp; } - set { timestamp = value; } - } - - void WriteGuiFile () - { - if (gui == null) { - if (System.IO.File.Exists (GuiPath)) - System.IO.File.Delete (GuiPath); - return; - } - if (!Directory.Exists (CacheDirectory)) - Directory.CreateDirectory (CacheDirectory); - - using (Stream stream = System.IO.File.Create (GuiPath)) - gui.Save (stream); - } - - public void WriteObjectsFile () - { - if (objects == null) { - if (System.IO.File.Exists (ObjectsPath)) - System.IO.File.Delete (ObjectsPath); - return; - } - - if (!Directory.Exists (CacheDirectory)) - Directory.CreateDirectory (CacheDirectory); - - using (Stream stream = System.IO.File.Create (ObjectsPath)) - objects.Save (stream); - } - - public event EventHandler Changed; - - public void OnChanged () - { - if (Changed != null) - Changed (this, EventArgs.Empty); - } - } - - static string dir = Path.Combine (Path.Combine (ENV.GetFolderPath (ENV.SpecialFolder.ApplicationData), "stetic"), "library-cache"); - - public class LibraryInfoCollection : IEnumerable { - - Dictionary libs = new Dictionary (); - - public LibraryInfo this [string path] { - get { - path = Path.GetFullPath (path); - if (libs.ContainsKey (path)) - return libs [path]; - return null; - } - } - - public void Add (object obj) - { - Add (obj as LibraryInfo); - } - - public void Add (LibraryInfo info) - { - libs [info.File] = info; - } - - public IEnumerator GetEnumerator () - { - return libs.Values.GetEnumerator (); - } - - public void Remove (string file) - { - file = Path.GetFullPath (file); - libs.Remove (file); - } - } - - public static LibraryCache Cache = Load (); - - [XmlArray] - [XmlArrayItem (ElementName="LibraryInfo", Type=typeof(LibraryInfo))] - public LibraryInfoCollection Members = new LibraryInfoCollection (); - - public LibraryCache () {} - - public LibraryInfo this [string file] { - get { - file = Path.GetFullPath (file); - if (IsCurrent (file)) - return Members [file]; - - Refresh (null, file); - return Members [file]; - } - } - - public bool IsCurrent (string file) - { - file = Path.GetFullPath (file); - LibraryInfo info = Members [file]; - return info != null && info.Timestamp == File.GetLastWriteTime (file).ToUniversalTime (); - } - - EmbeddedResource GetResource (AssemblyDefinition asm, string name) - { - foreach (Resource res in asm.MainModule.Resources) { - EmbeddedResource eres = res as EmbeddedResource; - if (eres != null && eres.Name == name) - return eres; - } - return null; - } - - void AddDependencies (XmlElement elem, AssemblyResolver resolver, string filename, AssemblyDefinition asm) - { - string dir = Path.GetDirectoryName (filename); - foreach (AssemblyNameReference aref in asm.MainModule.AssemblyReferences) { - LibraryInfo info = GetInfo (resolver, aref.FullName, dir); - if (info != null && info.HasWidgets) { - XmlElement edep = elem.OwnerDocument.CreateElement ("dependency"); - edep.InnerText = info.File; - elem.AppendChild (edep); - } - } - } - - XmlDocument GetGuiDoc (AssemblyDefinition adef) - { - XmlDocument doc = null; - try { - EmbeddedResource res = GetResource (adef, "gui.stetic"); - if (res != null) { - MemoryStream stream = new MemoryStream (res.GetResourceData ()); - doc = new XmlDocument (); - using (stream) - doc.Load (stream); - } - } catch { - doc = null; - } - - return doc; - } - - bool ReferenceChainContainsGtk (AssemblyResolver resolver, AssemblyNameReference aref, Hashtable visited) - { - if (aref.Name == "gtk-sharp") - return true; - else if (visited.Contains (aref.Name)) - return false; - - visited [aref.Name] = aref; - - AssemblyDefinition adef = resolver.Resolve (aref); - if (adef == null) - return false; - - foreach (AssemblyNameReference child in adef.MainModule.AssemblyReferences) - if (ReferenceChainContainsGtk (resolver, child, visited)) - return true; - - return false; - } - - internal class ToolboxItemInfo { - - public ToolboxItemInfo (string base_type) - { - BaseType = base_type; - } - - public string BaseType; - public string PaletteCategory; - } - - ToolboxItemInfo GetToolboxItemInfo (AssemblyResolver resolver, string baseDirectory, AssemblyDefinition asm, TypeDefinition tdef, bool checkBaseType) - { - if (tdef == null) - return null; - - ToolboxItemInfo info = null; - string category = "General"; - - foreach (CustomAttribute attr in tdef.CustomAttributes) { - switch (attr.AttributeType.FullName) { - case "System.ComponentModel.ToolboxItemAttribute": - if (attr.ConstructorArguments.Count > 0) { - object param = attr.ConstructorArguments [0].Value; - if (param == null) - return null; - else if (param.GetType () == typeof (bool)) { - if ((bool) param) - info = new ToolboxItemInfo ("Gtk.Widget"); - else - return null; - } else if (param.GetType () == typeof (TypeReference)) - info = new ToolboxItemInfo ("Gtk.Widget"); - else - return null; - } - break; - case "System.ComponentModel.CategoryAttribute": - if (attr.ConstructorArguments.Count > 0) { - object param = attr.ConstructorArguments [0].Value; - if (param.GetType () == typeof (string)) - category = (string) param; - } - break; - default: - continue; - } - } - - if (info == null && checkBaseType && tdef.BaseType != null) { - string baseName = tdef.BaseType.FullName; - - foreach (AssemblyNameReference aref in asm.MainModule.AssemblyReferences) { - LibraryInfo libInfo = GetInfo (resolver, aref.FullName, baseDirectory); - if (libInfo != null && libInfo.HasWidgets) { - ToolboxItemInfo binfo = libInfo.GetToolboxItem (baseName, aref.Name); - if (binfo != null) { - info = new ToolboxItemInfo (baseName); - category = binfo.PaletteCategory; - break; - } - } - } - } - - if (info != null) - info.PaletteCategory = category; - - return info; - } - - XmlElement GetItemGroup (XmlElement groups, string cat, string default_label) - { - XmlElement group; - - if (String.IsNullOrEmpty (cat)) - group = (XmlElement) groups.SelectSingleNode ("itemgroup[(not(@name) or @name='') and not(@ref)]"); - else - group = (XmlElement) groups.SelectSingleNode ("itemgroup[@name='" + cat + "']"); - - if (group == null) { - group = groups.OwnerDocument.CreateElement ("itemgroup"); - if (String.IsNullOrEmpty (cat)) - group.SetAttribute ("label", default_label); - else { - group.SetAttribute ("name", cat); - group.SetAttribute ("label", cat); - } - groups.AppendChild (group); - } - return group; - } - - void AddProperty (PropertyDefinition prop, string cat, bool translatable, XmlElement obj) - { - XmlElement groups = obj ["itemgroups"]; - if (groups == null) { - groups = obj.OwnerDocument.CreateElement ("itemgroups"); - obj.AppendChild (groups); - } - - XmlElement group = GetItemGroup (groups, cat, prop.DeclaringType.Name + " Properties"); - XmlElement elem = group.OwnerDocument.CreateElement ("property"); - if (translatable) - elem.SetAttribute ("translatable", "yes"); - elem.SetAttribute ("name", prop.Name); - group.AppendChild (elem); - } - - static string[] supported_types = new string[] { - "System.Boolean", - "System.Char", - "System.SByte", - "System.Byte", - "System.Int16", - "System.UInt16", - "System.Int32", - "System.UInt32", - "System.Int64", - "System.UInt64", - "System.Decimal", - "System.Single", - "System.Double", - "System.DateTime", - "System.String", - "System.String[]", - "System.TimeSpan", - "Gtk.Adjustment", - }; - - void AddProperties (TypeDefinition tdef, XmlElement obj) - { - foreach (PropertyDefinition prop in tdef.Properties) { - if (prop.GetMethod == null || !prop.GetMethod.IsPublic || prop.SetMethod == null || !prop.SetMethod.IsPublic) - continue; - - else if (Array.IndexOf (supported_types, prop.PropertyType.FullName) < 0) - continue; - - bool browsable = true; - bool translatable = false; - string category = String.Empty; - foreach (CustomAttribute attr in prop.CustomAttributes) { - switch (attr.Constructor.DeclaringType.FullName) { - case "System.ComponentModel.BrowsableAttribute": - if (attr.ConstructorArguments.Count > 0) { - object param = attr.ConstructorArguments [0].Value; - if (param.GetType () == typeof (bool)) - browsable = (bool) param; - } - break; - case "System.ComponentModel.CategoryAttribute": - if (attr.ConstructorArguments.Count > 0) { - object param = attr.ConstructorArguments [0].Value; - if (param.GetType () == typeof (string)) - category = (string) param; - } - break; - case "System.ComponentModel.LocalizableAttribute": - if (attr.ConstructorArguments.Count > 0) { - object param = attr.ConstructorArguments [0].Value; - if (param.GetType () == typeof (bool)) - translatable = (bool) param; - } - break; - default: - continue; - } - if (!browsable) - break; - } - if (browsable) - AddProperty (prop, category, translatable, obj); - } - } - - void AddEvent (EventDefinition ev, string cat, XmlElement obj) - { - XmlElement groups = obj ["signals"]; - if (groups == null) { - groups = obj.OwnerDocument.CreateElement ("signals"); - obj.AppendChild (groups); - } - - XmlElement group = GetItemGroup (groups, cat, ev.DeclaringType.Name + " Signals"); - XmlElement elem = group.OwnerDocument.CreateElement ("signal"); - elem.SetAttribute ("name", ev.Name); - group.AppendChild (elem); - } - - void AddEvents (TypeDefinition tdef, XmlElement obj) - { - foreach (EventDefinition ev in tdef.Events) { - if (ev.AddMethod == null || !ev.AddMethod.IsPublic) - continue; - bool browsable = true; - string category = String.Empty; - foreach (CustomAttribute attr in ev.CustomAttributes) { - switch (attr.Constructor.DeclaringType.FullName) { - case "System.ComponentModel.BrowsableAttribute": - if (attr.ConstructorArguments.Count > 0) { - object param = attr.ConstructorArguments [0].Value; - if (param.GetType () == typeof (bool)) - browsable = (bool) param; - } - break; - case "System.ComponentModel.CategoryAttribute": - if (attr.ConstructorArguments.Count > 0) { - object param = attr.ConstructorArguments [0].Value; - if (param.GetType () == typeof (string)) - category = (string) param; - } - break; - default: - continue; - } - if (!browsable) - break; - } - if (browsable) - AddEvent (ev, category, obj); - } - } - - void AddObject (TypeDefinition tdef, Dictionary localObjects, AssemblyResolver resolver, string basePath, AssemblyDefinition adef) - { - if (tdef.IsAbstract || !tdef.IsClass) - return; - - ToolboxItemInfo tbinfo = GetToolboxItemInfo (resolver, basePath, adef, tdef, true); - if (tbinfo == null) - return; - - localObjects [tdef] = tbinfo; - - foreach (var nestedType in tdef.NestedTypes) - AddObject (nestedType, localObjects, resolver, basePath, adef); - } - - void AddObjects (XmlDocument doc, AssemblyResolver resolver, string basePath, AssemblyDefinition adef) - { - Dictionary localObjects = new Dictionary (); - - foreach (TypeDefinition tdef in adef.MainModule.Types) { - AddObject (tdef, localObjects, resolver, basePath, adef); - } - - foreach (KeyValuePair item in localObjects) { - TypeDefinition tdef = item.Key; - ToolboxItemInfo tbinfo = item.Value; - XmlElement elem = doc.CreateElement ("object"); - elem.SetAttribute ("type", tdef.FullName); - elem.SetAttribute ("allow-children", "false"); - elem.SetAttribute ("palette-category", tbinfo.PaletteCategory); - if (tdef.IsNotPublic) - elem.SetAttribute ("internal", "true"); - doc.DocumentElement.AppendChild (elem); - - TypeDefinition curDef = tdef; - while (curDef != null && curDef.FullName != tbinfo.BaseType) { - if (curDef != tdef && localObjects.ContainsKey (curDef)) { - tbinfo.BaseType = curDef.FullName; - break; - } - else if (curDef.Module.Assembly.Name.Name == "gtk-sharp") { - tbinfo.BaseType = curDef.FullName; - break; - } - else if (curDef != tdef && GetToolboxItemInfo (resolver, basePath, curDef.Module.Assembly, curDef, false) != null) { - tbinfo.BaseType = curDef.FullName; - break; - } - if (curDef.Module.Assembly != adef) { - - LibraryInfo li = Refresh (resolver, curDef.Module.FileName, basePath); - if (li.HasWidgets && li.GetToolboxItem (curDef.FullName, curDef.Module.Assembly.Name.Name) != null) { - tbinfo.BaseType = curDef.FullName; - break; - } - } - AddProperties (curDef, elem); - AddEvents (curDef, elem); - if (curDef.BaseType != null && curDef.BaseType.FullName != tbinfo.BaseType) - curDef = FindTypeDefinition (resolver, adef, basePath, curDef.BaseType.FullName); - else - curDef = null; - } - - elem.SetAttribute ("base-type", tbinfo.BaseType); - } - } - - XmlDocument GetObjectsDoc (AssemblyResolver resolver, AssemblyDefinition adef, string path, string baseDirectory) - { - XmlDocument doc = null; - bool isMainLib = Path.GetFileName (path) == "libstetic.dll"; - - try { - EmbeddedResource res = GetResource (adef, "objects.xml"); - if (res != null) { - MemoryStream stream = new MemoryStream (res.GetResourceData ()); - doc = new XmlDocument (); - using (stream) - doc.Load (stream); - } - - if (resolver == null) - resolver = new AssemblyResolver (null); - - baseDirectory = baseDirectory ?? Path.GetDirectoryName (path); - - if (!isMainLib) { - // Make sure all referenced assemblies are up to date. - foreach (AssemblyNameReference aref in adef.MainModule.AssemblyReferences) { - Refresh (resolver, aref.FullName, baseDirectory); - } - } - - if (doc == null) { -// Hashtable visited = new Hashtable (); - foreach (AssemblyNameReference aref in adef.MainModule.AssemblyReferences) { - if (aref.Name != "gtk-sharp") { - LibraryInfo info = GetInfo (resolver, aref.FullName, baseDirectory); - if (info == null || !info.HasWidgets) - continue; - } - - if (doc == null) { - doc = new XmlDocument (); - doc.AppendChild (doc.CreateElement ("objects")); - } - AddObjects (doc, resolver, baseDirectory, adef); - break; - } - } - - if (doc != null && !isMainLib) { - XmlElement elem = doc.CreateElement ("dependencies"); - doc.DocumentElement.AppendChild (elem); - AddDependencies (elem, resolver, path, adef); - } - } catch (Exception e) { - Console.WriteLine ("Got exception loading objects: " + e); - doc = null; - } - - return doc; - } - - LibraryInfo GetInfo (AssemblyResolver resolver, string assembly, string baseDirectory) - { - string file = assembly; - if (File.Exists (assembly)) - file = assembly; - else { - if (resolver == null) - resolver = new AssemblyResolver (null); - try { - string path = resolver.Resolve (assembly, baseDirectory); - if (path != null) - file = path; - else - return null; - } catch (Exception) { - return null; - } - } - - file = Path.GetFullPath (file); - - LibraryInfo info = Members [file]; - if (info == null) { - info = new LibraryInfo (); - info.File = file ?? assembly; - Members.Add (info); - } - return info; - } - - internal LibraryInfo Refresh (AssemblyResolver resolver, string assembly) - { - return Refresh (resolver, assembly, null); - } - - LibraryInfo Refresh (AssemblyResolver resolver, string assembly, string baseDirectory) - { - LibraryInfo info = GetInfo (resolver, assembly, baseDirectory); - - if (info == null || info.IsCurrent || !File.Exists (info.File)) - return info; - - info.Timestamp = File.GetLastWriteTime (info.File).ToUniversalTime (); - info.Guid = Guid.NewGuid (); - Save (); - using (AssemblyDefinition adef = AssemblyDefinition.ReadAssembly (info.File)) { - XmlDocument objects = GetObjectsDoc (resolver, adef, info.File, baseDirectory); - if (objects != null) { - info.ObjectsDocument = objects; - XmlDocument gui = GetGuiDoc (adef); - if (gui != null) - info.GuiDocument = gui; - } - } - info.OnChanged (); - return info; - } - - void Save () - { - if (!Directory.Exists (dir)) - Directory.CreateDirectory (dir); - - // remove any dead assemblies from the cache - StringCollection zombies = new StringCollection (); - foreach (LibraryInfo info in Members) { - if (File.Exists (info.File)) - continue; - zombies.Add (info.File); - string zombie_dir = Path.Combine (dir, info.Guid.ToString ()); - if (Directory.Exists (zombie_dir)) - Directory.Delete (Path.Combine (dir, info.Guid.ToString ()), true); - } - - foreach (string file in zombies) - Members.Remove (file); - - XmlSerializer serializer = new XmlSerializer (typeof (LibraryCache)); - using (FileStream fs = File.Create (Path.Combine (dir, "index.xml"))) - serializer.Serialize (fs, this); - } - - static LibraryCache Load () - { - string index_path = Path.Combine (dir, "index.xml"); - if (File.Exists (index_path)) { - try { - LibraryCache result; - XmlSerializer serializer = new XmlSerializer (typeof (LibraryCache)); - using (XmlTextReader rdr = new XmlTextReader (index_path)) - result = (LibraryCache) serializer.Deserialize (rdr); - return result; - } catch (Exception e) { - Console.WriteLine ("Cache index serialization failed " + e); - } - } - - return new LibraryCache (); - } - - internal TypeDefinition FindTypeDefinition (AssemblyResolver resolver, AssemblyDefinition assembly, string basePath, string fullName) - { - TypeDefinition t = FindTypeDefinition (new Hashtable (), resolver, basePath, assembly, fullName); - return t; - } - - TypeDefinition FindTypeDefinition (Hashtable visited, AssemblyResolver resolver, string basePath, AssemblyDefinition asm, string fullName) - { - if (visited.Contains (asm)) - return null; - - visited [asm] = asm; - - TypeDefinition cls = asm.MainModule.GetType (fullName); - if (cls != null) - return cls; - - foreach (AssemblyNameReference aref in asm.MainModule.AssemblyReferences) { - AssemblyDefinition basm = resolver.Resolve (aref, basePath); - if (basm != null) { - cls = basm.MainModule.GetType (fullName); - if (cls != null) - return cls; - } - } - return null; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Makefile.am b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Makefile.am deleted file mode 100644 index c9cc87438f7..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include $(top_srcdir)/xbuild.include diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Palette.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Palette.cs deleted file mode 100644 index 3f747df6cfb..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Palette.cs +++ /dev/null @@ -1,46 +0,0 @@ - -using System; -using Gtk; - -namespace Stetic -{ - public class Palette: PluggableWidget - { - bool showWindowCategory = true; - - internal Palette (Application app): base (app) - { - } - - protected override void OnCreatePlug (uint socketId) - { - app.Backend.CreatePaletteWidgetPlug (socketId); - Update (); - } - - protected override void OnDestroyPlug (uint socketId) - { - app.Backend.DestroyPaletteWidgetPlug (); - } - - protected override Gtk.Widget OnCreateWidget () - { - Update (); - return app.Backend.GetPaletteWidget (); - } - - public bool ShowWindowCategory { - get { return showWindowCategory; } - set { - showWindowCategory = value; - Update (); - } - } - - void Update () - { - if (!showWindowCategory) - app.Backend.HidePaletteGroup ("window"); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/PaletteBackend.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/PaletteBackend.cs deleted file mode 100644 index 40d6e8050dd..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/PaletteBackend.cs +++ /dev/null @@ -1,409 +0,0 @@ -using Gtk; -using Gdk; -using System; -using System.Collections; -using System.Reflection; -using Mono.Unix; - -namespace Stetic { - - internal class PaletteBackend : Gtk.ScrolledWindow, IComparer { - - Hashtable groups; - ProjectBackend project; - WidgetLibrary[] libraries; - ArrayList visibleGroups = new ArrayList (); - Wrapper.Widget selection; - ActionGroupBox localActionsBox; - ActionGroupBox globalActionsBox; - Gtk.VBox box; - ApplicationBackend app; - - public PaletteBackend (ApplicationBackend app) - { - this.app = app; - box = new Gtk.VBox (false, 0); - AddWithViewport (box); - groups = new Hashtable (); - Registry.RegistryChanged += OnRegistryChanged; - - ShowGroup ("window", Catalog.GetString ("Windows")); - ShowGroup ("widget", Catalog.GetString ("Widgets")); - ShowGroup ("container", Catalog.GetString ("Containers")); -// ShowGroup ("toolbaritem", "Toolbar Items"); - ShowGroup ("actions", Catalog.GetString ("Actions")); - } - - public override void Dispose () - { - Registry.RegistryChanged -= OnRegistryChanged; - - foreach (PaletteGroup grp in groups.Values) - grp.Destroy (); - - if (localActionsBox != null) { - localActionsBox.Destroy (); - localActionsBox = null; - } - if (globalActionsBox != null) { - globalActionsBox.Destroy (); - globalActionsBox = null; - } - - project = null; - selection = null; - base.Dispose (); - } - - public PaletteBackend (ApplicationBackend app, ProjectBackend project): this (app) - { - this.ProjectBackend = project; - } - - public ProjectBackend ProjectBackend { - get { return project; } - set { - if (project != null) { - project.SelectionChanged -= OnSelectionChanged; - project.ProjectReloaded -= OnProjectReloaded; - } - project = value; - if (project != null) { - UpdateSelection (Wrapper.Widget.Lookup (project.Selection)); - project.SelectionChanged += OnSelectionChanged; - project.ProjectReloaded += OnProjectReloaded; - } else - UpdateSelection (null); - LoadWidgets (project); - } - } - - public WidgetLibrary[] WidgetLibraries { - get { return libraries; } - set { - libraries = value; - LoadWidgets (project); - } - } - - void OnProjectReloaded (object s, EventArgs args) - { - LoadWidgets (project); - } - - void OnSelectionChanged (object ob, Stetic.Wrapper.WidgetEventArgs args) - { - UpdateSelection (args.WidgetWrapper); - } - - void UpdateSelection (Wrapper.Widget sel) - { - selection = sel; - if (localActionsBox != null) - localActionsBox.SetActionGroups (selection != null ? selection.LocalActionGroups : null); - ShowAll (); - } - - public void ShowGroup (string name, string label) - { - visibleGroups.Add (new string[] { name, label }); - if (project != null) - LoadWidgets (project); - } - - public void HideGroup (string name) - { - for (int n=0; n < visibleGroups.Count; n++) { - if (((string[])visibleGroups[n])[0] == name) { - visibleGroups.RemoveAt (n); - if (project != null) - LoadWidgets (project); - return; - } - } - } - - void OnRegistryChanged (object o, EventArgs args) - { - WidgetLibraries = app.GetActiveLibraries (); - } - - public void LoadWidgets (ProjectBackend project) - { - if (project == null) { - box.Hide (); - return; - } - - box.Show (); - - foreach (PaletteGroup g in groups.Values) { - box.Remove (g); - g.Destroy (); - } - - groups.Clear (); - - foreach (string[] grp in visibleGroups) - AddOrGetGroup (grp[0], grp[1]); - - ArrayList classes = new ArrayList (); - if (libraries == null) { - foreach (ClassDescriptor klass in Registry.AllClasses) - if (klass.SupportsGtkVersion (project.TargetGtkVersion)) - classes.Add (klass); - } else if (project != null) { - foreach (WidgetLibrary lib in libraries) { - bool isInternalLib = project.IsInternalLibrary (lib.Name); - foreach (ClassDescriptor cd in lib.AllClasses) { - if (!cd.Deprecated && cd.Category.Length > 0 && (isInternalLib || !cd.IsInternal) && cd.SupportsGtkVersion (project.TargetGtkVersion)) - classes.Add (cd); - } - } - } - - classes.Sort (this); - - foreach (ClassDescriptor klass in classes) { - - if (!groups.Contains (klass.Category)) - continue; - - WidgetFactory factory; - if (klass.Category == "window") - factory = new WindowFactory (project, klass); - else - factory = new WidgetFactory (project, klass); - - AddOrGetGroup(klass.Category).Append (factory); - } - - if (localActionsBox != null) - localActionsBox.Destroy (); - if (globalActionsBox != null) - globalActionsBox.Destroy (); - - PaletteGroup widgetGroup = AddOrGetGroup ("actions", Catalog.GetString ("Actions")); - localActionsBox = new ActionGroupBox (); - globalActionsBox = new ActionGroupBox (); - widgetGroup.Append (localActionsBox); - widgetGroup.Append (globalActionsBox); - - if (project != null) { - widgetGroup.Sensitive = true; - localActionsBox.SetActionGroups (selection != null ? selection.LocalActionGroups : null); - globalActionsBox.SetActionGroups (project.ActionGroups); - } else { - widgetGroup.Sensitive = false; - localActionsBox.SetActionGroups (null); - globalActionsBox.SetActionGroups (null); - } - - // This is a workaround. In looks like the palette is not correctly - // redrawn if it is rebuilt while it is not visible (the dock is hidden in MD). - GLib.Idle.Add (delegate { - ShowAll (); - return false; - }); - } - - int IComparer.Compare (object x, object y) - { - return string.Compare (((ClassDescriptor)x).Label, - ((ClassDescriptor)y).Label); - } - - private PaletteGroup AddOrGetGroup (string id, string name) - { - PaletteGroup group = (PaletteGroup) groups[id]; - - if (group == null) { - group = new PaletteGroup (name); - box.PackStart (group, false, false, 0); - groups.Add (id, group); - } - - return group; - } - - private PaletteGroup AddOrGetGroup (string name) - { - return AddOrGetGroup (name, name); - } - } - - class PaletteGroup : Gtk.Expander - { - private Gtk.Alignment align; - private Gtk.VBox vbox; - Gtk.Label emptyLabel; - bool isEmpty = true; - - public PaletteGroup (string name) : base ("" + name + "") - { - vbox = new VBox (false, 0); - emptyLabel = new Gtk.Label (); - emptyLabel.Markup = " " + Catalog.GetString ("Empty") + ""; - vbox.PackStart (emptyLabel, false, false, 0); - - align = new Gtk.Alignment (0, 0, 0, 0); - align.SetPadding (0, 0, 20, 0); - align.Child = vbox; - - UseMarkup = true; - Expanded = true; - Child = align; - } - - public void SetName (string name) - { - Label = "" + name + ""; - } - - public void Append (Widget w) - { - if (isEmpty) { - vbox.Remove (emptyLabel); - isEmpty = false; - } - vbox.PackStart (w, false, false, 0); - } - - public void Clear () - { - foreach (Gtk.Widget w in vbox.Children) { - vbox.Remove (w); - w.Destroy (); - } - - isEmpty = true; - vbox.PackStart (emptyLabel, false, false, 0); - } - } - - class ActionPaletteGroup : PaletteGroup - { - Wrapper.ActionGroup group; - - public ActionPaletteGroup (string name, Wrapper.ActionGroup group): base (name) - { - DND.DestSet (this, true); - this.group = group; - group.ActionAdded += OnActionGroupChanged; - group.ActionRemoved += OnActionGroupChanged; - group.ActionChanged += OnActionGroupChanged; - group.ObjectChanged += OnActionGroupChanged; - Fill (); - } - - public Wrapper.ActionGroup Group { - get { return group; } - } - - public override void Dispose () - { - group.ActionAdded -= OnActionGroupChanged; - group.ActionRemoved -= OnActionGroupChanged; - group.ActionChanged -= OnActionGroupChanged; - group.ObjectChanged -= OnActionGroupChanged; - base.Dispose (); - } - - public void Fill () - { - foreach (Stetic.Wrapper.Action action in group.Actions) { - Gdk.Pixbuf icon = action.RenderIcon (Gtk.IconSize.Menu); - if (icon == null) icon = ActionComponent.DefaultActionIcon; - Stetic.Wrapper.ActionPaletteItem it = new Stetic.Wrapper.ActionPaletteItem (Gtk.UIManagerItemType.Menuitem, null, action); - Append (new InstanceWidgetFactory (action.MenuLabel, icon, it)); - } - } - - void OnActionGroupChanged (object s, EventArgs args) - { - SetName (((Stetic.Wrapper.ActionGroup)s).Name); - } - - void OnActionGroupChanged (object s, Stetic.Wrapper.ActionEventArgs args) - { - Clear (); - Fill (); - ShowAll (); - } - - protected override bool OnDragDrop (Gdk.DragContext context, int x, int y, uint time) - { - Wrapper.ActionPaletteItem dropped = DND.Drop (context, null, time) as Wrapper.ActionPaletteItem; - if (dropped == null) - return false; - - if (dropped.Node.Action.ActionGroup != group) { - using (dropped.Node.Action.UndoManager.AtomicChange) { - dropped.Node.Action.ActionGroup.Actions.Remove (dropped.Node.Action); - group.Actions.Add (dropped.Node.Action); - } - } - - return base.OnDragDrop (context, x, y, time); - } - } - - class ActionGroupBox: Gtk.VBox - { - Stetic.Wrapper.ActionGroupCollection groups; - - public void SetActionGroups (Stetic.Wrapper.ActionGroupCollection groups) - { - if (this.groups != null) { - this.groups.ActionGroupAdded -= OnGroupAdded; - this.groups.ActionGroupRemoved -= OnGroupRemoved; - } - this.groups = groups; - if (this.groups != null) { - this.groups.ActionGroupAdded += OnGroupAdded; - this.groups.ActionGroupRemoved += OnGroupRemoved; - } - Update (); - } - - public override void Dispose () - { - foreach (ActionPaletteGroup grp in Children) - grp.Destroy (); - base.Dispose (); - } - - public void Update () - { - foreach (ActionPaletteGroup grp in Children) { - Remove (grp); - grp.Destroy (); - } - - if (groups != null) { - foreach (Stetic.Wrapper.ActionGroup group in groups) { - ActionPaletteGroup pg = new ActionPaletteGroup (group.Name, group); - PackStart (pg, false, false, 0); - } - } - ShowAll (); - } - - void OnGroupAdded (object s, Stetic.Wrapper.ActionGroupEventArgs args) - { - ActionPaletteGroup pg = new ActionPaletteGroup (args.ActionGroup.Name, args.ActionGroup); - pg.ShowAll (); - PackStart (pg, false, false, 0); - } - - void OnGroupRemoved (object s, Stetic.Wrapper.ActionGroupEventArgs args) - { - foreach (ActionPaletteGroup grp in Children) { - if (grp.Group == args.ActionGroup) { - Remove (grp); - grp.Destroy (); - } - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/PluggableWidget.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/PluggableWidget.cs deleted file mode 100644 index 4db2da15d2a..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/PluggableWidget.cs +++ /dev/null @@ -1,151 +0,0 @@ - -using System; - -namespace Stetic -{ - public abstract class PluggableWidget: Gtk.EventBox - { - internal Application app; - bool initialized; - Gtk.Socket socket; - Gtk.Notebook book; - - public PluggableWidget (Application app) - { - book = new Gtk.Notebook (); - book.ShowTabs = false; - book.ShowBorder = false; - book.Show (); - Add (book); - - this.app = app; - if (app is IsolatedApplication) { - (app as IsolatedApplication).BackendChanged += OnBackendChanged; - (app as IsolatedApplication).BackendChanging += OnBackendChanging; - } - } - - protected void AddCustomWidget (Gtk.Widget w) - { - w.ShowAll (); - book.AppendPage (w, null); - book.Page = book.NPages - 1; - - if (initialized) { - Gtk.Widget cw = book.GetNthPage (0); - book.RemovePage (0); - cw.Destroy (); - } - else - initialized = true; - } - - protected void ResetCustomWidget () - { - } - - protected override void OnRealized () - { - base.OnRealized (); - if (!initialized) { - initialized = true; - if (app is IsolatedApplication) - ConnectPlug (); - else { - Gtk.Widget w = OnCreateWidget (); - w.Show (); - book.AppendPage (w, null); - } - } - } - - protected override void OnUnrealized () - { - if (app is IsolatedApplication && initialized) { - OnDestroyPlug (socket.Id); - initialized = false; - } - base.OnUnrealized (); - } - - protected void PrepareUpdateWidget () - { - // This method is called when the child widget is going to be changed. - // It takes a 'screenshot' of the widget. This image will be shown until - // UpdateWidget is called. - - if (book.NPages == 1) { - Gtk.Widget w = book.GetNthPage (0); - Gdk.Window win = w.GdkWindow; - if (win != null && win.IsViewable) { - Gdk.Pixbuf img = Gdk.Pixbuf.FromDrawable (win, win.Colormap, w.Allocation.X, w.Allocation.Y, 0, 0, w.Allocation.Width, w.Allocation.Height); - Gtk.Image oldImage = new Gtk.Image (img); - oldImage.Show (); - book.AppendPage (oldImage, null); - book.Page = 1; - book.RemovePage (0); - } - } - } - - protected void UpdateWidget () - { - if (!initialized) - return; - - if (app is LocalApplication) { - Gtk.Widget w = OnCreateWidget (); - if (w.Parent != book) { - book.AppendPage (w, null); - w.Show (); - } - book.Page = book.NPages - 1; - if (book.NPages > 1) { - Gtk.Widget cw = book.GetNthPage (0); - book.Remove (cw); - OnDestroyWidget (cw); - } - } - } - - protected abstract void OnCreatePlug (uint socketId); - protected abstract void OnDestroyPlug (uint socketId); - - protected abstract Gtk.Widget OnCreateWidget (); - protected virtual void OnDestroyWidget (Gtk.Widget w) { w.Destroy (); } - - public override void Dispose () - { - if (app is IsolatedApplication) { - IsolatedApplication iapp = app as IsolatedApplication; - iapp.BackendChanged -= OnBackendChanged; - iapp.BackendChanging -= OnBackendChanging; - } - base.Dispose (); - } - - internal virtual void OnBackendChanged (ApplicationBackend oldBackend) - { - if (!initialized) - return; - - Gtk.Widget w = book.GetNthPage (0); - book.RemovePage (0); - w.Destroy (); - socket.Dispose (); - ConnectPlug (); - } - - internal virtual void OnBackendChanging () - { - } - - void ConnectPlug () - { - socket = new Gtk.Socket (); - socket.Show (); - book.AppendPage (socket, null); - OnCreatePlug (socket.Id); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Project.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Project.cs deleted file mode 100644 index a0f594b5b47..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Project.cs +++ /dev/null @@ -1,838 +0,0 @@ - -using System; -using System.Xml; -using System.IO; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; - -namespace Stetic -{ - public class Project: MarshalByRefObject - { - Application app; - ProjectBackend backend; - string fileName; - IResourceProvider resourceProvider; - Component selection; - string tmpProjectFile; - bool reloadRequested; - List widgets = new List (); - List groups = new List (); - bool modified; - ImportFileDelegate importFileDelegate; - - public event WidgetInfoEventHandler WidgetAdded; - public event WidgetInfoEventHandler WidgetRemoved; - public event ComponentNameEventHandler ComponentNameChanged; - public event EventHandler ComponentTypesChanged; - - public event EventHandler ActionGroupsChanged; - public event EventHandler ModifiedChanged; - public event EventHandler Changed; - - - // Internal events - internal event BackendChangingHandler BackendChanging; - internal event BackendChangedHandler BackendChanged; - internal event ComponentSignalEventHandler SignalAdded; - internal event ComponentSignalEventHandler SignalRemoved; - internal event ComponentSignalEventHandler SignalChanged; - - public event EventHandler ProjectReloading; - public event EventHandler ProjectReloaded; - - internal Project (Application app): this (app, null) - { - } - - internal Project (Application app, ProjectBackend backend) - { - this.app = app; - if (backend != null) { - this.backend = backend; - backend.SetFrontend (this); - } - - if (app is IsolatedApplication) { - IsolatedApplication iapp = app as IsolatedApplication; - iapp.BackendChanging += OnBackendChanging; - iapp.BackendChanged += OnBackendChanged; - } - } - - internal ProjectBackend ProjectBackend { - get { - if (backend == null) { - backend = app.Backend.CreateProject (); - backend.SetFrontend (this); - if (resourceProvider != null) - backend.ResourceProvider = resourceProvider; - if (fileName != null) - backend.Load (fileName); - } - return backend; - } - } - - internal bool IsBackendLoaded { - get { return backend != null; } - } - - internal Application App { - get { return app; } - } - - internal event EventHandler Disposed; - - public void Dispose () - { - if (app is IsolatedApplication) { - IsolatedApplication iapp = app as IsolatedApplication; - iapp.BackendChanging -= OnBackendChanging; - iapp.BackendChanged -= OnBackendChanged; - } - - if (tmpProjectFile != null && File.Exists (tmpProjectFile)) { - File.Delete (tmpProjectFile); - tmpProjectFile = null; - } - if (backend != null) - backend.Dispose (); - if (Disposed != null) - Disposed (this, EventArgs.Empty); - System.Runtime.Remoting.RemotingServices.Disconnect (this); - } - - public override object InitializeLifetimeService () - { - // Will be disconnected when calling Dispose - return null; - } - - public string FileName { - get { return fileName; } - } - - public IResourceProvider ResourceProvider { - get { return resourceProvider; } - set { - resourceProvider = value; - if (backend != null) - backend.ResourceProvider = value; - } - } - - public Stetic.ProjectIconFactory IconFactory { - get { return ProjectBackend.IconFactory; } - set { backend.IconFactory = value; } - } - - public ImportFileDelegate ImportFileCallback { - get { return importFileDelegate; } - set { importFileDelegate = value; } - } - - public bool CanGenerateCode { - get { return ProjectBackend.CanGenerateCode; } - } - - public Component Selection { - get { return selection; } - } - - public string ImagesRootPath { - get { return ProjectBackend.ImagesRootPath; } - set { ProjectBackend.ImagesRootPath = value; } - } - - public string TargetGtkVersion { - get { return ProjectBackend.TargetGtkVersion; } - set { ProjectBackend.TargetGtkVersion = value; } - } - - public void Close () - { - if (backend != null) - backend.Close (); - } - - public void Load (string fileName) - { - this.fileName = fileName; - if (backend != null) - backend.Load (fileName); - - using (StreamReader sr = new StreamReader (fileName)) { - XmlTextReader reader = new XmlTextReader (sr); - - reader.MoveToContent (); - if (reader.IsEmptyElement) - return; - - reader.ReadStartElement ("stetic-interface"); - if (reader.IsEmptyElement) - return; - while (reader.NodeType != XmlNodeType.EndElement) { - if (reader.NodeType == XmlNodeType.Element) { - if (reader.LocalName == "widget") - ReadWidget (reader); - else if (reader.LocalName == "action-group") - ReadActionGroup (reader); - else - reader.Skip (); - } - else { - reader.Skip (); - } - reader.MoveToContent (); - } - } - } - - void ReadWidget (XmlTextReader reader) - { - WidgetInfo w = new WidgetInfo (this, reader.GetAttribute ("id"), reader.GetAttribute ("class")); - widgets.Add (w); - if (reader.IsEmptyElement) { - reader.Skip (); - return; - } - reader.ReadStartElement (); - reader.MoveToContent (); - while (reader.NodeType != XmlNodeType.EndElement) { - if (reader.NodeType == XmlNodeType.Element && reader.LocalName == "action-group") { - w.AddGroup (reader.GetAttribute ("name")); - } - reader.Skip (); - reader.MoveToContent (); - } - reader.ReadEndElement (); - } - - void ReadActionGroup (XmlTextReader reader) - { - groups.Add (new ActionGroupInfo (this, reader.GetAttribute ("name"))); - reader.Skip (); - } - - public void Save (string fileName) - { - this.fileName = fileName; - if (backend != null) - backend.Save (fileName); - } - - public void ImportGlade (string fileName) - { - ProjectBackend.ImportGlade (fileName); - } - - public void ExportGlade (string fileName) - { - ProjectBackend.ExportGlade (fileName); - } - - public object SaveStatus () - { - return ProjectBackend.SaveStatus (); - } - - public void LoadStatus (object status) - { - ProjectBackend.LoadStatus (status); - } - - public bool Modified { - get { - if (backend != null) - return backend.Modified; - else - return modified; - } - set { - if (backend != null) - backend.Modified = value; - else - modified = true; - } - } - - public IEnumerable Widgets { - get { return widgets; } - } - - public IEnumerable ActionGroups { - get { return groups; } - } - - public WidgetInfo GetWidget (string name) - { - foreach (WidgetInfo w in widgets) - if (w.Name == name) - return w; - return null; - } - - public ActionGroupInfo GetActionGroup (string name) - { - foreach (ActionGroupInfo w in groups) - if (w.Name == name) - return w; - return null; - } - - public WidgetDesigner CreateWidgetDesigner (WidgetInfo widgetInfo, bool autoCommitChanges) - { - return new WidgetDesigner (this, widgetInfo.Name, autoCommitChanges); - } - - public ActionGroupDesigner CreateActionGroupDesigner (ActionGroupInfo actionGroup, bool autoCommitChanges) - { - return new ActionGroupDesigner (this, null, actionGroup.Name, null, autoCommitChanges); - } - - public void SetWidgetModified (string widgetName) - { - ProjectBackend.SetWidgetModified (widgetName); - } - - public void SetAllWidgetsModified () - { - ProjectBackend.SetAllWidgetsModified (); - } - - public void ResetModifiedWidgetFlags () - { - ProjectBackend.ResetModifiedWidgetFlags (); - } - - public WidgetInfo AddNewComponent (ComponentType type, string name) - { - object ob = ProjectBackend.AddNewWidget (type.Name, name); - WidgetComponent wc = (WidgetComponent) App.GetComponent (ob, null, null); - WidgetInfo wi = GetWidget (wc.Name); - if (wi == null) { - wi = new WidgetInfo (this, wc); - widgets.Add (wi); - } - return wi; - } - - public WidgetInfo AddNewComponent (XmlElement template) - { - object ob = ProjectBackend.AddNewWidgetFromTemplate (template.OuterXml); - WidgetComponent wc = (WidgetComponent) App.GetComponent (ob, null, null); - WidgetInfo wi = GetWidget (wc.Name); - if (wi == null) { - wi = new WidgetInfo (this, wc); - widgets.Add (wi); - } - return wi; - } - - public ComponentType[] GetComponentTypes () - { - ArrayList types = new ArrayList (); - - ArrayList typeNames = ProjectBackend.GetComponentTypes (); - for (int n=0; n groups; - - internal WidgetInfo (Project project, string name, string type): base (project, name) - { - this.type = type; - } - - internal WidgetInfo (Project project, Component c): base (project, c.Name) - { - type = c.Type.Name; - } - - public IEnumerable ActionGroups { - get { - if (groups != null) - return groups; - else - return new ActionGroupInfo [0]; - } - } - - public string Type { - get { return type; } - } - - public bool IsWindow { - get { return type == "Gtk.Dialog" || type == "Gtk.Window"; } - } - - public override Component Component { - get { return project.GetComponent (Name); } - } - - internal void AddGroup (string group) - { - if (groups == null) - groups = new List (); - groups.Add (new ActionGroupInfo (project, group, Name)); - } - } - - public class ActionGroupInfo: ProjectItemInfo - { - string widgetName; - - internal ActionGroupInfo (Project project, string name): base (project, name) - { - } - - internal ActionGroupInfo (Project project, string name, string widgetName): base (project, name) - { - this.widgetName = widgetName; - } - - public override Component Component { - get { - ActionGroupComponent[] ags; - if (widgetName != null) { - WidgetComponent c = project.GetComponent (widgetName) as WidgetComponent; - if (c == null) - return null; - ags = c.GetActionGroups (); - } - else { - ags = project.GetActionGroups (); - } - foreach (ActionGroupComponent ag in ags) - if (ag.Name == Name) - return ag; - return null; - } - } - } - - public delegate string ImportFileDelegate (string fileName); -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ProjectBackend.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/ProjectBackend.cs deleted file mode 100644 index 6aba97c0dc0..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ProjectBackend.cs +++ /dev/null @@ -1,1146 +0,0 @@ -using Gtk; -using System; -using System.IO; -using System.Xml; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.CodeDom; -using Mono.Unix; - -namespace Stetic { - - internal class ProjectBackend : MarshalByRefObject, IProject, IDisposable - { - List topLevels; - bool modified; - Gtk.Widget selection; - string id; - string fileName; - XmlDocument tempDoc; - bool loading; - IResourceProvider resourceProvider; - - // Global action groups of the project - Stetic.Wrapper.ActionGroupCollection actionGroups; - bool ownedGlobalActionGroups = true; // It may be false when reusing groups from another project - - Stetic.ProjectIconFactory iconFactory; - Project frontend; - ArrayList widgetLibraries; - ArrayList internalLibs; - ApplicationBackend app; - AssemblyResolver resolver; - string imagesRootPath; - string targetGtkVersion; - - // The action collection of the last selected widget - Stetic.Wrapper.ActionGroupCollection oldTopActionCollection; - - public event Wrapper.WidgetNameChangedHandler WidgetNameChanged; - public event Wrapper.WidgetEventHandler WidgetAdded; - public event Wrapper.WidgetEventHandler WidgetContentsChanged; - public event ObjectWrapperEventHandler ObjectChanged; - public event EventHandler ComponentTypesChanged; - - public event SignalEventHandler SignalAdded; - public event SignalEventHandler SignalRemoved; - public event SignalChangedEventHandler SignalChanged; - - public event Wrapper.WidgetEventHandler SelectionChanged; - public event EventHandler ModifiedChanged; - public event EventHandler Changed; - - // Fired when the project has been reloaded, due for example to - // a change in the registry - public event EventHandler ProjectReloading; - public event EventHandler ProjectReloaded; - - public ProjectBackend (ApplicationBackend app) - { - this.app = app; - topLevels = new List (); - - ActionGroups = new Stetic.Wrapper.ActionGroupCollection (); - - Registry.RegistryChanging += OnRegistryChanging; - Registry.RegistryChanged += OnRegistryChanged; - - iconFactory = new ProjectIconFactory (); - widgetLibraries = new ArrayList (); - internalLibs = new ArrayList (); - } - - public void Dispose () - { - // First of all, disconnect from the frontend, - // to avoid sending notifications while disposing - frontend = null; - - if (oldTopActionCollection != null) - oldTopActionCollection.ActionGroupChanged -= OnComponentTypesChanged; - - Registry.RegistryChanging -= OnRegistryChanging; - Registry.RegistryChanged -= OnRegistryChanged; - Close (); - iconFactory = null; - ActionGroups = null; - System.Runtime.Remoting.RemotingServices.Disconnect (this); - } - - public override object InitializeLifetimeService () - { - // Will be disconnected when calling Dispose - return null; - } - - public string FileName { - get { return fileName; } - set { - this.fileName = value; - if (fileName != null) - Id = System.IO.Path.GetFileName (fileName); - else - Id = null; - } - } - - internal ArrayList WidgetLibraries { - get { return widgetLibraries; } - set { widgetLibraries = value; } - } - - internal ArrayList InternalWidgetLibraries { - get { return internalLibs; } - set { internalLibs = value; } - } - - public bool IsInternalLibrary (string lib) - { - return internalLibs.Contains (lib); - } - - public bool CanGenerateCode { - get { - // It can generate code if all libraries on which depend can generate code - foreach (string s in widgetLibraries) { - WidgetLibrary lib = Registry.GetWidgetLibrary (s); - if (lib != null && !lib.CanGenerateCode) - return false; - } - return true; - } - } - - public string TargetGtkVersion { - get { return targetGtkVersion != null ? targetGtkVersion : "2.4"; } - set { - if (TargetGtkVersion == value) - return; - targetGtkVersion = value; - - // Update the project - OnRegistryChanging (null, null); - OnRegistryChanged (null, null); - } - } - - public string ImagesRootPath { - get { - if (string.IsNullOrEmpty (imagesRootPath)) { - if (string.IsNullOrEmpty (fileName)) - return "."; - else - return Path.GetDirectoryName (fileName); - } - else { - if (Path.IsPathRooted (imagesRootPath)) - return imagesRootPath; - else if (!string.IsNullOrEmpty (fileName)) - return Path.GetFullPath (Path.Combine (Path.GetDirectoryName (fileName), imagesRootPath)); - else - return imagesRootPath; - } - } - set { imagesRootPath = value; } - } - - - public void AddWidgetLibrary (string lib) - { - AddWidgetLibrary (lib, false); - } - - public void AddWidgetLibrary (string lib, bool isInternal) - { - if (!widgetLibraries.Contains (lib)) - widgetLibraries.Add (lib); - if (isInternal) { - if (!internalLibs.Contains (lib)) - internalLibs.Add (lib); - } - else { - internalLibs.Remove (lib); - } - } - - public void RemoveWidgetLibrary (string lib) - { - widgetLibraries.Remove (lib); - internalLibs.Remove (lib); - } - - public ArrayList GetComponentTypes () - { - ArrayList list = new ArrayList (); - foreach (WidgetLibrary lib in app.GetProjectLibraries (this)) { - // Don't include in the list widgets which are internal (when the library is - // not internal to the project), widgets not assigned to any category, and deprecated ones. - bool isInternalLib = IsInternalLibrary (lib.Name); - if (lib.NeedsReload) - lib.Reload (); - foreach (ClassDescriptor cd in lib.AllClasses) { - if (!cd.Deprecated && cd.Category.Length > 0 && (isInternalLib || !cd.IsInternal) && cd.SupportsGtkVersion (TargetGtkVersion)) - list.Add (cd.Name); - } - } - return list; - } - - public string[] GetWidgetTypes () - { - List list = new List (); - foreach (WidgetLibrary lib in app.GetProjectLibraries (this)) { - // Don't include in the list widgets which are internal (when the library is - // not internal to the project) and deprecated ones. - bool isInternalLib = IsInternalLibrary (lib.Name); - foreach (ClassDescriptor cd in lib.AllClasses) { - if (!cd.Deprecated && (isInternalLib || !cd.IsInternal)) - list.Add (cd.Name); - } - } - return list.ToArray (); - } - - public IResourceProvider ResourceProvider { - get { return resourceProvider; } - set { resourceProvider = value; } - } - - public Stetic.Wrapper.ActionGroupCollection ActionGroups { - get { return actionGroups; } - set { - if (actionGroups != null) { - actionGroups.ActionGroupAdded -= OnGroupAdded; - actionGroups.ActionGroupRemoved -= OnGroupRemoved; - actionGroups.ActionGroupChanged -= OnComponentTypesChanged; - } - actionGroups = value; - if (actionGroups != null) { - actionGroups.ActionGroupAdded += OnGroupAdded; - actionGroups.ActionGroupRemoved += OnGroupRemoved; - actionGroups.ActionGroupChanged += OnComponentTypesChanged; - } - ownedGlobalActionGroups = true; - } - } - - public void AttachActionGroups (Stetic.Wrapper.ActionGroupCollection groups) - { - ActionGroups = groups; - ownedGlobalActionGroups = false; - } - - public Stetic.ProjectIconFactory IconFactory { - get { return iconFactory; } - set { iconFactory = value; } - } - - internal void SetFileName (string fileName) - { - this.fileName = fileName; - } - - internal void SetFrontend (Project project) - { - frontend = project; - } - - public void Close () - { - fileName = null; - - if (actionGroups != null && ownedGlobalActionGroups) { - foreach (Stetic.Wrapper.ActionGroup ag in actionGroups) - ag.Dispose (); - actionGroups.Clear (); - } - - foreach (WidgetData wd in topLevels) { - if (wd.Widget != null) { - try { - wd.Widget.Destroy (); - } catch (Exception e) { Console.WriteLine (e); } - } - } - - selection = null; - topLevels.Clear (); - widgetLibraries.Clear (); - - iconFactory = new ProjectIconFactory (); - } - - public void Load (string fileName) - { - Load (fileName, fileName); - } - - public void Load (string xmlFile, string fileName) - { - this.fileName = fileName; - XmlDocument doc = new XmlDocument (); - doc.PreserveWhitespace = true; - doc.Load (xmlFile); - Read (doc); - - Id = System.IO.Path.GetFileName (fileName); - } - - void Read (XmlDocument doc) - { - loading = true; - string basePath = fileName != null ? Path.GetDirectoryName (fileName) : null; - - try { - string fn = fileName; - Close (); - fileName = fn; - - XmlNode node = doc.SelectSingleNode ("/stetic-interface"); - if (node == null) - throw new ApplicationException (Catalog.GetString ("Not a Stetic file according to node name.")); - - // Load configuration options - foreach (XmlNode configNode in node.SelectNodes ("configuration/*")) { - XmlElement config = configNode as XmlElement; - if (config == null) continue; - - if (config.LocalName == "images-root-path") - imagesRootPath = config.InnerText; - else if (config.LocalName == "target-gtk-version") - targetGtkVersion = config.InnerText; - } - - // Load the assembly directories - resolver = new AssemblyResolver (app); - foreach (XmlElement libElem in node.SelectNodes ("import/assembly-directory")) { - string dir = libElem.GetAttribute ("path"); - if (dir.Length > 0) { - if (basePath != null && !Path.IsPathRooted (dir)) { - dir = FromOSAgnosticRelPath (Path.Combine (basePath, dir)); - if (Directory.Exists (dir)) - dir = Path.GetFullPath (dir); - } - resolver.Directories.Add (dir); - } - } - - // Import the referenced libraries - foreach (XmlElement libElem in node.SelectNodes ("import/widget-library")) { - string libname = libElem.GetAttribute ("name"); - if (libname.EndsWith (".dll") || libname.EndsWith (".exe")) { - if (basePath != null && !Path.IsPathRooted (libname)) { - libname = FromOSAgnosticRelPath (Path.Combine (basePath, libname)); - if (File.Exists (libname)) - libname = Path.GetFullPath (libname); - } - } - widgetLibraries.Add (libname); - if (libElem.GetAttribute ("internal") == "true") - internalLibs.Add (libname); - } - - app.LoadLibraries (resolver, widgetLibraries); - - ObjectReader reader = new ObjectReader (this, FileFormat.Native); - - if (ownedGlobalActionGroups) { - foreach (XmlElement groupElem in node.SelectNodes ("action-group")) { - Wrapper.ActionGroup actionGroup = new Wrapper.ActionGroup (); - actionGroup.Read (reader, groupElem); - actionGroups.Add (actionGroup); - } - } - - XmlElement iconsElem = node.SelectSingleNode ("icon-factory") as XmlElement; - if (iconsElem != null) - iconFactory.Read (this, iconsElem); - - foreach (XmlElement toplevel in node.SelectNodes ("widget")) { - topLevels.Add (new WidgetData (toplevel.GetAttribute ("id"), toplevel, null)); - } - } finally { - loading = false; - } - } - - public Gtk.Widget GetWidget (WidgetData data) - { - if (data.Widget == null) { - try { - loading = true; - ObjectReader reader = new ObjectReader (this, FileFormat.Native); - Wrapper.Container wrapper = Stetic.ObjectWrapper.ReadObject (reader, data.XmlData) as Wrapper.Container; - data.Widget = wrapper.Wrapped; - } finally { - loading = false; - } - } - - return data.Widget; - } - - public void Save (string fileName) - { - this.fileName = fileName; - XmlDocument doc = Write (false); - - XmlWriter writer = null; - try { - //Always normalize line endings to \n so that they remain consistent. - //Else, because of the way subdocument are persisted unmodified, we could - //end up with mixed line endings. - //Also, string arrays are stored in plain text data with \n separators, - //and break badly if we have \r\n. - var settings = new XmlWriterSettings () { - NewLineHandling = NewLineHandling.Replace, - Encoding = System.Text.Encoding.UTF8, - NewLineChars = "\n", - Indent = true, - }; - - // Write to a temporary file first, just in case something fails - writer = XmlTextWriter.Create (fileName + "~", settings); - doc.Save (writer); - writer.Close (); - - File.Copy (fileName + "~", fileName, true); - File.Delete (fileName + "~"); - } finally { - if (writer != null) - writer.Close (); - } - } - - //in the cases where a path is relative, we store it using / as a path separator - //so the .stetic file doesn't unnecessarily differ between Windows & Linux/Mac - string ToOSAgnosticRelPath (string s) - { - return s.Replace ('\\', '/'); - } - - string FromOSAgnosticRelPath (string s) - { - return s.Replace ('/', Path.DirectorySeparatorChar); - } - - XmlDocument Write (bool includeUndoInfo) - { - XmlDocument doc = new XmlDocument (); - doc.PreserveWhitespace = true; - - XmlElement toplevel = doc.CreateElement ("stetic-interface"); - doc.AppendChild (toplevel); - - XmlElement config = doc.CreateElement ("configuration"); - if (!string.IsNullOrEmpty (imagesRootPath)) { - XmlElement iroot = doc.CreateElement ("images-root-path"); - iroot.InnerText = imagesRootPath; - config.AppendChild (iroot); - } - if (!string.IsNullOrEmpty (targetGtkVersion)) { - XmlElement iroot = doc.CreateElement ("target-gtk-version"); - iroot.InnerText = targetGtkVersion; - config.AppendChild (iroot); - } - - if (config.ChildNodes.Count > 0) - toplevel.AppendChild (config); - - if (widgetLibraries.Count > 0 || (resolver != null && resolver.Directories.Count > 0)) { - XmlElement importElem = doc.CreateElement ("import"); - toplevel.AppendChild (importElem); - string basePath = Path.GetDirectoryName (fileName); - - if (resolver != null && resolver.Directories.Count > 0) { - foreach (string dir in resolver.Directories) { - XmlElement dirElem = doc.CreateElement ("assembly-directory"); - if (basePath != null) - dirElem.SetAttribute ("path", ToOSAgnosticRelPath (AbsoluteToRelativePath (basePath, dir))); - else - dirElem.SetAttribute ("path", dir); - toplevel.AppendChild (dirElem); - } - } - - foreach (string wlib in widgetLibraries) { - string libName = wlib; - XmlElement libElem = doc.CreateElement ("widget-library"); - if (wlib.EndsWith (".dll") || wlib.EndsWith (".exe")) { - if (basePath != null) - libName = ToOSAgnosticRelPath (AbsoluteToRelativePath (basePath, wlib)); - } - - libElem.SetAttribute ("name", libName); - if (IsInternalLibrary (wlib)) - libElem.SetAttribute ("internal", "true"); - importElem.AppendChild (libElem); - } - } - - ObjectWriter writer = new ObjectWriter (doc, FileFormat.Native); - writer.CreateUndoInfo = includeUndoInfo; - if (ownedGlobalActionGroups) { - foreach (Wrapper.ActionGroup agroup in actionGroups) { - XmlElement elem = agroup.Write (writer); - toplevel.AppendChild (elem); - } - } - - if (iconFactory.Icons.Count > 0) - toplevel.AppendChild (iconFactory.Write (doc)); - - foreach (WidgetData data in topLevels) { - if (data.Widget != null) { - Stetic.Wrapper.Container wrapper = Stetic.Wrapper.Container.Lookup (data.Widget); - if (wrapper == null) - continue; - - XmlElement elem = wrapper.Write (writer); - if (elem != null) - toplevel.AppendChild (elem); - } else { - toplevel.AppendChild (doc.ImportNode (data.XmlData, true)); - } - } - - // Remove undo annotations from the xml document - if (!includeUndoInfo) - CleanUndoData (doc.DocumentElement); - - return doc; - } - - public void ImportGlade (string fileName) - { - GladeFiles.Import (this, fileName); - } - - public void ExportGlade (string fileName) - { - GladeFiles.Export (this, fileName); - } - - public void EditIcons () - { - using (Stetic.Editor.EditIconFactoryDialog dlg = new Stetic.Editor.EditIconFactoryDialog (null, this, this.IconFactory)) { - dlg.Run (); - } - } - - internal WidgetEditSession CreateWidgetDesignerSession (WidgetDesignerFrontend frontend, string windowName, Stetic.ProjectBackend editingBackend, bool autoCommitChanges) - { - return new WidgetEditSession (this, frontend, windowName, editingBackend, autoCommitChanges); - } - - internal ActionGroupEditSession CreateGlobalActionGroupDesignerSession (ActionGroupDesignerFrontend frontend, string groupName, bool autoCommitChanges) - { - return new ActionGroupEditSession (frontend, this, null, groupName, autoCommitChanges); - } - - internal ActionGroupEditSession CreateLocalActionGroupDesignerSession (ActionGroupDesignerFrontend frontend, string windowName, bool autoCommitChanges) - { - return new ActionGroupEditSession (frontend, this, windowName, null, autoCommitChanges); - } - - public Wrapper.Container GetTopLevelWrapper (string name, bool throwIfNotFound) - { - Gtk.Widget w = GetTopLevel (name); - if (w != null) { - Wrapper.Container ww = Wrapper.Container.Lookup (w); - if (ww != null) - return (Wrapper.Container) Component.GetSafeReference (ww); - } - if (throwIfNotFound) - throw new InvalidOperationException ("Component not found: " + name); - return null; - } - - HashSet modifiedWidgets = new HashSet (); - bool allModified; - - public void SetWidgetModified (string widgetName) - { - modifiedWidgets.Add (widgetName); - } - - public void SetAllWidgetsModified () - { - allModified = true; - } - - public void ResetModifiedWidgetFlags () - { - allModified = false; - modifiedWidgets.Clear (); - } - - internal bool IsWidgetModified (string name) - { - return allModified || modifiedWidgets.Contains (name); - } - - public object AddNewWidget (string type, string name) - { - ClassDescriptor cls = Registry.LookupClassByName (type); - Gtk.Widget w = (Gtk.Widget) cls.NewInstance (this); - w.Name = name; - this.AddWidget (w); - return Component.GetSafeReference (ObjectWrapper.Lookup (w)); - } - - public object AddNewWidgetFromTemplate (string template) - { - XmlDocument doc = new XmlDocument (); - doc.LoadXml (template); - Gtk.Widget widget = Stetic.WidgetUtils.ImportWidget (this, doc.DocumentElement); - AddWidget (widget); - return Component.GetSafeReference (ObjectWrapper.Lookup (widget)); - } - - public void RemoveWidget (string name) - { - WidgetData data = GetWidgetData (name); - if (data == null) - return; - - if (frontend != null) - frontend.NotifyWidgetRemoved (data.Name); - - XmlElement elem; - if (data.Widget != null) - elem = Stetic.WidgetUtils.ExportWidget (data.Widget); - else - elem = (XmlElement) data.XmlData.Clone (); - XmlDocument doc = new XmlDocument (); - XmlNode node = doc.ImportNode (elem, true); - doc.AppendChild (node); - string dir = Path.Combine (Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "stetic"), "deleted-designs"); - if (!Directory.Exists (dir)) - Directory.CreateDirectory (dir); - doc.Save (Path.Combine (dir, name + ".xml")); - topLevels.Remove (data); - if (data.Widget != null) - data.Widget.Destroy (); - } - - public Stetic.Wrapper.ActionGroup AddNewActionGroup (string name) - { - Stetic.Wrapper.ActionGroup group = new Stetic.Wrapper.ActionGroup (); - group.Name = name; - ActionGroups.Add (group); - return group; - } - - public Stetic.Wrapper.ActionGroup AddNewActionGroupFromTemplate (string template) - { - XmlDocument doc = new XmlDocument (); - doc.LoadXml (template); - ObjectReader or = new ObjectReader (this, FileFormat.Native); - Stetic.Wrapper.ActionGroup group = new Stetic.Wrapper.ActionGroup (); - group.Read (or, doc.DocumentElement); - ActionGroups.Add (group); - return group; - } - - public void RemoveActionGroup (Stetic.Wrapper.ActionGroup group) - { - ActionGroups.Remove (group); - } - - public Wrapper.ActionGroup[] GetActionGroups () - { - // Needed since ActionGroupCollection can't be made serializable - return ActionGroups.ToArray (); - } - - public void CopyWidgetToProject (string name, ProjectBackend other, string replacedName) - { - WidgetData wdata = GetWidgetData (name); - if (name == null) - throw new InvalidOperationException ("Component not found: " + name); - - XmlElement data; - if (wdata.Widget != null) - data = Stetic.WidgetUtils.ExportWidget (wdata.Widget); - else - data = (XmlElement) wdata.XmlData.Clone (); - - // If widget already exist, replace it - wdata = other.GetWidgetData (replacedName); - if (wdata == null) { - wdata = new WidgetData (name, data, null); - other.topLevels.Add (wdata); - } else { - if (wdata.Widget != null) { - // If a widget instance already exist, load the new data on it - Wrapper.Widget sw = Wrapper.Widget.Lookup (wdata.Widget); - sw.Read (new ObjectReader (other, FileFormat.Native), data); - sw.NotifyChanged (); - if (name != replacedName) - other.OnWidgetNameChanged (new Wrapper.WidgetNameChangedArgs (sw, replacedName, name), true); - } else { - wdata.SetXmlData (name, data); - if (name != replacedName) - other.OnWidgetNameChanged (new Wrapper.WidgetNameChangedArgs (null, replacedName, name), true); - } - } - } - - void CleanUndoData (XmlElement elem) - { - elem.RemoveAttribute ("undoId"); - foreach (XmlNode cn in elem.ChildNodes) { - XmlElement ce = cn as XmlElement; - if (ce != null) - CleanUndoData (ce); - } - } - - void OnRegistryChanging (object o, EventArgs args) - { - if (loading) return; - - // Store a copy of the current tree. The tree will - // be recreated once the registry change is completed. - - tempDoc = Write (true); - Selection = null; - } - - void OnRegistryChanged (object o, EventArgs args) - { - if (loading) return; - - if (tempDoc != null) - LoadStatus (tempDoc); - } - - public object SaveStatus () - { - return Write (true); - } - - public void LoadStatus (object ob) - { - if (frontend != null) - frontend.NotifyProjectReloading (); - if (ProjectReloading != null) - ProjectReloading (this, EventArgs.Empty); - - ProjectIconFactory icf = iconFactory; - - Read ((XmlDocument)ob); - - // Reuse the same icon factory, since a registry change has no effect to it - // and it may be inherited from another project - iconFactory = icf; - - if (frontend != null) - frontend.NotifyProjectReloaded (); - if (ProjectReloaded != null) - ProjectReloaded (this, EventArgs.Empty); - NotifyComponentTypesChanged (); - } - - public void Reload () - { - OnRegistryChanging (null, null); - OnRegistryChanged (null, null); - } - - public string Id { - get { return id; } - set { id = value; } - } - - public bool Modified { - get { return modified; } - set { - if (modified != value) { - modified = value; - if (frontend != null) - frontend.NotifyModifiedChanged (); - OnModifiedChanged (EventArgs.Empty); - } - } - } - - public AssemblyResolver Resolver { - get { return resolver; } - } - - public string ImportFile (string filePath) - { - return frontend.ImportFile (filePath); - } - - public void AddWindow (Gtk.Window window) - { - AddWindow (window, false); - } - - public void AddWindow (Gtk.Window window, bool select) - { - AddWidget (window); - if (select) - Selection = window; - } - - public void AddWidget (Gtk.Widget widget) - { - modifiedWidgets.Add (widget.Name); - if (!typeof(Gtk.Container).IsInstanceOfType (widget)) - throw new System.ArgumentException ("widget", "Only containers can be top level widgets"); - topLevels.Add (new WidgetData (null, null, widget)); - - if (!loading) { - Stetic.Wrapper.Widget ww = Stetic.Wrapper.Widget.Lookup (widget); - if (ww == null) - throw new InvalidOperationException ("Widget not wrapped"); - if (frontend != null) - frontend.NotifyWidgetAdded (Component.GetSafeReference (ww), widget.Name, ww.ClassDescriptor.Name); - OnWidgetAdded (new Stetic.Wrapper.WidgetEventArgs (ww)); - } - } - - void IProject.NotifyObjectChanged (ObjectWrapperEventArgs args) - { - if (loading) - return; - NotifyChanged (); - if (ObjectChanged != null) - ObjectChanged (this, args); - } - - void IProject.NotifyNameChanged (Stetic.Wrapper.WidgetNameChangedArgs args) - { - if (loading) - return; - NotifyChanged (); - OnWidgetNameChanged (args, args.WidgetWrapper.IsTopLevel); - } - - void IProject.NotifySignalAdded (SignalEventArgs args) - { - if (loading) - return; - if (frontend != null) - frontend.NotifySignalAdded (Component.GetSafeReference (args.Wrapper), null, args.Signal); - OnSignalAdded (args); - } - - void IProject.NotifySignalRemoved (SignalEventArgs args) - { - if (loading) - return; - if (frontend != null) - frontend.NotifySignalRemoved (Component.GetSafeReference (args.Wrapper), null, args.Signal); - OnSignalRemoved (args); - } - - void IProject.NotifySignalChanged (SignalChangedEventArgs args) - { - if (loading) - return; - OnSignalChanged (args); - } - - void IProject.NotifyWidgetContentsChanged (Wrapper.Widget w) - { - if (loading) - return; - if (WidgetContentsChanged != null) - WidgetContentsChanged (this, new Wrapper.WidgetEventArgs (w)); - } - - void OnWidgetNameChanged (Stetic.Wrapper.WidgetNameChangedArgs args, bool isTopLevel) - { - if (frontend != null) - frontend.NotifyWidgetNameChanged (Component.GetSafeReference (args.WidgetWrapper), args.OldName, args.NewName, isTopLevel); - if (args.WidgetWrapper != null && WidgetNameChanged != null) - WidgetNameChanged (this, args); - } - - void OnSignalAdded (object sender, SignalEventArgs args) - { - if (frontend != null) - frontend.NotifySignalAdded (Component.GetSafeReference (args.Wrapper), null, args.Signal); - OnSignalAdded (args); - } - - protected virtual void OnSignalAdded (SignalEventArgs args) - { - if (SignalAdded != null) - SignalAdded (this, args); - } - - void OnSignalRemoved (object sender, SignalEventArgs args) - { - if (frontend != null) - frontend.NotifySignalRemoved (Component.GetSafeReference (args.Wrapper), null, args.Signal); - OnSignalRemoved (args); - } - - protected virtual void OnSignalRemoved (SignalEventArgs args) - { - if (SignalRemoved != null) - SignalRemoved (this, args); - } - - void OnSignalChanged (object sender, SignalChangedEventArgs args) - { - OnSignalChanged (args); - } - - protected virtual void OnSignalChanged (SignalChangedEventArgs args) - { - if (frontend != null) - frontend.NotifySignalChanged (Component.GetSafeReference (args.Wrapper), null, args.OldSignal, args.Signal); - if (SignalChanged != null) - SignalChanged (this, args); - } - - public Gtk.Widget[] Toplevels { - get { - List list = new List (); - foreach (WidgetData w in topLevels) - list.Add (GetWidget (w)); - return list.ToArray (); - } - } - - public Gtk.Widget GetTopLevel (string name) - { - WidgetData w = GetWidgetData (name); - if (w != null) - return GetWidget (w); - else - return null; - } - - public WidgetData GetWidgetData (string name) - { - foreach (WidgetData w in topLevels) { - if (w.Name == name) - return w; - } - return null; - } - - // IProject - - public Gtk.Widget Selection { - get { - return selection; - } - set { - if (selection == value) - return; - - Wrapper.ActionGroupCollection newCollection = null; - - // FIXME: should there be an IsDestroyed property? - if (selection != null && selection.Handle != IntPtr.Zero) { - Stetic.Wrapper.Container parent = Stetic.Wrapper.Container.LookupParent (selection); - if (parent == null) - parent = Stetic.Wrapper.Container.Lookup (selection); - if (parent != null) - parent.UnSelect (selection); - } - - selection = value; - - if (selection != null && selection.Handle != IntPtr.Zero) { - Stetic.Wrapper.Container parent = Stetic.Wrapper.Container.LookupParent (selection); - if (parent == null) - parent = Stetic.Wrapper.Container.Lookup (selection); - if (parent != null) - parent.Select (selection); - Wrapper.Widget w = Wrapper.Widget.Lookup (selection); - if (w != null) - newCollection = w.LocalActionGroups; - } - - if (SelectionChanged != null) - SelectionChanged (this, new Wrapper.WidgetEventArgs (Wrapper.Widget.Lookup (selection))); - - if (oldTopActionCollection != newCollection) { - if (oldTopActionCollection != null) - oldTopActionCollection.ActionGroupChanged -= OnComponentTypesChanged; - if (newCollection != null) - newCollection.ActionGroupChanged += OnComponentTypesChanged; - oldTopActionCollection = newCollection; - OnComponentTypesChanged (null, null); - } - } - } - - public void PopupContextMenu (Stetic.Wrapper.Widget wrapper) - { - Gtk.Menu m = new ContextMenu (wrapper); - m.Popup (); - } - - public void PopupContextMenu (Placeholder ph) - { - Gtk.Menu m = new ContextMenu (ph); - m.Popup (); - } - - static string AbsoluteToRelativePath (string baseDirectoryPath, string absPath) - { - if (!Path.IsPathRooted (absPath)) - return absPath; - - absPath = Path.GetFullPath (absPath); - baseDirectoryPath = Path.GetFullPath (baseDirectoryPath); - char[] separators = { Path.DirectorySeparatorChar, Path.VolumeSeparatorChar, Path.AltDirectorySeparatorChar }; - - string[] bPath = baseDirectoryPath.Split (separators); - string[] aPath = absPath.Split (separators); - int indx = 0; - for(; indx < Math.Min(bPath.Length, aPath.Length); ++indx) { - if(!bPath[indx].Equals(aPath[indx])) - break; - } - - if (indx == 0) { - return absPath; - } - - string erg = ""; - - if(indx == bPath.Length) { - erg += "." + Path.DirectorySeparatorChar; - } else { - for (int i = indx; i < bPath.Length; ++i) { - erg += ".." + Path.DirectorySeparatorChar; - } - } - erg += String.Join(Path.DirectorySeparatorChar.ToString(), aPath, indx, aPath.Length-indx); - - return erg; - } - - void OnComponentTypesChanged (object s, EventArgs a) - { - if (!loading) - NotifyComponentTypesChanged (); - } - - public void NotifyComponentTypesChanged () - { - if (frontend != null) - frontend.NotifyComponentTypesChanged (); - if (ComponentTypesChanged != null) - ComponentTypesChanged (this, EventArgs.Empty); - } - - void OnGroupAdded (object s, Stetic.Wrapper.ActionGroupEventArgs args) - { - args.ActionGroup.SignalAdded += OnSignalAdded; - args.ActionGroup.SignalRemoved += OnSignalRemoved; - args.ActionGroup.SignalChanged += OnSignalChanged; - if (frontend != null) - frontend.NotifyActionGroupAdded (args.ActionGroup.Name); - OnComponentTypesChanged (null, null); - } - - void OnGroupRemoved (object s, Stetic.Wrapper.ActionGroupEventArgs args) - { - args.ActionGroup.SignalAdded -= OnSignalAdded; - args.ActionGroup.SignalRemoved -= OnSignalRemoved; - args.ActionGroup.SignalChanged -= OnSignalChanged; - if (frontend != null) - frontend.NotifyActionGroupRemoved (args.ActionGroup.Name); - OnComponentTypesChanged (null, null); - } - - void NotifyChanged () - { - Modified = true; - if (frontend != null) - frontend.NotifyChanged (); - if (Changed != null) - Changed (this, EventArgs.Empty); - } - - protected virtual void OnModifiedChanged (EventArgs args) - { - if (ModifiedChanged != null) - ModifiedChanged (this, args); - } - - protected virtual void OnWidgetAdded (Stetic.Wrapper.WidgetEventArgs args) - { - NotifyChanged (); - if (WidgetAdded != null) - WidgetAdded (this, args); - } - } - - class WidgetData - { - string name; - - public WidgetData (string name, XmlElement data, Gtk.Widget widget) - { - SetXmlData (name, data); - Widget = widget; - } - - public void SetXmlData (string name, XmlElement data) - { - this.name = name; - XmlData = data; - Widget = null; - } - - public XmlElement XmlData; - public Gtk.Widget Widget; - - public string Name { - get { - if (Widget != null) - return Widget.Name; - else - return name; - } - } - } - - public static class EncodingUtility - { - static System.Text.UTF8Encoding utf8NoBom; - - /// This is so we can write XML files on .NET in a compatible way with Mono, - /// since .NET's XmlWriter writes the BOM but Mono's does not. - public static System.Text.UTF8Encoding UTF8NoBom { - get { - return utf8NoBom ?? (utf8NoBom = new System.Text.UTF8Encoding (false)); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ProjectViewBackend.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/ProjectViewBackend.cs deleted file mode 100644 index e6cd0876dd9..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ProjectViewBackend.cs +++ /dev/null @@ -1,346 +0,0 @@ -using Gtk; -using System; -using Mono.Unix; -using System.Collections.Generic; - -namespace Stetic { - - internal class ProjectViewBackend : ScrolledWindow - { - ProjectViewBackendNodeView nodeView; - - public ProjectViewBackend (ProjectViewFrontend frontend) - { - ShadowType = Gtk.ShadowType.In; - nodeView = new ProjectViewBackendNodeView (frontend); - Add (nodeView); - ShowAll (); - } - - public event Wrapper.WidgetEventHandler WidgetActivated { - add { nodeView.WidgetActivated += value; } - remove { nodeView.WidgetActivated -= value; } - } - - public void Bind (WidgetEditSession newSession) - { - nodeView.Bind (newSession); - } - } - - internal class ProjectViewBackendNodeView : TreeView - { - ProjectViewFrontend frontend; - TreeStore store; - WidgetEditSession editSession; - - const int ColIcon = 0; - const int ColName = 1; - const int ColWrapper = 2; - const int ColFilled = 3; - - public event Wrapper.WidgetEventHandler WidgetActivated; - - public ProjectViewBackendNodeView (ProjectViewFrontend frontend) - { - this.frontend = frontend; - HeadersVisible = false; - - store = new TreeStore (typeof(Gdk.Pixbuf), typeof(string), typeof(ObjectWrapper), typeof(bool)); - Model = store; - - TreeViewColumn col; - CellRenderer renderer; - - col = new TreeViewColumn (); - - renderer = new CellRendererPixbuf (); - col.PackStart (renderer, false); - col.AddAttribute (renderer, "pixbuf", 0); - - renderer = new CellRendererText (); - col.PackStart (renderer, true); - col.AddAttribute (renderer, "text", 1); - - AppendColumn (col); - - Selection.Mode = SelectionMode.Single; - Selection.Changed += RowSelected; - TestExpandRow += OnTestExpandRow; - ShowAll (); - } - - public void Bind (WidgetEditSession newSession) - { - if (editSession != null) { - editSession.SelectionChanged -= WidgetSelected; - editSession.EditingBackend.ProjectReloaded -= OnProjectReloaded; - editSession.EditingBackend.WidgetNameChanged -= OnWidgetNameChanged; - editSession.EditingBackend.WidgetContentsChanged -= OnContentsChanged; - } - editSession = newSession; - if (editSession != null) { - editSession.SelectionChanged += WidgetSelected; - editSession.EditingBackend.ProjectReloaded += OnProjectReloaded; - editSession.EditingBackend.WidgetNameChanged += OnWidgetNameChanged; - editSession.EditingBackend.WidgetContentsChanged += OnContentsChanged; - } - LoadProject (); - } - - public override void Dispose () - { - if (editSession != null) { - editSession.SelectionChanged -= WidgetSelected; - editSession.EditingBackend.ProjectReloaded -= OnProjectReloaded; - editSession.EditingBackend.WidgetNameChanged -= OnWidgetNameChanged; - editSession.EditingBackend.WidgetContentsChanged -= OnContentsChanged; - } - base.Dispose (); - } - - public void LoadProject () - { - Clear (); - if (editSession == null || editSession.RootWidget == null) - return; - - AddNode (TreeIter.Zero, editSession.RootWidget.Wrapped); - } - - public void AddNode (TreeIter iter, Gtk.Widget widget) - { - Stetic.Wrapper.Widget wrapper = GetVisibleWrapper (widget); - if (wrapper == null) - return; - - Gdk.Pixbuf icon = wrapper.ClassDescriptor.Icon.ScaleSimple (16, 16, Gdk.InterpType.Bilinear); - string txt = widget.Name; - - if (!iter.Equals (TreeIter.Zero)) - iter = store.AppendValues (iter, icon, txt, wrapper, true); - else - iter = store.AppendValues (icon, txt, wrapper, true); - - FillChildren (iter, wrapper); - } - - void FillChildren (TreeIter it, Wrapper.Widget wrapper) - { - Stetic.Wrapper.Container container = wrapper as Wrapper.Container; - if (container != null) { - foreach (Gtk.Widget w in container.RealChildren) { - Stetic.Wrapper.Widget ww = GetVisibleWrapper (w); - if (ww != null) { - // Add a dummy node to allow lazy loading - store.SetValue (it, ColFilled, false); - store.AppendValues (it, null, "", null, false); - return; - } - } - } - store.SetValue (it, ColFilled, true); - } - - Wrapper.Widget GetVisibleWrapper (Gtk.Widget w) - { - Stetic.Wrapper.Widget wrapper = Stetic.Wrapper.Widget.Lookup (w); - if (wrapper == null || wrapper.Unselectable) - return null; - else - return wrapper; - } - - void EnsureFilled (TreeIter it) - { - bool filled = (bool) store.GetValue (it, ColFilled); - if (filled) - return; - - // Remove the dummy node - TreeIter cit; - store.IterChildren (out cit, it); - store.Remove (ref cit); - - // Add the real children - Stetic.Wrapper.Container container = store.GetValue (it, ColWrapper) as Wrapper.Container; - if (container != null) { - foreach (Gtk.Widget w in container.RealChildren) - AddNode (it, w); - } - - store.SetValue (it, ColFilled, true); - } - - void OnTestExpandRow (object s, Gtk.TestExpandRowArgs args) - { - EnsureFilled (args.Iter); - args.RetVal = false; - } - - public void Clear () - { - TreeIter it; - while (store.GetIterFirst (out it)) { - store.Remove (ref it); - } - } - - void RefreshNode (TreeIter it) - { - Wrapper.Widget wrapper = (Wrapper.Widget) store.GetValue (it, ColWrapper); - store.SetValue (it, ColName, wrapper.Wrapped.Name); - TreeIter cit; - while (store.IterChildren (out cit, it)) { - store.Remove (ref cit); - } - FillChildren (it, wrapper); - } - - void OnWidgetNameChanged (object s, Wrapper.WidgetNameChangedArgs args) - { - TreeIter? node = FindNode (args.WidgetWrapper, false); - if (node == null) - return; - store.SetValue (node.Value, ColName, args.NewName); - } - - void OnContentsChanged (object s, Wrapper.WidgetEventArgs args) - { - TreeIter? node = FindNode (args.WidgetWrapper, false); - if (node != null) - RefreshNode (node.Value); - } - - void OnProjectReloaded (object o, EventArgs a) - { - LoadProject (); - } - - Stetic.Wrapper.Widget SelectedWrapper { - get { - TreeIter iter; - if (!Selection.GetSelected (out iter)) - return null; - Wrapper.Widget w = (Wrapper.Widget) store.GetValue (iter, ColWrapper); - return w; - } - } - - bool syncing = false; - - void RowSelected (object obj, EventArgs args) - { - if (!syncing) { - syncing = true; - Stetic.Wrapper.Widget selection = SelectedWrapper; - if (selection != null) - selection.Select (); - syncing = false; - NotifySelectionChanged (selection); - } - } - - void WidgetSelected (object s, Wrapper.WidgetEventArgs args) - { - if (!syncing) { - syncing = true; - if (args.Widget != null) { - Wrapper.Widget w = Wrapper.Widget.Lookup (args.Widget); - if (w != null) { - TreeIter? it = FindNode (w, true); - if (it != null) { - ExpandToPath (store.GetPath (it.Value)); - Selection.SelectIter (it.Value); - ScrollToCell (store.GetPath (it.Value), Columns[0], false, 0, 0); - NotifySelectionChanged (w); - } - } - } - else { - Selection.UnselectAll (); - NotifySelectionChanged (null); - } - syncing = false; - } - } - - TreeIter? FindNode (Wrapper.Widget w, bool loadBranches) - { - Wrapper.Widget parent = w.ParentWrapper; - TreeIter it; - - if (parent == null) { - if (!store.GetIterFirst (out it)) - return null; - } else { - TreeIter? pi = FindNode (parent, loadBranches); - if (pi == null) - return null; - if (loadBranches) - EnsureFilled (pi.Value); - if (!store.IterChildren (out it, pi.Value)) - return null; - } - - do { - Wrapper.Widget cw = (Wrapper.Widget) store.GetValue (it, ColWrapper); - if (cw == w) - return it; - } while (store.IterNext (ref it)); - - return null; - } - - void NotifySelectionChanged (Stetic.Wrapper.Widget w) - { - if (frontend == null) - return; - if (w != null) - frontend.NotifySelectionChanged (Component.GetSafeReference (w), w.Wrapped.Name, w.ClassDescriptor.Name); - else - frontend.NotifySelectionChanged (null, null, null); - } - - //HACK: show context menu in release event instead of show event to work around gtk bug - protected override bool OnButtonReleaseEvent (Gdk.EventButton evt) - { - if (Stetic.Editor.GtkWorkarounds.IsContextMenuButton (evt)) - return OnPopupMenu (); - return base.OnButtonReleaseEvent (evt); - } - - protected override bool OnPopupMenu () - { - Stetic.Wrapper.Widget selection = SelectedWrapper; - - if (selection != null) { - Menu m = new ContextMenu (selection); - if (selection.IsTopLevel) { - // Allow deleting top levels from the project view - ImageMenuItem item = new ImageMenuItem (Gtk.Stock.Delete, null); - item.Activated += delegate (object obj, EventArgs args) { - selection.Delete (); - }; - item.Show (); - m.Add (item); - } - m.Popup (); - return true; - } else - return base.OnPopupMenu (); - } - - protected override void OnRowActivated (TreePath path, TreeViewColumn col) - { - base.OnRowActivated (path, col); - Stetic.Wrapper.Widget w = SelectedWrapper; - if (w != null) { - if (frontend != null) - frontend.NotifyWidgetActivated (Component.GetSafeReference (w), w.Wrapped.Name, w.ClassDescriptor.Name); - if (WidgetActivated != null) - WidgetActivated (this, new Wrapper.WidgetEventArgs (w)); - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/PropertyEditor.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/PropertyEditor.cs deleted file mode 100644 index 27656da7183..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/PropertyEditor.cs +++ /dev/null @@ -1,64 +0,0 @@ -using Gtk; -using System; -using System.Collections; -using System.Reflection; - -namespace Stetic { - - class PropertyEditor : VBox - { - IPropertyEditor propEditor; - EditSession session; - - public PropertyEditor (PropertyDescriptor prop) : base (false, 0) - { - propEditor = CreateEditor (prop); - Add ((Gtk.Widget) propEditor); - } - - public void AttachObject (object ob) - { - if (session != null) - session.AttachObject (ob); - } - - public IPropertyEditor CreateEditor (PropertyDescriptor prop) - { - PropertyEditorCell cell = PropertyEditorCell.GetPropertyCell (prop); - cell.Initialize (this, prop, null); - - session = cell.StartEditing (new Gdk.Rectangle (), StateType.Normal); - if (session == null) - return new DummyEditor (); - - Gtk.Widget w = (Gtk.Widget) session.Editor as Gtk.Widget; - w.ShowAll (); - return session.Editor; - } - - public void Update () - { - if (session != null) - session.UpdateEditor (); - } - } - - class DummyEditor: Gtk.Label, IPropertyEditor - { - public void Initialize (PropertyDescriptor prop) - { - Text = "(" + prop.PropertyType.Name + ")"; - } - - public void AttachObject (object obj) - { - } - - public object Value { - get { return null; } - set { } - } - - public event EventHandler ValueChanged { add {} remove {} } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/PropertyGrid.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/PropertyGrid.cs deleted file mode 100644 index fe8ca717bd6..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/PropertyGrid.cs +++ /dev/null @@ -1,275 +0,0 @@ -using Gtk; -using GLib; -using System; -using System.Collections; -using System.Reflection; - -namespace Stetic { - - internal class PropertyGrid : Gtk.VBox { - - Hashtable cachedGroups = new Hashtable (); - - Stetic.Wrapper.Widget selection; - Stetic.Wrapper.Widget newSelection; - Stetic.Wrapper.Container.ContainerChild packingSelection; - - PropertyGridHeader header; - Gtk.Widget noSelection; - - ProjectBackend project; - - public PropertyGrid () - { - header = new PropertyGridHeader (); - header.Show (); - PackStart (header, false, false, 0); - - Label lab = new Label (); - lab.Markup = "No selection"; - PackStart (lab, false, false, 0); - noSelection = lab; - - Stetic.Registry.RegistryChanging += new EventHandler (OnRegistryChanging); - } - - public PropertyGrid (ProjectBackend project): this () - { - this.ProjectBackend = project; - } - - public override void Dispose () - { - base.Dispose (); - } - - void OnRegistryChanging (object o, EventArgs args) - { - cachedGroups.Clear (); - Clear (); - foreach (Gtk.Widget w in Children) - if (! (w is PropertyGridHeader)) - Remove (w); - } - - public ProjectBackend ProjectBackend { - get { return project; } - set { - if (project != null) - project.SelectionChanged -= Selected; - - project = value; - project.SelectionChanged += Selected; - Selected (null, null); - } - } - - void Clear () - { - if (selection != null) { - selection.Notify -= Notified; - selection = null; - } - foreach (Gtk.Widget w in Children) - w.Hide (); - } - - void Notified (object wrapper, string propertyName) - { - foreach (object ob in Children) { - PropertyGridGroup grid = ob as PropertyGridGroup; - if (grid != null) - grid.Notified (propertyName); - } - } - - void Selected (object s, Wrapper.WidgetEventArgs args) - { - newSelection = args != null ? args.WidgetWrapper : null; - GLib.Timeout.Add (50, new GLib.TimeoutHandler (SelectedHandler)); - } - - bool SelectedHandler () - { - ClassDescriptor klass; - - Clear (); - - selection = newSelection; - - if (selection == null || selection.Wrapped is ErrorWidget) { - noSelection.Show (); - return false; - } - - header.Show (); - - selection.Notify += Notified; - - klass = selection.ClassDescriptor; - - header.AttachObject (selection.Wrapped); - AppendItemGroups (klass, selection.Wrapped); - - packingSelection = Stetic.Wrapper.Container.ChildWrapper (selection); - if (packingSelection != null) { - klass = packingSelection.ClassDescriptor; - if (klass.ItemGroups.Count > 0) { - AppendItemGroups (klass, packingSelection.Wrapped); - packingSelection.Notify += Notified; - } - } - return false; - } - - void AppendItemGroups (ClassDescriptor klass, object obj) - { - int n = 1; - foreach (ItemGroup igroup in klass.ItemGroups) { - PropertyGridGroup grid = (PropertyGridGroup) cachedGroups [igroup]; - if (grid == null) { - grid = new PropertyGridGroup (); - grid.AddGroup (igroup); - cachedGroups [igroup] = grid; - PackStart (grid, false, false, 0); - } - ReorderChild (grid, n++); - grid.ShowAll (); - grid.AttachObject (obj); - } - } - } - - class PropertyGridGroup: Stetic.Grid - { - Hashtable editors; - Hashtable sensitives, invisibles; - object obj; - - public PropertyGridGroup () - { - editors = new Hashtable (); - sensitives = new Hashtable (); - invisibles = new Hashtable (); - } - - public void AddGroup (ItemGroup igroup) - { - AppendGroup (igroup.Label, true); - foreach (ItemDescriptor item in igroup) { - if (item.IsInternal) - continue; - if (item is PropertyDescriptor) - AppendProperty ((PropertyDescriptor)item); - else if (item is CommandDescriptor) - AppendCommand ((CommandDescriptor)item); - } - } - - public virtual void AttachObject (object ob) - { - this.obj = ob; - - foreach (object ed in editors.Values) { - PropertyEditor pe = ed as PropertyEditor; - if (pe != null) - pe.AttachObject (ob); - } - UpdateSensitivity (); - } - - protected void AppendProperty (PropertyDescriptor prop) - { - PropertyEditor rep = new PropertyEditor (prop); - - // FIXME: Make sure all notify events are based on prop names, not propspec - editors[prop.Name] = rep; - - AppendPair (prop.Label, rep, prop.Description); - rep.ShowAll (); - - if (prop.HasDependencies) - sensitives[prop] = prop; - if (prop.HasVisibility) - invisibles[prop] = prop; - } - - void AppendCommand (CommandDescriptor cmd) - { - Gtk.Button button = new Gtk.Button (cmd.Label); - button.Clicked += delegate (object o, EventArgs args) { - cmd.Run (this.obj); - }; - button.Show (); - Append (button, cmd.Description); - - if (cmd.HasDependencies) { - editors[cmd.Name] = button; - sensitives[cmd] = cmd; - } - if (cmd.HasVisibility) { - editors[cmd.Name] = button; - invisibles[cmd] = cmd; - } - } - - void UpdateSensitivity () - { - foreach (ItemDescriptor item in sensitives.Keys) { - Widget w = editors[item.Name] as Widget; - if (w != null) { - object ob = sensitives.Contains (item) ? obj : null; - w.Sensitive = item.EnabledFor (ob); - } - } - foreach (ItemDescriptor item in invisibles.Keys) { - Widget w = editors[item.Name] as Widget; - if (w != null) { - object ob = invisibles.Contains (item) ? obj : null; - if (!item.VisibleFor (ob)) - w.Hide (); - else - w.Show (); - } - } - } - - public void Notified (string propertyName) - { - PropertyEditor ed = editors [propertyName] as PropertyEditor; - if (ed != null) - ed.Update (); - UpdateSensitivity (); - } - } - - class PropertyGridHeader: PropertyGridGroup - { - PropertyDescriptor name; - Gtk.Image image; - Gtk.Label label; - - public PropertyGridHeader () - { - name = (PropertyDescriptor)Registry.LookupClassByName ("Gtk.Widget") ["Name"]; - AppendProperty (name); - - Gtk.HBox box = new Gtk.HBox (false, 6); - image = new Gtk.Image (); - box.PackStart (image, false, false, 0); - label = new Gtk.Label (); - box.PackStart (label, false, false, 0); - box.ShowAll (); - AppendPair ("Widget Class", box, null); - } - - public override void AttachObject (object ob) - { - base.AttachObject (ob); - Gtk.Widget w = (Gtk.Widget) ob; - ObjectWrapper wrapper = ObjectWrapper.Lookup (w); - image.Pixbuf = wrapper.ClassDescriptor.Icon; - label.Text = wrapper.WrappedTypeName; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/PropertyTree.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/PropertyTree.cs deleted file mode 100644 index f297ad70a3f..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/PropertyTree.cs +++ /dev/null @@ -1,582 +0,0 @@ - -using System; -using System.Collections; -using Gtk; -using Gdk; -using Mono.Unix; - -namespace Stetic -{ - public class PropertyTree: Gtk.ScrolledWindow - { - Gtk.TreeStore store; - InternalTree tree; - TreeViewColumn editorColumn; - Hashtable propertyRows; - Hashtable sensitives, invisibles; - ArrayList expandStatus = new ArrayList (); - - public PropertyTree () - { - propertyRows = new Hashtable (); - sensitives = new Hashtable (); - invisibles = new Hashtable (); - - store = new TreeStore (typeof (string), typeof(PropertyDescriptor), typeof(bool), typeof(InstanceData)); - - tree = new InternalTree (this, store); - - CellRendererText crt; - - TreeViewColumn col; - - col = new TreeViewColumn (); - col.Title = Catalog.GetString ("Property"); - crt = new CellRendererPropertyGroup (tree); - col.PackStart (crt, true); - col.SetCellDataFunc (crt, new TreeCellDataFunc (GroupData)); - col.Resizable = true; - col.Expand = false; - col.Sizing = TreeViewColumnSizing.Fixed; - col.FixedWidth = 150; - tree.AppendColumn (col); - - editorColumn = new TreeViewColumn (); - editorColumn.Title = Catalog.GetString ("Value"); - - CellRendererProperty crp = new CellRendererProperty (tree); - - editorColumn.PackStart (crp, true); - editorColumn.SetCellDataFunc (crp, new TreeCellDataFunc (PropertyData)); - editorColumn.Sizing = TreeViewColumnSizing.Fixed; - editorColumn.Resizable = false; - editorColumn.Expand = true; - tree.AppendColumn (editorColumn); - - tree.HeadersVisible = false; - this.ShadowType = Gtk.ShadowType.In; - this.HscrollbarPolicy = Gtk.PolicyType.Never; - - Add (tree); - ShowAll (); - - tree.Selection.Changed += OnSelectionChanged; - } - - public void AddProperties (ItemGroupCollection itemGroups, object instance, string targetGtkVersion) - { - foreach (ItemGroup igroup in itemGroups) - AddGroup (igroup, instance, targetGtkVersion); - } - - public void SaveStatus () - { - expandStatus.Clear (); - - TreeIter iter; - if (!tree.Model.GetIterFirst (out iter)) - return; - - do { - if (tree.GetRowExpanded (tree.Model.GetPath (iter))) { - expandStatus.Add (tree.Model.GetValue (iter, 0)); - } - } while (tree.Model.IterNext (ref iter)); - } - - public void RestoreStatus () - { - TreeIter iter; - if (!tree.Model.GetIterFirst (out iter)) - return; - - // If the tree only has one group, show it always expanded - TreeIter iter2 = iter; - if (!tree.Model.IterNext (ref iter2)) { - tree.ExpandRow (tree.Model.GetPath (iter), true); - return; - } - - do { - object grp = tree.Model.GetValue (iter, 0); - if (expandStatus.Contains (grp)) - tree.ExpandRow (tree.Model.GetPath (iter), true); - } while (tree.Model.IterNext (ref iter)); - } - - public virtual void Clear () - { - store.Clear (); - propertyRows.Clear (); - sensitives.Clear (); - invisibles.Clear (); - } - - public virtual void Update () - { - // Just repaint the cells - QueueDraw (); - } - - public void AddGroup (ItemGroup igroup, object instance, string targetGtkVersion) - { - ArrayList props = new ArrayList (); - foreach (ItemDescriptor item in igroup) { - if (item.IsInternal) - continue; - if (item is PropertyDescriptor && item.SupportsGtkVersion (targetGtkVersion)) - props.Add (item); - } - - if (props.Count == 0) - return; - - InstanceData idata = new InstanceData (instance); - TreeIter iter = store.AppendValues (igroup.Label, null, true, idata); - foreach (PropertyDescriptor item in props) - AppendProperty (iter, (PropertyDescriptor)item, idata); - } - - protected void AppendProperty (PropertyDescriptor prop, object instance) - { - AppendProperty (TreeIter.Zero, prop, new InstanceData (instance)); - } - - protected void AppendProperty (TreeIter piter, PropertyDescriptor prop, object instance) - { - AppendProperty (piter, prop, new InstanceData (instance)); - } - - void AppendProperty (TreeIter piter, PropertyDescriptor prop, InstanceData idata) - { - TreeIter iter; - if (piter.Equals (TreeIter.Zero)) - iter = store.AppendValues (prop.Label, prop, false, idata); - else - iter = store.AppendValues (piter, prop.Label, prop, false, idata); - if (prop.HasDependencies) - sensitives[prop] = prop; - if (prop.HasVisibility) - invisibles[prop] = prop; - propertyRows [prop] = store.GetStringFromIter (iter); - } - - protected virtual void OnObjectChanged () - { - } - - void OnSelectionChanged (object s, EventArgs a) - { - TreePath[] rows = tree.Selection.GetSelectedRows (); - if (!tree.dragging && rows != null && rows.Length > 0) { - tree.SetCursor (rows[0], editorColumn, true); - } - } - - internal void NotifyChanged () - { - OnObjectChanged (); - } - - void PropertyData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) - { - CellRendererProperty rc = (CellRendererProperty) cell; - bool group = (bool) model.GetValue (iter, 2); - if (group) { - rc.SetData (null, null, null); - } else { - PropertyDescriptor prop = (PropertyDescriptor) model.GetValue (iter, 1); - PropertyEditorCell propCell = PropertyEditorCell.GetPropertyCell (prop); - InstanceData idata = (InstanceData) model.GetValue (iter, 3); - propCell.Initialize (tree, prop, idata.Instance); - rc.SetData (idata.Instance, prop, propCell); - } - } - - void GroupData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) - { - CellRendererPropertyGroup rc = (CellRendererPropertyGroup) cell; - rc.IsGroup = (bool) model.GetValue (iter, 2); - rc.Text = (string) model.GetValue (iter, 0); - - PropertyDescriptor prop = (PropertyDescriptor) model.GetValue (iter, 1); - if (prop != null) { - InstanceData idata = (InstanceData) model.GetValue (iter, 3); - rc.SensitiveProperty = prop.EnabledFor (idata.Instance) && prop.VisibleFor (idata.Instance); - } else - rc.SensitiveProperty = true; - } - } - - class InternalTree: TreeView - { - internal ArrayList Groups = new ArrayList (); - Pango.Layout layout; - bool editing; - PropertyTree tree; - internal bool dragging; - int dragPos; - Gdk.Cursor resizeCursor = new Gdk.Cursor (CursorType.SbHDoubleArrow); - - public InternalTree (PropertyTree tree, TreeModel model): base (model) - { - this.tree = tree; - layout = new Pango.Layout (this.PangoContext); - layout.Wrap = Pango.WrapMode.Char; - Pango.FontDescription des = this.Style.FontDescription.Copy(); - des.Size = 10 * (int) Pango.Scale.PangoScale; - layout.FontDescription = des; - } - - public bool Editing { - get { return editing; } - set { editing = value; Update (); tree.NotifyChanged (); } - } - - protected override bool OnExposeEvent (Gdk.EventExpose e) - { - Groups.Clear (); - - bool res = base.OnExposeEvent (e); - - foreach (TreeGroup grp in Groups) { - layout.SetMarkup ("" + GLib.Markup.EscapeText (grp.Group) + ""); - e.Window.DrawLayout (this.Style.TextGC (grp.State), grp.X, grp.Y, layout); - } - - return res; - } - - protected override bool OnMotionNotifyEvent (EventMotion evnt) - { - if (dragging) { - int nw = (int)(evnt.X) + dragPos; - if (nw <= 40) nw = 40; - GLib.Idle.Add (delegate { - Columns[0].FixedWidth = nw; - return false; - }); - } else { - int w = Columns[0].Width; - if (Math.Abs (w - evnt.X) < 5) - this.GdkWindow.Cursor = resizeCursor; - else - this.GdkWindow.Cursor = null; - } - return base.OnMotionNotifyEvent (evnt); - } - - protected override bool OnButtonPressEvent (EventButton evnt) - { - int w = Columns[0].Width; - if (Math.Abs (w - evnt.X) < 5) { - TreePath[] rows = Selection.GetSelectedRows (); - if (rows != null && rows.Length > 0) - SetCursor (rows[0], Columns[0], false); - dragging = true; - dragPos = w - (int) evnt.X; - this.GdkWindow.Cursor = resizeCursor; - } - return base.OnButtonPressEvent (evnt); - } - - protected override bool OnButtonReleaseEvent (EventButton evnt) - { - if (dragging) { - this.GdkWindow.Cursor = null; - dragging = false; - } - return base.OnButtonReleaseEvent (evnt); - } - - public virtual void Update () - { - } - - protected override void OnDestroyed () - { - base.OnDestroyed (); - if (layout != null) { - layout.Dispose (); - layout = null; - } - if (resizeCursor != null) { - resizeCursor.Dispose (); - resizeCursor = null; - } - } - - } - - class TreeGroup - { - public string Group; - public int X; - public int Y; - public StateType State; - } - - class CellRendererProperty: CellRenderer - { - PropertyDescriptor property; - object instance; - int rowHeight; - PropertyEditorCell editorCell; - bool sensitive; - bool visible; - TreeView tree; - - public CellRendererProperty (TreeView tree) - { - this.tree = tree; - Xalign = 0; - Xpad = 3; - - Mode |= Gtk.CellRendererMode.Editable; - Entry dummyEntry = new Gtk.Entry (); - dummyEntry.HasFrame = false; - rowHeight = dummyEntry.SizeRequest ().Height; - } - - public void SetData (object instance, PropertyDescriptor property, PropertyEditorCell editor) - { - this.instance = instance; - this.property = property; - if (property == null) - this.CellBackgroundGdk = tree.Style.MidColors [(int)Gtk.StateType.Normal]; - else - this.CellBackground = null; - - visible = property != null ? property.VisibleFor (instance): true; - sensitive = property != null ? property.EnabledFor (instance) && property.VisibleFor (instance): true; - editorCell = editor; - } - - public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - if (editorCell != null) - editorCell.GetSize ((int)(cell_area.Width - this.Xpad * 2), out width, out height); - else { - width = height = 0; - } - - width += (int) this.Xpad * 2; - height += (int) this.Ypad * 2; - - x_offset = 0; - y_offset = 0; - - if (height < rowHeight) - height = rowHeight; - } - - protected override void Render (Drawable window, Widget widget, Rectangle background_area, Rectangle cell_area, Rectangle expose_area, CellRendererState flags) - { - if (instance == null || !visible) - return; - int width = 0, height = 0; - int iwidth = cell_area.Width - (int) this.Xpad * 2; - - if (editorCell != null) - editorCell.GetSize ((int)(cell_area.Width - this.Xpad * 2), out width, out height); - - Rectangle bounds = new Rectangle (); - bounds.Width = width > iwidth ? iwidth : width; - bounds.Height = height; - bounds.X = (int) (cell_area.X + this.Xpad); - bounds.Y = cell_area.Y + (cell_area.Height - height) / 2; - - StateType state = GetState (flags); - - if (editorCell != null) - editorCell.Render (window, bounds, state); - } - - public override CellEditable StartEditing (Gdk.Event ev, Widget widget, string path, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, CellRendererState flags) - { - if (property == null || editorCell == null || !sensitive) - return null; - - StateType state = GetState (flags); - EditSession session = editorCell.StartEditing (cell_area, state); - if (session == null) - return null; - Gtk.Widget propEditor = (Gtk.Widget) session.Editor; - propEditor.Show (); - HackEntry e = new HackEntry (propEditor, session); - e.Show (); - return e; - } - - StateType GetState (CellRendererState flags) - { - if (!sensitive) - return StateType.Insensitive; - else if ((flags & CellRendererState.Selected) != 0) - return StateType.Selected; - else - return StateType.Normal; - } - } - - class CellRendererPropertyGroup: CellRendererText - { - TreeView tree; - Pango.Layout layout; - bool isGroup; - bool sensitive; - - public bool IsGroup { - get { return isGroup; } - set { - isGroup = value; - if (value) - this.CellBackgroundGdk = tree.Style.MidColors [(int)Gtk.StateType.Normal]; - else - this.CellBackground = null; - } - } - - public bool SensitiveProperty { - get { return sensitive; } - set { sensitive = value; } - } - - public CellRendererPropertyGroup (TreeView tree) - { - this.tree = tree; - layout = new Pango.Layout (tree.PangoContext); - layout.Wrap = Pango.WrapMode.Char; - - Pango.FontDescription des = tree.Style.FontDescription.Copy(); - des.Size = 10 * (int) Pango.Scale.PangoScale; - layout.FontDescription = des; - } - - protected void GetCellSize (Widget widget, int availableWidth, out int width, out int height) - { - layout.SetMarkup (Text); - layout.Width = -1; - layout.GetPixelSize (out width, out height); - } - - public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - GetCellSize (widget, (int)(cell_area.Width - this.Xpad * 2), out width, out height); - width += (int) this.Xpad * 2; - height += (int) this.Ypad * 2; - - x_offset = y_offset = 0; - - if (IsGroup) - width = 0; - } - - protected override void Render (Drawable window, Widget widget, Rectangle background_area, Rectangle cell_area, Rectangle expose_area, CellRendererState flags) - { - int width, height; - GetCellSize (widget, (int)(cell_area.Width - this.Xpad * 2), out width, out height); - - int x = (int) (cell_area.X + this.Xpad); - int y = cell_area.Y + (cell_area.Height - height) / 2; - - StateType state; - if (!sensitive) - state = StateType.Insensitive; - else if ((flags & CellRendererState.Selected) != 0) - state = StateType.Selected; - else - state = StateType.Normal; - - if (IsGroup) { - TreeGroup grp = new TreeGroup (); - grp.X = x; - grp.Y = y; - grp.Group = Text; - grp.State = state; - InternalTree tree = (InternalTree) widget; - tree.Groups.Add (grp); - } else { - window.DrawLayout (widget.Style.TextGC (state), x, y, layout); - int bx = background_area.X + background_area.Width - 1; - using (Gdk.GC gc = new Gdk.GC (window)) { - gc.RgbFgColor = tree.Style.MidColors [(int)Gtk.StateType.Normal]; - window.DrawLine (gc, bx, background_area.Y, bx, background_area.Y + background_area.Height); - } - } - } - - protected override void OnDestroyed () - { - if (layout != null) { - layout.Dispose (); - layout = null; - } - base.OnDestroyed (); - } - } - - class HackEntry: Entry - { - EventBox box; - EditSession session; - - public HackEntry (Gtk.Widget child, EditSession session) - { - this.session = session; - box = new EventBox (); - box.ButtonPressEvent += new ButtonPressEventHandler (OnClickBox); - box.ModifyBg (StateType.Normal, Style.White); - box.Add (child); - } - - [GLib.ConnectBefore] - void OnClickBox (object s, ButtonPressEventArgs args) - { - // Avoid forwarding the button press event to the - // tree, since it would hide the cell editor. - args.RetVal = true; - } - - protected override void OnParentSet (Gtk.Widget previous_parent) - { - base.OnParentSet (previous_parent); - - if (Parent != null) { - if (this.ParentWindow != null) - box.ParentWindow = this.ParentWindow; - box.Parent = Parent; - box.Show (); - ((InternalTree)Parent).Editing = true; - } - else { - session.Dispose (); - ((InternalTree)previous_parent).Editing = false; - if (box.Parent != null) - box.Unparent (); - } - } - - protected override void OnShown () - { - // Do nothing. - } - - protected override void OnSizeAllocated (Gdk.Rectangle allocation) - { - base.OnSizeAllocated (allocation); - box.SizeRequest (); - box.Allocation = allocation; - } - } - - class InstanceData - { - public InstanceData (object instance) - { - Instance = instance; - } - - public object Instance; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Shadow.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Shadow.cs deleted file mode 100644 index 45d2a623572..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Shadow.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* Shadow code from anders */ - -using System; -using Gdk; - -class ConvFilter -{ - public int size; - public double[] data; -} - -class Shadow -{ - public const int BLUR_RADIUS = 5; - public const int SHADOW_OFFSET = (BLUR_RADIUS * 4 / 5); - public const double SHADOW_OPACITY = 0.5; - - static ConvFilter filter; - - static double Gaussian (double x, double y, double r) - { - return ((1 / (2 * System.Math.PI * r)) * - System.Math.Exp ((- (x * x + y * y)) / (2 * r * r))); - } - - static ConvFilter CreateBlurFilter (int radius) - { - ConvFilter filter; - int x, y; - double sum; - - filter = new ConvFilter (); - filter.size = radius * 2 + 1; - filter.data = new double [filter.size * filter.size]; - - sum = 0.0; - - for (y = 0 ; y < filter.size; y++) { - for (x = 0 ; x < filter.size; x++) { - sum += filter.data [y * filter.size + x] = Gaussian (x - (filter.size >> 1), - y - (filter.size >> 1), - radius); - } - } - - for (y = 0; y < filter.size; y++) { - for (x = 0; x < filter.size; x++) - filter.data [y * filter.size + x] /= sum; - } - return filter; - } - - unsafe static Pixbuf CreateEffect (int src_width, int src_height, ConvFilter filter, int radius, int offset, double opacity) - { - Pixbuf dest; - int x, y, i, j; - int src_x, src_y; - int suma; - int dest_width, dest_height; - int dest_rowstride; - byte* dest_pixels; - - dest_width = src_width + 2 * radius + offset; - dest_height = src_height + 2 * radius + offset; - - dest = new Pixbuf (Colorspace.Rgb, true, 8, dest_width, dest_height); - dest.Fill (0); - - dest_pixels = (byte*) dest.Pixels; - - dest_rowstride = dest.Rowstride; - - for (y = 0; y < dest_height; y++) - { - for (x = 0; x < dest_width; x++) - { - suma = 0; - - src_x = x - radius; - src_y = y - radius; - - /* We don't need to compute effect here, since this pixel will be - * discarded when compositing */ - if (src_x >= 0 && src_x < src_width && src_y >= 0 && src_y < src_height) - continue; - - for (i = 0; i < filter.size; i++) - { - for (j = 0; j < filter.size; j++) - { - src_y = -(radius + offset) + y - (filter.size >> 1) + i; - src_x = -(radius + offset) + x - (filter.size >> 1) + j; - - if (src_y < 0 || src_y >= src_height || - src_x < 0 || src_x >= src_width) - continue; - - suma += (int) (((byte)0xFF) * filter.data [i * filter.size + j]); - } - } - - byte r = (byte) (suma * opacity); - dest_pixels [y * dest_rowstride + x * 4 + 3] = r; - } - } - return dest; - } - - public static Pixbuf AddShadow (int width, int height) - { - if (filter == null) - filter = CreateBlurFilter (BLUR_RADIUS); - - return CreateEffect (width, height, filter, BLUR_RADIUS, SHADOW_OFFSET, SHADOW_OPACITY); - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/SignalsEditor.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/SignalsEditor.cs deleted file mode 100644 index 023a52c1cf3..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/SignalsEditor.cs +++ /dev/null @@ -1,90 +0,0 @@ - -using System; - -namespace Stetic -{ - public class SignalsEditor: PluggableWidget - { - SignalsEditorFrontend frontend; - SignalsEditorEditSession session; - - public event EventHandler SignalActivated; - - internal SignalsEditor (Application app): base (app) - { - frontend = new SignalsEditorFrontend (this); - } - - public Signal SelectedSignal { - get { - if (session != null) - return session.SelectedSignal; - else - return null; - } - } - - protected override void OnCreatePlug (uint socketId) - { - session = app.Backend.CreateSignalsWidgetPlug (frontend, socketId); - } - - protected override void OnDestroyPlug (uint socketId) - { - app.Backend.DestroySignalsWidgetPlug (); - } - - protected override Gtk.Widget OnCreateWidget () - { - session = app.Backend.GetSignalsWidget (frontend); - return session.Editor; - } - - bool disposed = false; - - public override void Dispose () - { - if (disposed) - return; - disposed = true; - - if (session != null) - session.Dispose (); - frontend.disposed = true; - System.Runtime.Remoting.RemotingServices.Disconnect (frontend); - base.Dispose (); - } - - internal void NotifySignalActivated () - { - if (SignalActivated != null) - SignalActivated (this, EventArgs.Empty); - } - } - - internal class SignalsEditorFrontend: MarshalByRefObject - { - SignalsEditor editor; - internal bool disposed; - - public SignalsEditorFrontend (SignalsEditor editor) - { - this.editor = editor; - } - - public void NotifySignalActivated () - { - Gtk.Application.Invoke ( - (o, args) => { - if (!disposed) editor.NotifySignalActivated (); - } - ); - } - - public override object InitializeLifetimeService () - { - // Will be disconnected when calling Dispose - return null; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/SignalsEditorBackend.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/SignalsEditorBackend.cs deleted file mode 100644 index 5b22a710d7d..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/SignalsEditorBackend.cs +++ /dev/null @@ -1,479 +0,0 @@ -using System; -using System.Text; -using System.Collections; -using Stetic.Wrapper; -using Mono.Unix; - -namespace Stetic -{ - internal class SignalsEditorBackend: Gtk.ScrolledWindow, IObjectViewer - { - Gtk.TreeView tree; - Gtk.TreeStore store; - SignalsEditorFrontend frontend; - - ProjectBackend project; - ObjectWrapper selection; - bool internalChange; - - const int ColSignal = 0; - const int ColHandler = 1; - const int ColAfter = 2; - const int ColHasHandler = 3; - const int ColIsSignal = 4; - const int ColSignalTextWeight = 5; - - public SignalsEditorBackend (SignalsEditorFrontend frontend) - { - this.frontend = frontend; - - tree = new Gtk.TreeView (); - store = new Gtk.TreeStore (typeof(string), typeof(string), typeof(bool), typeof(bool), typeof(bool), typeof(int)); - tree.Model = store; - tree.RowActivated += new Gtk.RowActivatedHandler (OnRowActivated); - - Gtk.CellRendererText crtSignal = new Gtk.CellRendererText (); - - Gtk.CellRendererText crtHandler = new Gtk.CellRendererText (); - crtHandler.Editable = true; - crtHandler.Edited += new Gtk.EditedHandler (OnHandlerEdited); - - Gtk.CellRendererToggle crtogAfter = new Gtk.CellRendererToggle (); - crtogAfter.Activatable = true; - crtogAfter.Toggled += new Gtk.ToggledHandler (OnAfterToggled); - - tree.AppendColumn (Catalog.GetString ("Signal"), crtSignal, "text", ColSignal, "weight", ColSignalTextWeight); - tree.AppendColumn (Catalog.GetString ("Handler"), crtHandler, "markup", ColHandler, "visible", ColIsSignal); - tree.AppendColumn (Catalog.GetString ("After"), crtogAfter, "active", ColAfter, "visible", ColHasHandler); - tree.Columns[0].Resizable = true; - tree.Columns[1].Resizable = true; - tree.Columns[2].Resizable = true; - Add (tree); - ShowAll (); - } - - public SignalsEditorBackend (SignalsEditorFrontend frontend, ProjectBackend project): this (frontend) - { - ProjectBackend = project; - } - - public ProjectBackend ProjectBackend { - get { return project; } - set { - if (project != null) { - project.SelectionChanged -= OnWidgetSelected; - project.SignalAdded -= new SignalEventHandler (OnSignalAddedOrRemoved); - project.SignalRemoved -= new SignalEventHandler (OnSignalAddedOrRemoved); - project.SignalChanged -= new SignalChangedEventHandler (OnSignalChanged); - project.ProjectReloaded -= new EventHandler (OnProjectReloaded); - } - - project = value; - if (project != null) { - TargetObject = project.Selection; - project.SelectionChanged += OnWidgetSelected; - project.SignalAdded += new SignalEventHandler (OnSignalAddedOrRemoved); - project.SignalRemoved += new SignalEventHandler (OnSignalAddedOrRemoved); - project.SignalChanged += new SignalChangedEventHandler (OnSignalChanged); - project.ProjectReloaded += new EventHandler (OnProjectReloaded); - } else if (selection != null) { - selection = null; - RefreshTree (); - } - } - } - - void OnProjectReloaded (object s, EventArgs a) - { - OnWidgetSelected (null, null); - } - - public Signal SelectedSignal { - get { - Gtk.TreeModel foo; - Gtk.TreeIter iter; - if (!tree.Selection.GetSelected (out foo, out iter)) - return null; - return GetSignal (iter); - } - } - - public object TargetObject { - get { - return selection != null ? selection.Wrapped : null; - } - set { - if (project != null) { - ObjectWrapper wrapper = ObjectWrapper.Lookup (value); - if (wrapper == selection) - return; - selection = wrapper; - RefreshTree (); - } - } - } - - void OnWidgetSelected (object s, Wrapper.WidgetEventArgs args) - { - ObjectWrapper wrapper = args != null ? args.WidgetWrapper : null; - if (wrapper == selection) - return; - selection = wrapper; - RefreshTree (); - } - - void OnSignalAddedOrRemoved (object sender, SignalEventArgs args) - { - if (!internalChange && args.Wrapper == selection) - RefreshTree (); - } - - void OnSignalChanged (object sender, SignalChangedEventArgs args) - { - if (!internalChange && args.Wrapper == selection) - RefreshTree (); - } - - void RefreshTree () - { - ArrayList status = SaveStatus (); - store.Clear (); - - if (selection == null) - return; - - ClassDescriptor klass = selection.ClassDescriptor; - - foreach (ItemGroup group in klass.SignalGroups) { - Gtk.TreeIter iter = store.AppendValues (group.Label, null, false, false, false, (int) Pango.Weight.Normal); - if (FillGroup (iter, group)) - store.SetValue (iter, ColSignalTextWeight, (int) Pango.Weight.Bold); - } - RestoreStatus (status); - } - - bool FillGroup (Gtk.TreeIter groupIter, ItemGroup group) - { - bool hasSignals = false; - foreach (SignalDescriptor sd in group) { - if (!sd.SupportsGtkVersion (project.TargetGtkVersion)) - continue; - - bool foundSignal = false; - Gtk.TreeIter parent = groupIter; - - foreach (Signal signal in selection.Signals) { - if (signal.SignalDescriptor != sd) continue; - - Gtk.TreeIter iter = store.AppendValues (parent, null, signal.Handler, false, true, true, (int) Pango.Weight.Normal); - if (!foundSignal) { - parent = iter; - store.SetValue (iter, ColSignal, sd.Name); - store.SetValue (iter, ColSignalTextWeight, (int) Pango.Weight.Bold); - hasSignals = foundSignal = true; - } - } - - InsertEmptySignalRow (parent, foundSignal ? null : sd.Name); - } - return hasSignals; - } - - void SetSignalData (Gtk.TreeIter iter, Signal signal) - { - store.SetValue (iter, ColHandler, signal.Handler); - store.SetValue (iter, ColAfter, false); - store.SetValue (iter, ColHasHandler, true); - store.SetValue (iter, ColIsSignal, true); - } - - void InsertEmptySignalRow (Gtk.TreeIter parent, string name) - { - store.AppendValues (parent, name, EmptyHandlerMarkup, false, false, true, (int) Pango.Weight.Normal); - } - - void OnRowActivated (object sender, Gtk.RowActivatedArgs args) - { - Gtk.TreeIter iter; - if (!store.GetIter (out iter, args.Path)) - return; - - SignalDescriptor sd = GetSignalDescriptor (iter); - if (sd != null) { - if (GetSignal (iter) == null) - AddHandler (iter, GetHandlerName (sd.Name)); - frontend.NotifySignalActivated (); - } - } - - string GetHandlerName (string signalName) - { - Wrapper.Widget selWidget = selection as Wrapper.Widget; - if (selWidget != null) { - if (selWidget.IsTopLevel) - return "On" + signalName; - else - return "On" + GetIdentifier (selWidget.Wrapped.Name) + signalName; - } - - Wrapper.Action action = selection as Wrapper.Action; - if (action != null) { - return "On" + GetIdentifier (action.Name) + signalName; - } - - return "On" + signalName; - } - - string GetIdentifier (string name) - { - StringBuilder sb = new StringBuilder (); - - bool wstart = true; - foreach (char c in name) { - if (c == '_' || c == '-' || c == ' ' || !char.IsLetterOrDigit (c)) { - wstart = true; - continue; - } - if (wstart) { - sb.Append (char.ToUpper (c)); - wstart = false; - } else - sb.Append (c); - } - return sb.ToString (); - } - - void OnHandlerEdited (object sender, Gtk.EditedArgs args) - { - if (args.NewText == EmptyHandlerText) - return; - - Gtk.TreeIter iter; - if (!store.GetIterFromString (out iter, args.Path)) - return; - - AddHandler (iter, args.NewText); - } - - void AddHandler (Gtk.TreeIter iter, string name) - { - internalChange = true; - - Gtk.TreeIter piter = iter; - while (store.IterDepth (piter) != 0) - store.IterParent (out piter, piter); - - Signal signal = GetSignal (iter); - if (signal == null) { - if (name != "") { - SignalDescriptor sd = GetSignalDescriptor (iter); - signal = new Signal (sd); - signal.Handler = name; - selection.Signals.Add (signal); - SetSignalData (iter, signal); - store.SetValue (iter, ColSignalTextWeight, (int) Pango.Weight.Bold); - if (store.IterDepth (iter) != 1) - store.IterParent (out iter, iter); - InsertEmptySignalRow (iter, null); - } - } else { - if (name != "") { - signal.Handler = name; - store.SetValue (iter, ColHandler, signal.Handler); - } else { - selection.Signals.Remove (signal); - if (store.IterDepth (iter) == 1) { - if (store.IterNChildren (iter) == 1) { - Gtk.TreeIter parent; - store.IterParent (out parent, iter); - store.Remove (ref iter); - InsertEmptySignalRow (parent, signal.SignalDescriptor.Name); - } else { - Gtk.TreeIter citer; - store.IterChildren (out citer, iter); - Signal csignal = GetSignal (citer); - store.Remove (ref citer); - SetSignalData (iter, csignal); - if (store.IterNChildren (iter) == 1) - tree.CollapseRow (store.GetPath (iter)); - } - } else - store.Remove (ref iter); - } - } - UpdateGroupStatus (piter); - internalChange = false; - } - - void OnAfterToggled (object o, Gtk.ToggledArgs args) - { - Gtk.TreeIter it; - if (store.GetIterFromString (out it, args.Path)) { - Signal signal = GetSignal (it); - if (signal != null) { - internalChange = true; - signal.After = !signal.After; - internalChange = false; - store.SetValue (it, ColAfter, signal.After); - } - } - } - - void UpdateGroupStatus (Gtk.TreeIter iter) - { - Gtk.TreeIter signalIter; - if (store.IterChildren (out signalIter, iter)) { - do { - if (store.IterNChildren (signalIter) > 0) { - store.SetValue (iter, ColSignalTextWeight, (int) Pango.Weight.Bold); - return; - } - } while (store.IterNext (ref signalIter)); - } - store.SetValue (iter, ColSignalTextWeight, (int) Pango.Weight.Normal); - } - - Signal GetSignal (Gtk.TreeIter iter) - { - if (! (bool) store.GetValue (iter, ColHasHandler)) - return null; - string handler = (string) store.GetValue (iter, ColHandler); - foreach (Signal sig in selection.Signals) - if (sig.Handler == handler) - return sig; - return null; - } - - SignalDescriptor GetSignalDescriptor (Gtk.TreeIter iter) - { - Gtk.TreeIter group_iter; - if (! (bool) store.GetValue (iter, ColIsSignal) || !store.IterParent (out group_iter, iter)) - return null; - string name = (string) store.GetValue (iter, ColSignal); - string group_name = (string) store.GetValue (group_iter, ColSignal); - - foreach (ItemGroup igroup in selection.ClassDescriptor.SignalGroups) { - if (igroup.Label != group_name) - continue; - SignalDescriptor desc = (SignalDescriptor) igroup [name]; - if (desc != null) - return desc; - } - - return null; - } - - ArrayList SaveStatus () - { - ArrayList list = new ArrayList (); - - Gtk.TreeIter it; - if (!store.GetIterFirst (out it)) - return list; - - do { - SaveStatus (list, "", it); - } while (store.IterNext (ref it)); - - return list; - } - - void SaveStatus (ArrayList list, string path, Gtk.TreeIter iter) - { - string basePath = path + "/" + store.GetValue (iter, ColSignal); - - if (!tree.GetRowExpanded (store.GetPath (iter))) - return; - - list.Add (basePath); - - if (store.IterChildren (out iter, iter)) { - do { - SaveStatus (list, basePath, iter); - } while (store.IterNext (ref iter)); - } - } - - void RestoreStatus (ArrayList list) - { - foreach (string namePath in list) { - string[] names = namePath.Split ('/'); - - Gtk.TreeIter iter = Gtk.TreeIter.Zero; - - bool found = true; - foreach (string name in names) { - if (name == "") continue; - if (!FindChildByName (name, ref iter)) { - found = false; - break; - } - } - - if (found) - tree.ExpandRow (store.GetPath (iter), false); - } - } - - bool FindChildByName (string name, ref Gtk.TreeIter iter) - { - if (iter.Equals (Gtk.TreeIter.Zero)) { - if (!store.GetIterFirst (out iter)) - return false; - } else if (!store.IterChildren (out iter, iter)) - return false; - - do { - if (name == (string) store.GetValue (iter, ColSignal)) - return true; - } - while (store.IterNext (ref iter)); - - return false; - } - - string EmptyHandlerMarkup { - get { return "" + EmptyHandlerText + ""; } - } - - string EmptyHandlerText { - get { return Catalog.GetString ("Click here to add a new handler"); } - } - } - - internal class SignalsEditorEditSession: MarshalByRefObject - { - SignalsEditorBackend backend; - - public SignalsEditorEditSession (SignalsEditorFrontend frontend) - { - backend = new SignalsEditorBackend (frontend); - } - - public SignalsEditorBackend Editor { - get { return backend; } - } - - public ProjectBackend ProjectBackend { - get { return backend.ProjectBackend; } - set { backend.ProjectBackend = value; } - } - - public Signal SelectedSignal { - get { - return backend.SelectedSignal; - } - } - - public void Dispose () - { - System.Runtime.Remoting.RemotingServices.Disconnect (this); - } - - public override object InitializeLifetimeService () - { - // Will be disconnected when calling Dispose - return null; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/UndoQueue.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/UndoQueue.cs deleted file mode 100644 index 0ae6a6fc02f..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/UndoQueue.cs +++ /dev/null @@ -1,282 +0,0 @@ - -using System; -using System.Xml; -using System.Collections; -using System.Collections.Generic; - -namespace Stetic -{ - public class UndoQueue: MarshalByRefObject - { - List changeList = new List (); - int undoListCount = 0; - static UndoQueue empty = new UndoQueue (); - - public void AddChange (UndoRedoChange change) - { - if (undoListCount < changeList.Count) { - // Destroy all undone changes - changeList.RemoveRange (undoListCount, changeList.Count - undoListCount); - } - changeList.Add (change); - undoListCount = changeList.Count; - } - - public IEnumerable Changes { - get { return changeList; } - } - - public static UndoQueue Empty { - get { return empty; } - } - - public bool CanUndo { - get { return undoListCount > 0; } - } - - public bool CanRedo { - get { return undoListCount < changeList.Count; } - } - - public void Undo () - { - if (undoListCount == 0) - return; - - UndoRedoChange change = (UndoRedoChange) changeList [--undoListCount]; - if (change.CheckValid ()) { - UndoRedoChange res = change.ApplyChange (); - if (res != null) - changeList [undoListCount] = res; - else - // Undo failed - changeList.RemoveAt (undoListCount); - } else { - changeList.RemoveAt (undoListCount); - Undo (); - } - } - - public void Redo () - { - if (undoListCount == changeList.Count) - return; - - UndoRedoChange change = (UndoRedoChange) changeList [undoListCount++]; - if (change.CheckValid ()) { - UndoRedoChange res = change.ApplyChange (); - if (res != null) - changeList [undoListCount - 1] = res; - else { - // Redo failed - undoListCount--; - changeList.RemoveAt (undoListCount); - } - } - else { - changeList.RemoveAt (--undoListCount); - Redo (); - } - } - - public void Purge () - { - for (int n=0; n 0) - button.TooltipText = cmd.Label; - } - else { - button.Label = cmd.Label; - button.IsImportant = true; - } - button.Clicked += delegate (object o, EventArgs args) { - if (!updating) - cmd.Run (widget.Wrapped); - }; - button.ShowAll (); - Insert (button, -1); - - if (cmd.HasDependencies) { - editors[cmd.Name] = button; - sensitives[cmd] = cmd; - } - if (cmd.HasVisibility) { - editors[cmd.Name] = button; - invisibles[cmd] = cmd; - } - wrappers [cmd] = widget; - } - - void Notified (object s, string propertyName) - { - UpdateSensitivity (); - } - - void UpdateSensitivity () - { - foreach (ItemDescriptor item in sensitives.Keys) { - Widget w = editors[item.Name] as Widget; - if (w != null) { - ObjectWrapper wrapper = wrappers [item] as ObjectWrapper; - object ob = sensitives.Contains (item) ? wrapper.Wrapped : null; - w.Sensitive = item.EnabledFor (ob); - } - } - foreach (ItemDescriptor item in invisibles.Keys) { - Widget w = editors[item.Name] as Widget; - if (w != null) { - ObjectWrapper wrapper = wrappers [item] as ObjectWrapper; - object ob = invisibles.Contains (item) ? wrapper.Wrapped : null; - w.Visible = item.VisibleFor (ob); - } - } - foreach (CommandDescriptor cmd in toggles) { - ToggleToolButton w = editors[cmd.Name] as ToggleToolButton; - if (w != null) { - ObjectWrapper wrapper = wrappers [cmd] as ObjectWrapper; - updating = true; - w.Active = cmd.IsToogled (wrapper.Wrapped); - updating = false; - } - } - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetComponent.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetComponent.cs deleted file mode 100644 index 84f63413ca3..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetComponent.cs +++ /dev/null @@ -1,122 +0,0 @@ - -using System; -using System.Collections; -using System.Collections.Specialized; - -namespace Stetic -{ - public class WidgetComponent: Component - { - static WidgetComponent placeholder; - - public WidgetComponent (Application app, object backend, string name, ComponentType type): base (app, backend, name, type) - { - } - - public override string Name { - get { - if (name == null) - UpdateComponentInfo (); - return name; - } - set { - name = value; - if (app != null) - app.Backend.RenameWidget ((Wrapper.Widget)backend, value); - } - } - - public override bool GeneratePublic { - get { return ((Wrapper.Widget)backend).GeneratePublic; } - set { ((Wrapper.Widget)backend).GeneratePublic = value; } - } - - internal void UpdateName (string name) - { - this.name = name; - } - - public override Component[] GetChildren () - { - if (app == null) - return new Component [0]; - ArrayList wws = app.Backend.GetWidgetChildren ((Wrapper.Widget)backend); - if (wws == null) - return new Component [0]; - ArrayList children = new ArrayList (wws.Count); - for (int n=0; n nw) nw = a.Requisition.Width; - if (a.Requisition.Height > nh) nh = a.Requisition.Height; - - if (nw != alloc.Width || nh != alloc.Height) { - int ow = child.WidthRequest; - int oh = child.HeightRequest; - child.SetSizeRequest (nw, nh); - if (ow > nw) - child.WidthRequest = ow; - if (oh > nh) - child.HeightRequest = oh; - QueueDraw (); - } - } - - protected override void OnSizeRequested (ref Requisition req) - { - // The Toplevel check is done to ensure that this widget is anchored, - // otherwise the Realize call will fail. - if (!child.IsRealized && Toplevel is Gtk.Window) - child.Realize (); - - req = child.SizeRequest (); - // Make some room for the border - req.Width += padding * 2 + selectionBorder * 2; - req.Height += padding * 2 + selectionBorder * 2; - selectionBox.SizeRequest (); - if (selectionBox.Allocation.Width > req.Width) - req.Width = selectionBox.Allocation.Width; - if (selectionBox.Allocation.Height > req.Height) - req.Height = selectionBox.Allocation.Height; - - foreach (TopLevelChild tchild in topLevels) { - Gtk.Requisition treq = tchild.Child.SizeRequest (); - if (tchild.X + treq.Width > req.Width) - req.Width = tchild.X + treq.Width; - if (tchild.Y + treq.Height > req.Height) - req.Height = tchild.Y + treq.Height; - } - } - - protected override void OnSizeAllocated (Gdk.Rectangle rect) - { - base.OnSizeAllocated (rect); - - if (selectionWidget != null) - PlaceSelectionBoxInternal (selectionWidget); - - foreach (TopLevelChild child in topLevels) { - Gtk.Requisition req = child.Child.SizeRequest (); - child.Child.SizeAllocate (new Gdk.Rectangle (rect.X + child.X, rect.Y + child.Y, req.Width, req.Height)); - } - } - - protected override void ForAll (bool include_internals, Gtk.Callback callback) - { - base.ForAll (include_internals, callback); - foreach (TopLevelChild child in topLevels) - callback (child.Child); - if (include_internals) - selectionBox.ForAll (include_internals, callback); - } - - protected override bool OnMotionNotifyEvent (Gdk.EventMotion ev) - { - if (resizingX || resizingY) { - if (resizingX) { - int nw = (int)(ev.X - difX - padding - selectionBorder); - if (nw < currentSizeRequest.Width) nw = currentSizeRequest.Width; - child.WidthRequest = nw; - } - - if (resizingY) { - int nh = (int)(ev.Y - difY - padding - selectionBorder); - if (nh < currentSizeRequest.Height) nh = currentSizeRequest.Height; - child.HeightRequest = nh; - } - QueueDraw (); - } else if (AllowResize) { - if (GetAreaResizeXY ().Contains ((int) ev.X, (int) ev.Y)) - GdkWindow.Cursor = cursorXY; - else if (GetAreaResizeX ().Contains ((int) ev.X, (int) ev.Y)) - GdkWindow.Cursor = cursorX; - else if (GetAreaResizeY ().Contains ((int) ev.X, (int) ev.Y)) - GdkWindow.Cursor = cursorY; - else - GdkWindow.Cursor = null; - } - - return base.OnMotionNotifyEvent (ev); - } - - protected override bool OnButtonPressEvent (Gdk.EventButton ev) - { - Gdk.Rectangle rectArea = child.Allocation; - rectArea.Inflate (selectionBorder, selectionBorder); - - if (rectArea.Contains ((int) ev.X, (int) ev.Y)) { - Stetic.Wrapper.Widget gw = Stetic.Wrapper.Widget.Lookup (container); - if (gw != null) - gw.Select (); - else - ResetSelection (null); - - if (AllowResize) { - Rectangle rect = GetAreaResizeXY (); - if (rect.Contains ((int) ev.X, (int) ev.Y)) { - resizingX = resizingY = true; - difX = (int) (ev.X - rect.X); - difY = (int) (ev.Y - rect.Y); - GdkWindow.Cursor = cursorXY; - } - - rect = GetAreaResizeY (); - if (rect.Contains ((int) ev.X, (int) ev.Y)) { - resizingY = true; - difY = (int) (ev.Y - rect.Y); - GdkWindow.Cursor = cursorY; - } - - rect = GetAreaResizeX (); - if (rect.Contains ((int) ev.X, (int) ev.Y)) { - resizingX = true; - difX = (int) (ev.X - rect.X); - GdkWindow.Cursor = cursorX; - } - } - } else { - Stetic.Wrapper.Widget gw = Stetic.Wrapper.Widget.Lookup (container); - if (gw != null) - gw.Project.Selection = null; - } - - return base.OnButtonPressEvent (ev); - } - - Rectangle GetAreaResizeY () - { - Gdk.Rectangle rect = child.Allocation; - return new Gdk.Rectangle (rect.X - selectionBorder, rect.Y + rect.Height, rect.Width + selectionBorder, selectionBorder); - } - - Rectangle GetAreaResizeX () - { - Gdk.Rectangle rect = child.Allocation; - return new Gdk.Rectangle (rect.X + rect.Width, rect.Y - selectionBorder, selectionBorder, rect.Height + selectionBorder); - } - - Rectangle GetAreaResizeXY () - { - Gdk.Rectangle rect = child.Allocation; - return new Gdk.Rectangle (rect.X + rect.Width, rect.Y + rect.Height, selectionBorder, selectionBorder); - } - - protected override bool OnButtonReleaseEvent (Gdk.EventButton ev) - { - resizingX = resizingY = false; - GdkWindow.Cursor = null; - return base.OnButtonReleaseEvent (ev); - } - - protected override bool OnExposeEvent (Gdk.EventExpose ev) - { - bool r = base.OnExposeEvent (ev); - //FIXME Disabled checkerboard background because it's very inefficient and makes the control *very* slow to resize - // It should take the EventExpose area into account, invalidate more selectively during resizes (GTK viewport - // code would probably be a good start), and take advantage of the flat block color the parent is rendering. - /* - int size = 8; - bool squareColor = true; - bool startsquareColor = true; - int x1 = 0; - int x2 = Allocation.Width; - int y1 = 0; - int y2 = Allocation.Height; - for (int y = y1; y < y2; y += size) { - squareColor = startsquareColor; - startsquareColor = !startsquareColor; - for (int x = x1; x < x2; x += size) { - GdkWindow.DrawRectangle (squareColor ? Style.DarkGC (StateType.Normal) : Style.DarkGC (StateType.Active), true, x, y, size, size); - squareColor = !squareColor; - } - } - - foreach (Widget cw in Children) - PropagateExpose (cw, ev);*/ - - Gdk.Rectangle rect = child.Allocation; - GdkWindow.DrawRectangle (this.Style.BackgroundGC (StateType.Normal), true, rect.X, rect.Y, rect.Width, rect.Height); - - Pixbuf sh = Shadow.AddShadow (rect.Width, rect.Height); - GdkWindow.DrawPixbuf (this.Style.BackgroundGC (StateType.Normal), sh, 0, 0, rect.X - 5, rect.Y - 5, sh.Width, sh.Height, RgbDither.None, 0, 0); - return r; - } - - protected override bool OnKeyPressEvent (Gdk.EventKey ev) - { - switch (ev.Key) { - case Gdk.Key.Delete: - case Gdk.Key.KP_Delete: - IObjectSelection sel = GetSelection (); - if (sel != null && sel.DataObject != null) { - Wrapper.Widget wrapper = Wrapper.Widget.Lookup (sel.DataObject) as Wrapper.Widget; - if (wrapper != null && !wrapper.IsTopLevel) - wrapper.Delete (); - } - return true; - default: - return base.OnKeyPressEvent (ev); - } - } - - class TopLevelChild - { - public int X; - public int Y; - public Gtk.Widget Child; - } - } - - enum BoxPos - { - Start, - Center, - End, - } - - enum BoxFill - { - Box, - VLine, - HLine - } - - class SelectionHandleBox - { - const int selectionHandleSize = 4; - const int topSelectionHandleSize = 8; - public const int selectionLineWidth = 2; - - ArrayList selection = new ArrayList (); - Gdk.Rectangle allocation; - SelectionHandlePart dragHandlePart; - public ObjectSelection ObjectSelection; - - public SelectionHandleBox (Gtk.Widget parent) - { - // Lines - selection.Add (new SelectionHandlePart (BoxFill.HLine, BoxPos.Start, BoxPos.Start, 0, -selectionLineWidth, BoxPos.End, BoxPos.Start, 0, 0)); - selection.Add (new SelectionHandlePart (BoxFill.HLine, BoxPos.Start, BoxPos.End, 0, 0, BoxPos.End, BoxPos.End, 0, selectionLineWidth)); - selection.Add (new SelectionHandlePart (BoxFill.VLine, BoxPos.Start, BoxPos.Start, -selectionLineWidth, 0, BoxPos.Start, BoxPos.End, 0, 0)); - selection.Add (new SelectionHandlePart (BoxFill.VLine, BoxPos.End, BoxPos.Start, 0, 0, BoxPos.End, BoxPos.End, selectionLineWidth, 0)); - - // Handles - selection.Add (new SelectionHandlePart (BoxFill.Box, BoxPos.Start, BoxPos.Start, -selectionHandleSize, -selectionHandleSize, BoxPos.Start, BoxPos.Start, 0, 0)); - selection.Add (new SelectionHandlePart (BoxFill.Box, BoxPos.End, BoxPos.Start, 0, -selectionHandleSize, BoxPos.End, BoxPos.Start, selectionHandleSize, 0)); - selection.Add (new SelectionHandlePart (BoxFill.Box, BoxPos.Start, BoxPos.End, -selectionHandleSize, 0, BoxPos.Start, BoxPos.End, 0, selectionHandleSize)); - selection.Add (new SelectionHandlePart (BoxFill.Box, BoxPos.End, BoxPos.End, 0, 0, BoxPos.End, BoxPos.End, selectionHandleSize, selectionHandleSize)); - - selection.Add (new SelectionHandlePart (BoxFill.Box, BoxPos.Center, BoxPos.Start, -selectionHandleSize/2, -selectionHandleSize, BoxPos.Center, BoxPos.Start, selectionHandleSize/2, 0)); - selection.Add (new SelectionHandlePart (BoxFill.Box, BoxPos.Center, BoxPos.End, -selectionHandleSize/2, 0, BoxPos.Center, BoxPos.End, selectionHandleSize/2, selectionHandleSize)); - selection.Add (new SelectionHandlePart (BoxFill.Box, BoxPos.Start, BoxPos.Center, -selectionHandleSize, -selectionHandleSize/2, BoxPos.Start, BoxPos.Center, 0, selectionHandleSize/2)); - selection.Add (new SelectionHandlePart (BoxFill.Box, BoxPos.End, BoxPos.Center, 0, -selectionHandleSize/2, BoxPos.End, BoxPos.Center, selectionHandleSize, selectionHandleSize/2)); - - dragHandlePart = new SelectionHandlePart (BoxFill.Box, BoxPos.Center, BoxPos.Start, -topSelectionHandleSize/2, -topSelectionHandleSize, BoxPos.Center, BoxPos.Start, topSelectionHandleSize/2, 0); - selection.Add (dragHandlePart); - - foreach (SelectionHandlePart s in selection) { - s.Parent = parent; - s.ParentBox = this; - } - } - - public void Show () - { - foreach (Gtk.Widget s in selection) - s.Show (); - dragHandlePart.Visible = (ObjectSelection != null && ObjectSelection.AllowDrag); - } - - public void Hide () - { - foreach (Gtk.Widget s in selection) - s.Hide (); - } - - public void Reposition (Gdk.Rectangle rect) - { - bool firstRect = true; - - foreach (SelectionHandlePart s in selection) { - s.Reposition (rect); - Gdk.Rectangle r = s.Allocation; - if (firstRect) { - allocation = r; - firstRect = false; - } else - allocation = allocation.Union (r); - } - } - - public Gdk.Rectangle Allocation { - get { return allocation; } - } - - public void ForAll (bool include_internals, Gtk.Callback callback) - { - foreach (Gtk.Widget s in selection) - callback (s); - } - - public void SizeRequest () - { - foreach (Gtk.Widget s in selection) - s.SizeRequest (); - } - } - - class SelectionHandlePart: EventBox - { - BoxPos hpos, vpos; - BoxPos hposEnd, vposEnd; - int x, y; - int xEnd, yEnd; - BoxFill fill; - public SelectionHandleBox ParentBox; - int clickX, clickY; - int localClickX, localClickY; - int ox, oy; - - public SelectionHandlePart (BoxFill fill, BoxPos hpos, BoxPos vpos, int x, int y, BoxPos hposEnd, BoxPos vposEnd, int xEnd, int yEnd) - { - this.fill = fill; - this.hpos = hpos; - this.vpos = vpos; - this.x = x; - this.y = y; - - this.hposEnd = hposEnd; - this.vposEnd = vposEnd; - this.xEnd = xEnd; - this.yEnd = yEnd; - } - - public void Reposition (Gdk.Rectangle rect) - { - int px, py; - int pxEnd, pyEnd; - - CalcPos (rect, hpos, vpos, out px, out py); - px += x; - py += y; - - CalcPos (rect, hposEnd, vposEnd, out pxEnd, out pyEnd); - pxEnd += xEnd; - pyEnd += yEnd; - - Allocation = new Gdk.Rectangle (px, py, pxEnd - px, pyEnd - py); - ox = rect.X; - oy = rect.Y; - } - - void CalcPos (Gdk.Rectangle rect, BoxPos hp, BoxPos vp, out int px, out int py) - { - if (vp == BoxPos.Start) - py = rect.Y; - else if (vp == BoxPos.End) - py = rect.Bottom; - else - py = rect.Y + rect.Height / 2; - - if (hp == BoxPos.Start) - px = rect.X; - else if (hp == BoxPos.End) - px = rect.Right; - else - px = rect.X + rect.Width / 2; - } - - protected override bool OnExposeEvent (Gdk.EventExpose ev) - { - int w, h; - this.GdkWindow.GetSize (out w, out h); - - if (fill == BoxFill.Box) { - this.GdkWindow.DrawRectangle (this.Style.WhiteGC, true, 0, 0, w, h); - this.GdkWindow.DrawRectangle (this.Style.BlackGC, false, 0, 0, w-1, h-1); - } else if (fill == BoxFill.HLine) { - using (Gdk.GC gc = new Gdk.GC (this.GdkWindow)) { - gc.SetDashes (0, new sbyte [] { 1, 1 }, 2); - gc.SetLineAttributes (SelectionHandleBox.selectionLineWidth, Gdk.LineStyle.OnOffDash, Gdk.CapStyle.NotLast, Gdk.JoinStyle.Miter); - gc.Foreground = this.Style.Black; - this.GdkWindow.DrawLine (gc, 0, h / 2, w, h / 2); - gc.Foreground = this.Style.White; - this.GdkWindow.DrawLine (gc, 1, h/2, w, h/2); - } - } else { - using (Gdk.GC gc = new Gdk.GC (this.GdkWindow)) { - gc.SetDashes (0, new sbyte [] { 1, 1 }, 2); - gc.SetLineAttributes (SelectionHandleBox.selectionLineWidth, Gdk.LineStyle.OnOffDash, Gdk.CapStyle.NotLast, Gdk.JoinStyle.Miter); - gc.Foreground = this.Style.Black; - this.GdkWindow.DrawLine (gc, w / 2, 0, w / 2, h); - gc.Foreground = this.Style.White; - this.GdkWindow.DrawLine (gc, w / 2, 1, w/2, h); - } - } - - return true; - } - - protected override bool OnButtonPressEvent (Gdk.EventButton evb) - { - if (evb.Type == Gdk.EventType.ButtonPress && evb.Button == 1 && !GtkWorkarounds.TriggersContextMenu (evb)) { - clickX = (int)evb.XRoot; - clickY = (int)evb.YRoot; - localClickX = (int) evb.X; - localClickY = (int) evb.Y; - } - return true; - } - - protected override bool OnMotionNotifyEvent (Gdk.EventMotion evm) - { - if ((evm.State & Gdk.ModifierType.Button1Mask) == 0) - return false; - - if (!Gtk.Drag.CheckThreshold (this, clickX, clickY, (int)evm.XRoot, (int)evm.YRoot)) - return false; - - if (ParentBox.ObjectSelection != null && ParentBox.ObjectSelection.AllowDrag) { - int dx = Allocation.X - ox + localClickX; - int dy = Allocation.Y - oy + localClickY; - ParentBox.ObjectSelection.FireDrag (evm, dx, dy); - } - - return true; - } - } - - class ObjectSelection: IObjectSelection - { - ResizableFixed box; - Gtk.Widget widget; - object dataObject; - bool allowDrag = true; - - public ObjectSelection (ResizableFixed box, Gtk.Widget widget, object dataObject) - { - this.box = box; - this.widget = widget; - this.dataObject = dataObject; - } - - public Gtk.Widget Widget { - get { return widget; } - } - - public object DataObject { - get { return dataObject; } - } - - public void Dispose () - { - box.ResetSelection (widget); - } - - internal void FireDisposed () - { - if (Disposed != null) - Disposed (this, EventArgs.Empty); - } - - internal void FireDrag (Gdk.EventMotion evt, int dx, int dy) - { - if (Drag != null) - Drag (evt, dx, dy); - } - - public bool AllowDrag { - get { return allowDrag; } - set { allowDrag = value; } - } - - public event DragDelegate Drag; - public event EventHandler Disposed; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetEditSession.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetEditSession.cs deleted file mode 100644 index d4085d86479..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetEditSession.cs +++ /dev/null @@ -1,431 +0,0 @@ -// -// WidgetEditSession.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (C) 2006 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System; -using System.Xml; -using System.Reflection; -using System.Collections; -using System.CodeDom; -using Mono.Unix; - -namespace Stetic { - - internal class WidgetEditSession: MarshalByRefObject, IDisposable - { - string sourceWidget; - Stetic.ProjectBackend sourceProject; - - Stetic.ProjectBackend gproject; - Stetic.Wrapper.Container rootWidget; - Stetic.WidgetDesignerBackend widget; - Gtk.VBox designer; - Gtk.Plug plug; - bool autoCommitChanges; - WidgetActionBar toolbar; - WidgetDesignerFrontend frontend; - bool allowBinding; - bool disposed; - - ContainerUndoRedoManager undoManager; - UndoQueue undoQueue; - - public event EventHandler RootWidgetChanged; - public event Stetic.Wrapper.WidgetEventHandler SelectionChanged; - - public WidgetEditSession (ProjectBackend sourceProject, WidgetDesignerFrontend frontend, string windowName, Stetic.ProjectBackend editingBackend, bool autoCommitChanges) - { - this.frontend = frontend; - this.autoCommitChanges = autoCommitChanges; - undoManager = new ContainerUndoRedoManager (); - undoQueue = new UndoQueue (); - undoManager.UndoQueue = undoQueue; - - sourceWidget = windowName; - this.sourceProject = sourceProject; - - if (!autoCommitChanges) { - // Reuse the action groups and icon factory of the main project - gproject = editingBackend; - - // Attach will prevent the destruction of the action group list by gproject - gproject.AttachActionGroups (sourceProject.ActionGroups); - - gproject.IconFactory = sourceProject.IconFactory; - gproject.FileName = sourceProject.FileName; - gproject.ImagesRootPath = sourceProject.ImagesRootPath; - gproject.ResourceProvider = sourceProject.ResourceProvider; - gproject.WidgetLibraries = (ArrayList) sourceProject.WidgetLibraries.Clone (); - gproject.InternalWidgetLibraries = (ArrayList) sourceProject.InternalWidgetLibraries.Clone (); - gproject.TargetGtkVersion = sourceProject.TargetGtkVersion; - sourceProject.ComponentTypesChanged += OnSourceProjectLibsChanged; - sourceProject.ProjectReloaded += OnSourceProjectReloaded; - - rootWidget = editingBackend.GetTopLevelWrapper (sourceWidget, false); - if (rootWidget == null) { - // Copy the widget to edit from the source project - // When saving the file, this project will be merged with the main project. - sourceProject.CopyWidgetToProject (windowName, gproject, windowName); - rootWidget = gproject.GetTopLevelWrapper (windowName, true); - } - - gproject.Modified = false; - } - else { - rootWidget = sourceProject.GetTopLevelWrapper (windowName, true); - gproject = sourceProject; - } - - rootWidget.Select (); - undoManager.RootObject = rootWidget; - - gproject.ModifiedChanged += new EventHandler (OnModifiedChanged); - gproject.Changed += new EventHandler (OnChanged); - gproject.ProjectReloaded += new EventHandler (OnProjectReloaded); - gproject.ProjectReloading += new EventHandler (OnProjectReloading); -// gproject.WidgetMemberNameChanged += new Stetic.Wrapper.WidgetNameChangedHandler (OnWidgetNameChanged); - } - - public bool AllowWidgetBinding { - get { return allowBinding; } - set { - allowBinding = value; - if (toolbar != null) - toolbar.AllowWidgetBinding = allowBinding; - } - } - - public Stetic.Wrapper.Widget GladeWidget { - get { return rootWidget; } - } - - public Stetic.Wrapper.Container RootWidget { - get { return (Wrapper.Container) Component.GetSafeReference (rootWidget); } - } - - public Gtk.Widget WrapperWidget { - get { - if (designer == null) { - if (rootWidget == null) - return widget; - Gtk.Container wc = rootWidget.Wrapped as Gtk.Container; - if (widget == null) - widget = Stetic.UserInterface.CreateWidgetDesigner (wc, rootWidget.DesignWidth, rootWidget.DesignHeight); - - toolbar = new WidgetActionBar (frontend, rootWidget); - toolbar.AllowWidgetBinding = allowBinding; - designer = new Gtk.VBox (); - designer.BorderWidth = 3; - designer.PackStart (toolbar, false, false, 0); - designer.PackStart (widget, true, true, 3); - widget.DesignArea.SetSelection (gproject.Selection, gproject.Selection, false); - widget.SelectionChanged += OnSelectionChanged; - - } - return designer; - } - } - - [NoGuiDispatch] - public void CreateWrapperWidgetPlug (uint socketId) - { - Gdk.Threads.Enter (); - plug = new Gtk.Plug (socketId); - plug.Add (WrapperWidget); - plug.Decorated = false; - plug.ShowAll (); - Gdk.Threads.Leave (); - } - - public void DestroyWrapperWidgetPlug () - { - if (designer != null) { - Gtk.Plug plug = (Gtk.Plug) WrapperWidget.Parent; - plug.Remove (WrapperWidget); - plug.Destroy (); - } - } - - public void Save () - { - if (!autoCommitChanges) { - gproject.CopyWidgetToProject (rootWidget.Wrapped.Name, sourceProject, sourceWidget); - sourceWidget = rootWidget.Wrapped.Name; - gproject.Modified = false; - } - } - - public ProjectBackend EditingBackend { - get { return gproject; } - } - - public void Dispose () - { - sourceProject.ComponentTypesChanged -= OnSourceProjectLibsChanged; - sourceProject.ProjectReloaded -= OnSourceProjectReloaded; - - gproject.ModifiedChanged -= new EventHandler (OnModifiedChanged); - gproject.Changed -= new EventHandler (OnChanged); - gproject.ProjectReloaded -= OnProjectReloaded; - gproject.ProjectReloading -= OnProjectReloading; -// gproject.WidgetMemberNameChanged -= new Stetic.Wrapper.WidgetNameChangedHandler (OnWidgetNameChanged); - - if (!autoCommitChanges) { - // Don't dispose the project here! it will be disposed by the frontend - if (widget != null) { - widget.SelectionChanged -= OnSelectionChanged; - // Don't dispose the widget. It will be disposed when destroyed together - // with the container - widget = null; - } - } - - if (plug != null) - plug.Destroy (); - gproject = null; - rootWidget = null; - frontend = null; - System.Runtime.Remoting.RemotingServices.Disconnect (this); - disposed = true; - } - - public bool Disposed { - get { return disposed; } - } - - public override object InitializeLifetimeService () - { - // Will be disconnected when calling Dispose - return null; - } - - public void SetDesignerActive () - { - widget.UpdateObjectViewers (); - } - - public bool Modified { - get { return gproject.Modified; } - } - - public UndoQueue UndoQueue { - get { - if (undoQueue != null) - return undoQueue; - else - return UndoQueue.Empty; - } - } - - void OnModifiedChanged (object s, EventArgs a) - { - if (frontend != null) - frontend.NotifyModifiedChanged (); - } - - void OnChanged (object s, EventArgs a) - { - if (frontend != null) - frontend.NotifyChanged (); - } - - void OnSourceProjectReloaded (object s, EventArgs a) - { - // Propagate gtk version change - if (sourceProject.TargetGtkVersion != gproject.TargetGtkVersion) - gproject.TargetGtkVersion = sourceProject.TargetGtkVersion; - } - - void OnSourceProjectLibsChanged (object s, EventArgs a) - { - // If component types have changed in the source project, they must also change - // in this project. - gproject.WidgetLibraries = (ArrayList) sourceProject.WidgetLibraries.Clone (); - gproject.InternalWidgetLibraries = (ArrayList) sourceProject.InternalWidgetLibraries.Clone (); - gproject.NotifyComponentTypesChanged (); - } - - void OnProjectReloading (object s, EventArgs a) - { - if (frontend != null) - frontend.NotifyRootWidgetChanging (); - } - - void OnProjectReloaded (object s, EventArgs a) - { - // Update the actions group list - if (!autoCommitChanges) { - gproject.AttachActionGroups (sourceProject.ActionGroups); - gproject.WidgetLibraries = (ArrayList) sourceProject.WidgetLibraries.Clone (); - gproject.InternalWidgetLibraries = (ArrayList) sourceProject.InternalWidgetLibraries.Clone (); - } - - Gtk.Widget[] tops = gproject.Toplevels; - if (tops.Length > 0) { - rootWidget = Stetic.Wrapper.Container.Lookup (tops[0]); - undoManager.RootObject = rootWidget; - if (rootWidget != null) { - Gtk.Widget oldWidget = designer; - if (widget != null) { - widget.SelectionChanged -= OnSelectionChanged; - widget = null; - } - OnRootWidgetChanged (); - if (oldWidget != null) { - // Delay the destruction of the old widget, so the designer has time to - // show the new widget. This avoids flickering. - GLib.Timeout.Add (500, delegate { - oldWidget.Destroy (); - return false; - }); - } - - gproject.NotifyComponentTypesChanged (); - return; - } - } - SetErrorMode (); - } - - void SetErrorMode () - { - Gtk.Label lab = new Gtk.Label (); - lab.Markup = "" + Catalog.GetString ("The form designer could not be loaded") + ""; - Gtk.EventBox box = new Gtk.EventBox (); - box.Add (lab); - - widget = Stetic.UserInterface.CreateWidgetDesigner (box, 100, 100); - rootWidget = null; - - OnRootWidgetChanged (); - } - - void OnRootWidgetChanged () - { - if (designer != null) { - if (designer.Parent is Gtk.Plug) - ((Gtk.Plug)designer.Parent).Remove (designer); - designer = null; - } - - if (plug != null) { - Gdk.Threads.Enter (); - plug.Add (WrapperWidget); - plug.ShowAll (); - Gdk.Threads.Leave (); - } - - if (frontend != null) - frontend.NotifyRootWidgetChanged (); - if (RootWidgetChanged != null) - RootWidgetChanged (this, EventArgs.Empty); - } - - void OnSelectionChanged (object ob, EventArgs a) - { - if (frontend != null) { - bool canCut, canCopy, canPaste, canDelete; - ObjectWrapper obj = ObjectWrapper.Lookup (widget.Selection); - Stetic.Wrapper.Widget wrapper = obj as Stetic.Wrapper.Widget; - IEditableObject editable = widget.Selection as IEditableObject; - if (editable == null) - editable = obj as IEditableObject; - if (editable != null) { - canCut = editable.CanCut; - canCopy = editable.CanCopy; - canPaste = editable.CanPaste; - canDelete = editable.CanDelete; - } - else { - canCut = canCopy = canPaste = canDelete = false; - } - - frontend.NotifySelectionChanged (Component.GetSafeReference (obj), canCut, canCopy, canPaste, canDelete); - if (SelectionChanged != null) - SelectionChanged (this, new Stetic.Wrapper.WidgetEventArgs (wrapper)); - } - } - - public object SaveState () - { - return new object[] { - gproject.SaveStatus (), - undoQueue - }; - } - - public void RestoreState (object sessionData) - { - object[] status = (object[]) sessionData; - gproject.LoadStatus (status [0]); - undoQueue = (UndoQueue) status [1]; - foreach (UndoRedoChange ch in undoQueue.Changes) { - ObjectWrapperUndoRedoChange och = ch as ObjectWrapperUndoRedoChange; - if (och != null) - och.Manager = undoManager; - } - undoManager.UndoQueue = undoQueue; - } - - internal void ClipboardCopySelection () - { - IEditableObject editable = widget.Selection as IEditableObject; - if (editable == null) - editable = ObjectWrapper.Lookup (widget.Selection) as IEditableObject; - if (editable != null) - editable.Copy (); - } - - public void ClipboardCutSelection () - { - IEditableObject editable = widget.Selection as IEditableObject; - if (editable == null) - editable = ObjectWrapper.Lookup (widget.Selection) as IEditableObject; - if (editable != null) - editable.Cut (); - } - - public void ClipboardPaste () - { - IEditableObject editable = widget.Selection as IEditableObject; - if (editable == null) - editable = ObjectWrapper.Lookup (widget.Selection) as IEditableObject; - if (editable != null) - editable.Paste (); - } - - public void DeleteSelection () - { - IEditableObject editable = widget.Selection as IEditableObject; - if (editable == null) - editable = ObjectWrapper.Lookup (widget.Selection) as IEditableObject; - if (editable != null) - editable.Delete (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetFactory.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetFactory.cs deleted file mode 100644 index 780b287e163..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetFactory.cs +++ /dev/null @@ -1,136 +0,0 @@ -using Gtk; -using Gdk; -using System; -using System.Collections; -using System.Reflection; - -namespace Stetic { - - // This is the base class for palette items. Implements the basic - // functionality for showing the icon and label of the item. - - internal class PaletteItemFactory : EventBox - { - public PaletteItemFactory () - { - } - - public virtual void Initialize (string name, Gdk.Pixbuf icon) - { - DND.SourceSet (this); - AboveChild = true; - - Gtk.HBox hbox = new HBox (false, 6); - hbox.BorderWidth = 3; - - if (icon != null) { - icon = icon.ScaleSimple (16, 16, Gdk.InterpType.Bilinear); - hbox.PackStart (new Gtk.Image (icon), false, false, 0); - } - - Gtk.Label label = new Gtk.Label ("" + name + ""); - label.UseMarkup = true; - label.Justify = Justification.Left; - label.Xalign = 0; - hbox.PackEnd (label, true, true, 0); - - Add (hbox); - } - - protected override void OnDragBegin (Gdk.DragContext ctx) - { - Gtk.Widget ob = CreateItemWidget (); - if (ob != null) - DND.Drag (this, ctx, ob); - } - - protected virtual Gtk.Widget CreateItemWidget () - { - return null; - } - - protected override bool OnEnterNotifyEvent (Gdk.EventCrossing ev) - { - this.State = Gtk.StateType.Prelight; - return base.OnEnterNotifyEvent (ev); - } - - protected override bool OnLeaveNotifyEvent (Gdk.EventCrossing ev) - { - this.State = Gtk.StateType.Normal; - return base.OnLeaveNotifyEvent (ev); - } - - protected override bool OnExposeEvent (Gdk.EventExpose e) - { - base.OnExposeEvent (e); - if (State == Gtk.StateType.Prelight) - Gtk.Style.PaintShadow (this.Style, this.GdkWindow, State, Gtk.ShadowType.Out, e.Area, this, "", e.Area.X, e.Area.Y, e.Area.Width, e.Area.Height); - return false; - } - } - - - // Palette item factory which creates a widget. - internal class WidgetFactory : PaletteItemFactory { - - protected ProjectBackend project; - protected ClassDescriptor klass; - - public WidgetFactory (ProjectBackend project, ClassDescriptor klass) - { - this.project = project; - this.klass = klass; - Initialize (klass.Label, klass.Icon); - if (project == null) - Sensitive = false; - } - - protected override Gtk.Widget CreateItemWidget () - { - return klass.NewInstance (project) as Widget; - } - } - - internal class WindowFactory : WidgetFactory - { - public WindowFactory (ProjectBackend project, ClassDescriptor klass) : base (project, klass) - { - } - - protected override bool OnButtonPressEvent (Gdk.EventButton evt) - { - Gtk.Window win = klass.NewInstance (project) as Gtk.Window; - project.AddWindow (win, true); - return true; - } - - public override void Initialize (string name, Gdk.Pixbuf icon) - { - base.Initialize (name, icon); - DND.SourceUnset (this); - } - } - - // Palette item factory which allows dragging an already existing object. - internal class InstanceWidgetFactory : PaletteItemFactory - { - Gtk.Widget instance; - - public InstanceWidgetFactory (string name, Gdk.Pixbuf icon, Gtk.Widget instance) - { - this.instance = instance; - Initialize (name, icon); - } - - protected override Gtk.Widget CreateItemWidget () - { - return instance; - } - - public override void Dispose () - { - base.Dispose (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetInfoEventHandler.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetInfoEventHandler.cs deleted file mode 100644 index 1d096dcf2bc..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetInfoEventHandler.cs +++ /dev/null @@ -1,41 +0,0 @@ - -using System; - -namespace Stetic -{ - public delegate void WidgetInfoEventHandler (object sender, WidgetInfoEventArgs args); - - public class WidgetInfoEventArgs: EventArgs - { - Project project; - WidgetInfo widget; - - internal WidgetInfoEventArgs (Project p, WidgetInfo w) - { - project = p; - widget = w; - } - - public Project Project { - get { return project; } - } - - public WidgetInfo WidgetInfo { - get { return widget; } - } - } - -/* public class ComponentNameEventArgs: ComponentEventArgs - { - string oldName; - - internal ComponentNameEventArgs (Project p, Component c, string oldName): base (p, c) - { - this.oldName = oldName; - } - - public string OldName { - get { return oldName; } - } - } -*/} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetPropertyTree.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetPropertyTree.cs deleted file mode 100644 index 3409681428b..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetPropertyTree.cs +++ /dev/null @@ -1,28 +0,0 @@ - -using System; -using Gtk; - -namespace Stetic -{ - public class WidgetPropertyTree: PluggableWidget - { - internal WidgetPropertyTree (Application app): base (app) - { - } - - protected override void OnCreatePlug (uint socketId) - { - app.Backend.CreatePropertiesWidgetPlug (socketId); - } - - protected override void OnDestroyPlug (uint socketId) - { - app.Backend.DestroyPropertiesWidgetPlug (); - } - - protected override Gtk.Widget OnCreateWidget () - { - return app.Backend.GetPropertiesWidget (); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetPropertyTreeBackend.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetPropertyTreeBackend.cs deleted file mode 100644 index d4e7d13a5be..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetPropertyTreeBackend.cs +++ /dev/null @@ -1,118 +0,0 @@ - -using System; - -namespace Stetic -{ - internal class WidgetPropertyTreeBackend: PropertyTree, IObjectViewer - { - ProjectBackend project; - Stetic.ObjectWrapper selection; - Stetic.ObjectWrapper newSelection; - Stetic.Wrapper.Container.ContainerChild packingSelection; - - public WidgetPropertyTreeBackend () - { - Stetic.Registry.RegistryChanging += new EventHandler (OnRegistryChanging); - } - - public ProjectBackend ProjectBackend { - get { return project; } - set { - if (project != null) { - project.SelectionChanged -= Selected; - } - - project = value; - if (project != null) { - TargetObject = project.Selection; - project.SelectionChanged += Selected; - } else { - TargetObject = null; - } - } - } - - public override void Clear () - { - base.Clear (); - Wrapper.Widget selWidget = selection as Wrapper.Widget; - if (selWidget != null) - selWidget.Notify -= Notified; - if (packingSelection != null) - packingSelection.Notify -= Notified; - } - - protected override void OnObjectChanged () - { - if (selection != null) - selection.NotifyChanged (); - } - - public object TargetObject { - get { return selection.Wrapped; } - set { - ObjectWrapper wrapper = ObjectWrapper.Lookup (value); - if (newSelection == wrapper) - return; - - newSelection = wrapper; - if (newSelection != null) - GLib.Timeout.Add (50, new GLib.TimeoutHandler (SelectedHandler)); - else - SelectedHandler (); - } - } - - void Selected (object s, Wrapper.WidgetEventArgs args) - { - TargetObject = args != null && args.Widget != null? args.Widget : null; - } - - bool SelectedHandler () - { - SaveStatus (); - - Clear (); - - selection = newSelection; - if (selection == null || selection.Wrapped is ErrorWidget || project == null) { - return false; - } - - Wrapper.Widget selWidget = selection as Wrapper.Widget; - if (selWidget != null) { - selWidget.Notify += Notified; - - PropertyDescriptor name = (PropertyDescriptor)Registry.LookupClassByName ("Gtk.Widget") ["Name"]; - AppendProperty (name, selection.Wrapped); - } - - AddProperties (selection.ClassDescriptor.ItemGroups, selection.Wrapped, project.TargetGtkVersion); - - if (selWidget != null) { - packingSelection = Stetic.Wrapper.Container.ChildWrapper (selWidget); - if (packingSelection != null) { - ClassDescriptor childklass = packingSelection.ClassDescriptor; - if (childklass.ItemGroups.Count > 0) { - AddProperties (childklass.ItemGroups, packingSelection.Wrapped, project.TargetGtkVersion); - packingSelection.Notify += Notified; - } - } - } - - RestoreStatus (); - return false; - } - - void Notified (object wrapper, string propertyName) - { - Update (); - } - - void OnRegistryChanging (object o, EventArgs args) - { - Clear (); - } - } - -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetTree.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetTree.cs deleted file mode 100644 index 66f423aab37..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetTree.cs +++ /dev/null @@ -1,92 +0,0 @@ - -using System; - -namespace Stetic -{ - public class WidgetTree: PluggableWidget - { - ProjectViewFrontend frontend; - - internal WidgetTree (Application app): base (app) - { - frontend = new ProjectViewFrontend (app); - } - - public event ComponentEventHandler ComponentActivated { - add { frontend.ComponentActivated += value; } - remove { frontend.ComponentActivated -= value; } - } - - public event ComponentEventHandler SelectionChanged { - add { frontend.SelectionChanged += value; } - remove { frontend.SelectionChanged -= value; } - } - - protected override void OnCreatePlug (uint socketId) - { - app.Backend.CreateProjectWidgetPlug (frontend, socketId); - } - - protected override void OnDestroyPlug (uint socketId) - { - app.Backend.DestroyProjectWidgetPlug (); - } - - protected override Gtk.Widget OnCreateWidget () - { - return app.Backend.GetProjectWidget (frontend); - } - - public override void Dispose () - { - frontend.disposed = true; - System.Runtime.Remoting.RemotingServices.Disconnect (frontend); - base.Dispose (); - } - } - - - internal class ProjectViewFrontend: MarshalByRefObject - { - Application app; - internal bool disposed; - - public event ComponentEventHandler ComponentActivated; - public event ComponentEventHandler SelectionChanged; - - public ProjectViewFrontend (Application app) - { - this.app = app; - } - - public void NotifyWidgetActivated (object ob, string widgetName, string widgetType) - { - Gtk.Application.Invoke ( - (o, args) => { - if (disposed) return; - Component c = app.GetComponent (ob, widgetName, widgetType); - if (c != null && ComponentActivated != null) - ComponentActivated (null, new ComponentEventArgs (app.ActiveProject, c)); - } - ); - } - - public void NotifySelectionChanged (object ob, string widgetName, string widgetType) - { - Gtk.Application.Invoke ( - (o, args) => { - if (disposed) return; - Component c = ob != null ? app.GetComponent (ob, widgetName, widgetType) : null; - if (SelectionChanged != null) - SelectionChanged (null, new ComponentEventArgs (app.ActiveProject, c)); - } - ); - } - - public override object InitializeLifetimeService () - { - // Will be disconnected when calling Dispose - return null; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetTreeCombo.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetTreeCombo.cs deleted file mode 100644 index 159f8ec9756..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/WidgetTreeCombo.cs +++ /dev/null @@ -1,213 +0,0 @@ - -using System; -using Gtk; - -namespace Stetic -{ - internal class WidgetTreeCombo: Button - { - Label label; - Image image; - Stetic.Wrapper.Widget rootWidget; - Stetic.IProject project; - Stetic.Wrapper.Widget selection; - WidgetTreePopup popup; - - public WidgetTreeCombo () - { - label = new Label (); - image = new Gtk.Image (); - - HBox bb = new HBox (); - bb.PackStart (image, false, false, 3); - bb.PackStart (label, true, true, 3); - label.Xalign = 0; - label.HeightRequest = 18; - bb.PackStart (new VSeparator (), false, false, 1); - bb.PackStart (new Arrow (ArrowType.Down, ShadowType.None), false, false, 1); - Child = bb; - this.WidthRequest = 300; - Sensitive = false; - } - - public override void Dispose () - { - if (popup != null) - popup.Destroy (); - base.Dispose (); - } - - - public Stetic.Wrapper.Widget RootWidget { - get { return rootWidget; } - set { - rootWidget = value; - Sensitive = rootWidget != null; - if (rootWidget != null) - project = rootWidget.Project; - Update (); - } - } - - public void SetSelection (Stetic.Wrapper.Widget widget) - { - selection = widget; - Update (); - } - - void Update () - { - if (selection != null) { - label.Text = selection.Wrapped.Name; - image.Pixbuf = selection.ClassDescriptor.Icon.ScaleSimple (16, 16, Gdk.InterpType.Bilinear); - image.Show (); - } else { - label.Text = " "; - image.Hide (); - } - } - - protected override void OnPressed () - { - base.OnPressed (); - if (popup == null) { - popup = new WidgetTreePopup (project); - popup.WidgetActivated += OnPopupActivated; - popup.SetDefaultSize (Allocation.Width, 500); - } - else if (popup.Visible) { - popup.Hide (); - return; - } - - int x, y; - ParentWindow.GetOrigin (out x, out y); - x += Allocation.X; - y += Allocation.Y + Allocation.Height; - - popup.Fill (RootWidget.Wrapped); - popup.Move (x, y); - popup.ShowAll (); - } - - protected override bool OnFocusOutEvent (Gdk.EventFocus evnt) - { - if (popup != null) - popup.Hide (); - return base.OnFocusOutEvent (evnt); - } - - - void OnPopupActivated (object s, EventArgs a) - { - popup.Hide (); - Stetic.Wrapper.Widget wrapper = Stetic.Wrapper.Widget.Lookup (popup.Selection); - GLib.Timeout.Add (10, delegate { - wrapper.Select (); - return false; - }); - } - } - - class WidgetTreePopup: Window - { - TreeView tree; - TreeStore store; - Gtk.Widget selection; - Stetic.IProject project; - - public event EventHandler WidgetActivated; - - public WidgetTreePopup (Stetic.IProject project): base (WindowType.Popup) - { - this.project = project; - Gtk.Frame frame = new Frame (); - frame.ShadowType = Gtk.ShadowType.Out; - Add (frame); - - Gtk.ScrolledWindow sc = new ScrolledWindow (); - sc.VscrollbarPolicy = PolicyType.Automatic; - sc.HscrollbarPolicy = PolicyType.Automatic; - frame.Add (sc); - - tree = new TreeView (); - store = new TreeStore (typeof(Gdk.Pixbuf), typeof(string), typeof(Widget)); - tree.Model = store; - tree.HeadersVisible = false; - - TreeViewColumn col = new TreeViewColumn (); - CellRendererPixbuf cr = new CellRendererPixbuf (); - col.PackStart (cr, false); - col.AddAttribute (cr, "pixbuf", 0); - - CellRendererText tr = new CellRendererText (); - col.PackStart (tr, true); - col.AddAttribute (tr, "markup", 1); - - tree.AppendColumn (col); - - tree.ButtonReleaseEvent += OnButtonRelease; - tree.RowActivated += OnButtonRelease; - sc.Add (tree); - tree.GrabFocus (); - - } - - public void Fill (Gtk.Widget widget) - { - store.Clear (); - Fill (TreeIter.Zero, widget); - } - - public void Fill (TreeIter iter, Gtk.Widget widget) - { - Stetic.Wrapper.Widget wrapper = Stetic.Wrapper.Widget.Lookup (widget); - if (wrapper == null) return; - - if (!wrapper.Unselectable) { - - Gdk.Pixbuf icon = wrapper.ClassDescriptor.Icon.ScaleSimple (16, 16, Gdk.InterpType.Bilinear); - string txt; - if (widget == project.Selection) - txt = "" + GLib.Markup.EscapeText (widget.Name) + ""; - else - txt = GLib.Markup.EscapeText (widget.Name); - - if (!iter.Equals (TreeIter.Zero)) - iter = store.AppendValues (iter, icon, txt, widget); - else - iter = store.AppendValues (icon, txt, widget); - } - - Gtk.Container cc = widget as Gtk.Container; - if (cc != null && wrapper.ClassDescriptor.AllowChildren) { - foreach (Gtk.Widget child in cc.Children) - Fill (iter, child); - } - if (widget == project.Selection) { - tree.ExpandToPath (store.GetPath (iter)); - tree.ExpandRow (store.GetPath (iter), false); - tree.Selection.SelectIter (iter); - } - } - - public Gtk.Widget Selection { - get { return selection; } - } - - void OnButtonRelease (object s, EventArgs a) - { - NotifyActivated (); - } - - void NotifyActivated () - { - TreeIter iter; - if (!tree.Selection.GetSelected (out iter)) - return; - selection = (Gtk.Widget) store.GetValue (iter, 2); - if (WidgetActivated != null) - WidgetActivated (this, EventArgs.Empty); - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Windows/Preview.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Windows/Preview.cs deleted file mode 100644 index aee001e5598..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Windows/Preview.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Gtk; -using Gdk; - -namespace Stetic.Windows -{ - class Preview: Bin - { - Gtk.Widget child; - WindowsTheme wtheme; - string caption; - - public Preview ( ) - { - DoubleBuffered = false; - AppPaintable = true; - } - - public static Preview Create (TopLevelWindow window) - { - if (System.IO.Path.DirectorySeparatorChar != '\\') - return null; - try { - Preview p = new Preview (); - p.Add (window); - return p; - } - catch { - return null; - } - } - - public string Title { - get { return caption; } - set { - caption = value; - QueueDraw (); - } - } - - protected override void OnDestroyed ( ) - { - if (wtheme != null) - wtheme.Dipose (); - base.OnDestroyed (); - } - - protected override void OnAdded (Widget widget) - { - base.OnAdded (widget); - child = widget; - if (child is TopLevelWindow) { - ((TopLevelWindow) child).PropertyChanged += Preview_TitleChanged; - Title = ((TopLevelWindow) child).Title; - } - } - - void Preview_TitleChanged (object sender, EventArgs e) - { - Title = ((TopLevelWindow) child).Title; - } - - protected override void OnRemoved (Widget widget) - { - base.OnRemoved (widget); - if (widget == child) { - if (child is TopLevelWindow) - ((TopLevelWindow) child).PropertyChanged -= Preview_TitleChanged; - child = null; - } - } - - protected override void OnSizeRequested (ref Requisition requisition) - { - if (child != null) - requisition = child.SizeRequest (); - } - - protected override void OnSizeAllocated (Gdk.Rectangle allocation) - { - base.OnSizeAllocated (allocation); - if (child != null) { - if (wtheme != null) - child.Allocation = wtheme.GetWindowClientArea (allocation); - else - child.Allocation = allocation; - } - } - - protected override void OnRealized ( ) - { - base.OnRealized (); - wtheme = new WindowsTheme (GdkWindow); - if (child != null) - child.Allocation = wtheme.GetWindowClientArea (Allocation); - } - - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { -// Gdk.Rectangle rect = new Gdk.Rectangle (Allocation.X+50, Allocation.Y+50, Allocation.Width - 1, Allocation.Height - 1); - wtheme.DrawWindowFrame (this, caption, Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); - foreach (Widget child in Children) - PropagateExpose (child, evnt); - return false; - } - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Windows/WindowsTheme.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/Windows/WindowsTheme.cs deleted file mode 100644 index c75e25b80d7..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/Windows/WindowsTheme.cs +++ /dev/null @@ -1,206 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; - -namespace Stetic.Windows -{ - class WindowsTheme - { - const string USER32 = "user32.dll"; - const string GDI32 = "gdi32.dll"; - const string LIBGDK = "libgdk-win32-2.0-0.dll"; - const string UXTHEME = "uxtheme"; - const string LIBUXTHEME = "uxtheme.dll"; - IntPtr hWnd; - IntPtr hTheme; - - public WindowsTheme (Gdk.Window win) - { - hWnd = gdk_win32_drawable_get_handle (win.Handle); - hTheme = OpenThemeData (hWnd, "WINDOW"); - } - - public void Dipose ( ) - { - CloseThemeData (hTheme); - } - - public void DrawWindowFrame (Gtk.Widget w, string caption, int x, int y, int width, int height) - { - Gdk.Drawable drawable = w.GdkWindow; - Gdk.Pixmap pix = new Gdk.Pixmap (drawable, width, height, drawable.Depth); - - Gdk.GC gcc = new Gdk.GC (pix); - gcc.Foreground = w.Style.Backgrounds [(int)Gtk.StateType.Normal]; - pix.DrawRectangle (gcc, true, 0, 0, width, height); - - IntPtr hdc = gdk_win32_hdc_get (pix.Handle, gcc.Handle, 0); - - RECT r = new RECT (0, 0, width, height); - SIZE size; - GetThemePartSize (hTheme, hdc, WP_CAPTION, CS_ACTIVE, ref r, 1, out size); - - r.Bottom = size.cy; - DrawThemeBackground (hTheme, hdc, WP_CAPTION, CS_ACTIVE, ref r, ref r); - - RECT rf = new RECT (FrameBorder, FrameBorder, width - FrameBorder * 2, size.cy); - LOGFONT lf = new LOGFONT (); - GetThemeSysFont (hTheme, TMT_CAPTIONFONT, ref lf); - IntPtr titleFont = CreateFontIndirect (ref lf); - IntPtr oldFont = SelectObject (hdc, titleFont); - SetBkMode (hdc, 1 /*TRANSPARENT*/); - DrawThemeText (hTheme, hdc, WP_CAPTION, CS_ACTIVE, caption, -1, DT_LEFT | DT_SINGLELINE | DT_WORD_ELLIPSIS, 0, ref rf); - SelectObject (hdc, oldFont); - DeleteObject (titleFont); - - int ny = r.Bottom; - r = new RECT (0, ny, width, height); - DrawThemeBackground (hTheme, hdc, WP_FRAMEBOTTOM, 0, ref r, ref r); - - gdk_win32_hdc_release (pix.Handle, gcc.Handle, 0); - - Gdk.Pixbuf img = Gdk.Pixbuf.FromDrawable (pix, pix.Colormap, 0, 0, 0, 0, width, height); - drawable.DrawPixbuf (new Gdk.GC (drawable), img, 0, 0, x, y, width, height, Gdk.RgbDither.None, 0, 0); - drawable.DrawRectangle (w.Style.BackgroundGC (Gtk.StateType.Normal), true, x + FrameBorder, y + size.cy, width - FrameBorder * 2, height - FrameBorder - size.cy); - } - - public Gdk.Rectangle GetWindowClientArea (Gdk.Rectangle allocation) - { - IntPtr hdc = GetDC (hWnd); - RECT r = new RECT (allocation.X, allocation.Y, allocation.X + allocation.Width, allocation.Y + allocation.Height); - SIZE size; - GetThemePartSize (hTheme, hdc, WP_CAPTION, CS_ACTIVE, ref r, 1, out size); - ReleaseDC (hWnd, hdc); - - return new Gdk.Rectangle (allocation.X + FrameBorder, allocation.Y + size.cy, allocation.Width - FrameBorder * 2, allocation.Height - size.cy - FrameBorder); - } - - const int FrameBorder = 8; - - const int WP_CAPTION = 1; - const int WP_FRAMEBOTTOM = 9; - const int CS_ACTIVE = 1; - const int TMT_CAPTIONFONT = 801; - - const int DT_LEFT = 0x0; - const int DT_WORD_ELLIPSIS = 0x40000; - const int DT_SINGLELINE = 0x20; - - - [DllImport (UXTHEME, ExactSpelling = true)] - extern static Int32 DrawThemeBackground (IntPtr hTheme, IntPtr hdc, int iPartId, - int iStateId, ref RECT pRect, ref RECT pClipRect); - - [DllImport (LIBUXTHEME, ExactSpelling = true, CharSet = CharSet.Unicode)] - static extern IntPtr OpenThemeData (IntPtr hWnd, String classList); - - [DllImport (LIBUXTHEME, ExactSpelling = true)] - extern static Int32 CloseThemeData (IntPtr hTheme); - - [DllImport (UXTHEME, ExactSpelling = true)] - extern static Int32 GetThemePartSize (IntPtr hTheme, IntPtr hdc, int part, int state, ref RECT pRect, int eSize, out SIZE size); - - [DllImport (UXTHEME, ExactSpelling = true)] - extern static Int32 GetThemeBackgroundExtent (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref RECT pBoundingRect, out RECT pContentRect); - - [DllImport (UXTHEME, ExactSpelling = true)] - extern static Int32 GetThemeMargins (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, int iPropId, out MARGINS pMargins); - - [DllImport (UXTHEME, ExactSpelling = true, CharSet = CharSet.Unicode)] - extern static Int32 DrawThemeText (IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, String text, int textLength, UInt32 textFlags, UInt32 textFlags2, ref RECT pRect); - - [DllImport (UXTHEME, ExactSpelling = true, CharSet = CharSet.Unicode)] - extern static Int32 GetThemeSysFont (IntPtr hTheme, int iFontId, ref LOGFONT plf); - - [DllImport (GDI32)] - static extern IntPtr CreateFontIndirect ([In] ref LOGFONT lplf); - - [DllImport (GDI32)] - static extern int SetBkMode (IntPtr hdc, int iBkMode); - - [DllImport (GDI32, ExactSpelling = true, PreserveSig = true, SetLastError = true)] - static extern IntPtr SelectObject (IntPtr hdc, IntPtr hgdiobj); - - [DllImport (GDI32)] - static extern bool DeleteObject (IntPtr hObject); - - [DllImport (USER32)] - static extern IntPtr GetDC (IntPtr hWnd); - - [DllImport (USER32)] - static extern int ReleaseDC (IntPtr hWnd, IntPtr hDC); - - [DllImport (LIBGDK, CallingConvention = CallingConvention.Cdecl)] - static extern IntPtr gdk_win32_drawable_get_handle (IntPtr raw); - - [DllImport (LIBGDK, CallingConvention = CallingConvention.Cdecl)] - static extern IntPtr gdk_win32_hdc_get (IntPtr drawable, IntPtr gc, int usage); - - [DllImport (LIBGDK, CallingConvention = CallingConvention.Cdecl)] - static extern void gdk_win32_hdc_release (IntPtr drawable, IntPtr gc, int usage); - } - - - [Serializable, StructLayout (LayoutKind.Sequential)] - public struct RECT - { - public int Left; - public int Top; - public int Right; - public int Bottom; - - public RECT (int left_, int top_, int right_, int bottom_) - { - Left = left_; - Top = top_; - Right = right_; - Bottom = bottom_; - } - - public int Height { get { return Bottom - Top; } } - public int Width { get { return Right - Left; } } - } - - [StructLayout (LayoutKind.Sequential)] - public struct SIZE - { - public int cx; - public int cy; - - public SIZE (int cx, int cy) - { - this.cx = cx; - this.cy = cy; - } - } - - [StructLayout (LayoutKind.Sequential)] - public struct MARGINS - { - public int leftWidth; - public int rightWidth; - public int topHeight; - public int bottomHeight; - } - - [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Auto)] - public struct LOGFONT - { - public int lfHeight; - public int lfWidth; - public int lfEscapement; - public int lfOrientation; - public int lfWeight; - public byte lfItalic; - public byte lfUnderline; - public byte lfStrikeOut; - public byte lfCharSet; - public byte lfOutPrecision; - public byte lfClipPrecision; - public byte lfQuality; - public byte lfPitchAndFamily; - [MarshalAs (UnmanagedType.ByValTStr, SizeConst = 32)] - public string lfFaceName; - } -} diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/action.png b/main/src/addins/MonoDevelop.GtkCore/libsteticui/action.png deleted file mode 100644 index fa6a6c8a12be6df9eb1ebe3d3a45ff308470a57f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 319 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYYs>cdx@v7EBiH8NkL=2$ED8gK%q09E{-7{$KOubnA_qY;Cg?dvw)7s zMx|wp(;td)tYbAVFtu19^QNPN$!rmGSdzf$2NyQ!+_tLLy(y$W|G!)PlE&s{`}3R& za&NOIpSfBsuWE9>*yYK(%vsNk9j2vT-?eV#Dy^;qmhShz`ybF`jF|TH_(Me&mzK(T z8?PxTF{tdXZT_!sQGe~FZqDsv``*WMJ8`Udb#`{0$!E6>>$F#Ot(v5AKU?4T@^_|W zo^zIKwgy(oAD_5MC!Y1*@6!f6{jt|w1w~vBn)rS{zSySYFt?DK-=u3@wWoppV(@hJ Kb6Mw<&;$S{hI_{V diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/libsteticui.csproj b/main/src/addins/MonoDevelop.GtkCore/libsteticui/libsteticui.csproj deleted file mode 100644 index ece3d0b3b96..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/libsteticui.csproj +++ /dev/null @@ -1,120 +0,0 @@ - - - - Debug - AnyCPU - {7926DB5B-96A7-47A7-9870-DB42FA5C3548} - $(MDFrameworkVersion) - ..\..\..\..\build\AddIns\MonoDevelop.GtkCore - True - - - - - - - - - - - - - - - - - ..\..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.dll - False - - - ..\..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.Mdb.dll - False - - - ..\..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.Pdb.dll - False - - - ..\..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.Rocks.dll - False - - - - - {F870E2E7-FA64-4B2F-968A-90B36AB7AAA9} - libstetic - False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - - - - - diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/libsteticui.dll.config b/main/src/addins/MonoDevelop.GtkCore/libsteticui/libsteticui.dll.config deleted file mode 100644 index 8c4c6ab9a9d..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/libsteticui.dll.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/missing.png b/main/src/addins/MonoDevelop.GtkCore/libsteticui/missing.png deleted file mode 100644 index 589da692bbebb0ddb0c6ede675a0ae763aa2d986..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 357 zcmV-r0h<1aP)e|K3p+62%Me#?NVh*-U@Yu#)%8by(TOa=jY zo?AVRV=c>4gCJ-raXJ8sqOi(aEEXh5LY8H0w_Cz61aMqNn5r_H&G0;r{r;CUO`Dok zfrt!(0M_d@zVF)=nC8QL%3(f5Rh!t<4G7?(yTfS_Ab-B&+#1&=Q$)D=_-^H|gD8tn8p8UZ(FbYJ3%ePfCH}NQds^U0KYmte& z;~?N%^XXIf0L$f)vMkRw1MGG?fS>N>Pb0sx@kfAvtF<1S8*f2y00000NkvXXu0mjf DDSn-) diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/packages.config b/main/src/addins/MonoDevelop.GtkCore/libsteticui/packages.config deleted file mode 100644 index 8b1b9ad8d7c..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/main/src/addins/MonoDevelop.GtkCore/packages.config b/main/src/addins/MonoDevelop.GtkCore/packages.config deleted file mode 100644 index f9194282d29..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/main/src/addins/MonoDevelop.GtkCore/templates/ActionGroup.xft.xml b/main/src/addins/MonoDevelop.GtkCore/templates/ActionGroup.xft.xml deleted file mode 100644 index 6e71c2624ef..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/templates/ActionGroup.xft.xml +++ /dev/null @@ -1,69 +0,0 @@ - - diff --git a/main/src/addins/MonoDevelop.GtkCore/templates/ActionGroupPartial.xft.xml b/main/src/addins/MonoDevelop.GtkCore/templates/ActionGroupPartial.xft.xml deleted file mode 100644 index d534caa8caf..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/templates/ActionGroupPartial.xft.xml +++ /dev/null @@ -1,65 +0,0 @@ - - diff --git a/main/src/addins/MonoDevelop.GtkCore/templates/Dialog.xft.xml b/main/src/addins/MonoDevelop.GtkCore/templates/Dialog.xft.xml deleted file mode 100644 index e41ec9e88a5..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/templates/Dialog.xft.xml +++ /dev/null @@ -1,129 +0,0 @@ - - diff --git a/main/src/addins/MonoDevelop.GtkCore/templates/DialogPartial.xft.xml b/main/src/addins/MonoDevelop.GtkCore/templates/DialogPartial.xft.xml deleted file mode 100644 index f6e249dc750..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/templates/DialogPartial.xft.xml +++ /dev/null @@ -1,125 +0,0 @@ - - diff --git a/main/src/addins/MonoDevelop.GtkCore/templates/DrawingArea.xft.xml b/main/src/addins/MonoDevelop.GtkCore/templates/DrawingArea.xft.xml deleted file mode 100644 index 2c8082951b5..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/templates/DrawingArea.xft.xml +++ /dev/null @@ -1,176 +0,0 @@ - - diff --git a/main/src/addins/MonoDevelop.GtkCore/templates/Widget.xft.xml b/main/src/addins/MonoDevelop.GtkCore/templates/Widget.xft.xml deleted file mode 100644 index 35817aacf3a..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/templates/Widget.xft.xml +++ /dev/null @@ -1,79 +0,0 @@ - - diff --git a/main/src/addins/MonoDevelop.GtkCore/templates/WidgetPartial.xft.xml b/main/src/addins/MonoDevelop.GtkCore/templates/WidgetPartial.xft.xml deleted file mode 100644 index a1d36b26699..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/templates/WidgetPartial.xft.xml +++ /dev/null @@ -1,75 +0,0 @@ - - diff --git a/main/src/addins/MonoDevelop.GtkCore/templates/Window.xft.xml b/main/src/addins/MonoDevelop.GtkCore/templates/Window.xft.xml deleted file mode 100644 index 32f7a9c5fe1..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/templates/Window.xft.xml +++ /dev/null @@ -1,78 +0,0 @@ - - diff --git a/main/src/addins/MonoDevelop.GtkCore/templates/WindowPartial.xft.xml b/main/src/addins/MonoDevelop.GtkCore/templates/WindowPartial.xft.xml deleted file mode 100644 index eacabbd45d2..00000000000 --- a/main/src/addins/MonoDevelop.GtkCore/templates/WindowPartial.xft.xml +++ /dev/null @@ -1,74 +0,0 @@ - - From 1db6b06f916e769c672523a8711bf8349b9b402e Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Mon, 23 Jul 2018 11:30:39 -0400 Subject: [PATCH 002/382] Remove lingering glade-sharp references --- main/configure.ac | 2 -- .../Templates/FSharpGtkProject.xpt.xml | 1 - main/monodevelop.spec.in | 1 - .../src/addins/CSharpBinding/templates/GtkSharp2Project.xpt.xml | 1 - main/src/addins/MonoDevelop.HexEditor/gtk-gui/gui.stetic | 1 - .../MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj | 1 - .../addins/VBNetBinding/templates/VBGtkSharp2Project.xpt.xml | 1 - main/src/addins/Xml/MonoDevelop.Xml.csproj | 1 - main/src/tools/mdmonitor/gtk-gui/gui.stetic | 1 - main/src/tools/mdmonitor/mdmonitor.csproj | 1 - .../test-projects/ContactBook/ContactBook/ContactBook.csproj | 1 - 11 files changed, 12 deletions(-) diff --git a/main/configure.ac b/main/configure.ac index cd79c192814..83277fc177e 100644 --- a/main/configure.ac +++ b/main/configure.ac @@ -135,8 +135,6 @@ PKG_CHECK_MODULES(GLIB_SHARP, glib-sharp-2.0 >= $GTKSHARP_REQUIRED_VERSION) AC_SUBST(GLIB_SHARP_LIBS) PKG_CHECK_MODULES(GTK_SHARP, gtk-sharp-2.0 >= $GTKSHARP_REQUIRED_VERSION) AC_SUBST(GTK_SHARP_LIBS) -PKG_CHECK_MODULES(GLADE_SHARP, glade-sharp-2.0 >= $GTKSHARP_REQUIRED_VERSION) -AC_SUBST(GLADE_SHARP_LIBS) PKG_CHECK_MODULES(MONODOC, monodoc >= $MONODOC_REQUIRED_VERSION) AC_SUBST(MONODOC_LIBS) diff --git a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/FSharpGtkProject.xpt.xml b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/FSharpGtkProject.xpt.xml index d5c6d9e5973..d44e6de1274 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/FSharpGtkProject.xpt.xml +++ b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/FSharpGtkProject.xpt.xml @@ -31,7 +31,6 @@ - diff --git a/main/monodevelop.spec.in b/main/monodevelop.spec.in index 2cc3ae8cbe3..97ff1809d3a 100644 --- a/main/monodevelop.spec.in +++ b/main/monodevelop.spec.in @@ -18,7 +18,6 @@ Name: monodevelop BuildRequires: pkgconfig(gtk-sharp-2.0) -BuildRequires: pkgconfig(glade-sharp-2.0) BuildRequires: pkgconfig(glib-sharp-2.0) BuildRequires: pkgconfig(gnome-sharp-2.0) BuildRequires: pkgconfig(mono-addins) diff --git a/main/src/addins/CSharpBinding/templates/GtkSharp2Project.xpt.xml b/main/src/addins/CSharpBinding/templates/GtkSharp2Project.xpt.xml index eccb3c53825..1a6f363c0ce 100644 --- a/main/src/addins/CSharpBinding/templates/GtkSharp2Project.xpt.xml +++ b/main/src/addins/CSharpBinding/templates/GtkSharp2Project.xpt.xml @@ -34,7 +34,6 @@ - diff --git a/main/src/addins/MonoDevelop.HexEditor/gtk-gui/gui.stetic b/main/src/addins/MonoDevelop.HexEditor/gtk-gui/gui.stetic index 9a1b8a37ffb..859ddf5b86c 100644 --- a/main/src/addins/MonoDevelop.HexEditor/gtk-gui/gui.stetic +++ b/main/src/addins/MonoDevelop.HexEditor/gtk-gui/gui.stetic @@ -4,7 +4,6 @@ .. - diff --git a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj index c0b11563390..c5add05c2d5 100644 --- a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj +++ b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj @@ -12,7 +12,6 @@ - diff --git a/main/src/addins/VBNetBinding/templates/VBGtkSharp2Project.xpt.xml b/main/src/addins/VBNetBinding/templates/VBGtkSharp2Project.xpt.xml index a103f6c7078..333f922f6bd 100644 --- a/main/src/addins/VBNetBinding/templates/VBGtkSharp2Project.xpt.xml +++ b/main/src/addins/VBNetBinding/templates/VBGtkSharp2Project.xpt.xml @@ -34,7 +34,6 @@ - diff --git a/main/src/addins/Xml/MonoDevelop.Xml.csproj b/main/src/addins/Xml/MonoDevelop.Xml.csproj index 6b9df37cdd5..ceee29bc0c4 100644 --- a/main/src/addins/Xml/MonoDevelop.Xml.csproj +++ b/main/src/addins/Xml/MonoDevelop.Xml.csproj @@ -16,7 +16,6 @@ - diff --git a/main/src/tools/mdmonitor/gtk-gui/gui.stetic b/main/src/tools/mdmonitor/gtk-gui/gui.stetic index 49446c7ee4b..cee108d72d8 100644 --- a/main/src/tools/mdmonitor/gtk-gui/gui.stetic +++ b/main/src/tools/mdmonitor/gtk-gui/gui.stetic @@ -5,7 +5,6 @@ 2.12 - diff --git a/main/src/tools/mdmonitor/mdmonitor.csproj b/main/src/tools/mdmonitor/mdmonitor.csproj index c97e7c871d8..6d898948014 100644 --- a/main/src/tools/mdmonitor/mdmonitor.csproj +++ b/main/src/tools/mdmonitor/mdmonitor.csproj @@ -19,7 +19,6 @@ - diff --git a/main/tests/test-projects/ContactBook/ContactBook/ContactBook.csproj b/main/tests/test-projects/ContactBook/ContactBook/ContactBook.csproj index 2ddfce2f46e..f39d92a663d 100644 --- a/main/tests/test-projects/ContactBook/ContactBook/ContactBook.csproj +++ b/main/tests/test-projects/ContactBook/ContactBook/ContactBook.csproj @@ -42,7 +42,6 @@ - From 61552748da58c85464f7fdde71c5f8bf5b082192 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Mon, 23 Jul 2018 12:31:28 -0400 Subject: [PATCH 003/382] Port to Gtk#3 --- main/configure.ac | 6 +++--- .../MonoDevelop.FSharp.Gui.csproj | 10 +++++----- .../MonoDevelop.FSharp.Tests.fsproj | 10 +++++----- .../MonoDevelop.FSharp.fsproj | 10 +++++----- .../Templates/FSharpGtkProject.xpt.xml | 10 +++++----- main/src/addins/AspNet/MonoDevelop.AspNet.csproj | 10 +++++----- .../AspNet/Tests/MonoDevelop.AspNet.Tests.csproj | 8 ++++---- .../CSharpBinding/AspNet/CSharpBinding.AspNet.csproj | 10 +++++----- main/src/addins/CSharpBinding/CSharpBinding.csproj | 10 +++++----- .../CSharpBinding/templates/GtkSharp2Project.xpt.xml | 10 +++++----- main/src/addins/ChangeLogAddIn/ChangeLogAddIn.csproj | 10 +++++----- .../MonoDevelop.Deployment.Linux.csproj | 10 +++++----- .../MonoDevelop.Deployment.csproj | 10 +++++----- main/src/addins/GnomePlatform/GnomePlatform.csproj | 10 +++++----- main/src/addins/ILAsmBinding/ILAsmBinding.csproj | 10 +++++----- main/src/addins/MacPlatform/MacPlatform.csproj | 10 +++++----- .../MonoDevelop.AspNetCore.csproj | 8 ++++---- .../MonoDevelop.AssemblyBrowser.csproj | 10 +++++----- .../MonoDevelop.Autotools/MonoDevelop.Autotools.csproj | 10 +++++----- .../MonoDevelop.ConnectedServices.csproj | 10 +++++----- .../MonoDevelop.Debugger.Soft.AspNet.csproj | 10 +++++----- .../MonoDevelop.Debugger.Soft.csproj | 10 +++++----- .../MonoDevelop.Debugger/MonoDevelop.Debugger.csproj | 10 +++++----- .../MonoDevelop.DesignerSupport.csproj | 10 +++++----- .../MonoDevelop.DocFood/MonoDevelop.DocFood.csproj | 10 +++++----- .../MonoDevelop.DotNetCore.csproj | 8 ++++---- .../MonoDevelop.Gettext/MonoDevelop.Gettext.csproj | 10 +++++----- .../MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj | 8 ++++---- .../MonoDevelop.PackageManagement.csproj | 10 +++++----- .../MonoDevelop.Packaging/MonoDevelop.Packaging.csproj | 10 +++++----- .../MonoDevelop.Refactoring.csproj | 10 +++++----- .../MonoDevelop.RegexToolkit.csproj | 10 +++++----- .../MonoDevelop.SourceEditor.csproj | 10 +++++----- .../MonoDevelop.UnitTesting.csproj | 10 +++++----- .../MonoDevelop.WebReferences.csproj | 10 +++++----- .../MonoDeveloperExtensions.csproj | 8 ++++---- .../PerformanceDiagnosticsAddIn.csproj | 6 +++--- .../MonoDevelop.TextTemplating.csproj | 10 +++++----- main/src/addins/VBNetBinding/VBNetBinding.csproj | 10 +++++----- .../VBNetBinding/templates/VBGtkSharp2Project.xpt.xml | 10 +++++----- .../MonoDevelop.VersionControl.Git.Tests.csproj | 4 ++-- .../MonoDevelop.VersionControl.Git.csproj | 8 ++++---- .../MonoDevelop.VersionControl.Subversion.csproj | 10 +++++----- .../MonoDevelop.VersionControl.csproj | 10 +++++----- .../WindowsPlatform/WindowsPlatform.csproj | 8 ++++---- main/src/addins/Xml/MonoDevelop.Xml.csproj | 10 +++++----- main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj | 10 +++++----- .../MonoDevelop.TextEditor.Tests.csproj | 10 +++++----- main/src/tools/mdmonitor/mdmonitor.csproj | 10 +++++----- main/tests/Ide.Tests/MonoDevelop.Ide.Tests.csproj | 6 +++--- main/tests/IdeUnitTests/IdeUnitTests.csproj | 4 ++-- .../MonoDevelop.CSharpBinding.Tests.csproj | 10 +++++----- .../MonoDevelop.Projects/ProjectLoadSaveTests.cs | 2 +- .../MonoDevelop.Refactoring.Tests.csproj | 10 +++++----- main/tests/TestRunner/TestRunner.csproj | 2 +- .../tests/UserInterfaceTests/UserInterfaceTests.csproj | 8 ++++---- .../ContactBook/ContactBook/ContactBook.csproj | 10 +++++----- .../ContactBook/ContactBook/gtk-gui/gui.stetic | 2 +- .../ContactBook/CustomWidgets/CustomWidgets.csproj | 4 ++-- .../ConsoleProject/ConsoleProject.csproj | 2 +- .../ConsoleProject/ConsoleProject.csproj.saved | 2 +- .../MonoDevelop.UserInterfaceTesting.csproj | 2 +- 62 files changed, 263 insertions(+), 263 deletions(-) diff --git a/main/configure.ac b/main/configure.ac index 83277fc177e..330ee80731e 100644 --- a/main/configure.ac +++ b/main/configure.ac @@ -128,12 +128,12 @@ fi dnl hard dependencies MONOADDINS_REQUIRED_VERSION=0.6 -GTKSHARP_REQUIRED_VERSION=2.12.8 +GTKSHARP_REQUIRED_VERSION=3.0 MONODOC_REQUIRED_VERSION=1.0 -PKG_CHECK_MODULES(GLIB_SHARP, glib-sharp-2.0 >= $GTKSHARP_REQUIRED_VERSION) +PKG_CHECK_MODULES(GLIB_SHARP, glib-sharp-3.0 >= $GTKSHARP_REQUIRED_VERSION) AC_SUBST(GLIB_SHARP_LIBS) -PKG_CHECK_MODULES(GTK_SHARP, gtk-sharp-2.0 >= $GTKSHARP_REQUIRED_VERSION) +PKG_CHECK_MODULES(GTK_SHARP, gtk-sharp-3.0 >= $GTKSHARP_REQUIRED_VERSION) AC_SUBST(GTK_SHARP_LIBS) PKG_CHECK_MODULES(MONODOC, monodoc >= $MONODOC_REQUIRED_VERSION) diff --git a/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/MonoDevelop.FSharp.Gui.csproj b/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/MonoDevelop.FSharp.Gui.csproj index 7cefc3189a0..59878cdd4c2 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/MonoDevelop.FSharp.Gui.csproj +++ b/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/MonoDevelop.FSharp.Gui.csproj @@ -38,11 +38,11 @@ - - - - - + + + + + diff --git a/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/MonoDevelop.FSharp.Tests.fsproj b/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/MonoDevelop.FSharp.Tests.fsproj index 6bb0846701a..6e0beed918c 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/MonoDevelop.FSharp.Tests.fsproj +++ b/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/MonoDevelop.FSharp.Tests.fsproj @@ -50,11 +50,11 @@ --publicsign - - - - - + + + + + diff --git a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.fsproj b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.fsproj index a9f034e2ce9..79cbca75e1e 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.fsproj +++ b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.fsproj @@ -126,11 +126,11 @@ - - - - - + + + + + diff --git a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/FSharpGtkProject.xpt.xml b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/FSharpGtkProject.xpt.xml index d44e6de1274..b6fef009ca0 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/FSharpGtkProject.xpt.xml +++ b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/FSharpGtkProject.xpt.xml @@ -28,11 +28,11 @@ - - - - - + + + + + diff --git a/main/src/addins/AspNet/MonoDevelop.AspNet.csproj b/main/src/addins/AspNet/MonoDevelop.AspNet.csproj index 294cc4bc289..69650cb7962 100644 --- a/main/src/addins/AspNet/MonoDevelop.AspNet.csproj +++ b/main/src/addins/AspNet/MonoDevelop.AspNet.csproj @@ -137,11 +137,11 @@ - - - - - + + + + + diff --git a/main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj b/main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj index 876ac5072f8..a22ba88105e 100644 --- a/main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj +++ b/main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj @@ -13,10 +13,10 @@ - - - - + + + + ..\..\..\..\build\bin\System.Reflection.Metadata.dll False diff --git a/main/src/addins/CSharpBinding/AspNet/CSharpBinding.AspNet.csproj b/main/src/addins/CSharpBinding/AspNet/CSharpBinding.AspNet.csproj index 82d29ecca99..e77a90ebdff 100644 --- a/main/src/addins/CSharpBinding/AspNet/CSharpBinding.AspNet.csproj +++ b/main/src/addins/CSharpBinding/AspNet/CSharpBinding.AspNet.csproj @@ -13,12 +13,12 @@ - - - - + + + + - + diff --git a/main/src/addins/CSharpBinding/CSharpBinding.csproj b/main/src/addins/CSharpBinding/CSharpBinding.csproj index 56f03b1dbf0..41ff2ada6d9 100644 --- a/main/src/addins/CSharpBinding/CSharpBinding.csproj +++ b/main/src/addins/CSharpBinding/CSharpBinding.csproj @@ -90,11 +90,11 @@ ..\..\..\packages\ICSharpCode.Decompiler.3.0.0.3403-beta4\lib\net46\ICSharpCode.Decompiler.dll false - - - - - + + + + + diff --git a/main/src/addins/CSharpBinding/templates/GtkSharp2Project.xpt.xml b/main/src/addins/CSharpBinding/templates/GtkSharp2Project.xpt.xml index 1a6f363c0ce..7da317572fb 100644 --- a/main/src/addins/CSharpBinding/templates/GtkSharp2Project.xpt.xml +++ b/main/src/addins/CSharpBinding/templates/GtkSharp2Project.xpt.xml @@ -31,11 +31,11 @@ - - - - - + + + + + diff --git a/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.csproj b/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.csproj index b6a2f0e20f9..05f68d0f4a6 100644 --- a/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.csproj +++ b/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.csproj @@ -59,11 +59,11 @@ - - - - - + + + + + diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.csproj b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.csproj index 73312e8aa57..778f2a5d270 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.csproj +++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.csproj @@ -42,11 +42,11 @@ - - - - - + + + + + diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj index d50e0b90f66..c2905003642 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj @@ -15,11 +15,11 @@ - - - - - + + + + + ..\..\..\..\packages\JetBrains.SharpZipLib.Stripped.0.87.20170615.10\lib\net40\ICSharpCode.SharpZipLib.dll False diff --git a/main/src/addins/GnomePlatform/GnomePlatform.csproj b/main/src/addins/GnomePlatform/GnomePlatform.csproj index c7c74ea572b..9cc68f2b9c3 100644 --- a/main/src/addins/GnomePlatform/GnomePlatform.csproj +++ b/main/src/addins/GnomePlatform/GnomePlatform.csproj @@ -10,12 +10,12 @@ - - - - + + + + - + diff --git a/main/src/addins/ILAsmBinding/ILAsmBinding.csproj b/main/src/addins/ILAsmBinding/ILAsmBinding.csproj index eadfb16e3cd..fe6663a7e92 100644 --- a/main/src/addins/ILAsmBinding/ILAsmBinding.csproj +++ b/main/src/addins/ILAsmBinding/ILAsmBinding.csproj @@ -12,11 +12,11 @@ - - - - - + + + + + diff --git a/main/src/addins/MacPlatform/MacPlatform.csproj b/main/src/addins/MacPlatform/MacPlatform.csproj index c727dff3c7d..c625bd53c81 100644 --- a/main/src/addins/MacPlatform/MacPlatform.csproj +++ b/main/src/addins/MacPlatform/MacPlatform.csproj @@ -13,11 +13,11 @@ - - - - - + + + + + diff --git a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.csproj b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.csproj index dfea01c7510..36fefef4341 100644 --- a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.csproj +++ b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.csproj @@ -14,10 +14,10 @@ - - - - + + + + diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.csproj b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.csproj index d9e34e818aa..079adaf4927 100644 --- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.csproj +++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.csproj @@ -17,11 +17,11 @@ ..\..\..\packages\ICSharpCode.Decompiler.3.0.0.3403-beta4\lib\net46\ICSharpCode.Decompiler.dll false - - - - - + + + + + diff --git a/main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.csproj b/main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.csproj index 51ca8d67530..2c3a1509780 100644 --- a/main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.csproj +++ b/main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.csproj @@ -39,11 +39,11 @@ - - - - - + + + + + ..\..\..\build\bin\System.Collections.Immutable.dll diff --git a/main/src/addins/MonoDevelop.ConnectedServices/MonoDevelop.ConnectedServices.csproj b/main/src/addins/MonoDevelop.ConnectedServices/MonoDevelop.ConnectedServices.csproj index 633c9ce62ab..9140a288611 100644 --- a/main/src/addins/MonoDevelop.ConnectedServices/MonoDevelop.ConnectedServices.csproj +++ b/main/src/addins/MonoDevelop.ConnectedServices/MonoDevelop.ConnectedServices.csproj @@ -12,12 +12,12 @@ - - - - + + + + - + ..\..\..\build\bin\System.Collections.Immutable.dll False diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/MonoDevelop.Debugger.Soft.AspNet.csproj b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/MonoDevelop.Debugger.Soft.AspNet.csproj index c7e1895f35c..95314624bb6 100644 --- a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/MonoDevelop.Debugger.Soft.AspNet.csproj +++ b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/MonoDevelop.Debugger.Soft.AspNet.csproj @@ -12,11 +12,11 @@ - - - - - + + + + + diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj index 5973b076489..8b6ba5c56c5 100644 --- a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj +++ b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj @@ -12,11 +12,11 @@ - - - - - + + + + + ..\..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.dll False diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj index 50fc4d428d0..aed5919b873 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj @@ -14,13 +14,13 @@ - - - - + + + + - + diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj index 7d7004514d0..b06b9efb42a 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj @@ -17,11 +17,11 @@ - - - - - + + + + + diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.csproj b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.csproj index ffa5d6ec22d..4f39a24c00e 100644 --- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.csproj +++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.csproj @@ -11,14 +11,14 @@ - - - + + + - - + + ..\..\..\build\bin\System.Reflection.Metadata.dll False diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj index bf733362659..985aea18161 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj @@ -24,10 +24,10 @@ - - - - + + + + ..\..\..\external\nuget-binary\NuGet.Versioning.dll False diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj index f5a813e393d..9b63d060866 100644 --- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj +++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj @@ -13,11 +13,11 @@ - - - - - + + + + + ..\..\..\build\bin\System.Reflection.Metadata.dll diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj index 36f1b72c749..ca1a7b73569 100644 --- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj +++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj @@ -16,10 +16,10 @@ - - - - + + + + diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj index e35250bc299..d415d1e320c 100644 --- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj +++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj @@ -12,14 +12,14 @@ - + - - - - + + + + diff --git a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.csproj b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.csproj index 727c825b47c..744b4763479 100644 --- a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.csproj +++ b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.csproj @@ -12,10 +12,10 @@ - - - - + + + + ..\..\..\external\nuget-binary\NuGet.Protocol.dll @@ -37,7 +37,7 @@ ..\..\..\external\nuget-binary\NuGet.Versioning.dll False - + ..\..\..\external\nuget-binary\NuGet.PackageManagement.dll diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj index 413f7a379f8..9cfeb735588 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj @@ -13,12 +13,12 @@ - - + + - - - + + + diff --git a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj index ff1d0cc4163..9c1636b9cc4 100644 --- a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj +++ b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj @@ -16,11 +16,11 @@ - - - - - + + + + + ..\..\..\build\bin\Microsoft.CodeAnalysis.CSharp.dll False diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj index d5126cc618b..e8e9ddafbc9 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj @@ -75,11 +75,11 @@ - - - - - + + + + + diff --git a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj index c5add05c2d5..a84737f1423 100644 --- a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj +++ b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj @@ -12,11 +12,11 @@ - - - - - + + + + + diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj index 846dfd37db4..0c8c37d86d6 100644 --- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj +++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj @@ -15,11 +15,11 @@ - - - - - + + + + + diff --git a/main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.csproj b/main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.csproj index 01b4f0315e5..1952c50cd92 100644 --- a/main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.csproj +++ b/main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.csproj @@ -29,10 +29,10 @@ - - - - + + + + diff --git a/main/src/addins/PerformanceDiagnostics/PerformanceDiagnostics/PerformanceDiagnosticsAddIn.csproj b/main/src/addins/PerformanceDiagnostics/PerformanceDiagnostics/PerformanceDiagnosticsAddIn.csproj index 33113800771..102b4fc2e87 100644 --- a/main/src/addins/PerformanceDiagnostics/PerformanceDiagnostics/PerformanceDiagnosticsAddIn.csproj +++ b/main/src/addins/PerformanceDiagnostics/PerformanceDiagnostics/PerformanceDiagnosticsAddIn.csproj @@ -11,9 +11,9 @@ - - - + + + ..\..\..\..\external\Xamarin.Mac.dll False diff --git a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/MonoDevelop.TextTemplating.csproj b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/MonoDevelop.TextTemplating.csproj index e7cc5eb2efc..52387faeb02 100644 --- a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/MonoDevelop.TextTemplating.csproj +++ b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/MonoDevelop.TextTemplating.csproj @@ -30,11 +30,11 @@ - - - - - + + + + + diff --git a/main/src/addins/VBNetBinding/VBNetBinding.csproj b/main/src/addins/VBNetBinding/VBNetBinding.csproj index a0043f6a8c7..da3b5aefbff 100644 --- a/main/src/addins/VBNetBinding/VBNetBinding.csproj +++ b/main/src/addins/VBNetBinding/VBNetBinding.csproj @@ -38,11 +38,11 @@ - - - - - + + + + + ..\..\..\build\bin\Microsoft.CodeAnalysis.VisualBasic.dll diff --git a/main/src/addins/VBNetBinding/templates/VBGtkSharp2Project.xpt.xml b/main/src/addins/VBNetBinding/templates/VBGtkSharp2Project.xpt.xml index 333f922f6bd..4bdffa46034 100644 --- a/main/src/addins/VBNetBinding/templates/VBGtkSharp2Project.xpt.xml +++ b/main/src/addins/VBNetBinding/templates/VBGtkSharp2Project.xpt.xml @@ -31,11 +31,11 @@ - - - - - + + + + + diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj index 0b7149aa3bf..cd360d2199c 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj @@ -21,8 +21,8 @@ - - + + diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj index 114e115ec57..9d5713348ce 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj @@ -17,10 +17,10 @@ - - - - + + + + diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj index 0721707ba8b..25ef448920a 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj @@ -50,11 +50,11 @@ - - - - - + + + + + diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj index c6a7a8e22c1..e32d9c101e5 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj @@ -61,11 +61,11 @@ - - - - - + + + + + diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj index 36e50fd67ab..694dad8f214 100644 --- a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj +++ b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj @@ -10,10 +10,10 @@ - - - - + + + + diff --git a/main/src/addins/Xml/MonoDevelop.Xml.csproj b/main/src/addins/Xml/MonoDevelop.Xml.csproj index ceee29bc0c4..0bcaaa97764 100644 --- a/main/src/addins/Xml/MonoDevelop.Xml.csproj +++ b/main/src/addins/Xml/MonoDevelop.Xml.csproj @@ -16,11 +16,11 @@ - - - - - + + + + + ..\..\..\build\bin\Microsoft.CodeAnalysis.dll diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj index 5d77650939a..babde514bb9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj @@ -21,11 +21,11 @@ - - - - - + + + + + ..\..\..\packages\JetBrains.SharpZipLib.Stripped.0.87.20170615.10\lib\net40\ICSharpCode.SharpZipLib.dll diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj b/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj index d8af16ef6e3..c47c4cc8ecf 100644 --- a/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj +++ b/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj @@ -17,11 +17,11 @@ - - - + + + - + @@ -82,4 +82,4 @@ - \ No newline at end of file + diff --git a/main/src/tools/mdmonitor/mdmonitor.csproj b/main/src/tools/mdmonitor/mdmonitor.csproj index 6d898948014..6a1cb39daaf 100644 --- a/main/src/tools/mdmonitor/mdmonitor.csproj +++ b/main/src/tools/mdmonitor/mdmonitor.csproj @@ -16,11 +16,11 @@ - - - - - + + + + + diff --git a/main/tests/Ide.Tests/MonoDevelop.Ide.Tests.csproj b/main/tests/Ide.Tests/MonoDevelop.Ide.Tests.csproj index 4bd8a7f984f..66f15887c39 100644 --- a/main/tests/Ide.Tests/MonoDevelop.Ide.Tests.csproj +++ b/main/tests/Ide.Tests/MonoDevelop.Ide.Tests.csproj @@ -15,10 +15,10 @@ - + - - + + ..\..\build\bin\Microsoft.CodeAnalysis.dll False diff --git a/main/tests/IdeUnitTests/IdeUnitTests.csproj b/main/tests/IdeUnitTests/IdeUnitTests.csproj index 72d4f06ba62..e910798fce5 100644 --- a/main/tests/IdeUnitTests/IdeUnitTests.csproj +++ b/main/tests/IdeUnitTests/IdeUnitTests.csproj @@ -11,7 +11,7 @@ - + ..\..\packages\Microsoft.VisualStudio.Composition.15.6.36\lib\net45\Microsoft.VisualStudio.Composition.dll @@ -64,4 +64,4 @@ - \ No newline at end of file + diff --git a/main/tests/MonoDevelop.CSharpBinding.Tests/MonoDevelop.CSharpBinding.Tests.csproj b/main/tests/MonoDevelop.CSharpBinding.Tests/MonoDevelop.CSharpBinding.Tests.csproj index 09cb8cd8810..5a78c41d062 100644 --- a/main/tests/MonoDevelop.CSharpBinding.Tests/MonoDevelop.CSharpBinding.Tests.csproj +++ b/main/tests/MonoDevelop.CSharpBinding.Tests/MonoDevelop.CSharpBinding.Tests.csproj @@ -54,11 +54,11 @@ ..\..\build\bin\Microsoft.CodeAnalysis.Features.dll - - - - - + + + + + ..\..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll diff --git a/main/tests/MonoDevelop.Core.Tests/MonoDevelop.Projects/ProjectLoadSaveTests.cs b/main/tests/MonoDevelop.Core.Tests/MonoDevelop.Projects/ProjectLoadSaveTests.cs index bc098e0ba02..cbef7b59fd2 100644 --- a/main/tests/MonoDevelop.Core.Tests/MonoDevelop.Projects/ProjectLoadSaveTests.cs +++ b/main/tests/MonoDevelop.Core.Tests/MonoDevelop.Projects/ProjectLoadSaveTests.cs @@ -1122,7 +1122,7 @@ public async Task AddImportThenRemoveImportAndThenAddImportAgain () [Test] public void LoadReferenceWithSpaces_bug43510 () { - var pref = ProjectReference.CreateAssemblyReference (" gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f"); + var pref = ProjectReference.CreateAssemblyReference (" gtk-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f"); var p = (DotNetProject)Services.ProjectService.CreateProject ("C#"); p.References.Add (pref); Assert.IsTrue (pref.IsValid); diff --git a/main/tests/MonoDevelop.Refactoring.Tests/MonoDevelop.Refactoring.Tests.csproj b/main/tests/MonoDevelop.Refactoring.Tests/MonoDevelop.Refactoring.Tests.csproj index 4cb1a342c3f..bad7568477a 100644 --- a/main/tests/MonoDevelop.Refactoring.Tests/MonoDevelop.Refactoring.Tests.csproj +++ b/main/tests/MonoDevelop.Refactoring.Tests/MonoDevelop.Refactoring.Tests.csproj @@ -66,11 +66,11 @@ False - - - - - + + + + + diff --git a/main/tests/TestRunner/TestRunner.csproj b/main/tests/TestRunner/TestRunner.csproj index 39715e7606a..7bab31b646f 100644 --- a/main/tests/TestRunner/TestRunner.csproj +++ b/main/tests/TestRunner/TestRunner.csproj @@ -11,7 +11,7 @@ - + ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll diff --git a/main/tests/UserInterfaceTests/UserInterfaceTests.csproj b/main/tests/UserInterfaceTests/UserInterfaceTests.csproj index 2b9fc46d735..f8177ccbca0 100644 --- a/main/tests/UserInterfaceTests/UserInterfaceTests.csproj +++ b/main/tests/UserInterfaceTests/UserInterfaceTests.csproj @@ -18,7 +18,7 @@ - + ..\..\packages\NUnit.Runners.2.6.4\tools\lib\nunit.core.dll False @@ -31,9 +31,9 @@ ..\..\packages\NUnit.Runners.2.6.4\tools\lib\nunit.core.interfaces.dll False - - - + + + ..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/main/tests/test-projects/ContactBook/ContactBook/ContactBook.csproj b/main/tests/test-projects/ContactBook/ContactBook/ContactBook.csproj index f39d92a663d..ce9cc6071d5 100644 --- a/main/tests/test-projects/ContactBook/ContactBook/ContactBook.csproj +++ b/main/tests/test-projects/ContactBook/ContactBook/ContactBook.csproj @@ -39,10 +39,10 @@ - - - - + + + + @@ -54,4 +54,4 @@ - \ No newline at end of file + diff --git a/main/tests/test-projects/ContactBook/ContactBook/gtk-gui/gui.stetic b/main/tests/test-projects/ContactBook/ContactBook/gtk-gui/gui.stetic index 35dd4a3892c..4f3159cd9cd 100755 --- a/main/tests/test-projects/ContactBook/ContactBook/gtk-gui/gui.stetic +++ b/main/tests/test-projects/ContactBook/ContactBook/gtk-gui/gui.stetic @@ -5,7 +5,7 @@ 2.4 - + diff --git a/main/tests/test-projects/ContactBook/CustomWidgets/CustomWidgets.csproj b/main/tests/test-projects/ContactBook/CustomWidgets/CustomWidgets.csproj index 9a74e81afc4..95eaf3f0c56 100644 --- a/main/tests/test-projects/ContactBook/CustomWidgets/CustomWidgets.csproj +++ b/main/tests/test-projects/ContactBook/CustomWidgets/CustomWidgets.csproj @@ -44,8 +44,8 @@ - - + + diff --git a/main/tests/test-projects/local-copy-package/ConsoleProject/ConsoleProject.csproj b/main/tests/test-projects/local-copy-package/ConsoleProject/ConsoleProject.csproj index e361974bec3..da7b12d071a 100644 --- a/main/tests/test-projects/local-copy-package/ConsoleProject/ConsoleProject.csproj +++ b/main/tests/test-projects/local-copy-package/ConsoleProject/ConsoleProject.csproj @@ -32,7 +32,7 @@ - + False diff --git a/main/tests/test-projects/local-copy-package/ConsoleProject/ConsoleProject.csproj.saved b/main/tests/test-projects/local-copy-package/ConsoleProject/ConsoleProject.csproj.saved index 25935f76745..5a52f6f9b22 100644 --- a/main/tests/test-projects/local-copy-package/ConsoleProject/ConsoleProject.csproj.saved +++ b/main/tests/test-projects/local-copy-package/ConsoleProject/ConsoleProject.csproj.saved @@ -34,7 +34,7 @@ True - + True diff --git a/main/tests/ui/MonoDevelop.UserInterfaceTesting/MonoDevelop.UserInterfaceTesting.csproj b/main/tests/ui/MonoDevelop.UserInterfaceTesting/MonoDevelop.UserInterfaceTesting.csproj index bc4f2728c95..93b5f7c42c7 100644 --- a/main/tests/ui/MonoDevelop.UserInterfaceTesting/MonoDevelop.UserInterfaceTesting.csproj +++ b/main/tests/ui/MonoDevelop.UserInterfaceTesting/MonoDevelop.UserInterfaceTesting.csproj @@ -34,7 +34,7 @@ ..\..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - + From abca95217388d38d6a2cae3515a6aaa13384dd9a Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Mon, 23 Jul 2018 12:53:43 -0400 Subject: [PATCH 004/382] moop --- main/Main.sln | 15 +++++++++++++-- .../MonoDevelop.SourceEditor.csproj | 7 ++++++- .../core/MonoDevelop.Ide/MonoDevelop.Ide.csproj | 5 +++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/main/Main.sln b/main/Main.sln index a3ebe61dedb..80ab6db9344 100644 --- a/main/Main.sln +++ b/main/Main.sln @@ -182,6 +182,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xwt", "external\xwt\Xwt\Xwt EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xwt.Gtk", "external\xwt\Xwt.Gtk\Xwt.Gtk.csproj", "{C3887A93-B2BD-4097-8E2F-3A063EFF32FD}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xwt.Gtk3", "external\xwt\Xwt.Gtk\Xwt.Gtk3.csproj", "{3B25FD1F-CEBA-4450-8893-DC330FDB56A7}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xwt.WPF", "external\xwt\Xwt.WPF\Xwt.WPF.csproj", "{C93D746E-1586-4D4F-B411-BF5A966E6A08}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xwt.Gtk.Mac", "external\xwt\Xwt.Gtk.Mac\Xwt.Gtk.Mac.csproj", "{E95833C9-90AA-4366-9262-0A1BED148249}" @@ -1186,7 +1188,6 @@ Global {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Debug|Any CPU.Build.0 = Debug|Any CPU {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.DebugGnome|Any CPU.ActiveCfg = Debug|Any CPU - {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.DebugGnome|Any CPU.Build.0 = Debug|Any CPU {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.DebugMac|Any CPU.Build.0 = Debug|Any CPU {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU @@ -1194,11 +1195,20 @@ Global {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Release|Any CPU.ActiveCfg = Release|Any CPU {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.Release|Any CPU.Build.0 = Release|Any CPU {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.ReleaseGnome|Any CPU.ActiveCfg = Release|Any CPU - {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.ReleaseGnome|Any CPU.Build.0 = Release|Any CPU {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.ReleaseWin32|Any CPU.ActiveCfg = Release|Any CPU {C3887A93-B2BD-4097-8E2F-3A063EFF32FD}.ReleaseWin32|Any CPU.Build.0 = Release|Any CPU + {3B25FD1F-CEBA-4450-8893-DC330FDB56A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B25FD1F-CEBA-4450-8893-DC330FDB56A7}.DebugGnome|Any CPU.ActiveCfg = Debug|Any CPU + {3B25FD1F-CEBA-4450-8893-DC330FDB56A7}.DebugGnome|Any CPU.Build.0 = Debug|Any CPU + {3B25FD1F-CEBA-4450-8893-DC330FDB56A7}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {3B25FD1F-CEBA-4450-8893-DC330FDB56A7}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU + {3B25FD1F-CEBA-4450-8893-DC330FDB56A7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B25FD1F-CEBA-4450-8893-DC330FDB56A7}.ReleaseGnome|Any CPU.ActiveCfg = Release|Any CPU + {3B25FD1F-CEBA-4450-8893-DC330FDB56A7}.ReleaseGnome|Any CPU.Build.0 = Release|Any CPU + {3B25FD1F-CEBA-4450-8893-DC330FDB56A7}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {3B25FD1F-CEBA-4450-8893-DC330FDB56A7}.ReleaseWin32|Any CPU.ActiveCfg = Release|Any CPU {C93D746E-1586-4D4F-B411-BF5A966E6A08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C93D746E-1586-4D4F-B411-BF5A966E6A08}.DebugGnome|Any CPU.ActiveCfg = Debug|Any CPU {C93D746E-1586-4D4F-B411-BF5A966E6A08}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU @@ -2116,6 +2126,7 @@ Global {67A32B53-F719-4ECB-B5E1-FD0B04FEE258} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C} {92494904-35FA-4DC9-BDE9-3A3E87AC49D3} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258} {C3887A93-B2BD-4097-8E2F-3A063EFF32FD} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258} + {3B25FD1F-CEBA-4450-8893-DC330FDB56A7} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258} {C93D746E-1586-4D4F-B411-BF5A966E6A08} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258} {E95833C9-90AA-4366-9262-0A1BED148249} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258} {252117CA-0ABB-4F36-BFC8-DE23A8089BB9} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258} diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj index e8e9ddafbc9..f277993b274 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj @@ -55,10 +55,15 @@ Mono.Debugging False - + + + {3B25FD1F-CEBA-4450-8893-DC330FDB56A7} + Xwt.Gtk3 + False diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj index babde514bb9..fabfbc1d25a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj @@ -158,9 +158,14 @@ {92494904-35FA-4DC9-BDE9-3A3E87AC49D3} Xwt + + + {3B25FD1F-CEBA-4450-8893-DC330FDB56A7} + Xwt.Gtk3 {91DD5A2D-9FE3-4C3C-9253-876141874DAD} From 7065835f262c67f0b340533890b82f3b3234e584 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Mon, 23 Jul 2018 12:54:59 -0400 Subject: [PATCH 005/382] moop --- main/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/configure.ac b/main/configure.ac index 330ee80731e..9d252307fe0 100644 --- a/main/configure.ac +++ b/main/configure.ac @@ -128,7 +128,7 @@ fi dnl hard dependencies MONOADDINS_REQUIRED_VERSION=0.6 -GTKSHARP_REQUIRED_VERSION=3.0 +GTKSHARP_REQUIRED_VERSION=2.99.3 MONODOC_REQUIRED_VERSION=1.0 PKG_CHECK_MODULES(GLIB_SHARP, glib-sharp-3.0 >= $GTKSHARP_REQUIRED_VERSION) From 17d164b43b706a5afd1f205da0cf3986c0df60e2 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 26 Jul 2018 14:26:29 -0400 Subject: [PATCH 006/382] current wip --- main/Main.sln | 15 +- ....FSharp.Gui.FSharpCompilerOptionsWidget.cs | 8 +- .../gtk-gui/generated.cs | 32 +- .../DocumentOutlinePad.cs | 36 +- ...op.Ide.CodeTemplates.EditTemplateDialog.cs | 14 +- ...Ide.Execution.CustomExecutionModeDialog.cs | 8 +- ...cution.CustomExecutionModeManagerDialog.cs | 4 +- ...xecution.MonoExecutionParametersPreview.cs | 4 +- ...velop.Ide.FindInFiles.FindInFilesDialog.cs | 12 +- ...de.Gui.Components.ExecutionModeComboBox.cs | 4 +- ...op.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs | 4 +- ...elop.Ide.Gui.Dialogs.MultiMessageDialog.cs | 4 +- ...Ide.Gui.Dialogs.MultiTaskProgressDialog.cs | 4 +- ...Develop.Ide.Gui.Dialogs.NewLayoutDialog.cs | 5 +- ...oDevelop.Ide.Gui.Dialogs.ProgressDialog.cs | 4 +- ....Ide.Gui.Dialogs.SelectFileFormatDialog.cs | 8 +- ....Ide.Gui.OptionPanels.AddInsPanelWidget.cs | 4 +- ...ui.OptionPanels.BuildMessagePanelWidget.cs | 12 +- ...p.Ide.Gui.OptionPanels.BuildPanelWidget.cs | 2 +- ...OptionPanels.IDEStyleOptionsPanelWidget.cs | 8 +- ...p.Ide.Gui.OptionPanels.KeyBindingsPanel.cs | 4 +- ...OptionPanels.TextStylePolicyPanelWidget.cs | 4 +- ...elop.Ide.Projects.AddExternalFileDialog.cs | 6 +- ...oDevelop.Ide.Projects.AddMimeTypeDialog.cs | 4 +- ...oDevelop.Ide.Projects.ApplyPolicyDialog.cs | 10 +- ...Ide.Projects.ConfirmProjectDeleteDialog.cs | 6 +- ...Develop.Ide.Projects.DeleteConfigDialog.cs | 4 +- ....Ide.Projects.ExportProjectPolicyDialog.cs | 6 +- ...velop.Ide.Projects.ExportSolutionDialog.cs | 8 +- ....Ide.Projects.ImportProjectPolicyDialog.cs | 4 +- ...elop.Ide.Projects.IncludeNewFilesDialog.cs | 4 +- ...lop.Ide.Projects.NewConfigurationDialog.cs | 12 +- .../MonoDevelop.Ide.Projects.NewFileDialog.cs | 8 +- ...Develop.Ide.Projects.NewPolicySetDialog.cs | 8 +- ...ojects.OptionPanels.CustomCommandWidget.cs | 4 +- ...els.NamespaceSynchronisationPanelWidget.cs | 2 +- ....OptionPanels.RuntimeOptionsPanelWidget.cs | 4 +- ....Ide.Projects.ProjectFileSelectorDialog.cs | 8 +- ...elop.Ide.Projects.ProjectSelectorDialog.cs | 4 +- ...Develop.Ide.Projects.RenameConfigDialog.cs | 4 +- ...elop.Ide.Projects.SelectReferenceDialog.cs | 4 +- .../MonoDevelop.Ide.SelectEncodingsDialog.cs | 4 +- .../src/core/MonoDevelop.Ide/Gui/generated.cs | 28 +- .../AtkCocoaHelper.cs | 50 +- .../GtkTreeModelResult.cs | 8 +- .../GtkWidgetResult.cs | 44 +- .../BasicChart.cs | 660 +- .../CommandCheckMenuItem.cs | 4 +- .../CommandMenu.cs | 10 +- .../CommandMenuBar.cs | 22 +- .../CommandMenuItem.cs | 4 +- .../PlaceholderWindow.cs | 24 +- .../TabStrip.cs | 63 +- .../AutoHideBox.cs | 41 +- .../MonoDevelop.Components.Docking/DockBar.cs | 83 +- .../DockBarItem.cs | 108 +- .../DockContainer.cs | 50 +- .../DockFrame.cs | 35 +- .../DockGroup.cs | 12 +- .../DockItemContainer.cs | 216 +- .../DockItemTitleTab.cs | 187 +- .../PlaceholderWindow.cs | 64 +- .../TabStrip.cs | 24 +- .../TextQuestionDialog.cs | 6 +- .../ButtonBar.cs | 85 +- .../MainToolbar.cs | 140 +- .../RoundButton.cs | 46 +- .../StatusArea.cs | 80 +- .../StyledProgressBar.cs | 36 +- .../BooleanEditorCell.cs | 32 +- .../CollectionEditor.cs | 121 +- .../ColorEditorCell.cs | 62 +- .../EnumerationEditorCell.cs | 8 +- .../EventEditor.cs | 158 +- .../FlagsEditorCell.cs | 78 +- .../FlagsSelectorDialog.cs | 2 +- .../PropertyTextEditor.cs | 8 +- .../TextEditorDialog.cs | 2 +- .../PropertyEditorCell.cs | 50 +- .../PropertyGrid.cs | 2 +- .../PropertyGridTable.cs | 54 +- .../GtkTheme.cs | 2 +- .../CellRendererComboBox.cs | 40 +- .../CellRendererImage.cs | 68 +- .../CompactScrolledWindow.cs | 145 +- .../ContextMenuExtensionsGtk.cs | 22 +- .../ContextMenuTreeView.cs | 4 +- .../MonoDevelop.Components/DropDownBox.cs | 158 +- .../DropDownBoxListWindow.cs | 76 +- .../MonoDevelop.Components/ExtendedLabel.cs | 84 +- .../FixedWidthWrapLabel.cs | 42 +- .../MonoDevelop.Components/GtkGestures.cs | 12 +- .../MonoDevelop.Components/GtkUtil.cs | 114 +- .../MonoDevelop.Components/GtkWorkarounds.cs | 50 +- .../MonoDevelop.Components/HPanedThin.cs | 34 +- .../MonoDevelop.Components/HeaderBox.cs | 174 +- .../HoverImageButton.cs | 22 +- .../MonoDevelop.Components/HslColor.cs | 8 +- .../MonoDevelop.Components/ImageButton.cs | 18 +- .../MonoDevelop.Components/ImageView.cs | 51 +- .../MonoDevelop.Components/InfoBar.cs | 12 +- .../MonoDevelop.Components/MenuButton.cs | 6 +- .../MonoDevelop.Components/MenuButtonEntry.cs | 6 +- .../MonoDevelop.Components/PathBar.cs | 322 +- .../MonoDevelop.Components/PopoverWidget.cs | 80 +- .../MonoDevelop.Components/PopoverWindow.cs | 125 +- .../MonoDevelop.Components/RoundedFrame.cs | 69 +- .../MonoDevelop.Components/SearchEntry.cs | 162 +- .../MonoDevelop.Components/SectionList.cs | 212 +- .../MonoDevelop.Components/TabLabel.cs | 2 +- .../MonoDevelop.Components/Tabstrip.cs | 61 +- .../MonoDevelop.Components/TooltipWindow.cs | 21 +- .../TreeViewCellContainer.cs | 23 +- .../MonoDevelop.Components/VPanedThin.cs | 28 +- .../ListWidget.cs | 441 +- .../TooltipInformationWindow.cs | 14 +- .../CodeTemplatePanel.cs | 4 +- .../EditTemplateDialog.cs | 2 +- .../MonoDevelop.Ide.Commands/EditCommands.cs | 26 +- .../ChunkStyle.cs | 16 +- .../ExternalToolPanel.cs | 12 +- .../FindInFilesDialog.cs | 24 +- .../SearchResultWidget.cs | 24 +- .../ExecutionModeComboBox.cs | 2 +- .../ExtensibleTreeView.cs | 5756 ++++++++--------- .../PadTreeView.cs | 4 +- .../TreeBuilder.cs | 2 +- .../CommonAboutDialog.cs | 6 +- .../DirtyFilesDialog.cs | 16 +- .../FeedbackDialog.cs | 134 +- .../FileSelectorDialog.cs | 31 +- .../GtkAlertDialog.cs | 6 +- .../MimeTypePolicyOptionsSection.cs | 7 +- .../MultiConfigItemOptionsPanel.cs | 4 +- .../OptionsDialog.cs | 10 +- .../PolicyOptionsPanel.cs | 2 +- .../ProgressDialog.cs | 2 +- .../SelectEncodingsDialog.cs | 8 +- .../MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs | 2 +- .../VersionInformationTabPage.cs | 2 +- .../KeyBindingsPanel.cs | 176 +- .../SdkLocationPanel.cs | 4 +- .../TasksOptionsPanel.cs | 12 +- .../FolderNodeBuilder.cs | 4 +- .../MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs | 80 +- .../MonodocTreePad.cs | 12 +- .../MonoDevelop.Ide.Gui/DocumentSwitcher.cs | 274 +- .../MonoDevelop.Ide.Gui/DocumentToolbar.cs | 30 +- .../MonoDevelopStatusBar.cs | 30 +- .../MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs | 2 +- .../MonoDevelop.Ide.Gui/ToolbarComboBox.cs | 6 +- .../MonoDevelop.Ide.Gui/WorkbenchWindow.cs | 13 +- .../CodeAnalysisPanel.cs | 2 +- .../CodeFormattingPanel.cs | 8 +- .../CombineConfigurationPanel.cs | 2 +- .../CustomCommandWidget.cs | 7 +- .../PortableRuntimeOptionsPanel.cs | 16 +- .../PortableRuntimeSelectorDialog.cs | 10 +- .../SolutionItemConfigurationsPanel.cs | 6 +- .../AddExternalFileDialog.cs | 2 +- .../MonoDevelop.Ide.Projects/AddFileDialog.cs | 6 +- .../ApplyPolicyDialog.cs | 48 +- .../AssemblyReferencePanel.cs | 2 +- .../DefaultPolicyOptionsDialog.cs | 10 +- .../GtkNewProjectDialogBackend.UI.cs | 67 +- .../GtkNewProjectDialogBackend.cs | 132 +- .../GtkProjectConfigurationWidget.cs | 2 +- .../GtkProjectFolderPreviewWidget.cs | 6 +- .../GtkTemplateCategoryCellRenderer.cs | 104 +- .../GtkTemplateCellRenderer.cs | 136 +- .../LanguageCellRenderer.cs | 150 +- .../MonoDevelop.Ide.Projects/NewFileDialog.cs | 4 +- .../PackageReferencePanel.cs | 184 +- .../ProjectFileSelectorDialog.cs | 8 +- .../ProjectReferencePanel.cs | 2 +- .../SelectReferenceDialog.cs | 10 +- .../TemplatePickerWidget.cs | 6 +- .../MonoDevelop.Ide.Tasks/CommentTasksView.cs | 2 +- .../MonoDevelop.Ide.Tasks/UserTasksView.cs | 2 +- .../AddinsUpdateHandler.cs | 2 +- .../DefaultWelcomePage.cs | 2 +- .../WelcomePageBarButton.cs | 2 +- .../WelcomePageColumn.cs | 6 +- .../WelcomePageFirstRun.cs | 64 +- .../WelcomePageListButton.cs | 110 +- .../WelcomePageRow.cs | 6 +- .../WelcomePageSection.cs | 66 +- .../WelcomePageWidget.cs | 64 +- .../MonoDevelop.Ide/MonoDevelop.Ide.csproj | 33 +- .../MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs | 22 +- 190 files changed, 7023 insertions(+), 6762 deletions(-) diff --git a/main/Main.sln b/main/Main.sln index 80ab6db9344..a2a1fb3d045 100644 --- a/main/Main.sln +++ b/main/Main.sln @@ -200,6 +200,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Addins.CecilReflector" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Addins.Gui", "external\mono-addins\Mono.Addins.Gui\Mono.Addins.Gui.csproj", "{FEC19BDA-4904-4005-8C09-68E82E8BEF6A}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Addins.GuiGtk3", "external\mono-addins\Mono.Addins.GuiGtk3\Mono.Addins.GuiGtk3.csproj", "{410A7DC9-E7DA-43E6-B592-93E2A344B660}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Addins.Setup", "external\mono-addins\Mono.Addins.Setup\Mono.Addins.Setup.csproj", "{A85C9721-C054-4BD8-A1F3-0227615F0A36}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NRefactory", "NRefactory", "{2D711139-8765-4929-BC7A-AA2DEE6F615D}" @@ -1284,7 +1286,6 @@ Global {FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.Debug|Any CPU.Build.0 = Debug|Any CPU {FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.DebugGnome|Any CPU.ActiveCfg = Debug|Any CPU - {FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.DebugGnome|Any CPU.Build.0 = Debug|Any CPU {FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU {FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.DebugMac|Any CPU.Build.0 = Debug|Any CPU {FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU @@ -1292,11 +1293,20 @@ Global {FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.Release|Any CPU.ActiveCfg = Release|Any CPU {FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.Release|Any CPU.Build.0 = Release|Any CPU {FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.ReleaseGnome|Any CPU.ActiveCfg = Release|Any CPU - {FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.ReleaseGnome|Any CPU.Build.0 = Release|Any CPU {FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU {FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.ReleaseMac|Any CPU.Build.0 = Release|Any CPU {FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.ReleaseWin32|Any CPU.ActiveCfg = Release|Any CPU {FEC19BDA-4904-4005-8C09-68E82E8BEF6A}.ReleaseWin32|Any CPU.Build.0 = Release|Any CPU + {410A7DC9-E7DA-43E6-B592-93E2A344B660}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {410A7DC9-E7DA-43E6-B592-93E2A344B660}.DebugGnome|Any CPU.ActiveCfg = Debug|Any CPU + {410A7DC9-E7DA-43E6-B592-93E2A344B660}.DebugGnome|Any CPU.Build.0 = Debug|Any CPU + {410A7DC9-E7DA-43E6-B592-93E2A344B660}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + {410A7DC9-E7DA-43E6-B592-93E2A344B660}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU + {410A7DC9-E7DA-43E6-B592-93E2A344B660}.Release|Any CPU.ActiveCfg = Release|Any CPU + {410A7DC9-E7DA-43E6-B592-93E2A344B660}.ReleaseGnome|Any CPU.ActiveCfg = Release|Any CPU + {410A7DC9-E7DA-43E6-B592-93E2A344B660}.ReleaseGnome|Any CPU.Build.0 = Release|Any CPU + {410A7DC9-E7DA-43E6-B592-93E2A344B660}.ReleaseMac|Any CPU.ActiveCfg = Release|Any CPU + {410A7DC9-E7DA-43E6-B592-93E2A344B660}.ReleaseWin32|Any CPU.ActiveCfg = Release|Any CPU {A85C9721-C054-4BD8-A1F3-0227615F0A36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A85C9721-C054-4BD8-A1F3-0227615F0A36}.Debug|Any CPU.Build.0 = Debug|Any CPU {A85C9721-C054-4BD8-A1F3-0227615F0A36}.DebugGnome|Any CPU.ActiveCfg = Debug|Any CPU @@ -2135,6 +2145,7 @@ Global {91DD5A2D-9FE3-4C3C-9253-876141874DAD} = {B8897B76-1A12-4DFA-8B60-7944CC4C9654} {42D1CE65-A14B-4218-B787-58AD7AA68513} = {B8897B76-1A12-4DFA-8B60-7944CC4C9654} {FEC19BDA-4904-4005-8C09-68E82E8BEF6A} = {B8897B76-1A12-4DFA-8B60-7944CC4C9654} + {410A7DC9-E7DA-43E6-B592-93E2A344B660} = {B8897B76-1A12-4DFA-8B60-7944CC4C9654} {A85C9721-C054-4BD8-A1F3-0227615F0A36} = {B8897B76-1A12-4DFA-8B60-7944CC4C9654} {2D711139-8765-4929-BC7A-AA2DEE6F615D} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C} {3B2A5653-EC97-4001-BB9B-D90F1AF2C371} = {2D711139-8765-4929-BC7A-AA2DEE6F615D} diff --git a/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/gtk-gui/MonoDevelop.FSharp.Gui.FSharpCompilerOptionsWidget.cs b/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/gtk-gui/MonoDevelop.FSharp.Gui.FSharpCompilerOptionsWidget.cs index 451c2c7b0f3..5f95167f4f3 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/gtk-gui/MonoDevelop.FSharp.Gui.FSharpCompilerOptionsWidget.cs +++ b/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/gtk-gui/MonoDevelop.FSharp.Gui.FSharpCompilerOptionsWidget.cs @@ -28,11 +28,11 @@ public partial class FSharpCompilerOptionsWidget private global::Gtk.HBox hbox2; - private global::Gtk.ComboBox comboDebug; + private global::Gtk.ComboBoxText comboDebug; private global::Gtk.HBox hbox6; - private global::Gtk.ComboBox comboPlatforms; + private global::Gtk.ComboBoxText comboPlatforms; private global::Gtk.Label label1; @@ -181,7 +181,7 @@ protected virtual void Build() this.hbox2.Name = "hbox2"; this.hbox2.Spacing = 6; // Container child hbox2.Gtk.Box+BoxChild - this.comboDebug = global::Gtk.ComboBox.NewText(); + this.comboDebug = new global::Gtk.ComboBoxText(); this.comboDebug.AppendText(global::Mono.Unix.Catalog.GetString("Full")); this.comboDebug.AppendText(global::Mono.Unix.Catalog.GetString("Symbols only")); this.comboDebug.AppendText(global::Mono.Unix.Catalog.GetString("None")); @@ -205,7 +205,7 @@ protected virtual void Build() this.hbox6.Name = "hbox6"; this.hbox6.Spacing = 6; // Container child hbox6.Gtk.Box+BoxChild - this.comboPlatforms = global::Gtk.ComboBox.NewText(); + this.comboPlatforms = new global::Gtk.ComboBoxText(); this.comboPlatforms.AppendText(global::Mono.Unix.Catalog.GetString("Any CPU")); this.comboPlatforms.AppendText(global::Mono.Unix.Catalog.GetString("x86")); this.comboPlatforms.AppendText(global::Mono.Unix.Catalog.GetString("x64")); diff --git a/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/gtk-gui/generated.cs b/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/gtk-gui/generated.cs index 453751b36af..85b8ce0d5f7 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/gtk-gui/generated.cs +++ b/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/gtk-gui/generated.cs @@ -24,27 +24,27 @@ internal class BinContainer public static BinContainer Attach(Gtk.Bin bin) { BinContainer bc = new BinContainer(); - bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested); - bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated); +// bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested); +// bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated); bin.Added += new Gtk.AddedHandler(bc.OnAdded); return bc; } - private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args) - { - if ((this.child != null)) - { - args.Requisition = this.child.SizeRequest(); - } - } +// private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args) +// { +// if ((this.child != null)) +// { +// args.Requisition = this.child.SizeRequest(); +// } +// } - private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args) - { - if ((this.child != null)) - { - this.child.Allocation = args.Allocation; - } - } +// private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args) +// { +// if ((this.child != null)) +// { +// this.child.Allocation = args.Allocation; +// } +// } private void OnAdded(object sender, Gtk.AddedArgs args) { diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs index b86f6f6ac12..d2ff1ca73f2 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs @@ -207,16 +207,16 @@ void UpdateLayout () layout.SetText (text); } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - if (evnt.Window != GdkWindow || layout == null) { - return base.OnExposeEvent (evnt); - } - layout.Width = (int)(Allocation.Width * 2 / 3 * Pango.Scale.PangoScale); - Gtk.Style.PaintLayout (Style, GdkWindow, State, false, evnt.Area, - this, null, Allocation.Width * 1 / 6 + Allocation.X , 12 + Allocation.Y, layout); - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// if (evnt.Window != GdkWindow || layout == null) { +// return base.OnExposeEvent (evnt); +// } +// layout.Width = (int)(Allocation.Width * 2 / 3 * Pango.Scale.PangoScale); +// Gtk.Style.PaintLayout (Style, GdkWindow, State, false, evnt.Area, +// this, null, Allocation.Width * 1 / 6 + Allocation.X , 12 + Allocation.Y, layout); +// return true; +// } protected override void OnStyleSet (Gtk.Style previous_style) { @@ -225,14 +225,14 @@ protected override void OnStyleSet (Gtk.Style previous_style) base.OnStyleSet (previous_style); } - public override void Dispose () - { - if (layout != null) { - layout.Dispose (); - layout = null; - } - base.Dispose (); - } +// public override void Dispose () +// { +// if (layout != null) { +// layout.Dispose (); +// layout = null; +// } +// base.Dispose (); +// } } } } \ No newline at end of file diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs index 4b96942a6d0..d96647117d3 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs @@ -9,11 +9,11 @@ partial class EditTemplateDialog private global::Gtk.HBox hbox1; private global::Gtk.Entry entryDescription; private global::Gtk.Label label2; - private global::Gtk.ComboBoxEntry comboboxentryMime; + private global::Gtk.ComboBoxText comboboxentryMime; private global::Gtk.HBox hbox2; private global::Gtk.Entry entryShortcut1; private global::Gtk.Label label5; - private global::Gtk.ComboBoxEntry comboboxentryGroups; + private global::Gtk.ComboBoxText comboboxentryGroups; private global::Gtk.HBox hbox5; private global::Gtk.CheckButton checkbuttonExpansion; private global::Gtk.CheckButton checkbuttonSurroundWith; @@ -43,7 +43,7 @@ protected virtual void Build () this.SkipPagerHint = true; this.SkipTaskbarHint = true; // Internal child MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.Spacing = 6; w1.BorderWidth = ((uint)(2)); @@ -87,7 +87,7 @@ protected virtual void Build () w3.Expand = false; w3.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.comboboxentryMime = global::Gtk.ComboBoxEntry.NewText (); + this.comboboxentryMime = new Gtk.ComboBoxText (); this.comboboxentryMime.Name = "comboboxentryMime"; this.hbox1.Add (this.comboboxentryMime); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.comboboxentryMime])); @@ -127,7 +127,7 @@ protected virtual void Build () w7.Expand = false; w7.Fill = false; // Container child hbox2.Gtk.Box+BoxChild - this.comboboxentryGroups = global::Gtk.ComboBoxEntry.NewText (); + this.comboboxentryGroups = new Gtk.ComboBoxText (); this.comboboxentryGroups.Name = "comboboxentryGroups"; this.hbox2.Add (this.comboboxentryGroups); global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.comboboxentryGroups])); @@ -259,7 +259,7 @@ protected virtual void Build () this.vbox4.Name = "vbox4"; this.vbox4.Spacing = 6; // Container child vbox4.Gtk.Box+BoxChild - this.comboboxVariables = global::Gtk.ComboBox.NewText (); + this.comboboxVariables = new global::Gtk.ComboBoxText (); this.comboboxVariables.Name = "comboboxVariables"; this.vbox4.Add (this.comboboxVariables); global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.comboboxVariables])); @@ -284,7 +284,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(w1 [this.hpaned1])); w27.Position = 0; // Internal child MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.ActionArea - global::Gtk.HButtonBox w28 = this.ActionArea; + global::Gtk.HButtonBox w28 = (Gtk.HButtonBox)this.ActionArea; w28.Name = "dialog1_ActionArea"; w28.Spacing = 6; w28.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.CustomExecutionModeDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.CustomExecutionModeDialog.cs index 56209bd3dec..69f27fe1f05 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.CustomExecutionModeDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.CustomExecutionModeDialog.cs @@ -17,7 +17,7 @@ internal partial class CustomExecutionModeDialog private global::Gtk.Label label4; private global::Gtk.Entry entryModeName; private global::Gtk.Label label3; - private global::Gtk.ComboBox comboStore; + private global::Gtk.ComboBoxText comboStore; private global::Gtk.CheckButton checkPrompt; private global::Gtk.Button buttonCancel; private global::Gtk.Button buttonOk; @@ -31,7 +31,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.Modal = true; // Internal child MonoDevelop.Ide.Execution.CustomExecutionModeDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -145,7 +145,7 @@ protected virtual void Build () w12.Expand = false; w12.Fill = false; // Container child boxName.Gtk.Box+BoxChild - this.comboStore = global::Gtk.ComboBox.NewText (); + this.comboStore = new global::Gtk.ComboBoxText (); this.comboStore.AppendText (global::Mono.Unix.Catalog.GetString ("Only this project")); this.comboStore.AppendText (global::Mono.Unix.Catalog.GetString ("Only this solution")); this.comboStore.AppendText (global::Mono.Unix.Catalog.GetString ("All solutions")); @@ -183,7 +183,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(w1 [this.boxEditor])); w17.Position = 0; // Internal child MonoDevelop.Ide.Execution.CustomExecutionModeDialog.ActionArea - global::Gtk.HButtonBox w18 = this.ActionArea; + global::Gtk.HButtonBox w18 = (Gtk.HButtonBox)this.ActionArea; w18.Name = "dialog1_ActionArea"; w18.Spacing = 10; w18.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.CustomExecutionModeManagerDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.CustomExecutionModeManagerDialog.cs index 13cba24c39b..56fd68bc2cb 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.CustomExecutionModeManagerDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.CustomExecutionModeManagerDialog.cs @@ -21,7 +21,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Custom Execution Modes"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Execution.CustomExecutionModeManagerDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -97,7 +97,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w9.Position = 0; // Internal child MonoDevelop.Ide.Execution.CustomExecutionModeManagerDialog.ActionArea - global::Gtk.HButtonBox w10 = this.ActionArea; + global::Gtk.HButtonBox w10 = (Gtk.HButtonBox)this.ActionArea; w10.Name = "dialog1_ActionArea"; w10.Spacing = 10; w10.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.MonoExecutionParametersPreview.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.MonoExecutionParametersPreview.cs index d52f1d7500d..3d660a0cfa3 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.MonoExecutionParametersPreview.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.MonoExecutionParametersPreview.cs @@ -16,7 +16,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.Modal = true; // Internal child MonoDevelop.Ide.Execution.MonoExecutionParametersPreview.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -42,7 +42,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(w1 [this.GtkScrolledWindow])); w5.Position = 0; // Internal child MonoDevelop.Ide.Execution.MonoExecutionParametersPreview.ActionArea - global::Gtk.HButtonBox w6 = this.ActionArea; + global::Gtk.HButtonBox w6 = (Gtk.HButtonBox)this.ActionArea; w6.Name = "dialog1_ActionArea"; w6.Spacing = 10; w6.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs index 870e372b05c..e76b7dd100e 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs @@ -17,7 +17,7 @@ public partial class FindInFilesDialog private global::Gtk.Table tableFindAndReplace; - private global::Gtk.ComboBoxEntry comboboxentryFind; + private global::Gtk.ComboBoxText comboboxentryFind; private global::Gtk.HBox hbox2; @@ -53,7 +53,7 @@ protected virtual void Build () this.SkipPagerHint = true; this.SkipTaskbarHint = true; // Internal child MonoDevelop.Ide.FindInFiles.FindInFilesDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.Spacing = 6; w1.BorderWidth = ((uint)(2)); @@ -75,7 +75,7 @@ protected virtual void Build () this.toggleFindInFiles.DrawIndicator = false; this.toggleFindInFiles.UseUnderline = true; this.toggleFindInFiles.Relief = ((global::Gtk.ReliefStyle)(2)); - this.toggleFindInFiles.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.toggleFindInFiles.Group = new global::Gtk.RadioButton [0]; this.hbox3.Add (this.toggleFindInFiles); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.toggleFindInFiles])); w2.Position = 0; @@ -116,7 +116,7 @@ protected virtual void Build () this.tableFindAndReplace.RowSpacing = ((uint)(6)); this.tableFindAndReplace.ColumnSpacing = ((uint)(6)); // Container child tableFindAndReplace.Gtk.Table+TableChild - this.comboboxentryFind = global::Gtk.ComboBoxEntry.NewText (); + this.comboboxentryFind = new global::Gtk.ComboBoxText (); this.comboboxentryFind.Name = "comboboxentryFind"; this.tableFindAndReplace.Add (this.comboboxentryFind); global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.tableFindAndReplace [this.comboboxentryFind])); @@ -128,7 +128,7 @@ protected virtual void Build () this.hbox2.Name = "hbox2"; this.hbox2.Spacing = 6; // Container child hbox2.Gtk.Box+BoxChild - this.comboboxScope = global::Gtk.ComboBox.NewText (); + this.comboboxScope = new global::Gtk.ComboBoxText (); this.comboboxScope.Name = "comboboxScope"; this.hbox2.Add (this.comboboxScope); global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.comboboxScope])); @@ -223,7 +223,7 @@ protected virtual void Build () w17.Expand = false; w17.Fill = false; // Internal child MonoDevelop.Ide.FindInFiles.FindInFilesDialog.ActionArea - global::Gtk.HButtonBox w18 = this.ActionArea; + global::Gtk.HButtonBox w18 = (Gtk.HButtonBox)this.ActionArea; w18.Name = "dialog1_ActionArea"; w18.Spacing = 6; w18.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Components.ExecutionModeComboBox.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Components.ExecutionModeComboBox.cs index 3451a049dfe..60585ee6f5c 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Components.ExecutionModeComboBox.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Components.ExecutionModeComboBox.cs @@ -3,7 +3,7 @@ namespace MonoDevelop.Ide.Gui.Components { public partial class ExecutionModeComboBox { - private global::Gtk.ComboBox comboMode; + private global::Gtk.ComboBoxText comboMode; protected virtual void Build () { @@ -12,7 +12,7 @@ protected virtual void Build () MonoDevelop.Components.BinContainer.Attach (this); this.Name = "MonoDevelop.Ide.Gui.Components.ExecutionModeComboBox"; // Container child MonoDevelop.Ide.Gui.Components.ExecutionModeComboBox.Gtk.Container+ContainerChild - this.comboMode = global::Gtk.ComboBox.NewText (); + this.comboMode = new global::Gtk.ComboBoxText (); this.comboMode.Name = "comboMode"; this.Add (this.comboMode); if ((this.Child != null)) { diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs index 89692fca53e..77c33c85d9f 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs @@ -33,7 +33,7 @@ protected virtual void Build () this.BorderWidth = ((uint)(6)); this.DefaultHeight = 350; // Internal child MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog-vbox1"; w1.Spacing = 6; w1.BorderWidth = ((uint)(2)); @@ -100,7 +100,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox1])); w8.Position = 0; // Internal child MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.ActionArea - global::Gtk.HButtonBox w9 = this.ActionArea; + global::Gtk.HButtonBox w9 = (Gtk.HButtonBox)this.ActionArea; w9.Name = "GtkDialog_ActionArea"; w9.Spacing = 6; w9.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.MultiMessageDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.MultiMessageDialog.cs index 84cc4904e07..ce620106cc5 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.MultiMessageDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.MultiMessageDialog.cs @@ -15,7 +15,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Ide.Gui.Dialogs.MultiMessageDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -36,7 +36,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(w1 [this.scrolled])); w5.Position = 0; // Internal child MonoDevelop.Ide.Gui.Dialogs.MultiMessageDialog.ActionArea - global::Gtk.HButtonBox w6 = this.ActionArea; + global::Gtk.HButtonBox w6 = (Gtk.HButtonBox)this.ActionArea; w6.Name = "dialog1_ActionArea"; w6.Spacing = 6; w6.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.MultiTaskProgressDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.MultiTaskProgressDialog.cs index b42a24cbb27..a78063e9c66 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.MultiTaskProgressDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.MultiTaskProgressDialog.cs @@ -22,7 +22,7 @@ protected virtual void Build () this.Modal = true; this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Ide.Gui.Dialogs.MultiTaskProgressDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.Spacing = 6; w1.BorderWidth = ((uint)(2)); @@ -82,7 +82,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(w1 [this.detailsScroll])); w7.Position = 3; // Internal child MonoDevelop.Ide.Gui.Dialogs.MultiTaskProgressDialog.ActionArea - global::Gtk.HButtonBox w8 = this.ActionArea; + global::Gtk.HButtonBox w8 = (Gtk.HButtonBox)this.ActionArea; w8.Name = "dialog1_ActionArea"; w8.Spacing = 6; w8.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs index 58f45aeff51..ac4dfe4e92c 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs @@ -21,9 +21,8 @@ protected virtual void Build () this.TypeHint = ((global::Gdk.WindowTypeHint)(1)); this.BorderWidth = ((uint)(6)); this.Resizable = false; - this.AllowGrow = false; // Internal child MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog-vbox4"; w1.Spacing = 6; w1.BorderWidth = ((uint)(2)); @@ -80,7 +79,7 @@ protected virtual void Build () w7.Expand = false; w7.Fill = false; // Internal child MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.ActionArea - global::Gtk.HButtonBox w8 = this.ActionArea; + global::Gtk.HButtonBox w8 = (Gtk.HButtonBox)this.ActionArea; w8.Name = "GtkDialog_ActionArea"; w8.Spacing = 6; w8.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.ProgressDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.ProgressDialog.cs index 8a6e876ed96..57611e89c29 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.ProgressDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.ProgressDialog.cs @@ -24,7 +24,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.Modal = true; // Internal child MonoDevelop.Ide.Gui.Dialogs.ProgressDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -110,7 +110,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w10.Position = 0; // Internal child MonoDevelop.Ide.Gui.Dialogs.ProgressDialog.ActionArea - global::Gtk.HButtonBox w11 = this.ActionArea; + global::Gtk.HButtonBox w11 = (Gtk.HButtonBox)this.ActionArea; w11.Name = "dialog1_ActionArea"; w11.Spacing = 10; w11.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs index ba33ff06a57..b7814e7a9df 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs @@ -27,7 +27,7 @@ partial class SelectFileFormatDialog private global::Gtk.Label labelCurrentFormat; - private global::Gtk.ComboBox comboNewFormat; + private global::Gtk.ComboBoxText comboNewFormat; private global::Gtk.Label label3; @@ -45,7 +45,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Select File Format"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -146,7 +146,7 @@ protected virtual void Build () w9.XOptions = ((global::Gtk.AttachOptions)(4)); w9.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.comboNewFormat = global::Gtk.ComboBox.NewText (); + this.comboNewFormat = new global::Gtk.ComboBoxText (); this.comboNewFormat.Name = "comboNewFormat"; this.table1.Add (this.comboNewFormat); global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table1 [this.comboNewFormat])); @@ -192,7 +192,7 @@ protected virtual void Build () w16.Expand = false; w16.Fill = false; // Internal child MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.ActionArea - global::Gtk.HButtonBox w17 = this.ActionArea; + global::Gtk.HButtonBox w17 = (Gtk.HButtonBox)this.ActionArea; w17.Name = "dialog1_ActionArea"; w17.Spacing = 10; w17.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs index b6fe94bfe06..96d2c9bf9c2 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs @@ -57,7 +57,7 @@ protected virtual void Build () this.radioHour.Active = true; this.radioHour.DrawIndicator = true; this.radioHour.UseUnderline = true; - this.radioHour.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.radioHour.Group = new global::Gtk.RadioButton [0]; this.vbox5.Add (this.radioHour); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.radioHour])); w2.Position = 0; @@ -136,7 +136,7 @@ protected virtual void Build () this.radioBeta.Active = true; this.radioBeta.DrawIndicator = true; this.radioBeta.UseUnderline = true; - this.radioBeta.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.radioBeta.Group = new global::Gtk.RadioButton [0]; this.vbox6.Add (this.radioBeta); global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.radioBeta])); w9.Position = 0; diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.BuildMessagePanelWidget.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.BuildMessagePanelWidget.cs index 25ed4b99cbc..31767988e3c 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.BuildMessagePanelWidget.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.BuildMessagePanelWidget.cs @@ -5,9 +5,9 @@ internal partial class BuildMessagePanelWidget { private global::Gtk.VBox vbox1; private global::Gtk.Table table4; - private global::Gtk.ComboBox comboboxErrorPadAfter; - private global::Gtk.ComboBox comboboxJumpToFirst; - private global::Gtk.ComboBox comboboxMessageBubbles; + private global::Gtk.ComboBoxText comboboxErrorPadAfter; + private global::Gtk.ComboBoxText comboboxJumpToFirst; + private global::Gtk.ComboBoxText comboboxMessageBubbles; private global::Gtk.Label label3; private global::Gtk.Label label5; private global::Gtk.Label label6; @@ -30,7 +30,7 @@ protected virtual void Build () this.table4.RowSpacing = ((uint)(6)); this.table4.ColumnSpacing = ((uint)(6)); // Container child table4.Gtk.Table+TableChild - this.comboboxErrorPadAfter = global::Gtk.ComboBox.NewText (); + this.comboboxErrorPadAfter = new global::Gtk.ComboBoxText (); this.comboboxErrorPadAfter.AppendText (global::Mono.Unix.Catalog.GetString ("Never")); this.comboboxErrorPadAfter.Name = "comboboxErrorPadAfter"; this.comboboxErrorPadAfter.Active = 0; @@ -43,7 +43,7 @@ protected virtual void Build () w1.XOptions = ((global::Gtk.AttachOptions)(4)); w1.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table4.Gtk.Table+TableChild - this.comboboxJumpToFirst = global::Gtk.ComboBox.NewText (); + this.comboboxJumpToFirst = new global::Gtk.ComboBoxText (); this.comboboxJumpToFirst.AppendText (global::Mono.Unix.Catalog.GetString ("Never")); this.comboboxJumpToFirst.Name = "comboboxJumpToFirst"; this.comboboxJumpToFirst.Active = 0; @@ -54,7 +54,7 @@ protected virtual void Build () w2.XOptions = ((global::Gtk.AttachOptions)(4)); w2.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table4.Gtk.Table+TableChild - this.comboboxMessageBubbles = global::Gtk.ComboBox.NewText (); + this.comboboxMessageBubbles = new global::Gtk.ComboBoxText (); this.comboboxMessageBubbles.AppendText (global::Mono.Unix.Catalog.GetString ("Never")); this.comboboxMessageBubbles.Name = "comboboxMessageBubbles"; this.comboboxMessageBubbles.Active = 0; diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs index 13f1fa424b0..a2d834445c0 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs @@ -136,7 +136,7 @@ protected virtual void Build() this.saveChangesRadioButton.Name = "saveChangesRadioButton"; this.saveChangesRadioButton.DrawIndicator = true; this.saveChangesRadioButton.UseUnderline = true; - this.saveChangesRadioButton.Group = new global::GLib.SList(global::System.IntPtr.Zero); + this.saveChangesRadioButton.Group = new global::Gtk.RadioButton[0]; this.vbox67.Add(this.saveChangesRadioButton); global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox67[this.saveChangesRadioButton])); w9.Position = 0; diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs index 81c95708bde..e2e55b18754 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs @@ -7,9 +7,9 @@ public partial class IDEStyleOptionsPanelWidget private global::Gtk.Table table1; - private global::Gtk.ComboBox comboLanguage; + private global::Gtk.ComboBoxText comboLanguage; - private global::Gtk.ComboBox comboTheme; + private global::Gtk.ComboBoxText comboTheme; private global::Gtk.Label label2; @@ -41,7 +41,7 @@ protected virtual void Build () this.table1.RowSpacing = ((uint)(6)); this.table1.ColumnSpacing = ((uint)(6)); // Container child table1.Gtk.Table+TableChild - this.comboLanguage = global::Gtk.ComboBox.NewText (); + this.comboLanguage = new global::Gtk.ComboBoxText (); this.comboLanguage.Name = "comboLanguage"; this.table1.Add (this.comboLanguage); global::Gtk.Table.TableChild w1 = ((global::Gtk.Table.TableChild)(this.table1 [this.comboLanguage])); @@ -50,7 +50,7 @@ protected virtual void Build () w1.XOptions = ((global::Gtk.AttachOptions)(4)); w1.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.comboTheme = global::Gtk.ComboBox.NewText (); + this.comboTheme = new global::Gtk.ComboBoxText (); this.comboTheme.Name = "comboTheme"; this.table1.Add (this.comboTheme); global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.comboTheme])); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs index f65d904eb8f..0081ff500c4 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs @@ -9,7 +9,7 @@ public partial class KeyBindingsPanel private global::Gtk.Label labelScheme; - private global::Gtk.ComboBox schemeCombo; + private global::Gtk.ComboBoxText schemeCombo; private global::Gtk.HSeparator hseparator2; @@ -74,7 +74,7 @@ protected virtual void Build () w1.Expand = false; w1.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.schemeCombo = global::Gtk.ComboBox.NewText (); + this.schemeCombo = new global::Gtk.ComboBoxText (); this.schemeCombo.Name = "schemeCombo"; this.hbox1.Add (this.schemeCombo); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.schemeCombo])); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.TextStylePolicyPanelWidget.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.TextStylePolicyPanelWidget.cs index fcf802adc04..91e9148a6c1 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.TextStylePolicyPanelWidget.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.TextStylePolicyPanelWidget.cs @@ -10,7 +10,7 @@ internal partial class TextStylePolicyPanelWidget private global::Gtk.Label label5; private global::Gtk.HBox hbox2; private global::Gtk.Label label6; - private global::Gtk.ComboBox lineEndingCombo; + private global::Gtk.ComboBoxText lineEndingCombo; private global::Gtk.Alignment alignment2; private global::Gtk.Label label3; private global::Gtk.Alignment alignment1; @@ -90,7 +90,7 @@ protected virtual void Build () w5.Expand = false; w5.Fill = false; // Container child hbox2.Gtk.Box+BoxChild - this.lineEndingCombo = global::Gtk.ComboBox.NewText (); + this.lineEndingCombo = new global::Gtk.ComboBoxText (); this.lineEndingCombo.Name = "lineEndingCombo"; this.hbox2.Add (this.lineEndingCombo); global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.lineEndingCombo])); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.AddExternalFileDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.AddExternalFileDialog.cs index 76e6194b6f6..55809d5642d 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.AddExternalFileDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.AddExternalFileDialog.cs @@ -47,7 +47,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Add File to Folder"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Projects.AddExternalFileDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -106,7 +106,7 @@ protected virtual void Build () this.radioKeep.Name = "radioKeep"; this.radioKeep.DrawIndicator = true; this.radioKeep.UseUnderline = true; - this.radioKeep.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.radioKeep.Group = new global::Gtk.RadioButton [0]; this.radioKeep.Remove (this.radioKeep.Child); // Container child radioKeep.Gtk.Container+ContainerChild this.labelKeep = new global::Gtk.Label (); @@ -205,7 +205,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox1])); w17.Position = 0; // Internal child MonoDevelop.Ide.Projects.AddExternalFileDialog.ActionArea - global::Gtk.HButtonBox w18 = this.ActionArea; + global::Gtk.HButtonBox w18 = (Gtk.HButtonBox)this.ActionArea; w18.Name = "dialog1_ActionArea"; w18.Spacing = 10; w18.BorderWidth = ((uint)(11)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.AddMimeTypeDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.AddMimeTypeDialog.cs index 970ac8e79c3..dabb51b7dd9 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.AddMimeTypeDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.AddMimeTypeDialog.cs @@ -27,7 +27,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Add File Type"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Projects.AddMimeTypeDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -88,7 +88,7 @@ protected virtual void Build () w7.Expand = false; w7.Fill = false; // Internal child MonoDevelop.Ide.Projects.AddMimeTypeDialog.ActionArea - global::Gtk.HButtonBox w8 = this.ActionArea; + global::Gtk.HButtonBox w8 = (Gtk.HButtonBox)this.ActionArea; w8.Name = "dialog1_ActionArea"; w8.Spacing = 10; w8.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ApplyPolicyDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ApplyPolicyDialog.cs index f51b756ec3e..8087ded224a 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ApplyPolicyDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ApplyPolicyDialog.cs @@ -9,7 +9,7 @@ internal partial class ApplyPolicyDialog private global::Gtk.Alignment boxCustom; private global::Gtk.HBox hbox1; private global::Gtk.Label label2; - private global::Gtk.ComboBox combPolicies; + private global::Gtk.ComboBoxText combPolicies; private global::Gtk.RadioButton radioFile; private global::Gtk.Alignment boxFile; private global::Gtk.HBox hbox2; @@ -29,7 +29,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Apply Policies"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Projects.ApplyPolicyDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -47,7 +47,7 @@ protected virtual void Build () this.radioCustom.Name = "radioCustom"; this.radioCustom.DrawIndicator = true; this.radioCustom.UseUnderline = true; - this.radioCustom.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.radioCustom.Group = new global::Gtk.RadioButton [0]; this.vbox2.Add (this.radioCustom); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.radioCustom])); w2.Position = 0; @@ -71,7 +71,7 @@ protected virtual void Build () w3.Expand = false; w3.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.combPolicies = global::Gtk.ComboBox.NewText (); + this.combPolicies = new Gtk.ComboBoxText (); this.combPolicies.Name = "combPolicies"; this.hbox1.Add (this.combPolicies); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.combPolicies])); @@ -160,7 +160,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox3])); w16.Position = 0; // Internal child MonoDevelop.Ide.Projects.ApplyPolicyDialog.ActionArea - global::Gtk.HButtonBox w17 = this.ActionArea; + global::Gtk.HButtonBox w17 = (Gtk.HButtonBox)this.ActionArea; w17.Name = "dialog1_ActionArea"; w17.Spacing = 10; w17.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ConfirmProjectDeleteDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ConfirmProjectDeleteDialog.cs index c6f136ed4d0..bd94322976a 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ConfirmProjectDeleteDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ConfirmProjectDeleteDialog.cs @@ -34,7 +34,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.Modal = true; // Internal child MonoDevelop.Ide.Projects.ConfirmProjectDeleteDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -58,7 +58,7 @@ protected virtual void Build () this.radioDeleteAll.Name = "radioDeleteAll"; this.radioDeleteAll.DrawIndicator = true; this.radioDeleteAll.UseUnderline = true; - this.radioDeleteAll.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.radioDeleteAll.Group = new global::Gtk.RadioButton [0]; this.vbox2.Add (this.radioDeleteAll); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.radioDeleteAll])); w3.Position = 1; @@ -113,7 +113,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w10.Position = 0; // Internal child MonoDevelop.Ide.Projects.ConfirmProjectDeleteDialog.ActionArea - global::Gtk.HButtonBox w11 = this.ActionArea; + global::Gtk.HButtonBox w11 = (Gtk.HButtonBox)this.ActionArea; w11.Name = "dialog1_ActionArea"; w11.Spacing = 10; w11.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.DeleteConfigDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.DeleteConfigDialog.cs index 09986d1fedd..bc0e432ffe8 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.DeleteConfigDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.DeleteConfigDialog.cs @@ -25,7 +25,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Delete Configuration"); this.TypeHint = ((global::Gdk.WindowTypeHint)(1)); // Internal child MonoDevelop.Ide.Projects.DeleteConfigDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog-vbox7"; // Container child dialog-vbox7.Gtk.Box+BoxChild this.hbox64 = new global::Gtk.HBox (); @@ -76,7 +76,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox64])); w6.Position = 0; // Internal child MonoDevelop.Ide.Projects.DeleteConfigDialog.ActionArea - global::Gtk.HButtonBox w7 = this.ActionArea; + global::Gtk.HButtonBox w7 = (Gtk.HButtonBox)this.ActionArea; w7.Name = "dialog-action_area7"; w7.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog-action_area7.Gtk.ButtonBox+ButtonBoxChild diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ExportProjectPolicyDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ExportProjectPolicyDialog.cs index 85ac3b3fd8b..eddbc9cf5e4 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ExportProjectPolicyDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ExportProjectPolicyDialog.cs @@ -29,7 +29,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Export Policies"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Projects.ExportProjectPolicyDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -47,7 +47,7 @@ protected virtual void Build () this.radioCustom.Name = "radioCustom"; this.radioCustom.DrawIndicator = true; this.radioCustom.UseUnderline = true; - this.radioCustom.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.radioCustom.Group = new global::Gtk.RadioButton [0]; this.vbox4.Add (this.radioCustom); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.radioCustom])); w2.Position = 0; @@ -163,7 +163,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w16.Position = 0; // Internal child MonoDevelop.Ide.Projects.ExportProjectPolicyDialog.ActionArea - global::Gtk.HButtonBox w17 = this.ActionArea; + global::Gtk.HButtonBox w17 = (Gtk.HButtonBox)this.ActionArea; w17.Name = "dialog1_ActionArea"; w17.Spacing = 10; w17.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ExportSolutionDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ExportSolutionDialog.cs index 045f7dae415..a907a78cd7f 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ExportSolutionDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ExportSolutionDialog.cs @@ -7,7 +7,7 @@ internal partial class ExportSolutionDialog private global::Gtk.Table table; - private global::Gtk.ComboBox comboFormat; + private global::Gtk.ComboBoxText comboFormat; private global::MonoDevelop.Components.FolderEntry folderEntry; @@ -34,7 +34,7 @@ protected virtual void Build () this.BorderWidth = ((uint)(6)); this.Resizable = false; // Internal child MonoDevelop.Ide.Projects.ExportSolutionDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Events = ((global::Gdk.EventMask)(256)); w1.Name = "dialog_VBox"; w1.Spacing = 6; @@ -50,7 +50,7 @@ protected virtual void Build () this.table.RowSpacing = ((uint)(6)); this.table.ColumnSpacing = ((uint)(6)); // Container child table.Gtk.Table+TableChild - this.comboFormat = global::Gtk.ComboBox.NewText (); + this.comboFormat = new global::Gtk.ComboBoxText (); this.comboFormat.Name = "comboFormat"; this.table.Add (this.comboFormat); global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table [this.comboFormat])); @@ -123,7 +123,7 @@ protected virtual void Build () w9.Expand = false; w9.Fill = false; // Internal child MonoDevelop.Ide.Projects.ExportSolutionDialog.ActionArea - global::Gtk.HButtonBox w10 = this.ActionArea; + global::Gtk.HButtonBox w10 = (Gtk.HButtonBox)this.ActionArea; w10.Name = "MonoDevelop.Ide.ExportProjectDialog_ActionArea"; w10.Spacing = 6; w10.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ImportProjectPolicyDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ImportProjectPolicyDialog.cs index 50a283a4b19..e54480a0c1a 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ImportProjectPolicyDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ImportProjectPolicyDialog.cs @@ -18,7 +18,7 @@ protected virtual void Build () this.Name = "MonoDevelop.Ide.Projects.ImportProjectPolicyDialog"; this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Projects.ImportProjectPolicyDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -70,7 +70,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5])); w6.Position = 0; // Internal child MonoDevelop.Ide.Projects.ImportProjectPolicyDialog.ActionArea - global::Gtk.HButtonBox w7 = this.ActionArea; + global::Gtk.HButtonBox w7 = (Gtk.HButtonBox)this.ActionArea; w7.Name = "dialog1_ActionArea"; w7.Spacing = 10; w7.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.IncludeNewFilesDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.IncludeNewFilesDialog.cs index 3628e3853bf..b993d2cad3b 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.IncludeNewFilesDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.IncludeNewFilesDialog.cs @@ -21,7 +21,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Ide.Projects.IncludeNewFilesDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -88,7 +88,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w8.Position = 0; // Internal child MonoDevelop.Ide.Projects.IncludeNewFilesDialog.ActionArea - global::Gtk.HButtonBox w9 = this.ActionArea; + global::Gtk.HButtonBox w9 = (Gtk.HButtonBox)this.ActionArea; w9.Name = "dialog1_ActionArea"; w9.Spacing = 6; w9.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewConfigurationDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewConfigurationDialog.cs index e72492ec692..28d340cf964 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewConfigurationDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewConfigurationDialog.cs @@ -5,8 +5,8 @@ internal partial class NewConfigurationDialog { private global::Gtk.VBox vbox77; private global::Gtk.Table table1; - private global::Gtk.ComboBoxEntry comboName; - private global::Gtk.ComboBoxEntry comboPlatform; + private global::Gtk.ComboBoxText comboName; + private global::Gtk.ComboBoxText comboPlatform; private global::Gtk.Label label1; private global::Gtk.Label label2; private global::Gtk.CheckButton createChildrenCheck; @@ -21,7 +21,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("New Configuration"); this.TypeHint = ((global::Gdk.WindowTypeHint)(1)); // Internal child MonoDevelop.Ide.Projects.NewConfigurationDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog-vbox6"; w1.BorderWidth = ((uint)(2)); // Container child dialog-vbox6.Gtk.Box+BoxChild @@ -35,7 +35,7 @@ protected virtual void Build () this.table1.RowSpacing = ((uint)(6)); this.table1.ColumnSpacing = ((uint)(6)); // Container child table1.Gtk.Table+TableChild - this.comboName = global::Gtk.ComboBoxEntry.NewText (); + this.comboName = new Gtk.ComboBoxText (); this.comboName.Name = "comboName"; this.table1.Add (this.comboName); global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.comboName])); @@ -44,7 +44,7 @@ protected virtual void Build () w2.XOptions = ((global::Gtk.AttachOptions)(4)); w2.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.comboPlatform = global::Gtk.ComboBoxEntry.NewText (); + this.comboPlatform = new Gtk.ComboBoxText (); this.comboPlatform.Name = "comboPlatform"; this.table1.Add (this.comboPlatform); global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.comboPlatform])); @@ -93,7 +93,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox77])); w8.Position = 0; // Internal child MonoDevelop.Ide.Projects.NewConfigurationDialog.ActionArea - global::Gtk.HButtonBox w9 = this.ActionArea; + global::Gtk.HButtonBox w9 = (Gtk.HButtonBox)this.ActionArea; w9.Name = "dialog-action_area6"; w9.Spacing = 6; w9.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewFileDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewFileDialog.cs index ab7583b8238..b152e1bde80 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewFileDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewFileDialog.cs @@ -37,7 +37,7 @@ internal partial class NewFileDialog private global::Gtk.CheckButton projectAddCheckbox; - private global::Gtk.ComboBox projectAddCombo; + private global::Gtk.ComboBoxText projectAddCombo; private global::Gtk.HBox hbox4; @@ -58,7 +58,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Ide.Projects.NewFileDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.Spacing = 6; w1.BorderWidth = ((uint)(2)); @@ -206,7 +206,7 @@ protected virtual void Build () w17.Expand = false; w17.Fill = false; // Container child hbox3.Gtk.Box+BoxChild - this.projectAddCombo = global::Gtk.ComboBox.NewText (); + this.projectAddCombo = new global::Gtk.ComboBoxText (); this.projectAddCombo.Name = "projectAddCombo"; this.hbox3.Add (this.projectAddCombo); global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.projectAddCombo])); @@ -250,7 +250,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w24.Position = 0; // Internal child MonoDevelop.Ide.Projects.NewFileDialog.ActionArea - global::Gtk.HButtonBox w25 = this.ActionArea; + global::Gtk.HButtonBox w25 = (Gtk.HButtonBox)this.ActionArea; w25.Name = "dialog1_ActionArea"; w25.Spacing = 6; w25.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewPolicySetDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewPolicySetDialog.cs index 6de41e9e20b..489097a21f0 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewPolicySetDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewPolicySetDialog.cs @@ -11,7 +11,7 @@ internal partial class NewPolicySetDialog private global::Gtk.Label label2; - private global::Gtk.ComboBox comboSets; + private global::Gtk.ComboBoxText comboSets; private global::Gtk.Button buttonCancel; @@ -25,7 +25,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("New Policy"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Projects.NewPolicySetDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -65,7 +65,7 @@ protected virtual void Build () w4.Expand = false; w4.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.comboSets = global::Gtk.ComboBox.NewText (); + this.comboSets = new global::Gtk.ComboBoxText (); this.comboSets.Name = "comboSets"; this.vbox2.Add (this.comboSets); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.comboSets])); @@ -78,7 +78,7 @@ protected virtual void Build () w6.Expand = false; w6.Fill = false; // Internal child MonoDevelop.Ide.Projects.NewPolicySetDialog.ActionArea - global::Gtk.HButtonBox w7 = this.ActionArea; + global::Gtk.HButtonBox w7 = (Gtk.HButtonBox)this.ActionArea; w7.Name = "dialog1_ActionArea"; w7.Spacing = 10; w7.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.OptionPanels.CustomCommandWidget.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.OptionPanels.CustomCommandWidget.cs index b7d32046262..2c41e60d8c6 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.OptionPanels.CustomCommandWidget.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.OptionPanels.CustomCommandWidget.cs @@ -6,7 +6,7 @@ internal partial class CustomCommandWidget private global::Gtk.VBox vbox1; private global::Gtk.HSeparator hseparator2; private global::Gtk.HBox hbox1; - private global::Gtk.ComboBox comboType; + private global::Gtk.ComboBoxText comboType; private global::Gtk.Button buttonRemove; private global::Gtk.Table tableData; private global::Gtk.Entry entryCommand; @@ -51,7 +51,7 @@ protected virtual void Build () this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild - this.comboType = global::Gtk.ComboBox.NewText (); + this.comboType = new global::Gtk.ComboBoxText (); this.comboType.CanFocus = true; this.comboType.Name = "comboType"; this.hbox1.Add (this.comboType); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.OptionPanels.NamespaceSynchronisationPanelWidget.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.OptionPanels.NamespaceSynchronisationPanelWidget.cs index 75f3a1d763e..1ef4208f271 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.OptionPanels.NamespaceSynchronisationPanelWidget.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.OptionPanels.NamespaceSynchronisationPanelWidget.cs @@ -86,7 +86,7 @@ protected virtual void Build () this.radioFlat.Name = "radioFlat"; this.radioFlat.DrawIndicator = true; this.radioFlat.UseUnderline = true; - this.radioFlat.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.radioFlat.Group = new global::Gtk.RadioButton [0]; this.vbox4.Add (this.radioFlat); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.radioFlat])); w4.Position = 0; diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.OptionPanels.RuntimeOptionsPanelWidget.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.OptionPanels.RuntimeOptionsPanelWidget.cs index 383e98d7952..bdcf66db587 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.OptionPanels.RuntimeOptionsPanelWidget.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.OptionPanels.RuntimeOptionsPanelWidget.cs @@ -6,7 +6,7 @@ internal partial class RuntimeOptionsPanelWidget private global::Gtk.VBox vbox81; private global::Gtk.HBox hbox68; private global::Gtk.Label label114; - private global::Gtk.ComboBox runtimeVersionCombo; + private global::Gtk.ComboBoxText runtimeVersionCombo; protected virtual void Build () { @@ -34,7 +34,7 @@ protected virtual void Build () w1.Expand = false; w1.Fill = false; // Container child hbox68.Gtk.Box+BoxChild - this.runtimeVersionCombo = global::Gtk.ComboBox.NewText (); + this.runtimeVersionCombo = new global::Gtk.ComboBoxText (); this.runtimeVersionCombo.Name = "runtimeVersionCombo"; this.hbox68.Add (this.runtimeVersionCombo); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox68 [this.runtimeVersionCombo])); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ProjectFileSelectorDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ProjectFileSelectorDialog.cs index 7b93e11a6aa..0b71e9ca24d 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ProjectFileSelectorDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ProjectFileSelectorDialog.cs @@ -27,7 +27,7 @@ public partial class ProjectFileSelectorDialog private global::Gtk.Label label2; - private global::Gtk.ComboBox fileTypeCombo; + private global::Gtk.ComboBoxText fileTypeCombo; private global::Gtk.Button buttonCancel; @@ -41,7 +41,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Select Project File..."); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Projects.ProjectFileSelectorDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -121,7 +121,7 @@ protected virtual void Build () w9.Expand = false; w9.Fill = false; // Container child typeBox.Gtk.Box+BoxChild - this.fileTypeCombo = global::Gtk.ComboBox.NewText (); + this.fileTypeCombo = new global::Gtk.ComboBoxText (); this.fileTypeCombo.Name = "fileTypeCombo"; this.typeBox.Add (this.fileTypeCombo); global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.typeBox [this.fileTypeCombo])); @@ -142,7 +142,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(w1 [this.hpaned1])); w14.Position = 0; // Internal child MonoDevelop.Ide.Projects.ProjectFileSelectorDialog.ActionArea - global::Gtk.HButtonBox w15 = this.ActionArea; + global::Gtk.HButtonBox w15 = (Gtk.HButtonBox)this.ActionArea; w15.Name = "dialog1_ActionArea"; w15.Spacing = 6; w15.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ProjectSelectorDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ProjectSelectorDialog.cs index cb56b2c526e..ac8d2da3b63 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ProjectSelectorDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ProjectSelectorDialog.cs @@ -16,7 +16,7 @@ protected virtual void Build () this.Name = "MonoDevelop.Ide.Projects.ProjectSelectorDialog"; this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Projects.ProjectSelectorDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -47,7 +47,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox4])); w4.Position = 0; // Internal child MonoDevelop.Ide.Projects.ProjectSelectorDialog.ActionArea - global::Gtk.HButtonBox w5 = this.ActionArea; + global::Gtk.HButtonBox w5 = (Gtk.HButtonBox)this.ActionArea; w5.Name = "dialog1_ActionArea"; w5.Spacing = 10; w5.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.RenameConfigDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.RenameConfigDialog.cs index 6e6caf060b1..3c790af1a87 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.RenameConfigDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.RenameConfigDialog.cs @@ -19,7 +19,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Rename Configuration"); this.TypeHint = ((global::Gdk.WindowTypeHint)(1)); // Internal child MonoDevelop.Ide.Projects.RenameConfigDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "vbox78"; w1.BorderWidth = ((uint)(2)); // Container child vbox78.Gtk.Box+BoxChild @@ -69,7 +69,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox79])); w6.Position = 0; // Internal child MonoDevelop.Ide.Projects.RenameConfigDialog.ActionArea - global::Gtk.HButtonBox w7 = this.ActionArea; + global::Gtk.HButtonBox w7 = (Gtk.HButtonBox)this.ActionArea; w7.Name = "hbuttonbox2"; w7.Spacing = 6; w7.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.SelectReferenceDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.SelectReferenceDialog.cs index d480903c029..d7f310d0a15 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.SelectReferenceDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.SelectReferenceDialog.cs @@ -45,7 +45,7 @@ protected virtual void Build () this.BorderWidth = ((uint)(6)); this.DestroyWithParent = true; // Internal child MonoDevelop.Ide.Projects.SelectReferenceDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog-vbox2"; w1.Spacing = 6; // Container child dialog-vbox2.Gtk.Box+BoxChild @@ -145,7 +145,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5])); w14.Position = 0; // Internal child MonoDevelop.Ide.Projects.SelectReferenceDialog.ActionArea - global::Gtk.HButtonBox w15 = this.ActionArea; + global::Gtk.HButtonBox w15 = (Gtk.HButtonBox)this.ActionArea; w15.Name = "dialog-action_area2"; w15.Spacing = 10; w15.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.SelectEncodingsDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.SelectEncodingsDialog.cs index 42df7fe27a1..c0a48fa3837 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.SelectEncodingsDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.SelectEncodingsDialog.cs @@ -57,7 +57,7 @@ protected virtual void Build () this.DefaultWidth = 700; this.DefaultHeight = 450; // Internal child MonoDevelop.Ide.SelectEncodingsDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog-vbox5"; w1.Spacing = 6; w1.BorderWidth = ((uint)(2)); @@ -215,7 +215,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(w1 [this.table5])); w20.Position = 0; // Internal child MonoDevelop.Ide.SelectEncodingsDialog.ActionArea - global::Gtk.HButtonBox w21 = this.ActionArea; + global::Gtk.HButtonBox w21 = (Gtk.HButtonBox)this.ActionArea; w21.Name = "dialog-action_area5"; w21.Spacing = 6; w21.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/generated.cs b/main/src/core/MonoDevelop.Ide/Gui/generated.cs index bc4dc98c212..70568068855 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/generated.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/generated.cs @@ -23,25 +23,25 @@ public class BinContainer public static BinContainer Attach (Gtk.Bin bin) { BinContainer bc = new BinContainer (); - bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested); - bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated); +// bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested); +// bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated); bin.Added += new Gtk.AddedHandler (bc.OnAdded); return bc; } - private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args) - { - if ((this.child != null)) { - args.Requisition = this.child.SizeRequest (); - } - } +// private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args) +// { +// if ((this.child != null)) { +// args.Requisition = this.child.SizeRequest (); +// } +// } - private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args) - { - if ((this.child != null)) { - this.child.Allocation = args.Allocation; - } - } +// private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args) +// { +// if ((this.child != null)) { +// this.child.Allocation = args.Allocation; +// } +// } private void OnAdded (object sender, Gtk.AddedArgs args) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AtkCocoaHelper/AtkCocoaHelper.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AtkCocoaHelper/AtkCocoaHelper.cs index 9275a69e25f..2fd73fd8cf4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AtkCocoaHelper/AtkCocoaHelper.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AtkCocoaHelper/AtkCocoaHelper.cs @@ -180,31 +180,31 @@ internal Atk.Object Owner { void HandleSignalAttachment (Atk.Object owner, Action> action) { - var signal = GLib.Signal.Lookup (owner, "request-actions", typeof (GLib.SignalArgs)); - action (signal, new EventHandler (RequestActionsHandler)); - - signal = GLib.Signal.Lookup (owner, "perform-cancel", typeof (GLib.SignalArgs)); - action (signal, new EventHandler (PerformCancelHandler)); - signal = GLib.Signal.Lookup (owner, "perform-confirm", typeof (GLib.SignalArgs)); - action (signal, new EventHandler (PerformConfirmHandler)); - signal = GLib.Signal.Lookup (owner, "perform-decrement", typeof (GLib.SignalArgs)); - action (signal, new EventHandler (PerformDecrementHandler)); - signal = GLib.Signal.Lookup (owner, "perform-delete", typeof (GLib.SignalArgs)); - action (signal, new EventHandler (PerformDeleteHandler)); - signal = GLib.Signal.Lookup (owner, "perform-increment", typeof (GLib.SignalArgs)); - action (signal, new EventHandler (PerformIncrementHandler)); - signal = GLib.Signal.Lookup (owner, "perform-pick", typeof (GLib.SignalArgs)); - action (signal, new EventHandler (PerformPickHandler)); - signal = GLib.Signal.Lookup (owner, "perform-press", typeof (GLib.SignalArgs)); - action (signal, new EventHandler (PerformPressHandler)); - signal = GLib.Signal.Lookup (owner, "perform-raise", typeof (GLib.SignalArgs)); - action (signal, new EventHandler (PerformRaiseHandler)); - signal = GLib.Signal.Lookup (owner, "perform-show-alternate-ui", typeof (GLib.SignalArgs)); - action (signal, new EventHandler (PerformShowAlternateUIHandler)); - signal = GLib.Signal.Lookup (owner, "perform-show-default-ui", typeof (GLib.SignalArgs)); - action (signal, new EventHandler (PerformShowDefaultUIHandler)); - signal = GLib.Signal.Lookup (owner, "perform-show-menu", typeof (GLib.SignalArgs)); - action (signal, new EventHandler (PerformShowMenuHandler)); +// var signal = GLib.Signal.Lookup (owner, "request-actions", typeof (GLib.SignalArgs)); +// action (signal, new EventHandler (RequestActionsHandler)); + +// signal = GLib.Signal.Lookup (owner, "perform-cancel", typeof (GLib.SignalArgs)); +// action (signal, new EventHandler (PerformCancelHandler)); +// signal = GLib.Signal.Lookup (owner, "perform-confirm", typeof (GLib.SignalArgs)); +// action (signal, new EventHandler (PerformConfirmHandler)); +// signal = GLib.Signal.Lookup (owner, "perform-decrement", typeof (GLib.SignalArgs)); +// action (signal, new EventHandler (PerformDecrementHandler)); +// signal = GLib.Signal.Lookup (owner, "perform-delete", typeof (GLib.SignalArgs)); +// action (signal, new EventHandler (PerformDeleteHandler)); +// signal = GLib.Signal.Lookup (owner, "perform-increment", typeof (GLib.SignalArgs)); +// action (signal, new EventHandler (PerformIncrementHandler)); +// signal = GLib.Signal.Lookup (owner, "perform-pick", typeof (GLib.SignalArgs)); +// action (signal, new EventHandler (PerformPickHandler)); +// signal = GLib.Signal.Lookup (owner, "perform-press", typeof (GLib.SignalArgs)); +// action (signal, new EventHandler (PerformPressHandler)); +// signal = GLib.Signal.Lookup (owner, "perform-raise", typeof (GLib.SignalArgs)); +// action (signal, new EventHandler (PerformRaiseHandler)); +// signal = GLib.Signal.Lookup (owner, "perform-show-alternate-ui", typeof (GLib.SignalArgs)); +// action (signal, new EventHandler (PerformShowAlternateUIHandler)); +// signal = GLib.Signal.Lookup (owner, "perform-show-default-ui", typeof (GLib.SignalArgs)); +// action (signal, new EventHandler (PerformShowDefaultUIHandler)); +// signal = GLib.Signal.Lookup (owner, "perform-show-menu", typeof (GLib.SignalArgs)); +// action (signal, new EventHandler (PerformShowMenuHandler)); } public ActionDelegate (Gtk.Widget widget) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs index 7e3dbbccbdb..623daace66f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs @@ -34,19 +34,19 @@ namespace MonoDevelop.Components.AutoTest.Results public class GtkTreeModelResult : GtkWidgetResult { Widget ParentWidget; - TreeModel TModel; + ITreeModel TModel; int Column; TreeIter? resultIter; string DesiredText; - internal GtkTreeModelResult (Widget parent, TreeModel treeModel, int column) : base (parent) + internal GtkTreeModelResult (Widget parent, ITreeModel treeModel, int column) : base (parent) { ParentWidget = parent; TModel = treeModel; Column = column; } - internal GtkTreeModelResult (Widget parent, TreeModel treeModel, int column, TreeIter iter) : base (parent) + internal GtkTreeModelResult (Widget parent, ITreeModel treeModel, int column, TreeIter iter) : base (parent) { ParentWidget = parent; TModel = treeModel; @@ -86,7 +86,7 @@ public override AppResult Model (string column) return this; } - bool CheckForText (TreeModel model, TreeIter iter, bool exact) + bool CheckForText (ITreeModel model, TreeIter iter, bool exact) { string modelText = model.GetValue (iter, Column) as string; if (modelText == null) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs index 6beaa805eb9..8e623b36f9a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs @@ -106,7 +106,7 @@ public override AppResult Text (string text, bool exact) // Check for the combobox first and try to use the active text. // If the active text fails then - ComboBox cb = resultWidget as ComboBox; + ComboBoxText cb = resultWidget as ComboBoxText; if (cb != null) { string activeText = cb.ActiveText; if (activeText == null) { @@ -152,7 +152,7 @@ public override AppResult Text (string text, bool exact) return null; } - protected TreeModel ModelFromWidget (Widget widget) + protected ITreeModel ModelFromWidget (Widget widget) { TreeView tv = widget as TreeView; if (tv != null) { @@ -169,7 +169,7 @@ protected TreeModel ModelFromWidget (Widget widget) public override AppResult Model (string column) { - TreeModel model = ModelFromWidget (resultWidget); + ITreeModel model = ModelFromWidget (resultWidget); if (model == null) { return null; } @@ -183,7 +183,7 @@ public override AppResult Model (string column) return columnNumber == -1 ? null : new GtkTreeModelResult (resultWidget, model, columnNumber) { SourceQuery = this.SourceQuery }; } - protected int GetColumnNumber (string column, TreeModel model) + protected int GetColumnNumber (string column, ITreeModel model) { Type modelType = model.GetType (); SemanticModelAttribute attr = modelType.GetCustomAttribute (); @@ -490,36 +490,36 @@ public override bool Toggle (bool active) bool flashState; - void OnFlashWidget (object o, ExposeEventArgs args) - { - flashState = !flashState; - - if (flashState) { - return; - } - - using (var cr = Gdk.CairoHelper.Create (resultWidget.GdkWindow)) { - cr.SetSourceRGB (1.0, 0.0, 0.0); - - Gdk.Rectangle allocation = resultWidget.Allocation; - Gdk.CairoHelper.Rectangle (cr, allocation); - cr.Stroke (); - } - } +// void OnFlashWidget (object o, ExposeEventArgs args) +// { +// flashState = !flashState; +// +// if (flashState) { +// return; +// } +// +// using (var cr = Gdk.CairoHelper.Create (resultWidget.GdkWindow)) { +// cr.SetSourceRGB (1.0, 0.0, 0.0); +// +// Gdk.Rectangle allocation = resultWidget.Allocation; +// Gdk.CairoHelper.Rectangle (cr, allocation); +// cr.Stroke (); +// } +// } public override void Flash () { int flashCount = 10; flashState = true; - resultWidget.ExposeEvent += OnFlashWidget; +// resultWidget.ExposeEvent += OnFlashWidget; GLib.Timeout.Add (1000, () => { resultWidget.QueueDraw (); flashCount--; if (flashCount == 0) { - resultWidget.ExposeEvent -= OnFlashWidget; +// resultWidget.ExposeEvent -= OnFlashWidget; return false; } return true; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs index 30ae5394576..4fa85f73a8c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs @@ -449,144 +449,144 @@ double GetMinTickStep (AxisDimension ad) return (((double) minTickStep) * (GetEnd (ad) - GetStart (ad))) / (double) GetAreaSize (ad); } - protected override bool OnExposeEvent (Gdk.EventExpose args) - { - Gdk.Window win = GdkWindow; - int rwidth, rheight; - - Cairo.Context ctx = CairoHelper.Create (win); - - win.GetSize (out rwidth, out rheight); - - if (autoStartY || autoEndY) { - double nstartY = double.MaxValue; - double nendY = double.MinValue; - GetValueRange (AxisDimension.Y, out nstartY, out nendY); - - if (!autoStartY) nstartY = startY; - if (!autoEndY) nendY = endY; - if (nendY < nstartY) nendY = nstartY; - - if (nstartY != startY || nendY != endY) { - yrangeChanged = true; - startY = nstartY; - endY = nendY; - } - } - - if (autoStartX || autoEndX) { - double nstartX = double.MaxValue; - double nendX = double.MinValue; - GetValueRange (AxisDimension.X, out nstartX, out nendX); - - if (!autoStartX) nstartX = startX; - if (!autoEndX) nendX = endX; - if (nendX < nstartX) nendX = nstartX; - - if (nstartX != startX || nendX != endX) { - xrangeChanged = true; - startX = nstartX; - endX = nendX; - } - } - - if (yrangeChanged) { - FixOrigins (); - int right = rwidth - 2 - AreaBorderWidth; - left = AreaBorderWidth; - left += MeasureAxisSize (AxisPosition.Left) + 1; - right -= MeasureAxisSize (AxisPosition.Right) + 1; - yrangeChanged = false; - width = right - left + 1; - if (width <= 0) width = 1; - } - - if (xrangeChanged) { - FixOrigins (); - int bottom = rheight - 2 - AreaBorderWidth; - top = AreaBorderWidth; - bottom -= MeasureAxisSize (AxisPosition.Bottom); - top += MeasureAxisSize (AxisPosition.Top); - - // Make room for cursor handles - foreach (ChartCursor cursor in cursors) { - if (cursor.Dimension == AxisDimension.X && top - AreaBorderWidth < cursor.HandleSize) - top = cursor.HandleSize + AreaBorderWidth; - } - - xrangeChanged = false; - height = bottom - top + 1; - if (height <= 0) height = 1; - } - - if (AutoScaleMargin != 0 && height > 0) { - double margin = (double)AutoScaleMargin * (endY - startY) / (double) height; - if (autoStartY) startY -= margin; - if (autoEndY) endY += margin; - } - -// Console.WriteLine ("L:" + left + " T:" + top + " W:" + width + " H:" + height); - - // Draw the background - - if (backgroundDisplay == BackgroundDisplay.Gradient) { - ctx.Rectangle (left - 1, top - 1, width + 2, height + 2); - - // FIXME: VV: Remove gradient features - using (var pat = new Cairo.LinearGradient (left - 1, top - 1, left - 1, height + 2)) { - pat.AddColorStop (0, backroundColor); - Cairo.Color endc = new Cairo.Color (1,1,1); - pat.AddColorStop (1, endc); - ctx.SetSource (pat); - ctx.Fill (); - } - } else { - ctx.Rectangle (left - 1, top - 1, width + 2, height + 2); - ctx.SetSourceColor (backroundColor); - ctx.Fill (); - } -// win.DrawRectangle (Style.WhiteGC, true, left - 1, top - 1, width + 2, height + 2); - win.DrawRectangle (Style.BlackGC, false, left - AreaBorderWidth, top - AreaBorderWidth, width + AreaBorderWidth*2, height + AreaBorderWidth*2); - - // Draw selected area - - if (enableSelection) { - int sx, sy, ex, ey; - GetPoint (selectionStart.Value, selectionStart.Value, out sx, out sy); - GetPoint (selectionEnd.Value, selectionEnd.Value, out ex, out ey); - if (sx > ex) { - int tmp = sx; sx = ex; ex = tmp; - } - using (Gdk.GC sgc = new Gdk.GC (GdkWindow)) { - sgc.RgbFgColor = new Color (225, 225, 225); - win.DrawRectangle (sgc, true, sx, top, ex - sx, height + 1); - } - } - - // Draw axes - - Gdk.GC gc = Style.BlackGC; - - foreach (Axis ax in axis) - DrawAxis (win, gc, ax); - - // Draw values - foreach (Serie serie in series) - if (serie.Visible) - DrawSerie (ctx, serie); - - // Draw cursors - foreach (ChartCursor cursor in cursors) - DrawCursor (cursor); - - // Draw cursor labels - foreach (ChartCursor cursor in cursors) - if (cursor.ShowValueLabel) - DrawCursorLabel (cursor); - - ((IDisposable)ctx).Dispose (); - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose args) +// { +// Gdk.Window win = GdkWindow; +// int rwidth, rheight; +// +// Cairo.Context ctx = CairoHelper.Create (win); +// +// win.GetSize (out rwidth, out rheight); +// +// if (autoStartY || autoEndY) { +// double nstartY = double.MaxValue; +// double nendY = double.MinValue; +// GetValueRange (AxisDimension.Y, out nstartY, out nendY); +// +// if (!autoStartY) nstartY = startY; +// if (!autoEndY) nendY = endY; +// if (nendY < nstartY) nendY = nstartY; +// +// if (nstartY != startY || nendY != endY) { +// yrangeChanged = true; +// startY = nstartY; +// endY = nendY; +// } +// } +// +// if (autoStartX || autoEndX) { +// double nstartX = double.MaxValue; +// double nendX = double.MinValue; +// GetValueRange (AxisDimension.X, out nstartX, out nendX); +// +// if (!autoStartX) nstartX = startX; +// if (!autoEndX) nendX = endX; +// if (nendX < nstartX) nendX = nstartX; +// +// if (nstartX != startX || nendX != endX) { +// xrangeChanged = true; +// startX = nstartX; +// endX = nendX; +// } +// } +// +// if (yrangeChanged) { +// FixOrigins (); +// int right = rwidth - 2 - AreaBorderWidth; +// left = AreaBorderWidth; +// left += MeasureAxisSize (AxisPosition.Left) + 1; +// right -= MeasureAxisSize (AxisPosition.Right) + 1; +// yrangeChanged = false; +// width = right - left + 1; +// if (width <= 0) width = 1; +// } +// +// if (xrangeChanged) { +// FixOrigins (); +// int bottom = rheight - 2 - AreaBorderWidth; +// top = AreaBorderWidth; +// bottom -= MeasureAxisSize (AxisPosition.Bottom); +// top += MeasureAxisSize (AxisPosition.Top); +// +// // Make room for cursor handles +// foreach (ChartCursor cursor in cursors) { +// if (cursor.Dimension == AxisDimension.X && top - AreaBorderWidth < cursor.HandleSize) +// top = cursor.HandleSize + AreaBorderWidth; +// } +// +// xrangeChanged = false; +// height = bottom - top + 1; +// if (height <= 0) height = 1; +// } +// +// if (AutoScaleMargin != 0 && height > 0) { +// double margin = (double)AutoScaleMargin * (endY - startY) / (double) height; +// if (autoStartY) startY -= margin; +// if (autoEndY) endY += margin; +// } +// +//// Console.WriteLine ("L:" + left + " T:" + top + " W:" + width + " H:" + height); +// +// // Draw the background +// +// if (backgroundDisplay == BackgroundDisplay.Gradient) { +// ctx.Rectangle (left - 1, top - 1, width + 2, height + 2); +// +// // FIXME: VV: Remove gradient features +// using (var pat = new Cairo.LinearGradient (left - 1, top - 1, left - 1, height + 2)) { +// pat.AddColorStop (0, backroundColor); +// Cairo.Color endc = new Cairo.Color (1,1,1); +// pat.AddColorStop (1, endc); +// ctx.SetSource (pat); +// ctx.Fill (); +// } +// } else { +// ctx.Rectangle (left - 1, top - 1, width + 2, height + 2); +// ctx.SetSourceColor (backroundColor); +// ctx.Fill (); +// } +//// win.DrawRectangle (Style.WhiteGC, true, left - 1, top - 1, width + 2, height + 2); +// win.DrawRectangle (Style.BlackGC, false, left - AreaBorderWidth, top - AreaBorderWidth, width + AreaBorderWidth*2, height + AreaBorderWidth*2); +// +// // Draw selected area +// +// if (enableSelection) { +// int sx, sy, ex, ey; +// GetPoint (selectionStart.Value, selectionStart.Value, out sx, out sy); +// GetPoint (selectionEnd.Value, selectionEnd.Value, out ex, out ey); +// if (sx > ex) { +// int tmp = sx; sx = ex; ex = tmp; +// } +// using (Gdk.GC sgc = new Gdk.GC (GdkWindow)) { +// sgc.RgbFgColor = new Color (225, 225, 225); +// win.DrawRectangle (sgc, true, sx, top, ex - sx, height + 1); +// } +// } +// +// // Draw axes +// +// Gdk.GC gc = Style.BlackGC; +// +// foreach (Axis ax in axis) +// DrawAxis (win, gc, ax); +// +// // Draw values +// foreach (Serie serie in series) +// if (serie.Visible) +// DrawSerie (ctx, serie); +// +// // Draw cursors +// foreach (ChartCursor cursor in cursors) +// DrawCursor (cursor); +// +// // Draw cursor labels +// foreach (ChartCursor cursor in cursors) +// if (cursor.ShowValueLabel) +// DrawCursorLabel (cursor); +// +// ((IDisposable)ctx).Dispose (); +// return true; +// } void GetValueRange (AxisDimension ad, out double min, out double max) { @@ -604,138 +604,138 @@ void GetValueRange (AxisDimension ad, out double min, out double max) } } - void DrawAxis (Gdk.Window win, Gdk.GC gc, Axis ax) - { - double minStep = GetMinTickStep (ax.Dimension); - - TickEnumerator enumSmall = ax.GetTickEnumerator (minStep); - if (enumSmall == null) - return; - - TickEnumerator enumBig = ax.GetTickEnumerator (minStep * 2); - - if (enumBig == null) { - DrawTicks (win, gc, enumSmall, ax.Position, ax.Dimension, ax.TickSize, ax.ShowLabels); - } else { - DrawTicks (win, gc, enumSmall, ax.Position, ax.Dimension, ax.TickSize / 2, false); - DrawTicks (win, gc, enumBig, ax.Position, ax.Dimension, ax.TickSize, ax.ShowLabels); - } - } +// void DrawAxis (Gdk.Window win, Gdk.GC gc, Axis ax) +// { +// double minStep = GetMinTickStep (ax.Dimension); +// +// TickEnumerator enumSmall = ax.GetTickEnumerator (minStep); +// if (enumSmall == null) +// return; +// +// TickEnumerator enumBig = ax.GetTickEnumerator (minStep * 2); +// +// if (enumBig == null) { +// DrawTicks (win, gc, enumSmall, ax.Position, ax.Dimension, ax.TickSize, ax.ShowLabels); +// } else { +// DrawTicks (win, gc, enumSmall, ax.Position, ax.Dimension, ax.TickSize / 2, false); +// DrawTicks (win, gc, enumBig, ax.Position, ax.Dimension, ax.TickSize, ax.ShowLabels); +// } +// } - void DrawTicks (Gdk.Window win, Gdk.GC gc, TickEnumerator e, AxisPosition pos, AxisDimension ad, int tickSize, bool showLabels) - { - int rwidth, rheight; - win.GetSize (out rwidth, out rheight); - - Pango.Layout layout = null; - - if (showLabels) { - layout = new Pango.Layout (this.PangoContext); - layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); - } - - bool isX = pos == AxisPosition.Top || pos == AxisPosition.Bottom; - bool isTop = pos == AxisPosition.Top || pos == AxisPosition.Right; - - double start = GetStart (ad); - double end = GetEnd (ad); - - e.Init (GetOrigin (ad)); - - while (e.CurrentValue > start) - e.MovePrevious (); - - int lastPosLabel; - int lastPos; - int lastTw = 0; - - if (isX) { - lastPosLabel = reverseXAxis ? left + width + MinLabelGapX : left - MinLabelGapX; - lastPos = left - minTickStep*2; - } - else { - lastPosLabel = reverseYAxis ? top - MinLabelGapY : rheight + MinLabelGapY; - lastPos = top + height + minTickStep*2; - } - - for ( ; e.CurrentValue <= end; e.MoveNext ()) - { - int px, py; - int tw = 0, th = 0; - int tick = tickSize; - - GetPoint (e.CurrentValue, e.CurrentValue, out px, out py); - - if (showLabels) { - layout.SetMarkup (e.CurrentLabel); - layout.GetPixelSize (out tw, out th); - } - - if (isX) { - if (Math.Abs ((long)px - (long)lastPos) < minTickStep || px < left || px > left + width) - continue; - lastPos = px; - - bool labelFits = false; - if ((Math.Abs (px - lastPosLabel) - (tw/2) - (lastTw/2)) >= MinLabelGapX) { - lastPosLabel = px; - lastTw = tw; - labelFits = true; - } - - if (isTop) { - if (showLabels) { - if (labelFits) - win.DrawLayout (gc, px - (tw/2), top - AreaBorderWidth - th, layout); - else - tick = tick / 2; - } - win.DrawLine (gc, px, top, px, top + tick); - } - else { - if (showLabels) { - if (labelFits) - win.DrawLayout (gc, px - (tw/2), top + height + AreaBorderWidth, layout); - else - tick = tick / 2; - } - win.DrawLine (gc, px, top + height, px, top + height - tick); - } - } - else { - if (Math.Abs ((long)lastPos - (long)py) < minTickStep || py < top || py > top + height) - continue; - lastPos = py; - - bool labelFits = false; - if ((Math.Abs (py - lastPosLabel) - (th/2) - (lastTw/2)) >= MinLabelGapY) { - lastPosLabel = py; - lastTw = th; - labelFits = true; - } - - if (isTop) { - if (showLabels) { - if (labelFits) - win.DrawLayout (gc, left + width + AreaBorderWidth + 1, py - (th/2), layout); - else - tick = tick / 2; - } - win.DrawLine (gc, left + width, py, left + width - tick, py); - } - else { - if (showLabels) { - if (labelFits) - win.DrawLayout (gc, left - AreaBorderWidth - tw - 1, py - (th/2), layout); - else - tick = tick / 2; - } - win.DrawLine (gc, left, py, left + tick, py); - } - } - } - layout?.Dispose (); - } +// void DrawTicks (Gdk.Window win, Gdk.GC gc, TickEnumerator e, AxisPosition pos, AxisDimension ad, int tickSize, bool showLabels) +// { +// int rwidth, rheight; +// win.GetSize (out rwidth, out rheight); +// +// Pango.Layout layout = null; +// +// if (showLabels) { +// layout = new Pango.Layout (this.PangoContext); +// layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); +// } +// +// bool isX = pos == AxisPosition.Top || pos == AxisPosition.Bottom; +// bool isTop = pos == AxisPosition.Top || pos == AxisPosition.Right; +// +// double start = GetStart (ad); +// double end = GetEnd (ad); +// +// e.Init (GetOrigin (ad)); +// +// while (e.CurrentValue > start) +// e.MovePrevious (); +// +// int lastPosLabel; +// int lastPos; +// int lastTw = 0; +// +// if (isX) { +// lastPosLabel = reverseXAxis ? left + width + MinLabelGapX : left - MinLabelGapX; +// lastPos = left - minTickStep*2; +// } +// else { +// lastPosLabel = reverseYAxis ? top - MinLabelGapY : rheight + MinLabelGapY; +// lastPos = top + height + minTickStep*2; +// } +// +// for ( ; e.CurrentValue <= end; e.MoveNext ()) +// { +// int px, py; +// int tw = 0, th = 0; +// int tick = tickSize; +// +// GetPoint (e.CurrentValue, e.CurrentValue, out px, out py); +// +// if (showLabels) { +// layout.SetMarkup (e.CurrentLabel); +// layout.GetPixelSize (out tw, out th); +// } +// +// if (isX) { +// if (Math.Abs ((long)px - (long)lastPos) < minTickStep || px < left || px > left + width) +// continue; +// lastPos = px; +// +// bool labelFits = false; +// if ((Math.Abs (px - lastPosLabel) - (tw/2) - (lastTw/2)) >= MinLabelGapX) { +// lastPosLabel = px; +// lastTw = tw; +// labelFits = true; +// } +// +// if (isTop) { +// if (showLabels) { +// if (labelFits) +// win.DrawLayout (gc, px - (tw/2), top - AreaBorderWidth - th, layout); +// else +// tick = tick / 2; +// } +// win.DrawLine (gc, px, top, px, top + tick); +// } +// else { +// if (showLabels) { +// if (labelFits) +// win.DrawLayout (gc, px - (tw/2), top + height + AreaBorderWidth, layout); +// else +// tick = tick / 2; +// } +// win.DrawLine (gc, px, top + height, px, top + height - tick); +// } +// } +// else { +// if (Math.Abs ((long)lastPos - (long)py) < minTickStep || py < top || py > top + height) +// continue; +// lastPos = py; +// +// bool labelFits = false; +// if ((Math.Abs (py - lastPosLabel) - (th/2) - (lastTw/2)) >= MinLabelGapY) { +// lastPosLabel = py; +// lastTw = th; +// labelFits = true; +// } +// +// if (isTop) { +// if (showLabels) { +// if (labelFits) +// win.DrawLayout (gc, left + width + AreaBorderWidth + 1, py - (th/2), layout); +// else +// tick = tick / 2; +// } +// win.DrawLine (gc, left + width, py, left + width - tick, py); +// } +// else { +// if (showLabels) { +// if (labelFits) +// win.DrawLayout (gc, left - AreaBorderWidth - tw - 1, py - (th/2), layout); +// else +// tick = tick / 2; +// } +// win.DrawLine (gc, left, py, left + tick, py); +// } +// } +// } +// layout?.Dispose (); +// } int MeasureAxisSize (AxisPosition pos) { @@ -835,70 +835,70 @@ void DrawSerie (Cairo.Context ctx, Serie serie) void DrawCursor (ChartCursor cursor) { - using (Gdk.GC gc = new Gdk.GC (GdkWindow)) { - gc.RgbFgColor = cursor.Color; - - int x, y; - GetPoint (cursor.Value, cursor.Value, out x, out y); - - if (cursor.Dimension == AxisDimension.X) { - int cy = top - AreaBorderWidth - 1; - Point [] ps = new Point [4]; - ps [0] = new Point (x, cy); - ps [1] = new Point (x + (cursor.HandleSize / 2), cy - cursor.HandleSize + 1); - ps [2] = new Point (x - (cursor.HandleSize / 2), cy - cursor.HandleSize + 1); - ps [3] = ps [0]; - GdkWindow.DrawPolygon (gc, false, ps); - if (activeCursor == cursor) - GdkWindow.DrawPolygon (gc, true, ps); - GdkWindow.DrawLine (gc, x, top, x, top + height); - } else { - throw new NotSupportedException (); - } - } +// using (Gdk.GC gc = new Gdk.GC (GdkWindow)) { +// gc.RgbFgColor = cursor.Color; +// +// int x, y; +// GetPoint (cursor.Value, cursor.Value, out x, out y); +// +// if (cursor.Dimension == AxisDimension.X) { +// int cy = top - AreaBorderWidth - 1; +// Point [] ps = new Point [4]; +// ps [0] = new Point (x, cy); +// ps [1] = new Point (x + (cursor.HandleSize / 2), cy - cursor.HandleSize + 1); +// ps [2] = new Point (x - (cursor.HandleSize / 2), cy - cursor.HandleSize + 1); +// ps [3] = ps [0]; +// GdkWindow.DrawPolygon (gc, false, ps); +// if (activeCursor == cursor) +// GdkWindow.DrawPolygon (gc, true, ps); +// GdkWindow.DrawLine (gc, x, top, x, top + height); +// } else { +// throw new NotSupportedException (); +// } +// } } void DrawCursorLabel (ChartCursor cursor) { - using (Gdk.GC gc = new Gdk.GC (GdkWindow)) { - gc.RgbFgColor = cursor.Color; - - int x, y; - GetPoint (cursor.Value, cursor.Value, out x, out y); - - if (cursor.Dimension == AxisDimension.X) { - - string text; - - if (cursor.LabelAxis != null) { - double minStep = GetMinTickStep (cursor.Dimension); - TickEnumerator tenum = cursor.LabelAxis.GetTickEnumerator (minStep); - tenum.Init (cursor.Value); - text = tenum.CurrentLabel; - } else { - text = GetValueLabel (cursor.Dimension, cursor.Value); - } - - if (text != null && text.Length > 0) { - Pango.Layout layout = new Pango.Layout (this.PangoContext); - layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); - layout.SetMarkup (text); - - int tw, th; - layout.GetPixelSize (out tw, out th); - int tl = x - tw / 2; - int tt = top + 4; - if (tl + tw + 2 >= left + width) tl = left + width - tw - 1; - if (tl < left + 1) tl = left + 1; - GdkWindow.DrawRectangle (Style.WhiteGC, true, tl - 1, tt - 1, tw + 2, th + 2); - GdkWindow.DrawRectangle (Style.BlackGC, false, tl - 2, tt - 2, tw + 3, th + 3); - GdkWindow.DrawLayout (gc, tl, tt, layout); - layout.Dispose (); - } - } else { - throw new NotSupportedException (); - } - } +// using (Gdk.GC gc = new Gdk.GC (GdkWindow)) { +// gc.RgbFgColor = cursor.Color; +// +// int x, y; +// GetPoint (cursor.Value, cursor.Value, out x, out y); +// +// if (cursor.Dimension == AxisDimension.X) { +// +// string text; +// +// if (cursor.LabelAxis != null) { +// double minStep = GetMinTickStep (cursor.Dimension); +// TickEnumerator tenum = cursor.LabelAxis.GetTickEnumerator (minStep); +// tenum.Init (cursor.Value); +// text = tenum.CurrentLabel; +// } else { +// text = GetValueLabel (cursor.Dimension, cursor.Value); +// } +// +// if (text != null && text.Length > 0) { +// Pango.Layout layout = new Pango.Layout (this.PangoContext); +// layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); +// layout.SetMarkup (text); +// +// int tw, th; +// layout.GetPixelSize (out tw, out th); +// int tl = x - tw / 2; +// int tt = top + 4; +// if (tl + tw + 2 >= left + width) tl = left + width - tw - 1; +// if (tl < left + 1) tl = left + 1; +// GdkWindow.DrawRectangle (Style.WhiteGC, true, tl - 1, tt - 1, tw + 2, th + 2); +// GdkWindow.DrawRectangle (Style.BlackGC, false, tl - 2, tt - 2, tw + 3, th + 3); +// GdkWindow.DrawLayout (gc, tl, tt, layout); +// layout.Dispose (); +// } +// } else { +// throw new NotSupportedException (); +// } +// } } void GetPoint (double wx, double wy, out int x, out int y) @@ -947,7 +947,7 @@ string GetValueLabel (AxisDimension ad, double value) return null; } - internal void OnLayoutChanged () + /*internal*/public void OnLayoutChanged () { xrangeChanged = true; yrangeChanged = true; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandCheckMenuItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandCheckMenuItem.cs index 8333696daa4..9c45d63e5f1 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandCheckMenuItem.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandCheckMenuItem.cs @@ -141,8 +141,8 @@ void Update (CommandInfo cmdInfo) label.Xalign = 0.0f; label.Show (); - ((Gtk.Box) child).PackStart (label); - ((Gtk.Box) child).PackStart (accel_label); + ((Gtk.Box) child).PackStart (label, false, true, 0); + ((Gtk.Box) child).PackStart (accel_label, false, true, 0); child.Show (); this.Remove (Child); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenu.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenu.cs index 22abd3aa5fd..759f515125d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenu.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenu.cs @@ -101,10 +101,16 @@ protected override void OnRealized () EnsurePopulated (); } - protected override void OnSizeRequested (ref Gtk.Requisition requisition) + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { EnsurePopulated (); - base.OnSizeRequested (ref requisition); + base.OnGetPreferredHeight (out min_height, out natural_height); + } + + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) + { + EnsurePopulated (); + base.OnGetPreferredWidth (out min_width, out natural_width); } internal void Update () diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs index 3302f8da77b..d69476fa79b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs @@ -43,16 +43,16 @@ internal CommandManager CommandManager { get { return manager; } } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - using (var context = Gdk.CairoHelper.Create (evnt.Window)) { - context.SetSourceColor (Style.Light (StateType.Normal).ToCairoColor ()); - context.Paint (); - } - - foreach (Gtk.Widget child in Children) - (this as Gtk.Container).PropagateExpose (child, evnt); - return false; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { +// context.SetSourceColor (Style.Light (StateType.Normal).ToCairoColor ()); +// context.Paint (); +// } +// +// foreach (Gtk.Widget child in Children) +// (this as Gtk.Container).PropagateExpose (child, evnt); +// return false; +// } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs index 896dc4d5737..0bbe56c5f39 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs @@ -209,8 +209,8 @@ void Update (CommandInfo cmdInfo) label.Xalign = 0.0f; label.Show (); - ((Gtk.Box) child).PackStart (label); - ((Gtk.Box) child).PackStart (accel_label); + ((Gtk.Box) child).PackStart (label, false, true, 0); + ((Gtk.Box) child).PackStart (accel_label, false, true, 0); child.Show (); this.Remove (Child); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs index 41f3709714a..bcd995d8110 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs @@ -246,18 +246,18 @@ protected override void OnRealized () base.OnRealized (); GdkWindow.Opacity = 0.4; } - protected override bool OnExposeEvent (EventExpose evnt) - { - int w, h; - GetSize (out w, out h); - - using (var ctx = CairoHelper.Create (evnt.Window)) { - ctx.SetSourceColor (new Cairo.Color (0.17, 0.55, 0.79)); - ctx.Rectangle (Allocation.ToCairoRect ()); - ctx.Fill (); - } - return true; - } +// protected override bool OnExposeEvent (EventExpose evnt) +// { +// int w, h; +// GetSize (out w, out h); +// +// using (var ctx = CairoHelper.Create (evnt.Window)) { +// ctx.SetSourceColor (new Cairo.Color (0.17, 0.55, 0.79)); +// ctx.Rectangle (Allocation.ToCairoRect ()); +// ctx.Fill (); +// } +// return true; +// } public void Relocate (int x, int y, int w, int h, bool animate) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs index 8fbd898711c..85501ec62f2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs @@ -165,7 +165,7 @@ public TabStrip (DockNotebook notebook) Add (innerBox); this.notebook = notebook; - WidgetFlags |= Gtk.WidgetFlags.AppPaintable; + this.AppPaintable = true; Events |= EventMask.PointerMotionMask | EventMask.LeaveNotifyMask | EventMask.ButtonPressMask; var arr = new Xwt.ImageView (tabbarPrevImage); @@ -235,7 +235,7 @@ public TabStrip (DockNotebook notebook) tab.AccessibilityPressCloseButton += OnAccessibilityPressCloseButton; tab.AccessibilityShowMenu += OnAccessibilityShowMenu; } - } + } UpdateAccessibilityTabs (); notebook.PageAdded += PageAddedHandler; notebook.PageRemoved += PageRemovedHandler; @@ -254,14 +254,14 @@ protected override void OnDestroyed () void PageAddedHandler (object sender, TabEventArgs args) { - var tab = args.Tab; + var tab = args.Tab; - if (tab.Accessible != null) { + if (tab.Accessible != null) { Accessible.AddAccessibleElement (tab.Accessible); - Accessible.AddAccessibleElement (tab.CloseButtonAccessible); - - tab.AccessibilityPressTab += OnAccessibilityPressTab; - tab.AccessibilityPressCloseButton += OnAccessibilityPressCloseButton; + Accessible.AddAccessibleElement (tab.CloseButtonAccessible); + + tab.AccessibilityPressTab += OnAccessibilityPressTab; + tab.AccessibilityPressCloseButton += OnAccessibilityPressCloseButton; tab.AccessibilityShowMenu += OnAccessibilityShowMenu; } @@ -272,13 +272,13 @@ void PageAddedHandler (object sender, TabEventArgs args) void PageRemovedHandler (object sender, TabEventArgs args) { - var tab = args.Tab; + var tab = args.Tab; + + if (tab.Accessible != null) { + tab.AccessibilityPressTab -= OnAccessibilityPressTab; + tab.AccessibilityPressCloseButton -= OnAccessibilityPressCloseButton; + tab.AccessibilityShowMenu -= OnAccessibilityShowMenu; - if (tab.Accessible != null) { - tab.AccessibilityPressTab -= OnAccessibilityPressTab; - tab.AccessibilityPressCloseButton -= OnAccessibilityPressCloseButton; - tab.AccessibilityShowMenu -= OnAccessibilityShowMenu; - Accessible.RemoveAccessibleElement (tab.Accessible); Accessible.RemoveAccessibleElement (tab.CloseButtonAccessible); } @@ -290,11 +290,11 @@ void PageRemovedHandler (object sender, TabEventArgs args) UpdateAccessibilityTabs (); } - void PageReorderedHandler (DockNotebookTab tab, int oldPlacement, int newPlacement) + void PageReorderedHandler (DockNotebookTab tab, int oldPlacement, int newPlacement) { QueueResize (); - UpdateAccessibilityTabs (); + UpdateAccessibilityTabs (); } void UpdateAccessibilityTabs () @@ -356,11 +356,16 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) Update (); } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) + { + base.OnGetPreferredWidth (out min_width, out natural_width); + min_width = 0; + } + + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - base.OnSizeRequested (ref requisition); - requisition.Height = TotalHeight; - requisition.Width = 0; + base.OnGetPreferredHeight (out min_height, out natural_height); + min_height = TotalHeight; } internal void InitSize () @@ -1120,17 +1125,17 @@ void Draw (Context ctx) drawActive?.Invoke (ctx); if (HasFocus) { - Gtk.Style.PaintFocus (Style, GdkWindow, State, focusRect, this, "tab", focusRect.X, focusRect.Y, focusRect.Width, focusRect.Height); + Gtk.Style.PaintFocus (Style, ctx, State, /*focusRect,*/ this, "tab", focusRect.X, focusRect.Y, focusRect.Width, focusRect.Height); } } - protected override bool OnExposeEvent (EventExpose evnt) - { - using (var context = CairoHelper.Create (evnt.Window)) { - Draw (context); - } - return base.OnExposeEvent (evnt); - } +// protected override bool OnExposeEvent (EventExpose evnt) +// { +// using (var context = CairoHelper.Create (evnt.Window)) { +// Draw (context); +// } +// return base.OnExposeEvent (evnt); +// } void DrawTab (Context ctx, DockNotebookTab tab, Gdk.Rectangle allocation, Gdk.Rectangle tabBounds, bool highlight, bool active, bool dragging, Pango.Layout la, bool focused) { @@ -1199,7 +1204,7 @@ void DrawTab (Context ctx, DockNotebookTab tab, Gdk.Rectangle allocation, Gdk.Re ctx.SetSource (lg); Pango.CairoHelper.ShowLayout (ctx, la.GetLine (0).Layout); } - } + } la.Dispose (); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs index 64b1158b837..47502caf7f2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs @@ -148,7 +148,7 @@ public AutoHideBox (DockFrame frame, DockItem item, Gtk.PositionType pos, int si sepBox.ButtonPressEvent += OnSizeButtonPress; sepBox.ButtonReleaseEvent += OnSizeButtonRelease; sepBox.MotionNotifyEvent += OnSizeMotion; - sepBox.ExposeEvent += OnGripExpose; +// sepBox.ExposeEvent += OnGripExpose; sepBox.EnterNotifyEvent += delegate { insideGrip = true; sepBox.QueueDraw (); }; sepBox.LeaveNotifyEvent += delegate { insideGrip = false; sepBox.QueueDraw (); }; } @@ -361,16 +361,16 @@ void OnSizeMotion (object ob, Gtk.MotionNotifyEventArgs args) } } - void OnGripExpose (object sender, Gtk.ExposeEventArgs args) - { - var w = (EventBox) sender; - StateType s = insideGrip ? StateType.Prelight : StateType.Normal; - - using (var ctx = CairoHelper.Create (args.Event.Window)) { - ctx.SetSourceColor (w.Style.Background (s).ToCairoColor ()); - ctx.Paint (); - } - } +// void OnGripExpose (object sender, Gtk.ExposeEventArgs args) +// { +// var w = (EventBox) sender; +// StateType s = insideGrip ? StateType.Prelight : StateType.Normal; +// +// using (var ctx = CairoHelper.Create (args.Event.Window)) { +// ctx.SetSourceColor (w.Style.Background (s).ToCairoColor ()); +// ctx.Paint (); +// } +// } } class ScrollableContainer: EventBox @@ -396,15 +396,24 @@ public void SetSize (PositionType expandPosition, int targetSize) QueueResize (); } - protected override void OnSizeRequested (ref Requisition req) + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) + { + base.OnGetPreferredHeight (out min_height, out natural_height); + if (scrollMode || Child == null) { + min_height = 0; + } + else + min_height = Child.SizeRequest ().Height; + } + + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { - base.OnSizeRequested (ref req); + base.OnGetPreferredWidth (out min_width, out natural_width); if (scrollMode || Child == null) { - req.Width = 0; - req.Height = 0; + min_width = 0; } else - req = Child.SizeRequest (); + min_width = Child.SizeRequest ().Width; } protected override void OnSizeAllocated (Rectangle alloc) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs index d269d7b6f10..8cb3215ea29 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs @@ -61,7 +61,7 @@ internal DockBar (DockFrame frame, Gtk.PositionType position) filler = new Label (); filler.WidthRequest = 4; filler.HeightRequest = 4; - box.PackEnd (filler); + box.PackEnd (filler, false, true, 0); ShowAll (); UpdateVisibility (); @@ -125,7 +125,7 @@ internal DockBarItem AddItem (DockItem item, int size) it.ShowAll (); UpdateVisibility (); it.Shown += OnItemVisibilityChanged; - it.Hidden += OnItemVisibilityChanged; + it.Hidden += OnItemVisibilityChanged; return it; } @@ -160,7 +160,7 @@ internal void UpdateVisibility () internal void RemoveItem (DockBarItem it) { DisableHoverActivation (); - box.Remove (it); + box.Remove (it); it.Shown -= OnItemVisibilityChanged; it.Hidden -= OnItemVisibilityChanged; UpdateVisibility (); @@ -181,16 +181,25 @@ internal void UpdateStyle (DockItem item) { } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - base.OnSizeRequested (ref requisition); + base.OnGetPreferredHeight (out min_height, out natural_height); + + if (ShowBorder) { + // Add space for the separator + if (Orientation == Gtk.Orientation.Horizontal) + min_height++; + } + } + + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) + { + base.OnGetPreferredWidth (out min_width, out natural_width); if (ShowBorder) { // Add space for the separator if (Orientation == Gtk.Orientation.Vertical) - requisition.Width++; - else - requisition.Height++; + min_width++; } } @@ -208,35 +217,35 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) } } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - var alloc = Allocation; - using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { - ctx.Rectangle (alloc.X, alloc.Y, alloc.X + alloc.Width, alloc.Y + alloc.Height); - ctx.SetSourceColor (Styles.DockBarBackground.ToCairoColor ()); - ctx.Fill (); - } - - if (Child != null) - PropagateExpose (Child, evnt); - - if (ShowBorder) { - using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { - ctx.LineWidth = 1; - - // Dark separator - switch (Position) { - case PositionType.Left:ctx.MoveTo (alloc.X + alloc.Width - 0.5, alloc.Y); ctx.RelLineTo (0, Allocation.Height); break; - case PositionType.Right: ctx.MoveTo (alloc.X + 0.5, alloc.Y); ctx.RelLineTo (0, Allocation.Height); break; - case PositionType.Top: ctx.MoveTo (alloc.X, alloc.Y + alloc.Height + 0.5); ctx.RelLineTo (Allocation.Width, 0); break; - case PositionType.Bottom: ctx.MoveTo (alloc.X, alloc.Y + 0.5); ctx.RelLineTo (Allocation.Width, 0); break; - } - ctx.SetSourceColor (Styles.DockSeparatorColor.ToCairoColor ()); - ctx.Stroke (); - } - } - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// var alloc = Allocation; +// using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { +// ctx.Rectangle (alloc.X, alloc.Y, alloc.X + alloc.Width, alloc.Y + alloc.Height); +// ctx.SetSourceColor (Styles.DockBarBackground.ToCairoColor ()); +// ctx.Fill (); +// } +// +// if (Child != null) +// PropagateExpose (Child, evnt); +// +// if (ShowBorder) { +// using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { +// ctx.LineWidth = 1; +// +// // Dark separator +// switch (Position) { +// case PositionType.Left:ctx.MoveTo (alloc.X + alloc.Width - 0.5, alloc.Y); ctx.RelLineTo (0, Allocation.Height); break; +// case PositionType.Right: ctx.MoveTo (alloc.X + 0.5, alloc.Y); ctx.RelLineTo (0, Allocation.Height); break; +// case PositionType.Top: ctx.MoveTo (alloc.X, alloc.Y + alloc.Height + 0.5); ctx.RelLineTo (Allocation.Width, 0); break; +// case PositionType.Bottom: ctx.MoveTo (alloc.X, alloc.Y + 0.5); ctx.RelLineTo (Allocation.Width, 0); break; +// } +// ctx.SetSourceColor (Styles.DockSeparatorColor.ToCairoColor ()); +// ctx.Stroke (); +// } +// } +// return true; +// } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs index 28c94b36e51..2bf25a4cb6d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs @@ -87,27 +87,33 @@ protected override void OnDestroyed () base.OnDestroyed (); } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - base.OnSizeRequested (ref requisition); + base.OnGetPreferredHeight (out min_height, out natural_height); - requisition.Width = (int) primary.Width; - requisition.Height = (int) primary.Height; + min_height = (int) primary.Height; } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { - using (Cairo.Context context = Gdk.CairoHelper.Create (evnt.Window)) { - if (secondaryOpacity < 1.0f) - RenderIcon (context, primary, 1.0f - (float)Math.Pow (secondaryOpacity, 3.0f)); + base.OnGetPreferredWidth (out min_width, out natural_width); - if (secondaryOpacity > 0.0f) - RenderIcon (context, secondary, secondaryOpacity); - } - - return false; + min_width = (int) primary.Width; } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// using (Cairo.Context context = Gdk.CairoHelper.Create (evnt.Window)) { +// if (secondaryOpacity < 1.0f) +// RenderIcon (context, primary, 1.0f - (float)Math.Pow (secondaryOpacity, 3.0f)); +// +// if (secondaryOpacity > 0.0f) +// RenderIcon (context, secondary, secondaryOpacity); +// } +// +// return false; +// } + void RenderIcon (Cairo.Context context, Xwt.Drawing.Image surface, double opacity) { context.DrawImage (this, surface.WithAlpha (opacity), @@ -503,44 +509,44 @@ protected override bool OnButtonReleaseEvent (Gdk.EventButton evnt) return true; } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - using (var context = Gdk.CairoHelper.Create (evnt.Window)) { - var alloc = Allocation; - - // TODO: VV: Remove preflight gradient features and replace with a flat color - - Cairo.LinearGradient lg; - - if (bar.Orientation == Orientation.Horizontal) { - lg = new Cairo.LinearGradient (alloc.X, 0, alloc.X + alloc.Width, 0); - } else { - lg = new Cairo.LinearGradient (0, alloc.Y, 0, alloc.Y + alloc.Height); - } - - using (lg) { - Cairo.Color primaryColor = Styles.DockBarPrelightColor.ToCairoColor (); - primaryColor.A = hoverProgress; - - Cairo.Color transparent = primaryColor; - transparent.A = 0; - - lg.AddColorStop (0.0, transparent); - lg.AddColorStop (0.35, primaryColor); - lg.AddColorStop (0.65, primaryColor); - lg.AddColorStop (1.0, transparent); - - context.Rectangle (alloc.ToCairoRect ()); - context.SetSource (lg); - } - context.Fill (); - } - - if (HasFocus) { - Gtk.Style.PaintFocus (Style, GdkWindow, State, Allocation, this, "button", Allocation.X + 2, Allocation.Y + 2, Allocation.Width - 4, Allocation.Height - 4); - } - return base.OnExposeEvent (evnt); - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { +// var alloc = Allocation; +// +// // TODO: VV: Remove preflight gradient features and replace with a flat color +// +// Cairo.LinearGradient lg; +// +// if (bar.Orientation == Orientation.Horizontal) { +// lg = new Cairo.LinearGradient (alloc.X, 0, alloc.X + alloc.Width, 0); +// } else { +// lg = new Cairo.LinearGradient (0, alloc.Y, 0, alloc.Y + alloc.Height); +// } +// +// using (lg) { +// Cairo.Color primaryColor = Styles.DockBarPrelightColor.ToCairoColor (); +// primaryColor.A = hoverProgress; +// +// Cairo.Color transparent = primaryColor; +// transparent.A = 0; +// +// lg.AddColorStop (0.0, transparent); +// lg.AddColorStop (0.35, primaryColor); +// lg.AddColorStop (0.65, primaryColor); +// lg.AddColorStop (1.0, transparent); +// +// context.Rectangle (alloc.ToCairoRect ()); +// context.SetSource (lg); +// } +// context.Fill (); +// } +// +// if (HasFocus) { +// Gtk.Style.PaintFocus (Style, GdkWindow, State, Allocation, this, "button", Allocation.X + 2, Allocation.Y + 2, Allocation.Width - 4, Allocation.Height - 4); +// } +// return base.OnExposeEvent (evnt); +// } protected override bool OnFocusInEvent (Gdk.EventFocus evnt) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs index 16b90c98549..6243593022a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs @@ -132,11 +132,23 @@ public void StoreAllocation () layout.StoreAllocation (); } - protected override void OnSizeRequested (ref Requisition req) + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { + natural_width = 0; + min_width = 0; if (layout != null) { LayoutWidgets (); - req = layout.SizeRequest (); + min_width = layout.SizeRequest ().Width; + } + } + + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) + { + natural_height = 0; + min_height = 0; + if (layout != null) { + LayoutWidgets (); + min_height = layout.SizeRequest ().Height; } } @@ -193,15 +205,15 @@ protected override void ForAll (bool include_internals, Gtk.Callback callback) callback (s); } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - bool res = base.OnExposeEvent (evnt); - - if (layout != null) { - layout.Draw (evnt.Area, null, 0); - } - return res; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// bool res = base.OnExposeEvent (evnt); +// +// if (layout != null) { +// layout.Draw (evnt.Area, null, 0); +// } +// return res; +// } protected override void OnAdded (Widget widget) { @@ -351,17 +363,17 @@ int CountRequiredSplitters (DockGroup grp) protected override void OnRealized () { - WidgetFlags |= WidgetFlags.Realized; - + this.IsRealized = true; + Gdk.WindowAttr attributes = new Gdk.WindowAttr (); attributes.X = Allocation.X; attributes.Y = Allocation.Y; attributes.Height = Allocation.Height; attributes.Width = Allocation.Width; attributes.WindowType = Gdk.WindowType.Child; - attributes.Wclass = Gdk.WindowClass.InputOutput; +// attributes.Wclass = Gdk.WindowClass.InputOutput; attributes.Visual = Visual; - attributes.Colormap = Colormap; +// attributes.Colormap = Colormap; attributes.EventMask = (int)(Events | Gdk.EventMask.ExposureMask | Gdk.EventMask.Button1MotionMask | @@ -371,15 +383,15 @@ protected override void OnRealized () Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | - Gdk.WindowAttributesType.Colormap | +// Gdk.WindowAttributesType.Colormap | Gdk.WindowAttributesType.Visual; GdkWindow = new Gdk.Window (ParentWindow, attributes, (int)attributes_mask); GdkWindow.UserData = Handle; Style = Style.Attach (GdkWindow); Style.SetBackground (GdkWindow, State); - this.WidgetFlags &= ~WidgetFlags.NoWindow; - + this.HasWindow = true; + //GdkWindow.SetBackPixmap (null, true); ModifyBase (StateType.Normal, Styles.DockFrameBackground.ToGdkColor ()); @@ -390,7 +402,7 @@ protected override void OnUnrealized () if (this.GdkWindow != null) { this.GdkWindow.UserData = IntPtr.Zero; this.GdkWindow.Destroy (); - this.WidgetFlags |= WidgetFlags.NoWindow; + this.HasWindow = false; } base.OnUnrealized (); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs index 22d2b6dc898..ba7c8804d96 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs @@ -948,7 +948,7 @@ internal void AddTopLevel (DockFrameTopLevel w, int x, int y, int width, int hei w.Parent = this; w.Size = new Size (width, height); Requisition r = w.SizeRequest (); - w.Allocation = new Gdk.Rectangle (Allocation.X + x, Allocation.Y + y, r.Width, r.Height); +// w.Allocation = new Gdk.Rectangle (Allocation.X + x, Allocation.Y + y, r.Width, r.Height); topLevels.Add (w); } } @@ -1094,15 +1094,22 @@ internal void AutoHide (DockItem item, AutoHideBox widget, bool animate) RemoveTopLevel (widget); widget.Disposed = true; - widget.Destroy (); + widget.Destroy (); } } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { if (overlayWidget != null) overlayWidget.SizeRequest (); - base.OnSizeRequested (ref requisition); + base.OnGetPreferredWidth (out min_width, out natural_width); + } + + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) + { + if (overlayWidget != null) + overlayWidget.SizeRequest (); + base.OnGetPreferredHeight (out min_height, out natural_height); } protected override void OnSizeAllocated (Rectangle allocation) @@ -1139,15 +1146,15 @@ internal void MinimizeAllAutohidden () if (it.Visible && it.Status == DockItemStatus.AutoHide) it.Minimize (); } - } - - static internal bool IsWindows { - get { return System.IO.Path.DirectorySeparatorChar == '\\'; } - } - - internal static Cairo.Color ToCairoColor (Gdk.Color color) - { - return new Cairo.Color (color.Red / (double) ushort.MaxValue, color.Green / (double) ushort.MaxValue, color.Blue / (double) ushort.MaxValue); + } + + static internal bool IsWindows { + get { return System.IO.Path.DirectorySeparatorChar == '\\'; } + } + + internal static Cairo.Color ToCairoColor (Gdk.Color color) + { + return new Cairo.Color (color.Red / (double) ushort.MaxValue, color.Green / (double) ushort.MaxValue, color.Blue / (double) ushort.MaxValue); } protected override bool OnFocused (DirectionType direction) @@ -1159,7 +1166,7 @@ protected override bool OnFocused (DirectionType direction) } return base.OnFocused (direction); - } + } } public class DockStyle diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs index 3733a8b4a46..4727a51f77c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs @@ -873,11 +873,11 @@ void DrawSeparators (Gdk.Rectangle exposedArea, DockGroup currentHandleGrp, int int hw = horiz ? Frame.HandleSize : Allocation.Width; int hh = horiz ? Allocation.Height : Frame.HandleSize; - Gdk.GC hgc = null; +// Gdk.GC hgc = null; if (areasList == null && oper == DrawSeparatorOperation.Draw) { - hgc = new Gdk.GC (Frame.Container.GdkWindow); - hgc.RgbFgColor = Styles.DockFrameBackground.ToGdkColor (); +// hgc = new Gdk.GC (Frame.Container.GdkWindow); +// hgc.RgbFgColor = Styles.DockFrameBackground.ToGdkColor (); } for (int n=0; n leftMargin + rightMargin + leftPadding + rightPadding) { allocation.X += leftMargin + leftPadding; @@ -288,76 +298,76 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) allocation.Height -= topMargin + bottomMargin + topPadding + bottomPadding; } if (child != null) - child.SizeAllocate (allocation); - } - - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - Gdk.Rectangle rect = Allocation; - - //Gdk.Rectangle.Right and Bottom are inconsistent - int right = rect.X + rect.Width, bottom = rect.Y + rect.Height; - - var bcolor = backgroundColorSet ? BackgroundColor : Style.Background (Gtk.StateType.Normal); - using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) { - - if (GradientBackround) { - cr.NewPath (); - cr.MoveTo (rect.X, rect.Y); - cr.RelLineTo (rect.Width, 0); - cr.RelLineTo (0, rect.Height); - cr.RelLineTo (-rect.Width, 0); - cr.RelLineTo (0, -rect.Height); - cr.ClosePath (); - - // FIXME: VV: Remove gradient features - using (Cairo.Gradient pat = new Cairo.LinearGradient (rect.X, rect.Y, rect.X, bottom)) { - pat.AddColorStop (0, bcolor.ToCairoColor ()); - Xwt.Drawing.Color gcol = bcolor.ToXwtColor (); - gcol.Light -= 0.1; - if (gcol.Light < 0) - gcol.Light = 0; - pat.AddColorStop (1, gcol.ToCairoColor ()); - cr.SetSource (pat); - cr.Fill (); - } - } else { - if (backgroundColorSet) { - Gdk.GC gc = new Gdk.GC (GdkWindow); - gc.RgbFgColor = bcolor; - evnt.Window.DrawRectangle (gc, true, rect.X, rect.Y, rect.Width, rect.Height); - gc.Dispose (); - } - } - - } - base.OnExposeEvent (evnt); - - using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) { - cr.SetSourceColor (BorderColor.ToCairoColor ()); - - double y = rect.Y + topMargin / 2d; - cr.LineWidth = topMargin; - cr.Line (rect.X, y, right, y); - cr.Stroke (); - - y = bottom - bottomMargin / 2d; - cr.LineWidth = bottomMargin; - cr.Line (rect.X, y, right, y); - cr.Stroke (); - - double x = rect.X + leftMargin / 2d; - cr.LineWidth = leftMargin; - cr.Line (x, rect.Y, x, bottom); - cr.Stroke (); - - x = right - rightMargin / 2d; - cr.LineWidth = rightMargin; - cr.Line (x, rect.Y, x, bottom); - cr.Stroke (); + child.SizeAllocate (allocation); + } - return false; - } - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// Gdk.Rectangle rect = Allocation; +// +// //Gdk.Rectangle.Right and Bottom are inconsistent +// int right = rect.X + rect.Width, bottom = rect.Y + rect.Height; +// +// var bcolor = backgroundColorSet ? BackgroundColor : Style.Background (Gtk.StateType.Normal); +// using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) { +// +// if (GradientBackround) { +// cr.NewPath (); +// cr.MoveTo (rect.X, rect.Y); +// cr.RelLineTo (rect.Width, 0); +// cr.RelLineTo (0, rect.Height); +// cr.RelLineTo (-rect.Width, 0); +// cr.RelLineTo (0, -rect.Height); +// cr.ClosePath (); +// +// // FIXME: VV: Remove gradient features +// using (Cairo.Gradient pat = new Cairo.LinearGradient (rect.X, rect.Y, rect.X, bottom)) { +// pat.AddColorStop (0, bcolor.ToCairoColor ()); +// Xwt.Drawing.Color gcol = bcolor.ToXwtColor (); +// gcol.Light -= 0.1; +// if (gcol.Light < 0) +// gcol.Light = 0; +// pat.AddColorStop (1, gcol.ToCairoColor ()); +// cr.SetSource (pat); +// cr.Fill (); +// } +// } else { +// if (backgroundColorSet) { +// Gdk.GC gc = new Gdk.GC (GdkWindow); +// gc.RgbFgColor = bcolor; +// evnt.Window.DrawRectangle (gc, true, rect.X, rect.Y, rect.Width, rect.Height); +// gc.Dispose (); +// } +// } +// +// } +// base.OnExposeEvent (evnt); +// +// using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) { +// cr.SetSourceColor (BorderColor.ToCairoColor ()); +// +// double y = rect.Y + topMargin / 2d; +// cr.LineWidth = topMargin; +// cr.Line (rect.X, y, right, y); +// cr.Stroke (); +// +// y = bottom - bottomMargin / 2d; +// cr.LineWidth = bottomMargin; +// cr.Line (rect.X, y, right, y); +// cr.Stroke (); +// +// double x = rect.X + leftMargin / 2d; +// cr.LineWidth = leftMargin; +// cr.Line (x, rect.Y, x, bottom); +// cr.Stroke (); +// +// x = right - rightMargin / 2d; +// cr.LineWidth = rightMargin; +// cr.Line (x, rect.Y, x, bottom); +// cr.Stroke (); +// +// return false; +// } +// } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs index d4532109acc..efc50ce765b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs @@ -187,10 +187,10 @@ void UpdateVisualStyle () if (!(Parent is TabStrip.TabStripBox)) labelWidget.Xalign = 0; - } - - if (tabIcon != null) { - tabIcon.Image = tabIcon.Image.WithAlpha (active ? 1.0 : inactiveIconAlpha); + } + + if (tabIcon != null) { + tabIcon.Image = tabIcon.Image.WithAlpha (active ? 1.0 : inactiveIconAlpha); tabIcon.Visible = visualStyle.ShowPadTitleIcon.Value; } @@ -214,82 +214,82 @@ public void SetLabel (Gtk.Widget page, Xwt.Drawing.Image icon, string label) { string labelNoSpaces = label != null ? label.Replace (' ', '-') : null; this.label = label; - this.page = page; - - if (icon == null) + this.page = page; + + if (icon == null) icon = ImageService.GetIcon ("md-empty"); - if (box == null) { - box = new HBox (); - box.Accessible.SetShouldIgnore (true); - box.Spacing = -2; - - tabIcon = new ImageView (); - tabIcon.Accessible.SetShouldIgnore (true); - tabIcon.Show (); + if (box == null) { + box = new HBox (); + box.Accessible.SetShouldIgnore (true); + box.Spacing = -2; + + tabIcon = new ImageView (); + tabIcon.Accessible.SetShouldIgnore (true); + tabIcon.Show (); box.PackStart (tabIcon, false, false, 3); labelWidget = new ExtendedLabel (label); // Ignore the label because the title tab already contains its name - labelWidget.Accessible.SetShouldIgnore (true); - labelWidget.UseMarkup = true; - var alignLabel = new Alignment (0.0f, 0.5f, 1, 1); - alignLabel.Accessible.SetShouldIgnore (true); - alignLabel.BottomPadding = 0; - alignLabel.RightPadding = 15; - alignLabel.Add (labelWidget); - box.PackStart (alignLabel, false, false, 0); - - btnDock = new ImageButton (); - btnDock.Image = pixAutoHide; - btnDock.TooltipText = GettextCatalog.GetString ("Auto Hide"); + labelWidget.Accessible.SetShouldIgnore (true); + labelWidget.UseMarkup = true; + var alignLabel = new Alignment (0.0f, 0.5f, 1, 1); + alignLabel.Accessible.SetShouldIgnore (true); + alignLabel.BottomPadding = 0; + alignLabel.RightPadding = 15; + alignLabel.Add (labelWidget); + box.PackStart (alignLabel, false, false, 0); + + btnDock = new ImageButton (); + btnDock.Image = pixAutoHide; + btnDock.TooltipText = GettextCatalog.GetString ("Auto Hide"); btnDock.CanFocus = true; // btnDock.WidthRequest = btnDock.HeightRequest = 17; - btnDock.Clicked += OnClickDock; - btnDock.ButtonPressEvent += (o, args) => args.RetVal = true; - btnDock.WidthRequest = btnDock.SizeRequest ().Width; - UpdateDockButtonAccessibilityLabels (); - - btnClose = new ImageButton (); - btnClose.Image = pixClose; - btnClose.TooltipText = GettextCatalog.GetString ("Close"); + btnDock.Clicked += OnClickDock; + btnDock.ButtonPressEvent += (o, args) => args.RetVal = true; + btnDock.WidthRequest = btnDock.SizeRequest ().Width; + UpdateDockButtonAccessibilityLabels (); + + btnClose = new ImageButton (); + btnClose.Image = pixClose; + btnClose.TooltipText = GettextCatalog.GetString ("Close"); btnClose.CanFocus = true; // btnClose.WidthRequest = btnClose.HeightRequest = 17; - btnClose.WidthRequest = btnDock.SizeRequest ().Width; - btnClose.Clicked += delegate { - item.Visible = false; - }; - btnClose.ButtonPressEvent += (o, args) => args.RetVal = true; - - al = new Alignment (0, 0.5f, 1, 1); - al.Accessible.SetShouldIgnore (true); - HBox btnBox = new HBox (false, 0); - btnBox.Accessible.SetShouldIgnore (true); - btnBox.PackStart (btnDock, false, false, 3); - btnBox.PackStart (btnClose, false, false, 1); - al.Add (btnBox); - box.PackEnd (al, false, false, 3); - + btnClose.WidthRequest = btnDock.SizeRequest ().Width; + btnClose.Clicked += delegate { + item.Visible = false; + }; + btnClose.ButtonPressEvent += (o, args) => args.RetVal = true; + + al = new Alignment (0, 0.5f, 1, 1); + al.Accessible.SetShouldIgnore (true); + HBox btnBox = new HBox (false, 0); + btnBox.Accessible.SetShouldIgnore (true); + btnBox.PackStart (btnDock, false, false, 3); + btnBox.PackStart (btnClose, false, false, 1); + al.Add (btnBox); + box.PackEnd (al, false, false, 3); + Add (box); - } - - tabIcon.Image = icon; - - string realLabel, realHelp; - if (!string.IsNullOrEmpty (label)) { - labelWidget.Parent.Show (); - labelWidget.Name = label; - btnDock.Name = string.Format ("btnDock_{0}", labelNoSpaces ?? string.Empty); - btnClose.Name = string.Format ("btnClose_{0}", labelNoSpaces ?? string.Empty); - realLabel = GettextCatalog.GetString ("Close {0}", label); - realHelp = GettextCatalog.GetString ("Close the {0} pad", label); - } else { - labelWidget.Parent.Hide (); - realLabel = GettextCatalog.GetString ("Close pad"); - realHelp = GettextCatalog.GetString ("Close the pad"); - } - - btnClose.Accessible.SetLabel (realLabel); + } + + tabIcon.Image = icon; + + string realLabel, realHelp; + if (!string.IsNullOrEmpty (label)) { + labelWidget.Parent.Show (); + labelWidget.Name = label; + btnDock.Name = string.Format ("btnDock_{0}", labelNoSpaces ?? string.Empty); + btnClose.Name = string.Format ("btnClose_{0}", labelNoSpaces ?? string.Empty); + realLabel = GettextCatalog.GetString ("Close {0}", label); + realHelp = GettextCatalog.GetString ("Close the {0} pad", label); + } else { + labelWidget.Parent.Hide (); + realLabel = GettextCatalog.GetString ("Close pad"); + realHelp = GettextCatalog.GetString ("Close the pad"); + } + + btnClose.Accessible.SetLabel (realLabel); btnClose.Accessible.Description = realHelp; if (label != null) { @@ -692,15 +692,26 @@ protected override void OnRealized () UpdateVisualStyle (); } - protected override void OnSizeRequested (ref Gtk.Requisition req) + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { + min_height = 0; + natural_height = 0; if (Child != null) { - req = Child.SizeRequest (); - req.Width += (int)(TabPadding.Left + TabPadding.Right); + Requisition req = Child.SizeRequest (); if (active) - req.Height += (int)(TabActivePadding.Top + TabActivePadding.Bottom); + min_height += (int)(TabActivePadding.Top + TabActivePadding.Bottom); else - req.Height += (int)(TabPadding.Top + TabPadding.Bottom); + min_height += (int)(TabPadding.Top + TabPadding.Bottom); + } + } + + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) + { + min_width = 0; + natural_width = 0; + if (Child != null) { + Requisition req = Child.SizeRequest (); + min_width += (int)(TabPadding.Left + TabPadding.Right); } } @@ -728,20 +739,20 @@ protected override void OnSizeAllocated (Gdk.Rectangle rect) } } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - if (VisualStyle.TabStyle == DockTabStyle.Normal) - DrawAsBrowser (evnt); - else - DrawNormal (evnt); - - if (HasFocus) { - var alloc = labelWidget.Allocation; - Gtk.Style.PaintFocus (Style, GdkWindow, State, alloc, this, "label", - alloc.X, alloc.Y, alloc.Width, alloc.Height); - } - return base.OnExposeEvent (evnt); - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// if (VisualStyle.TabStyle == DockTabStyle.Normal) +// DrawAsBrowser (evnt); +// else +// DrawNormal (evnt); +// +// if (HasFocus) { +// var alloc = labelWidget.Allocation; +// Gtk.Style.PaintFocus (Style, GdkWindow, State, alloc, this, "label", +// alloc.X, alloc.Y, alloc.Width, alloc.Height); +// } +// return base.OnExposeEvent (evnt); +// } void DrawAsBrowser (Gdk.EventExpose evnt) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs index 935fa341a9a..a337f672ed7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs @@ -36,7 +36,7 @@ namespace MonoDevelop.Components.Docking { internal class PlaceholderWindow: Gtk.Window { - Gdk.GC redgc; +// Gdk.GC redgc; uint anim; int rx, ry, rw, rh; bool allowDocking; @@ -60,17 +60,17 @@ public PlaceholderWindow (DockFrame frame): base (Gtk.WindowType.Popup) // Create the mask for the arrow Realize (); - redgc = new Gdk.GC (GdkWindow); - redgc.RgbFgColor = frame.Style.Background (StateType.Selected); +// redgc = new Gdk.GC (GdkWindow); +// redgc.RgbFgColor = frame.Style.Background (StateType.Selected); } - protected override void OnDestroyed () + protected override void OnDestroyed () { - if (redgc != null) { - redgc.Dispose (); - redgc = null; - } - base.OnDestroyed (); +// if (redgc != null) { +// redgc.Dispose (); +// redgc = null; +// } + base.OnDestroyed (); } protected override void OnRealized () @@ -85,20 +85,20 @@ void CreateShape (int width, int height) black = new Gdk.Color (0, 0, 0); black.Pixel = 1; white = new Gdk.Color (255, 255, 255); - white.Pixel = 0; - - using (Gdk.Pixmap pm = new Pixmap (this.GdkWindow, width, height, 1)) { - using (Gdk.GC gc = new Gdk.GC (pm)) { - gc.Background = white; - gc.Foreground = white; - pm.DrawRectangle (gc, true, 0, 0, width, height); - - gc.Foreground = black; - pm.DrawRectangle (gc, false, 0, 0, width - 1, height - 1); - pm.DrawRectangle (gc, false, 1, 1, width - 3, height - 3); - } - this.ShapeCombineMask (pm, 0, 0); - } + white.Pixel = 0; + +// using (Gdk.Pixmap pm = new Pixmap (this.GdkWindow, width, height, 1)) { +// using (Gdk.GC gc = new Gdk.GC (pm)) { +// gc.Background = white; +// gc.Foreground = white; +// pm.DrawRectangle (gc, true, 0, 0, width, height); +// +// gc.Foreground = black; +// pm.DrawRectangle (gc, false, 0, 0, width - 1, height - 1); +// pm.DrawRectangle (gc, false, 1, 1, width - 3, height - 3); +// } +// this.ShapeCombineMask (pm, 0, 0); +// } } protected override void OnSizeAllocated (Rectangle allocation) @@ -108,15 +108,15 @@ protected override void OnSizeAllocated (Rectangle allocation) } - protected override bool OnExposeEvent (Gdk.EventExpose args) - { - //base.OnExposeEvent (args); - int w, h; - this.GetSize (out w, out h); - this.GdkWindow.DrawRectangle (redgc, false, 0, 0, w-1, h-1); - this.GdkWindow.DrawRectangle (redgc, false, 1, 1, w-3, h-3); - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose args) +// { +// //base.OnExposeEvent (args); +// int w, h; +// this.GetSize (out w, out h); +// this.GdkWindow.DrawRectangle (redgc, false, 0, 0, w-1, h-1); +// this.GdkWindow.DrawRectangle (redgc, false, 1, 1, w-3, h-3); +// return true; +// } public void Relocate (int x, int y, int w, int h, bool animate) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs index 89de00dbc11..0193045a813 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs @@ -219,15 +219,15 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) base.OnSizeAllocated (allocation); } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredWidth (out int minimum_width, out int natural_width) { - base.OnSizeRequested (ref requisition); + base.OnGetPreferredWidth (out minimum_width, out natural_width); int minWidth = 0; foreach (var tab in box.Children.Cast ()) minWidth += tab.MinWidth; - requisition.Width = minWidth; + minimum_width = minWidth; } void UpdateEllipsize (Gdk.Rectangle allocation) @@ -320,15 +320,15 @@ internal class TabStripBox: HBox public TabStrip TabStrip; static Xwt.Drawing.Image tabbarBackImage = Xwt.Drawing.Image.FromResource ("tabbar-back.9.png"); - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - if (TabStrip.VisualStyle.TabStyle == DockTabStyle.Normal) { - using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { - ctx.DrawImage (this, tabbarBackImage.WithSize (Allocation.Width, Allocation.Height), 0, 0); - } - } - return base.OnExposeEvent (evnt); - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// if (TabStrip.VisualStyle.TabStyle == DockTabStyle.Normal) { +// using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { +// ctx.DrawImage (this, tabbarBackImage.WithSize (Allocation.Width, Allocation.Height), 0, 0); +// } +// } +// return base.OnExposeEvent (evnt); +// } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/TextQuestionDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/TextQuestionDialog.cs index f9fe9d90b9d..06895e989a8 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/TextQuestionDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/TextQuestionDialog.cs @@ -68,7 +68,7 @@ protected override bool RunDefault () Gtk.Dialog md = null; try { md = new Gtk.Dialog (Caption, TransientFor, DialogFlags.Modal | DialogFlags.DestroyWithParent) { - HasSeparator = false, +// HasSeparator = false, BorderWidth = 6, }; @@ -76,7 +76,7 @@ protected override bool RunDefault () UseMarkup = true, Xalign = 0.0F, }; - md.VBox.PackStart (questionLabel, true, false, 6); + md.ContentArea.PackStart (questionLabel, true, false, 6); var responseEntry = new Entry (Value ?? "") { Visibility = !IsPassword, @@ -84,7 +84,7 @@ protected override bool RunDefault () responseEntry.Activated += (sender, e) => { md.Respond (ResponseType.Ok); }; - md.VBox.PackStart (responseEntry, false, true, 6); + md.ContentArea.PackStart (responseEntry, false, true, 6); md.AddActionWidget (new Button (Gtk.Stock.Cancel) { CanDefault = true }, ResponseType.Cancel); md.AddActionWidget (new Button (Gtk.Stock.Ok), ResponseType.Ok); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ButtonBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ButtonBar.cs index 60ef3400a31..0b4c702ff30 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ButtonBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ButtonBar.cs @@ -79,7 +79,7 @@ public IEnumerable Groups { public ButtonBar () { - WidgetFlags |= Gtk.WidgetFlags.AppPaintable; + this.AppPaintable = true; VisibleWindow = false; Events |= EventMask.ButtonPressMask | EventMask.ButtonReleaseMask; @@ -125,17 +125,17 @@ IButtonBarButton[] VisibleButtons { } } - StateType leaveState = StateType.Normal; + StateFlags leaveState = StateFlags.Normal; protected override bool OnEnterNotifyEvent (EventCrossing evnt) { - State = leaveState; + this.SetStateFlags (leaveState, true); return base.OnEnterNotifyEvent (evnt); } protected override bool OnLeaveNotifyEvent (EventCrossing evnt) { - leaveState = State; - State = StateType.Normal; + leaveState = this.StateFlags; + this.SetStateFlags(StateFlags.Normal, true); return base.OnLeaveNotifyEvent (evnt); } @@ -144,7 +144,7 @@ protected override bool OnButtonPressEvent (EventButton evnt) if (evnt.Button == 1) { pushedButton = VisibleButtons.FirstOrDefault (b => allocations [b].Contains (Allocation.X + (int)evnt.X, Allocation.Y + (int)evnt.Y)); if (pushedButton != null && pushedButton.Enabled) - State = StateType.Selected; + this.SetStateFlags(StateFlags.Selected, true); } return true; } @@ -154,8 +154,8 @@ protected override bool OnButtonReleaseEvent (EventButton evnt) if (State == StateType.Selected && pushedButton != null) { pushedButton.NotifyPushed (); } - State = StateType.Prelight; - leaveState = StateType.Normal; + this.SetStateFlags( StateFlags.Prelight, true); + leaveState = StateFlags.Normal; pushedButton = null; return true; } @@ -174,44 +174,49 @@ protected override bool OnQueryTooltip (int x, int y, bool keyboard_tooltip, Too } } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - base.OnSizeRequested (ref requisition); - requisition.Width = VisibleButtons.Sum (b => b.Visible ? (!b.IsSeparator ? (int)btnNormalOriginal[0].Width : SeparatorSpacing) : 0); - requisition.Height = (int)btnNormalOriginal[0].Height; + base.OnGetPreferredHeight (out min_height, out natural_height); + min_height = (int)btnNormalOriginal[0].Height; } - protected override bool OnExposeEvent (EventExpose evnt) + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { - ScaleImages (Allocation.Height); - - using (var context = Gdk.CairoHelper.Create (evnt.Window)) { - double x = Allocation.X, y = Allocation.Y; - for (int i = 0; i < VisibleButtons.Length; i++) { - bool nextIsSeparator = (i < VisibleButtons.Length - 1 && VisibleButtons[i + 1].IsSeparator) || i == VisibleButtons.Length - 1; - bool lastWasSeparator = (i > 0 && VisibleButtons[i - 1].IsSeparator) || i == 0; - IButtonBarButton button = VisibleButtons [i]; - if (button.IsSeparator) { - if (!lastWasSeparator) - x += SeparatorSpacing; - continue; - } - Xwt.Drawing.Image[] images = State == StateType.Selected && pushedButton == button ? btnPressed : btnNormal; - Xwt.Drawing.Image img = images [lastWasSeparator ? 0 : nextIsSeparator ? 2 : 1]; - context.DrawImage (this, img, x, y); - - allocations [button] = new Gdk.Rectangle ((int)x, (int)y, (int)img.Width, (int)img.Height); - - var icon = ImageService.GetIcon (button.Image, IconSize.Menu); - if (!Sensitive || !button.Enabled) - icon = icon.WithAlpha (0.4); - context.DrawImage (this, icon, Math.Truncate (x + (img.Width - icon.Width) / 2), Math.Truncate (y + (img.Height - icon.Height) / 2)); - x += img.Width; - } - } - return base.OnExposeEvent (evnt); + base.OnGetPreferredWidth (out min_width, out natural_width); + min_width = VisibleButtons.Sum (b => b.Visible ? (!b.IsSeparator ? (int)btnNormalOriginal[0].Width : SeparatorSpacing) : 0); } +// protected override bool OnExposeEvent (EventExpose evnt) +// { +// ScaleImages (Allocation.Height); +// +// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { +// double x = Allocation.X, y = Allocation.Y; +// for (int i = 0; i < VisibleButtons.Length; i++) { +// bool nextIsSeparator = (i < VisibleButtons.Length - 1 && VisibleButtons[i + 1].IsSeparator) || i == VisibleButtons.Length - 1; +// bool lastWasSeparator = (i > 0 && VisibleButtons[i - 1].IsSeparator) || i == 0; +// IButtonBarButton button = VisibleButtons [i]; +// if (button.IsSeparator) { +// if (!lastWasSeparator) +// x += SeparatorSpacing; +// continue; +// } +// Xwt.Drawing.Image[] images = State == StateType.Selected && pushedButton == button ? btnPressed : btnNormal; +// Xwt.Drawing.Image img = images [lastWasSeparator ? 0 : nextIsSeparator ? 2 : 1]; +// context.DrawImage (this, img, x, y); +// +// allocations [button] = new Gdk.Rectangle ((int)x, (int)y, (int)img.Width, (int)img.Height); +// +// var icon = ImageService.GetIcon (button.Image, IconSize.Menu); +// if (!Sensitive || !button.Enabled) +// icon = icon.WithAlpha (0.4); +// context.DrawImage (this, icon, Math.Truncate (x + (img.Width - icon.Width) / 2), Math.Truncate (y + (img.Height - icon.Height) / 2)); +// x += img.Width; +// } +// } +// return base.OnExposeEvent (evnt); +// } + Xwt.Drawing.Image ExpandImageVertically (Xwt.Drawing.Image img, int newHeight) { if (newHeight <= img.Height) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs index eccc7b93245..165ce4739ec 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs @@ -93,45 +93,45 @@ internal static object LastCommandTarget { get { return lastCommandTarget != null ? lastCommandTarget.Target : null; } } - static bool RuntimeIsSeparator (TreeModel model, TreeIter iter) + static bool RuntimeIsSeparator (ITreeModel model, TreeIter iter) { var runtime = (IRuntimeModel)model.GetValue (iter, 0); return runtime == null || runtime.IsSeparator; } - void RuntimeRenderCell (CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter) - { - var runtime = (IRuntimeModel)model.GetValue (iter, 0); - var renderer = (CellRendererText) cell; - - if (runtime == null || runtime.IsSeparator) { - renderer.Xpad = (uint)0; - return; - } - - using (var mutableModel = runtime.GetMutableModel ()) { - renderer.Visible = mutableModel.Visible; - renderer.Sensitive = mutableModel.Enabled; - renderer.Xpad = (uint)(runtime.IsIndented ? 18 : 3); - - if (!runtimeCombo.PopupShown) { - // no need to ident text when the combo dropdown is not showing - if (Platform.IsWindows) - renderer.Xpad = 3; - renderer.Text = mutableModel.FullDisplayString; - renderer.Attributes = normalAttributes; - } else { - renderer.Text = mutableModel.DisplayString; - renderer.Attributes = runtime.Notable ? boldAttributes : normalAttributes; - } - - } - } +// void RuntimeRenderCell (CellLayout layout, CellRenderer cell, ITreeModel model, TreeIter iter) +// { +// var runtime = (IRuntimeModel)model.GetValue (iter, 0); +// var renderer = (CellRendererText) cell; +// +// if (runtime == null || runtime.IsSeparator) { +// renderer.Xpad = (uint)0; +// return; +// } +// +// using (var mutableModel = runtime.GetMutableModel ()) { +// renderer.Visible = mutableModel.Visible; +// renderer.Sensitive = mutableModel.Enabled; +// renderer.Xpad = (uint)(runtime.IsIndented ? 18 : 3); +// +// if (!runtimeCombo.PopupShown) { +// // no need to ident text when the combo dropdown is not showing +// if (Platform.IsWindows) +// renderer.Xpad = 3; +// renderer.Text = mutableModel.FullDisplayString; +// renderer.Attributes = normalAttributes; +// } else { +// renderer.Text = mutableModel.DisplayString; +// renderer.Attributes = runtime.Notable ? boldAttributes : normalAttributes; +// } +// +// } +// } TreeIter lastSelection = TreeIter.Zero; public MainToolbar () { - WidgetFlags |= Gtk.WidgetFlags.AppPaintable; +// WidgetFlags |= Gtk.WidgetFlags.AppPaintable; AddWidget (button); AddSpace (8); @@ -167,7 +167,7 @@ public MainToolbar () if (Platform.IsWindows) ctx.Ellipsize = Pango.EllipsizeMode.Middle; runtimeCombo.PackStart (ctx, true); - runtimeCombo.SetCellDataFunc (ctx, RuntimeRenderCell); +// runtimeCombo.SetCellDataFunc (ctx, RuntimeRenderCell); runtimeCombo.RowSeparatorFunc = RuntimeIsSeparator; var runtimeComboVBox = new VBox (); @@ -272,7 +272,7 @@ public MainToolbar () }; this.ShowAll (); - this.statusArea.statusIconBox.HideAll (); + this.statusArea.statusIconBox.Hide(); } protected override bool OnButtonPressEvent (Gdk.EventButton evnt) @@ -343,38 +343,38 @@ public void AddWidget (Gtk.Widget widget) contentBox.PackStart (widget, false, false, 0); } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - using (var context = Gdk.CairoHelper.Create (evnt.Window)) { - context.Rectangle ( - evnt.Area.X, - evnt.Area.Y, - evnt.Area.Width, - evnt.Area.Height - ); - context.Clip (); - context.LineWidth = 1; - if (Background != null && Background.Width > 0) { - for (int x=0; x < Allocation.Width; x += Background.Width) { - Background.Show (context, x, -TitleBarHeight); - } - } else { - context.Rectangle (0, 0, Allocation.Width, Allocation.Height); - using (var lg = new LinearGradient (0, 0, 0, Allocation.Height)) { - lg.AddColorStop (0, Style.Light (StateType.Normal).ToCairoColor ()); - lg.AddColorStop (1, Style.Mid (StateType.Normal).ToCairoColor ()); - context.SetSource (lg); - } - context.Fill (); - - } - context.MoveTo (0, Allocation.Height - 0.5); - context.RelLineTo (Allocation.Width, 0); - context.SetSourceColor (Styles.ToolbarBottomBorderColor.ToCairoColor ()); - context.Stroke (); - } - return base.OnExposeEvent (evnt); - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { +// context.Rectangle ( +// evnt.Area.X, +// evnt.Area.Y, +// evnt.Area.Width, +// evnt.Area.Height +// ); +// context.Clip (); +// context.LineWidth = 1; +// if (Background != null && Background.Width > 0) { +// for (int x=0; x < Allocation.Width; x += Background.Width) { +// Background.Show (context, x, -TitleBarHeight); +// } +// } else { +// context.Rectangle (0, 0, Allocation.Width, Allocation.Height); +// using (var lg = new LinearGradient (0, 0, 0, Allocation.Height)) { +// lg.AddColorStop (0, Style.Light (StateType.Normal).ToCairoColor ()); +// lg.AddColorStop (1, Style.Mid (StateType.Normal).ToCairoColor ()); +// context.SetSource (lg); +// } +// context.Fill (); +// +// } +// context.MoveTo (0, Allocation.Height - 0.5); +// context.RelLineTo (Allocation.Width, 0); +// context.SetSourceColor (Styles.ToolbarBottomBorderColor.ToCairoColor ()); +// context.Stroke (); +// } +// return base.OnExposeEvent (evnt); +// } void HandleStartButtonClicked (object sender, EventArgs e) { @@ -413,14 +413,14 @@ public bool ConfigurationPlatformSensitivity { } static bool FindIter (TreeStore store, Func match, out TreeIter iter) - { - if (store.GetIterFirst (out iter)) { + { + if (store.GetIterFirst (out iter)) { do { - if (match((T)store.GetValue (iter, 1))) - return true; - } while (store.IterNext (ref iter)); + if (match((T)store.GetValue (iter, 1))) + return true; + } while (store.IterNext (ref iter)); } - return false; + return false; } public IConfigurationModel ActiveConfiguration { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/RoundButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/RoundButton.cs index 4d3a4d70bb0..c8711867de2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/RoundButton.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/RoundButton.cs @@ -51,7 +51,7 @@ class RoundButton : Gtk.EventBox public RoundButton () { - WidgetFlags |= Gtk.WidgetFlags.AppPaintable; + this.AppPaintable = true; Events |= EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.LeaveNotifyMask | EventMask.PointerMotionMask; VisibleWindow = false; SetSizeRequest (height, height); @@ -71,26 +71,27 @@ public RoundButton () iconBuildDisabled = Xwt.Drawing.Image.FromResource (GetType (), "ico-build-disabled-32.png"); } - StateType hoverState = StateType.Prelight; + StateFlags hoverState = StateFlags.Prelight; protected override bool OnMotionNotifyEvent (EventMotion evnt) { - State = IsInside (evnt.X, evnt.Y) ? hoverState : StateType.Normal;; + this.SetStateFlags( IsInside (evnt.X, evnt.Y) ? hoverState : StateFlags.Normal, true);; return base.OnMotionNotifyEvent (evnt); } protected override bool OnLeaveNotifyEvent (EventCrossing evnt) { - State = StateType.Normal; + this.SetStateFlags (StateFlags.Normal, true); return base.OnLeaveNotifyEvent (evnt); } protected override bool OnButtonPressEvent (EventButton evnt) { if (evnt.Button == 1 && IsInside (evnt.X, evnt.Y)) { - hoverState = State = StateType.Selected; + hoverState = StateFlags.Selected; + this.SetStateFlags (hoverState, true); } return true; } @@ -99,8 +100,8 @@ protected override bool OnButtonReleaseEvent (EventButton evnt) { if (State == StateType.Selected) OnClicked (EventArgs.Empty); - State = IsInside (evnt.X, evnt.Y) ? StateType.Prelight : StateType.Normal;; - hoverState = StateType.Prelight; + this.SetStateFlags( IsInside (evnt.X, evnt.Y) ? StateFlags.Prelight : StateFlags.Normal, true);; + hoverState = StateFlags.Prelight; return true; } @@ -111,11 +112,16 @@ bool IsInside (double x, double y) return Math.Sqrt (xr * xr + yr * yr) <= height / 2; } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - requisition.Width = (int) btnNormal.Size.Width; - requisition.Height = (int) btnNormal.Size.Height + 2; - base.OnSizeRequested (ref requisition); + min_height = (int) btnNormal.Size.Height + 2; + base.OnGetPreferredHeight (out min_height, out natural_height); + } + + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) + { + min_width = (int) btnNormal.Size.Width; + base.OnGetPreferredWidth (out min_width, out natural_width); } Xwt.Drawing.Image GetIcon() @@ -142,15 +148,15 @@ public OperationIcon Icon { } } - protected override bool OnExposeEvent (EventExpose evnt) - { - using (var context = Gdk.CairoHelper.Create (evnt.Window)) { - DrawBackground (context, Allocation, 15, State); - var icon = GetIcon(); - context.DrawImage (this, icon, Allocation.X + Math.Max (0, (Allocation.Width - icon.Width) / 2), Allocation.Y + Math.Max (0, (Allocation.Height - icon.Height) / 2)); - } - return base.OnExposeEvent (evnt); - } +// protected override bool OnExposeEvent (EventExpose evnt) +// { +// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { +// DrawBackground (context, Allocation, 15, State); +// var icon = GetIcon(); +// context.DrawImage (this, icon, Allocation.X + Math.Max (0, (Allocation.Width - icon.Width) / 2), Allocation.Y + Math.Max (0, (Allocation.Height - icon.Height) / 2)); +// } +// return base.OnExposeEvent (evnt); +// } void DrawBackground (Cairo.Context context, Gdk.Rectangle region, int radius, StateType state) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs index effa7f914f4..0078aa64cc7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs @@ -144,7 +144,7 @@ public StatusArea () ctxHandler = new StatusBarContextHandler (this); VisibleWindow = false; NoShowAll = true; - WidgetFlags |= Gtk.WidgetFlags.AppPaintable; + this.AppPaintable = true; statusIconBox.BorderWidth = 0; statusIconBox.Spacing = 3; @@ -390,24 +390,24 @@ protected override void OnRealized () ModifyFg (StateType.Normal, Styles.StatusBarTextColor.ToGdkColor ()); } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - requisition.Height = 32; - base.OnSizeRequested (ref requisition); + min_height = 32; + base.OnGetPreferredHeight (out min_height, out natural_height); } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - using (var context = Gdk.CairoHelper.Create (evnt.Window)) { - renderArg.Allocation = Allocation; - renderArg.ChildAllocation = messageBox.Allocation; - renderArg.MousePosition = tracker.MousePosition; - renderArg.Pango = PangoContext; - - theme.Render (context, renderArg, this); - } - return base.OnExposeEvent (evnt); - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { +// renderArg.Allocation = Allocation; +// renderArg.ChildAllocation = messageBox.Allocation; +// renderArg.MousePosition = tracker.MousePosition; +// renderArg.Pango = PangoContext; +// +// theme.Render (context, renderArg, this); +// } +// return base.OnExposeEvent (evnt); +// } #region StatusBar implementation @@ -416,7 +416,7 @@ public StatusBarIcon ShowStatusIcon (Xwt.Drawing.Image pixbuf) { Runtime.AssertMainThread (); StatusIcon icon = new StatusIcon (this, pixbuf); - statusIconBox.PackEnd (icon.box); + statusIconBox.PackEnd (icon.box, false, true, 0); statusIconBox.ShowAll (); return icon; } @@ -891,29 +891,29 @@ public void SetCancellationTokenSource (CancellationTokenSource source) class StatusAreaSeparator: HBox { - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - using (var ctx = Gdk.CairoHelper.Create (this.GdkWindow)) { - var alloc = Allocation; - //alloc.Inflate (0, -2); - ctx.Rectangle (alloc.X, alloc.Y, 1, alloc.Height); - - // FIXME: VV: Remove gradient features - using (Cairo.LinearGradient gr = new LinearGradient (alloc.X, alloc.Y, alloc.X, alloc.Y + alloc.Height)) { - gr.AddColorStop (0, new Cairo.Color (0, 0, 0, 0)); - gr.AddColorStop (0.5, new Cairo.Color (0, 0, 0, 0.2)); - gr.AddColorStop (1, new Cairo.Color (0, 0, 0, 0)); - ctx.SetSource (gr); - ctx.Fill (); - } - } - return true; - } - - protected override void OnSizeRequested (ref Requisition requisition) - { - base.OnSizeRequested (ref requisition); - requisition.Width = 1; +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// using (var ctx = Gdk.CairoHelper.Create (this.GdkWindow)) { +// var alloc = Allocation; +// //alloc.Inflate (0, -2); +// ctx.Rectangle (alloc.X, alloc.Y, 1, alloc.Height); +// +// // FIXME: VV: Remove gradient features +// using (Cairo.LinearGradient gr = new LinearGradient (alloc.X, alloc.Y, alloc.X, alloc.Y + alloc.Height)) { +// gr.AddColorStop (0, new Cairo.Color (0, 0, 0, 0)); +// gr.AddColorStop (0.5, new Cairo.Color (0, 0, 0, 0.2)); +// gr.AddColorStop (1, new Cairo.Color (0, 0, 0, 0)); +// ctx.SetSource (gr); +// ctx.Fill (); +// } +// } +// return true; +// } + + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) + { + base.OnGetPreferredWidth (out min_width, out natural_width); + min_width = 1; } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StyledProgressBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StyledProgressBar.cs index e7cae617163..20af136d6c2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StyledProgressBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StyledProgressBar.cs @@ -60,24 +60,24 @@ public StyledProgressBar () const int height = 14; - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - if (!showProgress) - return base.OnExposeEvent (evnt); - using (var ctx = Gdk.CairoHelper.Create (evnt.Window)) { - ctx.LineWidth = 1; - ctx.MoveTo (Allocation.X + 0.5, Allocation.Y + 0.5); - ctx.RelLineTo (Allocation.Width, 0); - ctx.SetSourceRGB (0.8, 0.8, 0.8); - ctx.Stroke (); - - ctx.MoveTo (Allocation.X + 0.5, Allocation.Y + 0.5); - ctx.RelLineTo ((double)Allocation.Width * fraction, 0); - ctx.SetSourceRGB (0.1, 0.1, 0.1); - ctx.Stroke (); - } - return base.OnExposeEvent (evnt); - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// if (!showProgress) +// return base.OnExposeEvent (evnt); +// using (var ctx = Gdk.CairoHelper.Create (evnt.Window)) { +// ctx.LineWidth = 1; +// ctx.MoveTo (Allocation.X + 0.5, Allocation.Y + 0.5); +// ctx.RelLineTo (Allocation.Width, 0); +// ctx.SetSourceRGB (0.8, 0.8, 0.8); +// ctx.Stroke (); +// +// ctx.MoveTo (Allocation.X + 0.5, Allocation.Y + 0.5); +// ctx.RelLineTo ((double)Allocation.Width * fraction, 0); +// ctx.SetSourceRGB (0.1, 0.1, 0.1); +// ctx.Stroke (); +// } +// return base.OnExposeEvent (evnt); +// } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/BooleanEditorCell.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/BooleanEditorCell.cs index c83f4222acb..25c486bee97 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/BooleanEditorCell.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/BooleanEditorCell.cs @@ -70,25 +70,25 @@ public override void GetSize (int availableWidth, out int width, out int height) height = indicatorSize; } - public override void Render (Gdk.Drawable window, Cairo.Context ctx, Gdk.Rectangle bounds, Gtk.StateType state) - { - if (style == null) - InitializeStyle (Container); - - Gtk.ShadowType sh = (bool) Value ? Gtk.ShadowType.In : Gtk.ShadowType.Out; - - int s = indicatorSize - 1; - if (s > bounds.Height) - s = bounds.Height; - if (s > bounds.Width) - s = bounds.Width; - - Gtk.Style.PaintCheck (style, window, state, sh, bounds, Container, "checkbutton", bounds.X + indicatorSpacing - 1, bounds.Y + (bounds.Height - s)/2, s, s); - } +// public override void Render (Gdk.Drawable window, Cairo.Context ctx, Gdk.Rectangle bounds, Gtk.StateType state) +// { +// if (style == null) +// InitializeStyle (Container); +// +// Gtk.ShadowType sh = (bool) Value ? Gtk.ShadowType.In : Gtk.ShadowType.Out; +// +// int s = indicatorSize - 1; +// if (s > bounds.Height) +// s = bounds.Height; +// if (s > bounds.Width) +// s = bounds.Width; +// +// Gtk.Style.PaintCheck (style, window, state, sh, bounds, Container, "checkbutton", bounds.X + indicatorSpacing - 1, bounds.Y + (bounds.Height - s)/2, s, s); +// } protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state) { - return new BooleanEditor { State = state }; + return new BooleanEditor { }; } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs index a4070bdd75a..c9da0e97337 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs @@ -29,11 +29,11 @@ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - + */ + using System; using Gtk; -using System.ComponentModel; +using System.ComponentModel; using System.ComponentModel.Design; using System.Collections; @@ -44,11 +44,11 @@ class CollectionEditor : PropertyEditorCell //TODO: Support for multiple object types private Type[] types; - protected override void Initialize () - { - base.Initialize (); + protected override void Initialize () + { + base.Initialize (); this.types = new Type[] { EditorManager.GetCollectionItemType (Property.PropertyType) }; - } + } protected virtual Type[] NewItemTypes () { @@ -62,18 +62,18 @@ public override bool DialogueEdit public override bool EditsReadOnlyObject { get { return true; } - } - - protected override string GetValueText () - { - return MonoDevelop.Core.GettextCatalog.GetString ("(Collection)"); + } + + protected override string GetValueText () + { + return MonoDevelop.Core.GettextCatalog.GetString ("(Collection)"); } public override void LaunchDialogue () { //the Type in the collection - IList collection = (IList) Value; - string displayName = Property.DisplayName; + IList collection = (IList) Value; + string displayName = Property.DisplayName; //populate list with existing items ListStore itemStore = new ListStore (typeof (object), typeof (int), typeof (string)); @@ -90,8 +90,7 @@ public override void LaunchDialogue () var dialog = new Gtk.Dialog () { Title = displayName + " Editor", Modal = true, - AllowGrow = true, - AllowShrink = true, + Resizable = true, }; IdeTheme.ApplyTheme (dialog); var toplevel = this.Container.GetNativeWidget ().Toplevel as Gtk.Window; @@ -103,7 +102,7 @@ public override void LaunchDialogue () //three columns for items, sorting, PropGrid HBox hBox = new HBox (); - dialog.VBox.PackStart (hBox, true, true, 5); + dialog.ContentArea.PackStart (hBox, true, true, 5); //propGrid at end grid = new PropertyGrid (base.EditorManager) { @@ -271,60 +270,60 @@ public override void LaunchDialogue () //if 'OK' put items back in collection using (dialog) { - if (MonoDevelop.Ide.MessageService.ShowCustomDialog (dialog, toplevel) == (int)ResponseType.Ok) { - DesignerTransaction tran = CreateTransaction (Instance); - object old = collection; - - try { + if (MonoDevelop.Ide.MessageService.ShowCustomDialog (dialog, toplevel) == (int)ResponseType.Ok) { + DesignerTransaction tran = CreateTransaction (Instance); + object old = collection; + + try { collection.Clear (); foreach (object[] o in itemStore) - collection.Add (o [0]); - EndTransaction (Instance, tran, old, collection, true); - } catch { - EndTransaction (Instance, tran, old, collection, false); - throw; + collection.Add (o [0]); + EndTransaction (Instance, tran, old, collection, true); + } catch { + EndTransaction (Instance, tran, old, collection, false); + throw; } } } - } - - //This and EndTransaction are from Mono internal class System.ComponentModel.ReflectionPropertyDescriptor - // Lluis Sanchez Gual (lluis@ximian.com), (C) Novell, Inc, MIT X11 license - DesignerTransaction CreateTransaction (object obj) - { - IComponent com = obj as IComponent; - if (com == null || com.Site == null) return null; - - IDesignerHost dh = (IDesignerHost) com.Site.GetService (typeof(IDesignerHost)); - if (dh == null) return null; - - DesignerTransaction tran = dh.CreateTransaction (); - IComponentChangeService ccs = (IComponentChangeService) com.Site.GetService (typeof(IComponentChangeService)); - if (ccs != null) - ccs.OnComponentChanging (com, Property); - return tran; - } - - void EndTransaction (object obj, DesignerTransaction tran, object oldValue, object newValue, bool commit) - { - if (tran == null) return; - - if (commit) { - IComponent com = obj as IComponent; - IComponentChangeService ccs = (IComponentChangeService) com.Site.GetService (typeof(IComponentChangeService)); - if (ccs != null) - ccs.OnComponentChanged (com, Property, oldValue, newValue); - tran.Commit (); - } - else - tran.Cancel (); + } + + //This and EndTransaction are from Mono internal class System.ComponentModel.ReflectionPropertyDescriptor + // Lluis Sanchez Gual (lluis@ximian.com), (C) Novell, Inc, MIT X11 license + DesignerTransaction CreateTransaction (object obj) + { + IComponent com = obj as IComponent; + if (com == null || com.Site == null) return null; + + IDesignerHost dh = (IDesignerHost) com.Site.GetService (typeof(IDesignerHost)); + if (dh == null) return null; + + DesignerTransaction tran = dh.CreateTransaction (); + IComponentChangeService ccs = (IComponentChangeService) com.Site.GetService (typeof(IComponentChangeService)); + if (ccs != null) + ccs.OnComponentChanging (com, Property); + return tran; + } + + void EndTransaction (object obj, DesignerTransaction tran, object oldValue, object newValue, bool commit) + { + if (tran == null) return; + + if (commit) { + IComponent com = obj as IComponent; + IComponentChangeService ccs = (IComponentChangeService) com.Site.GetService (typeof(IComponentChangeService)); + if (ccs != null) + ccs.OnComponentChanged (com, Property, oldValue, newValue); + tran.Commit (); + } + else + tran.Cancel (); } static void UpdateIndices (ListStore itemStore) { TreeIter iter; int i = 0; - if (!itemStore.GetIterFirst (out iter)) + if (!itemStore.GetIterFirst (out iter)) return; do { @@ -347,7 +346,7 @@ static void UpdateName (ListStore itemStore, TreeIter iter) } //generally useful function... why not in model already? - static bool IterPrev (TreeModel model, ref TreeIter iter) + static bool IterPrev (ITreeModel model, ref TreeIter iter) { TreePath tp = model.GetPath (iter); return tp.Prev() && model.GetIter (out iter, tp); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ColorEditorCell.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ColorEditorCell.cs index 49566bd8813..04fbc77b805 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ColorEditorCell.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ColorEditorCell.cs @@ -32,7 +32,7 @@ namespace MonoDevelop.Components.PropertyGrid.PropertyEditors { - [PropertyEditorType (typeof (System.Drawing.Color))] + [PropertyEditorType (typeof (System.Drawing.Color))] public class ColorEditorCell: PropertyEditorCell { const int ColorBoxSize = 16; @@ -47,36 +47,36 @@ public override void GetSize (int availableWidth, out int width, out int height) protected override string GetValueText () { - System.Drawing.Color color = (System.Drawing.Color) Value; - //TODO: dropdown known color selector so this does something - if (color.IsKnownColor) - return color.Name; - else if (color.IsEmpty) - return ""; - else - return String.Format("#{0:x2}{1:x2}{2:x2}", color.R, color.G, color.B); + System.Drawing.Color color = (System.Drawing.Color) Value; + //TODO: dropdown known color selector so this does something + if (color.IsKnownColor) + return color.Name; + else if (color.IsEmpty) + return ""; + else + return String.Format("#{0:x2}{1:x2}{2:x2}", color.R, color.G, color.B); } - public override void Render (Gdk.Drawable window, Cairo.Context ctx, Gdk.Rectangle bounds, Gtk.StateType state) +// public override void Render (Gdk.Drawable window, Cairo.Context ctx, Gdk.Rectangle bounds, Gtk.StateType state) +// { +// using (Gdk.GC gc = new Gdk.GC (window)) { +// gc.RgbFgColor = GetColor (); +// int yd = (bounds.Height - ColorBoxSize) / 2; +// window.DrawRectangle (gc, true, bounds.X, bounds.Y + yd, ColorBoxSize - 1, ColorBoxSize - 1); +// window.DrawRectangle (Container.GetNativeWidget ().Style.BlackGC, false, bounds.X, bounds.Y + yd, ColorBoxSize - 1, ColorBoxSize - 1); +// bounds.X += ColorBoxSize + ColorBoxSpacing; +// bounds.Width -= ColorBoxSize + ColorBoxSpacing; +// base.Render (window, ctx, bounds, state); +// } +// } + + private Gdk.Color GetColor () { - using (Gdk.GC gc = new Gdk.GC (window)) { - gc.RgbFgColor = GetColor (); - int yd = (bounds.Height - ColorBoxSize) / 2; - window.DrawRectangle (gc, true, bounds.X, bounds.Y + yd, ColorBoxSize - 1, ColorBoxSize - 1); - window.DrawRectangle (Container.GetNativeWidget ().Style.BlackGC, false, bounds.X, bounds.Y + yd, ColorBoxSize - 1, ColorBoxSize - 1); - bounds.X += ColorBoxSize + ColorBoxSpacing; - bounds.Width -= ColorBoxSize + ColorBoxSpacing; - base.Render (window, ctx, bounds, state); - } + System.Drawing.Color color = (System.Drawing.Color) Value; + //TODO: Property.Converter.ConvertTo() fails: why? + return new Gdk.Color (color.R, color.G, color.B); } - - private Gdk.Color GetColor () - { - System.Drawing.Color color = (System.Drawing.Color) Value; - //TODO: Property.Converter.ConvertTo() fails: why? - return new Gdk.Color (color.R, color.G, color.B); - } - + protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state) { return new ColorEditor (); @@ -93,13 +93,13 @@ public void Initialize (EditSession session) public object Value { get { - int red = (int) (255 * (float) Color.Red / ushort.MaxValue); - int green = (int) (255 * (float) Color.Green / ushort.MaxValue); - int blue = (int) (255 * (float) Color.Blue / ushort.MaxValue); + int red = (int) (255 * (float) Color.Red / ushort.MaxValue); + int green = (int) (255 * (float) Color.Green / ushort.MaxValue); + int blue = (int) (255 * (float) Color.Blue / ushort.MaxValue); return System.Drawing.Color.FromArgb (red, green, blue); } set { - System.Drawing.Color color = (System.Drawing.Color) value; + System.Drawing.Color color = (System.Drawing.Color) value; Color = new Gdk.Color (color.R, color.G, color.B); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/EnumerationEditorCell.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/EnumerationEditorCell.cs index f924f87716b..6e725cd20b9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/EnumerationEditorCell.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/EnumerationEditorCell.cs @@ -33,7 +33,7 @@ namespace MonoDevelop.Components.PropertyGrid.PropertyEditors { - [PropertyEditorType(typeof(System.Enum))] + [PropertyEditorType(typeof(System.Enum))] public class EnumerationEditorCell: PropertyEditorCell { protected override string GetValueText () @@ -65,7 +65,7 @@ protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.St public class EnumerationEditor : Gtk.HBox, IPropertyEditor { Gtk.EventBox ebox; - Gtk.ComboBoxEntry combo; + Gtk.ComboBoxText combo; Array values; public EnumerationEditor () : base (false, 0) @@ -94,7 +94,7 @@ public void Initialize (EditSession session) ebox.Show (); PackStart (ebox, true, true, 0); - combo = Gtk.ComboBoxEntry.NewText (); + combo = new Gtk.ComboBoxText(); combo.Changed += combo_Changed; combo.Entry.IsEditable = false; combo.Entry.CanFocus = false; @@ -106,7 +106,7 @@ public void Initialize (EditSession session) foreach (object value in values) { string str = prop.Converter.ConvertToString (value); if (names.Contains (str)) - str = (string) names [str]; + str = (string) names [str]; combo.AppendText (str); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/EventEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/EventEditor.cs index a07c47b6ca6..21b57dd553c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/EventEditor.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/EventEditor.cs @@ -5,7 +5,7 @@ * editing of all of an object's public properties * * Authors: - * Michael Hutchinson + * Michael Hutchinson * Lluis Sanchez Gual * * Copyright (C) 2005 Michael Hutchinson @@ -32,8 +32,8 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; -using System.ComponentModel; -using System.ComponentModel.Design; +using System.ComponentModel; +using System.ComponentModel.Design; using System.Collections; using Gtk; @@ -41,95 +41,95 @@ namespace MonoDevelop.Components.PropertyGrid.PropertyEditors { [PropertyEditorType (typeof (Delegate), true)] public class EventEditorCell : PropertyEditorCell - { + { IEventBindingService evtBind; - protected override void Initialize () - { - IComponent comp = Instance as IComponent; - evtBind = (IEventBindingService) comp.Site.GetService (typeof (IEventBindingService)); + protected override void Initialize () + { + IComponent comp = Instance as IComponent; + evtBind = (IEventBindingService) comp.Site.GetService (typeof (IEventBindingService)); base.Initialize (); - } - - protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state) - { - //get existing method names - ICollection IColl = evtBind.GetCompatibleMethods (evtBind.GetEvent (Property)) ; - string[] methods = new string [IColl.Count + 1]; - IColl.CopyTo (methods, 1); - - //add a suggestion - methods [0] = evtBind.CreateUniqueMethodName ((IComponent) Instance, evtBind.GetEvent (Property)); - + } + + protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state) + { + //get existing method names + ICollection IColl = evtBind.GetCompatibleMethods (evtBind.GetEvent (Property)) ; + string[] methods = new string [IColl.Count + 1]; + IColl.CopyTo (methods, 1); + + //add a suggestion + methods [0] = evtBind.CreateUniqueMethodName ((IComponent) Instance, evtBind.GetEvent (Property)); + EventEditor combo = new EventEditor (evtBind, methods); if (Value != null) combo.Entry.Text = (string) Value; - combo.WidthRequest = 30; //Don't artificially inflate the width. It expands anyway. + combo.WidthRequest = 30; //Don't artificially inflate the width. It expands anyway. return combo; - } - - } - - class EventEditor: ComboBoxEntry, IPropertyEditor - { - bool isNull; - PropertyDescriptor prop; - IEventBindingService evtBind; - object component; - - public EventEditor (IEventBindingService evtBind, string[] ops): base (ops) - { - this.evtBind = evtBind; - } - - public void Initialize (EditSession session) - { - this.prop = session.Property; - component = session.Instance; + } + + } + + class EventEditor: ComboBox, IPropertyEditor + { + bool isNull; + PropertyDescriptor prop; + IEventBindingService evtBind; + object component; + + public EventEditor (IEventBindingService evtBind, string[] ops): base (ops) + { + this.evtBind = evtBind; + } + + public void Initialize (EditSession session) + { + this.prop = session.Property; + component = session.Instance; Entry.Destroyed += new EventHandler (entry_Changed); - Entry.Activated += new EventHandler (entry_Activated); - } - - public object Value { - get { + Entry.Activated += new EventHandler (entry_Activated); + } + + public object Value { + get { //if value was null and new value is empty, leave as null - if (Entry.Text.Length == 0 && isNull) - return null; - else - return Entry.Text; - } - set { - isNull = value == null; - if (isNull) - Entry.Text = ""; - else - Entry.Text = (string) value; - } - } - - protected override void OnChanged () - { - if (component == null) - return; - entry_Changed (this, null); - evtBind.ShowCode ((IComponent) component, evtBind.GetEvent (prop)); - } - + if (Entry.Text.Length == 0 && isNull) + return null; + else + return Entry.Text; + } + set { + isNull = value == null; + if (isNull) + Entry.Text = ""; + else + Entry.Text = (string) value; + } + } + + protected override void OnChanged () + { + if (component == null) + return; + entry_Changed (this, null); + evtBind.ShowCode ((IComponent) component, evtBind.GetEvent (prop)); + } + void entry_Activated (object sender, EventArgs e) - { - entry_Changed (sender, e); - evtBind.ShowCode ((IComponent) component, evtBind.GetEvent (prop)); - } - + { + entry_Changed (sender, e); + evtBind.ShowCode ((IComponent) component, evtBind.GetEvent (prop)); + } + void entry_Changed (object sender, EventArgs e) - { - if (ValueChanged != null) - ValueChanged (this, EventArgs.Empty); - } + { + if (ValueChanged != null) + ValueChanged (this, EventArgs.Empty); + } - public event EventHandler ValueChanged; + public event EventHandler ValueChanged; } -} \ No newline at end of file +} diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FlagsEditorCell.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FlagsEditorCell.cs index 272cb84f547..cb2313e516e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FlagsEditorCell.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FlagsEditorCell.cs @@ -86,45 +86,45 @@ protected override string GetValueText () return txt; } - public override void Render (Gdk.Drawable window, Cairo.Context ctx, Gdk.Rectangle bounds, Gtk.StateType state) - { - var values = Enum.GetValues (Property.PropertyType); - if (values.Length < MaxCheckCount) { - if (style == null) - InitializeStyle (Container); - - var container = (Widget)Container; - using (var layout = new Pango.Layout (container.PangoContext)) { - layout.Width = -1; - layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); - - ulong value = Convert.ToUInt64 (Value); - int dy = 2; - foreach (var val in values) { - ulong uintVal = Convert.ToUInt64 (val); - Gtk.ShadowType sh = (value & uintVal) != 0 ? Gtk.ShadowType.In : Gtk.ShadowType.Out; - if (value == 0 && uintVal == 0) - sh = Gtk.ShadowType.In; - int s = indicatorSize - 1; - Gtk.Style.PaintCheck (style, window, state, sh, bounds, Container, "checkbutton", bounds.X + indicatorSpacing - 1, bounds.Y + dy, s, s); - - layout.SetText (val.ToString ()); - int tw, th; - layout.GetPixelSize (out tw, out th); - ctx.Save (); - ctx.SetSourceColor (container.Style.Text (state).ToCairoColor ()); - ctx.MoveTo (bounds.X + indicatorSize + indicatorSpacing, dy + bounds.Y + ((indicatorSize - th) / 2)); - Pango.CairoHelper.ShowLayout (ctx, layout); - ctx.Restore (); - - dy += indicatorSize + CheckSpacing; - } - } - } else { - base.Render (window, ctx, bounds, state); - return; - } - } +// public override void Render (Gdk.Drawable window, Cairo.Context ctx, Gdk.Rectangle bounds, Gtk.StateType state) +// { +// var values = Enum.GetValues (Property.PropertyType); +// if (values.Length < MaxCheckCount) { +// if (style == null) +// InitializeStyle (Container); +// +// var container = (Widget)Container; +// using (var layout = new Pango.Layout (container.PangoContext)) { +// layout.Width = -1; +// layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); +// +// ulong value = Convert.ToUInt64 (Value); +// int dy = 2; +// foreach (var val in values) { +// ulong uintVal = Convert.ToUInt64 (val); +// Gtk.ShadowType sh = (value & uintVal) != 0 ? Gtk.ShadowType.In : Gtk.ShadowType.Out; +// if (value == 0 && uintVal == 0) +// sh = Gtk.ShadowType.In; +// int s = indicatorSize - 1; +// Gtk.Style.PaintCheck (style, window, state, sh, bounds, Container, "checkbutton", bounds.X + indicatorSpacing - 1, bounds.Y + dy, s, s); +// +// layout.SetText (val.ToString ()); +// int tw, th; +// layout.GetPixelSize (out tw, out th); +// ctx.Save (); +// ctx.SetSourceColor (container.Style.Text (state).ToCairoColor ()); +// ctx.MoveTo (bounds.X + indicatorSize + indicatorSpacing, dy + bounds.Y + ((indicatorSize - th) / 2)); +// Pango.CairoHelper.ShowLayout (ctx, layout); +// ctx.Restore (); +// +// dy += indicatorSize + CheckSpacing; +// } +// } +// } else { +// base.Render (window, ctx, bounds, state); +// return; +// } +// } protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FlagsSelectorDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FlagsSelectorDialog.cs index 16de80590d8..2cde251c0b2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FlagsSelectorDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FlagsSelectorDialog.cs @@ -55,7 +55,7 @@ public FlagsSelectorDialog (Gtk.Window parent, Type enumDesc, ulong flags, strin dialog = new Gtk.Dialog (); IdeTheme.ApplyTheme (dialog); - dialog.VBox.Add (sc); + dialog.ContentArea.Add (sc); dialog.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel); dialog.AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/PropertyTextEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/PropertyTextEditor.cs index bf9f94b69f0..dd63dc6d61a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/PropertyTextEditor.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/PropertyTextEditor.cs @@ -43,7 +43,7 @@ public class PropertyTextEditor: Gtk.HBox, IPropertyEditor string initialText; object currentValue; Entry entry; - ComboBox combo; + ComboBoxText combo; ListStore store; bool changed; @@ -59,13 +59,13 @@ public void Initialize (EditSession session) //if converter doesn't allow nonstandard values, or can't convert from strings, don't have an entry if (session.Property.Converter.GetStandardValuesExclusive (session) || !session.Property.Converter.CanConvertFrom (session, typeof(string))) { - combo = new ComboBox (store); + combo = (ComboBoxText)new ComboBox (store); var crt = new CellRendererText (); combo.PackStart (crt, true); combo.AddAttribute (crt, "text", 0); } else { - combo = new ComboBoxEntry (store, 0); - entry = ((ComboBoxEntry)combo).Entry; + combo = (ComboBoxText)new ComboBox (store); + entry = ((ComboBox)combo).Entry; entry.HeightRequest = combo.SizeRequest ().Height; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditorDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditorDialog.cs index be86d5b5422..846ceb18df0 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditorDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditorDialog.cs @@ -51,7 +51,7 @@ public TextEditorDialog () IdeTheme.ApplyTheme (dialog); dialog.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel); dialog.AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok); - dialog.VBox.Add (sc); + dialog.ContentArea.Add (sc); } public Gtk.Window TransientFor { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs index 7b173ca7be2..5dc98f26b23 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs @@ -132,18 +132,18 @@ public virtual void GetSize (int availableWidth, out int width, out int height) layout.GetPixelSize (out width, out height); } - public virtual void Render (Drawable window, Cairo.Context ctx, Rectangle bounds, StateType state) - { - int w, h; - layout.GetPixelSize (out w, out h); - int dy = (bounds.Height - h) / 2; - - ctx.Save (); - ctx.SetSourceColor (container.Style.Text (state).ToCairoColor ()); - ctx.MoveTo (bounds.X, dy + bounds.Y); - Pango.CairoHelper.ShowLayout (ctx, layout); - ctx.Restore (); - } +// public virtual void Render (Drawable window, Cairo.Context ctx, Rectangle bounds, StateType state) +// { +// int w, h; +// layout.GetPixelSize (out w, out h); +// int dy = (bounds.Height - h) / 2; +// +// ctx.Save (); +// ctx.SetSourceColor (container.Style.Text (state).ToCairoColor ()); +// ctx.MoveTo (bounds.X, dy + bounds.Y); +// Pango.CairoHelper.ShowLayout (ctx, layout); +// ctx.Restore (); +// } protected virtual IPropertyEditor CreateEditor (Rectangle cellArea, StateType state) { @@ -335,19 +335,19 @@ public CellRendererWidget (PropertyEditorCell cell, ITypeDescriptorContext conte this.ModifyBg (StateType.Normal, this.Style.White); } - protected override bool OnExposeEvent (EventExpose evnt) - { - bool res = base.OnExposeEvent (evnt); - cell.Initialize (this, em, context); - - Rectangle rect = Allocation; - rect.Inflate (-3, 0);// Add some margin - - using (Cairo.Context ctx = CairoHelper.Create (GdkWindow)) { - cell.Render (GdkWindow, ctx, rect, StateType.Normal); - } - return res; - } +// protected override bool OnExposeEvent (EventExpose evnt) +// { +// bool res = base.OnExposeEvent (evnt); +// cell.Initialize (this, em, context); +// +// Rectangle rect = Allocation; +// rect.Inflate (-3, 0);// Add some margin +// +// using (Cairo.Context ctx = CairoHelper.Create (GdkWindow)) { +// cell.Render (GdkWindow, ctx, rect, StateType.Normal); +// } +// return res; +// } } class PropertyDialogueEditor: HBox, IPropertyEditor diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs index 2a8477da80a..4b3e333aa9c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs @@ -140,7 +140,7 @@ internal PropertyGrid (EditorManager editorManager) AddPropertyTab (new DefaultPropertyTab ()); AddPropertyTab (new EventPropertyTab ()); - base.PackEnd (vpaned); + base.PackEnd (vpaned, false, true, 0); base.FocusChain = new Gtk.Widget [] { vpaned }; Populate (saveEditSession: false); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs index c681a05f976..0f512bfafde 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs @@ -159,7 +159,7 @@ public PropertyGridTable (EditorManager editorManager, PropertyGrid parentGrid) this.parentGrid = parentGrid; this.editorManager = editorManager; - WidgetFlags |= Gtk.WidgetFlags.AppPaintable; + this.AppPaintable = true; Events |= Gdk.EventMask.PointerMotionMask; CanFocus = true; resizeCursor = new Cursor (CursorType.SbHDoubleArrow); @@ -448,15 +448,23 @@ protected override void ForAll (bool includeInternals, Gtk.Callback callback) } } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { - requisition.Width = 20; + min_width = 20; + natural_width = 0; + foreach (var c in children) + c.Key.SizeRequest (); + } + + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) + { + natural_height = 0; int dx = (int)((double)Allocation.Width * dividerPosition) - PropertyContentLeftPadding; if (dx < 0) dx = 0; int y = 0; MeasureHeight (rows, ref y); - requisition.Height = y; + min_height = y; foreach (var c in children) c.Key.SizeRequest (); @@ -528,24 +536,24 @@ void MeasureHeight (IEnumerable rowList, ref int y) layout.Dispose (); } - protected override bool OnExposeEvent (EventExpose evnt) - { - using (Cairo.Context ctx = CairoHelper.Create (evnt.Window)) { - int dx = (int)((double)Allocation.Width * dividerPosition); - ctx.LineWidth = 1; - ctx.Rectangle (0, 0, Allocation.Width, Allocation.Height); - ctx.SetSourceColor (Styles.PropertyPadLabelBackgroundColor.ToCairoColor ()); - ctx.Fill (); - ctx.MoveTo (dx + 0.5, 0); - ctx.RelLineTo (0, Allocation.Height); - ctx.SetSourceColor (Styles.PropertyPadDividerColor.ToCairoColor ()); - ctx.Stroke (); - - int y = 0; - Draw (ctx, rows, dx, PropertyLeftPadding, ref y); - } - return base.OnExposeEvent (evnt); - } +// protected override bool OnExposeEvent (EventExpose evnt) +// { +// using (Cairo.Context ctx = CairoHelper.Create (evnt.Window)) { +// int dx = (int)((double)Allocation.Width * dividerPosition); +// ctx.LineWidth = 1; +// ctx.Rectangle (0, 0, Allocation.Width, Allocation.Height); +// ctx.SetSourceColor (Styles.PropertyPadLabelBackgroundColor.ToCairoColor ()); +// ctx.Fill (); +// ctx.MoveTo (dx + 0.5, 0); +// ctx.RelLineTo (0, Allocation.Height); +// ctx.SetSourceColor (Styles.PropertyPadDividerColor.ToCairoColor ()); +// ctx.Stroke (); +// +// int y = 0; +// Draw (ctx, rows, dx, PropertyLeftPadding, ref y); +// } +// return base.OnExposeEvent (evnt); +// } void Draw (Cairo.Context ctx, List rowList, int dividerX, int x, ref int y) { @@ -609,7 +617,7 @@ void Draw (Cairo.Context ctx, List rowList, int dividerX, int x, ref i if (r != currentEditorRow) { var bounds = GetInactiveEditorBounds (r); - cell.Render (GdkWindow, ctx, bounds, state); +// cell.Render (GdkWindow, ctx, bounds, state); if (r.IsExpandable) { var img = r.Expanded ? discloseUp : discloseDown; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs index a59672a7cc2..12f06cba800 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs @@ -52,7 +52,7 @@ public static Gdk.Color GetGdkTextMidColor (Widget widget) { Cairo.Color color = GetCairoTextMidColor (widget); Gdk.Color gdk_color = new Gdk.Color ((byte)(color.R * 255), (byte)(color.G * 255), (byte)(color.B * 255)); - Gdk.Colormap.System.AllocColor (ref gdk_color, true, true); +// Gdk.Colormap.System.AllocColor (ref gdk_color, true, true); return gdk_color; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererComboBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererComboBox.cs index 860f96ca4ae..d3442f43f37 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererComboBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererComboBox.cs @@ -41,7 +41,7 @@ public class CellRendererComboBox: CellRendererText public CellRendererComboBox () { Mode |= Gtk.CellRendererMode.Editable; - Gtk.ComboBox dummyEntry = Gtk.ComboBox.NewText (); + Gtk.ComboBoxText dummyEntry = new Gtk.ComboBoxText (); rowHeight = dummyEntry.SizeRequest ().Height + (2 * dummyEntry.Style?.YThickness ?? 0); Ypad = 0; } @@ -51,29 +51,29 @@ public string[] Values { set { values = value; } } - public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - if (height < rowHeight) - height = rowHeight; - } +// public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) +// { +// base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); +// if (height < rowHeight) +// height = rowHeight; +// } - public override CellEditable StartEditing (Gdk.Event ev, Widget widget, string path, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, CellRendererState flags) - { - this.path = path; - - Gtk.ComboBox combo = Gtk.ComboBox.NewText (); - foreach (string s in values) - combo.AppendText (s); - - combo.Active = Array.IndexOf (values, Text); - combo.Changed += new EventHandler (SelectionChanged); - return new TreeViewCellContainer (combo); - } +// public override ICellEditable StartEditing (Gdk.Event ev, Widget widget, string path, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, CellRendererState flags) +// { +// this.path = path; +// +// Gtk.ComboBox combo = Gtk.ComboBox.NewText (); +// foreach (string s in values) +// combo.AppendText (s); +// +// combo.Active = Array.IndexOf (values, Text); +// combo.Changed += new EventHandler (SelectionChanged); +// return new TreeViewCellContainer (combo); +// } void SelectionChanged (object s, EventArgs a) { - Gtk.ComboBox combo = (Gtk.ComboBox) s; + Gtk.ComboBoxText combo = (Gtk.ComboBoxText) s; if (Changed != null) Changed (this, new ComboSelectionChangedArgs (path, combo.Active, combo.ActiveText)); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs index ec66e799294..9547378a48e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs @@ -128,23 +128,23 @@ public virtual Image ImageExpanderClosed { } } - protected override void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags) - { - var img = GetImage (); - if (img == null) - return; - - if ((flags & Gtk.CellRendererState.Selected) != 0) - img = img.WithStyles ("sel"); - if (!img.HasFixedSize) - img = img.WithSize (Gtk.IconSize.Menu); - - using (var ctx = Gdk.CairoHelper.Create (window)) { - var x = cell_area.X + cell_area.Width / 2 - (int)(img.Width / 2); - var y = cell_area.Y + cell_area.Height / 2 - (int)(img.Height / 2); - ctx.DrawImage (widget, img, x, y); - } - } +// protected override void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags) +// { +// var img = GetImage (); +// if (img == null) +// return; +// +// if ((flags & Gtk.CellRendererState.Selected) != 0) +// img = img.WithStyles ("sel"); +// if (!img.HasFixedSize) +// img = img.WithSize (Gtk.IconSize.Menu); +// +// using (var ctx = Gdk.CairoHelper.Create (window)) { +// var x = cell_area.X + cell_area.Width / 2 - (int)(img.Width / 2); +// var y = cell_area.Y + cell_area.Height / 2 - (int)(img.Height / 2); +// ctx.DrawImage (widget, img, x, y); +// } +// } protected void GetImageInfo (Gdk.Rectangle cell_area, out Image img, out int x, out int y) { @@ -158,23 +158,23 @@ protected void GetImageInfo (Gdk.Rectangle cell_area, out Image img, out int x, } } - public override void GetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - var img = GetImage (); - if (img != null) { - if (img.HasFixedSize) { - width = (int)img.Width; - height = (int)img.Height; - } else - Gtk.IconSize.Menu.GetSize(out width, out height); - } else - width = height = 0; - - width += (int)Xpad * 2; - height += (int)Ypad * 2; - x_offset = (int)(cell_area.Width / 2 - (width / 2)); - y_offset = (int)(cell_area.Height / 2 - (height / 2)); - } +// public override void GetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) +// { +// var img = GetImage (); +// if (img != null) { +// if (img.HasFixedSize) { +// width = (int)img.Width; +// height = (int)img.Height; +// } else +// Gtk.IconSize.Menu.GetSize(out width, out height); +// } else +// width = height = 0; +// +// width += (int)Xpad * 2; +// height += (int)Ypad * 2; +// x_offset = (int)(cell_area.Width / 2 - (width / 2)); +// y_offset = (int)(cell_area.Height / 2 - (height / 2)); +// } Image GetImage () { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs index e6f0c23f4bb..a17f2d45220 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs @@ -61,14 +61,23 @@ public bool ShowBorderLine { } } - protected override void OnSizeRequested (ref Gtk.Requisition requisition) + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - base.OnSizeRequested (ref requisition); + base.OnGetPreferredHeight (out min_height, out natural_height); //if showing a border line, request a little more space if (showBorderLine) { - requisition.Height += HScrollbar.Visible? 1 : 2; - requisition.Width += VScrollbar.Visible? 1 : 2; + min_height += HScrollbar.Visible? 1 : 2; + } + } + + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) + { + base.OnGetPreferredWidth (out min_width, out natural_width); + + //if showing a border line, request a little more space + if (showBorderLine) { + min_width += VScrollbar.Visible? 1 : 2; } } @@ -104,70 +113,70 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) } } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - var ret = base.OnExposeEvent (evnt); - if (!showBorderLine) - return ret; - - bool hasHScroll = HScrollbar.Visible; - bool hasVScroll = VScrollbar.Visible; - - //this is the rectangle that defines where we will draw the border lines - //note that Allocation was set by the base, but we altered it during allocation, so take that into account - var rect = Allocation; - var borderWidth = (int) BorderWidth; - rect.X += borderWidth - 1; - rect.Y += borderWidth - 1; - rect.Width -= borderWidth + borderWidth - 2; - rect.Height -= borderWidth + borderWidth - 2; - - //if there will be scrollbars, bring the end of the lines to the middle of the scrollbar so it looks nice - if (hasHScroll) { - rect.Height -= HScrollbar.Allocation.Height / 2; - } - - if (hasVScroll) { - rect.Width -= VScrollbar.Allocation.Width / 2; - } - - double lineWidth = 1; - var halfLineWidth = lineWidth / 2.0; - - //draw the border lines - using (var cr = Gdk.CairoHelper.Create (evnt.Window)) { - Gdk.CairoHelper.Region (cr, evnt.Region); - cr.Clip (); - - cr.SetSourceColor (Style.Dark (Gtk.StateType.Normal).ToCairoColor ()); - cr.LineWidth = lineWidth; - cr.Translate (rect.X, rect.Y); - - //top - cr.MoveTo (0, halfLineWidth); - cr.LineTo (rect.Width, halfLineWidth); - - //bottom. redundant if there's a horizontal scrollbar. - if (!hasHScroll) { - cr.MoveTo (0, rect.Height - halfLineWidth); - cr.LineTo (rect.Width, rect.Height - halfLineWidth); - } - - //left - cr.MoveTo (halfLineWidth, 0); - cr.LineTo (halfLineWidth, rect.Height); - - //right. redundant if there's a vertical scrollbar. - if (!hasVScroll) { - cr.MoveTo (rect.Width - halfLineWidth, 0); - cr.LineTo (rect.Width - halfLineWidth, rect.Height); - } - - cr.Stroke (); - } - - return ret; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// var ret = base.OnExposeEvent (evnt); +// if (!showBorderLine) +// return ret; +// +// bool hasHScroll = HScrollbar.Visible; +// bool hasVScroll = VScrollbar.Visible; +// +// //this is the rectangle that defines where we will draw the border lines +// //note that Allocation was set by the base, but we altered it during allocation, so take that into account +// var rect = Allocation; +// var borderWidth = (int) BorderWidth; +// rect.X += borderWidth - 1; +// rect.Y += borderWidth - 1; +// rect.Width -= borderWidth + borderWidth - 2; +// rect.Height -= borderWidth + borderWidth - 2; +// +// //if there will be scrollbars, bring the end of the lines to the middle of the scrollbar so it looks nice +// if (hasHScroll) { +// rect.Height -= HScrollbar.Allocation.Height / 2; +// } +// +// if (hasVScroll) { +// rect.Width -= VScrollbar.Allocation.Width / 2; +// } +// +// double lineWidth = 1; +// var halfLineWidth = lineWidth / 2.0; +// +// //draw the border lines +// using (var cr = Gdk.CairoHelper.Create (evnt.Window)) { +// Gdk.CairoHelper.Region (cr, evnt.Region); +// cr.Clip (); +// +// cr.SetSourceColor (Style.Dark (Gtk.StateType.Normal).ToCairoColor ()); +// cr.LineWidth = lineWidth; +// cr.Translate (rect.X, rect.Y); +// +// //top +// cr.MoveTo (0, halfLineWidth); +// cr.LineTo (rect.Width, halfLineWidth); +// +// //bottom. redundant if there's a horizontal scrollbar. +// if (!hasHScroll) { +// cr.MoveTo (0, rect.Height - halfLineWidth); +// cr.LineTo (rect.Width, rect.Height - halfLineWidth); +// } +// +// //left +// cr.MoveTo (halfLineWidth, 0); +// cr.LineTo (halfLineWidth, rect.Height); +// +// //right. redundant if there's a vertical scrollbar. +// if (!hasVScroll) { +// cr.MoveTo (rect.Width - halfLineWidth, 0); +// cr.LineTo (rect.Width - halfLineWidth, rect.Height); +// } +// +// cr.Stroke (); +// } +// +// return ret; +// } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs index f7cc0788151..76b522957a7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs @@ -79,19 +79,19 @@ class PoupHandlerWrapper public PoupHandlerWrapper (ContextMenu menu, Gtk.Menu gtkMenu) { this.menu = menu; - gtkMenu.ExposeEvent += HandleExposeEvent; + //gtkMenu.ExposeEvent += HandleExposeEvent; } - void HandleExposeEvent (object o, Gtk.ExposeEventArgs args) - { - var gtkMenu = (Gtk.Menu)o; - gtkMenu.ExposeEvent -= HandleExposeEvent; - int ox, oy; - gtkMenu.ParentWindow.GetOrigin (out ox, out oy); - int rx, ry; - IdeApp.Workbench.RootWindow.GdkWindow.GetOrigin (out rx, out ry); - menu.Items [0].FireSelectedEvent (new Xwt.Rectangle (ox - rx, oy - ry, gtkMenu.Allocation.Width, gtkMenu.Allocation.Height)); - } +// void HandleExposeEvent (object o, Gtk.ExposeEventArgs args) +// { +// var gtkMenu = (Gtk.Menu)o; +// gtkMenu.ExposeEvent -= HandleExposeEvent; +// int ox, oy; +// gtkMenu.ParentWindow.GetOrigin (out ox, out oy); +// int rx, ry; +// IdeApp.Workbench.RootWindow.GdkWindow.GetOrigin (out rx, out ry); +// menu.Items [0].FireSelectedEvent (new Xwt.Rectangle (ox - rx, oy - ry, gtkMenu.Allocation.Width, gtkMenu.Allocation.Height)); +// } } public static void ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt, Gtk.Menu menu) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs index 87b795386a0..92d3a7093c9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs @@ -40,7 +40,7 @@ public ContextMenuTreeView () ActionHandler.PerformShowMenu += PerformShowMenu; } - public ContextMenuTreeView (Gtk.TreeModel model) : base (model) + public ContextMenuTreeView (Gtk.ITreeModel model) : base (model) { } @@ -198,4 +198,4 @@ bool MultipleNodesSelected () return Selection.GetSelectedRows ().Length > 1; } } -} \ No newline at end of file +} diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs index 9c950c757ae..4235527b3b9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs @@ -182,16 +182,15 @@ protected override void OnDestroyed () base.OnDestroyed (); } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { int width, height; + natural_width = 0; + min_width = 0; layout.GetPixelSize (out width, out height); if (Pixbuf != null) { width += (int)Pixbuf.Width + pixbufSpacing * 2; - height = System.Math.Max (height, (int)Pixbuf.Height); - } else { - height = System.Math.Max (height, defaultIconHeight); } if (DrawRightBorder) @@ -199,8 +198,25 @@ protected override void OnSizeRequested (ref Requisition requisition) int arrowHeight = height / 2; int arrowWidth = arrowHeight + 1; - requisition.Width = FixedWidth > 0 ? FixedWidth : width + arrowWidth + leftSpacing; - requisition.Height = FixedHeight >0 ? FixedHeight : height + ySpacing * 2; + min_width = FixedWidth > 0 ? FixedWidth : width + arrowWidth + leftSpacing; + } + + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) + { + int width, height; + natural_height = 0; + min_height = 0; + layout.GetPixelSize (out width, out height); + + if (Pixbuf != null) { + height = System.Math.Max (height, (int)Pixbuf.Height); + } else { + height = System.Math.Max (height, defaultIconHeight); + } + + int arrowHeight = height / 2; + + min_height = FixedHeight >0 ? FixedHeight : height + ySpacing * 2; } protected override bool OnFocusOutEvent (Gdk.EventFocus evnt) @@ -279,71 +295,71 @@ protected override bool OnMotionNotifyEvent (Gdk.EventMotion e) return base.OnMotionNotifyEvent (e); } - protected override bool OnExposeEvent (Gdk.EventExpose args) - { - Gdk.Drawable win = args.Window; - - int width, height; - layout.GetPixelSize (out width, out height); - - int arrowHeight = height / 2; - int arrowWidth = arrowHeight + 1; - int arrowXPos = this.Allocation.X + this.Allocation.Width - arrowWidth; - if (DrawButtonShape) { - arrowXPos -= 4; - } else if (DrawRightBorder) { - arrowXPos -= 2; - } - - //HACK: don't ever draw insensitive, only active/prelight/normal, because insensitive generally looks really ugly - //this *might* cause some theme issues with the state of the text/arrows rendering on top of it - var state = window != null? StateType.Active - : State == StateType.Insensitive? StateType.Normal : State; - - //HACK: paint the button background as if it were bigger, but it stays clipped to the real area, - // so we get the content but not the border. This might break with crazy themes. - //FIXME: we can't use the style's actual internal padding because GTK# hasn't wrapped GtkBorder AFAICT - // (default-border, inner-border, default-outside-border, etc - see http://git.gnome.org/browse/gtk+/tree/gtk/gtkbutton.c) - const int padding = 4; - if (DrawButtonShape){ - Style.PaintBox (Style, args.Window, state, ShadowType.None, args.Area, this, "button", - Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); - - } else { - Style.PaintBox (Style, args.Window, state, ShadowType.None, args.Area, this, "button", - Allocation.X - padding, Allocation.Y - padding, Allocation.Width + padding * 2, Allocation.Height + padding * 2); - } - - int xPos = Allocation.Left; - if (Pixbuf != null) { - using (var ctx = Gdk.CairoHelper.Create (win)) - ctx.DrawImage (this, Pixbuf, xPos + pixbufSpacing, Allocation.Y + (Allocation.Height - Pixbuf.Height) / 2); - xPos += (int)Pixbuf.Width + pixbufSpacing * 2; - } - if (DrawButtonShape) - xPos += 4; - - //constrain the text area so it doesn't get rendered under the arrows - var textArea = new Gdk.Rectangle (xPos, Allocation.Y + ySpacing, arrowXPos - xPos - 2, Allocation.Height - ySpacing); - - if (FixedWidth > 0) { - layout.Ellipsize = Pango.EllipsizeMode.End; - layout.Width = Allocation.Width - textArea.X; - } - - Style.PaintLayout (Style, win, state, true, textArea, this, "", textArea.X, textArea.Y + Math.Max (0, (textArea.Height - height) / 2), layout); - - state = Sensitive ? StateType.Normal : StateType.Insensitive; - Gtk.Style.PaintArrow (this.Style, win, state, ShadowType.None, args.Area, this, "", ArrowType.Up, true, arrowXPos, Allocation.Y + (Allocation.Height) / 2 - arrowHeight, arrowWidth, arrowHeight); - Gtk.Style.PaintArrow (this.Style, win, state, ShadowType.None, args.Area, this, "", ArrowType.Down, true, arrowXPos, Allocation.Y + (Allocation.Height) / 2, arrowWidth, arrowHeight); - if (!DrawButtonShape) { - if (DrawRightBorder) - win.DrawLine (this.Style.DarkGC (StateType.Normal), Allocation.X + Allocation.Width - 1, Allocation.Y, Allocation.X + Allocation.Width - 1, Allocation.Y + Allocation.Height); - if (DrawLeftBorder) - win.DrawLine (this.Style.DarkGC (StateType.Normal), Allocation.X, Allocation.Y, Allocation.X, Allocation.Y + Allocation.Height); - } - return false; - } +// protected override bool OnExposeEvent (Gdk.EventExpose args) +// { +// Gdk.Drawable win = args.Window; +// +// int width, height; +// layout.GetPixelSize (out width, out height); +// +// int arrowHeight = height / 2; +// int arrowWidth = arrowHeight + 1; +// int arrowXPos = this.Allocation.X + this.Allocation.Width - arrowWidth; +// if (DrawButtonShape) { +// arrowXPos -= 4; +// } else if (DrawRightBorder) { +// arrowXPos -= 2; +// } +// +// //HACK: don't ever draw insensitive, only active/prelight/normal, because insensitive generally looks really ugly +// //this *might* cause some theme issues with the state of the text/arrows rendering on top of it +// var state = window != null? StateType.Active +// : State == StateType.Insensitive? StateType.Normal : State; +// +// //HACK: paint the button background as if it were bigger, but it stays clipped to the real area, +// // so we get the content but not the border. This might break with crazy themes. +// //FIXME: we can't use the style's actual internal padding because GTK# hasn't wrapped GtkBorder AFAICT +// // (default-border, inner-border, default-outside-border, etc - see http://git.gnome.org/browse/gtk+/tree/gtk/gtkbutton.c) +// const int padding = 4; +// if (DrawButtonShape){ +// Style.PaintBox (Style, args.Window, state, ShadowType.None, args.Area, this, "button", +// Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); +// +// } else { +// Style.PaintBox (Style, args.Window, state, ShadowType.None, args.Area, this, "button", +// Allocation.X - padding, Allocation.Y - padding, Allocation.Width + padding * 2, Allocation.Height + padding * 2); +// } +// +// int xPos = Allocation.Left; +// if (Pixbuf != null) { +// using (var ctx = Gdk.CairoHelper.Create (win)) +// ctx.DrawImage (this, Pixbuf, xPos + pixbufSpacing, Allocation.Y + (Allocation.Height - Pixbuf.Height) / 2); +// xPos += (int)Pixbuf.Width + pixbufSpacing * 2; +// } +// if (DrawButtonShape) +// xPos += 4; +// +// //constrain the text area so it doesn't get rendered under the arrows +// var textArea = new Gdk.Rectangle (xPos, Allocation.Y + ySpacing, arrowXPos - xPos - 2, Allocation.Height - ySpacing); +// +// if (FixedWidth > 0) { +// layout.Ellipsize = Pango.EllipsizeMode.End; +// layout.Width = Allocation.Width - textArea.X; +// } +// +// Style.PaintLayout (Style, win, state, true, textArea, this, "", textArea.X, textArea.Y + Math.Max (0, (textArea.Height - height) / 2), layout); +// +// state = Sensitive ? StateType.Normal : StateType.Insensitive; +// Gtk.Style.PaintArrow (this.Style, win, state, ShadowType.None, args.Area, this, "", ArrowType.Up, true, arrowXPos, Allocation.Y + (Allocation.Height) / 2 - arrowHeight, arrowWidth, arrowHeight); +// Gtk.Style.PaintArrow (this.Style, win, state, ShadowType.None, args.Area, this, "", ArrowType.Down, true, arrowXPos, Allocation.Y + (Allocation.Height) / 2, arrowWidth, arrowHeight); +// if (!DrawButtonShape) { +// if (DrawRightBorder) +// win.DrawLine (this.Style.DarkGC (StateType.Normal), Allocation.X + Allocation.Width - 1, Allocation.Y, Allocation.X + Allocation.Width - 1, Allocation.Y + Allocation.Height); +// if (DrawLeftBorder) +// win.DrawLine (this.Style.DarkGC (StateType.Normal), Allocation.X, Allocation.Y, Allocation.X, Allocation.Y + Allocation.Height); +// } +// return false; +// } public EventHandler ItemSet; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs index 13028e8b00c..29cf3811861 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs @@ -420,7 +420,7 @@ protected override bool OnButtonPressEvent (Gdk.EventButton evnt) protected override bool OnMotionNotifyEvent (Gdk.EventMotion evnt) { int winWidth, winHeight; - GdkWindow.GetSize (out winWidth, out winHeight); +// GdkWindow.GetSize (out winWidth, out winHeight); curMouseY = (int)evnt.Y; Selection = GetRowByPosition (curMouseY); @@ -440,17 +440,17 @@ protected override bool OnScrollEvent (Gdk.EventScroll evnt) return base.OnScrollEvent (evnt); } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - base.OnExposeEvent (evnt); - DrawList (); - return false; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// base.OnExposeEvent (evnt); +// DrawList (); +// return false; +// } void DrawList () { - int winWidth, winHeight; - GdkWindow.GetSize (out winWidth, out winHeight); + int winWidth = 0, winHeight = 0; +// GdkWindow.GetSize (out winWidth, out winHeight); int lineWidth = winWidth - leftXAlignment * 2; const int xpos = leftXAlignment + padding; @@ -475,26 +475,26 @@ void DrawList () if (n == selection) { if (!disableSelection) { - GdkWindow.DrawRectangle (Style.BaseGC (StateType.Selected), - true, leftXAlignment, ypos, lineWidth, rowHeight); - GdkWindow.DrawLayout (Style.TextGC (StateType.Selected), - xpos + iconWidth + iconTextDistance, typos, layout); +// GdkWindow.DrawRectangle (Style.BaseGC (StateType.Selected), +// true, leftXAlignment, ypos, lineWidth, rowHeight); +// GdkWindow.DrawLayout (Style.TextGC (StateType.Selected), +// xpos + iconWidth + iconTextDistance, typos, layout); if (icon != null) icon = icon.WithStyles ("sel"); - } else { - GdkWindow.DrawRectangle (Style.BaseGC (StateType.Selected), - false, leftXAlignment, ypos, lineWidth, rowHeight); - GdkWindow.DrawLayout (Style.TextGC (StateType.Normal), - xpos + iconWidth + iconTextDistance, typos, layout); - } - } else - GdkWindow.DrawLayout (Style.TextGC (StateType.Normal), - xpos + iconWidth + iconTextDistance, typos, layout); + } //else { +// GdkWindow.DrawRectangle (Style.BaseGC (StateType.Selected), +// false, leftXAlignment, ypos, lineWidth, rowHeight); +// GdkWindow.DrawLayout (Style.TextGC (StateType.Normal), +// xpos + iconWidth + iconTextDistance, typos, layout); +// } + } //else +// GdkWindow.DrawLayout (Style.TextGC (StateType.Normal), +// xpos + iconWidth + iconTextDistance, typos, layout); - if (icon != null) { - using (var ctx = Gdk.CairoHelper.Create (this.GdkWindow)) - ctx.DrawImage (this, icon, xpos, iypos); - } +// if (icon != null) { +// using (var ctx = Gdk.CairoHelper.Create (this.GdkWindow)) +// ctx.DrawImage (this, icon, xpos, iypos); +// } ypos += rowHeight; n++; @@ -609,18 +609,18 @@ void UpdateStyle () Adjustment hAdjustment; Adjustment vAdjustment; - protected override void OnSetScrollAdjustments (Adjustment hadj, Adjustment vadj) - { - hAdjustment = hadj; - vAdjustment = vadj; - if (vAdjustment != null) - vAdjustment.ValueChanged += delegate { - if (selection > -1) - Selection = GetRowByPosition (curMouseY); - QueueDraw (); - }; - base.OnSetScrollAdjustments (hadj, vadj); - } +// protected override void OnSetScrollAdjustments (Adjustment hadj, Adjustment vadj) +// { +// hAdjustment = hadj; +// vAdjustment = vadj; +// if (vAdjustment != null) +// vAdjustment.ValueChanged += delegate { +// if (selection > -1) +// Selection = GetRowByPosition (curMouseY); +// QueueDraw (); +// }; +// base.OnSetScrollAdjustments (hadj, vadj); +// } internal virtual void OnSelectItem (EventArgs e) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ExtendedLabel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ExtendedLabel.cs index 222c1a3ab38..82784ccf009 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ExtendedLabel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ExtendedLabel.cs @@ -39,48 +39,48 @@ public ExtendedLabel (string text): base (text) { } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - Pango.Layout la = new Pango.Layout (PangoContext); - int w, h; - if (UseMarkup) - la.SetMarkup (Text); - else - la.SetText (Text); - - la.GetPixelSize (out w, out h); - - int tx = Allocation.X + (int) Xpad + (int) ((float)(Allocation.Width - (int)(Xpad*2) - w) * Xalign); - int ty = Allocation.Y + (int) Ypad + (int) ((float)(Allocation.Height - (int)(Ypad*2) - h) * Yalign); - - using (var ctx = CairoHelper.Create (evnt.Window)) { - ctx.SetSourceColor (Style.Text (State).ToCairoColor ()); - ctx.MoveTo (tx, ty); - - // In order to get the same result as in MonoDevelop.Components.DockNotebook.TabStrip.DrawTab() - // (document tabs) we need to draw using a LinearGradient (because of issues below), - // but we don't want to mask the actual text here, like in the doc tabs. - // Therefore we use a LinearGradient and mask only the last vertical pixel line - // of the label with 0.99 alpha, which forces Cairo to render the whole layout - // in the desired way. - - // Semi-transparent gradient disables sub-pixel rendering of the label (reverting to grayscale antialiasing). - // As Mac sub-pixel font rendering looks stronger than grayscale rendering, the label used in pad tabs - // looked different. We need to simulate same gradient treatment as we have in document tabs. - - using (var lg = new LinearGradient (tx + w - 1, 0, tx + w, 0)) { - var color = Style.Text (State).ToCairoColor (); - lg.AddColorStop (0, color); - color.A = 0.99; - lg.AddColorStop (1, color); - ctx.SetSource (lg); - Pango.CairoHelper.ShowLayout (ctx, la); - } - } - - la.Dispose (); - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// Pango.Layout la = new Pango.Layout (PangoContext); +// int w, h; +// if (UseMarkup) +// la.SetMarkup (Text); +// else +// la.SetText (Text); +// +// la.GetPixelSize (out w, out h); +// +// int tx = Allocation.X + (int) Xpad + (int) ((float)(Allocation.Width - (int)(Xpad*2) - w) * Xalign); +// int ty = Allocation.Y + (int) Ypad + (int) ((float)(Allocation.Height - (int)(Ypad*2) - h) * Yalign); +// +// using (var ctx = CairoHelper.Create (evnt.Window)) { +// ctx.SetSourceColor (Style.Text (State).ToCairoColor ()); +// ctx.MoveTo (tx, ty); +// +// // In order to get the same result as in MonoDevelop.Components.DockNotebook.TabStrip.DrawTab() +// // (document tabs) we need to draw using a LinearGradient (because of issues below), +// // but we don't want to mask the actual text here, like in the doc tabs. +// // Therefore we use a LinearGradient and mask only the last vertical pixel line +// // of the label with 0.99 alpha, which forces Cairo to render the whole layout +// // in the desired way. +// +// // Semi-transparent gradient disables sub-pixel rendering of the label (reverting to grayscale antialiasing). +// // As Mac sub-pixel font rendering looks stronger than grayscale rendering, the label used in pad tabs +// // looked different. We need to simulate same gradient treatment as we have in document tabs. +// +// using (var lg = new LinearGradient (tx + w - 1, 0, tx + w, 0)) { +// var color = Style.Text (State).ToCairoColor (); +// lg.AddColorStop (0, color); +// color.A = 0.99; +// lg.AddColorStop (1, color); +// ctx.SetSource (lg); +// Pango.CairoHelper.ShowLayout (ctx, la); +// } +// } +// +// la.Dispose (); +// return true; +// } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FixedWidthWrapLabel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FixedWidthWrapLabel.cs index f7c12d91342..52394c79657 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FixedWidthWrapLabel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FixedWidthWrapLabel.cs @@ -63,7 +63,7 @@ public Pango.FontDescription FontDescription { } public FixedWidthWrapLabel () { - WidgetFlags |= WidgetFlags.NoWindow; + this.HasWindow = true; } public FixedWidthWrapLabel (string text) @@ -142,14 +142,22 @@ protected override void OnStyleSet (Style previous_style) base.OnStyleSet (previous_style); } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { - base.OnSizeRequested (ref requisition); + base.OnGetPreferredWidth (out min_width, out natural_width); UpdateLayout (); int lw, lh; layout.GetPixelSize (out lw, out lh); - requisition.Height = lh; - requisition.Width = lw; + min_width = lw; + } + + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) + { + base.OnGetPreferredHeight (out min_height, out natural_height); + UpdateLayout (); + int lw, lh; + layout.GetPixelSize (out lw, out lh); + min_height = lh; } // protected override void OnSizeAllocated (Gdk.Rectangle allocation) @@ -165,18 +173,18 @@ protected override void OnSizeRequested (ref Requisition requisition) // } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - UpdateLayout (); - if (evnt.Window != GdkWindow) { - return base.OnExposeEvent (evnt); - } - - Gtk.Style.PaintLayout (Style, GdkWindow, State, false, evnt.Area, - this, null, Allocation.X, Allocation.Y, layout); - - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// UpdateLayout (); +// if (evnt.Window != GdkWindow) { +// return base.OnExposeEvent (evnt); +// } +// +// Gtk.Style.PaintLayout (Style, GdkWindow, State, false, evnt.Area, +// this, null, Allocation.X, Allocation.Y, layout); +// +// return true; +// } public string Markup { get { return text; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkGestures.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkGestures.cs index a819fc0f74c..d212647f2b0 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkGestures.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkGestures.cs @@ -57,24 +57,24 @@ public static void AddGestureMagnifyHandler (this Gtk.Widget widget, EventHandle { if (!isSupported) throw new NotSupportedException (); - var signal = GLib.Signal.Lookup (widget, "gesture-magnify-event", typeof(GestureMagnifyEventArgs)); - signal.AddDelegate (new EventHandler (handler)); + //var signal = GLib.Signal.Lookup (widget, "gesture-magnify-event", typeof(GestureMagnifyEventArgs)); + //signal.AddDelegate (new EventHandler (handler)); } public static void AddGestureRotateHandler (this Gtk.Widget widget, EventHandler handler) { if (!isSupported) throw new NotSupportedException (); - var signal = GLib.Signal.Lookup (widget, "gesture-rotate-event", typeof(GestureRotateEventArgs)); - signal.AddDelegate (new EventHandler (handler)); +// var signal = GLib.Signal.Lookup (widget, "gesture-rotate-event", typeof(GestureRotateEventArgs)); +// signal.AddDelegate (new EventHandler (handler)); } public static void AddGestureSwipeHandler (this Gtk.Widget widget, EventHandler handler) { if (!isSupported) throw new NotSupportedException (); - var signal = GLib.Signal.Lookup (widget, "gesture-swipe-event", typeof(GestureSwipeEventArgs)); - signal.AddDelegate (new EventHandler (handler)); + //var signal = GLib.Signal.Lookup (widget, "gesture-swipe-event", typeof(GestureSwipeEventArgs)); + //signal.AddDelegate (new EventHandler (handler)); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs index c3a176f3dbc..e1d08c2c356 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs @@ -971,66 +971,66 @@ public CellTooltipWindow (TreeView tree, TreeViewColumn col, TreePath path) col.CellSetCellData (tree.Model, iter, false, false); int x = 0; int th = 0; - CellRenderer[] renderers = col.CellRenderers; - foreach (CellRenderer cr in renderers) { - int sp, wi, he, xo, yo; - col.CellGetPosition (cr, out sp, out wi); - Gdk.Rectangle crect = new Gdk.Rectangle (x, rect.Y, wi, rect.Height); - cr.GetSize (tree, ref crect, out xo, out yo, out wi, out he); - if (cr != renderers [renderers.Length - 1]) - x += crect.Width + col.Spacing + 1; - else - x += wi + 1; - if (he > th) th = he; - } +// CellRenderer[] renderers = col.CellRenderers; +// foreach (CellRenderer cr in renderers) { +// int sp, wi, he, xo, yo; +// col.CellGetPosition (cr, out sp, out wi); +// Gdk.Rectangle crect = new Gdk.Rectangle (x, rect.Y, wi, rect.Height); +// cr.GetSize (tree, ref crect, out xo, out yo, out wi, out he); +// if (cr != renderers [renderers.Length - 1]) +// x += crect.Width + col.Spacing + 1; +// else +// x += wi + 1; +// if (he > th) th = he; +// } SetSizeRequest (x, th + 2); } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - base.OnExposeEvent (evnt); - - Gdk.Rectangle expose = Allocation; - Gdk.Color save = Gdk.Color.Zero; - bool hasFgColor = false; - int x = 1; - - // Make sure that the row has not been removed inbetween. - // If the model is a TreeStore, it can do the validation for us, otherwise we need to validate the path. - if ((treeStore != null && treeStore.IterIsValid (iter) == false) || !tree.Model.GetIter (out iter, path)) { - GtkUtil.HideTooltip (tree); - return true; - } - col.CellSetCellData (tree.Model, iter, false, false); - - foreach (CellRenderer cr in col.CellRenderers) { - if (!cr.Visible) - continue; - - if (cr is CellRendererText) { - hasFgColor = ((CellRendererText)cr).GetCellForegroundSet (); - save = ((CellRendererText)cr).ForegroundGdk; - ((CellRendererText)cr).ForegroundGdk = Style.Foreground (State); - } - - int sp, wi, he, xo, yo; - col.CellGetPosition (cr, out sp, out wi); - Gdk.Rectangle bgrect = new Gdk.Rectangle (x, expose.Y, wi, expose.Height - 2); - cr.GetSize (tree, ref bgrect, out xo, out yo, out wi, out he); - int leftMargin = (int) ((bgrect.Width - wi) * cr.Xalign); - int topMargin = (int) ((bgrect.Height - he) * cr.Yalign); - Gdk.Rectangle cellrect = new Gdk.Rectangle (bgrect.X + leftMargin, bgrect.Y + topMargin + 1, wi, he); - cr.Render (this.GdkWindow, this, bgrect, cellrect, expose, CellRendererState.Focused); - x += bgrect.Width + col.Spacing + 1; - - if (cr is CellRendererText) { - ((CellRendererText)cr).ForegroundGdk = save; - ((CellRendererText)cr).SetCellForegroundSet (hasFgColor); - } - } - - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// base.OnExposeEvent (evnt); +// +// Gdk.Rectangle expose = Allocation; +// Gdk.Color save = Gdk.Color.Zero; +// bool hasFgColor = false; +// int x = 1; +// +// // Make sure that the row has not been removed inbetween. +// // If the model is a TreeStore, it can do the validation for us, otherwise we need to validate the path. +// if ((treeStore != null && treeStore.IterIsValid (iter) == false) || !tree.Model.GetIter (out iter, path)) { +// GtkUtil.HideTooltip (tree); +// return true; +// } +// col.CellSetCellData (tree.Model, iter, false, false); +// +// foreach (CellRenderer cr in col.CellRenderers) { +// if (!cr.Visible) +// continue; +// +// if (cr is CellRendererText) { +// hasFgColor = ((CellRendererText)cr).GetCellForegroundSet (); +// save = ((CellRendererText)cr).ForegroundGdk; +// ((CellRendererText)cr).ForegroundGdk = Style.Foreground (State); +// } +// +// int sp, wi, he, xo, yo; +// col.CellGetPosition (cr, out sp, out wi); +// Gdk.Rectangle bgrect = new Gdk.Rectangle (x, expose.Y, wi, expose.Height - 2); +// cr.GetSize (tree, ref bgrect, out xo, out yo, out wi, out he); +// int leftMargin = (int) ((bgrect.Width - wi) * cr.Xalign); +// int topMargin = (int) ((bgrect.Height - he) * cr.Yalign); +// Gdk.Rectangle cellrect = new Gdk.Rectangle (bgrect.X + leftMargin, bgrect.Y + topMargin + 1, wi, he); +// cr.Render (this.GdkWindow, this, bgrect, cellrect, expose, CellRendererState.Focused); +// x += bgrect.Width + col.Spacing + 1; +// +// if (cr is CellRendererText) { +// ((CellRendererText)cr).ForegroundGdk = save; +// ((CellRendererText)cr).SetCellForegroundSet (hasFgColor); +// } +// } +// +// return true; +// } protected override bool OnButtonPressEvent (Gdk.EventButton evnt) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs index bc4797ec0a1..1ae5ab73c85 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs @@ -395,17 +395,17 @@ public static bool IsContextMenuButton (this Gdk.EventButton evt) public static Gdk.ModifierType GetCurrentKeyModifiers () { #if WIN32 - Gdk.ModifierType mtype = Gdk.ModifierType.None; - ModifierKeys mod = Keyboard.Modifiers; - if ((mod & ModifierKeys.Shift) > 0) - mtype |= Gdk.ModifierType.ShiftMask; - if ((mod & ModifierKeys.Control) > 0) - mtype |= Gdk.ModifierType.ControlMask; - if ((mod & ModifierKeys.Alt) > 0) - mtype |= Gdk.ModifierType.Mod1Mask; // Alt key - if ((mod & ModifierKeys.Windows) > 0) - mtype |= Gdk.ModifierType.Mod2Mask; // Command key - return mtype; + Gdk.ModifierType mtype = Gdk.ModifierType.None; + ModifierKeys mod = Keyboard.Modifiers; + if ((mod & ModifierKeys.Shift) > 0) + mtype |= Gdk.ModifierType.ShiftMask; + if ((mod & ModifierKeys.Control) > 0) + mtype |= Gdk.ModifierType.ControlMask; + if ((mod & ModifierKeys.Alt) > 0) + mtype |= Gdk.ModifierType.Mod1Mask; // Alt key + if ((mod & ModifierKeys.Windows) > 0) + mtype |= Gdk.ModifierType.Mod2Mask; // Command key + return mtype; #else if (Platform.IsMac) { Gdk.ModifierType mtype = Gdk.ModifierType.None; @@ -1091,8 +1091,8 @@ void HandleLink (object sender, ActivateLinkEventArgs args) public void ConnectTo (Gtk.Label label) { - var signal = GLib.Signal.Lookup (label, "activate-link", typeof(ActivateLinkEventArgs)); - signal.AddDelegate (new EventHandler (HandleLink)); +// var signal = GLib.Signal.Lookup (label, "activate-link", typeof(ActivateLinkEventArgs)); +// signal.AddDelegate (new EventHandler (HandleLink)); } class ActivateLinkEventArgs : GLib.SignalArgs @@ -1150,7 +1150,7 @@ public static void GetOverlayScrollbarPolicy (Gtk.ScrolledWindow sw, out Gtk.Pol //the GTK# version of this has 'out' instead of 'ref', preventing passing the x,y values in public static bool GetTooltipContext (this TreeView tree, ref int x, ref int y, bool keyboardTip, - out TreeModel model, out TreePath path, out Gtk.TreeIter iter) + out ITreeModel model, out TreePath path, out Gtk.TreeIter iter) { IntPtr intPtr = Marshal.AllocHGlobal (Marshal.SizeOf (typeof(TreeIter))); IntPtr handle; @@ -1305,20 +1305,20 @@ public static Gdk.Pixbuf RenderIcon (this Gtk.IconSet iconset, Gtk.Style style, [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] static extern void gtk_object_set_data (IntPtr raw, IntPtr key, IntPtr data); - public static void SetData (Gtk.Object gtkobject, string key, T data) where T: struct - { - IntPtr pkey = GLib.Marshaller.StringToPtrGStrdup (key); - IntPtr pdata = Marshal.AllocHGlobal(Marshal.SizeOf(data)); - Marshal.StructureToPtr(data, pdata, false); - gtk_object_set_data (gtkobject.Handle, pkey, pdata); - Marshal.FreeHGlobal(pdata); - GLib.Marshaller.Free (pkey); - gtkobject.Data [key] = data; - } +// public static void SetData (Gtk.Object gtkobject, string key, T data) where T: struct +// { +// IntPtr pkey = GLib.Marshaller.StringToPtrGStrdup (key); +// IntPtr pdata = Marshal.AllocHGlobal(Marshal.SizeOf(data)); +// Marshal.StructureToPtr(data, pdata, false); +// gtk_object_set_data (gtkobject.Handle, pkey, pdata); +// Marshal.FreeHGlobal(pdata); +// GLib.Marshaller.Free (pkey); +// gtkobject.Data [key] = data; +// } public static void SetTransparentBgHint (this Widget widget, bool enable) { - SetData (widget, "transparent-bg-hint", enable); + //SetData (widget, "transparent-bg-hint", enable); } public static void SetMarkup (this Gtk.TextView view, string pangoMarkup) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs index 6ad66fed98a..c4d5aa4950f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs @@ -72,20 +72,20 @@ protected override void ForAll (bool include_internals, Gtk.Callback callback) callback (handle); } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - base.OnExposeEvent (evnt); - - if (Child1 != null && Child1.Visible && Child2 != null && Child2.Visible) { - var gc = new Gdk.GC (evnt.Window); - gc.RgbFgColor = Styles.ThinSplitterColor.ToGdkColor (); - var x = Child1.Allocation.X + Child1.Allocation.Width; - evnt.Window.DrawLine (gc, x, Allocation.Y, x, Allocation.Y + Allocation.Height); - gc.Dispose (); - } - - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// base.OnExposeEvent (evnt); +// +// if (Child1 != null && Child1.Visible && Child2 != null && Child2.Visible) { +// var gc = new Gdk.GC (evnt.Window); +// gc.RgbFgColor = Styles.ThinSplitterColor.ToGdkColor (); +// var x = Child1.Allocation.X + Child1.Allocation.Width; +// evnt.Window.DrawLine (gc, x, Allocation.Y, x, Allocation.Y + Allocation.Height); +// gc.Dispose (); +// } +// +// return true; +// } } class CustomPanedHandle: Gtk.EventBox @@ -107,9 +107,9 @@ public CustomPanedHandle (Gtk.Paned parent) GrabAreaSize = HandleGrabWidth; Events |= Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.PointerMotionMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask; - parent.SizeRequested += delegate { - SizeRequest (); - }; +// parent.SizeRequested += delegate { +// SizeRequest (); +// }; parent.SizeAllocated += HandleSizeAllocated; HandleWidget = null; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs index ec21b26c1b4..26b7225abc4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs @@ -127,15 +127,25 @@ protected override void OnAdded (Widget widget) child = widget; } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { + natural_height = 0; if (child != null) { - requisition = child.SizeRequest (); - requisition.Width += leftMargin + rightMargin + leftPadding + rightPadding; - requisition.Height += topMargin + bottomMargin + topPadding + bottomPadding; + min_height = child.SizeRequest ().Height; + min_height += topMargin + bottomMargin + topPadding + bottomPadding; } else { - requisition.Width = 0; - requisition.Height = 0; + min_height = 0; + } + } + + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) + { + natural_width = 0; + if (child != null) { + min_width = child.SizeRequest ().Width; + min_width += leftMargin + rightMargin + leftPadding + rightPadding; + } else { + min_width = 0; } } @@ -154,82 +164,82 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) child.SizeAllocate (allocation); } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - Gdk.Rectangle rect; - - if (GradientBackground) { - rect = new Gdk.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); - var gcol = Style.Background (Gtk.StateType.Normal).ToXwtColor (); - - using (Cairo.Context cr = Gdk.CairoHelper.Create (GdkWindow)) { - cr.NewPath (); - cr.MoveTo (rect.X, rect.Y); - cr.RelLineTo (rect.Width, 0); - cr.RelLineTo (0, rect.Height); - cr.RelLineTo (-rect.Width, 0); - cr.RelLineTo (0, -rect.Height); - cr.ClosePath (); - - // FIXME: VV: Remove gradient features - using (Cairo.Gradient pat = new Cairo.LinearGradient (rect.X, rect.Y, rect.X, rect.Bottom)) { - pat.AddColorStop (0, gcol.ToCairoColor ()); - gcol.Light -= 0.1; - if (gcol.Light < 0) - gcol.Light = 0; - pat.AddColorStop (1, gcol.ToCairoColor ()); - cr.SetSource (pat); - cr.FillPreserve (); - } - } - } else if (BackgroundColor != null) { - using (Cairo.Context cr = Gdk.CairoHelper.Create (GdkWindow)) { - cr.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); - cr.SetSourceColor (BackgroundColor.Value.ToCairoColor ()); - cr.Fill (); - } - } else if (useChildBackgroundColor && Child != null) { - using (Cairo.Context cr = Gdk.CairoHelper.Create (GdkWindow)) { - cr.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); - cr.SetSourceColor (Child.Style.Base (StateType.Normal).ToCairoColor ()); - cr.Fill (); - } - } - - bool res = base.OnExposeEvent (evnt); - - var borderColor = new Gdk.GC (GdkWindow); - borderColor.RgbFgColor = BorderColor != null ? BorderColor.Value : Style.Dark (Gtk.StateType.Normal); - - rect = Allocation; - for (int n=0; n= 0 && hoverIndex < Path.Length && leftPath [i] == Path [hoverIndex] && (menuVisible || pressed || hovering)) - DrawButtonBorder (ctx, x - padding, itemWidth + padding + padding); - - if (index == focusedPathIndex) { - focusRect = new Gdk.Rectangle (x - padding, 0, itemWidth + (padding * 2) ,0); - } - int textOffset = 0; - if (leftPath [i].DarkIcon != null) { - int iy = (height - (int)leftPath [i].DarkIcon.Height) / 2 + topPadding; - ctx.DrawImage (this, leftPath [i].DarkIcon, x, iy); - textOffset += (int) leftPath [i].DarkIcon.Width + iconSpacing; - } - - layout.Attributes = (i == activeIndex) ? boldAtts : null; - layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11); - layout.SetMarkup (GetFirstLineFromMarkup (leftPath [i].Markup)); - - ctx.Save (); - - // If size is being reduced, ellipsize it - bool showText = true; - if (widthReduced) { - int w = itemWidth - textOffset; - if (w > 0) { - ctx.Rectangle (x + textOffset, textTopPadding, w, height); - ctx.Clip (); - } else - showText = false; - } else - layout.Width = -1; - - if (showText) { - // Text - ctx.SetSourceColor (Styles.BreadcrumbTextColor.ToCairoColor ()); - ctx.MoveTo (x + textOffset, textTopPadding); - Pango.CairoHelper.ShowLayout (ctx, layout); - } - ctx.Restore (); - - if (!last) { - xpos += arrowLeftPadding; - if (leftPath [i].IsPathEnd) { - Style.PaintVline (Style, GdkWindow, State, evnt.Area, this, "", ypos, ypos + height, xpos - arrowSize / 2); - } else { - int arrowH = Math.Min (height, arrowSize); - int arrowY = ypos + (height - arrowH) / 2; - DrawPathSeparator (ctx, xpos, arrowY, arrowH); - } - xpos += arrowSize + arrowRightPadding; - } - } - - int xposRight = Allocation.Width - rightPadding; - for (int i = 0; i < rightPath.Length; i++, index++) { - // bool last = i == rightPath.Length - 1; - - // Reduce the item size when required - int itemWidth = currentWidths [i + leftPath.Length]; - xposRight -= itemWidth; - xposRight -= arrowSize; - - int x = xposRight; - - SetAccessibilityFrame (rightPath [i], x, itemWidth); - - if (hoverIndex >= 0 && hoverIndex < Path.Length && rightPath [i] == Path [hoverIndex] && (menuVisible || pressed || hovering)) - DrawButtonBorder (ctx, x - padding, itemWidth + padding + padding); - - if (index == focusedPathIndex) { - focusRect = new Gdk.Rectangle (x - padding, 0, itemWidth + (padding * 2), 0); - } - - int textOffset = 0; - if (rightPath [i].DarkIcon != null) { - ctx.DrawImage (this, rightPath [i].DarkIcon, x, ypos); - textOffset += (int) rightPath [i].DarkIcon.Width + padding; - } - - layout.Attributes = (i == activeIndex) ? boldAtts : null; - layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11); - layout.SetMarkup (GetFirstLineFromMarkup (rightPath [i].Markup)); - - ctx.Save (); - - // If size is being reduced, ellipsize it - bool showText = true; - if (widthReduced) { - int w = itemWidth - textOffset; - if (w > 0) { - ctx.Rectangle (x + textOffset, textTopPadding, w, height); - ctx.Clip (); - } else - showText = false; - } else - layout.Width = -1; - - if (showText) { - // Text - ctx.SetSourceColor (Styles.BreadcrumbTextColor.ToCairoColor ()); - ctx.MoveTo (x + textOffset, textTopPadding); - Pango.CairoHelper.ShowLayout (ctx, layout); - } - - ctx.Restore (); - } - - if (DrawBottomBorder) { - ctx.MoveTo (0, Allocation.Height - 0.5); - ctx.RelLineTo (Allocation.Width, 0); - ctx.SetSourceColor (Styles.BreadcrumbBottomBorderColor.ToCairoColor ()); - ctx.LineWidth = 1; - ctx.Stroke (); - } - if (HasFocus) { - int focusY = topPadding - buttonPadding; - int focusHeight = Allocation.Height - topPadding - bottomPadding + buttonPadding * 2; - - Gtk.Style.PaintFocus (Style, GdkWindow, State, Allocation, this, "label", focusRect.X, focusY, focusRect.Width, focusHeight); - } - } - return true; - } +// protected override bool OnExposeEvent (EventExpose evnt) +// { +// Gdk.Rectangle focusRect = new Gdk.Rectangle (0, 0, 0, 0); +// +// using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { +// int index = 0; +// ctx.Rectangle (0, 0, Allocation.Width, Allocation.Height); +// ctx.SetSourceColor (Styles.BreadcrumbBackgroundColor.ToCairoColor ()); +// ctx.Fill (); +// +// if (widths == null) +// return true; +// +// // Calculate the total required with, and the reduction to be applied in case it doesn't fit the available space +// +// bool widthReduced; +// var currentWidths = GetCurrentWidths (out widthReduced); +// +// // Render the paths +// +// int textTopPadding = topPadding + (height - textHeight) / 2; +// int xpos = leftPadding, ypos = topPadding; +// +// for (int i = 0; i < leftPath.Length; i++, index++) { +// bool last = i == leftPath.Length - 1; +// +// // Reduce the item size when required +// int itemWidth = currentWidths [i]; +// int x = xpos; +// xpos += itemWidth; +// +// SetAccessibilityFrame (leftPath [i], x, itemWidth); +// +// if (hoverIndex >= 0 && hoverIndex < Path.Length && leftPath [i] == Path [hoverIndex] && (menuVisible || pressed || hovering)) +// DrawButtonBorder (ctx, x - padding, itemWidth + padding + padding); +// +// if (index == focusedPathIndex) { +// focusRect = new Gdk.Rectangle (x - padding, 0, itemWidth + (padding * 2) ,0); +// } +// int textOffset = 0; +// if (leftPath [i].DarkIcon != null) { +// int iy = (height - (int)leftPath [i].DarkIcon.Height) / 2 + topPadding; +// ctx.DrawImage (this, leftPath [i].DarkIcon, x, iy); +// textOffset += (int) leftPath [i].DarkIcon.Width + iconSpacing; +// } +// +// layout.Attributes = (i == activeIndex) ? boldAtts : null; +// layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11); +// layout.SetMarkup (GetFirstLineFromMarkup (leftPath [i].Markup)); +// +// ctx.Save (); +// +// // If size is being reduced, ellipsize it +// bool showText = true; +// if (widthReduced) { +// int w = itemWidth - textOffset; +// if (w > 0) { +// ctx.Rectangle (x + textOffset, textTopPadding, w, height); +// ctx.Clip (); +// } else +// showText = false; +// } else +// layout.Width = -1; +// +// if (showText) { +// // Text +// ctx.SetSourceColor (Styles.BreadcrumbTextColor.ToCairoColor ()); +// ctx.MoveTo (x + textOffset, textTopPadding); +// Pango.CairoHelper.ShowLayout (ctx, layout); +// } +// ctx.Restore (); +// +// if (!last) { +// xpos += arrowLeftPadding; +// if (leftPath [i].IsPathEnd) { +// Style.PaintVline (Style, GdkWindow, State, evnt.Area, this, "", ypos, ypos + height, xpos - arrowSize / 2); +// } else { +// int arrowH = Math.Min (height, arrowSize); +// int arrowY = ypos + (height - arrowH) / 2; +// DrawPathSeparator (ctx, xpos, arrowY, arrowH); +// } +// xpos += arrowSize + arrowRightPadding; +// } +// } +// +// int xposRight = Allocation.Width - rightPadding; +// for (int i = 0; i < rightPath.Length; i++, index++) { +// // bool last = i == rightPath.Length - 1; +// +// // Reduce the item size when required +// int itemWidth = currentWidths [i + leftPath.Length]; +// xposRight -= itemWidth; +// xposRight -= arrowSize; +// +// int x = xposRight; +// +// SetAccessibilityFrame (rightPath [i], x, itemWidth); +// +// if (hoverIndex >= 0 && hoverIndex < Path.Length && rightPath [i] == Path [hoverIndex] && (menuVisible || pressed || hovering)) +// DrawButtonBorder (ctx, x - padding, itemWidth + padding + padding); +// +// if (index == focusedPathIndex) { +// focusRect = new Gdk.Rectangle (x - padding, 0, itemWidth + (padding * 2), 0); +// } +// +// int textOffset = 0; +// if (rightPath [i].DarkIcon != null) { +// ctx.DrawImage (this, rightPath [i].DarkIcon, x, ypos); +// textOffset += (int) rightPath [i].DarkIcon.Width + padding; +// } +// +// layout.Attributes = (i == activeIndex) ? boldAtts : null; +// layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11); +// layout.SetMarkup (GetFirstLineFromMarkup (rightPath [i].Markup)); +// +// ctx.Save (); +// +// // If size is being reduced, ellipsize it +// bool showText = true; +// if (widthReduced) { +// int w = itemWidth - textOffset; +// if (w > 0) { +// ctx.Rectangle (x + textOffset, textTopPadding, w, height); +// ctx.Clip (); +// } else +// showText = false; +// } else +// layout.Width = -1; +// +// if (showText) { +// // Text +// ctx.SetSourceColor (Styles.BreadcrumbTextColor.ToCairoColor ()); +// ctx.MoveTo (x + textOffset, textTopPadding); +// Pango.CairoHelper.ShowLayout (ctx, layout); +// } +// +// ctx.Restore (); +// } +// +// if (DrawBottomBorder) { +// ctx.MoveTo (0, Allocation.Height - 0.5); +// ctx.RelLineTo (Allocation.Width, 0); +// ctx.SetSourceColor (Styles.BreadcrumbBottomBorderColor.ToCairoColor ()); +// ctx.LineWidth = 1; +// ctx.Stroke (); +// } +// if (HasFocus) { +// int focusY = topPadding - buttonPadding; +// int focusHeight = Allocation.Height - topPadding - bottomPadding + buttonPadding * 2; +// +// Gtk.Style.PaintFocus (Style, GdkWindow, State, Allocation, this, "label", focusRect.X, focusY, focusRect.Width, focusHeight); +// } +// } +// return true; +// } void DrawPathSeparator (Cairo.Context ctx, double x, double y, double size) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWidget.cs index 12caa853ff7..54d2e19a9cc 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWidget.cs @@ -55,15 +55,15 @@ public PopoverWidget () Add (alignment); disableSizeCheck = false; - - SizeRequested += (object o, SizeRequestedArgs args) => { - if (this.AnimationIsRunning("Resize") && !disableSizeCheck) { - Gtk.Requisition result = new Gtk.Requisition (); - result.Width = Math.Max (args.Requisition.Width, Math.Max (Allocation.Width, targetSize.Width)); - result.Height = Math.Max (args.Requisition.Height, Math.Max (Allocation.Height, targetSize.Height)); - args.Requisition = result; - } - }; + +// SizeRequested += (object o, SizeRequestedArgs args) => { +// if (this.AnimationIsRunning("Resize") && !disableSizeCheck) { +// Gtk.Requisition result = new Gtk.Requisition (); +// result.Width = Math.Max (args.Requisition.Width, Math.Max (Allocation.Width, targetSize.Width)); +// result.Height = Math.Max (args.Requisition.Height, Math.Max (Allocation.Height, targetSize.Height)); +// args.Requisition = result; +// } +// }; UpdatePadding (); } @@ -118,7 +118,8 @@ public void AnimatedResize () disableSizeCheck = true; Gtk.Requisition sizeReq = Gtk.Requisition.Zero; // use OnSizeRequested instead of SizeRequest to bypass internal GTK caching - OnSizeRequested (ref sizeReq); + OnGetPreferredWidth (out sizeReq.Width, out sizeReq.Width); + OnGetPreferredHeight (out sizeReq.Height, out sizeReq.Height); disableSizeCheck = false; Gdk.Size size = new Gdk.Size (sizeReq.Width, sizeReq.Height); @@ -150,7 +151,8 @@ void MaybeReanimate () { disableSizeCheck = true; Gtk.Requisition sizeReq = Gtk.Requisition.Zero; - OnSizeRequested (ref sizeReq); + OnGetPreferredHeight (out sizeReq.Height, out sizeReq.Height); + OnGetPreferredWidth (out sizeReq.Width, out sizeReq.Width); disableSizeCheck = false; if (sizeReq.Width == paintSize.Width && sizeReq.Height == paintSize.Height) @@ -159,34 +161,34 @@ void MaybeReanimate () AnimatedResize (); //Desired size changed mid animation } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - if ((position & PopupPosition.Top) != 0 || (position & PopupPosition.Bottom) != 0) - theme.ArrowOffset = Allocation.Width / 2; - else - theme.ArrowOffset = Allocation.Height / 2; - - using (var context = Gdk.CairoHelper.Create (evnt.Window)) { - context.Save (); - Theme.SetBorderPath (context, BorderAllocation, position); - context.Clip (); - OnDrawContent (evnt, context); // Draw content first so we can easily clip it - context.Restore (); - - - // protect against overriden methods which leave in a bad state - context.Save (); - if (Theme.DrawPager) { - Theme.RenderPager (context, - PangoContext, - BorderAllocation); - } - - Theme.RenderShadow (context, BorderAllocation, position); - context.Restore (); - } - return base.OnExposeEvent (evnt); - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// if ((position & PopupPosition.Top) != 0 || (position & PopupPosition.Bottom) != 0) +// theme.ArrowOffset = Allocation.Width / 2; +// else +// theme.ArrowOffset = Allocation.Height / 2; +// +// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { +// context.Save (); +// Theme.SetBorderPath (context, BorderAllocation, position); +// context.Clip (); +// OnDrawContent (evnt, context); // Draw content first so we can easily clip it +// context.Restore (); +// +// +// // protect against overriden methods which leave in a bad state +// context.Save (); +// if (Theme.DrawPager) { +// Theme.RenderPager (context, +// PangoContext, +// BorderAllocation); +// } +// +// Theme.RenderShadow (context, BorderAllocation, position); +// context.Restore (); +// } +// return base.OnExposeEvent (evnt); +// } protected virtual void OnDrawContent (Gdk.EventExpose evnt, Cairo.Context context) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindow.cs index d2ad2099d53..0d30608ff00 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindow.cs @@ -71,14 +71,14 @@ public PopoverWindow (Gtk.WindowType type) : base(type) disableSizeCheck = false; - SizeRequested += (object o, SizeRequestedArgs args) => { - if (this.AnimationIsRunning("Resize") && !disableSizeCheck) { - Gtk.Requisition result = new Gtk.Requisition (); - result.Width = Math.Max (args.Requisition.Width, Math.Max (Allocation.Width, targetSize.Width)); - result.Height = Math.Max (args.Requisition.Height, Math.Max (Allocation.Height, targetSize.Height)); - args.Requisition = result; - } - }; +// SizeRequested += (object o, SizeRequestedArgs args) => { +// if (this.AnimationIsRunning("Resize") && !disableSizeCheck) { +// Gtk.Requisition result = new Gtk.Requisition (); +// result.Width = Math.Max (args.Requisition.Width, Math.Max (Allocation.Width, targetSize.Width)); +// result.Height = Math.Max (args.Requisition.Height, Math.Max (Allocation.Height, targetSize.Height)); +// args.Requisition = result; +// } +// }; UpdatePadding (); } @@ -209,21 +209,22 @@ Gdk.Rectangle GetUsableMonitorGeometry (Gdk.Rectangle caret) return Gdk.Rectangle.Zero; } - + void IAnimatable.BatchBegin () { } void IAnimatable.BatchCommit () { QueueDraw (); } public void AnimatedResize () - { - if (!GtkUtil.ScreenSupportsARGB ()) { - QueueResize(); - return; + { + if (!GtkUtil.ScreenSupportsARGB ()) { + QueueResize(); + return; } disableSizeCheck = true; Gtk.Requisition sizeReq = Gtk.Requisition.Zero; // use OnSizeRequested instead of SizeRequest to bypass internal GTK caching - OnSizeRequested (ref sizeReq); + OnGetPreferredWidth (out sizeReq.Width, out sizeReq.Width); + OnGetPreferredHeight (out sizeReq.Height, out sizeReq.Height); disableSizeCheck = false; Gdk.Size size = new Gdk.Size (sizeReq.Width, sizeReq.Height); @@ -255,7 +256,7 @@ void MaybeReanimate () { disableSizeCheck = true; Gtk.Requisition sizeReq = Gtk.Requisition.Zero; - OnSizeRequested (ref sizeReq); +// OnSizeRequested (ref sizeReq); disableSizeCheck = false; if (sizeReq.Width == paintSize.Width && sizeReq.Height == paintSize.Height) @@ -416,11 +417,11 @@ public bool ShowWindowShadow { void CheckScreenColormap () { SupportsAlpha = Screen.IsComposited; - if (SupportsAlpha) { - Colormap = Screen.RgbaColormap; - } else { - Colormap = Screen.RgbColormap; - } +// if (SupportsAlpha) { +// Colormap = Screen.RgbaColormap; +// } else { +// Colormap = Screen.RgbColormap; +// } } protected override void OnScreenChanged (Gdk.Screen previous_screen) @@ -429,48 +430,48 @@ protected override void OnScreenChanged (Gdk.Screen previous_screen) CheckScreenColormap (); } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - bool retVal; - bool changed; - using (var context = Gdk.CairoHelper.Create (evnt.Window)) { - context.Save (); - if (SupportsAlpha) { - context.Operator = Cairo.Operator.Source; - context.SetSourceRGBA (1, 1, 1, 0); - } else { - context.Operator = Cairo.Operator.Over; - context.SetSourceRGB (1, 1, 1); - } - context.Paint (); - context.Restore (); - - OnDrawContent (evnt, context); // Draw content first so we can easily clip it - retVal = base.OnExposeEvent (evnt); - - changed = Theme.SetBorderPath (context, BorderAllocation, position); - context.Operator = Cairo.Operator.DestIn; - context.SetSourceRGBA (1, 1, 1, 1); - context.Fill (); - context.Operator = Cairo.Operator.Over; - - // protect against overriden methods which leave in a bad state - context.Save (); - if (Theme.DrawPager) { - Theme.RenderPager (context, - PangoContext, - BorderAllocation); - } - - Theme.RenderShadow (context, BorderAllocation, position); - context.Restore (); - } - - if (changed) - GtkWorkarounds.UpdateNativeShadow (this); - - return retVal; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// bool retVal; +// bool changed; +// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { +// context.Save (); +// if (SupportsAlpha) { +// context.Operator = Cairo.Operator.Source; +// context.SetSourceRGBA (1, 1, 1, 0); +// } else { +// context.Operator = Cairo.Operator.Over; +// context.SetSourceRGB (1, 1, 1); +// } +// context.Paint (); +// context.Restore (); +// +// OnDrawContent (evnt, context); // Draw content first so we can easily clip it +// retVal = base.OnExposeEvent (evnt); +// +// changed = Theme.SetBorderPath (context, BorderAllocation, position); +// context.Operator = Cairo.Operator.DestIn; +// context.SetSourceRGBA (1, 1, 1, 1); +// context.Fill (); +// context.Operator = Cairo.Operator.Over; +// +// // protect against overriden methods which leave in a bad state +// context.Save (); +// if (Theme.DrawPager) { +// Theme.RenderPager (context, +// PangoContext, +// BorderAllocation); +// } +// +// Theme.RenderShadow (context, BorderAllocation, position); +// context.Restore (); +// } +// +// if (changed) +// GtkWorkarounds.UpdateNativeShadow (this); +// +// return retVal; +// } protected virtual void OnDrawContent (Gdk.EventExpose evnt, Cairo.Context context) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs index 43b4cb2286f..bc19581b0b9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs @@ -56,7 +56,7 @@ protected RoundedFrame (IntPtr ptr) : base(ptr) public RoundedFrame () { this.Events = Gdk.EventMask.AllEventsMask; - this.WidgetFlags |= WidgetFlags.NoWindow; + this.HasWindow = true; DoubleBuffered = true; AppPaintable = false; } @@ -100,21 +100,34 @@ protected override void OnRealized () theme = MonoDevelop.Components.Theming.ThemeEngine.CreateTheme (this); } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { + natural_height = 0; if (child != null && child.Visible) { // Add the child's width/height Requisition child_requisition = child.SizeRequest (); - requisition.Width = Math.Max (0, child_requisition.Width); - requisition.Height = child_requisition.Height; + min_height = child_requisition.Height; } else { - requisition.Width = 0; - requisition.Height = 0; + min_height = 0; } // Add the frame border - requisition.Width += ((int)BorderWidth + frame_width) * 2; - requisition.Height += ((int)BorderWidth + frame_width) * 2; + min_height += ((int)BorderWidth + frame_width) * 2; + } + + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) + { + natural_width = 0; + if (child != null && child.Visible) { + // Add the child's width/height + Requisition child_requisition = child.SizeRequest (); + min_width = Math.Max (0, child_requisition.Width); + } else { + min_width = 0; + } + + // Add the frame border + min_width += ((int)BorderWidth + frame_width) * 2; } protected override void OnSizeAllocated (Gdk.Rectangle allocation) @@ -134,26 +147,26 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) child.SizeAllocate (child_allocation); } - protected override void OnSetScrollAdjustments (Adjustment hadj, Adjustment vadj) - { - // This is to satisfy the gtk_widget_set_scroll_adjustments - // inside of GtkScrolledWindow so it doesn't complain about - // its child not being scrollable. - } - - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - if (!IsDrawable) { - return false; - } - - using (Context cr = Gdk.CairoHelper.Create (evnt.Window)) { - DrawFrame (cr, evnt.Area); - if (child != null) - PropagateExpose (child, evnt); - return false; - } - } +// protected override void OnSetScrollAdjustments (Adjustment hadj, Adjustment vadj) +// { +// // This is to satisfy the gtk_widget_set_scroll_adjustments +// // inside of GtkScrolledWindow so it doesn't complain about +// // its child not being scrollable. +// } + +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// if (!IsDrawable) { +// return false; +// } +// +// using (Context cr = Gdk.CairoHelper.Create (evnt.Window)) { +// DrawFrame (cr, evnt.Area); +// if (child != null) +// PropagateExpose (child, evnt); +// return false; +// } +// } private void DrawFrame (Cairo.Context cr, Gdk.Rectangle clip) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs index e0803887c02..a4b108b93c5 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs @@ -207,13 +207,13 @@ private void BuildWidget () ShowHideButtons (); } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { if (HeightRequest != -1 && box.HeightRequest != HeightRequest) box.HeightRequest = HeightRequest; if (box.HeightRequest != -1 && HeightRequest == -1) box.HeightRequest = -1; - base.OnSizeRequested (ref requisition); + base.OnGetPreferredHeight (out min_height, out natural_height); } Gtk.EventBox statusLabelEventBox; @@ -430,50 +430,50 @@ protected override bool OnKeyPressEvent (Gdk.EventKey evnt) return base.OnKeyPressEvent (evnt); } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - var alloc = new Gdk.Rectangle (alignment.Allocation.X, box.Allocation.Y, alignment.Allocation.Width, box.Allocation.Height); - - if (hasFrame && (!roundedShape || (roundedShape && !customRoundedShapeDrawing))) { - if (Platform.IsLinux) - Style.PaintFlatBox (Style, GdkWindow, entry.State, ShadowType.None, - evnt.Area, this, "entry_bg", alloc.X + 2, alloc.Y + 2, alloc.Width - 4, alloc.Height - 4); - Style.PaintShadow (entry.Style, GdkWindow, entry.State, entry.ShadowType, - evnt.Area, entry, "entry", alloc.X, alloc.Y, alloc.Width, alloc.Height); +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// var alloc = new Gdk.Rectangle (alignment.Allocation.X, box.Allocation.Y, alignment.Allocation.Width, box.Allocation.Height); +// +// if (hasFrame && (!roundedShape || (roundedShape && !customRoundedShapeDrawing))) { +// if (Platform.IsLinux) +// Style.PaintFlatBox (Style, GdkWindow, entry.State, ShadowType.None, +// evnt.Area, this, "entry_bg", alloc.X + 2, alloc.Y + 2, alloc.Width - 4, alloc.Height - 4); +// Style.PaintShadow (entry.Style, GdkWindow, entry.State, entry.ShadowType, +// evnt.Area, entry, "entry", alloc.X, alloc.Y, alloc.Width, alloc.Height); /* using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { ctx.LineWidth = 1; ctx.Rectangle (alloc.X + 0.5, alloc.Y + 0.5, alloc.Width - 1, alloc.Height - 1); ctx.Color = new Cairo.Color (1,0,0); ctx.Stroke (); }*/ - } - else if (!roundedShape) { - using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { - CairoExtensions.RoundedRectangle (ctx, alloc.X + 0.5, alloc.Y + 0.5, alloc.Width - 1, alloc.Height - 1, 4); - ctx.SetSourceColor (entry.Style.Base (Gtk.StateType.Normal).ToCairoColor ()); - ctx.Fill (); - } - } - else { - using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { - RoundBorder (ctx, alloc.X + 0.5, alloc.Y + 0.5, alloc.Width - 1, alloc.Height - 1); - ctx.SetSourceColor (entry.Style.Base (Gtk.StateType.Normal).ToCairoColor ()); - ctx.Fill (); - } - } - - PropagateExpose (Child, evnt); - - if (hasFrame && roundedShape && customRoundedShapeDrawing) { - using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { - RoundBorder (ctx, alloc.X + 0.5, alloc.Y + 0.5, alloc.Width - 1, alloc.Height - 1); - ctx.SetSourceColor (Styles.WidgetBorderColor.ToCairoColor ()); - ctx.LineWidth = 1; - ctx.Stroke (); - } - } - return true; - } +// } +// else if (!roundedShape) { +// using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { +// CairoExtensions.RoundedRectangle (ctx, alloc.X + 0.5, alloc.Y + 0.5, alloc.Width - 1, alloc.Height - 1, 4); +// ctx.SetSourceColor (entry.Style.Base (Gtk.StateType.Normal).ToCairoColor ()); +// ctx.Fill (); +// } +// } +// else { +// using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { +// RoundBorder (ctx, alloc.X + 0.5, alloc.Y + 0.5, alloc.Width - 1, alloc.Height - 1); +// ctx.SetSourceColor (entry.Style.Base (Gtk.StateType.Normal).ToCairoColor ()); +// ctx.Fill (); +// } +// } +// +// PropagateExpose (Child, evnt); +// +// if (hasFrame && roundedShape && customRoundedShapeDrawing) { +// using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { +// RoundBorder (ctx, alloc.X + 0.5, alloc.Y + 0.5, alloc.Width - 1, alloc.Height - 1); +// ctx.SetSourceColor (Styles.WidgetBorderColor.ToCairoColor ()); +// ctx.LineWidth = 1; +// ctx.Stroke (); +// } +// } +// return true; +// } static void RoundBorder (Cairo.Context ctx, double x, double y, double w, double h) { @@ -687,7 +687,7 @@ private class FramelessEntry : Entry { private SearchEntry parent; private Pango.Layout layout; - private Gdk.GC text_gc; +// private Gdk.GC text_gc; public FramelessEntry (SearchEntry parent) : base() { @@ -708,8 +708,8 @@ private void OnParentStyleSet (object o, EventArgs args) private void RefreshGC () { - text_gc?.Dispose (); - text_gc = null; +// text_gc?.Dispose (); +// text_gc = null; } protected override void OnDestroyed () @@ -751,47 +751,47 @@ public static Gdk.Color ColorBlend (Gdk.Color a, Gdk.Color b) double blB = mB * blendRatio; Gdk.Color color = new Gdk.Color ((byte)blR, (byte)blG, (byte)blB); - Gdk.Colormap.System.AllocColor (ref color, true, true); +// Gdk.Colormap.System.AllocColor (ref color, true, true); return color; } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - // The Entry's GdkWindow is the top level window onto which - // the frame is drawn; the actual text entry is drawn into a - // separate window, so we can ensure that for themes that don't - // respect HasFrame, we never ever allow the base frame drawing - // to happen - if (evnt.Window == GdkWindow) { - return true; - } - - bool ret = base.OnExposeEvent (evnt); - - if (text_gc == null) { - text_gc = new Gdk.GC (evnt.Window); - text_gc.Copy (Style.TextGC (StateType.Normal)); - Gdk.Color color_a = parent.Style.Base (StateType.Normal); - Gdk.Color color_b = parent.Style.Text (StateType.Normal); - text_gc.RgbFgColor = ColorBlend (color_a, color_b); - } - - if (Text.Length > 0 || HasFocus || parent.EmptyMessage == null) { - return ret; - } - - if (layout == null) { - layout = new Pango.Layout (PangoContext); - layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11); - } - - int width, height; - layout.SetMarkup (parent.EmptyMessage); - layout.GetPixelSize (out width, out height); - evnt.Window.DrawLayout (text_gc, 2, (SizeRequest ().Height - height) / 2, layout); - - return ret; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// // The Entry's GdkWindow is the top level window onto which +// // the frame is drawn; the actual text entry is drawn into a +// // separate window, so we can ensure that for themes that don't +// // respect HasFrame, we never ever allow the base frame drawing +// // to happen +// if (evnt.Window == GdkWindow) { +// return true; +// } +// +// bool ret = base.OnExposeEvent (evnt); +// +// if (text_gc == null) { +// text_gc = new Gdk.GC (evnt.Window); +// text_gc.Copy (Style.TextGC (StateType.Normal)); +// Gdk.Color color_a = parent.Style.Base (StateType.Normal); +// Gdk.Color color_b = parent.Style.Text (StateType.Normal); +// text_gc.RgbFgColor = ColorBlend (color_a, color_b); +// } +// +// if (Text.Length > 0 || HasFocus || parent.EmptyMessage == null) { +// return ret; +// } +// +// if (layout == null) { +// layout = new Pango.Layout (PangoContext); +// layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11); +// } +// +// int width, height; +// layout.SetMarkup (parent.EmptyMessage); +// layout.GetPixelSize (out width, out height); +// evnt.Window.DrawLayout (text_gc, 2, (SizeRequest ().Height - height) / 2, layout); +// +// return ret; +// } } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs index a923811a16f..1a0ddacae32 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs @@ -91,8 +91,8 @@ void OnActiveSectionChanged () public SectionList () { GtkWorkarounds.FixContainerLeak (this); - - this.WidgetFlags |= WidgetFlags.NoWindow; + + this.HasWindow = false; WidthRequest = 100; EnsureLayout (); } @@ -106,7 +106,7 @@ protected override void OnRealized () var attributes = new Gdk.WindowAttr () { WindowType = Gdk.WindowType.Child, - Wclass = Gdk.WindowClass.InputOnly, +// Wclass = Gdk.WindowClass.InputOnly, EventMask = (int) ( EventMask.EnterNotifyMask | EventMask.LeaveNotifyMask | @@ -183,10 +183,10 @@ void KillLayout () layout = null; } - protected override void OnDestroyed () + protected override void OnDestroyed () { - KillLayout (); - base.OnDestroyed (); + KillLayout (); + base.OnDestroyed (); } protected override void OnAdded (Widget widget) @@ -214,12 +214,12 @@ protected override void OnShown () base.OnShown (); } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - int wr = 0, hr = 0; + int hr = 0; + natural_height = 0; foreach (var section in sections) { var req = section.Child.SizeRequest (); - wr = Math.Max (wr, req.Width); hr = Math.Max (hr, req.Height); } @@ -228,13 +228,29 @@ protected override void OnSizeRequested (ref Requisition requisition) int bw2 = ((int)BorderWidth + borderLineWidth) * 2; hr += bw2; - wr += bw2; hr = Math.Max (hr, HeightRequest); + + min_height = hr; + } + + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) + { + int wr = 0; + natural_width = 0; + foreach (var section in sections) { + var req = section.Child.SizeRequest (); + wr = Math.Max (wr, req.Width); + } + + + int bw2 = ((int)BorderWidth + borderLineWidth) * 2; + + wr += bw2; + wr = Math.Max (wr, WidthRequest); - requisition.Height = hr; - requisition.Width = wr; + min_width = wr; } protected override void OnSizeAllocated (Gdk.Rectangle allocation) @@ -281,91 +297,91 @@ static Cairo.Color Convert (Gdk.Color color) } //FIXME: respect damage regions not just the whole areas, and skip more work when possible - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - if (sections.Count == 0) - return false; - - var alloc = Allocation; - - int bw = (int) BorderWidth; - double halfLineWidth = borderLineWidth / 2.0; - int bw2 = bw * 2; - int w = alloc.Width - bw2; - int h = alloc.Height - bw2; - - using (var cr = CairoHelper.Create (evnt.Window)) { - CairoHelper.Region (cr, evnt.Region); - cr.Clip (); - - cr.Translate (alloc.X + bw, alloc.Y + bw); - - var borderCol = Convert (Style.Dark (StateType.Normal)); - cr.SetSourceColor (borderCol); - cr.Rectangle (halfLineWidth, halfLineWidth, w - borderLineWidth, h - borderLineWidth); - cr.LineWidth = borderLineWidth; - cr.Stroke (); - - cr.Translate (borderLineWidth, borderLineWidth); - w = w - (2 * borderLineWidth); - - using (LinearGradient unselectedGrad = new LinearGradient (0, 0, 0, headerHeight), - hoverGrad = new LinearGradient (0, 0, 0, headerHeight), - selectedGrad = new LinearGradient (0, 0, 0, headerHeight) - ) - { - var unselectedCol = Convert (Style.Mid (StateType.Normal)); - var unselectedTextCol = Convert (Style.Text (StateType.Normal)); - unselectedCol.A = 0.6; - unselectedGrad.AddColorStop (0, unselectedCol); - unselectedCol.A = 1; - unselectedGrad.AddColorStop (1, unselectedCol); - - var hoverCol = Convert (Style.Mid (StateType.Prelight)); - var hoverTextCol = Convert (Style.Text (StateType.Prelight)); - hoverCol.A = 0.6; - hoverGrad.AddColorStop (0, unselectedCol); - hoverCol.A = 1; - hoverGrad.AddColorStop (1, unselectedCol); - - var selectedCol = Convert (Style.Mid (StateType.Normal)); - var selectedTextCol = Convert (Style.Text (StateType.Normal)); - selectedCol.A = 0.6; - selectedGrad.AddColorStop (0, selectedCol); - selectedCol.A = 1; - selectedGrad.AddColorStop (1, selectedCol); - - for (int i = 0; i < sections.Count; i++) { - var section = sections[i]; - bool isActive = activeIndex == i; - bool isHover = hoverIndex == i; - - cr.Rectangle (0, 0, w, headerHeight); - cr.SetSource (isActive? selectedGrad : (isHover? hoverGrad : unselectedGrad)); - cr.Fill (); - - cr.SetSourceColor (isActive? selectedTextCol : (isHover? hoverTextCol : unselectedTextCol)); - layout.SetText (section.Title); - layout.Ellipsize = Pango.EllipsizeMode.End; - layout.Width = (int) ((w - headerPadding - headerPadding) * Pango.Scale.PangoScale); - cr.MoveTo (headerPadding, headerPadding); - Pango.CairoHelper.ShowLayout (cr, layout); - - cr.MoveTo (-halfLineWidth, i > activeIndex? -halfLineWidth : headerHeight + halfLineWidth); - cr.RelLineTo (w + borderLineWidth, 0.0); - cr.SetSourceColor (borderCol); - cr.Stroke (); - - cr.Translate (0, headerHeight + borderLineWidth); - if (isActive) - cr.Translate (0, section.Child.Allocation.Height + borderLineWidth); - } - } - } - - PropagateExpose (sections[activeIndex].Child, evnt); - return true;// base.OnExposeEvent (evnt); - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// if (sections.Count == 0) +// return false; +// +// var alloc = Allocation; +// +// int bw = (int) BorderWidth; +// double halfLineWidth = borderLineWidth / 2.0; +// int bw2 = bw * 2; +// int w = alloc.Width - bw2; +// int h = alloc.Height - bw2; +// +// using (var cr = CairoHelper.Create (evnt.Window)) { +// CairoHelper.Region (cr, evnt.Region); +// cr.Clip (); +// +// cr.Translate (alloc.X + bw, alloc.Y + bw); +// +// var borderCol = Convert (Style.Dark (StateType.Normal)); +// cr.SetSourceColor (borderCol); +// cr.Rectangle (halfLineWidth, halfLineWidth, w - borderLineWidth, h - borderLineWidth); +// cr.LineWidth = borderLineWidth; +// cr.Stroke (); +// +// cr.Translate (borderLineWidth, borderLineWidth); +// w = w - (2 * borderLineWidth); +// +// using (LinearGradient unselectedGrad = new LinearGradient (0, 0, 0, headerHeight), +// hoverGrad = new LinearGradient (0, 0, 0, headerHeight), +// selectedGrad = new LinearGradient (0, 0, 0, headerHeight) +// ) +// { +// var unselectedCol = Convert (Style.Mid (StateType.Normal)); +// var unselectedTextCol = Convert (Style.Text (StateType.Normal)); +// unselectedCol.A = 0.6; +// unselectedGrad.AddColorStop (0, unselectedCol); +// unselectedCol.A = 1; +// unselectedGrad.AddColorStop (1, unselectedCol); +// +// var hoverCol = Convert (Style.Mid (StateType.Prelight)); +// var hoverTextCol = Convert (Style.Text (StateType.Prelight)); +// hoverCol.A = 0.6; +// hoverGrad.AddColorStop (0, unselectedCol); +// hoverCol.A = 1; +// hoverGrad.AddColorStop (1, unselectedCol); +// +// var selectedCol = Convert (Style.Mid (StateType.Normal)); +// var selectedTextCol = Convert (Style.Text (StateType.Normal)); +// selectedCol.A = 0.6; +// selectedGrad.AddColorStop (0, selectedCol); +// selectedCol.A = 1; +// selectedGrad.AddColorStop (1, selectedCol); +// +// for (int i = 0; i < sections.Count; i++) { +// var section = sections[i]; +// bool isActive = activeIndex == i; +// bool isHover = hoverIndex == i; +// +// cr.Rectangle (0, 0, w, headerHeight); +// cr.SetSource (isActive? selectedGrad : (isHover? hoverGrad : unselectedGrad)); +// cr.Fill (); +// +// cr.SetSourceColor (isActive? selectedTextCol : (isHover? hoverTextCol : unselectedTextCol)); +// layout.SetText (section.Title); +// layout.Ellipsize = Pango.EllipsizeMode.End; +// layout.Width = (int) ((w - headerPadding - headerPadding) * Pango.Scale.PangoScale); +// cr.MoveTo (headerPadding, headerPadding); +// Pango.CairoHelper.ShowLayout (cr, layout); +// +// cr.MoveTo (-halfLineWidth, i > activeIndex? -halfLineWidth : headerHeight + halfLineWidth); +// cr.RelLineTo (w + borderLineWidth, 0.0); +// cr.SetSourceColor (borderCol); +// cr.Stroke (); +// +// cr.Translate (0, headerHeight + borderLineWidth); +// if (isActive) +// cr.Translate (0, section.Child.Allocation.Height + borderLineWidth); +// } +// } +// } +// +// PropagateExpose (sections[activeIndex].Child, evnt); +// return true;// base.OnExposeEvent (evnt); +// } protected override void ForAll (bool include_internals, Callback callback) { @@ -507,4 +523,4 @@ internal void OnActivated () public event EventHandler Activated; } } -} \ No newline at end of file +} diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TabLabel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TabLabel.cs index 8e6aeee4e63..e84c83ef23b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TabLabel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TabLabel.cs @@ -59,7 +59,7 @@ public TabLabel (Label label, ImageView icon) : base (false, 0) button.Clicked += new EventHandler(ButtonClicked); button.Name = "MonoDevelop.TabLabel.CloseButton"; this.PackStart (button, false, true, 0); - this.ClearFlag (WidgetFlags.CanFocus); + this.CanFocus = false; this.BorderWidth = 0; this.ShowAll (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs index a8c9cd2c290..3265a7ee78d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs @@ -207,37 +207,38 @@ protected override bool OnLeaveNotifyEvent (Gdk.EventCrossing evnt) return base.OnLeaveNotifyEvent (evnt); } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - requisition.Height = (int)Math.Ceiling (tabSizes.Max (p => p.Y)); - } - - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - using (var cr = Gdk.CairoHelper.Create (evnt.Window)) { - cr.Rectangle (0, 0, Allocation.Width, Allocation.Height); - cr.SetSourceColor (Styles.SubTabBarBackgroundColor.ToCairoColor ()); - cr.Fill (); - - Tab active = null; - for (int i = tabs.Count; i --> 0;) { - if (i == ActiveTab) { - active = tabs [i]; - continue; - } - var tab = tabs[i]; - var bounds = GetBounds (tab); - tab.HoverPosition = tab == hoverTab ? new Cairo.PointD (mx - bounds.X, my) : new Cairo.PointD (-1, -1); - tab.Draw (cr, bounds); - } - - if (active != null) { - active.Draw (cr, GetBounds (active)); - } - } - - return base.OnExposeEvent (evnt); - } + natural_height = 0; + min_height = (int)Math.Ceiling (tabSizes.Max (p => p.Y)); + } + +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// using (var cr = Gdk.CairoHelper.Create (evnt.Window)) { +// cr.Rectangle (0, 0, Allocation.Width, Allocation.Height); +// cr.SetSourceColor (Styles.SubTabBarBackgroundColor.ToCairoColor ()); +// cr.Fill (); +// +// Tab active = null; +// for (int i = tabs.Count; i --> 0;) { +// if (i == ActiveTab) { +// active = tabs [i]; +// continue; +// } +// var tab = tabs[i]; +// var bounds = GetBounds (tab); +// tab.HoverPosition = tab == hoverTab ? new Cairo.PointD (mx - bounds.X, my) : new Cairo.PointD (-1, -1); +// tab.Draw (cr, bounds); +// } +// +// if (active != null) { +// active.Draw (cr, GetBounds (active)); +// } +// } +// +// return base.OnExposeEvent (evnt); +// } int focusedTab = -1; protected override bool OnFocused (DirectionType direction) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs index f2cfc14f3a5..b54533d48b6 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs @@ -51,8 +51,7 @@ protected TooltipWindow () : base (Gtk.WindowType.Popup) this.Decorated = false; this.BorderWidth = 2; this.TypeHint = WindowTypeHint.Tooltip; - this.AllowShrink = false; - this.AllowGrow = false; + this.Resizable = true; this.Title = "tooltip"; // fixes the annoying '** Message: ATK_ROLE_TOOLTIP object found, but doesn't look like a tooltip.** Message: ATK_ROLE_TOOLTIP object found, but doesn't look like a tooltip.' //fake widget name for stupid theme engines @@ -77,15 +76,15 @@ public bool EnableTransparencyControl { } } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - int winWidth, winHeight; - this.GetSize (out winWidth, out winHeight); - Gtk.Style.PaintFlatBox (Style, this.GdkWindow, StateType.Normal, ShadowType.Out, evnt.Area, this, "tooltip", 0, 0, winWidth, winHeight); - foreach (var child in this.Children) - this.PropagateExpose (child, evnt); - return false; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// int winWidth, winHeight; +// this.GetSize (out winWidth, out winHeight); +// Gtk.Style.PaintFlatBox (Style, this.GdkWindow, StateType.Normal, ShadowType.Out, evnt.Area, this, "tooltip", 0, 0, winWidth, winHeight); +// foreach (var child in this.Children) +// this.PropagateExpose (child, evnt); +// return false; +// } protected override void OnDestroyed () { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TreeViewCellContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TreeViewCellContainer.cs index 61b4939117e..92e81cf7f60 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TreeViewCellContainer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TreeViewCellContainer.cs @@ -76,22 +76,23 @@ protected override void OnShown () // Do nothing. } - protected override void OnSizeRequested (ref Requisition requisition) - { - base.OnSizeRequested (ref requisition); - if (box.Child != null) { - requisition = box.Child.SizeRequest (); - requisition.Height += 2 * box.Child.Style?.YThickness ?? 0; - } - else - requisition = box.SizeRequest (); - } +// protected override void OnSizeRequested (ref Requisition requisition) +// { +// base.OnSizeRequested (ref requisition); +// if (box.Child != null) { +// requisition = box.Child.SizeRequest (); +// requisition.Height += 2 * box.Child.Style?.YThickness ?? 0; +// } +// else +// requisition = box.SizeRequest (); +// } protected override void OnSizeAllocated (Gdk.Rectangle allocation) { base.OnSizeAllocated (allocation); box.SizeRequest (); - box.Allocation = allocation; + box.WidthRequest = allocation.Width; + box.HeightRequest = allocation.Height; } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/VPanedThin.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/VPanedThin.cs index b2d116950b3..9babf5d8f3d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/VPanedThin.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/VPanedThin.cs @@ -59,20 +59,20 @@ protected override void ForAll (bool include_internals, Gtk.Callback callback) callback (handle); } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - base.OnExposeEvent (evnt); - - if (Child1 != null && Child1.Visible && Child2 != null && Child2.Visible) { - var gc = new Gdk.GC (evnt.Window); - gc.RgbFgColor = Styles.ThinSplitterColor.ToGdkColor (); - var y = Child1.Allocation.Y + Child1.Allocation.Height; - evnt.Window.DrawLine (gc, Allocation.X, y, Allocation.X + Allocation.Width, y); - gc.Dispose (); - } - - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// base.OnExposeEvent (evnt); +// +// if (Child1 != null && Child1.Visible && Child2 != null && Child2.Visible) { +// var gc = new Gdk.GC (evnt.Window); +// gc.RgbFgColor = Styles.ThinSplitterColor.ToGdkColor (); +// var y = Child1.Allocation.Y + Child1.Allocation.Height; +// evnt.Window.DrawLine (gc, Allocation.X, y, Allocation.X + Allocation.Width, y); +// gc.Dispose (); +// } +// +// return true; +// } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs index 25c9b6aac25..3826969cd4a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs @@ -207,17 +207,17 @@ protected override void OnDestroyed () } } - protected override void OnSetScrollAdjustments (Adjustment hadj, Adjustment vadj) - { - if (this.vadj != null) - this.vadj.ValueChanged -= HandleValueChanged; - this.vadj = vadj; - base.OnSetScrollAdjustments (hadj, vadj); - if (this.vadj != null) { - this.vadj.ValueChanged += HandleValueChanged; - SetAdjustments (); - } - } +// protected override void OnSetScrollAdjustments (Adjustment hadj, Adjustment vadj) +// { +// if (this.vadj != null) +// this.vadj.ValueChanged -= HandleValueChanged; +// this.vadj = vadj; +// base.OnSetScrollAdjustments (hadj, vadj); +// if (this.vadj != null) { +// this.vadj.ValueChanged += HandleValueChanged; +// SetAdjustments (); +// } +// } void HandleValueChanged (object sender, EventArgs e) { @@ -376,7 +376,7 @@ protected override bool OnMotionNotifyEvent (EventMotion e) if (!buttonPressed) return base.OnMotionNotifyEvent (e); int winWidth, winHeight; - this.GdkWindow.GetSize (out winWidth, out winHeight); +// this.GdkWindow.GetSize (out winWidth, out winHeight); SelectedItemIndex = GetRowByPosition ((int)e.Y); return true; } @@ -389,208 +389,208 @@ string NoSuggestionsMsg { get { return MonoDevelop.Core.GettextCatalog.GetString ("No suggestions"); } } - protected override bool OnExposeEvent (Gdk.EventExpose args) - { - using (var context = Gdk.CairoHelper.Create (args.Window)) { - var scalef = GtkWorkarounds.GetScaleFactor (this); - context.LineWidth = 1; - var alloc = Allocation; - int width = alloc.Width; - int height = alloc.Height; - context.Rectangle (args.Area.X, args.Area.Y, args.Area.Width, args.Area.Height); - var backgroundColor = Styles.CodeCompletion.BackgroundColor.ToCairoColor (); - var textColor = Styles.CodeCompletion.TextColor.ToCairoColor (); - var categoryColor = Styles.CodeCompletion.CategoryColor.ToCairoColor (); - context.SetSourceColor (backgroundColor); - context.Fill (); - int xpos = iconTextSpacing; - int yPos = (int)-vadj.Value; - //when there are no matches, display a message to indicate that the completion list is still handling input - if (filteredItems.Count == 0) { - context.Rectangle (0, yPos, width, height - yPos); - context.SetSourceColor (backgroundColor); - context.Stroke (); - noMatchLayout.SetText (DataProvider.ItemCount == 0 ? NoSuggestionsMsg : NoMatchesMsg); - int lWidth, lHeight; - noMatchLayout.GetPixelSize (out lWidth, out lHeight); - context.SetSourceColor (textColor); - context.MoveTo ((width - lWidth) / 2, yPos + (height - lHeight - yPos) / 2 - lHeight / 2); - Pango.CairoHelper.ShowLayout (context, noMatchLayout); - return false; - } - - Iterate (true, ref yPos, delegate (CategorizedCompletionItems category, int ypos) { - if (ypos >= height) - return; - if (ypos < -rowHeight) - return; - - // window.DrawRectangle (this.Style.BackgroundGC (StateType.Insensitive), true, 0, yPos, width, rowHeight); - int x = 2; - if (category.CompletionCategory != null && !string.IsNullOrEmpty (category.CompletionCategory.Icon)) { - var icon = ImageService.GetIcon (category.CompletionCategory.Icon, IconSize.Menu); - context.DrawImage (this, icon, 0, ypos); - x = (int)icon.Width + 4; - } - context.Rectangle (0, ypos, Allocation.Width, rowHeight); - context.SetSourceColor (backgroundColor); - context.Fill (); - - - // layout.SetMarkup ("" + (category.CompletionCategory != null ? category.CompletionCategory.DisplayText : "Uncategorized") + ""); - // window.DrawLayout (textGCInsensitive, x - 1, ypos + 1 + (rowHeight - py) / 2, layout); - // layout.SetMarkup ("" + (category.CompletionCategory != null ? category.CompletionCategory.DisplayText : "Uncategorized") + ""); - categoryLayout.SetMarkup ((category.CompletionCategory != null ? category.CompletionCategory.DisplayText : "Uncategorized")); - int px, py; - categoryLayout.GetPixelSize (out px, out py); - context.MoveTo (x, ypos + (rowHeight - py) / 2); - context.SetSourceColor (categoryColor); - Pango.CairoHelper.ShowLayout (context, categoryLayout); - }, delegate (CategorizedCompletionItems curCategory, int item, int itemidx, int ypos) { - if (ypos >= height) - return false; - if (ypos < -rowHeight) - return true; - const int categoryModeItemIndenting = 0; - if (InCategoryMode && curCategory != null && curCategory.CompletionCategory != null) { - xpos = iconTextSpacing + categoryModeItemIndenting; - } else { - xpos = iconTextSpacing; - } - bool drawIconAsSelected = SelectionEnabled && item == SelectedItemIndex; - string markup = DataProvider.HasMarkup (item) ? (DataProvider.GetMarkup (item) ?? "<null>") : GLib.Markup.EscapeText (DataProvider.GetText (item) ?? ""); - string description = DataProvider.GetDescription (item, drawIconAsSelected); - - if (string.IsNullOrEmpty (description)) { - layout.SetMarkup (markup); - } else { - layout.SetMarkup (markup + " " + description); - } - - string text = DataProvider.GetText (item); - - if (!string.IsNullOrEmpty (text)) { - int [] matchIndices = DataProvider.GetHighlightedTextIndices(item); - if (matchIndices != null) { - Pango.AttrList attrList = layout.Attributes ?? new Pango.AttrList (); - for (int newSelection = 0; newSelection < matchIndices.Length; newSelection++) { - int idx = matchIndices [newSelection]; - var bold = new AttrWeight (Weight.Bold); - - bold.StartIndex = (uint)idx; - bold.EndIndex = (uint)(idx + 1); - attrList.Insert (bold); - - if (item != SelectedItemIndex) { - var highlightColor = (item == SelectedItemIndex) ? Styles.CodeCompletion.SelectionHighlightColor : Styles.CodeCompletion.HighlightColor; - var fg = new AttrForeground ((ushort)(highlightColor.Red * ushort.MaxValue), (ushort)(highlightColor.Green * ushort.MaxValue), (ushort)(highlightColor.Blue * ushort.MaxValue)); - fg.StartIndex = (uint)idx; - fg.EndIndex = (uint)(idx + 1); - attrList.Insert (fg); - } - } - layout.Attributes = attrList; - } - } - - Xwt.Drawing.Image icon = DataProvider.GetIcon (item); - int iconHeight, iconWidth; - if (icon != null) { - if (drawIconAsSelected) - icon = icon.WithStyles ("sel"); - iconWidth = (int)icon.Width; - iconHeight = (int)icon.Height; - } else if (!Gtk.Icon.SizeLookup (IconSize.Menu, out iconWidth, out iconHeight)) { - iconHeight = iconWidth = 24; - } - - int wi, he, typos, iypos; - layout.GetPixelSize (out wi, out he); - - - typos = he < rowHeight ? ypos + (int)Math.Ceiling ((rowHeight - he) / 2.0) : ypos; - if (scalef <= 1.0) - typos -= 1; // 1px up on non HiDPI - iypos = iconHeight < rowHeight ? ypos + (rowHeight - iconHeight) / 2 : ypos; - if (item == SelectedItemIndex) { - var barStyle = SelectionEnabled ? Styles.CodeCompletion.SelectionBackgroundColor : Styles.CodeCompletion.SelectionBackgroundInactiveColor; - context.SetSourceColor (barStyle.ToCairoColor ()); - - if (SelectionEnabled) { - context.Rectangle (0, ypos, Allocation.Width, rowHeight); - context.Fill (); - } else { - context.LineWidth++; - context.Rectangle (0.5, ypos + 0.5, Allocation.Width - 1, rowHeight - 1); - context.Stroke (); - context.LineWidth--; - } - } - - if (icon != null) { - context.DrawImage (this, icon, xpos, iypos); - xpos += iconTextSpacing; - } - context.SetSourceColor ((drawIconAsSelected ? Styles.CodeCompletion.SelectionTextColor : Styles.CodeCompletion.TextColor).ToCairoColor ()); - var textXPos = xpos + iconWidth + 2; - context.MoveTo (textXPos, typos); - layout.Width = (int)((Allocation.Width - textXPos) * Pango.Scale.PangoScale); - layout.Ellipsize = EllipsizeMode.End; - Pango.CairoHelper.ShowLayout (context, layout); - int textW, textH; - layout.GetPixelSize (out textW, out textH); - layout.Width = -1; - layout.Ellipsize = EllipsizeMode.None; - - layout.SetMarkup (""); - if (layout.Attributes != null) { - layout.Attributes.Dispose (); - layout.Attributes = null; - } - - string rightText = DataProvider.GetRightSideDescription (item, drawIconAsSelected); - if (!string.IsNullOrEmpty (rightText)) { - layout.SetMarkup (rightText); - - int w, h; - layout.GetPixelSize (out w, out h); - const int leftpadding = 8; - const int rightpadding = 3; - w += rightpadding; - w = Math.Min (w, Allocation.Width - textXPos - textW - leftpadding); - wi += w; - typos = h < rowHeight ? ypos + (rowHeight - h) / 2 : ypos; - if (scalef <= 1.0) - typos -= 1; // 1px up on non HiDPI - context.MoveTo (Allocation.Width - w, typos); - layout.Width = (int)(w * Pango.Scale.PangoScale); - layout.Ellipsize = EllipsizeMode.End; - - Pango.CairoHelper.ShowLayout (context, layout); - layout.Width = -1; - layout.Ellipsize = EllipsizeMode.None; - - } - - if (Math.Min (maxListWidth, wi + xpos + iconWidth + 2) > listWidth) { - WidthRequest = listWidth = Math.Min (maxListWidth, wi + xpos + iconWidth + 2 + iconTextSpacing); - win.ResetSizes (); - } else { - //workaround for the vscrollbar display - the calculated width needs to be the width ofthe render region. - if (Allocation.Width < listWidth) { - if (listWidth - Allocation.Width < 30) { - WidthRequest = listWidth + listWidth - Allocation.Width; - win.ResetSizes (); - } - } - } - - return true; - }); - - return false; - } - } +// protected override bool OnExposeEvent (Gdk.EventExpose args) +// { +// using (var context = Gdk.CairoHelper.Create (args.Window)) { +// var scalef = GtkWorkarounds.GetScaleFactor (this); +// context.LineWidth = 1; +// var alloc = Allocation; +// int width = alloc.Width; +// int height = alloc.Height; +// context.Rectangle (args.Area.X, args.Area.Y, args.Area.Width, args.Area.Height); +// var backgroundColor = Styles.CodeCompletion.BackgroundColor.ToCairoColor (); +// var textColor = Styles.CodeCompletion.TextColor.ToCairoColor (); +// var categoryColor = Styles.CodeCompletion.CategoryColor.ToCairoColor (); +// context.SetSourceColor (backgroundColor); +// context.Fill (); +// int xpos = iconTextSpacing; +// int yPos = (int)-vadj.Value; +// //when there are no matches, display a message to indicate that the completion list is still handling input +// if (filteredItems.Count == 0) { +// context.Rectangle (0, yPos, width, height - yPos); +// context.SetSourceColor (backgroundColor); +// context.Stroke (); +// noMatchLayout.SetText (DataProvider.ItemCount == 0 ? NoSuggestionsMsg : NoMatchesMsg); +// int lWidth, lHeight; +// noMatchLayout.GetPixelSize (out lWidth, out lHeight); +// context.SetSourceColor (textColor); +// context.MoveTo ((width - lWidth) / 2, yPos + (height - lHeight - yPos) / 2 - lHeight / 2); +// Pango.CairoHelper.ShowLayout (context, noMatchLayout); +// return false; +// } +// +// Iterate (true, ref yPos, delegate (CategorizedCompletionItems category, int ypos) { +// if (ypos >= height) +// return; +// if (ypos < -rowHeight) +// return; +// +// // window.DrawRectangle (this.Style.BackgroundGC (StateType.Insensitive), true, 0, yPos, width, rowHeight); +// int x = 2; +// if (category.CompletionCategory != null && !string.IsNullOrEmpty (category.CompletionCategory.Icon)) { +// var icon = ImageService.GetIcon (category.CompletionCategory.Icon, IconSize.Menu); +// context.DrawImage (this, icon, 0, ypos); +// x = (int)icon.Width + 4; +// } +// context.Rectangle (0, ypos, Allocation.Width, rowHeight); +// context.SetSourceColor (backgroundColor); +// context.Fill (); +// +// +// // layout.SetMarkup ("" + (category.CompletionCategory != null ? category.CompletionCategory.DisplayText : "Uncategorized") + ""); +// // window.DrawLayout (textGCInsensitive, x - 1, ypos + 1 + (rowHeight - py) / 2, layout); +// // layout.SetMarkup ("" + (category.CompletionCategory != null ? category.CompletionCategory.DisplayText : "Uncategorized") + ""); +// categoryLayout.SetMarkup ((category.CompletionCategory != null ? category.CompletionCategory.DisplayText : "Uncategorized")); +// int px, py; +// categoryLayout.GetPixelSize (out px, out py); +// context.MoveTo (x, ypos + (rowHeight - py) / 2); +// context.SetSourceColor (categoryColor); +// Pango.CairoHelper.ShowLayout (context, categoryLayout); +// }, delegate (CategorizedCompletionItems curCategory, int item, int itemidx, int ypos) { +// if (ypos >= height) +// return false; +// if (ypos < -rowHeight) +// return true; +// const int categoryModeItemIndenting = 0; +// if (InCategoryMode && curCategory != null && curCategory.CompletionCategory != null) { +// xpos = iconTextSpacing + categoryModeItemIndenting; +// } else { +// xpos = iconTextSpacing; +// } +// bool drawIconAsSelected = SelectionEnabled && item == SelectedItemIndex; +// string markup = DataProvider.HasMarkup (item) ? (DataProvider.GetMarkup (item) ?? "<null>") : GLib.Markup.EscapeText (DataProvider.GetText (item) ?? ""); +// string description = DataProvider.GetDescription (item, drawIconAsSelected); +// +// if (string.IsNullOrEmpty (description)) { +// layout.SetMarkup (markup); +// } else { +// layout.SetMarkup (markup + " " + description); +// } +// +// string text = DataProvider.GetText (item); +// +// if (!string.IsNullOrEmpty (text)) { +// int [] matchIndices = DataProvider.GetHighlightedTextIndices(item); +// if (matchIndices != null) { +// Pango.AttrList attrList = layout.Attributes ?? new Pango.AttrList (); +// for (int newSelection = 0; newSelection < matchIndices.Length; newSelection++) { +// int idx = matchIndices [newSelection]; +// var bold = new AttrWeight (Weight.Bold); +// +// bold.StartIndex = (uint)idx; +// bold.EndIndex = (uint)(idx + 1); +// attrList.Insert (bold); +// +// if (item != SelectedItemIndex) { +// var highlightColor = (item == SelectedItemIndex) ? Styles.CodeCompletion.SelectionHighlightColor : Styles.CodeCompletion.HighlightColor; +// var fg = new AttrForeground ((ushort)(highlightColor.Red * ushort.MaxValue), (ushort)(highlightColor.Green * ushort.MaxValue), (ushort)(highlightColor.Blue * ushort.MaxValue)); +// fg.StartIndex = (uint)idx; +// fg.EndIndex = (uint)(idx + 1); +// attrList.Insert (fg); +// } +// } +// layout.Attributes = attrList; +// } +// } +// +// Xwt.Drawing.Image icon = DataProvider.GetIcon (item); +// int iconHeight, iconWidth; +// if (icon != null) { +// if (drawIconAsSelected) +// icon = icon.WithStyles ("sel"); +// iconWidth = (int)icon.Width; +// iconHeight = (int)icon.Height; +// } else if (!Gtk.Icon.SizeLookup (IconSize.Menu, out iconWidth, out iconHeight)) { +// iconHeight = iconWidth = 24; +// } +// +// int wi, he, typos, iypos; +// layout.GetPixelSize (out wi, out he); +// +// +// typos = he < rowHeight ? ypos + (int)Math.Ceiling ((rowHeight - he) / 2.0) : ypos; +// if (scalef <= 1.0) +// typos -= 1; // 1px up on non HiDPI +// iypos = iconHeight < rowHeight ? ypos + (rowHeight - iconHeight) / 2 : ypos; +// if (item == SelectedItemIndex) { +// var barStyle = SelectionEnabled ? Styles.CodeCompletion.SelectionBackgroundColor : Styles.CodeCompletion.SelectionBackgroundInactiveColor; +// context.SetSourceColor (barStyle.ToCairoColor ()); +// +// if (SelectionEnabled) { +// context.Rectangle (0, ypos, Allocation.Width, rowHeight); +// context.Fill (); +// } else { +// context.LineWidth++; +// context.Rectangle (0.5, ypos + 0.5, Allocation.Width - 1, rowHeight - 1); +// context.Stroke (); +// context.LineWidth--; +// } +// } +// +// if (icon != null) { +// context.DrawImage (this, icon, xpos, iypos); +// xpos += iconTextSpacing; +// } +// context.SetSourceColor ((drawIconAsSelected ? Styles.CodeCompletion.SelectionTextColor : Styles.CodeCompletion.TextColor).ToCairoColor ()); +// var textXPos = xpos + iconWidth + 2; +// context.MoveTo (textXPos, typos); +// layout.Width = (int)((Allocation.Width - textXPos) * Pango.Scale.PangoScale); +// layout.Ellipsize = EllipsizeMode.End; +// Pango.CairoHelper.ShowLayout (context, layout); +// int textW, textH; +// layout.GetPixelSize (out textW, out textH); +// layout.Width = -1; +// layout.Ellipsize = EllipsizeMode.None; +// +// layout.SetMarkup (""); +// if (layout.Attributes != null) { +// layout.Attributes.Dispose (); +// layout.Attributes = null; +// } +// +// string rightText = DataProvider.GetRightSideDescription (item, drawIconAsSelected); +// if (!string.IsNullOrEmpty (rightText)) { +// layout.SetMarkup (rightText); +// +// int w, h; +// layout.GetPixelSize (out w, out h); +// const int leftpadding = 8; +// const int rightpadding = 3; +// w += rightpadding; +// w = Math.Min (w, Allocation.Width - textXPos - textW - leftpadding); +// wi += w; +// typos = h < rowHeight ? ypos + (rowHeight - h) / 2 : ypos; +// if (scalef <= 1.0) +// typos -= 1; // 1px up on non HiDPI +// context.MoveTo (Allocation.Width - w, typos); +// layout.Width = (int)(w * Pango.Scale.PangoScale); +// layout.Ellipsize = EllipsizeMode.End; +// +// Pango.CairoHelper.ShowLayout (context, layout); +// layout.Width = -1; +// layout.Ellipsize = EllipsizeMode.None; +// +// } +// +// if (Math.Min (maxListWidth, wi + xpos + iconWidth + 2) > listWidth) { +// WidthRequest = listWidth = Math.Min (maxListWidth, wi + xpos + iconWidth + 2 + iconTextSpacing); +// win.ResetSizes (); +// } else { +// //workaround for the vscrollbar display - the calculated width needs to be the width ofthe render region. +// if (Allocation.Width < listWidth) { +// if (listWidth - Allocation.Width < 30) { +// WidthRequest = listWidth + listWidth - Allocation.Width; +// win.ResetSizes (); +// } +// } +// } +// +// return true; +// }); +// +// return false; +// } +// } public int TextOffset { get { @@ -661,12 +661,17 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) SetAdjustments (false); } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) + { + base.OnGetPreferredWidth (out min_width, out natural_width); + min_width = listWidth; + } + + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - base.OnSizeRequested (ref requisition); - requisition.Width = listWidth; + base.OnGetPreferredHeight (out min_height, out natural_height); if (rowHeight > 0) - requisition.Height += requisition.Height % rowHeight; + min_height += min_height % rowHeight; } void CalcVisibleRows () diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs index 35bc051ecd1..dc2d6a808cb 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs @@ -294,13 +294,13 @@ public TooltipInformationWindow () vb2.Spacing = 4; vb2.PackStart (hb, true, true, 0); - vb2.SizeRequested += (o, args) => { - var w = Math.Max (headLabel.WidthRequest, headLabel.RealWidth); - var req = new Gtk.Requisition (); - req.Height = args.Requisition.Height; - req.Width = (int)Math.Max (w + PaddingLeft + PaddingTop, args.Requisition.Width); - args.Args[0] = req; - }; +// vb2.SizeRequested += (o, args) => { +// var w = Math.Max (headLabel.WidthRequest, headLabel.RealWidth); +// var req = new Gtk.Requisition (); +// req.Height = args.Requisition.Height; +// req.Width = (int)Math.Max (w + PaddingLeft + PaddingTop, args.Requisition.Width); +// args.Args[0] = req; +// }; Content = BackendHost.ToolkitEngine.WrapWidget (vb2, Xwt.NativeWidgetSizing.DefaultPreferredSize); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs index 191409be2b4..bd0c4337267 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs @@ -150,7 +150,7 @@ public void Store () CodeTemplateService.Templates = templates; } - static void RenderIcon (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + static void RenderIcon (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { CodeTemplate template = (CodeTemplate)model.GetValue (iter, 0); @@ -163,7 +163,7 @@ static void RenderIcon (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.Tr } - void RenderTemplateName (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + void RenderTemplateName (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { CodeTemplate template = (CodeTemplate)model.GetValue (iter, 0); var crt = (CellRendererText)cell; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs index e02b80ba359..b8225bda044 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs @@ -99,7 +99,7 @@ public EditTemplateDialog (CodeTemplate template, bool isNew) treeviewVariable.AppendColumn ("", new Gtk.CellRendererText (), "text", 0); CellRendererText nameRenderer = new CellRendererText (); - treeviewVariable.AppendColumn ("", nameRenderer, delegate (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) { + treeviewVariable.AppendColumn ("", nameRenderer, delegate (TreeViewColumn col, CellRenderer cell, ITreeModel model, TreeIter iter) { nameRenderer.Markup = ((string)model.GetValue (iter, 2)); }); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs index c81c15ae148..79d66f04465 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs @@ -111,7 +111,7 @@ internal class DefaultDeleteHandler: CommandHandler protected override void Run () { if (IdeApp.Workbench.RootWindow.HasToplevelFocus) { - Gtk.Editable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.Editable; + Gtk.IEditable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.IEditable; if (editable != null) { int cm; int cme; @@ -142,8 +142,8 @@ protected override void Run () protected override void Update (CommandInfo info) { object focus = IdeApp.Workbench.RootWindow.Focus; - if (focus is Gtk.Editable) - info.Enabled = ((Gtk.Editable)focus).IsEditable; + if (focus is Gtk.IEditable) + info.Enabled = ((Gtk.IEditable)focus).IsEditable; else if (focus is Gtk.TextView) info.Enabled = ((Gtk.TextView)focus).Editable; else @@ -171,7 +171,7 @@ protected override void Run () #endif if (IdeApp.Workbench.RootWindow.HasToplevelFocus) { - Gtk.Editable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.Editable; + Gtk.IEditable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.IEditable; if (editable != null) { editable.CopyClipboard (); return; @@ -201,7 +201,7 @@ protected override void Run () protected override void Update (CommandInfo info) { object focus = IdeApp.Workbench.RootWindow.HasToplevelFocus ? IdeApp.Workbench.RootWindow.Focus : null; - info.Enabled = (focus is Gtk.Editable || focus is Gtk.TextView); + info.Enabled = (focus is Gtk.IEditable || focus is Gtk.TextView); #if MAC var macfocus = AppKit.NSApplication.SharedApplication?.KeyWindow?.FirstResponder; info.Enabled |= macfocus is AppKit.NSText || macfocus?.RespondsToSelector (copySelector) == true; @@ -232,7 +232,7 @@ protected override void Run () #endif if (IdeApp.Workbench.RootWindow.HasToplevelFocus) { - Gtk.Editable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.Editable; + Gtk.IEditable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.IEditable; if (editable != null) { editable.CutClipboard (); return; @@ -262,8 +262,8 @@ protected override void Run () protected override void Update (CommandInfo info) { object focus = IdeApp.Workbench.RootWindow.HasToplevelFocus ? IdeApp.Workbench.RootWindow.Focus : null; - if (focus is Gtk.Editable) - info.Enabled = ((Gtk.Editable)focus).IsEditable; + if (focus is Gtk.IEditable) + info.Enabled = ((Gtk.IEditable)focus).IsEditable; else if (focus is Gtk.TextView) info.Enabled = ((Gtk.TextView)focus).Editable; else @@ -300,7 +300,7 @@ protected override void Run () } #endif if (IdeApp.Workbench.RootWindow.HasToplevelFocus) { - Gtk.Editable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.Editable; + Gtk.IEditable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.IEditable; if (editable != null) { editable.PasteClipboard (); return; @@ -330,8 +330,8 @@ protected override void Run () protected override void Update (CommandInfo info) { object focus = IdeApp.Workbench.RootWindow.HasToplevelFocus ? IdeApp.Workbench.RootWindow.Focus : null; - if (focus is Gtk.Editable) - info.Enabled = ((Gtk.Editable)focus).IsEditable; + if (focus is Gtk.IEditable) + info.Enabled = ((Gtk.IEditable)focus).IsEditable; else if (focus is Gtk.TextView) info.Enabled = ((Gtk.TextView)focus).Editable; else @@ -387,7 +387,7 @@ protected override void Run () } #endif if (IdeApp.Workbench.RootWindow.HasToplevelFocus) { - Gtk.Editable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.Editable; + Gtk.IEditable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.IEditable; if (editable != null) { editable.SelectRegion (0, -1); return; @@ -416,7 +416,7 @@ protected override void Run () protected override void Update (CommandInfo info) { object focus = IdeApp.Workbench.RootWindow.HasToplevelFocus ? IdeApp.Workbench.RootWindow.Focus : null; - info.Enabled = (focus is Gtk.Editable || focus is Gtk.TextView); + info.Enabled = (focus is Gtk.IEditable || focus is Gtk.TextView); #if MAC var macfocus = AppKit.NSApplication.SharedApplication?.KeyWindow?.FirstResponder; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ChunkStyle.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ChunkStyle.cs index bb6434ab05a..98f480a40e3 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ChunkStyle.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ChunkStyle.cs @@ -96,15 +96,15 @@ public override int GetHashCode () } } - internal Gdk.GC CreateBgGC (Gdk.Drawable drawable) - { - return new Gdk.GC (drawable) { RgbBgColor = (HslColor)Foreground, RgbFgColor = (HslColor)Background }; - } +// internal Gdk.GC CreateBgGC (Gdk.Drawable drawable) +// { +// return new Gdk.GC (drawable) { RgbBgColor = (HslColor)Foreground, RgbFgColor = (HslColor)Background }; +// } - internal Gdk.GC CreateFgGC (Gdk.Drawable drawable) - { - return new Gdk.GC (drawable) { RgbBgColor = (HslColor)Background, RgbFgColor = (HslColor)Foreground }; - } +// internal Gdk.GC CreateFgGC (Gdk.Drawable drawable) +// { +// return new Gdk.GC (drawable) { RgbBgColor = (HslColor)Background, RgbFgColor = (HslColor)Foreground }; +// } public override string ToString () { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs index 7e984d5b068..3fef03b20de 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs @@ -177,7 +177,7 @@ void MoveUpButtonClicked (object sender, EventArgs e) { if (toolListBox.Selection.CountSelectedRows () == 1) { TreeIter selectedItem; - TreeModel ls; + ITreeModel ls; ((ListStore)toolListBox.Model).GetIter (out selectedItem, (TreePath)toolListBox.Selection.GetSelectedRows (out ls)[0]); // we know we have a selected item so get it's index // use that to get the path of the item before it, and swap the two @@ -195,7 +195,7 @@ void MoveDownButtonClicked (object sender, EventArgs e) { if (toolListBox.Selection.CountSelectedRows () == 1) { TreeIter selectedItem; - TreeModel ls; + ITreeModel ls; ((ListStore)toolListBox.Model).GetIter (out selectedItem, (TreePath) toolListBox.Selection.GetSelectedRows(out ls)[0]); // swap it with the next one TreeIter toSwap = selectedItem; @@ -321,7 +321,7 @@ TreeIter SelectedIter { get { if (toolListBox.Selection.CountSelectedRows () == 1) { TreeIter selectedIter; - TreeModel ls; + ITreeModel ls; ((ListStore) toolListBox.Model).GetIter (out selectedIter, (TreePath) toolListBox.Selection.GetSelectedRows (out ls)[0]); return selectedIter; } @@ -332,7 +332,7 @@ ExternalTool SelectedTool { get { if (toolListBox.Selection.CountSelectedRows () == 1) { TreeIter selectedIter; - TreeModel ls; + ITreeModel ls; ((ListStore) toolListBox.Model).GetIter (out selectedIter, (TreePath) toolListBox.Selection.GetSelectedRows (out ls)[0]); return toolListBox.Model.GetValue(selectedIter, 1) as ExternalTool; } @@ -378,7 +378,7 @@ void RemoveButtonClicked (object sender, EventArgs e) int maxIndex = 0; // first copy the selected item paths into a temp array TreeIter[] selectedIters = new TreeIter[selectedItemCount]; - TreeModel lv; + ITreeModel lv; TreePath[] pathList = toolListBox.Selection.GetSelectedRows (out lv); for (int i = 0; i < selectedItemCount; i++) { TreePath path = (TreePath) pathList[i]; @@ -414,7 +414,7 @@ int GetSelectedIndex (Gtk.TreeView tv) { if (toolListBox.Selection.CountSelectedRows () == 1) { TreeIter selectedIter; - TreeModel lv; + ITreeModel lv; ((ListStore) toolListBox.Model).GetIter(out selectedIter, (TreePath) toolListBox.Selection.GetSelectedRows (out lv)[0]); // return index of first level node (since only 1 level list model) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs index 58f710ad14f..e286e57dc9b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs @@ -59,8 +59,8 @@ enum SearchScope { } CheckButton checkbuttonRecursively; - ComboBoxEntry comboboxentryReplace; - ComboBoxEntry comboboxentryPath; + ComboBoxText comboboxentryReplace; + ComboBoxText comboboxentryPath; SearchEntry searchentryFileMask; Button buttonBrowsePaths; Button buttonReplace; @@ -356,7 +356,7 @@ void ShowReplaceUI () return; labelReplace = new Label { Text = GettextCatalog.GetString ("_Replace:"), Xalign = 0f, UseUnderline = true }; - comboboxentryReplace = new ComboBoxEntry (); + comboboxentryReplace = new ComboBoxText (); LoadHistory ("MonoDevelop.FindReplaceDialogs.ReplaceHistory", comboboxentryReplace); comboboxentryReplace.Show (); labelReplace.Show (); @@ -424,11 +424,11 @@ void ShowDirectoryPathUI () labelPath.Show (); hboxPath = new HBox (); - comboboxentryPath = new ComboBoxEntry (); + comboboxentryPath = new ComboBoxText (); comboboxentryPath.Destroyed += ComboboxentryPathDestroyed; LoadHistory ("MonoDevelop.FindReplaceDialogs.PathHistory", comboboxentryPath); comboboxentryPath.Show (); - hboxPath.PackStart (comboboxentryPath); + hboxPath.PackStart (comboboxentryPath, false, true, 0); labelPath.MnemonicWidget = comboboxentryPath; @@ -588,15 +588,15 @@ void UpdateSensitivity () buttonReplace.Sensitive = isSensitive; } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { - base.OnSizeRequested (ref requisition); - requisition.Width = Math.Max (480, requisition.Width); + base.OnGetPreferredWidth (out min_width, out natural_width); + min_width = Math.Max (480, min_width); } static void ComboboxentryPathDestroyed (object sender, EventArgs e) { - StoreHistory ("MonoDevelop.FindReplaceDialogs.PathHistory", (ComboBoxEntry)sender); + StoreHistory ("MonoDevelop.FindReplaceDialogs.PathHistory", (ComboBox)sender); } void ButtonBrowsePathsClicked (object sender, EventArgs e) @@ -637,7 +637,7 @@ void InitFromProperties () // LoadHistory ("MonoDevelop.FindReplaceDialogs.FileMaskHistory", comboboxentryFileMask); } - static void LoadHistory (string propertyName, ComboBoxEntry entry) + static void LoadHistory (string propertyName, ComboBoxText entry) { var ec = new EntryCompletion (); /* entry.Changed += delegate { @@ -652,7 +652,7 @@ static void LoadHistory (string propertyName, ComboBoxEntry entry) entry.Entry.Completion.Model = store; entry.Model = store; entry.Entry.ActivatesDefault = true; - entry.TextColumn = 0; + entry.Active = 0; var history = PropertyService.Get (propertyName); if (!string.IsNullOrEmpty (history)) { string[] items = history.Split (historySeparator); @@ -684,7 +684,7 @@ void StorePoperties () //StoreHistory ("MonoDevelop.FindReplaceDialogs.FileMaskHistory", comboboxentryFileMask); } - static void StoreHistory (string propertyName, ComboBoxEntry comboBox) + static void StoreHistory (string propertyName, ComboBox comboBox) { var store = (ListStore)comboBox.Model; var history = new List (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs index 8aea145849a..8f4a5041611 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs @@ -383,7 +383,7 @@ public void ShowStatus (string text) labelStatus.Text = text; } - static void FileIconDataFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) + static void FileIconDataFunc (TreeViewColumn column, CellRenderer cell, ITreeModel model, TreeIter iter) { if (TreeIter.Zero.Equals (iter)) return; @@ -399,7 +399,7 @@ static string MarkupText (string text, bool didRead) return string.Format ("{0}", GLib.Markup.EscapeText (text), didRead ? "normal" : "bold"); } - void FileNameDataFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) + void FileNameDataFunc (TreeViewColumn column, CellRenderer cell, ITreeModel model, TreeIter iter) { if (TreeIter.Zero.Equals (iter)) return; @@ -420,19 +420,19 @@ void FileNameDataFunc (TreeViewColumn column, CellRenderer cell, TreeModel model fileNameRenderer.Markup = MarkupText (System.IO.Path.GetFileName (searchResult.FileName) + ":" + lineNumber, didRead); } - int CompareLineNumbers (TreeModel model, TreeIter first, TreeIter second) + int CompareLineNumbers (ITreeModel model, TreeIter first, TreeIter second) { var loc1 = GetLocation ((SearchResult)model.GetValue (first, SearchResultColumn)); var loc2 = GetLocation ((SearchResult)model.GetValue (second, SearchResultColumn)); return loc1.Line.CompareTo (loc2.Line); } - static int DefaultSortFunc (TreeModel model, TreeIter first, TreeIter second) + static int DefaultSortFunc (ITreeModel model, TreeIter first, TreeIter second) { return 0; } - static int CompareFileNames (TreeModel model, TreeIter first, TreeIter second) + static int CompareFileNames (ITreeModel model, TreeIter first, TreeIter second) { var searchResult1 = (SearchResult)model.GetValue (first, SearchResultColumn); var searchResult2 = (SearchResult)model.GetValue (second, SearchResultColumn); @@ -446,7 +446,7 @@ static int CompareFileNames (TreeModel model, TreeIter first, TreeIter second) } } - static int CompareProjectFileNames (TreeModel model, TreeIter first, TreeIter second) + static int CompareProjectFileNames (ITreeModel model, TreeIter first, TreeIter second) { var searchResult1 = (SearchResult)model.GetValue (first, SearchResultColumn); var searchResult2 = (SearchResult)model.GetValue (second, SearchResultColumn); @@ -457,7 +457,7 @@ static int CompareProjectFileNames (TreeModel model, TreeIter first, TreeIter se return string.Compare (System.IO.Path.GetFileName (searchResult1.Projects [0].FileName), System.IO.Path.GetFileName (searchResult2.Projects [0].FileName), StringComparison.Ordinal); } - static int CompareFilePaths (TreeModel model, TreeIter first, TreeIter second) + static int CompareFilePaths (ITreeModel model, TreeIter first, TreeIter second) { var searchResult1 = (SearchResult)model.GetValue (first, SearchResultColumn); var searchResult2 = (SearchResult)model.GetValue (second, SearchResultColumn); @@ -467,7 +467,7 @@ static int CompareFilePaths (TreeModel model, TreeIter first, TreeIter second) return System.IO.Path.GetDirectoryName (searchResult1.FileName).CompareTo (System.IO.Path.GetDirectoryName (searchResult2.FileName)); } - void ResultPathDataFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) + void ResultPathDataFunc (TreeViewColumn column, CellRenderer cell, ITreeModel model, TreeIter iter) { if (TreeIter.Zero.Equals (iter)) return; @@ -491,7 +491,7 @@ void ResultPathDataFunc (TreeViewColumn column, CellRenderer cell, TreeModel mod pathRenderer.Markup = MarkupText (directory, didRead); } - static void ResultProjectIconDataFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) + static void ResultProjectIconDataFunc (TreeViewColumn column, CellRenderer cell, ITreeModel model, TreeIter iter) { if (TreeIter.Zero.Equals (iter)) return; @@ -506,7 +506,7 @@ static void ResultProjectIconDataFunc (TreeViewColumn column, CellRenderer cell, } } - static void ResultProjectDataFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) + static void ResultProjectDataFunc (TreeViewColumn column, CellRenderer cell, ITreeModel model, TreeIter iter) { if (TreeIter.Zero.Equals (iter)) return; @@ -529,7 +529,7 @@ static int TranslateIndexToUTF8 (string text, int index) return Encoding.UTF8.GetCharCount (bytes, 0, index); } List> markupCache = new List> (); - void ResultTextDataFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) + void ResultTextDataFunc (TreeViewColumn column, CellRenderer cell, ITreeModel model, TreeIter iter) { if (TreeIter.Zero.Equals (iter)) return; @@ -759,7 +759,7 @@ public void SelectAll () public void CopySelection () { - TreeModel model; + ITreeModel model; var sb = new StringBuilder (); foreach (TreePath p in treeviewSearchResults.Selection.GetSelectedRows (out model)) { TreeIter iter; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExecutionModeComboBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExecutionModeComboBox.cs index c8d022c9c96..5afcffef9f6 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExecutionModeComboBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExecutionModeComboBox.cs @@ -45,7 +45,7 @@ public ExecutionModeComboBox () { this.Build (); - comboMode.RowSeparatorFunc = delegate (TreeModel model, TreeIter iter) { + comboMode.RowSeparatorFunc = delegate (ITreeModel model, TreeIter iter) { string item = (string) comboMode.Model.GetValue (iter, 0); return item == "--"; }; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs index 3c50105a7b3..bf1dced8f88 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs @@ -29,2883 +29,2883 @@ //#define TREE_VERIFY_INTEGRITY -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Mono.Addins; -using MonoDevelop.Components; -using MonoDevelop.Components.Commands; -using MonoDevelop.Core; -using MonoDevelop.Ide.Commands; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mono.Addins; +using MonoDevelop.Components; +using MonoDevelop.Components.Commands; +using MonoDevelop.Core; +using MonoDevelop.Ide.Commands; using MonoDevelop.Ide.Extensions; -using MonoDevelop.Ide.Gui.Pads; -using MonoDevelop.Projects.Extensions; - -namespace MonoDevelop.Ide.Gui.Components -{ - public partial class ExtensibleTreeView : Control, ICommandRouter - { - internal const int NodeInfoColumn = 0; - internal const int DataItemColumn = 1; - internal const int BuilderChainColumn = 2; - internal const int FilledColumn = 3; - internal const int ShowPopupColumn = 4; - - NodeBuilder[] builders; - Dictionary builderChains = new Dictionary (); - NodeHashtable nodeHash = new NodeHashtable (); - - ExtensibleTreeViewWidget widget; - ExtensibleTreeViewTree tree; - Gtk.TreeStore store; - Gtk.TreeViewColumn complete_column; - ZoomableCellRendererPixbuf pix_render; - CustomCellRendererText text_render; - TreeBuilderContext builderContext; - Dictionary> callbacks = new Dictionary> (); - bool editingText = false; - - TreePadOption[] options; - TreeOptions globalOptions; - - TreeNodeNavigator workNode; - TreeNodeNavigator compareNode1; - TreeNodeNavigator compareNode2; - - internal bool sorting; - - object[] copyObjects; - DragOperation currentTransferOperation; - - TransactedNodeStore transactionStore; - int updateLockCount; - string contextMenuPath; - IDictionary contextMenuTypeNameAliases; - - public IDictionary ContextMenuTypeNameAliases { - get { return contextMenuTypeNameAliases; } - set { contextMenuTypeNameAliases = value; } - } - - internal Gtk.TreeStore Store { - get { - return this.store; - } - } - - internal Gtk.TreeView Tree { - get { - return tree; - } - } - - public event EventHandler SelectionChanged; - - public bool AllowsMultipleSelection { - get { - return Tree.Selection.Mode == Gtk.SelectionMode.Multiple; - } - set { - if (value) - Tree.Selection.Mode = Gtk.SelectionMode.Multiple; - else - Tree.Selection.Mode = Gtk.SelectionMode.Single; - } - } - - public string Id { get; set; } - - - class ExtensibleTreeViewWidget : CompactScrolledWindow, ICommandRouter - { - ExtensibleTreeView control; - - public ExtensibleTreeViewWidget (ExtensibleTreeView control) - { - this.control = control; - ShadowType = Gtk.ShadowType.None; - ShowBorderLine = false; - } - - protected override void OnStyleSet (Gtk.Style previous_style) - { - base.OnStyleSet (previous_style); - control.UpdateFont (); - } - - protected override bool OnScrollEvent (Gdk.EventScroll evnt) - { - control.HideStatusMessage (); - var modifier = !Platform.IsMac? Gdk.ModifierType.ControlMask - //Mac window manager already uses control-scroll, so use command - //Command might be either meta or mod1, depending on GTK version - : (Gdk.ModifierType.MetaMask | Gdk.ModifierType.Mod1Mask); - - if ((evnt.State & modifier) !=0) { - if (evnt.Direction == Gdk.ScrollDirection.Up) - control.ZoomIn (); - else if (evnt.Direction == Gdk.ScrollDirection.Down) - control.ZoomOut (); - - return true; - } - return base.OnScrollEvent (evnt); - } - - protected override void OnDestroyed () - { - control.Destroy (); - base.OnDestroyed (); - } - - public object GetNextCommandTarget () - { - return control; - } - } - - protected override object CreateNativeWidget () - { - return widget; - } - - public ExtensibleTreeView () - { - widget = new ExtensibleTreeViewWidget (this); - tree = new ExtensibleTreeViewTree (this); - } - - public ExtensibleTreeView (NodeBuilder[] builders, TreePadOption[] options) : this () - { - Initialize (builders, options); - } - - void CustomFontPropertyChanged (object sender, EventArgs a) - { - UpdateFont (); - } - - void UpdateFont () - { - text_render.CustomFont = IdeApp.Preferences.CustomPadFont ?? tree.Style.FontDescription; - tree.ColumnsAutosize (); - } - - public void Initialize (NodeBuilder [] builders, TreePadOption [] options, string contextMenuPath = null) - { - OnInitialize (builders, options, contextMenuPath); - } - - protected virtual void OnInitialize (NodeBuilder[] builders, TreePadOption[] options, string contextMenuPath) - { - this.contextMenuPath = contextMenuPath; - builderContext = new TreeBuilderContext (this); - - SetBuilders (builders, options); - - store = new Gtk.TreeStore (typeof(NodeInfo), typeof(object), typeof(object), typeof(bool), typeof(bool)); - tree.Model = store; - tree.Selection.Mode = Gtk.SelectionMode.Multiple; - - store.DefaultSortFunc = new Gtk.TreeIterCompareFunc (CompareNodes); - store.SetSortColumnId (/* GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID */ -1, Gtk.SortType.Ascending); - - tree.HeadersVisible = false; - tree.EnableSearch = false; - complete_column = new Gtk.TreeViewColumn (); - complete_column.Title = "column"; - - pix_render = new ZoomableCellRendererPixbuf (); - pix_render.Xpad = 0; - complete_column.PackStart (pix_render, false); - - text_render = new CustomCellRendererText (this); - text_render.Ypad = 0; - IdeApp.Preferences.CustomPadFont.Changed += CustomFontPropertyChanged; - text_render.EditingStarted += HandleEditingStarted; - text_render.Edited += HandleOnEdit; - text_render.EditingCanceled += HandleOnEditCancelled; - complete_column.PackStart (text_render, true); - - complete_column.SetCellDataFunc (pix_render, SetIconCellData); - complete_column.SetCellDataFunc (text_render, SetTextCellData); - - tree.AppendColumn (complete_column); - - tree.TestExpandRow += OnTestExpandRow; - tree.RowActivated += OnNodeActivated; - tree.DoPopupMenu += ShowPopup; - - // Add an extra action handler to the tree to handle Press actions - var actionHandler = tree.ActionHandler; - actionHandler.PerformPress += OnPerformPress; - - workNode = new TreeNodeNavigator (this); - compareNode1 = new TreeNodeNavigator (this); - compareNode2 = new TreeNodeNavigator (this); - - tree.CursorChanged += OnSelectionChanged; - tree.KeyPressEvent += OnKeyPress; - tree.MotionNotifyEvent += HandleMotionNotifyEvent; - tree.LeaveNotifyEvent += HandleLeaveNotifyEvent; - - if (GtkGestures.IsSupported) { - tree.AddGestureMagnifyHandler ((sender, args) => { - Zoom += Zoom * (args.Magnification / 4d); - }); - } - - for (int n=3; n<16; n++) { - Gtk.Rc.ParseString ("style \"MonoDevelop.ExtensibleTreeView_" + n + "\" {\n GtkTreeView::expander-size = " + n + "\n }\n"); - Gtk.Rc.ParseString ("widget \"*.MonoDevelop.ExtensibleTreeView_" + n + "\" style \"MonoDevelop.ExtensibleTreeView_" + n + "\"\n"); - } - - if (!string.IsNullOrEmpty (Id)) - Zoom = PropertyService.Get ("MonoDevelop.Ide.ExtensibleTreeView.Zoom." + Id, 1d); - else - Zoom = 1d; - - widget.Add (tree); - widget.ShowAll (); - -#if TREE_VERIFY_INTEGRITY - GLib.Timeout.Add (3000, Checker); -#endif - } -#if TREE_VERIFY_INTEGRITY - // Verifies the consistency of the tree view. Disabled by default - HashSet ochecked = new HashSet (); - bool Checker () - { - int nodes = 0; - foreach (DictionaryEntry e in nodeHash) { - if (e.Value is Gtk.TreeIter) { - nodes++; - if (!store.IterIsValid ((Gtk.TreeIter)e.Value) && ochecked.Add (e.Key)) { - Console.WriteLine ("Found invalid iter in tree pad - Object: " + e.Key); - MessageService.ShowError ("Found invalid iter in tree pad", "Object: " + e.Key); - } - } else { - Gtk.TreeIter[] iters = (Gtk.TreeIter[]) e.Value; - for (int n=0; n builders = new List (); - foreach (NodeBuilder nb in buildersArray) { - if (!(nb is TreeViewItemBuilder)) - builders.Add (nb); - } - builders.Add (new TreeViewItemBuilder ()); - - this.options = options; - globalOptions = new TreeOptions (); - foreach (TreePadOption op in options) - globalOptions [op.Id] = op.DefaultValue; - globalOptions.Pad = this; - - // Check that there is only one TypeNodeBuilder per type - - Hashtable bc = new Hashtable (); - foreach (NodeBuilder nb in builders) { - TypeNodeBuilder tnb = nb as TypeNodeBuilder; - if (tnb != null) { - if (tnb.UseReferenceEquality) - nodeHash.RegisterByRefType (tnb.NodeDataType); - TypeNodeBuilder other = (TypeNodeBuilder) bc [tnb.NodeDataType]; - if (other != null) - throw new ApplicationException (string.Format ("The type node builder {0} can't be used in this context because the type {1} is already handled by {2}", nb.GetType(), tnb.NodeDataType, other.GetType())); - bc [tnb.NodeDataType] = tnb; - } - else if (!(nb is NodeBuilderExtension)) - throw new InvalidOperationException (string.Format ("Invalid NodeBuilder type: {0}. NodeBuilders must inherit either from TypeNodeBuilder or NodeBuilderExtension", nb.GetType())); - } - - NodeBuilders = builders.ToArray (); - - foreach (NodeBuilder nb in builders) - nb.SetContext (builderContext); - } - - public void EnableDragUriSource (Func nodeToUri) - { - tree.EnableDragUriSource (nodeToUri); - } - - object[] GetDragObjects (out Xwt.Drawing.Image icon) - { - ITreeNavigator[] navs = GetSelectedNodes (); - if (navs.Length == 0) { - icon = null; - return null; - } - var dragObjects = new object [navs.Length]; - for (int n=0; n= rect.X && cx <= rect.Right) { - tree.ConvertBinWindowToWidgetCoords (rect.X, rect.Y, out rect.X, out rect.Y); - ShowStatusMessage (it, rect, info); - popupShown = true; - } - } - } - } - if (!popupShown) - HideStatusMessage (); - } - - bool statusMessageVisible; - Gtk.TreeIter statusIconIter; - TooltipPopoverWindow statusPopover; - - void ShowStatusMessage (Gtk.TreeIter it, Gdk.Rectangle rect, NodeInfo info) - { - if (statusMessageVisible && store.GetPath (it).Equals (store.GetPath (statusIconIter))) - return; - if (statusPopover != null) - statusPopover.Destroy (); - statusMessageVisible = true; - statusIconIter = it; - - statusPopover = TooltipPopoverWindow.Create (); - statusPopover.ShowArrow = true; - statusPopover.Text = info.StatusMessage; - statusPopover.Severity = info.StatusSeverity; - rect.Y += 2; - statusPopover.ShowPopup (this, rect, PopupPosition.Top); - } - - void HideStatusMessage () - { - if (statusMessageVisible) { - statusMessageVisible = false; - statusPopover.Destroy (); - statusPopover = null; - } - } - - [GLib.ConnectBefore] - void HandleLeaveNotifyEvent (object o, Gtk.LeaveNotifyEventArgs args) - { - HideStatusMessage (); - } - - internal void LockUpdates () - { - if (++updateLockCount == 1) - transactionStore = new TransactedNodeStore (this); - } - - internal void UnlockUpdates () - { - if (--updateLockCount == 0) { - TransactedNodeStore store = transactionStore; - transactionStore = null; - store.CommitChanges (); - } - } - - internal ITreeBuilder CreateBuilder () - { - return CreateBuilder (Gtk.TreeIter.Zero); - } - - internal ITreeBuilder CreateBuilder (Gtk.TreeIter it) - { - if (transactionStore != null) - return new TransactedTreeBuilder (this, transactionStore, it); - else - return new TreeBuilder (this, it); - } - - protected NodeBuilder[] NodeBuilders { - get { return builders; } - set { builders = value; } - } - - internal Gtk.TreeViewColumn CompleteColumn { - get { - return complete_column; - } - } - - NodeHashtable NodeHash { - get { - return nodeHash; - } - } - - internal ITreeBuilderContext BuilderContext { - get { - return builderContext; - } - } - - internal object[] CopyObjects { - get { - return copyObjects; - } - set { - copyObjects = value; - } - } - - internal DragOperation CurrentTransferOperation { - get { - return currentTransferOperation; - } - } - - public ITreeBuilder LoadTree (object nodeObject) - { - Clear (); - TreeBuilder builder = new TreeBuilder (this); - builder.AddChild (nodeObject, true); - builder.Expanded = true; - InitialSelection (); - return builder; - } - - public ITreeBuilder AddChild (object nodeObject) - { - return AddChild (nodeObject, true); - } - - public ITreeBuilder AddChild (object nodeObject, bool expanded) - { - TreeBuilder builder = new TreeBuilder (this); - builder.AddChild (nodeObject, true); - builder.Expanded = expanded; - InitialSelection (); - return builder; - } - - public void RemoveChild (object nodeObject) - { - TreeBuilder builder = new TreeBuilder (this); - if (builder.MoveToObject (nodeObject)) { - builder.Remove (); - InitialSelection (); - } - } - - void InitialSelection () - { - if (tree.Selection.CountSelectedRows () == 0) { - Gtk.TreeIter it; - if (store.GetIterFirst (out it)) { - tree.Selection.SelectIter (it); - tree.SetCursor (store.GetPath (it), tree.Columns [0], false); - } - } - } - - public void Clear () - { - copyObjects = tree.dragObjects = null; - - object[] obs = new object [nodeHash.Count]; - nodeHash.Keys.CopyTo (obs, 0); - - foreach (object dataObject in obs) - NotifyNodeRemoved (dataObject, null); - - nodeHash = new NodeHashtable (); - store.Clear (); - } - - public ITreeNavigator GetSelectedNode () - { - Gtk.TreePath[] sel = tree.Selection.GetSelectedRows (); - if (sel.Length == 0) - return null; - Gtk.TreeIter iter; - if (store.GetIter (out iter, sel[0])) - return new TreeNodeNavigator (this, iter); - else - return null; - } - - class SelectionGroup - { - public NodeBuilder[] BuilderChain; - public List Nodes; - public Gtk.TreeStore store; - - NodePosition[] savedPos; - object[] dataItems; - - public object[] DataItems { - get { - if (dataItems == null) { - dataItems = new object [Nodes.Count]; - for (int n=0; n GetSelectedNodesGrouped () - { - Gtk.TreePath[] paths = tree.Selection.GetSelectedRows (); - if (paths.Length == 0) { - return new SelectionGroup [0]; - } - if (paths.Length == 1) { - Gtk.TreeIter it; - store.GetIter (out it, paths [0]); - SelectionGroup grp = new SelectionGroup (); - TreeNodeNavigator nav = new TreeNodeNavigator (this, it); - grp.BuilderChain = nav.BuilderChain; - grp.Nodes = new List (); - grp.Nodes.Add (nav); - grp.store = store; - return new SelectionGroup [] { grp }; - } - - Dictionary dict = new Dictionary (); - for (int n=0; n (); - grp.store = store; - dict [nav.BuilderChain] = grp; - } - grp.Nodes.Add (nav); - } - return dict.Values; - } - - public bool MultipleNodesSelected () - { - return tree.Selection.GetSelectedRows ().Length > 1; - } - - public ITreeNavigator[] GetSelectedNodes () - { - Gtk.TreePath[] paths = tree.Selection.GetSelectedRows (); - ITreeNavigator [] navs = new ITreeNavigator [paths.Length]; - for (int n=0; n (); - list.Add (callback); - callbacks [dataObject] = list; - } - } - - internal new object GetNextCommandTarget () - { - return null; - } - - class MulticastNodeRouter: IMultiCastCommandRouter - { - List targets; - - public MulticastNodeRouter (List targets) - { - this.targets = targets; - } - - public IEnumerable GetCommandTargets () - { - return targets; - } - } - - internal object GetDelegatedCommandTarget () - { - // If a node is being edited, don't delegate commands to the - // node builders, since what's selected is not the node, - // but the node label. In this way commands such as Delete - // will be handled by the node Entry. - if (editingText) - return null; - - List targets = new List (); - - foreach (SelectionGroup grp in GetSelectedNodesGrouped ()) { - NodeBuilder[] chain = grp.BuilderChain; - if (chain.Length > 0) { - ITreeNavigator[] nodes = grp.Nodes.ToArray (); - NodeCommandTargetChain targetChain = null; - NodeCommandTargetChain lastNode = null; - foreach (NodeBuilder nb in chain) { - NodeCommandTargetChain newNode = new NodeCommandTargetChain (nb.CommandHandler, nodes); - if (lastNode == null) - targetChain = lastNode = newNode; - else { - lastNode.Next = newNode; - lastNode = newNode; - } - } - - if (targetChain != null) - targets.Add (targetChain); - } - } - if (targets.Count == 1) - return targets[0]; - else if (targets.Count > 1) - return new MulticastNodeRouter (targets); - else - return null; - } - - void ExpandCurrentItem () - { - try { - LockUpdates (); - - IEnumerable nodeGroups = GetSelectedNodesGrouped (); - if (nodeGroups.Count () == 1) { - SelectionGroup grp = nodeGroups.First (); - - if (grp.Nodes.Count () == 1) { - ITreeNavigator node = grp.Nodes.First (); - if (node.Expanded) { - grp.SavePositions (); - node.Selected = false; - if (node.MoveToFirstChild ()) - node.Selected = true; - - // This exit statement is so that it doesn't do 2 actions at a time. - // As in, navigate, then expand. - return; - } - } - } - - foreach (SelectionGroup grp in nodeGroups) { - grp.SavePositions (); - - foreach (var node in grp.Nodes) { - node.Expanded = true; - } - } - } finally { - UnlockUpdates (); - } - } - - void CollapseCurrentItem () - { - try { - LockUpdates (); - - IEnumerable nodeGroups = GetSelectedNodesGrouped (); - if (nodeGroups.Count () == 1) { - SelectionGroup grp = nodeGroups.First (); - - if (grp.Nodes.Count () == 1) - { - ITreeNavigator node = grp.Nodes.First (); - if (!node.HasChildren () || !node.Expanded) { - grp.SavePositions (); - node.Selected = false; - if (node.MoveToParent ()) - node.Selected = true; - - // This exit statement is so that it doesn't do 2 actions at a time. - // As in, navigate, then collapse. - return; - } - } - } - - foreach (SelectionGroup grp in nodeGroups) { - grp.SavePositions (); - - foreach (var node in grp.Nodes) { - node.Expanded = false; - } - } - } finally { - UnlockUpdates (); - } - } - - [CommandHandler (ViewCommands.Open)] - public void ActivateCurrentItem () - { - OnActivateCurrentItem (); - } - - protected virtual void OnActivateCurrentItem () - { - try { - LockUpdates (); - foreach (SelectionGroup grp in GetSelectedNodesGrouped ()) { - grp.SavePositions (); - foreach (NodeBuilder b in grp.BuilderChain) { - NodeCommandHandler handler = b.CommandHandler; - handler.SetCurrentNodes (grp.Nodes.ToArray ()); - handler.ActivateMultipleItems (); - if (!grp.RestorePositions ()) - break; - } - } - OnCurrentItemActivated (); - } finally { - UnlockUpdates (); - } - } - - public void DeleteCurrentItem () - { - OnDeleteCurrentItem (); - } - - protected virtual void OnDeleteCurrentItem () - { - try { - LockUpdates (); - foreach (SelectionGroup grp in GetSelectedNodesGrouped ()) { - NodeBuilder[] chain = grp.BuilderChain; - grp.SavePositions (); - foreach (NodeBuilder b in chain) { - NodeCommandHandler handler = b.CommandHandler; - handler.SetCurrentNodes (grp.Nodes.ToArray ()); - if (handler.CanDeleteMultipleItems ()) { - if (!grp.RestorePositions ()) - return; - handler.DeleteMultipleItems (); - // FIXME: fixes bug #396566, but it is not 100% correct - // It can only be fully fixed if updates to the tree are delayed - break; - } - if (!grp.RestorePositions ()) - return; - } - } - } finally { - UnlockUpdates (); - } - } - - protected virtual bool CanDeleteCurrentItem () - { - foreach (SelectionGroup grp in GetSelectedNodesGrouped ()) { - NodeBuilder[] chain = grp.BuilderChain; - grp.SavePositions (); - foreach (NodeBuilder b in chain) { - NodeCommandHandler handler = b.CommandHandler; - handler.SetCurrentNodes (grp.Nodes.ToArray ()); - if (handler.CanDeleteMultipleItems ()) - return true; - if (!grp.RestorePositions ()) - return false; - } - } - return false; - } - - [CommandHandler (ViewCommands.RefreshTree)] - public void RefreshCurrentItem () - { - OnRefreshCurrentItem (); - } - - protected virtual void OnRefreshCurrentItem () - { - try { - LockUpdates (); - foreach (SelectionGroup grp in GetSelectedNodesGrouped ()) { - NodeBuilder[] chain = grp.BuilderChain; - grp.SavePositions (); - foreach (NodeBuilder b in chain) { - NodeCommandHandler handler = b.CommandHandler; - handler.SetCurrentNodes (grp.Nodes.ToArray ()); - if (!grp.RestorePositions ()) - return; - handler.RefreshMultipleItems (); - if (!grp.RestorePositions ()) - return; - } - } - } finally { - UnlockUpdates (); - } - RefreshTree (); - } - - protected virtual void OnCurrentItemActivated () - { - if (CurrentItemActivated != null) - CurrentItemActivated (this, EventArgs.Empty); - } - - public event EventHandler CurrentItemActivated; - - #region Zoom - - const double ZOOM_FACTOR = 1.1f; - const int ZOOM_MIN_POW = -4; - const int ZOOM_MAX_POW = 8; - static readonly double ZOOM_MIN = System.Math.Pow (ZOOM_FACTOR, ZOOM_MIN_POW); - static readonly double ZOOM_MAX = System.Math.Pow (ZOOM_FACTOR, ZOOM_MAX_POW); - double zoom; - - public double Zoom { - get { - return zoom; - } - set { - value = System.Math.Min (ZOOM_MAX, System.Math.Max (ZOOM_MIN, value)); - if (value > ZOOM_MAX || value < ZOOM_MIN) - return; - //snap to one, if within 0.001d - if ((System.Math.Abs (value - 1d)) < 0.001d) { - value = 1d; - } - if (zoom != value) { - zoom = value; - OnZoomChanged (value); - } - } - } - - void OnZoomChanged (double value) - { - pix_render.Zoom = value; - text_render.Zoom = value; - - int expanderSize = (int) (12 * Zoom); - if (expanderSize < 3) expanderSize = 3; - if (expanderSize > 15) expanderSize = 15; - if (expanderSize != 12) - tree.Name = "MonoDevelop.ExtensibleTreeView_" + expanderSize; - else - tree.Name = ""; - tree.ColumnsAutosize (); - if (!string.IsNullOrEmpty (Id)) { - PropertyService.Set ("MonoDevelop.Ide.ExtensibleTreeView.Zoom." + Id, Zoom); - } - } - - [CommandHandler (ViewCommands.ZoomIn)] - public void ZoomIn () - { - int oldPow = (int)System.Math.Round (System.Math.Log (zoom) / System.Math.Log (ZOOM_FACTOR)); - Zoom = System.Math.Pow (ZOOM_FACTOR, oldPow + 1); - } - - [CommandHandler (ViewCommands.ZoomOut)] - public void ZoomOut () - { - int oldPow = (int)System.Math.Round (System.Math.Log (zoom) / System.Math.Log (ZOOM_FACTOR)); - Zoom = System.Math.Pow (ZOOM_FACTOR, oldPow - 1); - } - - [CommandHandler (ViewCommands.ZoomReset)] - public void ZoomReset () - { - Zoom = 1d; - } - - [CommandUpdateHandler (ViewCommands.ZoomIn)] - protected void UpdateZoomIn (CommandInfo cinfo) - { - cinfo.Enabled = zoom < ZOOM_MAX - 0.000001d; - } - - [CommandUpdateHandler (ViewCommands.ZoomOut)] - protected void UpdateZoomOut (CommandInfo cinfo) - { - cinfo.Enabled = zoom > ZOOM_MIN + 0.000001d; - } - - [CommandUpdateHandler (ViewCommands.ZoomReset)] - protected void UpdateZoomReset (CommandInfo cinfo) - { - cinfo.Enabled = zoom != 1d; - } - - #endregion Zoom - - [CommandHandler (EditCommands.Copy)] - public void CopyCurrentItem () - { - CancelTransfer (); - TransferCurrentItem (DragOperation.Copy); - } - - [CommandHandler (EditCommands.Cut)] - public void CutCurrentItem () - { - CancelTransfer (); - TransferCurrentItem (DragOperation.Move); - - if (copyObjects != null) { - foreach (object ob in copyObjects) { - ITreeBuilder tb = CreateBuilder (); - if (tb.MoveToObject (ob)) - tb.Update (); - } - } - } - - [CommandUpdateHandler (EditCommands.Copy)] - internal void UpdateCopyCurrentItem (CommandInfo info) - { - if (editingText) { - info.Bypass = true; - return; - } - info.Enabled = CanTransferCurrentItem (DragOperation.Copy); - } - - [CommandUpdateHandler (EditCommands.Cut)] - internal void UpdateCutCurrentItem (CommandInfo info) - { - if (editingText) { - info.Bypass = true; - return; - } - info.Enabled = CanTransferCurrentItem (DragOperation.Move); - } - - void TransferCurrentItem (DragOperation oper) - { - foreach (SelectionGroup grp in GetSelectedNodesGrouped ()) { - NodeBuilder[] chain = grp.BuilderChain; - grp.SavePositions (); - foreach (NodeBuilder b in chain) { - try { - NodeCommandHandler handler = b.CommandHandler; - handler.SetCurrentNodes (grp.Nodes.ToArray ()); - if ((handler.CanDragNode () & oper) != 0) { - grp.RestorePositions (); - copyObjects = grp.DataItems; - currentTransferOperation = oper; - break; - } - } catch (Exception ex) { - LoggingService.LogError (ex.ToString ()); - } - grp.RestorePositions (); - } - } - } - - bool CanTransferCurrentItem (DragOperation oper) - { - TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); - if (node != null) { - NodeBuilder[] chain = node.NodeBuilderChain; - NodePosition pos = node.CurrentPosition; - foreach (NodeBuilder b in chain) { - try { - NodeCommandHandler handler = b.CommandHandler; - handler.SetCurrentNode (node); - if ((handler.CanDragNode () & oper) != 0) - return true; - } catch (Exception ex) { - LoggingService.LogError (ex.ToString ()); - } - node.MoveToPosition (pos); - } - } - return false; - } - - [CommandHandler (EditCommands.Paste)] - public void PasteToCurrentItem () - { - if (copyObjects == null) return; - - try { - LockUpdates (); - TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); - if (node != null) { - NodeBuilder[] chain = node.NodeBuilderChain; - NodePosition pos = node.CurrentPosition; - foreach (NodeBuilder b in chain) { - NodeCommandHandler handler = b.CommandHandler; - handler.SetCurrentNode (node); - if (handler.CanDropMultipleNodes (copyObjects, currentTransferOperation, DropPosition.Into)) { - node.MoveToPosition (pos); - handler.OnMultipleNodeDrop (copyObjects, currentTransferOperation, DropPosition.Into); - } - node.MoveToPosition (pos); - } - } - if (currentTransferOperation == DragOperation.Move) - CancelTransfer (); - } finally { - UnlockUpdates (); - } - } - - [CommandUpdateHandler (EditCommands.Paste)] - internal void UpdatePasteToCurrentItem (CommandInfo info) - { - if (editingText) { - info.Bypass = true; - return; - } - - if (copyObjects != null) { - TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); - if (node != null) { - NodeBuilder[] chain = node.NodeBuilderChain; - NodePosition pos = node.CurrentPosition; - foreach (NodeBuilder b in chain) { - NodeCommandHandler handler = b.CommandHandler; - handler.SetCurrentNode (node); - if (handler.CanDropMultipleNodes (copyObjects, currentTransferOperation, DropPosition.Into)) { - info.Enabled = true; - return; - } - node.MoveToPosition (pos); - } - } - } - info.Enabled = false; - } - - void CancelTransfer () - { - if (copyObjects != null) { - object[] oldCopyObjects = copyObjects; - copyObjects = null; - if (currentTransferOperation == DragOperation.Move) { - foreach (object ob in oldCopyObjects) { - ITreeBuilder tb = CreateBuilder (); - if (tb.MoveToObject (ob)) - tb.Update (); - } - } - } - } - - NodeInfo GetNodeInfo (Gtk.TreeIter it) - { - return (NodeInfo)store.GetValue (it, NodeInfoColumn); - } - - void StartLabelEditInternal() - { - if (editingText) - return; - - TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); - if (node == null) - return; - - Gtk.TreeIter iter = node.CurrentPosition._iter; - object dataObject = node.DataItem; - NodeAttributes attributes = NodeAttributes.None; - - ITreeNavigator parentNode = node.Clone (); - parentNode.MoveToParent (); - NodePosition pos = parentNode.CurrentPosition; - - foreach (NodeBuilder b in node.NodeBuilderChain) { - try { - b.GetNodeAttributes (parentNode, dataObject, ref attributes); - } catch (Exception ex) { - LoggingService.LogError (ex.ToString ()); - } - parentNode.MoveToPosition (pos); - } - - if ((attributes & NodeAttributes.AllowRename) == 0) - return; - - node.ExpandToNode (); //make sure the parent of the node that is being edited is expanded - - string editText = node.NodeName; - - // Get and validate the initial text selection - int editTextLength = editText != null ? editText.Length : 0, - selectionStart = 0, selectionLength = editTextLength; - - foreach (NodeBuilder b in node.NodeBuilderChain) { - try { - NodeCommandHandler handler = b.CommandHandler; - handler.SetCurrentNode(node); - handler.OnRenameStarting(ref editText, ref selectionStart, ref selectionLength); - } catch (Exception ex) { - LoggingService.LogError (ex.ToString ()); - } - } - - editTextLength = editText != null ? editText.Length : 0; - - GetNodeInfo (iter).Label = GLib.Markup.EscapeText (editText); - store.EmitRowChanged (store.GetPath (iter), iter); - - if (selectionStart < 0 || selectionStart >= editTextLength) - selectionStart = 0; - if (selectionStart + selectionLength > editTextLength) - selectionLength = editTextLength - selectionStart; - // This will apply the selection as soon as possible - GLib.Idle.Add (() => { - var editable = currentLabelEditable; - if (editable == null) - return false; - - editable.SelectRegion (selectionStart, selectionStart + selectionLength); - return false; - }); - // Ensure we set all our state variables before calling SetCursor - // as this may directly invoke HandleOnEditCancelled - text_render.Editable = true; - editingText = true; - tree.SetCursor (store.GetPath (iter), complete_column, true); - } - - Gtk.Editable currentLabelEditable; - void HandleEditingStarted (object o, Gtk.EditingStartedArgs e) - { - currentLabelEditable = e.Editable as Gtk.Entry; - } - - void HandleOnEdit (object o, Gtk.EditedArgs e) - { - try { - editingText = false; - text_render.Editable = false; - currentLabelEditable = null; - - Gtk.TreeIter iter; - if (!store.GetIterFromString (out iter, e.Path)) - throw new Exception("Error calculating iter for path " + e.Path); - - if (e.NewText != null && e.NewText.Length > 0) { - ITreeNavigator nav = new TreeNodeNavigator (this, iter); - NodePosition pos = nav.CurrentPosition; - - try { - LockUpdates (); - NodeBuilder[] chain = (NodeBuilder[]) store.GetValue (iter, BuilderChainColumn); - foreach (NodeBuilder b in chain) { - try { - NodeCommandHandler handler = b.CommandHandler; - handler.SetCurrentNode (nav); - handler.RenameItem (e.NewText); - } catch (Exception ex) { - LoggingService.LogInternalError (ex); - } - nav.MoveToPosition (pos); - } - } finally { - UnlockUpdates (); - } - } - - // Get the iter again since the this node may have been replaced. - if (!store.GetIterFromString (out iter, e.Path)) - return; - - ITreeBuilder builder = CreateBuilder (iter); - builder.Update (); - } - catch (Exception ex) { - LoggingService.LogInternalError ("The item could not be renamed", ex); - } - } - - void HandleOnEditCancelled (object s, EventArgs args) - { - editingText = false; - text_render.Editable = false; - currentLabelEditable = null; - - TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); - if (node == null) - return; - - // Restore the original node label - Gtk.TreeIter iter = node.CurrentPosition._iter; - ITreeBuilder builder = CreateBuilder (iter); - builder.Update (); - } - - public NodeState SaveTreeState () - { - ITreeNavigator root = GetRootNode (); - if (root == null) - return null; - - var rootState = NodeState.CreateRoot (); - List children = new List (); - rootState.ChildrenState = children; - - var s = new Dictionary (); - foreach (TreePadOption opt in options) { - bool val; - if (globalOptions.TryGetValue (opt.Id, out val) && val != opt.DefaultValue) - s [opt.Id] = val; - } - if (s.Count != 0) - rootState.Options = s; - - do { - rootState.ChildrenState.Add (root.SaveState ()); - } while (root.MoveNext ()); - - return rootState; - } - - public void RestoreTreeState (NodeState state) - { - if (state == null) - return; - - ITreeNavigator nav = GetRootNode (); - if (nav == null) - return; - - if (state.IsRoot) { - if (state.ChildrenState != null) { - var pos = nav.CurrentPosition; - foreach (NodeState ces in state.ChildrenState) { - do { - if (nav.NodeName == ces.NodeName) { - nav.RestoreState (ces); - break; - } - } while (nav.MoveNext ()); - nav.MoveToPosition (pos); - } - } - } else - nav.RestoreState (state); - - globalOptions = new TreeOptions (); - foreach (TreePadOption opt in options) { - bool val = false; - if (state.Options == null || !state.Options.TryGetValue (opt.Id, out val)) - val = opt.DefaultValue; - globalOptions[opt.Id] = val; - } - globalOptions.Pad = this; - RefreshTree (); - } - - TypeNodeBuilder GetTypeNodeBuilder (Type type) - { - NodeBuilder[] chain = GetBuilderChain (type); - if (chain == null) return null; - return (TypeNodeBuilder) chain [0]; - } - - internal NodeBuilder[] GetBuilderChain (Type type) - { - NodeBuilder[] chain; - builderChains.TryGetValue (type, out chain); - if (chain == null) { - List list = new List (); - - // Find the most specific node builder type. - TypeNodeBuilder bestTypeNodeBuilder = null; - Type bestNodeType = null; - - foreach (NodeBuilder nb in builders) { - if (nb is TypeNodeBuilder) { - TypeNodeBuilder tnb = (TypeNodeBuilder) nb; - if (tnb.NodeDataType.IsAssignableFrom (type)) { - if (bestNodeType == null || bestNodeType.IsAssignableFrom (tnb.NodeDataType)) { - bestNodeType = tnb.NodeDataType; - bestTypeNodeBuilder = tnb; - } - } - } else { - try { - if (((NodeBuilderExtension)nb).CanBuildNode (type)) - list.Add (nb); - } catch (Exception ex) { - LoggingService.LogError (ex.ToString ()); - } - } - } - - if (bestTypeNodeBuilder != null) { - list.Insert (0, bestTypeNodeBuilder); - chain = list.ToArray (); - } else - chain = null; - - builderChains [type] = chain; - } - return chain; - } - - TypeNodeBuilder GetTypeNodeBuilder (Gtk.TreeIter iter) - { - NodeBuilder[] chain = (NodeBuilder[]) store.GetValue (iter, ExtensibleTreeView.BuilderChainColumn); - if (chain != null && chain.Length > 0) - return chain[0] as TypeNodeBuilder; - return null; - } - - internal int CompareNodes (Gtk.TreeModel model, Gtk.TreeIter a, Gtk.TreeIter b) - { - sorting = true; - try { - NodeBuilder[] chain1 = (NodeBuilder[]) store.GetValue (a, BuilderChainColumn); - if (chain1 == null) return -1; - - NodeBuilder [] chain2 = (NodeBuilder [])store.GetValue (b, BuilderChainColumn); - if (chain2 == null) return 1; - - compareNode1.MoveToIter (a); - compareNode2.MoveToIter (b); - - var i1 = GetSortIndex (chain1, compareNode1); - var i2 = GetSortIndex (chain2, compareNode2); - - if (i1 < i2) - return -1; - else if (i1 > i2) - return 1; - - int sort = CompareObjects (chain1, compareNode1, compareNode2); - if (sort != TypeNodeBuilder.DefaultSort) return sort; - - if (chain1 != chain2) { - sort = CompareObjects (chain2, compareNode2, compareNode1); - if (sort != TypeNodeBuilder.DefaultSort) return sort * -1; - } - - TypeNodeBuilder tb1 = (TypeNodeBuilder) chain1[0]; - TypeNodeBuilder tb2 = (TypeNodeBuilder) chain2[0]; - object o1 = store.GetValue (a, DataItemColumn); - object o2 = store.GetValue (b, DataItemColumn); - return string.Compare (tb1.GetNodeName (compareNode1, o1), tb2.GetNodeName (compareNode2, o2), true); - } finally { - sorting = false; - compareNode1.MoveToIter (Gtk.TreeIter.Zero); - compareNode2.MoveToIter (Gtk.TreeIter.Zero); - } - } - - int CompareObjects (NodeBuilder[] chain, ITreeNavigator thisNode, ITreeNavigator otherNode) - { - int result = NodeBuilder.DefaultSort; - for (int n=0; n (copyObjects); - list.RemoveAt (i); - if (list.Count > 0) - copyObjects = list.ToArray (); - else - copyObjects = null; - } - } - - // Remove object from drag list - - if (tree.dragObjects != null) { - int i = Array.IndexOf (tree.dragObjects, dataObject); - if (i != -1) { - var list = new List (tree.dragObjects); - list.RemoveAt (i); - if (list.Count > 0) - tree.dragObjects = list.ToArray (); - else - tree.dragObjects = null; - } - } - - object currentIt; - nodeHash.TryGetValue (dataObject, out currentIt); - if (currentIt is Gtk.TreeIter[]) { - Gtk.TreeIter[] arr = (Gtk.TreeIter[]) currentIt; - Gtk.TreePath path = null; - List iters = new List (); - if (store.IterIsValid (iter)) - path = store.GetPath (iter); - - // Iters can't be directly compared (TreeIter.Equals is broken), so we have - // to compare paths. - foreach (Gtk.TreeIter it in arr) { - if (store.IterIsValid (it) && (path == null || !path.Equals (store.GetPath (it)))) - iters.Add (it); - } - if (iters.Count > 1) - nodeHash [dataObject] = iters.ToArray (); - else if (iters.Count == 1) - nodeHash [dataObject] = iters[0]; - else - nodeHash.Remove (dataObject); - } else { - nodeHash.Remove (dataObject); - if (fireRemovedEvent) - NotifyNodeRemoved (dataObject, chain); - } - } - - internal void RemoveChildren (Gtk.TreeIter it) - { - Gtk.TreeIter child; - while (store.IterChildren (out child, it)) { - RemoveChildren (child); - object childData = store.GetValue (child, ExtensibleTreeView.DataItemColumn); - if (childData != null) - UnregisterNode (childData, child, null, true); - store.Remove (ref child); - } - } - - void NotifyNodeRemoved (object dataObject, NodeBuilder[] chain) - { - if (chain == null) - chain = GetBuilderChain (dataObject.GetType()); - foreach (NodeBuilder nb in chain) { - try { - nb.OnNodeRemoved (dataObject); - } catch (Exception ex) { - LoggingService.LogError (ex.ToString ()); - } - } - } - - internal bool IsRegistered (object dataObject) - { - return nodeHash.ContainsKey (dataObject); - } - - internal void NotifyInserted (Gtk.TreeIter it, object dataObject) - { - if (callbacks.Count > 0) { - if (callbacks.TryGetValue (dataObject, out var list)) { - ITreeNavigator nav = new TreeNodeNavigator (this, it); - NodePosition pos = nav.CurrentPosition; - foreach (TreeNodeCallback callback in list) { - callback (nav); - nav.MoveToPosition (pos); - } - callbacks.Remove (dataObject); - } - } - } - - internal string GetNamePathFromIter (Gtk.TreeIter iter) - { - workNode.MoveToIter (iter); - StringBuilder sb = new StringBuilder (); - do { - string name = workNode.NodeName; - if (sb.Length > 0) sb.Insert (0, '/'); - name = name.Replace ("%","%%"); - name = name.Replace ("/","_%_"); - sb.Insert (0, name); - } while (workNode.MoveToParent ()); - - workNode.MoveToIter (Gtk.TreeIter.Zero); - - return sb.ToString (); - } - - void RefreshNode (Gtk.TreeIter iter) - { - ITreeBuilder builder = CreateBuilder (iter); - builder.UpdateAll (); - } - - public void RefreshNode (ITreeNavigator nav) - { - RefreshNode (nav.CurrentPosition._iter); - } - - internal void ResetState (ITreeNavigator nav) - { - if (nav is TreeBuilder) - ((TreeBuilder)nav).ResetState (); - else if (nav is TransactedTreeBuilder) - ((TransactedTreeBuilder)nav).ResetState (); - else { - ITreeBuilder builder = CreateBuilder (nav.CurrentPosition._iter); - ResetState (builder); - } - } - - internal bool GetIterFromNamePath (string path, out Gtk.TreeIter iter) - { - if (!store.GetIterFirst (out iter)) - return false; - - TreeNodeNavigator nav = new TreeNodeNavigator (this, iter); - string[] names = path.Split ('/'); - - int n = 0; - bool more; - do { - string name = names [n].Replace ("_%_","/"); - name = name.Replace ("%%","%"); - - if (nav.NodeName == name) { - iter = nav.CurrentPosition._iter; - if (++n == names.Length) return true; - more = nav.MoveToFirstChild (); - } else - more = nav.MoveNext (); - } while (more); - - return false; - } - - /// - /// If you want to edit a node label. Select the node you want to edit and then - /// call this method, instead of using the LabelEdit Property and the BeginEdit - /// Method directly. - /// - [CommandHandler (EditCommands.Rename)] - public void StartLabelEdit () - { - GLib.Timeout.Add (20, new GLib.TimeoutHandler (wantFocus)); - } - - [CommandUpdateHandler (EditCommands.Rename)] - internal void UpdateStartLabelEdit (CommandInfo info) - { - if (editingText || GetSelectedNodes ().Length != 1) { - info.Visible = false; - return; - } - - TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); - NodeAttributes attributes = GetNodeAttributes (node); - if ((attributes & NodeAttributes.AllowRename) == 0) { - info.Visible = false; - return; - } - } - - NodeAttributes GetNodeAttributes (TreeNodeNavigator node) - { - object dataObject = node.DataItem; - NodeAttributes attributes = NodeAttributes.None; - - ITreeNavigator parentNode = node.Clone (); - parentNode.MoveToParent (); - NodePosition pos = parentNode.CurrentPosition; - - foreach (NodeBuilder b in node.NodeBuilderChain) { - try { - b.GetNodeAttributes (parentNode, dataObject, ref attributes); - } catch (Exception ex) { - LoggingService.LogError (ex.ToString ()); - } - parentNode.MoveToPosition (pos); - } - return attributes; - } - - - bool wantFocus () - { - tree.GrabFocus (); - StartLabelEditInternal (); - return false; - } - - private void OnTestExpandRow (object sender, Gtk.TestExpandRowArgs args) - { - bool filled = (bool) store.GetValue (args.Iter, FilledColumn); - if (!filled) { - TreeBuilder nb = new TreeBuilder (this, args.Iter); - args.RetVal = !nb.FillNode (); - } else - args.RetVal = false; - } - - void ShowPopup (Gdk.EventButton evt) - { - var entryset = BuildEntrySet (); - if (entryset == null) - return; - - tree.ShowContextMenu (evt, entryset, this); - } - - CommandEntrySet BuildEntrySet () - { - ITreeNavigator tnav = GetSelectedNode (); - if (tnav == null) - return null; - TypeNodeBuilder nb = GetTypeNodeBuilder (tnav.CurrentPosition._iter); - string menuPath = nb != null && nb.ContextMenuAddinPath != null ? nb.ContextMenuAddinPath : contextMenuPath; - if (menuPath == null) { - if (options.Length > 0) { - CommandEntrySet opset = new CommandEntrySet (); - opset.AddItem (ViewCommands.TreeDisplayOptionList); - opset.AddItem (Command.Separator); - opset.AddItem (ViewCommands.ResetTreeDisplayOptions); - return opset; - } - return null; - } else { - ExtensionContext ctx = AddinManager.CreateExtensionContext (); - ctx.RegisterCondition ("ItemType", new ItemTypeCondition (tnav.DataItem.GetType (), contextMenuTypeNameAliases)); - if (tnav.DataItem is MonoDevelop.Projects.IFileItem fileItem) { - var fileTypeCondition = new FileTypeCondition (); +using MonoDevelop.Ide.Gui.Pads; +using MonoDevelop.Projects.Extensions; + +namespace MonoDevelop.Ide.Gui.Components +{ + public partial class ExtensibleTreeView : Control, ICommandRouter + { + internal const int NodeInfoColumn = 0; + internal const int DataItemColumn = 1; + internal const int BuilderChainColumn = 2; + internal const int FilledColumn = 3; + internal const int ShowPopupColumn = 4; + + NodeBuilder[] builders; + Dictionary builderChains = new Dictionary (); + NodeHashtable nodeHash = new NodeHashtable (); + + ExtensibleTreeViewWidget widget; + ExtensibleTreeViewTree tree; + Gtk.TreeStore store; + Gtk.TreeViewColumn complete_column; + ZoomableCellRendererPixbuf pix_render; + CustomCellRendererText text_render; + TreeBuilderContext builderContext; + Dictionary> callbacks = new Dictionary> (); + bool editingText = false; + + TreePadOption[] options; + TreeOptions globalOptions; + + TreeNodeNavigator workNode; + TreeNodeNavigator compareNode1; + TreeNodeNavigator compareNode2; + + internal bool sorting; + + object[] copyObjects; + DragOperation currentTransferOperation; + + TransactedNodeStore transactionStore; + int updateLockCount; + string contextMenuPath; + IDictionary contextMenuTypeNameAliases; + + public IDictionary ContextMenuTypeNameAliases { + get { return contextMenuTypeNameAliases; } + set { contextMenuTypeNameAliases = value; } + } + + internal Gtk.TreeStore Store { + get { + return this.store; + } + } + + internal Gtk.TreeView Tree { + get { + return tree; + } + } + + public event EventHandler SelectionChanged; + + public bool AllowsMultipleSelection { + get { + return Tree.Selection.Mode == Gtk.SelectionMode.Multiple; + } + set { + if (value) + Tree.Selection.Mode = Gtk.SelectionMode.Multiple; + else + Tree.Selection.Mode = Gtk.SelectionMode.Single; + } + } + + public string Id { get; set; } + + + class ExtensibleTreeViewWidget : CompactScrolledWindow, ICommandRouter + { + ExtensibleTreeView control; + + public ExtensibleTreeViewWidget (ExtensibleTreeView control) + { + this.control = control; + ShadowType = Gtk.ShadowType.None; + ShowBorderLine = false; + } + + protected override void OnStyleSet (Gtk.Style previous_style) + { + base.OnStyleSet (previous_style); + control.UpdateFont (); + } + + protected override bool OnScrollEvent (Gdk.EventScroll evnt) + { + control.HideStatusMessage (); + var modifier = !Platform.IsMac? Gdk.ModifierType.ControlMask + //Mac window manager already uses control-scroll, so use command + //Command might be either meta or mod1, depending on GTK version + : (Gdk.ModifierType.MetaMask | Gdk.ModifierType.Mod1Mask); + + if ((evnt.State & modifier) !=0) { + if (evnt.Direction == Gdk.ScrollDirection.Up) + control.ZoomIn (); + else if (evnt.Direction == Gdk.ScrollDirection.Down) + control.ZoomOut (); + + return true; + } + return base.OnScrollEvent (evnt); + } + + protected override void OnDestroyed () + { + control.Destroy (); + base.OnDestroyed (); + } + + public object GetNextCommandTarget () + { + return control; + } + } + + protected override object CreateNativeWidget () + { + return widget; + } + + public ExtensibleTreeView () + { + widget = new ExtensibleTreeViewWidget (this); + tree = new ExtensibleTreeViewTree (this); + } + + public ExtensibleTreeView (NodeBuilder[] builders, TreePadOption[] options) : this () + { + Initialize (builders, options); + } + + void CustomFontPropertyChanged (object sender, EventArgs a) + { + UpdateFont (); + } + + void UpdateFont () + { + text_render.CustomFont = IdeApp.Preferences.CustomPadFont ?? tree.Style.FontDescription; + tree.ColumnsAutosize (); + } + + public void Initialize (NodeBuilder [] builders, TreePadOption [] options, string contextMenuPath = null) + { + OnInitialize (builders, options, contextMenuPath); + } + + protected virtual void OnInitialize (NodeBuilder[] builders, TreePadOption[] options, string contextMenuPath) + { + this.contextMenuPath = contextMenuPath; + builderContext = new TreeBuilderContext (this); + + SetBuilders (builders, options); + + store = new Gtk.TreeStore (typeof(NodeInfo), typeof(object), typeof(object), typeof(bool), typeof(bool)); + tree.Model = store; + tree.Selection.Mode = Gtk.SelectionMode.Multiple; + + store.DefaultSortFunc = new Gtk.TreeIterCompareFunc (CompareNodes); + store.SetSortColumnId (/* GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID */ -1, Gtk.SortType.Ascending); + + tree.HeadersVisible = false; + tree.EnableSearch = false; + complete_column = new Gtk.TreeViewColumn (); + complete_column.Title = "column"; + + pix_render = new ZoomableCellRendererPixbuf (); + pix_render.Xpad = 0; + complete_column.PackStart (pix_render, false); + + text_render = new CustomCellRendererText (this); + text_render.Ypad = 0; + IdeApp.Preferences.CustomPadFont.Changed += CustomFontPropertyChanged; + text_render.EditingStarted += HandleEditingStarted; + text_render.Edited += HandleOnEdit; + text_render.EditingCanceled += HandleOnEditCancelled; + complete_column.PackStart (text_render, true); + + complete_column.SetCellDataFunc (pix_render, SetIconCellData); + complete_column.SetCellDataFunc (text_render, SetTextCellData); + + tree.AppendColumn (complete_column); + + tree.TestExpandRow += OnTestExpandRow; + tree.RowActivated += OnNodeActivated; + tree.DoPopupMenu += ShowPopup; + + // Add an extra action handler to the tree to handle Press actions + var actionHandler = tree.ActionHandler; + actionHandler.PerformPress += OnPerformPress; + + workNode = new TreeNodeNavigator (this); + compareNode1 = new TreeNodeNavigator (this); + compareNode2 = new TreeNodeNavigator (this); + + tree.CursorChanged += OnSelectionChanged; + tree.KeyPressEvent += OnKeyPress; + tree.MotionNotifyEvent += HandleMotionNotifyEvent; + tree.LeaveNotifyEvent += HandleLeaveNotifyEvent; + + if (GtkGestures.IsSupported) { + tree.AddGestureMagnifyHandler ((sender, args) => { + Zoom += Zoom * (args.Magnification / 4d); + }); + } + + for (int n=3; n<16; n++) { + Gtk.Rc.ParseString ("style \"MonoDevelop.ExtensibleTreeView_" + n + "\" {\n GtkTreeView::expander-size = " + n + "\n }\n"); + Gtk.Rc.ParseString ("widget \"*.MonoDevelop.ExtensibleTreeView_" + n + "\" style \"MonoDevelop.ExtensibleTreeView_" + n + "\"\n"); + } + + if (!string.IsNullOrEmpty (Id)) + Zoom = PropertyService.Get ("MonoDevelop.Ide.ExtensibleTreeView.Zoom." + Id, 1d); + else + Zoom = 1d; + + widget.Add (tree); + widget.ShowAll (); + +#if TREE_VERIFY_INTEGRITY + GLib.Timeout.Add (3000, Checker); +#endif + } +#if TREE_VERIFY_INTEGRITY + // Verifies the consistency of the tree view. Disabled by default + HashSet ochecked = new HashSet (); + bool Checker () + { + int nodes = 0; + foreach (DictionaryEntry e in nodeHash) { + if (e.Value is Gtk.TreeIter) { + nodes++; + if (!store.IterIsValid ((Gtk.TreeIter)e.Value) && ochecked.Add (e.Key)) { + Console.WriteLine ("Found invalid iter in tree pad - Object: " + e.Key); + MessageService.ShowError ("Found invalid iter in tree pad", "Object: " + e.Key); + } + } else { + Gtk.TreeIter[] iters = (Gtk.TreeIter[]) e.Value; + for (int n=0; n builders = new List (); + foreach (NodeBuilder nb in buildersArray) { + if (!(nb is TreeViewItemBuilder)) + builders.Add (nb); + } + builders.Add (new TreeViewItemBuilder ()); + + this.options = options; + globalOptions = new TreeOptions (); + foreach (TreePadOption op in options) + globalOptions [op.Id] = op.DefaultValue; + globalOptions.Pad = this; + + // Check that there is only one TypeNodeBuilder per type + + Hashtable bc = new Hashtable (); + foreach (NodeBuilder nb in builders) { + TypeNodeBuilder tnb = nb as TypeNodeBuilder; + if (tnb != null) { + if (tnb.UseReferenceEquality) + nodeHash.RegisterByRefType (tnb.NodeDataType); + TypeNodeBuilder other = (TypeNodeBuilder) bc [tnb.NodeDataType]; + if (other != null) + throw new ApplicationException (string.Format ("The type node builder {0} can't be used in this context because the type {1} is already handled by {2}", nb.GetType(), tnb.NodeDataType, other.GetType())); + bc [tnb.NodeDataType] = tnb; + } + else if (!(nb is NodeBuilderExtension)) + throw new InvalidOperationException (string.Format ("Invalid NodeBuilder type: {0}. NodeBuilders must inherit either from TypeNodeBuilder or NodeBuilderExtension", nb.GetType())); + } + + NodeBuilders = builders.ToArray (); + + foreach (NodeBuilder nb in builders) + nb.SetContext (builderContext); + } + + public void EnableDragUriSource (Func nodeToUri) + { + tree.EnableDragUriSource (nodeToUri); + } + + object[] GetDragObjects (out Xwt.Drawing.Image icon) + { + ITreeNavigator[] navs = GetSelectedNodes (); + if (navs.Length == 0) { + icon = null; + return null; + } + var dragObjects = new object [navs.Length]; + for (int n=0; n= rect.X && cx <= rect.Right) { + tree.ConvertBinWindowToWidgetCoords (rect.X, rect.Y, out rect.X, out rect.Y); + ShowStatusMessage (it, rect, info); + popupShown = true; + } + } + } + } + if (!popupShown) + HideStatusMessage (); + } + + bool statusMessageVisible; + Gtk.TreeIter statusIconIter; + TooltipPopoverWindow statusPopover; + + void ShowStatusMessage (Gtk.TreeIter it, Gdk.Rectangle rect, NodeInfo info) + { + if (statusMessageVisible && store.GetPath (it).Equals (store.GetPath (statusIconIter))) + return; + if (statusPopover != null) + statusPopover.Destroy (); + statusMessageVisible = true; + statusIconIter = it; + + statusPopover = TooltipPopoverWindow.Create (); + statusPopover.ShowArrow = true; + statusPopover.Text = info.StatusMessage; + statusPopover.Severity = info.StatusSeverity; + rect.Y += 2; + statusPopover.ShowPopup (this, rect, PopupPosition.Top); + } + + void HideStatusMessage () + { + if (statusMessageVisible) { + statusMessageVisible = false; + statusPopover.Destroy (); + statusPopover = null; + } + } + + [GLib.ConnectBefore] + void HandleLeaveNotifyEvent (object o, Gtk.LeaveNotifyEventArgs args) + { + HideStatusMessage (); + } + + internal void LockUpdates () + { + if (++updateLockCount == 1) + transactionStore = new TransactedNodeStore (this); + } + + internal void UnlockUpdates () + { + if (--updateLockCount == 0) { + TransactedNodeStore store = transactionStore; + transactionStore = null; + store.CommitChanges (); + } + } + + internal ITreeBuilder CreateBuilder () + { + return CreateBuilder (Gtk.TreeIter.Zero); + } + + internal ITreeBuilder CreateBuilder (Gtk.TreeIter it) + { + if (transactionStore != null) + return new TransactedTreeBuilder (this, transactionStore, it); + else + return new TreeBuilder (this, it); + } + + protected NodeBuilder[] NodeBuilders { + get { return builders; } + set { builders = value; } + } + + internal Gtk.TreeViewColumn CompleteColumn { + get { + return complete_column; + } + } + + NodeHashtable NodeHash { + get { + return nodeHash; + } + } + + internal ITreeBuilderContext BuilderContext { + get { + return builderContext; + } + } + + internal object[] CopyObjects { + get { + return copyObjects; + } + set { + copyObjects = value; + } + } + + internal DragOperation CurrentTransferOperation { + get { + return currentTransferOperation; + } + } + + public ITreeBuilder LoadTree (object nodeObject) + { + Clear (); + TreeBuilder builder = new TreeBuilder (this); + builder.AddChild (nodeObject, true); + builder.Expanded = true; + InitialSelection (); + return builder; + } + + public ITreeBuilder AddChild (object nodeObject) + { + return AddChild (nodeObject, true); + } + + public ITreeBuilder AddChild (object nodeObject, bool expanded) + { + TreeBuilder builder = new TreeBuilder (this); + builder.AddChild (nodeObject, true); + builder.Expanded = expanded; + InitialSelection (); + return builder; + } + + public void RemoveChild (object nodeObject) + { + TreeBuilder builder = new TreeBuilder (this); + if (builder.MoveToObject (nodeObject)) { + builder.Remove (); + InitialSelection (); + } + } + + void InitialSelection () + { + if (tree.Selection.CountSelectedRows () == 0) { + Gtk.TreeIter it; + if (store.GetIterFirst (out it)) { + tree.Selection.SelectIter (it); + tree.SetCursor (store.GetPath (it), tree.Columns [0], false); + } + } + } + + public void Clear () + { + copyObjects = tree.dragObjects = null; + + object[] obs = new object [nodeHash.Count]; + nodeHash.Keys.CopyTo (obs, 0); + + foreach (object dataObject in obs) + NotifyNodeRemoved (dataObject, null); + + nodeHash = new NodeHashtable (); + store.Clear (); + } + + public ITreeNavigator GetSelectedNode () + { + Gtk.TreePath[] sel = tree.Selection.GetSelectedRows (); + if (sel.Length == 0) + return null; + Gtk.TreeIter iter; + if (store.GetIter (out iter, sel[0])) + return new TreeNodeNavigator (this, iter); + else + return null; + } + + class SelectionGroup + { + public NodeBuilder[] BuilderChain; + public List Nodes; + public Gtk.TreeStore store; + + NodePosition[] savedPos; + object[] dataItems; + + public object[] DataItems { + get { + if (dataItems == null) { + dataItems = new object [Nodes.Count]; + for (int n=0; n GetSelectedNodesGrouped () + { + Gtk.TreePath[] paths = tree.Selection.GetSelectedRows (); + if (paths.Length == 0) { + return new SelectionGroup [0]; + } + if (paths.Length == 1) { + Gtk.TreeIter it; + store.GetIter (out it, paths [0]); + SelectionGroup grp = new SelectionGroup (); + TreeNodeNavigator nav = new TreeNodeNavigator (this, it); + grp.BuilderChain = nav.BuilderChain; + grp.Nodes = new List (); + grp.Nodes.Add (nav); + grp.store = store; + return new SelectionGroup [] { grp }; + } + + Dictionary dict = new Dictionary (); + for (int n=0; n (); + grp.store = store; + dict [nav.BuilderChain] = grp; + } + grp.Nodes.Add (nav); + } + return dict.Values; + } + + public bool MultipleNodesSelected () + { + return tree.Selection.GetSelectedRows ().Length > 1; + } + + public ITreeNavigator[] GetSelectedNodes () + { + Gtk.TreePath[] paths = tree.Selection.GetSelectedRows (); + ITreeNavigator [] navs = new ITreeNavigator [paths.Length]; + for (int n=0; n (); + list.Add (callback); + callbacks [dataObject] = list; + } + } + + internal new object GetNextCommandTarget () + { + return null; + } + + class MulticastNodeRouter: IMultiCastCommandRouter + { + List targets; + + public MulticastNodeRouter (List targets) + { + this.targets = targets; + } + + public IEnumerable GetCommandTargets () + { + return targets; + } + } + + internal object GetDelegatedCommandTarget () + { + // If a node is being edited, don't delegate commands to the + // node builders, since what's selected is not the node, + // but the node label. In this way commands such as Delete + // will be handled by the node Entry. + if (editingText) + return null; + + List targets = new List (); + + foreach (SelectionGroup grp in GetSelectedNodesGrouped ()) { + NodeBuilder[] chain = grp.BuilderChain; + if (chain.Length > 0) { + ITreeNavigator[] nodes = grp.Nodes.ToArray (); + NodeCommandTargetChain targetChain = null; + NodeCommandTargetChain lastNode = null; + foreach (NodeBuilder nb in chain) { + NodeCommandTargetChain newNode = new NodeCommandTargetChain (nb.CommandHandler, nodes); + if (lastNode == null) + targetChain = lastNode = newNode; + else { + lastNode.Next = newNode; + lastNode = newNode; + } + } + + if (targetChain != null) + targets.Add (targetChain); + } + } + if (targets.Count == 1) + return targets[0]; + else if (targets.Count > 1) + return new MulticastNodeRouter (targets); + else + return null; + } + + void ExpandCurrentItem () + { + try { + LockUpdates (); + + IEnumerable nodeGroups = GetSelectedNodesGrouped (); + if (nodeGroups.Count () == 1) { + SelectionGroup grp = nodeGroups.First (); + + if (grp.Nodes.Count () == 1) { + ITreeNavigator node = grp.Nodes.First (); + if (node.Expanded) { + grp.SavePositions (); + node.Selected = false; + if (node.MoveToFirstChild ()) + node.Selected = true; + + // This exit statement is so that it doesn't do 2 actions at a time. + // As in, navigate, then expand. + return; + } + } + } + + foreach (SelectionGroup grp in nodeGroups) { + grp.SavePositions (); + + foreach (var node in grp.Nodes) { + node.Expanded = true; + } + } + } finally { + UnlockUpdates (); + } + } + + void CollapseCurrentItem () + { + try { + LockUpdates (); + + IEnumerable nodeGroups = GetSelectedNodesGrouped (); + if (nodeGroups.Count () == 1) { + SelectionGroup grp = nodeGroups.First (); + + if (grp.Nodes.Count () == 1) + { + ITreeNavigator node = grp.Nodes.First (); + if (!node.HasChildren () || !node.Expanded) { + grp.SavePositions (); + node.Selected = false; + if (node.MoveToParent ()) + node.Selected = true; + + // This exit statement is so that it doesn't do 2 actions at a time. + // As in, navigate, then collapse. + return; + } + } + } + + foreach (SelectionGroup grp in nodeGroups) { + grp.SavePositions (); + + foreach (var node in grp.Nodes) { + node.Expanded = false; + } + } + } finally { + UnlockUpdates (); + } + } + + [CommandHandler (ViewCommands.Open)] + public void ActivateCurrentItem () + { + OnActivateCurrentItem (); + } + + protected virtual void OnActivateCurrentItem () + { + try { + LockUpdates (); + foreach (SelectionGroup grp in GetSelectedNodesGrouped ()) { + grp.SavePositions (); + foreach (NodeBuilder b in grp.BuilderChain) { + NodeCommandHandler handler = b.CommandHandler; + handler.SetCurrentNodes (grp.Nodes.ToArray ()); + handler.ActivateMultipleItems (); + if (!grp.RestorePositions ()) + break; + } + } + OnCurrentItemActivated (); + } finally { + UnlockUpdates (); + } + } + + public void DeleteCurrentItem () + { + OnDeleteCurrentItem (); + } + + protected virtual void OnDeleteCurrentItem () + { + try { + LockUpdates (); + foreach (SelectionGroup grp in GetSelectedNodesGrouped ()) { + NodeBuilder[] chain = grp.BuilderChain; + grp.SavePositions (); + foreach (NodeBuilder b in chain) { + NodeCommandHandler handler = b.CommandHandler; + handler.SetCurrentNodes (grp.Nodes.ToArray ()); + if (handler.CanDeleteMultipleItems ()) { + if (!grp.RestorePositions ()) + return; + handler.DeleteMultipleItems (); + // FIXME: fixes bug #396566, but it is not 100% correct + // It can only be fully fixed if updates to the tree are delayed + break; + } + if (!grp.RestorePositions ()) + return; + } + } + } finally { + UnlockUpdates (); + } + } + + protected virtual bool CanDeleteCurrentItem () + { + foreach (SelectionGroup grp in GetSelectedNodesGrouped ()) { + NodeBuilder[] chain = grp.BuilderChain; + grp.SavePositions (); + foreach (NodeBuilder b in chain) { + NodeCommandHandler handler = b.CommandHandler; + handler.SetCurrentNodes (grp.Nodes.ToArray ()); + if (handler.CanDeleteMultipleItems ()) + return true; + if (!grp.RestorePositions ()) + return false; + } + } + return false; + } + + [CommandHandler (ViewCommands.RefreshTree)] + public void RefreshCurrentItem () + { + OnRefreshCurrentItem (); + } + + protected virtual void OnRefreshCurrentItem () + { + try { + LockUpdates (); + foreach (SelectionGroup grp in GetSelectedNodesGrouped ()) { + NodeBuilder[] chain = grp.BuilderChain; + grp.SavePositions (); + foreach (NodeBuilder b in chain) { + NodeCommandHandler handler = b.CommandHandler; + handler.SetCurrentNodes (grp.Nodes.ToArray ()); + if (!grp.RestorePositions ()) + return; + handler.RefreshMultipleItems (); + if (!grp.RestorePositions ()) + return; + } + } + } finally { + UnlockUpdates (); + } + RefreshTree (); + } + + protected virtual void OnCurrentItemActivated () + { + if (CurrentItemActivated != null) + CurrentItemActivated (this, EventArgs.Empty); + } + + public event EventHandler CurrentItemActivated; + + #region Zoom + + const double ZOOM_FACTOR = 1.1f; + const int ZOOM_MIN_POW = -4; + const int ZOOM_MAX_POW = 8; + static readonly double ZOOM_MIN = System.Math.Pow (ZOOM_FACTOR, ZOOM_MIN_POW); + static readonly double ZOOM_MAX = System.Math.Pow (ZOOM_FACTOR, ZOOM_MAX_POW); + double zoom; + + public double Zoom { + get { + return zoom; + } + set { + value = System.Math.Min (ZOOM_MAX, System.Math.Max (ZOOM_MIN, value)); + if (value > ZOOM_MAX || value < ZOOM_MIN) + return; + //snap to one, if within 0.001d + if ((System.Math.Abs (value - 1d)) < 0.001d) { + value = 1d; + } + if (zoom != value) { + zoom = value; + OnZoomChanged (value); + } + } + } + + void OnZoomChanged (double value) + { + pix_render.Zoom = value; + text_render.Zoom = value; + + int expanderSize = (int) (12 * Zoom); + if (expanderSize < 3) expanderSize = 3; + if (expanderSize > 15) expanderSize = 15; + if (expanderSize != 12) + tree.Name = "MonoDevelop.ExtensibleTreeView_" + expanderSize; + else + tree.Name = ""; + tree.ColumnsAutosize (); + if (!string.IsNullOrEmpty (Id)) { + PropertyService.Set ("MonoDevelop.Ide.ExtensibleTreeView.Zoom." + Id, Zoom); + } + } + + [CommandHandler (ViewCommands.ZoomIn)] + public void ZoomIn () + { + int oldPow = (int)System.Math.Round (System.Math.Log (zoom) / System.Math.Log (ZOOM_FACTOR)); + Zoom = System.Math.Pow (ZOOM_FACTOR, oldPow + 1); + } + + [CommandHandler (ViewCommands.ZoomOut)] + public void ZoomOut () + { + int oldPow = (int)System.Math.Round (System.Math.Log (zoom) / System.Math.Log (ZOOM_FACTOR)); + Zoom = System.Math.Pow (ZOOM_FACTOR, oldPow - 1); + } + + [CommandHandler (ViewCommands.ZoomReset)] + public void ZoomReset () + { + Zoom = 1d; + } + + [CommandUpdateHandler (ViewCommands.ZoomIn)] + protected void UpdateZoomIn (CommandInfo cinfo) + { + cinfo.Enabled = zoom < ZOOM_MAX - 0.000001d; + } + + [CommandUpdateHandler (ViewCommands.ZoomOut)] + protected void UpdateZoomOut (CommandInfo cinfo) + { + cinfo.Enabled = zoom > ZOOM_MIN + 0.000001d; + } + + [CommandUpdateHandler (ViewCommands.ZoomReset)] + protected void UpdateZoomReset (CommandInfo cinfo) + { + cinfo.Enabled = zoom != 1d; + } + + #endregion Zoom + + [CommandHandler (EditCommands.Copy)] + public void CopyCurrentItem () + { + CancelTransfer (); + TransferCurrentItem (DragOperation.Copy); + } + + [CommandHandler (EditCommands.Cut)] + public void CutCurrentItem () + { + CancelTransfer (); + TransferCurrentItem (DragOperation.Move); + + if (copyObjects != null) { + foreach (object ob in copyObjects) { + ITreeBuilder tb = CreateBuilder (); + if (tb.MoveToObject (ob)) + tb.Update (); + } + } + } + + [CommandUpdateHandler (EditCommands.Copy)] + internal void UpdateCopyCurrentItem (CommandInfo info) + { + if (editingText) { + info.Bypass = true; + return; + } + info.Enabled = CanTransferCurrentItem (DragOperation.Copy); + } + + [CommandUpdateHandler (EditCommands.Cut)] + internal void UpdateCutCurrentItem (CommandInfo info) + { + if (editingText) { + info.Bypass = true; + return; + } + info.Enabled = CanTransferCurrentItem (DragOperation.Move); + } + + void TransferCurrentItem (DragOperation oper) + { + foreach (SelectionGroup grp in GetSelectedNodesGrouped ()) { + NodeBuilder[] chain = grp.BuilderChain; + grp.SavePositions (); + foreach (NodeBuilder b in chain) { + try { + NodeCommandHandler handler = b.CommandHandler; + handler.SetCurrentNodes (grp.Nodes.ToArray ()); + if ((handler.CanDragNode () & oper) != 0) { + grp.RestorePositions (); + copyObjects = grp.DataItems; + currentTransferOperation = oper; + break; + } + } catch (Exception ex) { + LoggingService.LogError (ex.ToString ()); + } + grp.RestorePositions (); + } + } + } + + bool CanTransferCurrentItem (DragOperation oper) + { + TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); + if (node != null) { + NodeBuilder[] chain = node.NodeBuilderChain; + NodePosition pos = node.CurrentPosition; + foreach (NodeBuilder b in chain) { + try { + NodeCommandHandler handler = b.CommandHandler; + handler.SetCurrentNode (node); + if ((handler.CanDragNode () & oper) != 0) + return true; + } catch (Exception ex) { + LoggingService.LogError (ex.ToString ()); + } + node.MoveToPosition (pos); + } + } + return false; + } + + [CommandHandler (EditCommands.Paste)] + public void PasteToCurrentItem () + { + if (copyObjects == null) return; + + try { + LockUpdates (); + TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); + if (node != null) { + NodeBuilder[] chain = node.NodeBuilderChain; + NodePosition pos = node.CurrentPosition; + foreach (NodeBuilder b in chain) { + NodeCommandHandler handler = b.CommandHandler; + handler.SetCurrentNode (node); + if (handler.CanDropMultipleNodes (copyObjects, currentTransferOperation, DropPosition.Into)) { + node.MoveToPosition (pos); + handler.OnMultipleNodeDrop (copyObjects, currentTransferOperation, DropPosition.Into); + } + node.MoveToPosition (pos); + } + } + if (currentTransferOperation == DragOperation.Move) + CancelTransfer (); + } finally { + UnlockUpdates (); + } + } + + [CommandUpdateHandler (EditCommands.Paste)] + internal void UpdatePasteToCurrentItem (CommandInfo info) + { + if (editingText) { + info.Bypass = true; + return; + } + + if (copyObjects != null) { + TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); + if (node != null) { + NodeBuilder[] chain = node.NodeBuilderChain; + NodePosition pos = node.CurrentPosition; + foreach (NodeBuilder b in chain) { + NodeCommandHandler handler = b.CommandHandler; + handler.SetCurrentNode (node); + if (handler.CanDropMultipleNodes (copyObjects, currentTransferOperation, DropPosition.Into)) { + info.Enabled = true; + return; + } + node.MoveToPosition (pos); + } + } + } + info.Enabled = false; + } + + void CancelTransfer () + { + if (copyObjects != null) { + object[] oldCopyObjects = copyObjects; + copyObjects = null; + if (currentTransferOperation == DragOperation.Move) { + foreach (object ob in oldCopyObjects) { + ITreeBuilder tb = CreateBuilder (); + if (tb.MoveToObject (ob)) + tb.Update (); + } + } + } + } + + NodeInfo GetNodeInfo (Gtk.TreeIter it) + { + return (NodeInfo)store.GetValue (it, NodeInfoColumn); + } + + void StartLabelEditInternal() + { + if (editingText) + return; + + TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); + if (node == null) + return; + + Gtk.TreeIter iter = node.CurrentPosition._iter; + object dataObject = node.DataItem; + NodeAttributes attributes = NodeAttributes.None; + + ITreeNavigator parentNode = node.Clone (); + parentNode.MoveToParent (); + NodePosition pos = parentNode.CurrentPosition; + + foreach (NodeBuilder b in node.NodeBuilderChain) { + try { + b.GetNodeAttributes (parentNode, dataObject, ref attributes); + } catch (Exception ex) { + LoggingService.LogError (ex.ToString ()); + } + parentNode.MoveToPosition (pos); + } + + if ((attributes & NodeAttributes.AllowRename) == 0) + return; + + node.ExpandToNode (); //make sure the parent of the node that is being edited is expanded + + string editText = node.NodeName; + + // Get and validate the initial text selection + int editTextLength = editText != null ? editText.Length : 0, + selectionStart = 0, selectionLength = editTextLength; + + foreach (NodeBuilder b in node.NodeBuilderChain) { + try { + NodeCommandHandler handler = b.CommandHandler; + handler.SetCurrentNode(node); + handler.OnRenameStarting(ref editText, ref selectionStart, ref selectionLength); + } catch (Exception ex) { + LoggingService.LogError (ex.ToString ()); + } + } + + editTextLength = editText != null ? editText.Length : 0; + + GetNodeInfo (iter).Label = GLib.Markup.EscapeText (editText); + store.EmitRowChanged (store.GetPath (iter), iter); + + if (selectionStart < 0 || selectionStart >= editTextLength) + selectionStart = 0; + if (selectionStart + selectionLength > editTextLength) + selectionLength = editTextLength - selectionStart; + // This will apply the selection as soon as possible + GLib.Idle.Add (() => { +// var editable = currentLabelEditable; +// if (editable == null) + return false; + +// editable.SelectRegion (selectionStart, selectionStart + selectionLength); + return false; + }); + // Ensure we set all our state variables before calling SetCursor + // as this may directly invoke HandleOnEditCancelled + text_render.Editable = true; + editingText = true; + tree.SetCursor (store.GetPath (iter), complete_column, true); + } + + Gtk.IEditable currentLabelEditable; + void HandleEditingStarted (object o, Gtk.EditingStartedArgs e) + { + currentLabelEditable = e.Editable as Gtk.Entry; + } + + void HandleOnEdit (object o, Gtk.EditedArgs e) + { + try { + editingText = false; + text_render.Editable = false; + currentLabelEditable = null; + + Gtk.TreeIter iter; + if (!store.GetIterFromString (out iter, e.Path)) + throw new Exception("Error calculating iter for path " + e.Path); + + if (e.NewText != null && e.NewText.Length > 0) { + ITreeNavigator nav = new TreeNodeNavigator (this, iter); + NodePosition pos = nav.CurrentPosition; + + try { + LockUpdates (); + NodeBuilder[] chain = (NodeBuilder[]) store.GetValue (iter, BuilderChainColumn); + foreach (NodeBuilder b in chain) { + try { + NodeCommandHandler handler = b.CommandHandler; + handler.SetCurrentNode (nav); + handler.RenameItem (e.NewText); + } catch (Exception ex) { + LoggingService.LogInternalError (ex); + } + nav.MoveToPosition (pos); + } + } finally { + UnlockUpdates (); + } + } + + // Get the iter again since the this node may have been replaced. + if (!store.GetIterFromString (out iter, e.Path)) + return; + + ITreeBuilder builder = CreateBuilder (iter); + builder.Update (); + } + catch (Exception ex) { + LoggingService.LogInternalError ("The item could not be renamed", ex); + } + } + + void HandleOnEditCancelled (object s, EventArgs args) + { + editingText = false; + text_render.Editable = false; +// currentLabelEditable = null; + + TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); + if (node == null) + return; + + // Restore the original node label + Gtk.TreeIter iter = node.CurrentPosition._iter; + ITreeBuilder builder = CreateBuilder (iter); + builder.Update (); + } + + public NodeState SaveTreeState () + { + ITreeNavigator root = GetRootNode (); + if (root == null) + return null; + + var rootState = NodeState.CreateRoot (); + List children = new List (); + rootState.ChildrenState = children; + + var s = new Dictionary (); + foreach (TreePadOption opt in options) { + bool val; + if (globalOptions.TryGetValue (opt.Id, out val) && val != opt.DefaultValue) + s [opt.Id] = val; + } + if (s.Count != 0) + rootState.Options = s; + + do { + rootState.ChildrenState.Add (root.SaveState ()); + } while (root.MoveNext ()); + + return rootState; + } + + public void RestoreTreeState (NodeState state) + { + if (state == null) + return; + + ITreeNavigator nav = GetRootNode (); + if (nav == null) + return; + + if (state.IsRoot) { + if (state.ChildrenState != null) { + var pos = nav.CurrentPosition; + foreach (NodeState ces in state.ChildrenState) { + do { + if (nav.NodeName == ces.NodeName) { + nav.RestoreState (ces); + break; + } + } while (nav.MoveNext ()); + nav.MoveToPosition (pos); + } + } + } else + nav.RestoreState (state); + + globalOptions = new TreeOptions (); + foreach (TreePadOption opt in options) { + bool val = false; + if (state.Options == null || !state.Options.TryGetValue (opt.Id, out val)) + val = opt.DefaultValue; + globalOptions[opt.Id] = val; + } + globalOptions.Pad = this; + RefreshTree (); + } + + TypeNodeBuilder GetTypeNodeBuilder (Type type) + { + NodeBuilder[] chain = GetBuilderChain (type); + if (chain == null) return null; + return (TypeNodeBuilder) chain [0]; + } + + internal NodeBuilder[] GetBuilderChain (Type type) + { + NodeBuilder[] chain; + builderChains.TryGetValue (type, out chain); + if (chain == null) { + List list = new List (); + + // Find the most specific node builder type. + TypeNodeBuilder bestTypeNodeBuilder = null; + Type bestNodeType = null; + + foreach (NodeBuilder nb in builders) { + if (nb is TypeNodeBuilder) { + TypeNodeBuilder tnb = (TypeNodeBuilder) nb; + if (tnb.NodeDataType.IsAssignableFrom (type)) { + if (bestNodeType == null || bestNodeType.IsAssignableFrom (tnb.NodeDataType)) { + bestNodeType = tnb.NodeDataType; + bestTypeNodeBuilder = tnb; + } + } + } else { + try { + if (((NodeBuilderExtension)nb).CanBuildNode (type)) + list.Add (nb); + } catch (Exception ex) { + LoggingService.LogError (ex.ToString ()); + } + } + } + + if (bestTypeNodeBuilder != null) { + list.Insert (0, bestTypeNodeBuilder); + chain = list.ToArray (); + } else + chain = null; + + builderChains [type] = chain; + } + return chain; + } + + TypeNodeBuilder GetTypeNodeBuilder (Gtk.TreeIter iter) + { + NodeBuilder[] chain = (NodeBuilder[]) store.GetValue (iter, ExtensibleTreeView.BuilderChainColumn); + if (chain != null && chain.Length > 0) + return chain[0] as TypeNodeBuilder; + return null; + } + + internal int CompareNodes (Gtk.ITreeModel model, Gtk.TreeIter a, Gtk.TreeIter b) + { + sorting = true; + try { + NodeBuilder[] chain1 = (NodeBuilder[]) store.GetValue (a, BuilderChainColumn); + if (chain1 == null) return -1; + + NodeBuilder [] chain2 = (NodeBuilder [])store.GetValue (b, BuilderChainColumn); + if (chain2 == null) return 1; + + compareNode1.MoveToIter (a); + compareNode2.MoveToIter (b); + + var i1 = GetSortIndex (chain1, compareNode1); + var i2 = GetSortIndex (chain2, compareNode2); + + if (i1 < i2) + return -1; + else if (i1 > i2) + return 1; + + int sort = CompareObjects (chain1, compareNode1, compareNode2); + if (sort != TypeNodeBuilder.DefaultSort) return sort; + + if (chain1 != chain2) { + sort = CompareObjects (chain2, compareNode2, compareNode1); + if (sort != TypeNodeBuilder.DefaultSort) return sort * -1; + } + + TypeNodeBuilder tb1 = (TypeNodeBuilder) chain1[0]; + TypeNodeBuilder tb2 = (TypeNodeBuilder) chain2[0]; + object o1 = store.GetValue (a, DataItemColumn); + object o2 = store.GetValue (b, DataItemColumn); + return string.Compare (tb1.GetNodeName (compareNode1, o1), tb2.GetNodeName (compareNode2, o2), true); + } finally { + sorting = false; + compareNode1.MoveToIter (Gtk.TreeIter.Zero); + compareNode2.MoveToIter (Gtk.TreeIter.Zero); + } + } + + int CompareObjects (NodeBuilder[] chain, ITreeNavigator thisNode, ITreeNavigator otherNode) + { + int result = NodeBuilder.DefaultSort; + for (int n=0; n (copyObjects); + list.RemoveAt (i); + if (list.Count > 0) + copyObjects = list.ToArray (); + else + copyObjects = null; + } + } + + // Remove object from drag list + + if (tree.dragObjects != null) { + int i = Array.IndexOf (tree.dragObjects, dataObject); + if (i != -1) { + var list = new List (tree.dragObjects); + list.RemoveAt (i); + if (list.Count > 0) + tree.dragObjects = list.ToArray (); + else + tree.dragObjects = null; + } + } + + object currentIt; + nodeHash.TryGetValue (dataObject, out currentIt); + if (currentIt is Gtk.TreeIter[]) { + Gtk.TreeIter[] arr = (Gtk.TreeIter[]) currentIt; + Gtk.TreePath path = null; + List iters = new List (); + if (store.IterIsValid (iter)) + path = store.GetPath (iter); + + // Iters can't be directly compared (TreeIter.Equals is broken), so we have + // to compare paths. + foreach (Gtk.TreeIter it in arr) { + if (store.IterIsValid (it) && (path == null || !path.Equals (store.GetPath (it)))) + iters.Add (it); + } + if (iters.Count > 1) + nodeHash [dataObject] = iters.ToArray (); + else if (iters.Count == 1) + nodeHash [dataObject] = iters[0]; + else + nodeHash.Remove (dataObject); + } else { + nodeHash.Remove (dataObject); + if (fireRemovedEvent) + NotifyNodeRemoved (dataObject, chain); + } + } + + internal void RemoveChildren (Gtk.TreeIter it) + { + Gtk.TreeIter child; + while (store.IterChildren (out child, it)) { + RemoveChildren (child); + object childData = store.GetValue (child, ExtensibleTreeView.DataItemColumn); + if (childData != null) + UnregisterNode (childData, child, null, true); + store.Remove (ref child); + } + } + + void NotifyNodeRemoved (object dataObject, NodeBuilder[] chain) + { + if (chain == null) + chain = GetBuilderChain (dataObject.GetType()); + foreach (NodeBuilder nb in chain) { + try { + nb.OnNodeRemoved (dataObject); + } catch (Exception ex) { + LoggingService.LogError (ex.ToString ()); + } + } + } + + internal bool IsRegistered (object dataObject) + { + return nodeHash.ContainsKey (dataObject); + } + + internal void NotifyInserted (Gtk.TreeIter it, object dataObject) + { + if (callbacks.Count > 0) { + if (callbacks.TryGetValue (dataObject, out var list)) { + ITreeNavigator nav = new TreeNodeNavigator (this, it); + NodePosition pos = nav.CurrentPosition; + foreach (TreeNodeCallback callback in list) { + callback (nav); + nav.MoveToPosition (pos); + } + callbacks.Remove (dataObject); + } + } + } + + internal string GetNamePathFromIter (Gtk.TreeIter iter) + { + workNode.MoveToIter (iter); + StringBuilder sb = new StringBuilder (); + do { + string name = workNode.NodeName; + if (sb.Length > 0) sb.Insert (0, '/'); + name = name.Replace ("%","%%"); + name = name.Replace ("/","_%_"); + sb.Insert (0, name); + } while (workNode.MoveToParent ()); + + workNode.MoveToIter (Gtk.TreeIter.Zero); + + return sb.ToString (); + } + + void RefreshNode (Gtk.TreeIter iter) + { + ITreeBuilder builder = CreateBuilder (iter); + builder.UpdateAll (); + } + + public void RefreshNode (ITreeNavigator nav) + { + RefreshNode (nav.CurrentPosition._iter); + } + + internal void ResetState (ITreeNavigator nav) + { + if (nav is TreeBuilder) + ((TreeBuilder)nav).ResetState (); + else if (nav is TransactedTreeBuilder) + ((TransactedTreeBuilder)nav).ResetState (); + else { + ITreeBuilder builder = CreateBuilder (nav.CurrentPosition._iter); + ResetState (builder); + } + } + + internal bool GetIterFromNamePath (string path, out Gtk.TreeIter iter) + { + if (!store.GetIterFirst (out iter)) + return false; + + TreeNodeNavigator nav = new TreeNodeNavigator (this, iter); + string[] names = path.Split ('/'); + + int n = 0; + bool more; + do { + string name = names [n].Replace ("_%_","/"); + name = name.Replace ("%%","%"); + + if (nav.NodeName == name) { + iter = nav.CurrentPosition._iter; + if (++n == names.Length) return true; + more = nav.MoveToFirstChild (); + } else + more = nav.MoveNext (); + } while (more); + + return false; + } + + /// + /// If you want to edit a node label. Select the node you want to edit and then + /// call this method, instead of using the LabelEdit Property and the BeginEdit + /// Method directly. + /// + [CommandHandler (EditCommands.Rename)] + public void StartLabelEdit () + { + GLib.Timeout.Add (20, new GLib.TimeoutHandler (wantFocus)); + } + + [CommandUpdateHandler (EditCommands.Rename)] + internal void UpdateStartLabelEdit (CommandInfo info) + { + if (editingText || GetSelectedNodes ().Length != 1) { + info.Visible = false; + return; + } + + TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); + NodeAttributes attributes = GetNodeAttributes (node); + if ((attributes & NodeAttributes.AllowRename) == 0) { + info.Visible = false; + return; + } + } + + NodeAttributes GetNodeAttributes (TreeNodeNavigator node) + { + object dataObject = node.DataItem; + NodeAttributes attributes = NodeAttributes.None; + + ITreeNavigator parentNode = node.Clone (); + parentNode.MoveToParent (); + NodePosition pos = parentNode.CurrentPosition; + + foreach (NodeBuilder b in node.NodeBuilderChain) { + try { + b.GetNodeAttributes (parentNode, dataObject, ref attributes); + } catch (Exception ex) { + LoggingService.LogError (ex.ToString ()); + } + parentNode.MoveToPosition (pos); + } + return attributes; + } + + + bool wantFocus () + { + tree.GrabFocus (); + StartLabelEditInternal (); + return false; + } + + private void OnTestExpandRow (object sender, Gtk.TestExpandRowArgs args) + { + bool filled = (bool) store.GetValue (args.Iter, FilledColumn); + if (!filled) { + TreeBuilder nb = new TreeBuilder (this, args.Iter); + args.RetVal = !nb.FillNode (); + } else + args.RetVal = false; + } + + void ShowPopup (Gdk.EventButton evt) + { + var entryset = BuildEntrySet (); + if (entryset == null) + return; + + tree.ShowContextMenu (evt, entryset, this); + } + + CommandEntrySet BuildEntrySet () + { + ITreeNavigator tnav = GetSelectedNode (); + if (tnav == null) + return null; + TypeNodeBuilder nb = GetTypeNodeBuilder (tnav.CurrentPosition._iter); + string menuPath = nb != null && nb.ContextMenuAddinPath != null ? nb.ContextMenuAddinPath : contextMenuPath; + if (menuPath == null) { + if (options.Length > 0) { + CommandEntrySet opset = new CommandEntrySet (); + opset.AddItem (ViewCommands.TreeDisplayOptionList); + opset.AddItem (Command.Separator); + opset.AddItem (ViewCommands.ResetTreeDisplayOptions); + return opset; + } + return null; + } else { + ExtensionContext ctx = AddinManager.CreateExtensionContext (); + ctx.RegisterCondition ("ItemType", new ItemTypeCondition (tnav.DataItem.GetType (), contextMenuTypeNameAliases)); + if (tnav.DataItem is MonoDevelop.Projects.IFileItem fileItem) { + var fileTypeCondition = new FileTypeCondition (); fileTypeCondition.SetFileName (fileItem.FileName); - ctx.RegisterCondition ("FileType", fileTypeCondition); - } - - CommandEntrySet eset = IdeApp.CommandService.CreateCommandEntrySet (ctx, menuPath); - - eset.AddItem (Command.Separator); - if (!tnav.Clone ().MoveToParent ()) { - CommandEntrySet opset = eset.AddItemSet (GettextCatalog.GetString ("Display Options")); - opset.AddItem (ViewCommands.TreeDisplayOptionList); - opset.AddItem (Command.Separator); - opset.AddItem (ViewCommands.ResetTreeDisplayOptions); - // opset.AddItem (ViewCommands.CollapseAllTreeNodes); - } - eset.AddItem (ViewCommands.RefreshTree); - return eset; - } - } - - [CommandUpdateHandler (ViewCommands.TreeDisplayOptionList)] - internal void BuildTreeOptionsMenu (CommandArrayInfo info) - { - foreach (TreePadOption op in options) { - CommandInfo ci = new CommandInfo (op.Label); - ci.Checked = globalOptions [op.Id]; - info.Add (ci, op.Id); - } - } - - [CommandHandler (ViewCommands.TreeDisplayOptionList)] - internal void OptionToggled (string optionId) - { - globalOptions [optionId] = !globalOptions [optionId]; - RefreshRoots (); - } - - [CommandHandler (ViewCommands.ResetTreeDisplayOptions)] - public void ResetOptions () - { - foreach (TreePadOption op in options) - globalOptions [op.Id] = op.DefaultValue; - - RefreshRoots (); - } - - void RefreshRoots () - { - Gtk.TreeIter it; - if (!store.GetIterFirst (out it)) - return; - do { - ITreeBuilder tb = CreateBuilder (it); - tb.UpdateAll (); - } while (store.IterNext (ref it)); - } - - public void RefreshTree () - { - foreach (TreeNodeNavigator node in GetSelectedNodes ()) { - Gtk.TreeIter it = node.CurrentPosition._iter; - if (store.IterIsValid (it)) { - ITreeBuilder tb = CreateBuilder (it); - tb.UpdateAll (); - } - } - } - - [CommandHandler (ViewCommands.CollapseAllTreeNodes)] - public void CollapseTree () - { - tree.CollapseAll(); - } - - [GLib.ConnectBefore] - void OnKeyPress (object o, Gtk.KeyPressEventArgs args) - { - HideStatusMessage (); - - if (args.Event.Key == Gdk.Key.Delete || args.Event.Key == Gdk.Key.KP_Delete) { - DeleteCurrentItem (); - args.RetVal = true; - return; - } - - //HACK: to work around "Bug 377810 - Many errors when expanding MonoDevelop treeviews with keyboard" - // The shift-right combo recursively expands all child nodes but the OnTestExpandRow callback - // modifies tree and successive calls get passed an invalid iter. Using the path to regenerate the iter - // causes a Gtk-Fatal. - bool shift = (args.Event.State & Gdk.ModifierType.ShiftMask) != 0; - if (args.Event.Key == Gdk.Key.asterisk || args.Event.Key == Gdk.Key.KP_Multiply - || (shift && (args.Event.Key == Gdk.Key.Right || args.Event.Key == Gdk.Key.KP_Right - || args.Event.Key == Gdk.Key.plus || args.Event.Key == Gdk.Key.KP_Add))) - { - Gtk.TreeIter iter; - foreach (Gtk.TreePath path in tree.Selection.GetSelectedRows ()) { - store.GetIter (out iter, path); - Expand (iter); - } - args.RetVal = true; - return; - } - - if (args.Event.Key == Gdk.Key.Right || args.Event.Key == Gdk.Key.KP_Right) { - ExpandCurrentItem (); - args.RetVal = true; - return; - } - - if (args.Event.Key == Gdk.Key.Left || args.Event.Key == Gdk.Key.KP_Left) { - CollapseCurrentItem (); - args.RetVal = true; - return; - } - - if (args.Event.Key == Gdk.Key.Return || args.Event.Key == Gdk.Key.KP_Enter || args.Event.Key == Gdk.Key.ISO_Enter) { - ActivateCurrentItem (); - args.RetVal = true; - return; - } - } - - [CommandHandler (SearchCommands.Find)] - void HandleSearchCommand () - { - IdeApp.CommandService.DispatchCommand (MonoDevelop.Components.MainToolbar.Commands.NavigateTo); - } - - void Expand (Gtk.TreeIter it) - { - tree.ExpandRow (store.GetPath (it), false); - Gtk.TreeIter ci; - if (store.IterChildren (out ci, it)) { - do { - Expand (ci); - } while (store.IterNext (ref ci)); - } - } - - void OnNodeActivated (object sender, Gtk.RowActivatedArgs args) - { - ActivateCurrentItem (); - } - - void OnPerformPress (object sender, EventArgs args) - { - ActivateCurrentItem (); - } - - void OnSelectionChanged (object sender, EventArgs args) - { - TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); - if (node != null) { - NodeBuilder[] chain = node.NodeBuilderChain; - NodePosition pos = node.CurrentPosition; - foreach (NodeBuilder b in chain) { - try { - NodeCommandHandler handler = b.CommandHandler; - handler.SetCurrentNode (node); - handler.OnItemSelected (); - } catch (Exception ex) { - LoggingService.LogError (ex.ToString ()); - } - node.MoveToPosition (pos); - } - } - OnSelectionChanged (); - } - - protected virtual void OnSelectionChanged () - { - if (SelectionChanged != null) - SelectionChanged (this, EventArgs.Empty); - } - - void Destroy () - { - IdeApp.Preferences.CustomPadFont.Changed -= CustomFontPropertyChanged; - if (pix_render != null) { - pix_render.Destroy (); - pix_render = null; - } - if (complete_column != null) { - complete_column.Destroy (); - complete_column = null; - } - if (text_render != null) { - text_render.Destroy (); - text_render = null; - } - - if (store != null) { - Clear (); - store = null; - } - - if (builders != null) { - foreach (NodeBuilder nb in builders) { - try { - nb.Dispose (); - } catch (Exception ex) { - LoggingService.LogError (ex.ToString ()); - } - } - builders = null; - } - builderChains.Clear (); - } - - object ICommandRouter.GetNextCommandTarget () - { - return widget.Parent; - } - - internal class PadCheckMenuItem: Gtk.CheckMenuItem - { - internal string Id; - - public PadCheckMenuItem (string label, string id): base (label) { - Id = id; - } - } - - internal class TreeBuilderContext: ITreeBuilderContext - { - ExtensibleTreeView pad; - Hashtable icons = new Hashtable (); - Hashtable composedIcons = new Hashtable (); - - internal TreeBuilderContext (ExtensibleTreeView pad) - { - this.pad = pad; - } - - public ITreeBuilder GetTreeBuilder () - { - Gtk.TreeIter iter; - if (!pad.store.GetIterFirst (out iter)) - return pad.CreateBuilder (Gtk.TreeIter.Zero); - else - return pad.CreateBuilder (iter); - } - - public ITreeBuilder GetTreeBuilder (object dataObject) - { - ITreeBuilder tb = pad.CreateBuilder (); - if (tb.MoveToObject (dataObject)) - return tb; - else - return null; - } - - public ITreeBuilder GetTreeBuilder (ITreeNavigator navigator) - { - return pad.CreateBuilder (navigator.CurrentPosition._iter); - } - - public Xwt.Drawing.Image GetIcon (string id) - { - Xwt.Drawing.Image icon = icons [id] as Xwt.Drawing.Image; - if (icon == null) { - icon = ImageService.GetIcon (id).WithSize (Gtk.IconSize.Menu); - icons [id] = icon; - } - return icon; - } - - public Xwt.Drawing.Image GetComposedIcon (Xwt.Drawing.Image baseIcon, object compositionKey) - { - Hashtable itable = composedIcons [baseIcon] as Hashtable; - if (itable == null) return null; - return itable [compositionKey] as Xwt.Drawing.Image; - } - - public Xwt.Drawing.Image CacheComposedIcon (Xwt.Drawing.Image baseIcon, object compositionKey, Xwt.Drawing.Image composedIcon) - { - Hashtable itable = composedIcons [baseIcon] as Hashtable; - if (itable == null) { - itable = new Hashtable (); - composedIcons [baseIcon] = itable; - } - itable [compositionKey] = composedIcon; - return composedIcon; - } - - public ITreeNavigator GetTreeNavigator (object dataObject) - { - Gtk.TreeIter iter; - if (!pad.GetFirstNode (dataObject, out iter)) return null; - return new TreeNodeNavigator (pad, iter); - } - - public ExtensibleTreeView Tree { - get { return pad; } - } - } - - class ExtensibleTreeViewTree : ContextMenuTreeView - { - ExtensibleTreeView tv; - - public ExtensibleTreeViewTree (ExtensibleTreeView tv) - { - this.tv = tv; - EnableModelDragDest (targetTable, Gdk.DragAction.Copy | Gdk.DragAction.Move); - Gtk.Drag.SourceSet (this, Gdk.ModifierType.Button1Mask, targetTable, Gdk.DragAction.Copy | Gdk.DragAction.Move); - } - - static Gtk.TargetEntry [] targetTable = new Gtk.TargetEntry [] { - new Gtk.TargetEntry ("text/uri-list", 0, 11 ), - new Gtk.TargetEntry ("text/plain", 0, 22), - new Gtk.TargetEntry ("application/x-rootwindow-drop", 0, 33) - }; - - public object[] dragObjects = null; - bool dropping = false; - Func nodeToUri; - - public void EnableDragUriSource (Func nodeToUri) - { - this.nodeToUri = nodeToUri; - } - - protected override void OnDragBegin (Gdk.DragContext context) - { - Xwt.Drawing.Image dragIcon; - dragObjects = tv.GetDragObjects (out dragIcon); - Gtk.Drag.SetIconPixbuf (context, dragIcon != null ? dragIcon.ToPixbuf (Gtk.IconSize.Menu) : null, -10, -10); - - base.OnDragBegin (context); - } - - protected override void OnDragEnd (Gdk.DragContext context) - { - dragObjects = null; - base.OnDragEnd (context); - } - - protected override bool OnDragMotion (Gdk.DragContext context, int x, int y, uint time) - { - //OnDragDataReceived callback loses x/y values, so stash them - this.x = x; - this.y = y; - - if (dragObjects == null) { - //it's a drag from outside, need to retrieve the data. This will cause OnDragDataReceived to be called. - Gdk.Atom atom = Gtk.Drag.DestFindTarget (this, context, null); - Gtk.Drag.GetData (this, context, atom, time); - } else { - //it's from inside, can call OnDragDataReceived directly - OnDragDataReceived (context, x, y, null, 0, time); - } - return true; - } - - int x, y; - - protected override void OnDragDataReceived (Gdk.DragContext context, int x, int y, Gtk.SelectionData selection_data, uint info, uint time) - { - x = this.x; - y = this.y; - - object[] data = dragObjects ?? new object[] { selection_data }; - bool canDrop = tv.CheckAndDrop (x, y, dropping, context, data); - if (dropping) { - dropping = false; - SetDragDestRow (null, 0); - Gtk.Drag.Finish (context, canDrop, true, time); - return; - } - - //let default handler handle hover-to-expand, autoscrolling, etc - base.OnDragMotion (context, x, y, time); - - //if we can't handle it, flag as not droppable and remove the drop marker - if (!canDrop) { - Gdk.Drag.Status (context, (Gdk.DragAction)0, time); - SetDragDestRow (null, 0); - } - } - - protected override bool OnDragDrop (Gdk.DragContext context, int x, int y, uint time_) - { - dropping = true; - return base.OnDragDrop (context, x, y, time_); - } - - protected override void OnDragDataGet (Gdk.DragContext context, Gtk.SelectionData selection_data, uint info, uint time_) - { - if (dragObjects == null || nodeToUri == null) - return; - - uint uriListTarget = targetTable [0].Info; - if (info == uriListTarget) { - var sb = new StringBuilder (); - foreach (var dobj in dragObjects) { - var val = nodeToUri (dobj); - if (val != null) { - sb.AppendLine (val); - } - } - selection_data.Set (selection_data.Target, selection_data.Format, Encoding.UTF8.GetBytes (sb.ToString ())); - } - } - } - - class CustomCellRendererText: Gtk.CellRendererText - { - double zoom; - Pango.Layout layout; - Pango.FontDescription scaledFont, customFont; - - ExtensibleTreeView parent; - Gdk.Rectangle buttonScreenRect; - Gdk.Rectangle buttonAllocation; - string markup; - string secondarymarkup; - - const int StatusIconSpacing = 4; - - public bool Pushed { get; set; } - - //using this instead of FontDesc property, FontDesc seems to be broken - public Pango.FontDescription CustomFont { - get { - return customFont; - } - set { - if (scaledFont != null) { - scaledFont.Dispose (); - scaledFont = null; - } - customFont = value; - } - } - - static CustomCellRendererText () - { - } - - [GLib.Property ("text-markup")] - public string TextMarkup { - get { return markup; } - set { - markup = value; - if (!string.IsNullOrEmpty (secondarymarkup)) - Markup = markup + " " + secondarymarkup; - else - Markup = markup; - } - } - - [GLib.Property ("secondary-text-markup")] - public string SecondaryTextMarkup { - get { return secondarymarkup; } - set { - secondarymarkup = value; - if (!string.IsNullOrEmpty (secondarymarkup)) - Markup = markup + " " + secondarymarkup; - else - Markup = markup; - } - } - - public bool DisabledStyle { get; set; } - - [GLib.Property ("status-icon")] - public Xwt.Drawing.Image StatusIcon { get; set; } - - public CustomCellRendererText (ExtensibleTreeView parent) - { - this.parent = parent; - } - - static Xwt.Size defaultIconSize = Gtk.IconSize.Menu.GetSize (); - - static Xwt.Size GetZoomedIconSize (Xwt.Drawing.Image icon, double zoom) - { - if (icon == null || icon == CellRendererImage.NullImage) - return defaultIconSize; - - var size = icon.HasFixedSize ? icon.Size : defaultIconSize; - - if (zoom == 1) - return size; - - int w = (int) (zoom * (double) size.Width); - int h = (int) (zoom * (double) size.Height); - if (w == 0) w = 1; - if (h == 0) h = 1; - return new Xwt.Size (w, h); - } - - static Xwt.Drawing.Image GetResized (Xwt.Drawing.Image icon, double zoom) - { - var size = GetZoomedIconSize (icon, zoom); - return icon.WithSize (size); - } - - void SetupLayout (Gtk.Widget widget, Gtk.CellRendererState flags = 0) - { - if (scaledFont == null) { - if (scaledFont != null) - scaledFont.Dispose (); - scaledFont = (customFont ?? parent.widget.Style.FontDesc).Copy (); - scaledFont.Size = (int)(customFont.Size * Zoom); - if (layout != null) - layout.FontDescription = scaledFont; - } - - if (layout == null || layout.Context != widget.PangoContext) { - if (layout != null) - layout.Dispose (); - layout = new Pango.Layout (widget.PangoContext); - layout.FontDescription = scaledFont; - } - - string newmarkup = TextMarkup; - if (DisabledStyle) { - Gdk.Color fgColor; - if (Platform.IsMac && flags.HasFlag (Gtk.CellRendererState.Selected)) - fgColor = widget.Style.Text (IdeTheme.UserInterfaceTheme == Theme.Light ? Gtk.StateType.Selected : Gtk.StateType.Normal); - else - fgColor = widget.Style.Text (Gtk.StateType.Insensitive); - newmarkup = "" + TextMarkup + ""; - } - - if (!string.IsNullOrEmpty (SecondaryTextMarkup)) { - if (Platform.IsMac && flags.HasFlag (Gtk.CellRendererState.Selected)) - newmarkup += " " + SecondaryTextMarkup + ""; - else - newmarkup += " " + SecondaryTextMarkup + ""; - } - - layout.SetMarkup (newmarkup); - } - - protected override void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags) - { - Gtk.StateType st = Gtk.StateType.Normal; - if ((flags & Gtk.CellRendererState.Prelit) != 0) - st = Gtk.StateType.Prelight; - if ((flags & Gtk.CellRendererState.Focused) != 0) - st = Gtk.StateType.Normal; - if ((flags & Gtk.CellRendererState.Insensitive) != 0) - st = Gtk.StateType.Insensitive; - if ((flags & Gtk.CellRendererState.Selected) != 0) - st = widget.HasFocus ? Gtk.StateType.Selected : Gtk.StateType.Active; - - SetupLayout (widget, flags); - - int w, h; - layout.GetPixelSize (out w, out h); - - int tx = cell_area.X + (int)Xpad; - int ty = cell_area.Y + (cell_area.Height - h) / 2; - - bool hasStatusIcon = StatusIcon != CellRendererImage.NullImage && StatusIcon != null; - - if (hasStatusIcon) { - var img = GetResized (StatusIcon, zoom); - if (st == Gtk.StateType.Selected) - img = img.WithStyles ("sel"); - var x = tx + w + StatusIconSpacing; - using (var ctx = Gdk.CairoHelper.Create (window)) { - ctx.DrawImage (widget, img, x, cell_area.Y + (cell_area.Height - img.Height) / 2); - } - } - - window.DrawLayout (widget.Style.TextGC (st), tx, ty, layout); - - hasStatusIcon = false; - } - - public Gdk.Rectangle GetStatusIconArea (Gtk.Widget widget, Gdk.Rectangle cell_area) - { - SetupLayout (widget); - - int w, h; - layout.GetPixelSize (out w, out h); - - var iconSize = GetZoomedIconSize (StatusIcon, zoom); - int tx = cell_area.X + (int)Xpad; - var x = tx + w + StatusIconSpacing; - return new Gdk.Rectangle (x, cell_area.Y, (int) iconSize.Width, (int) cell_area.Height); - } - - public override void GetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - SetupLayout (widget); - - x_offset = y_offset = 0; - - layout.GetPixelSize (out width, out height); - width += (int)Xpad * 2; - - if (StatusIcon != CellRendererImage.NullImage && StatusIcon != null) { - var iconSize = GetZoomedIconSize (StatusIcon, zoom); - width += (int)iconSize.Width + StatusIconSpacing; - } - } - - protected override void OnEditingStarted (Gtk.CellEditable editable, string path) - { - var entry = editable as Gtk.Entry; - if (entry != null && scaledFont != null) - entry.ModifyFont (scaledFont); - base.OnEditingStarted (editable, path); - } - - public double Zoom { - get { - return zoom; - } - set { - if (scaledFont != null) { - scaledFont.Dispose (); - scaledFont = null; - } - zoom = value; - } - } - - public bool PointerInButton (int px, int py) - { - return buttonScreenRect.Contains (px, py); - } - - public Gdk.Point PointerPosition { get; set; } - - public Gdk.Rectangle PopupAllocation { - get { return buttonAllocation; } - } - - protected override void OnDestroyed () - { - base.OnDestroyed (); - if (scaledFont != null) - scaledFont.Dispose (); - if (layout != null) - layout.Dispose (); - } - } - } - - class NodeCommandTargetChain: ICommandDelegatorRouter - { - NodeCommandHandler target; - ITreeNavigator[] nodes; - internal NodeCommandTargetChain Next; - - public NodeCommandTargetChain (NodeCommandHandler target, ITreeNavigator[] nodes) - { - this.nodes = nodes; - this.target = target; - } - - public object GetNextCommandTarget () - { - target.SetCurrentNodes (null); - return Next; - } - - public object GetDelegatedCommandTarget () - { - target.SetCurrentNodes (nodes); - return target; - } - } - - class IterComparer: IEqualityComparer - { - Gtk.TreeStore store; - - public IterComparer (Gtk.TreeStore store) - { - this.store = store; - } - public bool Equals (Gtk.TreeIter x, Gtk.TreeIter y) - { - if (!store.IterIsValid (x) || !store.IterIsValid (y)) - return false; - Gtk.TreePath px = store.GetPath (x); - Gtk.TreePath py = store.GetPath (y); - if (px == null || py == null) - return false; - return px.Equals (py); - } - - public int GetHashCode (Gtk.TreeIter obj) - { - if (!store.IterIsValid (obj)) - return 0; - Gtk.TreePath p = store.GetPath (obj); - if (p == null) - return 0; - else - return p.ToString ().GetHashCode (); - } - } - - class ZoomableCellRendererPixbuf: CellRendererImage - { - double zoom = 1f; - - Dictionary resizedCache = new Dictionary (); - - Xwt.Drawing.Image overlayBottomLeft; - Xwt.Drawing.Image overlayBottomRight; - Xwt.Drawing.Image overlayTopLeft; - Xwt.Drawing.Image overlayTopRight; - - public ZoomableCellRendererPixbuf () : base () - { - } - - public double Zoom { - get { return zoom; } - set { - if (zoom != value) { - zoom = value; - resizedCache.Clear (); - Notify ("image"); - } - } - } - - public override Xwt.Drawing.Image Image { - get { - return base.Image; - } - set { - base.Image = GetResized (value); - } - } - - public override Xwt.Drawing.Image ImageExpanderOpen { - get { - return base.ImageExpanderOpen; - } - set { - base.ImageExpanderOpen = GetResized (value); - } - } - - public override Xwt.Drawing.Image ImageExpanderClosed { - get { - return base.ImageExpanderClosed; - } - set { - base.ImageExpanderClosed = GetResized (value); - } - } - - [GLib.Property ("overlay-image-top-left")] - public Xwt.Drawing.Image OverlayTopLeft { - get { - return overlayTopLeft; - } - set { - overlayTopLeft = GetResized (value); - } - } - - [GLib.Property ("overlay-image-top-right")] - public Xwt.Drawing.Image OverlayTopRight { - get { - return overlayTopRight; - } - set { - overlayTopRight = GetResized (value); - } - } - - [GLib.Property ("overlay-image-bottom-left")] - public Xwt.Drawing.Image OverlayBottomLeft { - get { - return overlayBottomLeft; - } - set { - overlayBottomLeft = GetResized (value); - } - } - - [GLib.Property ("overlay-image-bottom-right")] - public Xwt.Drawing.Image OverlayBottomRight { - get { - return overlayBottomRight; - } - set { - overlayBottomRight = GetResized (value); - } - } - - Xwt.Drawing.Image GetResized (Xwt.Drawing.Image value) - { - //this can happen during solution deserialization if the project is unrecognized - //because a line is added into the treeview with no icon - if (value == null || value == CellRendererImage.NullImage) - return null; - - var img = value.HasFixedSize ? value : value.WithSize (Gtk.IconSize.Menu); - - if (zoom == 1) - return img; - - Xwt.Drawing.Image resized; - if (resizedCache.TryGetValue (img, out resized)) - return resized; - - int w = (int) (zoom * (double) img.Width); - int h = (int) (zoom * (double) img.Height); - if (w == 0) w = 1; - if (h == 0) h = 1; - resized = img.WithSize (w, h); - resizedCache [img] = resized; - return resized; - } - - public override void GetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - /* if (overlayBottomLeft != null || overlayBottomRight != null) - height += overlayOverflow; - if (overlayTopLeft != null || overlayTopRight != null) - height += overlayOverflow; - if (overlayBottomRight != null || overlayTopRight != null) - width += overlayOverflow;*/ - } - - const int overlayOverflow = 2; - - protected override void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags) - { - base.Render (window, widget, background_area, cell_area, expose_area, flags); - - if (overlayBottomLeft != null || overlayBottomRight != null || overlayTopLeft != null || overlayTopRight != null) { - int x, y; - Xwt.Drawing.Image image; - GetImageInfo (cell_area, out image, out x, out y); - - if (image == null) - return; - - bool selected = (flags & Gtk.CellRendererState.Selected) != 0; - - using (var ctx = Gdk.CairoHelper.Create (window)) { - if (overlayBottomLeft != null && overlayBottomLeft != NullImage) { - var img = selected ? overlayBottomLeft.WithStyles ("sel") : overlayBottomLeft; - ctx.DrawImage (widget, img, x - overlayOverflow, y + image.Height - img.Height + overlayOverflow); - } - if (overlayBottomRight != null && overlayBottomRight != NullImage) { - var img = selected ? overlayBottomRight.WithStyles ("sel") : overlayBottomRight; - ctx.DrawImage (widget, img, x + image.Width - img.Width + overlayOverflow, y + image.Height - img.Height + overlayOverflow); - } - if (overlayTopLeft != null && overlayTopLeft != NullImage) { - var img = selected ? overlayTopLeft.WithStyles ("sel") : overlayTopLeft; - ctx.DrawImage (widget, img, x - overlayOverflow, y - overlayOverflow); - } - if (overlayTopRight != null && overlayTopRight != NullImage) { - var img = selected ? overlayTopRight.WithStyles ("sel") : overlayTopRight; - ctx.DrawImage (widget, img, x + image.Width - img.Width + overlayOverflow, y - overlayOverflow); - } - } - } - } - } - - class NodeHashtable: Dictionary - { - // This dictionary can be configured to use object reference equality - // instead of regular object equality for a specific set of types - - NodeComparer nodeComparer; - - public NodeHashtable (): base (new NodeComparer ()) - { - nodeComparer = (NodeComparer)Comparer; - } - - /// - /// Sets that the objects of the specified type have to be compared - /// using object reference equality - /// - public void RegisterByRefType (Type type) - { - nodeComparer.byRefTypes.Add (type); - } - - class NodeComparer: IEqualityComparer - { - public HashSet byRefTypes = new HashSet (); - public Dictionary typeData = new Dictionary (); - - bool IEqualityComparer.Equals (object x, object y) - { - if (CompareByRef (x.GetType ())) - return x == y; - else - return x.Equals (y); - } - - int IEqualityComparer.GetHashCode (object obj) - { - if (CompareByRef (obj.GetType ())) - return System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode (obj); - else - return obj.GetHashCode (); - } - - bool CompareByRef (Type type) - { - if (byRefTypes.Count == 0) - return false; - - bool compareRef; - if (!typeData.TryGetValue (type, out compareRef)) { - compareRef = false; - var t = type; - while (t != null) { - if (byRefTypes.Contains (t)) { - compareRef = true; - break; - } - t = t.BaseType; - } - typeData [type] = compareRef; - } - return compareRef; - } - } - } -} + ctx.RegisterCondition ("FileType", fileTypeCondition); + } + + CommandEntrySet eset = IdeApp.CommandService.CreateCommandEntrySet (ctx, menuPath); + + eset.AddItem (Command.Separator); + if (!tnav.Clone ().MoveToParent ()) { + CommandEntrySet opset = eset.AddItemSet (GettextCatalog.GetString ("Display Options")); + opset.AddItem (ViewCommands.TreeDisplayOptionList); + opset.AddItem (Command.Separator); + opset.AddItem (ViewCommands.ResetTreeDisplayOptions); + // opset.AddItem (ViewCommands.CollapseAllTreeNodes); + } + eset.AddItem (ViewCommands.RefreshTree); + return eset; + } + } + + [CommandUpdateHandler (ViewCommands.TreeDisplayOptionList)] + internal void BuildTreeOptionsMenu (CommandArrayInfo info) + { + foreach (TreePadOption op in options) { + CommandInfo ci = new CommandInfo (op.Label); + ci.Checked = globalOptions [op.Id]; + info.Add (ci, op.Id); + } + } + + [CommandHandler (ViewCommands.TreeDisplayOptionList)] + internal void OptionToggled (string optionId) + { + globalOptions [optionId] = !globalOptions [optionId]; + RefreshRoots (); + } + + [CommandHandler (ViewCommands.ResetTreeDisplayOptions)] + public void ResetOptions () + { + foreach (TreePadOption op in options) + globalOptions [op.Id] = op.DefaultValue; + + RefreshRoots (); + } + + void RefreshRoots () + { + Gtk.TreeIter it; + if (!store.GetIterFirst (out it)) + return; + do { + ITreeBuilder tb = CreateBuilder (it); + tb.UpdateAll (); + } while (store.IterNext (ref it)); + } + + public void RefreshTree () + { + foreach (TreeNodeNavigator node in GetSelectedNodes ()) { + Gtk.TreeIter it = node.CurrentPosition._iter; + if (store.IterIsValid (it)) { + ITreeBuilder tb = CreateBuilder (it); + tb.UpdateAll (); + } + } + } + + [CommandHandler (ViewCommands.CollapseAllTreeNodes)] + public void CollapseTree () + { + tree.CollapseAll(); + } + + [GLib.ConnectBefore] + void OnKeyPress (object o, Gtk.KeyPressEventArgs args) + { + HideStatusMessage (); + + if (args.Event.Key == Gdk.Key.Delete || args.Event.Key == Gdk.Key.KP_Delete) { + DeleteCurrentItem (); + args.RetVal = true; + return; + } + + //HACK: to work around "Bug 377810 - Many errors when expanding MonoDevelop treeviews with keyboard" + // The shift-right combo recursively expands all child nodes but the OnTestExpandRow callback + // modifies tree and successive calls get passed an invalid iter. Using the path to regenerate the iter + // causes a Gtk-Fatal. + bool shift = (args.Event.State & Gdk.ModifierType.ShiftMask) != 0; + if (args.Event.Key == Gdk.Key.asterisk || args.Event.Key == Gdk.Key.KP_Multiply + || (shift && (args.Event.Key == Gdk.Key.Right || args.Event.Key == Gdk.Key.KP_Right + || args.Event.Key == Gdk.Key.plus || args.Event.Key == Gdk.Key.KP_Add))) + { + Gtk.TreeIter iter; + foreach (Gtk.TreePath path in tree.Selection.GetSelectedRows ()) { + store.GetIter (out iter, path); + Expand (iter); + } + args.RetVal = true; + return; + } + + if (args.Event.Key == Gdk.Key.Right || args.Event.Key == Gdk.Key.KP_Right) { + ExpandCurrentItem (); + args.RetVal = true; + return; + } + + if (args.Event.Key == Gdk.Key.Left || args.Event.Key == Gdk.Key.KP_Left) { + CollapseCurrentItem (); + args.RetVal = true; + return; + } + + if (args.Event.Key == Gdk.Key.Return || args.Event.Key == Gdk.Key.KP_Enter || args.Event.Key == Gdk.Key.ISO_Enter) { + ActivateCurrentItem (); + args.RetVal = true; + return; + } + } + + [CommandHandler (SearchCommands.Find)] + void HandleSearchCommand () + { + IdeApp.CommandService.DispatchCommand (MonoDevelop.Components.MainToolbar.Commands.NavigateTo); + } + + void Expand (Gtk.TreeIter it) + { + tree.ExpandRow (store.GetPath (it), false); + Gtk.TreeIter ci; + if (store.IterChildren (out ci, it)) { + do { + Expand (ci); + } while (store.IterNext (ref ci)); + } + } + + void OnNodeActivated (object sender, Gtk.RowActivatedArgs args) + { + ActivateCurrentItem (); + } + + void OnPerformPress (object sender, EventArgs args) + { + ActivateCurrentItem (); + } + + void OnSelectionChanged (object sender, EventArgs args) + { + TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); + if (node != null) { + NodeBuilder[] chain = node.NodeBuilderChain; + NodePosition pos = node.CurrentPosition; + foreach (NodeBuilder b in chain) { + try { + NodeCommandHandler handler = b.CommandHandler; + handler.SetCurrentNode (node); + handler.OnItemSelected (); + } catch (Exception ex) { + LoggingService.LogError (ex.ToString ()); + } + node.MoveToPosition (pos); + } + } + OnSelectionChanged (); + } + + protected virtual void OnSelectionChanged () + { + if (SelectionChanged != null) + SelectionChanged (this, EventArgs.Empty); + } + + void Destroy () + { + IdeApp.Preferences.CustomPadFont.Changed -= CustomFontPropertyChanged; + if (pix_render != null) { +// pix_render.Destroy (); + pix_render = null; + } + if (complete_column != null) { +// complete_column.Destroy (); + complete_column = null; + } + if (text_render != null) { +// text_render.Destroy (); + text_render = null; + } + + if (store != null) { + Clear (); + store = null; + } + + if (builders != null) { + foreach (NodeBuilder nb in builders) { + try { + nb.Dispose (); + } catch (Exception ex) { + LoggingService.LogError (ex.ToString ()); + } + } + builders = null; + } + builderChains.Clear (); + } + + object ICommandRouter.GetNextCommandTarget () + { + return widget.Parent; + } + + internal class PadCheckMenuItem: Gtk.CheckMenuItem + { + internal string Id; + + public PadCheckMenuItem (string label, string id): base (label) { + Id = id; + } + } + + internal class TreeBuilderContext: ITreeBuilderContext + { + ExtensibleTreeView pad; + Hashtable icons = new Hashtable (); + Hashtable composedIcons = new Hashtable (); + + internal TreeBuilderContext (ExtensibleTreeView pad) + { + this.pad = pad; + } + + public ITreeBuilder GetTreeBuilder () + { + Gtk.TreeIter iter; + if (!pad.store.GetIterFirst (out iter)) + return pad.CreateBuilder (Gtk.TreeIter.Zero); + else + return pad.CreateBuilder (iter); + } + + public ITreeBuilder GetTreeBuilder (object dataObject) + { + ITreeBuilder tb = pad.CreateBuilder (); + if (tb.MoveToObject (dataObject)) + return tb; + else + return null; + } + + public ITreeBuilder GetTreeBuilder (ITreeNavigator navigator) + { + return pad.CreateBuilder (navigator.CurrentPosition._iter); + } + + public Xwt.Drawing.Image GetIcon (string id) + { + Xwt.Drawing.Image icon = icons [id] as Xwt.Drawing.Image; + if (icon == null) { + icon = ImageService.GetIcon (id).WithSize (Gtk.IconSize.Menu); + icons [id] = icon; + } + return icon; + } + + public Xwt.Drawing.Image GetComposedIcon (Xwt.Drawing.Image baseIcon, object compositionKey) + { + Hashtable itable = composedIcons [baseIcon] as Hashtable; + if (itable == null) return null; + return itable [compositionKey] as Xwt.Drawing.Image; + } + + public Xwt.Drawing.Image CacheComposedIcon (Xwt.Drawing.Image baseIcon, object compositionKey, Xwt.Drawing.Image composedIcon) + { + Hashtable itable = composedIcons [baseIcon] as Hashtable; + if (itable == null) { + itable = new Hashtable (); + composedIcons [baseIcon] = itable; + } + itable [compositionKey] = composedIcon; + return composedIcon; + } + + public ITreeNavigator GetTreeNavigator (object dataObject) + { + Gtk.TreeIter iter; + if (!pad.GetFirstNode (dataObject, out iter)) return null; + return new TreeNodeNavigator (pad, iter); + } + + public ExtensibleTreeView Tree { + get { return pad; } + } + } + + class ExtensibleTreeViewTree : ContextMenuTreeView + { + ExtensibleTreeView tv; + + public ExtensibleTreeViewTree (ExtensibleTreeView tv) + { + this.tv = tv; + EnableModelDragDest (targetTable, Gdk.DragAction.Copy | Gdk.DragAction.Move); + Gtk.Drag.SourceSet (this, Gdk.ModifierType.Button1Mask, targetTable, Gdk.DragAction.Copy | Gdk.DragAction.Move); + } + + static Gtk.TargetEntry [] targetTable = new Gtk.TargetEntry [] { + new Gtk.TargetEntry ("text/uri-list", 0, 11 ), + new Gtk.TargetEntry ("text/plain", 0, 22), + new Gtk.TargetEntry ("application/x-rootwindow-drop", 0, 33) + }; + + public object[] dragObjects = null; + bool dropping = false; + Func nodeToUri; + + public void EnableDragUriSource (Func nodeToUri) + { + this.nodeToUri = nodeToUri; + } + + protected override void OnDragBegin (Gdk.DragContext context) + { + Xwt.Drawing.Image dragIcon; + dragObjects = tv.GetDragObjects (out dragIcon); + Gtk.Drag.SetIconPixbuf (context, dragIcon != null ? dragIcon.ToPixbuf (Gtk.IconSize.Menu) : null, -10, -10); + + base.OnDragBegin (context); + } + + protected override void OnDragEnd (Gdk.DragContext context) + { + dragObjects = null; + base.OnDragEnd (context); + } + + protected override bool OnDragMotion (Gdk.DragContext context, int x, int y, uint time) + { + //OnDragDataReceived callback loses x/y values, so stash them + this.x = x; + this.y = y; + + if (dragObjects == null) { + //it's a drag from outside, need to retrieve the data. This will cause OnDragDataReceived to be called. + Gdk.Atom atom = Gtk.Drag.DestFindTarget (this, context, null); + Gtk.Drag.GetData (this, context, atom, time); + } else { + //it's from inside, can call OnDragDataReceived directly + OnDragDataReceived (context, x, y, null, 0, time); + } + return true; + } + + int x, y; + + protected override void OnDragDataReceived (Gdk.DragContext context, int x, int y, Gtk.SelectionData selection_data, uint info, uint time) + { + x = this.x; + y = this.y; + + object[] data = dragObjects ?? new object[] { selection_data }; + bool canDrop = tv.CheckAndDrop (x, y, dropping, context, data); + if (dropping) { + dropping = false; + SetDragDestRow (null, 0); + Gtk.Drag.Finish (context, canDrop, true, time); + return; + } + + //let default handler handle hover-to-expand, autoscrolling, etc + base.OnDragMotion (context, x, y, time); + + //if we can't handle it, flag as not droppable and remove the drop marker + if (!canDrop) { + Gdk.Drag.Status (context, (Gdk.DragAction)0, time); + SetDragDestRow (null, 0); + } + } + + protected override bool OnDragDrop (Gdk.DragContext context, int x, int y, uint time_) + { + dropping = true; + return base.OnDragDrop (context, x, y, time_); + } + + protected override void OnDragDataGet (Gdk.DragContext context, Gtk.SelectionData selection_data, uint info, uint time_) + { + if (dragObjects == null || nodeToUri == null) + return; + + uint uriListTarget = targetTable [0].Info; + if (info == uriListTarget) { + var sb = new StringBuilder (); + foreach (var dobj in dragObjects) { + var val = nodeToUri (dobj); + if (val != null) { + sb.AppendLine (val); + } + } + selection_data.Set (selection_data.Target, selection_data.Format, Encoding.UTF8.GetBytes (sb.ToString ())); + } + } + } + + class CustomCellRendererText: Gtk.CellRendererText + { + double zoom; + Pango.Layout layout; + Pango.FontDescription scaledFont, customFont; + + ExtensibleTreeView parent; + Gdk.Rectangle buttonScreenRect; + Gdk.Rectangle buttonAllocation; + string markup; + string secondarymarkup; + + const int StatusIconSpacing = 4; + + public bool Pushed { get; set; } + + //using this instead of FontDesc property, FontDesc seems to be broken + public Pango.FontDescription CustomFont { + get { + return customFont; + } + set { + if (scaledFont != null) { + scaledFont.Dispose (); + scaledFont = null; + } + customFont = value; + } + } + + static CustomCellRendererText () + { + } + + [GLib.Property ("text-markup")] + public string TextMarkup { + get { return markup; } + set { + markup = value; + if (!string.IsNullOrEmpty (secondarymarkup)) + Markup = markup + " " + secondarymarkup; + else + Markup = markup; + } + } + + [GLib.Property ("secondary-text-markup")] + public string SecondaryTextMarkup { + get { return secondarymarkup; } + set { + secondarymarkup = value; + if (!string.IsNullOrEmpty (secondarymarkup)) + Markup = markup + " " + secondarymarkup; + else + Markup = markup; + } + } + + public bool DisabledStyle { get; set; } + + [GLib.Property ("status-icon")] + public Xwt.Drawing.Image StatusIcon { get; set; } + + public CustomCellRendererText (ExtensibleTreeView parent) + { + this.parent = parent; + } + + static Xwt.Size defaultIconSize = Gtk.IconSize.Menu.GetSize (); + + static Xwt.Size GetZoomedIconSize (Xwt.Drawing.Image icon, double zoom) + { + if (icon == null || icon == CellRendererImage.NullImage) + return defaultIconSize; + + var size = icon.HasFixedSize ? icon.Size : defaultIconSize; + + if (zoom == 1) + return size; + + int w = (int) (zoom * (double) size.Width); + int h = (int) (zoom * (double) size.Height); + if (w == 0) w = 1; + if (h == 0) h = 1; + return new Xwt.Size (w, h); + } + + static Xwt.Drawing.Image GetResized (Xwt.Drawing.Image icon, double zoom) + { + var size = GetZoomedIconSize (icon, zoom); + return icon.WithSize (size); + } + + void SetupLayout (Gtk.Widget widget, Gtk.CellRendererState flags = 0) + { + if (scaledFont == null) { + if (scaledFont != null) + scaledFont.Dispose (); + scaledFont = (customFont ?? parent.widget.Style.FontDesc).Copy (); + scaledFont.Size = (int)(customFont.Size * Zoom); + if (layout != null) + layout.FontDescription = scaledFont; + } + + if (layout == null || layout.Context != widget.PangoContext) { + if (layout != null) + layout.Dispose (); + layout = new Pango.Layout (widget.PangoContext); + layout.FontDescription = scaledFont; + } + + string newmarkup = TextMarkup; + if (DisabledStyle) { + Gdk.Color fgColor; + if (Platform.IsMac && flags.HasFlag (Gtk.CellRendererState.Selected)) + fgColor = widget.Style.Text (IdeTheme.UserInterfaceTheme == Theme.Light ? Gtk.StateType.Selected : Gtk.StateType.Normal); + else + fgColor = widget.Style.Text (Gtk.StateType.Insensitive); + newmarkup = "" + TextMarkup + ""; + } + + if (!string.IsNullOrEmpty (SecondaryTextMarkup)) { + if (Platform.IsMac && flags.HasFlag (Gtk.CellRendererState.Selected)) + newmarkup += " " + SecondaryTextMarkup + ""; + else + newmarkup += " " + SecondaryTextMarkup + ""; + } + + layout.SetMarkup (newmarkup); + } + +// protected override void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags) +// { +// Gtk.StateType st = Gtk.StateType.Normal; +// if ((flags & Gtk.CellRendererState.Prelit) != 0) +// st = Gtk.StateType.Prelight; +// if ((flags & Gtk.CellRendererState.Focused) != 0) +// st = Gtk.StateType.Normal; +// if ((flags & Gtk.CellRendererState.Insensitive) != 0) +// st = Gtk.StateType.Insensitive; +// if ((flags & Gtk.CellRendererState.Selected) != 0) +// st = widget.HasFocus ? Gtk.StateType.Selected : Gtk.StateType.Active; +// +// SetupLayout (widget, flags); +// +// int w, h; +// layout.GetPixelSize (out w, out h); +// +// int tx = cell_area.X + (int)Xpad; +// int ty = cell_area.Y + (cell_area.Height - h) / 2; +// +// bool hasStatusIcon = StatusIcon != CellRendererImage.NullImage && StatusIcon != null; +// +// if (hasStatusIcon) { +// var img = GetResized (StatusIcon, zoom); +// if (st == Gtk.StateType.Selected) +// img = img.WithStyles ("sel"); +// var x = tx + w + StatusIconSpacing; +// using (var ctx = Gdk.CairoHelper.Create (window)) { +// ctx.DrawImage (widget, img, x, cell_area.Y + (cell_area.Height - img.Height) / 2); +// } +// } +// +// window.DrawLayout (widget.Style.TextGC (st), tx, ty, layout); +// +// hasStatusIcon = false; +// } + + public Gdk.Rectangle GetStatusIconArea (Gtk.Widget widget, Gdk.Rectangle cell_area) + { + SetupLayout (widget); + + int w, h; + layout.GetPixelSize (out w, out h); + + var iconSize = GetZoomedIconSize (StatusIcon, zoom); + int tx = cell_area.X + (int)Xpad; + var x = tx + w + StatusIconSpacing; + return new Gdk.Rectangle (x, cell_area.Y, (int) iconSize.Width, (int) cell_area.Height); + } + +// public override void GetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) +// { +// SetupLayout (widget); +// +// x_offset = y_offset = 0; +// +// layout.GetPixelSize (out width, out height); +// width += (int)Xpad * 2; +// +// if (StatusIcon != CellRendererImage.NullImage && StatusIcon != null) { +// var iconSize = GetZoomedIconSize (StatusIcon, zoom); +// width += (int)iconSize.Width + StatusIconSpacing; +// } +// } + + protected override void OnEditingStarted (Gtk.ICellEditable editable, string path) + { + var entry = editable as Gtk.Entry; + if (entry != null && scaledFont != null) + entry.ModifyFont (scaledFont); + base.OnEditingStarted (editable, path); + } + + public double Zoom { + get { + return zoom; + } + set { + if (scaledFont != null) { + scaledFont.Dispose (); + scaledFont = null; + } + zoom = value; + } + } + + public bool PointerInButton (int px, int py) + { + return buttonScreenRect.Contains (px, py); + } + + public Gdk.Point PointerPosition { get; set; } + + public Gdk.Rectangle PopupAllocation { + get { return buttonAllocation; } + } + +// protected override void OnDestroyed () +// { +// base.OnDestroyed (); +// if (scaledFont != null) +// scaledFont.Dispose (); +// if (layout != null) +// layout.Dispose (); +// } + } + } + + class NodeCommandTargetChain: ICommandDelegatorRouter + { + NodeCommandHandler target; + ITreeNavigator[] nodes; + internal NodeCommandTargetChain Next; + + public NodeCommandTargetChain (NodeCommandHandler target, ITreeNavigator[] nodes) + { + this.nodes = nodes; + this.target = target; + } + + public object GetNextCommandTarget () + { + target.SetCurrentNodes (null); + return Next; + } + + public object GetDelegatedCommandTarget () + { + target.SetCurrentNodes (nodes); + return target; + } + } + + class IterComparer: IEqualityComparer + { + Gtk.TreeStore store; + + public IterComparer (Gtk.TreeStore store) + { + this.store = store; + } + public bool Equals (Gtk.TreeIter x, Gtk.TreeIter y) + { + if (!store.IterIsValid (x) || !store.IterIsValid (y)) + return false; + Gtk.TreePath px = store.GetPath (x); + Gtk.TreePath py = store.GetPath (y); + if (px == null || py == null) + return false; + return px.Equals (py); + } + + public int GetHashCode (Gtk.TreeIter obj) + { + if (!store.IterIsValid (obj)) + return 0; + Gtk.TreePath p = store.GetPath (obj); + if (p == null) + return 0; + else + return p.ToString ().GetHashCode (); + } + } + + class ZoomableCellRendererPixbuf: CellRendererImage + { + double zoom = 1f; + + Dictionary resizedCache = new Dictionary (); + + Xwt.Drawing.Image overlayBottomLeft; + Xwt.Drawing.Image overlayBottomRight; + Xwt.Drawing.Image overlayTopLeft; + Xwt.Drawing.Image overlayTopRight; + + public ZoomableCellRendererPixbuf () : base () + { + } + + public double Zoom { + get { return zoom; } + set { + if (zoom != value) { + zoom = value; + resizedCache.Clear (); + Notify ("image"); + } + } + } + + public override Xwt.Drawing.Image Image { + get { + return base.Image; + } + set { + base.Image = GetResized (value); + } + } + + public override Xwt.Drawing.Image ImageExpanderOpen { + get { + return base.ImageExpanderOpen; + } + set { + base.ImageExpanderOpen = GetResized (value); + } + } + + public override Xwt.Drawing.Image ImageExpanderClosed { + get { + return base.ImageExpanderClosed; + } + set { + base.ImageExpanderClosed = GetResized (value); + } + } + + [GLib.Property ("overlay-image-top-left")] + public Xwt.Drawing.Image OverlayTopLeft { + get { + return overlayTopLeft; + } + set { + overlayTopLeft = GetResized (value); + } + } + + [GLib.Property ("overlay-image-top-right")] + public Xwt.Drawing.Image OverlayTopRight { + get { + return overlayTopRight; + } + set { + overlayTopRight = GetResized (value); + } + } + + [GLib.Property ("overlay-image-bottom-left")] + public Xwt.Drawing.Image OverlayBottomLeft { + get { + return overlayBottomLeft; + } + set { + overlayBottomLeft = GetResized (value); + } + } + + [GLib.Property ("overlay-image-bottom-right")] + public Xwt.Drawing.Image OverlayBottomRight { + get { + return overlayBottomRight; + } + set { + overlayBottomRight = GetResized (value); + } + } + + Xwt.Drawing.Image GetResized (Xwt.Drawing.Image value) + { + //this can happen during solution deserialization if the project is unrecognized + //because a line is added into the treeview with no icon + if (value == null || value == CellRendererImage.NullImage) + return null; + + var img = value.HasFixedSize ? value : value.WithSize (Gtk.IconSize.Menu); + + if (zoom == 1) + return img; + + Xwt.Drawing.Image resized; + if (resizedCache.TryGetValue (img, out resized)) + return resized; + + int w = (int) (zoom * (double) img.Width); + int h = (int) (zoom * (double) img.Height); + if (w == 0) w = 1; + if (h == 0) h = 1; + resized = img.WithSize (w, h); + resizedCache [img] = resized; + return resized; + } + +// public override void GetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) +// { +// base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); +// /* if (overlayBottomLeft != null || overlayBottomRight != null) +// height += overlayOverflow; +// if (overlayTopLeft != null || overlayTopRight != null) +// height += overlayOverflow; +// if (overlayBottomRight != null || overlayTopRight != null) +// width += overlayOverflow;*/ +// } + + const int overlayOverflow = 2; + +// protected override void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags) +// { +// base.Render (window, widget, background_area, cell_area, expose_area, flags); +// +// if (overlayBottomLeft != null || overlayBottomRight != null || overlayTopLeft != null || overlayTopRight != null) { +// int x, y; +// Xwt.Drawing.Image image; +// GetImageInfo (cell_area, out image, out x, out y); +// +// if (image == null) +// return; +// +// bool selected = (flags & Gtk.CellRendererState.Selected) != 0; +// +// using (var ctx = Gdk.CairoHelper.Create (window)) { +// if (overlayBottomLeft != null && overlayBottomLeft != NullImage) { +// var img = selected ? overlayBottomLeft.WithStyles ("sel") : overlayBottomLeft; +// ctx.DrawImage (widget, img, x - overlayOverflow, y + image.Height - img.Height + overlayOverflow); +// } +// if (overlayBottomRight != null && overlayBottomRight != NullImage) { +// var img = selected ? overlayBottomRight.WithStyles ("sel") : overlayBottomRight; +// ctx.DrawImage (widget, img, x + image.Width - img.Width + overlayOverflow, y + image.Height - img.Height + overlayOverflow); +// } +// if (overlayTopLeft != null && overlayTopLeft != NullImage) { +// var img = selected ? overlayTopLeft.WithStyles ("sel") : overlayTopLeft; +// ctx.DrawImage (widget, img, x - overlayOverflow, y - overlayOverflow); +// } +// if (overlayTopRight != null && overlayTopRight != NullImage) { +// var img = selected ? overlayTopRight.WithStyles ("sel") : overlayTopRight; +// ctx.DrawImage (widget, img, x + image.Width - img.Width + overlayOverflow, y - overlayOverflow); +// } +// } +// } +// } + } + + class NodeHashtable: Dictionary + { + // This dictionary can be configured to use object reference equality + // instead of regular object equality for a specific set of types + + NodeComparer nodeComparer; + + public NodeHashtable (): base (new NodeComparer ()) + { + nodeComparer = (NodeComparer)Comparer; + } + + /// + /// Sets that the objects of the specified type have to be compared + /// using object reference equality + /// + public void RegisterByRefType (Type type) + { + nodeComparer.byRefTypes.Add (type); + } + + class NodeComparer: IEqualityComparer + { + public HashSet byRefTypes = new HashSet (); + public Dictionary typeData = new Dictionary (); + + bool IEqualityComparer.Equals (object x, object y) + { + if (CompareByRef (x.GetType ())) + return x == y; + else + return x.Equals (y); + } + + int IEqualityComparer.GetHashCode (object obj) + { + if (CompareByRef (obj.GetType ())) + return System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode (obj); + else + return obj.GetHashCode (); + } + + bool CompareByRef (Type type) + { + if (byRefTypes.Count == 0) + return false; + + bool compareRef; + if (!typeData.TryGetValue (type, out compareRef)) { + compareRef = false; + var t = type; + while (t != null) { + if (byRefTypes.Contains (t)) { + compareRef = true; + break; + } + t = t.BaseType; + } + typeData [type] = compareRef; + } + return compareRef; + } + } + } +} diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/PadTreeView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/PadTreeView.cs index f4ff469969b..b88566188a8 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/PadTreeView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/PadTreeView.cs @@ -56,7 +56,7 @@ public PadTreeView () Init (); } - public PadTreeView (TreeModel model) : base (model) + public PadTreeView (ITreeModel model) : base (model) { Init (); } @@ -194,4 +194,4 @@ void OnColumnVisibilityChanged (object sender, EventArgs args) PropertyService.Set (id, builder.ToString ()); } } -} \ No newline at end of file +} diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeBuilder.cs index be5a387fe5a..78e5146841a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeBuilder.cs @@ -155,7 +155,7 @@ internal static NodeAttributes GetAttributes (ITreeBuilder tb, NodeBuilder[] cha return ats; } - static int NullSortFunc (Gtk.TreeModel model, Gtk.TreeIter a, Gtk.TreeIter b) + static int NullSortFunc (Gtk.ITreeModel model, Gtk.TreeIter a, Gtk.TreeIter b) { return 0; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs index 33b444c0683..98590fe742a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs @@ -60,8 +60,8 @@ public CommonAboutDialog () Name = "wizard_dialog"; Title = string.Format (GettextCatalog.GetString ("About {0}"), BrandingService.ApplicationLongName); TransientFor = IdeApp.Workbench.RootWindow; - AllowGrow = false; - HasSeparator = false; + this.Resizable = true; +// HasSeparator = false; BorderWidth = 0; var notebook = new Notebook (); @@ -70,7 +70,7 @@ public CommonAboutDialog () notebook.BorderWidth = 0; notebook.AppendPage (new AboutMonoDevelopTabPage (), new Label (Title)); notebook.AppendPage (new VersionInformationTabPage (), new Label (GettextCatalog.GetString ("Version Information"))); - VBox.PackStart (notebook, true, true, 0); + ContentArea.PackStart (notebook, true, true, 0); var copyButton = new Button () { Label = GettextCatalog.GetString ("Copy Information") }; copyButton.Clicked += (sender, e) => CopyBufferToClipboard (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs index 414c87cf669..ad63fb82618 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs @@ -97,7 +97,7 @@ public DirtyFilesDialog (IReadOnlyList docs, bool closeWorkspace, bool sc.ShadowType = ShadowType.In; sc.BorderWidth = 6; - this.VBox.PackStart (sc, true, true, 6); + this.ContentArea.PackStart (sc, true, true, 6); btnSaveAndQuit = new Button (closeWorkspace ? GettextCatalog.GetString ("_Save and Quit") : GettextCatalog.GetString ("_Save and Close")); btnSaveAndQuit.Accessible.Name = "Dialog.DirtyFiles.SaveAndQuit"; @@ -131,9 +131,9 @@ public DirtyFilesDialog (IReadOnlyList docs, bool closeWorkspace, bool btnQuit.Clicked += Quit; btnCancel.Clicked += Cancel; - this.ActionArea.PackStart (btnCancel); - this.ActionArea.PackStart (btnQuit); - this.ActionArea.PackStart (btnSaveAndQuit); + this.ActionArea.PackStart (btnCancel, false, true, 0); + this.ActionArea.PackStart (btnQuit, false, true, 0); + this.ActionArea.PackStart (btnSaveAndQuit, false, true, 0); this.SetDefaultSize (300, 200); this.Child.ShowAll (); } @@ -150,11 +150,11 @@ protected override void OnDestroyed () btnCancel.Clicked -= Cancel; if (togRender != null) { togRender.Toggled -= toggled; - togRender.Destroy (); +// togRender.Destroy (); togRender = null; } if (textRender != null) { - textRender.Destroy (); +// textRender.Destroy (); textRender = null; } base.OnDestroyed (); @@ -165,7 +165,7 @@ async void SaveAndQuit (object o, EventArgs e) Sensitive = false; List saveTasks = new List (); - tsFiles.Foreach (delegate (TreeModel model, TreePath path, TreeIter iter) { + tsFiles.Foreach (delegate (ITreeModel model, TreePath path, TreeIter iter) { var window = tsFiles.GetValue (iter, 2) as SdiWorkspaceWindow; if (window == null) return false; @@ -189,7 +189,7 @@ async void SaveAndQuit (object o, EventArgs e) void Quit (object o, EventArgs e) { - tsFiles.Foreach (delegate (TreeModel model, TreePath path, TreeIter iter) { + tsFiles.Foreach (delegate (ITreeModel model, TreePath path, TreeIter iter) { var window = tsFiles.GetValue (iter, 2) as SdiWorkspaceWindow; if (window == null) return false; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FeedbackDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FeedbackDialog.cs index 869c87f0179..73b3bac995c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FeedbackDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FeedbackDialog.cs @@ -50,10 +50,10 @@ public FeedbackDialog (int x, int y): base (Gtk.WindowType.Toplevel) SetDefaultSize (350, 200); if (x == -1 && y == -1) { int ww, wh; - IdeApp.Workbench.RootWindow.GdkWindow.GetSize (out ww, out wh); - IdeApp.Workbench.RootWindow.GdkWindow.GetOrigin (out x, out y); - x = ww / 2 - 350 / 2; - y = wh / 2 - 200 / 2; +// IdeApp.Workbench.RootWindow.GdkWindow.GetSize (out ww, out wh); +// IdeApp.Workbench.RootWindow.GdkWindow.GetOrigin (out x, out y); +// x = ww / 2 - 350 / 2; +// y = wh / 2 - 200 / 2; Move (x, y); } else Move (x - 350, y - 200); @@ -243,92 +243,92 @@ protected override bool OnFocusOutEvent (Gdk.EventFocus evnt) class TextViewWithEmptyMessage: Gtk.TextView { private Pango.Layout layout; - private Gdk.GC text_gc; +// private Gdk.GC text_gc; public string EmptyMessage { get; set; } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - bool res = base.OnExposeEvent (evnt); - if (Buffer.Text.Length == 0 && !string.IsNullOrEmpty (EmptyMessage)) { - if (text_gc == null) { - text_gc = new Gdk.GC (evnt.Window); - text_gc.Copy (Style.TextGC (Gtk.StateType.Normal)); - Gdk.Color color_a = Style.Base (Gtk.StateType.Normal); - Gdk.Color color_b = Style.Text (Gtk.StateType.Normal); - text_gc.RgbFgColor = EntryWithEmptyMessage.ColorBlend (color_a, color_b); - } - - if (layout == null) { - layout = new Pango.Layout (PangoContext); - layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11); - } - - int width, height; - layout.SetMarkup (EmptyMessage); - layout.GetPixelSize (out width, out height); - evnt.Window.DrawLayout (text_gc, 2, 2, layout); - } - return res; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// bool res = base.OnExposeEvent (evnt); +// if (Buffer.Text.Length == 0 && !string.IsNullOrEmpty (EmptyMessage)) { +// if (text_gc == null) { +// text_gc = new Gdk.GC (evnt.Window); +// text_gc.Copy (Style.TextGC (Gtk.StateType.Normal)); +// Gdk.Color color_a = Style.Base (Gtk.StateType.Normal); +// Gdk.Color color_b = Style.Text (Gtk.StateType.Normal); +// text_gc.RgbFgColor = EntryWithEmptyMessage.ColorBlend (color_a, color_b); +// } +// +// if (layout == null) { +// layout = new Pango.Layout (PangoContext); +// layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11); +// } +// +// int width, height; +// layout.SetMarkup (EmptyMessage); +// layout.GetPixelSize (out width, out height); +// evnt.Window.DrawLayout (text_gc, 2, 2, layout); +// } +// return res; +// } - protected override void OnDestroyed () + protected override void OnDestroyed () { if (layout != null) { layout.Dispose (); layout = null; } - if (text_gc != null) { - text_gc.Dispose (); - text_gc = null; - } - base.OnDestroyed (); +// if (text_gc != null) { +// text_gc.Dispose (); +// text_gc = null; +// } + base.OnDestroyed (); } } class EntryWithEmptyMessage: Gtk.Entry { private Pango.Layout layout; - private Gdk.GC text_gc; +// private Gdk.GC text_gc; public string EmptyMessage { get; set; } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - bool res = base.OnExposeEvent (evnt); - if (Text.Length == 0 && !string.IsNullOrEmpty (EmptyMessage)) { - if (text_gc == null) { - text_gc = new Gdk.GC (evnt.Window); - text_gc.Copy (Style.TextGC (Gtk.StateType.Normal)); - Gdk.Color color_a = Style.Base (Gtk.StateType.Normal); - Gdk.Color color_b = Style.Text (Gtk.StateType.Normal); - text_gc.RgbFgColor = ColorBlend (color_a, color_b); - } - - if (layout == null) { - layout = new Pango.Layout (PangoContext); - layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11); - } - - int width, height; - layout.SetMarkup (EmptyMessage); - layout.GetPixelSize (out width, out height); - evnt.Window.DrawLayout (text_gc, 2, 2, layout); - } - return res; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// bool res = base.OnExposeEvent (evnt); +// if (Text.Length == 0 && !string.IsNullOrEmpty (EmptyMessage)) { +// if (text_gc == null) { +// text_gc = new Gdk.GC (evnt.Window); +// text_gc.Copy (Style.TextGC (Gtk.StateType.Normal)); +// Gdk.Color color_a = Style.Base (Gtk.StateType.Normal); +// Gdk.Color color_b = Style.Text (Gtk.StateType.Normal); +// text_gc.RgbFgColor = ColorBlend (color_a, color_b); +// } +// +// if (layout == null) { +// layout = new Pango.Layout (PangoContext); +// layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11); +// } +// +// int width, height; +// layout.SetMarkup (EmptyMessage); +// layout.GetPixelSize (out width, out height); +// evnt.Window.DrawLayout (text_gc, 2, 2, layout); +// } +// return res; +// } - protected override void OnDestroyed () + protected override void OnDestroyed () { if (layout != null) { layout.Dispose (); layout = null; } - if (text_gc != null) { - text_gc.Dispose (); - text_gc = null; - } - base.OnDestroyed (); +// if (text_gc != null) { +// text_gc.Dispose (); +// text_gc = null; +// } + base.OnDestroyed (); } public static Gdk.Color ColorBlend (Gdk.Color a, Gdk.Color b) @@ -359,7 +359,7 @@ public static Gdk.Color ColorBlend (Gdk.Color a, Gdk.Color b) double blB = mB * blendRatio; Gdk.Color color = new Gdk.Color ((byte)blR, (byte)blG, (byte)blB); - Gdk.Colormap.System.AllocColor (ref color, true, true); +// Gdk.Colormap.System.AllocColor (ref color, true, true); return color; } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs index 0c42fa9d38b..9ec54ba360a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs @@ -48,9 +48,9 @@ class FileSelectorDialog: FileSelector int firstEncIndex; Gtk.Label encodingLabel; - Gtk.OptionMenu encodingMenu; + Gtk.ComboBoxText encodingMenu; Gtk.Label viewerLabel; - Gtk.ComboBox viewerSelector; + Gtk.ComboBoxText viewerSelector; Gtk.CheckButton closeWorkspaceCheck; List currentViewers = new List (); @@ -71,9 +71,9 @@ public FileSelectorDialog (string title, Gtk.FileChooserAction action): base (ti encodingLabel.Xalign = 0; table.Attach (encodingLabel, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0); - encodingMenu = new Gtk.OptionMenu (); + encodingMenu = new Gtk.ComboBoxText (); FillEncodings (); - encodingMenu.SetHistory (0); + encodingMenu.Active = 0; table.Attach (encodingMenu, 1, 2, 0, 1, AttachOptions.Expand|AttachOptions.Fill, AttachOptions.Expand|AttachOptions.Fill, 0, 0); encodingMenu.Changed += EncodingChanged; @@ -84,7 +84,7 @@ public FileSelectorDialog (string title, Gtk.FileChooserAction action): base (ti table.Attach (viewerLabel, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0); Gtk.HBox box = new HBox (false, 6); - viewerSelector = Gtk.ComboBox.NewText (); + viewerSelector = new Gtk.ComboBoxText (); box.PackStart (viewerSelector, true, true, 0); closeWorkspaceCheck = new CheckButton (GettextCatalog.GetString ("Close current workspace")); closeWorkspaceCheck.Active = true; @@ -112,21 +112,18 @@ public int SelectedEncoding { get { if (!ShowEncodingSelector) return -1; - else if (encodingMenu.History < firstEncIndex || encodingMenu.History == selectOption) + else if (encodingMenu.Active < firstEncIndex || encodingMenu.Active == selectOption) return -1; - return TextEncoding.ConversionEncodings [encodingMenu.History - firstEncIndex].CodePage; + return TextEncoding.ConversionEncodings [encodingMenu.Active - firstEncIndex].CodePage; } set { for (uint n=0; n < TextEncoding.ConversionEncodings.Length; n++) { if (TextEncoding.ConversionEncodings [n].CodePage == value) { - encodingMenu.SetHistory (n + (uint)firstEncIndex); - Menu menu = (Menu)encodingMenu.Menu; - RadioMenuItem rm = (RadioMenuItem) menu.Children [n + firstEncIndex]; - rm.Active = true; + encodingMenu.Active = (int)(n + firstEncIndex); return; } } - encodingMenu.SetHistory (0); + encodingMenu.Active = 0; } } @@ -155,7 +152,7 @@ void FillEncodings () if (Action != Gtk.FileChooserAction.Save) { RadioMenuItem autodetect = new RadioMenuItem (GettextCatalog.GetString ("Auto Detected")); - autodetect.Group = new GLib.SList (typeof(object)); + autodetect.Group = new Gtk.RadioMenuItem [0]; menu.Append (autodetect); menu.Append (new Gtk.SeparatorMenuItem ()); autodetect.Active = true; @@ -170,7 +167,7 @@ void FillEncodings () menu.Append (mitem); if (defaultActivated == null) { defaultActivated = mitem; - defaultActivated.Group = new GLib.SList (typeof(object)); + defaultActivated.Group = new RadioMenuItem[0]; } else { mitem.Group = defaultActivated.Group; } @@ -186,16 +183,16 @@ void FillEncodings () menu.Append (select); menu.ShowAll (); - encodingMenu.Menu = menu; + //encodingMenu.Menu = menu; - encodingMenu.SetHistory (0); + encodingMenu.Active = 0; selectOption = firstEncIndex + TextEncoding.ConversionEncodings.Length + 1; } void EncodingChanged (object s, EventArgs args) { - if (encodingMenu.History == selectOption) { + if (encodingMenu.Active == selectOption) { using (var dlg = new SelectEncodingsDialog ()) MessageService.ShowCustomDialog (dlg, this); FillEncodings (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkAlertDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkAlertDialog.cs index 743114fc344..9cce6304b2c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkAlertDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkAlertDialog.cs @@ -59,7 +59,7 @@ public AlertButton ResultButton { void Init () { - VBox.PackStart (hbox); + ContentArea.PackStart (hbox, false, true, 0); hbox.PackStart (labelsBox, true, true, 0); labelsBox.PackStart (label, true, true, 0); @@ -68,10 +68,10 @@ void Init () this.BorderWidth = 6; //this.Type = WindowType.Toplevel; this.Resizable = false; - this.HasSeparator = false; +// this.HasSeparator = false; // Table 3.2 - this.VBox.Spacing = 12; + this.ContentArea.Spacing = 12; // Table 3.3 this.hbox.Spacing = 12; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsSection.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsSection.cs index 256bc85076c..3c24f7b7783 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsSection.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsSection.cs @@ -42,7 +42,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs { class MimeTypePolicyOptionsSection: OptionsPanel { - ComboBox policyCombo; + ComboBoxText policyCombo; ListStore store; PolicyBag bag; PolicySet polSet; @@ -96,13 +96,14 @@ public override Control CreatePanelWidget () hbox.PackStart (label, false, false, 0); store = new ListStore (typeof (string), typeof (PolicySet)); - policyCombo = new ComboBox (store); + policyCombo = new ComboBoxText (); + policyCombo.Model = store; CellRenderer renderer = new CellRendererText (); policyCombo.PackStart (renderer, true); policyCombo.AddAttribute (renderer, "text", 0); label.MnemonicWidget = policyCombo; - policyCombo.RowSeparatorFunc = (TreeModel model, TreeIter iter) => + policyCombo.RowSeparatorFunc = (ITreeModel model, TreeIter iter) => ((string) model.GetValue (iter, 0)) == "--"; hbox.PackStart (policyCombo, false, false, 0); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs index 62fc2913f1b..965522e734c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs @@ -43,7 +43,7 @@ public abstract class MultiConfigItemOptionsPanel: ItemOptionsPanel, IOptionsPan Gtk.ComboBox configCombo; Gtk.ListStore configListStore; const int configListStoreConfigNameColumn = 1; - Gtk.ComboBox platformCombo; + Gtk.ComboBoxText platformCombo; List currentConfigs = new List (); List platforms = new List (); Gtk.Widget panelWidget; @@ -114,7 +114,7 @@ Control IOptionsPanel.CreatePanelWidget () configCombo.AddAttribute (cell, "text", 0); combosBox.PackStart (configCombo, false, false, 0); combosBox.PackStart (new Gtk.Label (GettextCatalog.GetString ("Platform:")), false, false, 0); - platformCombo = Gtk.ComboBox.NewText (); + platformCombo = new Gtk.ComboBoxText (); platformCombo.Name = "panelWidgetPlatformCombo"; combosBox.PackStart (platformCombo, false, false, 0); cbox.PackStart (new Gtk.HSeparator (), false, false, 0); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs index d7558b5fb60..12a2e843635 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs @@ -95,7 +95,7 @@ public OptionsDialog (MonoDevelop.Components.Window parentWindow, object dataObj buttonOk = new Gtk.Button (Gtk.Stock.Ok); buttonOk.Accessible.Name = "Dialogs.Options.Ok"; buttonOk.Accessible.Description = GettextCatalog.GetString ("Close the options dialog and keep the changes"); - this.ActionArea.PackStart (buttonOk); + this.ActionArea.PackStart (buttonOk, false, true, 0); buttonOk.Clicked += OnButtonOkClicked; mainHBox = new HBox (); @@ -143,7 +143,7 @@ public OptionsDialog (MonoDevelop.Components.Window parentWindow, object dataObj imageHeader.Hide (); var imageHeaderWidget = imageHeader.ToGtkWidget (); imageHeaderWidget.Accessible.SetShouldIgnore (true); - headerBox.PackStart (imageHeaderWidget); + headerBox.PackStart (imageHeaderWidget, false, true, 0); var fboxHeader = new HeaderBox (); fboxHeader.Accessible.SetShouldIgnore (true); @@ -174,7 +174,7 @@ public OptionsDialog (MonoDevelop.Components.Window parentWindow, object dataObj fbox.Add (pageFrame); vbox.PackStart (fbox, true, true, 0); - this.VBox.PackStart (mainHBox, true, true, 0); + this.ContentArea.PackStart (mainHBox, true, true, 0); this.removeEmptySections = removeEmptySections; extensionContext = AddinManager.CreateExtensionContext (); @@ -225,7 +225,7 @@ public OptionsDialog (MonoDevelop.Components.Window parentWindow, object dataObj DefaultHeight = 680; } - static void PixbufCellDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) + static void PixbufCellDataFunc (TreeViewColumn col, CellRenderer cell, ITreeModel model, TreeIter iter) { TreeIter parent; bool toplevel = !model.IterParent (out parent, iter); @@ -255,7 +255,7 @@ static void PixbufCellDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel } } - static void TextCellDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) + static void TextCellDataFunc (TreeViewColumn col, CellRenderer cell, ITreeModel model, TreeIter iter) { TreeIter parent; bool toplevel = !model.IterParent (out parent, iter); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/PolicyOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/PolicyOptionsPanel.cs index e7e33028f1e..ded1189b60c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/PolicyOptionsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/PolicyOptionsPanel.cs @@ -74,7 +74,7 @@ Control IOptionsPanel.CreatePanelWidget () policyCombo.AddAttribute (renderer, "text", 0); label.MnemonicWidget = policyCombo; - policyCombo.RowSeparatorFunc = (TreeModel model, TreeIter iter) => + policyCombo.RowSeparatorFunc = (ITreeModel model, TreeIter iter) => ((string) model.GetValue (iter, 0)) == "--"; hbox.PackStart (policyCombo, false, false, 0); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs index 58586584fe6..edae5dbd061 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs @@ -53,7 +53,7 @@ public ProgressDialog (MonoDevelop.Components.Window parent, bool allowCancel, b MonoDevelop.Components.IdeTheme.ApplyTheme (this); this.Build (); this.Title = BrandingService.ApplicationName; - HasSeparator = false; +// HasSeparator = false; ActionArea.Hide (); DefaultHeight = 5; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SelectEncodingsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SelectEncodingsDialog.cs index 4551b3cdf52..2ab3c5e74a7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SelectEncodingsDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SelectEncodingsDialog.cs @@ -100,7 +100,7 @@ protected void OnRemoveClicked (object ob, EventArgs args) void EnsureItemIsSelected () { - TreeModel model; + ITreeModel model; TreeIter iter; // if the last item is removed no item is selected. if (!listSelected.Selection.GetSelected (out model, out iter)) { @@ -116,7 +116,7 @@ void EnsureItemIsSelected () void MoveItem (TreeView sourceList, ListStore sourceStore, TreeView targetList, ListStore targetStore) { - TreeModel model; + ITreeModel model; TreeIter iter; if (sourceList.Selection.GetSelected (out model, out iter)) { @@ -132,7 +132,7 @@ void MoveItem (TreeView sourceList, ListStore sourceStore, TreeView targetList, protected void OnUpClicked (object ob, EventArgs args) { - TreeModel model; + ITreeModel model; TreeIter iter; if (listSelected.Selection.GetSelected (out model, out iter)) { @@ -159,7 +159,7 @@ protected void OnUpClicked (object ob, EventArgs args) protected void OnDownClicked (object ob, EventArgs args) { - TreeModel model; + ITreeModel model; TreeIter iter; if (listSelected.Selection.GetSelected (out model, out iter)) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs index 93d162f65f5..2bfa1c11022 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs @@ -29,7 +29,7 @@ using System; using Mono.Addins; using Mono.Addins.Setup; -using Mono.Addins.Gui; +using Mono.Addins.GuiGtk3; using MonoDevelop.Core; using System.Threading.Tasks; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/VersionInformationTabPage.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/VersionInformationTabPage.cs index e1c2de5f954..b8d9eeb51d8 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/VersionInformationTabPage.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/VersionInformationTabPage.cs @@ -132,7 +132,7 @@ Gtk.Widget CreateAssembliesTable () box.PackStart (new Gtk.Label () { Markup = "LoadedAssemblies", Xalign = 0 - }); + }, false, true, 0); var table = new Gtk.Table (0, 0, false); table.ColumnSpacing = 3; uint line = 0; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs index 020b963c577..90c790379dc 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs @@ -120,7 +120,7 @@ public KeyBindingsPanel () schemeCombo.AppendText (s.Name); if (schemes.Count > 0) { - schemeCombo.RowSeparatorFunc = (TreeModel model, TreeIter iter) => { + schemeCombo.RowSeparatorFunc = (ITreeModel model, TreeIter iter) => { if (model.GetValue (iter, 0) as string == "---") return true; return false; @@ -360,7 +360,7 @@ void BindingRenderer_KeyBindingSelected (object sender, KeyBindingSelectedEventA void OnKeysTreeViewSelectionChange (object sender, EventArgs e) { TreeSelection sel = sender as TreeSelection; - TreeModel model; + ITreeModel model; TreeIter iter; Command selCommand = null; if (sel.GetSelected (out model, out iter) && model.GetValue (iter, commandCol) != null) { @@ -625,7 +625,7 @@ void UpdateWarningLabel () List FindBindings (string accel) { List bindings = new List (); - TreeModel model = (TreeModel) keyStore; + ITreeModel model = (ITreeModel) keyStore; TreeIter iter; if (!model.GetIterFirst (out iter)) return bindings; @@ -695,13 +695,13 @@ public KeyBindingSelectedEventArgs (IEnumerable keys, int selectedKey, C } } - protected override void OnDestroyed() + protected override void OnDestroyed() { if (bindingRenderer != null) { bindingRenderer.KeyBindingSelected -= BindingRenderer_KeyBindingSelected; bindingRenderer = null; - } - base.OnDestroyed(); + } + base.OnDestroyed(); } struct KeyBindingHitTestResult @@ -927,88 +927,88 @@ bool GetCellPosition (int mx, int my, out int cellx, out int celly, out TreeIter return false; } - protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - { - if (string.IsNullOrEmpty (Text)) - return; - - using (var cr = Gdk.CairoHelper.Create (window)) { - using (var layout = new Pango.Layout (widget.PangoContext)) { - var xpad = (int)Xpad; - int w, h; - Cairo.Color bgColor, fgColor; - foreach (var key in Text.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { - - HashSet bindingConflicts; - if (keyBindingsPanel.conflicts.TryGetValue (key, out bindingConflicts) && bindingConflicts.Contains (Command)) { - bgColor = Styles.KeyBindingsPanel.KeyConflictBackgroundColor.ToCairoColor (); - fgColor = Styles.KeyBindingsPanel.KeyConflictForegroundColor.ToCairoColor (); - } else if (keyBindingsPanel.duplicates.ContainsKey (key)) { - bgColor = Styles.KeyBindingsPanel.KeyDuplicateBackgroundColor.ToCairoColor (); - fgColor = Styles.KeyBindingsPanel.KeyDuplicateForegroundColor.ToCairoColor (); - } else { - bgColor = Styles.KeyBindingsPanel.KeyBackgroundColor.ToCairoColor (); - fgColor = Styles.KeyBindingsPanel.KeyForegroundColor.ToCairoColor (); - } - - layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); - layout.FontDescription = KeySymbolFont; - layout.GetPixelSize (out w, out h); - - int buttonWidth = w + (2 * KeyHPadding); - int buttonHeight = h + (2 * KeyVPadding); - int x = cell_area.X + xpad; - double y = cell_area.Y + ((cell_area.Height / 2) - (buttonHeight / 2)); - - cr.RoundedRectangle (x, y, buttonWidth, buttonHeight, KeyBgRadius); - cr.LineWidth = 1; - cr.SetSourceColor (bgColor); - cr.FillPreserve (); - cr.SetSourceColor (bgColor); - cr.Stroke (); - - cr.SetSourceColor (fgColor); - cr.MoveTo (x + KeyHPadding, y + KeyVPadding); - cr.ShowLayout (layout); - xpad += buttonWidth + Spacing; - } - } - } - } - - public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - x_offset = y_offset = 0; - if (string.IsNullOrEmpty (Text)) { - width = 0; - height = 0; - return; - } - - using (var layout = new Pango.Layout (widget.PangoContext)) { - height = 0; - width = (int)Xpad; - int w, h, buttonWidth; - foreach (var key in Text.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { - layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); - layout.FontDescription = KeySymbolFont; - layout.GetPixelSize (out w, out h); - if (height == 0) - height = h + (KeyVPadding * 2) + 1; - - buttonWidth = w + (2 * KeyHPadding); - width += buttonWidth + Spacing; - } - } - } - - protected override void OnDestroyed() - { - keyBindingsPanel = null; - HideConflictTooltip (); - base.OnDestroyed(); - } +// protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) +// { +// if (string.IsNullOrEmpty (Text)) +// return; +// +// using (var cr = Gdk.CairoHelper.Create (window)) { +// using (var layout = new Pango.Layout (widget.PangoContext)) { +// var xpad = (int)Xpad; +// int w, h; +// Cairo.Color bgColor, fgColor; +// foreach (var key in Text.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { +// +// HashSet bindingConflicts; +// if (keyBindingsPanel.conflicts.TryGetValue (key, out bindingConflicts) && bindingConflicts.Contains (Command)) { +// bgColor = Styles.KeyBindingsPanel.KeyConflictBackgroundColor.ToCairoColor (); +// fgColor = Styles.KeyBindingsPanel.KeyConflictForegroundColor.ToCairoColor (); +// } else if (keyBindingsPanel.duplicates.ContainsKey (key)) { +// bgColor = Styles.KeyBindingsPanel.KeyDuplicateBackgroundColor.ToCairoColor (); +// fgColor = Styles.KeyBindingsPanel.KeyDuplicateForegroundColor.ToCairoColor (); +// } else { +// bgColor = Styles.KeyBindingsPanel.KeyBackgroundColor.ToCairoColor (); +// fgColor = Styles.KeyBindingsPanel.KeyForegroundColor.ToCairoColor (); +// } +// +// layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); +// layout.FontDescription = KeySymbolFont; +// layout.GetPixelSize (out w, out h); +// +// int buttonWidth = w + (2 * KeyHPadding); +// int buttonHeight = h + (2 * KeyVPadding); +// int x = cell_area.X + xpad; +// double y = cell_area.Y + ((cell_area.Height / 2) - (buttonHeight / 2)); +// +// cr.RoundedRectangle (x, y, buttonWidth, buttonHeight, KeyBgRadius); +// cr.LineWidth = 1; +// cr.SetSourceColor (bgColor); +// cr.FillPreserve (); +// cr.SetSourceColor (bgColor); +// cr.Stroke (); +// +// cr.SetSourceColor (fgColor); +// cr.MoveTo (x + KeyHPadding, y + KeyVPadding); +// cr.ShowLayout (layout); +// xpad += buttonWidth + Spacing; +// } +// } +// } +// } + +// public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) +// { +// base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); +// x_offset = y_offset = 0; +// if (string.IsNullOrEmpty (Text)) { +// width = 0; +// height = 0; +// return; +// } +// +// using (var layout = new Pango.Layout (widget.PangoContext)) { +// height = 0; +// width = (int)Xpad; +// int w, h, buttonWidth; +// foreach (var key in Text.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { +// layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); +// layout.FontDescription = KeySymbolFont; +// layout.GetPixelSize (out w, out h); +// if (height == 0) +// height = h + (KeyVPadding * 2) + 1; +// +// buttonWidth = w + (2 * KeyHPadding); +// width += buttonWidth + Spacing; +// } +// } +// } + +// protected override void OnDestroyed() +// { +// keyBindingsPanel = null; +// HideConflictTooltip (); +// base.OnDestroyed(); +// } } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs index 88e78177811..378b9a175d6 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs @@ -104,9 +104,9 @@ public SdkLocationWidget (SdkLocationPanel panel) : base (false, 12) this.PackStart (new Label () { Markup = "" + GLib.Markup.EscapeText (panel.Label) + "", Xalign = 0f, - }); + }, false, true, 0); var alignment = new Alignment (0f, 0f, 1f, 1f) { LeftPadding = 24 }; - this.PackStart (alignment); + this.PackStart (alignment, false, true, 0); var vbox = new VBox (false , 6); var locationBox = new HBox (false, 6); var messageBox = new HBox (false, 6); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs index 94fd621dd25..1f6120acb9f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs @@ -43,13 +43,13 @@ namespace MonoDevelop.Ide.Gui.OptionPanels partial class TasksPanelWidget : Gtk.Bin { ListStore tokensStore; - ComboBox comboPriority; + ComboBoxText comboPriority; public TasksPanelWidget () { Build (); - comboPriority = ComboBox.NewText (); + comboPriority = new ComboBoxText (); foreach (TaskPriority priority in Enum.GetValues (typeof (TaskPriority))) comboPriority.AppendText (Enum.GetName (typeof (TaskPriority), priority)); comboPriority.Changed += new EventHandler (Validate); @@ -132,7 +132,7 @@ void Validate (object sender, EventArgs args) string selectedToken = String.Empty; int selectedPriority = (int)TaskPriority.Normal; TreeIter iter; - TreeModel model = (TreeModel)tokensStore; + ITreeModel model = (ITreeModel)tokensStore; if (tokensTreeView.Selection.GetSelected (out model, out iter)) { selectedToken = (string)tokensStore.GetValue (iter, 0); @@ -156,7 +156,7 @@ void OnTokenSelectionChanged (object sender, EventArgs args) if (selection != null) { TreeIter iter; - TreeModel model = (TreeModel)tokensStore; + ITreeModel model = (ITreeModel)tokensStore; if (selection.GetSelected (out model, out iter)) { entryToken.Text = (string)tokensStore.GetValue (iter, 0); comboPriority.Active = (int)tokensStore.GetValue (iter, 1); @@ -178,7 +178,7 @@ void AddToken (object sender, EventArgs args) void ChangeToken (object sender, EventArgs args) { TreeIter iter; - TreeModel model = (TreeModel)tokensStore; + ITreeModel model = (ITreeModel)tokensStore; if (tokensTreeView.Selection.GetSelected (out model, out iter)) { tokensStore.SetValue (iter, 0, entryToken.Text); tokensStore.SetValue (iter, 1, comboPriority.Active); @@ -189,7 +189,7 @@ void ChangeToken (object sender, EventArgs args) void RemoveToken (object sender, EventArgs args) { TreeIter iter; - TreeModel model = (TreeModel)tokensStore; + ITreeModel model = (ITreeModel)tokensStore; if (tokensTreeView.Selection.GetSelected (out model, out iter)) { tokensStore.Remove (ref iter); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs index 84f0fa4273d..28751340ba2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs @@ -187,7 +187,7 @@ public override bool CanDropNode (object dataObject, DragOperation operation) } else if (dataObject is Gtk.SelectionData) { SelectionData data = (SelectionData) dataObject; - if (data.Type == "text/uri-list") + if (data.DataType == "text/uri-list") return true; } return false; @@ -252,7 +252,7 @@ async System.Threading.Tasks.Task DropNode (HashSet projectsToSave } else if (dataObject is Gtk.SelectionData) { SelectionData data = (SelectionData) dataObject; - if (data.Type != "text/uri-list") + if (data.DataType != "text/uri-list") return; string sources = System.Text.Encoding.UTF8.GetString (data.Data); Console.WriteLine ("text/uri-list:\n{0}", sources); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs index c35e7b50bda..72795bdeb6f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs @@ -154,11 +154,11 @@ HBox MakeHBox (string image, out Label label) btnBox.Accessible.SetShouldIgnore (true); var imageView = new ImageView (image, Gtk.IconSize.Menu); imageView.Accessible.SetShouldIgnore (true); - btnBox.PackStart (imageView); + btnBox.PackStart (imageView, false, true, 0); label = new Label (); label.Accessible.SetShouldIgnore (true); - btnBox.PackStart (label); + btnBox.PackStart (label, false, true, 0); return btnBox; } @@ -329,7 +329,7 @@ void CreateControl () control.FocusChain = new Gtk.Widget [] { logView }; } - public override void Dispose () + public override void Dispose () { errorBtn.Toggled -= FilterChanged; warnBtn.Toggled -= FilterChanged; @@ -364,8 +364,8 @@ public override void Dispose () if (sw != null) { sw.SizeAllocated -= HandleSwSizeAllocated; } - - base.Dispose (); + + base.Dispose (); } void HandleSwSizeAllocated (object o, SizeAllocatedArgs args) @@ -683,7 +683,7 @@ void AddColumns () col.Resizable = true; } - static void ToggleDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + static void ToggleDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { Gtk.CellRendererToggle toggleRenderer = (Gtk.CellRendererToggle)cell; TaskListEntry task = model.GetValue (iter, DataColumns.Task) as TaskListEntry; @@ -694,7 +694,7 @@ static void ToggleDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gt toggleRenderer.Active = task.Completed; } - static void LineDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + static void LineDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { Gtk.CellRendererText textRenderer = (Gtk.CellRendererText)cell; TaskListEntry task = model.GetValue (iter, DataColumns.Task) as TaskListEntry; @@ -705,7 +705,7 @@ static void LineDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk. SetText (textRenderer, model, iter, task, task.Line != 0 ? task.Line.ToString () : ""); } - static void DescriptionDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + static void DescriptionDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { var textRenderer = (CellRendererText)cell; TaskListEntry task = model.GetValue (iter, DataColumns.Task) as TaskListEntry; @@ -725,7 +725,7 @@ static void DescriptionDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cel SetText (textRenderer, model, iter, task, text); } - static void FileDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + static void FileDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { Gtk.CellRendererText textRenderer = (Gtk.CellRendererText)cell; TaskListEntry task = model.GetValue (iter, DataColumns.Task) as TaskListEntry; @@ -737,7 +737,7 @@ static void FileDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk. SetText (textRenderer, model, iter, task, task.GetFile ()); } - static void ProjectDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + static void ProjectDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { Gtk.CellRendererText textRenderer = (Gtk.CellRendererText)cell; TaskListEntry task = model.GetValue (iter, DataColumns.Task) as TaskListEntry; @@ -748,7 +748,7 @@ static void ProjectDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, G SetText (textRenderer, model, iter, task, task.GetProject ()); } - static void PathDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + static void PathDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { Gtk.CellRendererText textRenderer = (Gtk.CellRendererText)cell; TaskListEntry task = model.GetValue (iter, DataColumns.Task) as TaskListEntry; @@ -759,7 +759,7 @@ static void PathDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk. SetText (textRenderer, model, iter, task, task.GetPath ()); } - static void CategoryDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + static void CategoryDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { Gtk.CellRendererText textRenderer = (Gtk.CellRendererText)cell; var task = model.GetValue (iter, DataColumns.Task) as TaskListEntry; @@ -770,7 +770,7 @@ static void CategoryDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, SetText (textRenderer, model, iter, task, task.Category ?? ""); } - static void SetText (CellRendererText textRenderer, TreeModel model, TreeIter iter, TaskListEntry task, string text) + static void SetText (CellRendererText textRenderer, ITreeModel model, TreeIter iter, TaskListEntry task, string text) { textRenderer.Text = text; textRenderer.Weight = (int)((bool)model.GetValue (iter, DataColumns.Read) ? Pango.Weight.Normal : Pango.Weight.Bold); @@ -827,7 +827,7 @@ internal void SetFilter (bool showErrors, bool showWarnings, bool showMessages) } - bool FilterTasks (TreeModel model, TreeIter iter) + bool FilterTasks (ITreeModel model, TreeIter iter) { bool canShow = false; @@ -980,7 +980,7 @@ private void ItemToggled (object o, ToggledArgs args) } } - static int SeverityIterSort(TreeModel model, TreeIter a, TreeIter z) + static int SeverityIterSort(ITreeModel model, TreeIter a, TreeIter z) { TaskListEntry aTask = model.GetValue(a, DataColumns.Task) as TaskListEntry, zTask = model.GetValue(z, DataColumns.Task) as TaskListEntry; @@ -990,7 +990,7 @@ static int SeverityIterSort(TreeModel model, TreeIter a, TreeIter z) 0; } - static int ProjectIterSort (TreeModel model, TreeIter a, TreeIter z) + static int ProjectIterSort (ITreeModel model, TreeIter a, TreeIter z) { TaskListEntry aTask = model.GetValue (a, DataColumns.Task) as TaskListEntry, zTask = model.GetValue (z, DataColumns.Task) as TaskListEntry; @@ -1000,7 +1000,7 @@ static int ProjectIterSort (TreeModel model, TreeIter a, TreeIter z) 0; } - static int FileIterSort (TreeModel model, TreeIter a, TreeIter z) + static int FileIterSort (ITreeModel model, TreeIter a, TreeIter z) { TaskListEntry aTask = model.GetValue (a, DataColumns.Task) as TaskListEntry, zTask = model.GetValue (z, DataColumns.Task) as TaskListEntry; @@ -1010,13 +1010,13 @@ static int FileIterSort (TreeModel model, TreeIter a, TreeIter z) 0; } - static int CategoryIterSort (TreeModel model, TreeIter a, TreeIter z) + static int CategoryIterSort (ITreeModel model, TreeIter a, TreeIter z) { - TaskListEntry aTask = model.GetValue (a, DataColumns.Task) as TaskListEntry, - zTask = model.GetValue (z, DataColumns.Task) as TaskListEntry; - - return (aTask?.Category != null && zTask?.Category != null) ? - string.Compare (aTask.Category, zTask.Category, StringComparison.Ordinal) : + TaskListEntry aTask = model.GetValue (a, DataColumns.Task) as TaskListEntry, + zTask = model.GetValue (z, DataColumns.Task) as TaskListEntry; + + return (aTask?.Category != null && zTask?.Category != null) ? + string.Compare (aTask.Category, zTask.Category, StringComparison.Ordinal) : 0; } @@ -1071,23 +1071,23 @@ class DescriptionCellRendererText : CellRendererText { public int PreferedMaxWidth { get; set; } - public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - int originalWrapWidth = WrapWidth; - WrapWidth = -1; - // First calculate Width with WrapWidth=-1 which will give us - // Width of text in one line(without wrapping) - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - int oneLineWidth = width; - WrapWidth = originalWrapWidth; - // originalWrapWidth(aka WrapWidth) equals to actual width of Column if oneLineWidth is bigger - // then column width/height we must recalculate, because Height is atm for one line - // and not multipline that WrapWidth creates... - if (oneLineWidth > originalWrapWidth) { - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - } - width = Math.Min (oneLineWidth, PreferedMaxWidth); - } +// public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) +// { +// int originalWrapWidth = WrapWidth; +// WrapWidth = -1; +// // First calculate Width with WrapWidth=-1 which will give us +// // Width of text in one line(without wrapping) +// base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); +// int oneLineWidth = width; +// WrapWidth = originalWrapWidth; +// // originalWrapWidth(aka WrapWidth) equals to actual width of Column if oneLineWidth is bigger +// // then column width/height we must recalculate, because Height is atm for one line +// // and not multipline that WrapWidth creates... +// if (oneLineWidth > originalWrapWidth) { +// base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); +// } +// width = Math.Min (oneLineWidth, PreferedMaxWidth); +// } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs index ac494f3372f..65e19424d7a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs @@ -59,7 +59,7 @@ public HelpTree () tree_view.RowExpanded += new Gtk.RowExpandedHandler (RowExpanded); tree_view.Selection.Changed += new EventHandler (RowActivated); - store = new TreeStore (typeof (string), typeof (Node)); + store = new TreeStore (typeof (string), typeof (Monodoc.Node)); tree_view.Model = store; tree_view.HeadersVisible = false; @@ -89,7 +89,7 @@ public HelpTree () Hashtable populated = new Hashtable (); void RowExpanded (object o, Gtk.RowExpandedArgs args) { - Node node = (Node)store.GetValue (args.Iter, 1); + Monodoc.Node node = (Monodoc.Node)store.GetValue (args.Iter, 1); if (node == null) return; if (populated.ContainsKey (node)) @@ -109,13 +109,13 @@ void RowExpanded (object o, Gtk.RowExpandedArgs args) void RowActivated (object o, EventArgs e) { Gtk.TreeIter iter; - Gtk.TreeModel model; + Gtk.ITreeModel model; if (tree_view.Selection.GetSelected (out model, out iter)) { if (store.GetPath (iter).Equals (store.GetPath (root_iter))) return; - Node n = (Node)store.GetValue (iter, 1); + Monodoc.Node n = (Monodoc.Node)store.GetValue (iter, 1); IdeApp.HelpOperations.ShowHelp (n.PublicUrl); } @@ -124,11 +124,11 @@ void RowActivated (object o, EventArgs e) #pragma warning disable 618 void PopulateNode (TreeIter parent) { - Node node = (Node)store.GetValue (parent, 1); + Monodoc.Node node = (Monodoc.Node)store.GetValue (parent, 1); if (node.Nodes == null) return; - foreach (Node n in node.Nodes) { + foreach (Monodoc.Node n in node.Nodes) { store.AppendValues (parent, n.Caption, n); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs index adfc291437b..9f60e8cc7ce 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs @@ -161,102 +161,102 @@ static string Ellipsize (string str, int maxLength) } const int upperGradientHeight = 16; - protected override bool OnExposeEvent (Gdk.EventExpose e) - { - - using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { - double xPos = padding, yPos = padding; - var layout = PangoUtil.CreateLayout (this); - int w, h; - layout.SetText (new string ('X', maxLength)); - layout.GetPixelSize (out w, out h); - - foreach (Category cat in categories) { - yPos = padding; - cr.MoveTo (xPos, yPos); - layout.SetMarkup ("" + cat.Title + ""); - cr.SetSourceColor (Style.Text (StateType.Normal).ToCairoColor ()); - cr.ShowLayout (layout); - - if (cat.Items.Count == 0) - continue; - - layout.SetMarkup (""); - int w2, h2; - layout.GetPixelSize (out w2, out h2); - yPos += h2; - yPos += headerDistance; - var startY = yPos; - int curItem = 0; - int row = 0; - var iconHeight = Math.Max (h, cat.Items [0].Icon.Height + 2) + itemPadding * 2; - if (cat.FirstVisibleItem > 0) { - Gtk.Style.PaintArrow (Style, e.Window, State, ShadowType.None, - new Rectangle ((int)xPos, (int)yPos, w, h), - this, - "", - ArrowType.Up, - true, - (int)xPos, - (int)yPos, - w, - h); - yPos += iconHeight; - curItem++; - } - - for (int i = cat.FirstVisibleItem; i < cat.Items.Count; i++) { - var item = cat.Items [i]; - - if (curItem + 1 >= maxItems && row + 1 >= maxRows && i + 1 < cat.Items.Count) { - Gtk.Style.PaintArrow (Style, e.Window, State, ShadowType.None, - new Rectangle ((int)xPos, (int)yPos, w, h), - this, - "", - ArrowType.Down, - true, - (int)xPos, - (int)yPos, - w, - h); - break; - } - - if (item == ActiveItem) { - int itemWidth = w + (int)item.Icon.Width + 2 + itemPadding * 2; - cr.Rectangle (xPos, yPos, itemWidth, iconHeight); - cr.LineWidth = 1; - cr.SetSourceColor (Style.Base (StateType.Selected).ToCairoColor ()); - cr.Fill (); - } else if (item == hoverItem) { - int itemWidth = w + (int)item.Icon.Width + 2 + itemPadding * 2; - cr.Rectangle (xPos + 0.5, yPos + 0.5, itemWidth - 1, iconHeight); - cr.LineWidth = 1; - cr.SetSourceColor (Style.Base (StateType.Selected).ToCairoColor ()); - cr.Stroke (); - } - cr.SetSourceColor (Style.Text (item == ActiveItem? StateType.Selected : StateType.Normal).ToCairoColor ()); - cr.MoveTo (xPos + item.Icon.Width + 2 + itemPadding, yPos + (iconHeight - h) / 2); - layout.SetText (Ellipsize (item.ListTitle ?? item.Title, maxLength)); - cr.ShowLayout (layout); - cr.DrawImage (this, item == ActiveItem ? item.Icon.WithStyles ("sel") : item.Icon, (int)xPos + itemPadding, - (int)(yPos + (iconHeight - item.Icon.Height) / 2)); - yPos += iconHeight; - if (++curItem >= maxItems) { - curItem = 0; - yPos = startY; - xPos += w + cat.Items [0].Icon.Width + 2 + padding + itemPadding * 2; - row++; - } - } - - - xPos += w + cat.Items [0].Icon.Width + 2 + padding + itemPadding * 2; - } - layout.Dispose (); - } - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose e) +// { +// +// using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { +// double xPos = padding, yPos = padding; +// var layout = PangoUtil.CreateLayout (this); +// int w, h; +// layout.SetText (new string ('X', maxLength)); +// layout.GetPixelSize (out w, out h); +// +// foreach (Category cat in categories) { +// yPos = padding; +// cr.MoveTo (xPos, yPos); +// layout.SetMarkup ("" + cat.Title + ""); +// cr.SetSourceColor (Style.Text (StateType.Normal).ToCairoColor ()); +// cr.ShowLayout (layout); +// +// if (cat.Items.Count == 0) +// continue; +// +// layout.SetMarkup (""); +// int w2, h2; +// layout.GetPixelSize (out w2, out h2); +// yPos += h2; +// yPos += headerDistance; +// var startY = yPos; +// int curItem = 0; +// int row = 0; +// var iconHeight = Math.Max (h, cat.Items [0].Icon.Height + 2) + itemPadding * 2; +// if (cat.FirstVisibleItem > 0) { +// Gtk.Style.PaintArrow (Style, e.Window, State, ShadowType.None, +// new Rectangle ((int)xPos, (int)yPos, w, h), +// this, +// "", +// ArrowType.Up, +// true, +// (int)xPos, +// (int)yPos, +// w, +// h); +// yPos += iconHeight; +// curItem++; +// } +// +// for (int i = cat.FirstVisibleItem; i < cat.Items.Count; i++) { +// var item = cat.Items [i]; +// +// if (curItem + 1 >= maxItems && row + 1 >= maxRows && i + 1 < cat.Items.Count) { +// Gtk.Style.PaintArrow (Style, e.Window, State, ShadowType.None, +// new Rectangle ((int)xPos, (int)yPos, w, h), +// this, +// "", +// ArrowType.Down, +// true, +// (int)xPos, +// (int)yPos, +// w, +// h); +// break; +// } +// +// if (item == ActiveItem) { +// int itemWidth = w + (int)item.Icon.Width + 2 + itemPadding * 2; +// cr.Rectangle (xPos, yPos, itemWidth, iconHeight); +// cr.LineWidth = 1; +// cr.SetSourceColor (Style.Base (StateType.Selected).ToCairoColor ()); +// cr.Fill (); +// } else if (item == hoverItem) { +// int itemWidth = w + (int)item.Icon.Width + 2 + itemPadding * 2; +// cr.Rectangle (xPos + 0.5, yPos + 0.5, itemWidth - 1, iconHeight); +// cr.LineWidth = 1; +// cr.SetSourceColor (Style.Base (StateType.Selected).ToCairoColor ()); +// cr.Stroke (); +// } +// cr.SetSourceColor (Style.Text (item == ActiveItem? StateType.Selected : StateType.Normal).ToCairoColor ()); +// cr.MoveTo (xPos + item.Icon.Width + 2 + itemPadding, yPos + (iconHeight - h) / 2); +// layout.SetText (Ellipsize (item.ListTitle ?? item.Title, maxLength)); +// cr.ShowLayout (layout); +// cr.DrawImage (this, item == ActiveItem ? item.Icon.WithStyles ("sel") : item.Icon, (int)xPos + itemPadding, +// (int)(yPos + (iconHeight - item.Icon.Height) / 2)); +// yPos += iconHeight; +// if (++curItem >= maxItems) { +// curItem = 0; +// yPos = startY; +// xPos += w + cat.Items [0].Icon.Width + 2 + padding + itemPadding * 2; +// row++; +// } +// } +// +// +// xPos += w + cat.Items [0].Icon.Width + 2 + padding + itemPadding * 2; +// } +// layout.Dispose (); +// } +// return true; +// } protected override bool OnKeyPressEvent (EventKey evnt) { @@ -496,9 +496,11 @@ Category GetPrevCat (int i) } while (cat.Items.Count == 0); return cat; } - - protected override void OnSizeRequested (ref Requisition req) + + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { + min_height = 0; + natural_height = 0; maxLength = 15; foreach (var cat in categories) { foreach (var item in cat.Items) { @@ -511,7 +513,6 @@ protected override void OnSizeRequested (ref Requisition req) layout.SetText (new string ('X', maxLength)); layout.GetPixelSize (out w, out h); layout.Dispose (); - int totalWidth = 0; int totalHeight = 0; var firstNonEmptyCat = categories.FirstOrDefault (c => c.Items.Count > 0); @@ -524,10 +525,39 @@ protected override void OnSizeRequested (ref Requisition req) foreach (var cat in categories) { var headerHeight = h + headerDistance; totalHeight = Math.Max (totalHeight, headerHeight + (Math.Min (cat.Items.Count, maxItems)) * iconHeight); + } + } + + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) + { + min_width = 0; + natural_width = 0; + maxLength = 15; + foreach (var cat in categories) { + foreach (var item in cat.Items) { + maxLength = Math.Min (30, Math.Max (maxLength, (item.ListTitle ?? item.Title).Length)); + } + } + + var layout = PangoUtil.CreateLayout (this); + int w, h; + layout.SetText (new string ('X', maxLength)); + layout.GetPixelSize (out w, out h); + layout.Dispose (); + int totalWidth = 0; + + var firstNonEmptyCat = categories.FirstOrDefault (c => c.Items.Count > 0); + if (firstNonEmptyCat == null) + return; + var icon = firstNonEmptyCat.Items[0].Icon; + var iconHeight = Math.Max (h, (int)icon.Height + 2) + itemPadding * 2; + var iconWidth = (int) icon.Width + 2 + w + itemPadding * 2; + + foreach (var cat in categories) { + var headerHeight = h + headerDistance; totalWidth += (1 + Math.Min (maxRows - 1, cat.Items.Count / maxItems)) * iconWidth; } - req.Width = totalWidth + padding * 2 + (categories.Count - 1) * padding; - req.Height = totalHeight + padding * 2; + min_width = totalWidth + padding * 2 + (categories.Count - 1) * padding; } public class Item @@ -737,18 +767,18 @@ public DocumentSwitcher (Gtk.Window parent, string category, bool startWithNext, else documentList.NextItem (true); - documentList.RequestClose += delegate(object sender, DocumentList.RequestActionEventArgs e) { + documentList.RequestClose += delegate(object sender, DocumentList.RequestActionEventArgs e) { object item = e.SelectItem ? documentList.ActiveItem.Tag : null; - DestroyWindow(); - - // The selected document has to be focused *after* this window is destroyed, becasuse the window - // destruction focuses its parent window. - if (item != null) { - if (item is Pad) - ((Pad)item).BringToFront(true); - else - ((MonoDevelop.Ide.Gui.Document)item).Select(); - } + DestroyWindow(); + + // The selected document has to be focused *after* this window is destroyed, becasuse the window + // destruction focuses its parent window. + if (item != null) { + if (item is Pad) + ((Pad)item).BringToFront(true); + else + ((MonoDevelop.Ide.Gui.Document)item).Select(); + } }; this.ShowAll (); @@ -786,15 +816,15 @@ protected override void OnDestroyed () IdeApp.CommandService.IsEnabled = true; } - protected override bool OnExposeEvent (EventExpose evnt) - { - base.OnExposeEvent (evnt); - - int winWidth, winHeight; - this.GetSize (out winWidth, out winHeight); - - this.GdkWindow.DrawRectangle (this.Style.ForegroundGC (StateType.Insensitive), false, 0, 0, winWidth - 1, winHeight - 1); - return false; - } +// protected override bool OnExposeEvent (EventExpose evnt) +// { +// base.OnExposeEvent (evnt); +// +// int winWidth, winHeight; +// this.GetSize (out winWidth, out winHeight); +// +// this.GdkWindow.DrawRectangle (this.Style.ForegroundGC (StateType.Insensitive), false, 0, 0, winWidth - 1, winHeight - 1); +// return false; +// } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentToolbar.cs index c5eef3e7b09..bf5e5f4eeb7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentToolbar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentToolbar.cs @@ -172,21 +172,21 @@ public ToolbarBox (float xa, float ya, float sx, float sy): base (xa, ya, sx, sy { } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { - ctx.Rectangle (0, 0, Allocation.Width, Allocation.Height); - ctx.SetSourceColor (Styles.BreadcrumbBackgroundColor.ToCairoColor ()); - ctx.Fill (); - - ctx.MoveTo (0.5, Allocation.Height - 0.5); - ctx.RelLineTo (Allocation.Width, 0); - ctx.SetSourceColor (Styles.BreadcrumbBottomBorderColor.ToCairoColor ()); - ctx.LineWidth = 1; - ctx.Stroke (); - } - return base.OnExposeEvent (evnt); - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { +// ctx.Rectangle (0, 0, Allocation.Width, Allocation.Height); +// ctx.SetSourceColor (Styles.BreadcrumbBackgroundColor.ToCairoColor ()); +// ctx.Fill (); +// +// ctx.MoveTo (0.5, Allocation.Height - 0.5); +// ctx.RelLineTo (Allocation.Width, 0); +// ctx.SetSourceColor (Styles.BreadcrumbBottomBorderColor.ToCairoColor ()); +// ctx.LineWidth = 1; +// ctx.Stroke (); +// } +// return base.OnExposeEvent (evnt); +// } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs index 4f211b52ec4..011060285a9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs @@ -81,10 +81,10 @@ internal MonoDevelopStatusBar () var im = new Xwt.ImageView (px).ToGtkWidget (); im.Accessible.Role = Atk.Role.Filler; - b.PackStart (im); + b.PackStart (im, false, true, 0); var label = new Gtk.Label (GettextCatalog.GetString ("Feedback")); label.Accessible.Role = Atk.Role.Filler; - b.PackStart (label); + b.PackStart (label, false, true, 0); Gtk.Alignment al = new Gtk.Alignment (0f, 0f, 1f, 1f); al.Accessible.Role = Atk.Role.Filler; al.RightPadding = 5; @@ -220,18 +220,18 @@ Gdk.Rectangle GetGripRect () return rect; } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - bool ret = base.OnExposeEvent (evnt); - if (HasResizeGrip) { - Gdk.Rectangle rect = GetGripRect (); - int w = rect.Width - Style.Xthickness; - int h = Allocation.Height - Style.YThickness; - if (h < 18 - Style.YThickness) h = 18 - Style.YThickness; - Gdk.WindowEdge edge = Direction == TextDirection.Ltr ? Gdk.WindowEdge.SouthEast : Gdk.WindowEdge.SouthWest; - Gtk.Style.PaintResizeGrip (Style, GdkWindow, State, evnt.Area, this, "statusbar", edge, rect.X, rect.Y, w, h); - } - return ret; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// bool ret = base.OnExposeEvent (evnt); +// if (HasResizeGrip) { +// Gdk.Rectangle rect = GetGripRect (); +// int w = rect.Width - Style.Xthickness; +// int h = Allocation.Height - Style.YThickness; +// if (h < 18 - Style.YThickness) h = 18 - Style.YThickness; +// Gdk.WindowEdge edge = Direction == TextDirection.Ltr ? Gdk.WindowEdge.SouthEast : Gdk.WindowEdge.SouthWest; +// Gtk.Style.PaintResizeGrip (Style, GdkWindow, State, evnt.Area, this, "statusbar", edge, rect.X, rect.Y, w, h); +// } +// return ret; +// } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs index b2585748d3d..e22679b98db 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs @@ -146,7 +146,7 @@ protected override void OnRealized () { base.OnRealized (); if (tabPage == null && subViewNotebook == null) - box.PackStart (TabPage); + box.PackStart (TabPage, false, true, 0); } Document document; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs index 065e41692ef..007fe1ad685 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs @@ -37,7 +37,7 @@ namespace MonoDevelop.Ide.Gui public class ToolbarComboBox: CustomItem { Gtk.Alignment align; - Gtk.ComboBox combo; + Gtk.ComboBoxText combo; Gtk.CellRendererText ctx; public ToolbarComboBox () @@ -48,7 +48,7 @@ public ToolbarComboBox () align.LeftPadding = 3; align.RightPadding = 3; - combo = new Gtk.ComboBox (); + combo = new Gtk.ComboBoxText (); combo.Model = new Gtk.ListStore (typeof(string)); ctx = new Gtk.CellRendererText (); combo.PackStart (ctx, true); @@ -58,7 +58,7 @@ public ToolbarComboBox () ShowAll (); } - protected Gtk.ComboBox Combo { + protected Gtk.ComboBoxText Combo { get { return combo; } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchWindow.cs index 92309d38bac..f58bc385310 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchWindow.cs @@ -103,9 +103,18 @@ public Gdk.Rectangle GetCoordinates (Gtk.Widget w) return rect; } - protected override void OnSizeRequested (ref Gtk.Requisition requisition) + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - base.OnSizeRequested (ref requisition); + base.OnGetPreferredHeight (out min_height, out natural_height); + + // Ignore the size of top levels. They are supposed to fit the available space + foreach (TopLevelChild tchild in topLevels) + tchild.Child.SizeRequest (); + } + + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) + { + base.OnGetPreferredWidth (out min_width, out natural_width); // Ignore the size of top levels. They are supposed to fit the available space foreach (TopLevelChild tchild in topLevels) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeAnalysisPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeAnalysisPanel.cs index d8c2ad6c9aa..feace2cae55 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeAnalysisPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeAnalysisPanel.cs @@ -94,7 +94,7 @@ void Build () enabledCheckBox.DrawIndicator = true; enabledCheckBox.UseUnderline = true; enabledCheckBox.Toggled += (s, e) => enabledCheckBox.Inconsistent = false; - PackStart (enabledCheckBox); + PackStart (enabledCheckBox, false, true, 0); ShowAll (); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeFormattingPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeFormattingPanel.cs index fcc5b2426c1..2aa58fef7dc 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeFormattingPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeFormattingPanel.cs @@ -329,7 +329,7 @@ public CodeFormattingPanelWidget (CodeFormattingPanel panel, OptionsDialog dialo static readonly string customPolicyText = GettextCatalog.GetString ("(Custom)"); - void OnSetPolicyData (Gtk.TreeViewColumn treeColumn, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + void OnSetPolicyData (Gtk.TreeViewColumn treeColumn, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { MimeTypePanelData mt = (MimeTypePanelData) store.GetValue (iter, 0); @@ -455,12 +455,12 @@ void UpdateButtons () buttonRemove.Sensitive = buttonEdit.Sensitive = false; } - protected override void OnDestroyed() + protected override void OnDestroyed() { store.Clear(); comboCell.Changed -= OnPolicySelectionChanged; - - base.OnDestroyed(); + + base.OnDestroyed(); } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineConfigurationPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineConfigurationPanel.cs index d49a759fa2e..43e2e041188 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineConfigurationPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineConfigurationPanel.cs @@ -111,7 +111,7 @@ public void Load (SolutionConfiguration config) } } - void OnSetConfigurationsData (Gtk.TreeViewColumn treeColumn, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + void OnSetConfigurationsData (Gtk.TreeViewColumn treeColumn, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { var item = (SolutionItem) store.GetValue (iter, ProjectCol); ConfigurationData data = parentDialog.ConfigurationData.FindConfigurationData (item); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandWidget.cs index 1c3cfc7ec8a..8bb42cbb720 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandWidget.cs @@ -83,8 +83,8 @@ public CustomCommandWidget (WorkspaceObject entry, CustomCommand cmd, Configurat this.entry = entry; UpdateControls (); - this.WidgetFlags |= Gtk.WidgetFlags.NoShowAll; - + this.NoShowAll = true; + StringTagModelDescription tagModel; if (entry is SolutionFolderItem) tagModel = ((SolutionFolderItem)entry).GetStringTagModelDescription (configSelector); @@ -92,7 +92,6 @@ public CustomCommandWidget (WorkspaceObject entry, CustomCommand cmd, Configurat tagModel = ((WorkspaceItem)entry).GetStringTagModelDescription (); else tagModel = new StringTagModelDescription (); - tagSelectorDirectory.TagModel = tagModel; tagSelectorDirectory.TargetEntry = workingdirEntry; tagSelectorDirectory.Accessible.SetCommonAttributes ("CustomCommand.TagSelectorDirectory", @@ -190,7 +189,7 @@ protected virtual void OnComboTypeChanged(object sender, System.EventArgs e) cmd = new CustomCommand (); cmd.Type = supportedTypes [comboType.Active - 1]; updating = true; - comboType.RemoveText (0); + comboType.Remove (0); updating = false; if (CommandCreated != null) CommandCreated (this, EventArgs.Empty); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeOptionsPanel.cs index ba7eb41939b..87b180c43aa 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeOptionsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeOptionsPanel.cs @@ -89,7 +89,7 @@ class PortableRuntimeOptionsPanelWidget : Gtk.VBox const string NetStandardPclCompatPackageName = "Microsoft.NETCore.Portable.Compatibility"; const string NetStandardPclCompatPackageVersion = "1.0.1"; - ComboBox netStandardCombo; + ComboBoxText netStandardCombo; Entry targetFrameworkEntry; RadioButton netstandardRadio; RadioButton pclRadio; @@ -133,25 +133,25 @@ void Build () { Spacing = 6; - PackStart (new Label { Markup = string.Format ("{0}", GettextCatalog.GetString ("Target Framework")), Xalign = 0f }); + PackStart (new Label { Markup = string.Format ("{0}", GettextCatalog.GetString ("Target Framework")), Xalign = 0f }, false, true, 0); var fxAlignment = new Alignment (0f, 0f, 1f, 1f) { LeftPadding = 12 }; - PackStart (fxAlignment); + PackStart (fxAlignment, false, true, 0); var radioBox = new VBox { Spacing = 10 }; fxAlignment.Add (radioBox); var netstandardPickerHbox = new HBox { Spacing = 10 }; - radioBox.PackStart (netstandardPickerHbox); + radioBox.PackStart (netstandardPickerHbox, false, true, 0); netstandardRadio = new RadioButton (GettextCatalog.GetString (".NET Standard Platform:")); netstandardPickerHbox.PackStart (netstandardRadio, false, false, 0); - netstandardPickerHbox.PackStart (netStandardCombo = ComboBox.NewText (), false, false, 0); + netstandardPickerHbox.PackStart (netStandardCombo = new ComboBoxText (), false, false, 0); var netstandardDesc = new Label { Markup = GettextCatalog.GetString ("Your library will be compatible with all frameworks that support the selected .NET Standard version.", netstandardDocsUrl), Xalign = 0f }; GtkWorkarounds.SetLinkHandler (netstandardDesc, HandleLink); - radioBox.PackStart (new Alignment (0f, 0f, 1f, 1f) { Child = netstandardDesc, LeftPadding = 24 }); + radioBox.PackStart (new Alignment (0f, 0f, 1f, 1f) { Child = netstandardDesc, LeftPadding = 24 }, false, true, 0); var pclPickerHbox = new HBox { Spacing = 10 }; - radioBox.PackStart (pclPickerHbox); + radioBox.PackStart (pclPickerHbox, false, true, 0); pclRadio = new RadioButton (netstandardRadio, GettextCatalog.GetString (".NET Portable:")); pclPickerHbox.PackStart (pclRadio, false, false, 0); pclPickerHbox.PackStart (targetFrameworkEntry = new Entry { IsEditable = false, WidthChars = 20, Name = "targetFrameworkEntry" }, false, false, 0); @@ -160,7 +160,7 @@ void Build () var pclDesc = new Label { Markup = GettextCatalog.GetString ("Your library will be compatible with the frameworks supported by the selected PCL profile.", pcldDocsUrl), Xalign = 0f }; GtkWorkarounds.SetLinkHandler (pclDesc, HandleLink); - radioBox.PackStart (new Alignment (0f, 0f, 1f, 1f) { Child = pclDesc, LeftPadding = 24 }); + radioBox.PackStart (new Alignment (0f, 0f, 1f, 1f) { Child = pclDesc, LeftPadding = 24 }, false, true, 0); frameworkPickerButton.Clicked += PickFramework; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeSelectorDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeSelectorDialog.cs index 8d7bb8fa2d7..0b05201973b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeSelectorDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeSelectorDialog.cs @@ -268,7 +268,7 @@ void AddLabel (string text, uint top) alignment.Add (label); alignment.Show (); - VBox.PackStart (alignment, false, true, 0); + ContentArea.PackStart (alignment, false, true, 0); } void AddTopSelectorCombo () @@ -305,7 +305,7 @@ void AddTopSelectorCombo () alignment.Show (); - VBox.PackStart (alignment, false, true, 0); + ContentArea.PackStart (alignment, false, true, 0); } void AddMultiOptionCombo (OptionCombo option) @@ -367,7 +367,7 @@ void AddMultiOptionCombo (OptionCombo option) alignment.Add (hbox); alignment.Show (); - VBox.PackStart (alignment, false, true, 0); + ContentArea.PackStart (alignment, false, true, 0); } void AddSingleOptionCheckbox (OptionCombo option) @@ -390,7 +390,7 @@ void AddSingleOptionCheckbox (OptionCombo option) alignment.Add (option.Check); alignment.Show (); - VBox.PackStart (alignment, false, true, 0); + ContentArea.PackStart (alignment, false, true, 0); } void AddWarningLabel () @@ -416,7 +416,7 @@ void AddWarningLabel () alignment.Child = warningHBox; alignment.Show (); - VBox.PackStart (alignment, false, true, 0); + ContentArea.PackStart (alignment, false, true, 0); } void ClearWarnings () diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/SolutionItemConfigurationsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/SolutionItemConfigurationsPanel.cs index 2d8ed345c4d..b636335c163 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/SolutionItemConfigurationsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/SolutionItemConfigurationsPanel.cs @@ -96,7 +96,7 @@ void OnAddConfiguration (object sender, EventArgs args) void OnCopyConfiguration (object sender, EventArgs args) { - Gtk.TreeModel foo; + Gtk.ITreeModel foo; Gtk.TreeIter iter; if (!configsList.Selection.GetSelected (out foo, out iter)) return; @@ -126,7 +126,7 @@ void AddConfiguration (string copyFrom) void OnRemoveConfiguration (object sender, EventArgs args) { - Gtk.TreeModel foo; + Gtk.ITreeModel foo; Gtk.TreeIter iter; if (!configsList.Selection.GetSelected (out foo, out iter)) return; @@ -152,7 +152,7 @@ void OnRemoveConfiguration (object sender, EventArgs args) void OnRenameConfiguration (object sender, EventArgs args) { - Gtk.TreeModel foo; + Gtk.ITreeModel foo; Gtk.TreeIter iter; if (!configsList.Selection.GetSelected (out foo, out iter)) return; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddExternalFileDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddExternalFileDialog.cs index dd01c1279dd..4eed4aacbdb 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddExternalFileDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddExternalFileDialog.cs @@ -33,7 +33,7 @@ internal partial class AddExternalFileDialog : Gtk.Dialog public AddExternalFileDialog (string file) { MonoDevelop.Components.IdeTheme.ApplyTheme (this); - HasSeparator = true; +// HasSeparator = true; this.Build (); radioCopy.Active = true; labelTitle.Markup = GettextCatalog.GetString (labelTitle.Text, "" + GLib.Markup.EscapeText (file) + ""); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddFileDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddFileDialog.cs index 0adbed59b7f..053ae6af234 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddFileDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddFileDialog.cs @@ -66,12 +66,12 @@ protected override bool RunDefault () FileSelector fdiag = new FileSelector (data.Title); fdiag.ShowHidden = data.ShowHidden; - + //add a combo that can be used to override the default build action - ComboBox combo = new ComboBox (data.BuildActions ?? new string[0]); + ComboBoxText combo = (ComboBoxText)(new ComboBox (data.BuildActions ?? new string[0])); combo.Sensitive = false; combo.Active = 0; - combo.RowSeparatorFunc = delegate (TreeModel model, TreeIter iter) { + combo.RowSeparatorFunc = delegate (ITreeModel model, TreeIter iter) { return "--" == ((string) model.GetValue (iter, 0)); }; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs index c301f2cbbf8..b9176227618 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs @@ -195,29 +195,29 @@ public PoliciesListSummaryTree () : base (new Gtk.ListStore (typeof (string))) this.AppendColumn ("", new Gtk.CellRendererText (), "text", 0); } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - if (HasPolicies) { - return base.OnExposeEvent (evnt); - } - - var win = evnt.Window; - win.Clear (); - if (string.IsNullOrEmpty (message)) { - return true; - } - - using (var layout = PangoUtil.CreateLayout (this)) { - layout.SetMarkup ("" + GLib.Markup.EscapeText (message) + ""); - int w, h; - layout.GetPixelSize (out w, out h); - var a = Allocation; - var x = (a.Width - w) / 2; - var y = (a.Height - h ) / 2; - win.DrawLayout (Style.TextGC (Gtk.StateType.Normal), x, y, layout); - } - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// if (HasPolicies) { +// return base.OnExposeEvent (evnt); +// } +// +// var win = evnt.Window; +// win.Clear (); +// if (string.IsNullOrEmpty (message)) { +// return true; +// } +// +// using (var layout = PangoUtil.CreateLayout (this)) { +// layout.SetMarkup ("" + GLib.Markup.EscapeText (message) + ""); +// int w, h; +// layout.GetPixelSize (out w, out h); +// var a = Allocation; +// var x = (a.Width - w) / 2; +// var y = (a.Height - h ) / 2; +// win.DrawLayout (Style.TextGC (Gtk.StateType.Normal), x, y, layout); +// } +// return true; +// } public bool HasPolicies { get; private set; } @@ -281,4 +281,4 @@ public void SetPolicies (PolicyContainer pset) HasPolicies = sorted.Count > 0; } } -} \ No newline at end of file +} diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs index a1b91bf4ca0..7c8dca335ac 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs @@ -129,7 +129,7 @@ public AssemblyReferencePanel (SelectReferenceDialog selectDialog) BorderWidth = 6; } - private int Sort (TreeModel model, TreeIter left, TreeIter right) + private int Sort (ITreeModel model, TreeIter left, TreeIter right) { int result = 0; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs index 1ac3ee7c816..af50aa3dcba 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs @@ -42,7 +42,7 @@ namespace MonoDevelop.Ide.Projects { public class DefaultPolicyOptionsDialog : OptionsDialog { - ComboBox policiesCombo; + ComboBoxText policiesCombo; MenuButton newButton; Button deleteButton; MenuButton exportButton; @@ -64,7 +64,7 @@ public DefaultPolicyOptionsDialog (MonoDevelop.Components.Window parentWindow) topBar.Spacing = 3; topBar.PackStart (new Label (GettextCatalog.GetString ("Editing Policy:")), false, false, 0); - policiesCombo = ComboBox.NewText (); + policiesCombo = new ComboBoxText (); topBar.PackStart (policiesCombo, false, false, 0); deleteButton = new Button (GettextCatalog.GetString ("Delete Policy")); @@ -128,9 +128,9 @@ public DefaultPolicyOptionsDialog (MonoDevelop.Components.Window parentWindow) ebox.ShowAll (); - VBox.PackStart (ebox, false, false, 0); - VBox.BorderWidth = 0; - Box.BoxChild c = (Box.BoxChild) VBox [ebox]; + ContentArea.PackStart (ebox, false, false, 0); + ContentArea.BorderWidth = 0; + Box.BoxChild c = (Box.BoxChild) ContentArea [ebox]; c.Position = 0; foreach (PolicySet ps in PolicyService.GetUserPolicySets ()) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs index 7ff8d8f7044..c4f65c41f9b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs @@ -114,9 +114,9 @@ void Build () // Top banner of dialog. var topLabelEventBox = new EventBox (); - topLabelEventBox.Accessible.SetShouldIgnore (true); + topLabelEventBox.Accessible.SetShouldIgnore (true); topLabelEventBox.Name = "topLabelEventBox"; - topLabelEventBox.HeightRequest = 52; + topLabelEventBox.HeightRequest = 52; topLabelEventBox.ModifyBg (StateType.Normal, bannerBackgroundColor); topLabelEventBox.ModifyFg (StateType.Normal, whiteColor); topLabelEventBox.BorderWidth = 0; @@ -148,15 +148,15 @@ void Build () topLabelHBox.PackStart (topBannerLabel, false, false, 20); topLabelEventBox.Add (topLabelHBox); - VBox.PackStart (topBannerTopEdgeLineEventBox, false, false, 0); - VBox.PackStart (topLabelEventBox, false, false, 0); - VBox.PackStart (topBannerBottomEdgeLineEventBox, false, false, 0); + ContentArea.PackStart (topBannerTopEdgeLineEventBox, false, false, 0); + ContentArea.PackStart (topLabelEventBox, false, false, 0); + ContentArea.PackStart (topBannerBottomEdgeLineEventBox, false, false, 0); // Main templates section. centreVBox = new VBox (); centreVBox.Accessible.SetShouldIgnore (true); centreVBox.Name = "centreVBox"; - VBox.PackStart (centreVBox, true, true, 0); + ContentArea.PackStart (centreVBox, true, true, 0); templatesHBox = new HBox (); templatesHBox.Accessible.SetShouldIgnore (true); templatesHBox.Name = "templatesHBox"; @@ -182,7 +182,7 @@ void Build () templateCategoriesTreeView.BorderWidth = 0; templateCategoriesTreeView.HeadersVisible = false; templateCategoriesTreeView.Model = templateCategoriesListStore; - templateCategoriesTreeView.SearchColumn = -1; // disable the interactive search + templateCategoriesTreeView.SearchColumn = -1; // disable the interactive search templateCategoriesTreeView.AppendColumn (CreateTemplateCategoriesTreeViewColumn ()); templateCategoriesScrolledWindow.Add (templateCategoriesTreeView); templateCategoriesBgBox.Add (templateCategoriesScrolledWindow); @@ -191,9 +191,9 @@ void Build () // Templates. var templatesBgBox = new EventBox (); templatesBgBox.Accessible.SetShouldIgnore (true); - templatesBgBox.ModifyBg (StateType.Normal, templateListBackgroundColor); + templatesBgBox.ModifyBg (StateType.Normal, templateListBackgroundColor); templatesBgBox.Name = "templatesVBox"; - templatesBgBox.WidthRequest = 400; + templatesBgBox.WidthRequest = 400; templatesHBox.PackStart (templatesBgBox, false, false, 0); var templatesScrolledWindow = new ScrolledWindow (); templatesScrolledWindow.Name = "templatesScrolledWindow"; @@ -207,12 +207,12 @@ void Build () templatesTreeView.Accessible.Description = GettextCatalog.GetString ("Select the project template"); templatesTreeView.HeadersVisible = false; templatesTreeView.Model = templatesListStore; - templatesTreeView.SearchColumn = -1; // disable the interactive search + templatesTreeView.SearchColumn = -1; // disable the interactive search templatesTreeView.AppendColumn (CreateTemplateListTreeViewColumn ()); templatesScrolledWindow.Add (templatesTreeView); - templatesBgBox.Add (templatesScrolledWindow); - - // Accessibilityy + templatesBgBox.Add (templatesScrolledWindow); + + // Accessibilityy templateCategoriesTreeView.Accessible.AddLinkedUIElement (templatesTreeView.Accessible); // Template @@ -230,27 +230,27 @@ void Build () // Template large image. templateImage = new ImageView (); - templateImage.Accessible.SetShouldIgnore (true); + templateImage.Accessible.SetShouldIgnore (true); templateImage.Name = "templateImage"; templateImage.HeightRequest = 140; - templateImage.WidthRequest = 240; + templateImage.WidthRequest = 240; templateVBox.PackStart (templateImage, false, false, 10); // Template description. - templateNameLabel = new Label (); + templateNameLabel = new Label (); templateNameLabel.Name = "templateNameLabel"; templateNameLabel.Accessible.Name = "templateNameLabel"; templateNameLabel.Accessible.Description = GettextCatalog.GetString ("The name of the selected template"); - templateNameLabel.WidthRequest = 240; + templateNameLabel.WidthRequest = 240; templateNameLabel.Wrap = true; templateNameLabel.Xalign = 0; templateNameLabel.Markup = MarkupTemplateName ("TemplateName"); templateVBox.PackStart (templateNameLabel, false, false, 0); - templateDescriptionLabel = new Label (); + templateDescriptionLabel = new Label (); templateDescriptionLabel.Name = "templateDescriptionLabel"; templateDescriptionLabel.Accessible.Name = "templateDescriptionLabel"; templateDescriptionLabel.Accessible.SetLabel (GettextCatalog.GetString ("The description of the selected template")); - templateDescriptionLabel.WidthRequest = 240; + templateDescriptionLabel.WidthRequest = 240; templateDescriptionLabel.Wrap = true; templateDescriptionLabel.Xalign = 0; templateVBox.PackStart (templateDescriptionLabel, false, false, 0); @@ -268,13 +268,13 @@ void Build () templateSectionSeparatorEventBox.Name = "templateSectionSeparatorEventBox"; templateSectionSeparatorEventBox.HeightRequest = 1; templateSectionSeparatorEventBox.ModifyBg (StateType.Normal, templateSectionSeparatorColor); - VBox.PackStart (templateSectionSeparatorEventBox, false, false, 0); + ContentArea.PackStart (templateSectionSeparatorEventBox, false, false, 0); // Buttons at bottom of dialog. var bottomHBox = new HBox (); bottomHBox.Accessible.SetShouldIgnore (true); bottomHBox.Name = "bottomHBox"; - VBox.PackStart (bottomHBox, false, false, 0); + ContentArea.PackStart (bottomHBox, false, false, 0); // Cancel button - bottom left. var cancelButtonBox = new HButtonBox (); @@ -296,7 +296,7 @@ void Build () previousNextButtonBox.Name = "previousNextButtonBox"; previousNextButtonBox.BorderWidth = 16; previousNextButtonBox.Spacing = 9; - bottomHBox.PackStart (previousNextButtonBox); + bottomHBox.PackStart (previousNextButtonBox, false, true, 0); previousNextButtonBox.Layout = ButtonBoxStyle.End; previousButton = new Button (); @@ -305,7 +305,7 @@ void Build () previousButton.Accessible.Description = GettextCatalog.GetString ("Return to the previous page"); previousButton.Label = GettextCatalog.GetString ("Previous"); previousButton.Sensitive = false; - previousNextButtonBox.PackEnd (previousButton); + previousNextButtonBox.PackEnd (previousButton, false, true, 0); // Next button - bottom right. nextButton = new Button (); @@ -313,10 +313,10 @@ void Build () nextButton.Accessible.Name = "nextButton"; nextButton.Accessible.Description = GettextCatalog.GetString ("Move to the next page"); nextButton.Label = GettextCatalog.GetString ("Next"); - previousNextButtonBox.PackEnd (nextButton); + previousNextButtonBox.PackEnd (nextButton, false, true, 0); // Remove default button action area. - VBox.Remove (ActionArea); + ContentArea.Remove (ActionArea); if (Child != null) { Child.ShowAll (); @@ -374,15 +374,20 @@ TreeViewColumn CreateTemplateListTreeViewColumn () /// widgets which will sometimes shrink the dialog. The size also changes /// on moving from page to page so override the requisition if it is too small. /// - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - base.OnSizeRequested (ref requisition); + base.OnGetPreferredHeight (out min_height, out natural_height); + + if (min_height < DefaultHeight) + min_height = DefaultHeight; + } - if (requisition.Height < DefaultHeight) - requisition.Height = DefaultHeight; + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) + { + base.OnGetPreferredWidth (out min_width, out natural_width); - if (requisition.Width < DefaultWidth) - requisition.Width = DefaultWidth; + if (min_width < DefaultWidth) + min_width = DefaultWidth; } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs index 59415db85f7..8c1b5e42dab 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs @@ -34,10 +34,10 @@ using MonoDevelop.Components.Commands; using MonoDevelop.Ide.Templates; using MonoDevelop.Ide.Gui; -using MonoDevelop.Core; +using MonoDevelop.Core; using System.Threading.Tasks; -using MonoDevelop.Ide.Projects; - +using MonoDevelop.Ide.Projects; + namespace MonoDevelop.Ide.Projects { partial class GtkNewProjectDialogBackend : INewProjectDialogBackend @@ -74,8 +74,8 @@ public GtkNewProjectDialogBackend () // Setup the treeview to be able to have a context menu var actionHandler = new ActionDelegate (templatesTreeView); actionHandler.PerformShowMenu += PerformShowMenu; - } - + } + void ProjectCreationFailed (object obj, EventArgs args) => ShowProjectCreationAccessibityNotification (true); void ProjectCreated(object obj, EventArgs args) => ShowProjectCreationAccessibityNotification (false); async void NextButtonClicked (object sender, EventArgs e) => await MoveToNextPage (); @@ -84,16 +84,16 @@ void ShowProjectCreationAccessibityNotification (bool hasError) { var projectTemplate = controller.SelectedTemplate; - string messageText; + string messageText; - if (hasError) - messageText = GettextCatalog.GetString ("{0} failed to create", projectTemplate.Name); - else + if (hasError) + messageText = GettextCatalog.GetString ("{0} failed to create", projectTemplate.Name); + else messageText = GettextCatalog.GetString ("{0} successfully created", projectTemplate.Name); - this.Accessible.MakeAccessibilityAnnouncement (messageText); + this.Accessible.MakeAccessibilityAnnouncement (messageText); } - + public void ShowDialog () { MessageService.ShowCustomDialog (this); @@ -122,7 +122,7 @@ public void RegisterController (INewProjectDialogController controller) MoveToNextPage ().Ignore(); } - void SetTemplateCategoryCellData (TreeViewColumn col, CellRenderer renderer, TreeModel model, TreeIter it) + void SetTemplateCategoryCellData (TreeViewColumn col, CellRenderer renderer, ITreeModel model, TreeIter it) { var categoryTextRenderer = (GtkTemplateCategoryCellRenderer)renderer; categoryTextRenderer.Category = (TemplateCategory)model.GetValue (it, TemplateCategoryColumn); @@ -130,7 +130,7 @@ void SetTemplateCategoryCellData (TreeViewColumn col, CellRenderer renderer, Tre categoryTextRenderer.CategoryName = model.GetValue (it, TemplateCategoryNameColumn) as string; } - static void SetTemplateTextCellData (TreeViewColumn col, CellRenderer renderer, TreeModel model, TreeIter it) + static void SetTemplateTextCellData (TreeViewColumn col, CellRenderer renderer, ITreeModel model, TreeIter it) { var template = (SolutionTemplate)model.GetValue (it, TemplateColumn); var templateTextRenderer = (GtkTemplateCellRenderer)renderer; @@ -139,7 +139,7 @@ static void SetTemplateTextCellData (TreeViewColumn col, CellRenderer renderer, templateTextRenderer.TemplateCategory = model.GetValue (it, TemplateNameColumn) as string; } - static void SetLanguageCellData (TreeViewColumn col, CellRenderer renderer, TreeModel model, TreeIter it) + static void SetLanguageCellData (TreeViewColumn col, CellRenderer renderer, ITreeModel model, TreeIter it) { var template = (SolutionTemplate)model.GetValue (it, TemplateColumn); var languageRenderer = (LanguageCellRenderer)renderer; @@ -149,20 +149,20 @@ static void SetLanguageCellData (TreeViewColumn col, CellRenderer renderer, Tree void HandlePopup (SolutionTemplate template, uint eventTime) { if (popupMenu == null) { - popupMenu = new Menu (); - popupMenu.AttachToWidget (this, null); - } - ClearPopupMenuItems (); - AddLanguageMenuItems (popupMenu, template); - popupMenu.ModifyBg (StateType.Normal, Styles.NewProjectDialog.TemplateLanguageButtonBackground.ToGdkColor ()); - popupMenu.ShowAll (); - - MenuPositionFunc posFunc = (Menu m, out int x, out int y, out bool pushIn) => { - Gdk.Rectangle rect = languageCellRenderer.GetLanguageRect (); - Gdk.Rectangle screenRect = GtkUtil.ToScreenCoordinates (templatesTreeView, templatesTreeView.GdkWindow, rect); - x = screenRect.X; - y = screenRect.Bottom; - pushIn = false; + popupMenu = new Menu (); + popupMenu.AttachToWidget (this, null); + } + ClearPopupMenuItems (); + AddLanguageMenuItems (popupMenu, template); + popupMenu.ModifyBg (StateType.Normal, Styles.NewProjectDialog.TemplateLanguageButtonBackground.ToGdkColor ()); + popupMenu.ShowAll (); + + MenuPositionFunc posFunc = (Menu m, out int x, out int y, out bool pushIn) => { + Gdk.Rectangle rect = languageCellRenderer.GetLanguageRect (); + Gdk.Rectangle screenRect = GtkUtil.ToScreenCoordinates (templatesTreeView, templatesTreeView.GdkWindow, rect); + x = screenRect.X; + y = screenRect.Bottom; + pushIn = false; }; popupMenu.Popup (null, null, posFunc, 0, eventTime); } @@ -179,24 +179,24 @@ void TemplatesTreeViewButtonPressed (object o, ButtonPressEventArgs args) if (languageCellRenderer.IsLanguageButtonPressed (args.Event)) { HandlePopup (template, args.Event.Time); } - } - - [GLib.ConnectBefore] - private void TemplatesTreeViewKeyPressed (object o, KeyPressEventArgs args) - { - isLastPressedKeySpace = args.Event.Key == Gdk.Key.space; - - if (isLastPressedKeySpace) { - isLastPressedKeySpace = true; - var template = GetSelectedTemplate (); - - if (template == null) - return; - if (template.AvailableLanguages.Count > 1) - HandlePopup (template, 0); - else - System.Media.SystemSounds.Beep.Play (); - } + } + + [GLib.ConnectBefore] + private void TemplatesTreeViewKeyPressed (object o, KeyPressEventArgs args) + { + isLastPressedKeySpace = args.Event.Key == Gdk.Key.space; + + if (isLastPressedKeySpace) { + isLastPressedKeySpace = true; + var template = GetSelectedTemplate (); + + if (template == null) + return; + if (template.AvailableLanguages.Count > 1) + HandlePopup (template, 0); + else + System.Media.SystemSounds.Beep.Play (); + } } void ClearPopupMenuItems () @@ -230,7 +230,7 @@ void AddLanguageMenuItems (Menu menu, SolutionTemplate template) } } - bool TemplateCategoriesTreeViewSelection (TreeSelection selection, TreeModel model, TreePath path, bool path_currently_selected) + bool TemplateCategoriesTreeViewSelection (TreeSelection selection, ITreeModel model, TreePath path, bool path_currently_selected) { TreeIter iter; if (model.GetIter (out iter, path)) { @@ -243,7 +243,7 @@ bool TemplateCategoriesTreeViewSelection (TreeSelection selection, TreeModel mod return true; } - bool TemplatesTreeViewSelection (TreeSelection selection, TreeModel model, TreePath path, bool path_currently_selected) + bool TemplatesTreeViewSelection (TreeSelection selection, ITreeModel model, TreePath path, bool path_currently_selected) { TreeIter iter; if (model.GetIter (out iter, path)) { @@ -381,20 +381,20 @@ TemplateCategory GetSelectedTemplateCategory () void ShowTemplatesForCategory (TemplateCategory category) { templateTextRenderer.RenderRecentTemplate = false; - languageCellRenderer.RenderRecentTemplate = false; - foreach (TemplateCategory subCategory in category.Categories) { - templatesListStore.AppendValues ( - MarkupTopLevelCategoryName (subCategory.Name), - null, - null); - + languageCellRenderer.RenderRecentTemplate = false; + foreach (TemplateCategory subCategory in category.Categories) { + templatesListStore.AppendValues ( + MarkupTopLevelCategoryName (subCategory.Name), + null, + null); + foreach (SolutionTemplate template in subCategory.Templates) { - if (template.HasProjects || controller.IsNewSolution) { - templatesListStore.AppendValues ( - template.Name, - GetIcon (template.IconId, IconSize.Dnd), - template); - } + if (template.HasProjects || controller.IsNewSolution) { + templatesListStore.AppendValues ( + template.Name, + GetIcon (template.IconId, IconSize.Dnd), + template); + } } } } @@ -463,7 +463,7 @@ void SelectTemplateDefinedbyController () if (selectedTemplate != null && controller.RecentTemplates.Count > 0) { if (controller.RecentTemplates.Contains (selectedTemplate)) { - SelectRecentTemplatesCategory (); + SelectRecentTemplatesCategory (); SelectTemplate (selectedTemplate); return; } @@ -486,8 +486,8 @@ void SelectRecentTemplatesCategory () TreeIter iter = TreeIter.Zero; // recent templates entry is always the first one and has no category assigned to it if (templateCategoriesListStore.GetIterFirst (out iter) && templateCategoriesListStore.GetValue (iter, TemplateCategoryColumn) == null) { - templateCategoriesTreeView.Selection.SelectIter (iter); - TreePath path = templateCategoriesListStore.GetPath (iter); + templateCategoriesTreeView.Selection.SelectIter (iter); + TreePath path = templateCategoriesListStore.GetPath (iter); templateCategoriesTreeView.ScrollToCell (path, null, true, 1, 0); } } @@ -634,14 +634,14 @@ void FocusWidget (Widget widget) void TreeViewRowActivated (object o, RowActivatedArgs args) { if (CanMoveToNextPage && !isLastPressedKeySpace && - IsSolutionTemplateOnActivatedRow ((Gtk.TreeView)o, args)) + IsSolutionTemplateOnActivatedRow ((Gtk.TreeView)o, args)) MoveToNextPage ().Ignore(); isLastPressedKeySpace = false; } bool IsSolutionTemplateOnActivatedRow (TreeView treeView, RowActivatedArgs args) { - TreeModel model = treeView.Model; + ITreeModel model = treeView.Model; TreeIter iter; if (model.GetIter (out iter, args.Path)) { var template = model.GetValue (iter, TemplateColumn) as SolutionTemplate; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectConfigurationWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectConfigurationWidget.cs index e1c784cb94f..80dbe31119f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectConfigurationWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectConfigurationWidget.cs @@ -149,7 +149,7 @@ void OnLocationTextBoxChanged () void ProjectNameTextInserted (object o, TextInsertedArgs args) { - if (args.Text.IndexOf ('\r') >= 0) { + if (args.ToString().IndexOf ('\r') >= 0) { var textBox = (Entry)o; textBox.Text = textBox.Text.Replace ("\r", string.Empty); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectFolderPreviewWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectFolderPreviewWidget.cs index a3df74f7789..df00e7f8693 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectFolderPreviewWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectFolderPreviewWidget.cs @@ -85,8 +85,8 @@ public GtkProjectFolderPreviewWidget () Styles.ColorGetHex (Styles.NewProjectDialog.ProjectConfigurationPreviewLabelColor), global::Mono.Unix.Catalog.GetString ("PREVIEW")); - CreateFolderTreeViewColumns (); - + CreateFolderTreeViewColumns (); + // Accessibility previewLabel.Accessible.Name = "projectFolderPreviewLabel"; previewLabel.Accessible.SetTitleFor (folderTreeView.Accessible); @@ -122,7 +122,7 @@ void CreateFolderTreeViewColumns () folderTreeView.AppendColumn (column); } - static bool TreeViewSelection (TreeSelection selection, TreeModel model, TreePath path, bool path_currently_selected) + static bool TreeViewSelection (TreeSelection selection, ITreeModel model, TreePath path, bool path_currently_selected) { return false; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCategoryCellRenderer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCategoryCellRenderer.cs index b8e64a0ba37..7684f3be052 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCategoryCellRenderer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCategoryCellRenderer.cs @@ -44,39 +44,39 @@ class GtkTemplateCategoryCellRenderer : CellRendererText const int iconTextXPadding = 1; const int iconYOffset = -1; - public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - if (CategoryIcon != null) { - height = (int)CategoryIcon.Height + ((int)Ypad * 2) + topLevelTemplateHeadingTotalYPadding; - } - } - - protected override void Render (Drawable window, Widget widget, Rectangle background_area, Rectangle cell_area, Rectangle expose_area, CellRendererState flags) - { - StateType state = GetState (widget, flags); - var isSelected = state == StateType.Selected || state == StateType.Active; - int iconTextPadding = iconTextXPadding; - int textYOffset = 0; - Rectangle iconRect = GetIconRect (cell_area); - - using (var ctx = CairoHelper.Create (window)) { - if (CategoryIcon != null) { - iconRect = DrawIcon (ctx, widget, cell_area, flags); - iconTextPadding = topLevelIconTextXPadding; - textYOffset = (Category == null ? 0 : topLevelTemplateHeadingYOffset); - } - - DrawTemplateCategoryText (window, widget, cell_area, iconRect, iconTextPadding, textYOffset, flags); - if (Category == null && !isSelected) { - ctx.MoveTo (cell_area.X + (int)Xpad, cell_area.Y + cell_area.Height + 1); - ctx.SetSourceColor (Gui.Styles.ThinSplitterColor.ToCairoColor ()); - ctx.LineWidth = 1; - ctx.LineTo (cell_area.X + cell_area.Width - (int)Xpad, cell_area.Y + cell_area.Height + 1); - ctx.Stroke (); - } - } - } +// public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) +// { +// base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); +// if (CategoryIcon != null) { +// height = (int)CategoryIcon.Height + ((int)Ypad * 2) + topLevelTemplateHeadingTotalYPadding; +// } +// } + +// protected override void Render (Drawable window, Widget widget, Rectangle background_area, Rectangle cell_area, Rectangle expose_area, CellRendererState flags) +// { +// StateType state = GetState (widget, flags); +// var isSelected = state == StateType.Selected || state == StateType.Active; +// int iconTextPadding = iconTextXPadding; +// int textYOffset = 0; +// Rectangle iconRect = GetIconRect (cell_area); +// +// using (var ctx = CairoHelper.Create (window)) { +// if (CategoryIcon != null) { +// iconRect = DrawIcon (ctx, widget, cell_area, flags); +// iconTextPadding = topLevelIconTextXPadding; +// textYOffset = (Category == null ? 0 : topLevelTemplateHeadingYOffset); +// } +// +// DrawTemplateCategoryText (window, widget, cell_area, iconRect, iconTextPadding, textYOffset, flags); +// if (Category == null && !isSelected) { +// ctx.MoveTo (cell_area.X + (int)Xpad, cell_area.Y + cell_area.Height + 1); +// ctx.SetSourceColor (Gui.Styles.ThinSplitterColor.ToCairoColor ()); +// ctx.LineWidth = 1; +// ctx.LineTo (cell_area.X + cell_area.Width - (int)Xpad, cell_area.Y + cell_area.Height + 1); +// ctx.Stroke (); +// } +// } +// } Rectangle GetIconRect (Rectangle cell_area) { @@ -109,25 +109,25 @@ Rectangle DrawIcon (Cairo.Context ctx, Widget widget, Rectangle cell_area, CellR return iconRect; } - void DrawTemplateCategoryText (Drawable window, Widget widget, Rectangle cell_area, Rectangle iconRect, int iconTextPadding, int textYOffset, CellRendererState flags) - { - StateType state = GetState (widget, flags); - - using (var layout = new Pango.Layout (widget.PangoContext)) { - - layout.Ellipsize = Pango.EllipsizeMode.End; - int textPixelWidth = widget.Allocation.Width - ((int)Xpad * 2) - iconRect.Width - iconTextPadding; - layout.Width = (int)(textPixelWidth * Pango.Scale.PangoScale); - - layout.SetMarkup (CategoryName); - - int w, h; - layout.GetPixelSize (out w, out h); - int textY = cell_area.Y + (cell_area.Height - h) / 2 + textYOffset; - - window.DrawLayout (widget.Style.TextGC (state), iconRect.Right + iconTextPadding, textY, layout); - } - } +// void DrawTemplateCategoryText (Drawable window, Widget widget, Rectangle cell_area, Rectangle iconRect, int iconTextPadding, int textYOffset, CellRendererState flags) +// { +// StateType state = GetState (widget, flags); +// +// using (var layout = new Pango.Layout (widget.PangoContext)) { +// +// layout.Ellipsize = Pango.EllipsizeMode.End; +// int textPixelWidth = widget.Allocation.Width - ((int)Xpad * 2) - iconRect.Width - iconTextPadding; +// layout.Width = (int)(textPixelWidth * Pango.Scale.PangoScale); +// +// layout.SetMarkup (CategoryName); +// +// int w, h; +// layout.GetPixelSize (out w, out h); +// int textY = cell_area.Y + (cell_area.Height - h) / 2 + textYOffset; +// +// window.DrawLayout (widget.Style.TextGC (state), iconRect.Right + iconTextPadding, textY, layout); +// } +// } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs index 8c885ffd9c2..9629e0c010e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs @@ -63,55 +63,55 @@ static bool IsYosemiteOrHigher () return Platform.IsMac && (Platform.OSVersion >= MacSystemInformation.Yosemite); } - public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - if (TemplateIcon != null) { - height = (int)TemplateIcon.Height + ((int)Ypad * 2); - } else { - height += RenderRecentTemplate ? recentTemplateHeadingTotalYPadding : groupTemplateHeadingTotalYPadding; - } - } - - protected override void Render (Drawable window, Widget widget, Rectangle background_area, Rectangle cell_area, Rectangle expose_area, CellRendererState flags) - { - if (Template == null) { - DrawTemplateCategoryText (window, widget, cell_area, flags); - return; - } - - using (var ctx = CairoHelper.Create (window)) { - using (var layout = new Pango.Layout (widget.PangoContext)) { - - Rectangle iconRect = DrawIcon (ctx, widget, cell_area, flags); - - DrawTemplateNameText (window, widget, cell_area, iconRect, flags); - if (RenderRecentTemplate) - DrawCategoryText (ctx, widget, cell_area, iconRect, flags); - } - } - } - - void DrawTemplateCategoryText (Drawable window, Widget widget, Rectangle cell_area, CellRendererState flags) - { - StateType state = GetState (widget, flags); - - using (var layout = new Pango.Layout (widget.PangoContext)) { - - layout.Ellipsize = Pango.EllipsizeMode.End; - int textPixelWidth = widget.Allocation.Width - ((int)Xpad * 2); - layout.Width = (int)(textPixelWidth * Pango.Scale.PangoScale); - - layout.SetMarkup (TemplateCategory); - - int w, h; - layout.GetPixelSize (out w, out h); - - int textX = cell_area.X + (int)Xpad + categoryTextPaddingX; - int textY = cell_area.Y + (cell_area.Height - h) / 2 + groupTemplateHeadingYOffset; - window.DrawLayout (widget.Style.TextGC (state), textX, textY, layout); - } - } +// public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) +// { +// base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); +// if (TemplateIcon != null) { +// height = (int)TemplateIcon.Height + ((int)Ypad * 2); +// } else { +// height += RenderRecentTemplate ? recentTemplateHeadingTotalYPadding : groupTemplateHeadingTotalYPadding; +// } +// } + +// protected override void Render (Drawable window, Widget widget, Rectangle background_area, Rectangle cell_area, Rectangle expose_area, CellRendererState flags) +// { +// if (Template == null) { +// DrawTemplateCategoryText (window, widget, cell_area, flags); +// return; +// } +// +// using (var ctx = CairoHelper.Create (window)) { +// using (var layout = new Pango.Layout (widget.PangoContext)) { +// +// Rectangle iconRect = DrawIcon (ctx, widget, cell_area, flags); +// +// DrawTemplateNameText (window, widget, cell_area, iconRect, flags); +// if (RenderRecentTemplate) +// DrawCategoryText (ctx, widget, cell_area, iconRect, flags); +// } +// } +// } + +// void DrawTemplateCategoryText (Drawable window, Widget widget, Rectangle cell_area, CellRendererState flags) +// { +// StateType state = GetState (widget, flags); +// +// using (var layout = new Pango.Layout (widget.PangoContext)) { +// +// layout.Ellipsize = Pango.EllipsizeMode.End; +// int textPixelWidth = widget.Allocation.Width - ((int)Xpad * 2); +// layout.Width = (int)(textPixelWidth * Pango.Scale.PangoScale); +// +// layout.SetMarkup (TemplateCategory); +// +// int w, h; +// layout.GetPixelSize (out w, out h); +// +// int textX = cell_area.X + (int)Xpad + categoryTextPaddingX; +// int textY = cell_area.Y + (cell_area.Height - h) / 2 + groupTemplateHeadingYOffset; +// window.DrawLayout (widget.Style.TextGC (state), textX, textY, layout); +// } +// } Rectangle DrawIcon (Cairo.Context ctx, Widget widget, Rectangle cell_area, CellRendererState flags) { @@ -125,25 +125,25 @@ Rectangle DrawIcon (Cairo.Context ctx, Widget widget, Rectangle cell_area, CellR return iconRect; } - void DrawTemplateNameText (Drawable window, Widget widget, Rectangle cell_area, Rectangle iconRect, CellRendererState flags) - { - StateType state = GetState (widget, flags); - - using (var layout = new Pango.Layout (widget.PangoContext)) { - - layout.Ellipsize = Pango.EllipsizeMode.End; - int textPixelWidth = cell_area.Width - ((int)Xpad * 2) - iconRect.Width - iconTextPadding; - layout.Width = (int)(textPixelWidth * Pango.Scale.PangoScale); - - layout.SetMarkup (GLib.Markup.EscapeText (Template.Name)); - - int w, h; - layout.GetPixelSize (out w, out h); - int textY = cell_area.Y + (RenderRecentTemplate ? (2) : (cell_area.Height - h) / 2); - - window.DrawLayout (widget.Style.TextGC (state), iconRect.Right + iconTextPadding, textY, layout); - } - } +// void DrawTemplateNameText (Drawable window, Widget widget, Rectangle cell_area, Rectangle iconRect, CellRendererState flags) +// { +// StateType state = GetState (widget, flags); +// +// using (var layout = new Pango.Layout (widget.PangoContext)) { +// +// layout.Ellipsize = Pango.EllipsizeMode.End; +// int textPixelWidth = cell_area.Width - ((int)Xpad * 2) - iconRect.Width - iconTextPadding; +// layout.Width = (int)(textPixelWidth * Pango.Scale.PangoScale); +// +// layout.SetMarkup (GLib.Markup.EscapeText (Template.Name)); +// +// int w, h; +// layout.GetPixelSize (out w, out h); +// int textY = cell_area.Y + (RenderRecentTemplate ? (2) : (cell_area.Height - h) / 2); +// +// window.DrawLayout (widget.Style.TextGC (state), iconRect.Right + iconTextPadding, textY, layout); +// } +// } void DrawCategoryText (Cairo.Context ctx, Widget widget, Rectangle cell_area, Rectangle iconRect, CellRendererState flags) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs index e2454a959f8..cdfc263646c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs @@ -72,63 +72,63 @@ public Rectangle GetLanguageRect () return languageRect; } - public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - - int languageRectangleWidth = textWidth + languageLeftHandPadding; - if (TemplateHasMultipleLanguages ()) { - languageRectangleWidth += languageRightHandPadding + dropdownTriangleWidth + dropdownTriangleRightHandPadding; - } else { - languageRectangleWidth += languageLeftHandPadding; - languageRectangleWidth = Math.Max (languageRectangleWidth, minLanguageRectWidth); - } - - width = languageRectangleWidth; - } - - protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - { - if (Template == null) { - return; - } - - if (!RenderRecentTemplate && (!Template.AvailableLanguages.Any () || !IsTemplateRowSelected (widget, flags))) { - return; - } - - using (var ctx = CairoHelper.Create (window)) { - using (var layout = new Pango.Layout (widget.PangoContext)) { - int textHeight = 0; - - SetMarkup (layout, GetSelectedLanguage ()); - layout.GetPixelSize (out textWidth, out textHeight); - - languageRect = GetLanguageButtonRectangle (window, widget, cell_area, textHeight, textWidth); - - StateType state = StateType.Normal; - if (!RenderRecentTemplate) { - RoundBorder (ctx, languageRect.X, languageRect.Y, languageRect.Width, languageRect.Height); - SetSourceColor (ctx, Styles.NewProjectDialog.TemplateLanguageButtonBackground.ToCairoColor ()); - ctx.Fill (); - } else { - state = GetState (widget, flags); - } - - int tw = TemplateHasMultipleLanguages () ? textWidth + dropdownTriangleWidth + 2 : textWidth; - int languageTextX = languageRect.X + ((languageRect.Width - tw) / 2); - int languageTextY = languageRect.Y + (languageRect.Height - textHeight) / 2; - - window.DrawLayout (widget.Style.TextGC (state), languageTextX, languageTextY, layout); - - if (TemplateHasMultipleLanguages ()) { - int triangleX = languageTextX + textWidth + languageRightHandPadding; - int triangleY = languageRect.Y + (languageRect.Height - dropdownTriangleHeight) / 2; - DrawTriangle (ctx, triangleX, triangleY); - } - } - } - } +// public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) +// { +// base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); +// +// int languageRectangleWidth = textWidth + languageLeftHandPadding; +// if (TemplateHasMultipleLanguages ()) { +// languageRectangleWidth += languageRightHandPadding + dropdownTriangleWidth + dropdownTriangleRightHandPadding; +// } else { +// languageRectangleWidth += languageLeftHandPadding; +// languageRectangleWidth = Math.Max (languageRectangleWidth, minLanguageRectWidth); +// } +// +// width = languageRectangleWidth; +// } + +// protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) +// { +// if (Template == null) { +// return; +// } +// +// if (!RenderRecentTemplate && (!Template.AvailableLanguages.Any () || !IsTemplateRowSelected (widget, flags))) { +// return; +// } +// +// using (var ctx = CairoHelper.Create (window)) { +// using (var layout = new Pango.Layout (widget.PangoContext)) { +// int textHeight = 0; +// +// SetMarkup (layout, GetSelectedLanguage ()); +// layout.GetPixelSize (out textWidth, out textHeight); +// +// languageRect = GetLanguageButtonRectangle (window, widget, cell_area, textHeight, textWidth); +// +// StateType state = StateType.Normal; +// if (!RenderRecentTemplate) { +// RoundBorder (ctx, languageRect.X, languageRect.Y, languageRect.Width, languageRect.Height); +// SetSourceColor (ctx, Styles.NewProjectDialog.TemplateLanguageButtonBackground.ToCairoColor ()); +// ctx.Fill (); +// } else { +// state = GetState (widget, flags); +// } +// +// int tw = TemplateHasMultipleLanguages () ? textWidth + dropdownTriangleWidth + 2 : textWidth; +// int languageTextX = languageRect.X + ((languageRect.Width - tw) / 2); +// int languageTextY = languageRect.Y + (languageRect.Height - textHeight) / 2; +// +// window.DrawLayout (widget.Style.TextGC (state), languageTextX, languageTextY, layout); +// +// if (TemplateHasMultipleLanguages ()) { +// int triangleX = languageTextX + textWidth + languageRightHandPadding; +// int triangleY = languageRect.Y + (languageRect.Height - dropdownTriangleHeight) / 2; +// DrawTriangle (ctx, triangleX, triangleY); +// } +// } +// } +// } void DrawTriangle (Cairo.Context ctx, int x, int y) { @@ -143,24 +143,24 @@ void DrawTriangle (Cairo.Context ctx, int x, int y) ctx.Fill (); } - Rectangle GetLanguageButtonRectangle (Drawable window, Widget widget, Rectangle cell_area, int textHeight, int textWidth) - { - int languageRectangleHeight = cell_area.Height - 8; - int languageRectangleWidth = textWidth + languageLeftHandPadding; - if (TemplateHasMultipleLanguages ()) { - languageRectangleWidth += languageRightHandPadding + dropdownTriangleWidth + dropdownTriangleRightHandPadding; - } else { - languageRectangleWidth += languageLeftHandPadding; - languageRectangleWidth = Math.Max (languageRectangleWidth, minLanguageRectWidth); - } - - var dy = (cell_area.Height - languageRectangleHeight) / 2 - 1; - var y = cell_area.Y + dy; - //var x = widget.Allocation.Width - languageRectangleWidth - (int)Xpad; - var x = cell_area.X; - - return new Rectangle (x, y, languageRectangleWidth, languageRectangleHeight); - } +// Rectangle GetLanguageButtonRectangle (Drawable window, Widget widget, Rectangle cell_area, int textHeight, int textWidth) +// { +// int languageRectangleHeight = cell_area.Height - 8; +// int languageRectangleWidth = textWidth + languageLeftHandPadding; +// if (TemplateHasMultipleLanguages ()) { +// languageRectangleWidth += languageRightHandPadding + dropdownTriangleWidth + dropdownTriangleRightHandPadding; +// } else { +// languageRectangleWidth += languageLeftHandPadding; +// languageRectangleWidth = Math.Max (languageRectangleWidth, minLanguageRectWidth); +// } +// +// var dy = (cell_area.Height - languageRectangleHeight) / 2 - 1; +// var y = cell_area.Y + dy; +// //var x = widget.Allocation.Width - languageRectangleWidth - (int)Xpad; +// var x = cell_area.X; +// +// return new Rectangle (x, y, languageRectangleWidth, languageRectangleHeight); +// } internal bool IsLanguageButtonPressed (EventButton button) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs index 7d5fb442c4b..2ab7257bc92 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs @@ -76,7 +76,7 @@ public NewFileDialog (Project parentProject, string basePath, SolutionFolder par BorderWidth = 6; TransientFor = IdeApp.Workbench.RootWindow; - HasSeparator = false; +// HasSeparator = false; InitializeComponents (); @@ -170,7 +170,7 @@ Category GetCategory (List catList, string categoryname) void CategoryChange (object sender, EventArgs e) { - TreeModel treeModel; + ITreeModel treeModel; TreeIter treeIter; if (catView.Selection.GetSelected (out treeModel, out treeIter)) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/PackageReferencePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/PackageReferencePanel.cs index c172f9320b5..2e790a0a8be 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/PackageReferencePanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/PackageReferencePanel.cs @@ -141,33 +141,33 @@ public void SetTargetFramework (IAssemblyContext targetContext, TargetFramework public void Reset () { try { - treeView.FreezeChildNotify (); - store.Clear (); - - bool isPcl = configureProject.IsPortableLibrary; - - foreach (SystemAssembly systemAssembly in targetContext.GetAssemblies (targetVersion)) { - if (systemAssembly.Package.IsFrameworkPackage && (isPcl || systemAssembly.Name == "mscorlib")) - continue; - - bool selected = IsSelected (ReferenceType.Package, systemAssembly.FullName, systemAssembly.Package.Name); - int matchRank = 0; - string name, version; - - if (stringMatcher != null) { - string txt = systemAssembly.Name + " " + systemAssembly.Version; - if (!stringMatcher.CalcMatchRank (txt, out matchRank)) - continue; - int [] match = stringMatcher.GetMatch (txt); - name = GetMatchMarkup (treeView, systemAssembly.Name, match, 0); - version = GetMatchMarkup (treeView, systemAssembly.Version, match, systemAssembly.Name.Length + 1); - } else { - name = GLib.Markup.EscapeText (systemAssembly.Name); - version = GLib.Markup.EscapeText (systemAssembly.Version); - } - string pkg = systemAssembly.Package.GetDisplayName (); - if (systemAssembly.Package.IsInternalPackage) - pkg += " " + GettextCatalog.GetString ("(Provided by {0})", BrandingService.ApplicationName); + treeView.FreezeChildNotify (); + store.Clear (); + + bool isPcl = configureProject.IsPortableLibrary; + + foreach (SystemAssembly systemAssembly in targetContext.GetAssemblies (targetVersion)) { + if (systemAssembly.Package.IsFrameworkPackage && (isPcl || systemAssembly.Name == "mscorlib")) + continue; + + bool selected = IsSelected (ReferenceType.Package, systemAssembly.FullName, systemAssembly.Package.Name); + int matchRank = 0; + string name, version; + + if (stringMatcher != null) { + string txt = systemAssembly.Name + " " + systemAssembly.Version; + if (!stringMatcher.CalcMatchRank (txt, out matchRank)) + continue; + int [] match = stringMatcher.GetMatch (txt); + name = GetMatchMarkup (treeView, systemAssembly.Name, match, 0); + version = GetMatchMarkup (treeView, systemAssembly.Version, match, systemAssembly.Name.Length + 1); + } else { + name = GLib.Markup.EscapeText (systemAssembly.Name); + version = GLib.Markup.EscapeText (systemAssembly.Version); + } + string pkg = systemAssembly.Package.GetDisplayName (); + if (systemAssembly.Package.IsInternalPackage) + pkg += " " + GettextCatalog.GetString ("(Provided by {0})", BrandingService.ApplicationName); store.InsertWithValues (-1, name, @@ -178,72 +178,72 @@ public void Reset () pkg, MonoDevelop.Ide.Gui.Stock.Package, matchRank, - null, + null, ReferenceType.Package); - } - - if (showAll) { - Solution openSolution = configureProject.ParentSolution; - if (openSolution == null) - return; - - Dictionary references = new Dictionary (); - - foreach (Project projectEntry in openSolution.GetAllItems ()) { - - if (projectEntry == configureProject) - continue; - - bool selected = IsSelected (ReferenceType.Project, projectEntry.Name, ""); - int matchRank = 0; - string name; - - if (stringMatcher != null) { - if (!stringMatcher.CalcMatchRank (projectEntry.Name, out matchRank)) - continue; - int [] match = stringMatcher.GetMatch (projectEntry.Name); - name = GetMatchMarkup (treeView, projectEntry.Name, match, 0); - } else { - name = GLib.Markup.EscapeText (projectEntry.Name); - } - - DotNetProject netProject = projectEntry as DotNetProject; - if (netProject != null) { - if (ProjectReferencePanel.ProjectReferencesProject (references, null, netProject, configureProject.Name)) - continue; - - string reason; - if (!configureProject.CanReferenceProject (netProject, out reason)) - continue; + } + + if (showAll) { + Solution openSolution = configureProject.ParentSolution; + if (openSolution == null) + return; + + Dictionary references = new Dictionary (); + + foreach (Project projectEntry in openSolution.GetAllItems ()) { + + if (projectEntry == configureProject) + continue; + + bool selected = IsSelected (ReferenceType.Project, projectEntry.Name, ""); + int matchRank = 0; + string name; + + if (stringMatcher != null) { + if (!stringMatcher.CalcMatchRank (projectEntry.Name, out matchRank)) + continue; + int [] match = stringMatcher.GetMatch (projectEntry.Name); + name = GetMatchMarkup (treeView, projectEntry.Name, match, 0); + } else { + name = GLib.Markup.EscapeText (projectEntry.Name); + } + + DotNetProject netProject = projectEntry as DotNetProject; + if (netProject != null) { + if (ProjectReferencePanel.ProjectReferencesProject (references, null, netProject, configureProject.Name)) + continue; + + string reason; + if (!configureProject.CanReferenceProject (netProject, out reason)) + continue; } - store.InsertWithValues (-1, name, "", null, selected, projectEntry.FileName.ToString (), "", projectEntry.StockIcon, matchRank, projectEntry.Name, ReferenceType.Project); - } - - foreach (FilePath file in selectDialog.GetRecentFileReferences ()) { - bool selected = IsSelected (ReferenceType.Assembly, file, ""); - int matchRank = 0; - string fname = file.FileName; - string name; - - string version = string.Empty; - try { - string sname = SystemAssemblyService.GetAssemblyName (file); - var aname = SystemAssemblyService.ParseAssemblyName (sname); - version = aname.Version.ToString (); - } catch { - continue; - } - - if (stringMatcher != null) { - if (!stringMatcher.CalcMatchRank (fname, out matchRank)) - continue; - int [] match = stringMatcher.GetMatch (fname); - name = GetMatchMarkup (treeView, fname, match, 0); - } else { - name = GLib.Markup.EscapeText (fname); - } - store.InsertWithValues (-1, name, version, null, selected, (string)file, GLib.Markup.EscapeText (file), MonoDevelop.Ide.Gui.Stock.OpenFolder, matchRank, null, ReferenceType.Assembly); - } + store.InsertWithValues (-1, name, "", null, selected, projectEntry.FileName.ToString (), "", projectEntry.StockIcon, matchRank, projectEntry.Name, ReferenceType.Project); + } + + foreach (FilePath file in selectDialog.GetRecentFileReferences ()) { + bool selected = IsSelected (ReferenceType.Assembly, file, ""); + int matchRank = 0; + string fname = file.FileName; + string name; + + string version = string.Empty; + try { + string sname = SystemAssemblyService.GetAssemblyName (file); + var aname = SystemAssemblyService.ParseAssemblyName (sname); + version = aname.Version.ToString (); + } catch { + continue; + } + + if (stringMatcher != null) { + if (!stringMatcher.CalcMatchRank (fname, out matchRank)) + continue; + int [] match = stringMatcher.GetMatch (fname); + name = GetMatchMarkup (treeView, fname, match, 0); + } else { + name = GLib.Markup.EscapeText (fname); + } + store.InsertWithValues (-1, name, version, null, selected, (string)file, GLib.Markup.EscapeText (file), MonoDevelop.Ide.Gui.Stock.OpenFolder, matchRank, null, ReferenceType.Assembly); + } } } finally { treeView.ThawChildNotify (); @@ -324,7 +324,7 @@ bool IsSelected (ReferenceType type, string name, string pkg) return selection.Contains (type + " " + name + " " + pkg); } - private int Sort (TreeModel model, TreeIter left, TreeIter right) + private int Sort (ITreeModel model, TreeIter left, TreeIter right) { int result = 0; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectFileSelectorDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectFileSelectorDialog.cs index 90cb6deab43..ad5ddff7648 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectFileSelectorDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectFileSelectorDialog.cs @@ -185,7 +185,7 @@ TreeIter InitDir (TreeIter root, Dictionary iters, FilePath dir return value; } - void PixDataFunc (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) + void PixDataFunc (TreeViewColumn tree_column, CellRenderer cell, ITreeModel tree_model, TreeIter iter) { var pixRenderer = (CellRendererImage) cell; string dirname = (string) tree_model.GetValue (iter, 0); @@ -201,7 +201,7 @@ void PixDataFunc (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_ pixRenderer.Image = dirClosedBuf; } - void TxtDataFunc (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) + void TxtDataFunc (TreeViewColumn tree_column, CellRenderer cell, ITreeModel tree_model, TreeIter iter) { CellRendererText txtRenderer = (CellRendererText) cell; string dirname = (string) tree_model.GetValue (iter, 0); @@ -214,7 +214,7 @@ void TxtDataFunc (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_ txtRenderer.Text = lastSlash < 0? dirname : dirname.Substring (lastSlash + 1); } - void TxtFileDataFunc (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) + void TxtFileDataFunc (TreeViewColumn tree_column, CellRenderer cell, ITreeModel tree_model, TreeIter iter) { CellRendererText txtRenderer = (CellRendererText) cell; ProjectFile pf = (ProjectFile)tree_model.GetValue (iter, 0); @@ -265,7 +265,7 @@ void UpdateFileList (object sender, EventArgs args) pattern = pattern.Replace ("\\|","$|^"); pattern = "^" + pattern + "$"; var regex = new Regex (pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase); - + string dir = GetSelectedDirectory ().ToString (); foreach (ProjectFile pf in project.Files) { string pathStr = pf.FilePath.ToString (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectReferencePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectReferencePanel.cs index e1dc9b1feff..eff40139aba 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectReferencePanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectReferencePanel.cs @@ -164,7 +164,7 @@ public void SignalRefChange (ProjectReference pref, bool newstate) } while (store.IterNext (ref looping_iter)); } - int CompareNodes (Gtk.TreeModel model, Gtk.TreeIter a, Gtk.TreeIter b) + int CompareNodes (Gtk.ITreeModel model, Gtk.TreeIter a, Gtk.TreeIter b) { string s1 = (string) store.GetValue (a, 0); string s2 = (string) store.GetValue (b, 0); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs index f297eeec48a..9dac5de9c3c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs @@ -340,7 +340,7 @@ TreeIter FindReference (ReferenceType referenceType, string reference) protected void RemoveReference (object sender, EventArgs e) { TreeIter iter; - TreeModel mdl; + ITreeModel mdl; if (ReferencesTreeView.Selection.GetSelected (out mdl, out iter)) { ProjectReference pref = (ProjectReference)refTreeStore.GetValue (iter, ProjectReferenceColumn); foreach (var p in panels) @@ -537,11 +537,13 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) RepositionFilter (); } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { + min_width = 0; + natural_width = 0; if (Child != null) - requisition = Child.SizeRequest (); - requisition.Width += filterEntry.SizeRequest ().Width; + min_width = Child.SizeRequest ().Width; + min_width += filterEntry.SizeRequest ().Width; } void RepositionFilter () diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/TemplatePickerWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/TemplatePickerWidget.cs index 8661c1239c0..a08d3dbd95a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/TemplatePickerWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/TemplatePickerWidget.cs @@ -523,7 +523,7 @@ public TemplateTreeView () ShowAll (); } - bool FilterFuncWrapper (TreeModel model, TreeIter iter) + bool FilterFuncWrapper (ITreeModel model, TreeIter iter) { if (filterFunc == null) return true; @@ -536,7 +536,7 @@ bool FilterFuncWrapper (TreeModel model, TreeIter iter) return filterFunc (item); } - static void CellDataFuncText (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) + static void CellDataFuncText (TreeViewColumn col, CellRenderer cell, ITreeModel model, TreeIter iter) { var item = (TemplateItem) model.GetValue (iter, 0); string name = GLib.Markup.EscapeText (item.Name); @@ -546,7 +546,7 @@ static void CellDataFuncText (TreeViewColumn col, CellRenderer cell, TreeModel m ((CellRendererText)cell).Markup = name; } - static void CellDataFuncIcon (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) + static void CellDataFuncIcon (TreeViewColumn col, CellRenderer cell, ITreeModel model, TreeIter iter) { var item = (TemplateItem) model.GetValue (iter, 0); var id = item.Template.Icon.IsNull ? "md-project" : item.Template.Icon.ToString (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs index 8b0020f14c2..a9145ea0c6b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs @@ -379,7 +379,7 @@ void OnGenTaskCopied (object o, EventArgs args) TaskListEntry SelectedTask { get { - TreeModel model; + ITreeModel model; TreeIter iter; if (view.Selection.GetSelected (out model, out iter)) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs index 60476127d63..4eb0ffc809e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs @@ -220,7 +220,7 @@ void NewUserTaskClicked (object obj, EventArgs e) void CopyUserTaskClicked (object o, EventArgs args) { TaskListEntry task; - TreeModel model; + ITreeModel model; TreeIter iter; if (view.Selection.GetSelected (out model, out iter)) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs index 813285b378f..04e01ed8a33 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs @@ -28,7 +28,7 @@ using Mono.Addins.Setup; using Gtk; using MonoDevelop.Core.ProgressMonitoring; -using Mono.Addins.Gui; +using Mono.Addins.GuiGtk3; using MonoDevelop.Ide.ProgressMonitoring; using Mono.Addins; using MonoDevelop.Core.Setup; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/DefaultWelcomePage.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/DefaultWelcomePage.cs index e4c5d0712bd..044a9c4f7a7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/DefaultWelcomePage.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/DefaultWelcomePage.cs @@ -51,7 +51,7 @@ protected override void BuildContent (Container parent) new WelcomePageBarButton (GettextCatalog.GetString ("Documentation"), "http://www.go-mono.com/docs", "welcome-link-info-16.png"), new WelcomePageBarButton (GettextCatalog.GetString ("Support"), "http://monodevelop.com/index.php?title=Help_%26_Contact", "welcome-link-support-16.png"), new WelcomePageBarButton (GettextCatalog.GetString ("Q&A"), "http://stackoverflow.com/questions/tagged/monodevelop", "welcome-link-chat-16.png") - ) + ), false, true, 0 ); row1.Accessible.SetShouldIgnore (true); mainCol.PackStart (row1, false, false, 0); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs index 4ff818b7cb7..ef4ffb0f4be 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs @@ -124,7 +124,7 @@ void UpdateStyle (object sender = null, EventArgs e = null) OnUpdateStyle (); if (label != null) { box.Remove (label); - box.PackStart (label = CreateLabel ()); + box.PackStart (label = CreateLabel (), false, true, 0); box.ShowAll (); Update (); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageColumn.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageColumn.cs index c7ae6156120..f67777a1e2d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageColumn.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageColumn.cs @@ -49,11 +49,11 @@ public WelcomePageColumn (params Gtk.Widget[] children): this () public int MinWidth { get; set; } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { - base.OnSizeRequested (ref requisition); + base.OnGetPreferredWidth (out min_width, out natural_width); if (MinWidth != -1) - requisition.Width = Math.Max (requisition.Width, MinWidth); + min_width = Math.Max (min_width, MinWidth); } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs index e55c9eb8964..c2cbf60ea79 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs @@ -280,9 +280,9 @@ protected override void OnDestroyed () Gdk.Size TitleSize { get { if (titleSize == null) { - using (var layout = TitleLayout (PangoContext)) { - int w, h; - layout.GetPixelSize (out w, out h); + using (var layout = TitleLayout (PangoContext)) { + int w, h; + layout.GetPixelSize (out w, out h); titleSize = new Gdk.Size (w, h); } } @@ -294,9 +294,9 @@ Gdk.Size TitleSize { Gdk.Size TextSize { get { if (textSize == null) { - using (var layout = TextLayout (PangoContext)) { - int w, h; - layout.GetPixelSize (out w, out h); + using (var layout = TextLayout (PangoContext)) { + int w, h; + layout.GetPixelSize (out w, out h); textSize = new Gdk.Size (w, h); } } @@ -304,32 +304,32 @@ Gdk.Size TextSize { } } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - using (var context = Gdk.CairoHelper.Create (evnt.Window)) { - context.Translate (Allocation.X, Allocation.Y); - Gdk.Rectangle main = new Gdk.Rectangle (0, 0, Allocation.Width, Allocation.Height); - context.CachedDraw (ref backgroundSurface, main, - opacity: (float)BackgroundOpacity, - draw: (ctx, opacity) => RenderBackground (ctx, main)); - - context.CachedDraw (ref titleSurface, RenderTitlePosition, TitleSize, new { Surface = backgroundSurface }, (float) TitleOpacity, (ctx, alpha) => { - ctx.SetSourceSurface (backgroundSurface.Surface, -TitlePosition.X, -TitlePosition.Y); - ctx.Rectangle (0, 0, TitleSize.Width, TitleSize.Height); - ctx.Fill (); - RenderTitle (ctx, new Gdk.Point (), alpha); - }); - context.CachedDraw (ref textSurface, RenderTextPosition, TextSize, new { Surface = backgroundSurface } , (float) TextOpacity, (ctx, alpha) => { - ctx.SetSourceSurface (backgroundSurface.Surface, -TextPosition.X, -TextPosition.Y); - ctx.Rectangle (0, 0, TextSize.Width, TextSize.Height); - ctx.Fill (); - RenderText (ctx, new Gdk.Point (), alpha); - }); - context.CachedDraw (ref buttonSurface, ButtonPosistion, ButtonSize, new { Hovered = ButtonHovered }, (float)ButtonOpacity, (ctx, alpha) => RenderButton (ctx, new Gdk.Point (), alpha, ButtonHovered)); - RenderPreview (context, RenderIconPosition, IconOpacity); - } - return base.OnExposeEvent (evnt); - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { +// context.Translate (Allocation.X, Allocation.Y); +// Gdk.Rectangle main = new Gdk.Rectangle (0, 0, Allocation.Width, Allocation.Height); +// context.CachedDraw (ref backgroundSurface, main, +// opacity: (float)BackgroundOpacity, +// draw: (ctx, opacity) => RenderBackground (ctx, main)); +// +// context.CachedDraw (ref titleSurface, RenderTitlePosition, TitleSize, new { Surface = backgroundSurface }, (float) TitleOpacity, (ctx, alpha) => { +// ctx.SetSourceSurface (backgroundSurface.Surface, -TitlePosition.X, -TitlePosition.Y); +// ctx.Rectangle (0, 0, TitleSize.Width, TitleSize.Height); +// ctx.Fill (); +// RenderTitle (ctx, new Gdk.Point (), alpha); +// }); +// context.CachedDraw (ref textSurface, RenderTextPosition, TextSize, new { Surface = backgroundSurface } , (float) TextOpacity, (ctx, alpha) => { +// ctx.SetSourceSurface (backgroundSurface.Surface, -TextPosition.X, -TextPosition.Y); +// ctx.Rectangle (0, 0, TextSize.Width, TextSize.Height); +// ctx.Fill (); +// RenderText (ctx, new Gdk.Point (), alpha); +// }); +// context.CachedDraw (ref buttonSurface, ButtonPosistion, ButtonSize, new { Hovered = ButtonHovered }, (float)ButtonOpacity, (ctx, alpha) => RenderButton (ctx, new Gdk.Point (), alpha, ButtonHovered)); +// RenderPreview (context, RenderIconPosition, IconOpacity); +// } +// return base.OnExposeEvent (evnt); +// } protected override bool OnButtonReleaseEvent (Gdk.EventButton evnt) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs index 4d65e2ed65f..0083c9f6ab1 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs @@ -331,61 +331,61 @@ protected virtual void DrawIcon (Cairo.Context ctx) } } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - using (var ctx = Gdk.CairoHelper.Create (evnt.Window)) { - if (mouseOver) - DrawHoverBackground (ctx); - - // Draw the icon - DrawIcon (ctx); - - // Draw the text - - int textWidth = Allocation.Width - LeftTextPadding - InternalPadding * 2; - - using (var titleLayout = new Pango.Layout (PangoContext)) - { - titleLayout.Width = Pango.Units.FromPixels (textWidth); - titleLayout.Ellipsize = Pango.EllipsizeMode.End; - titleLayout.SetMarkup (WelcomePageSection.FormatText (TitleFontFace, TitleFontSize, Pango.Weight.Bold, MediumTitleColor, title)); - - Pango.Layout subtitleLayout = null; - - if (!string.IsNullOrEmpty (subtitle)) - { - subtitleLayout = new Pango.Layout (PangoContext); - subtitleLayout.Width = Pango.Units.FromPixels (textWidth); - subtitleLayout.Ellipsize = Pango.EllipsizeMode.Start; - subtitleLayout.SetMarkup (WelcomePageSection.FormatText (SmallTitleFontFace, SmallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, subtitle)); - } - - int height = 0; - int w, h1, h2; - titleLayout.GetPixelSize (out w, out h1); - height += h1; - - if (subtitleLayout != null) - { - height += Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TitleBottomMargin; - subtitleLayout.GetPixelSize (out w, out h2); - height += h2; - } - - int tx = Allocation.X + InternalPadding + LeftTextPadding; - int ty = Allocation.Y + (Allocation.Height - height) / 2; - DrawLayout (ctx, titleLayout, TitleFontFace, TitleFontSize, Pango.Weight.Bold, MediumTitleColor, tx, ty); - - if (subtitleLayout != null) - { - ty += h1 + Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TitleBottomMargin; - DrawLayout (ctx, subtitleLayout, SmallTitleFontFace, SmallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, tx, ty); - subtitleLayout.Dispose (); - } - } - } - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// using (var ctx = Gdk.CairoHelper.Create (evnt.Window)) { +// if (mouseOver) +// DrawHoverBackground (ctx); +// +// // Draw the icon +// DrawIcon (ctx); +// +// // Draw the text +// +// int textWidth = Allocation.Width - LeftTextPadding - InternalPadding * 2; +// +// using (var titleLayout = new Pango.Layout (PangoContext)) +// { +// titleLayout.Width = Pango.Units.FromPixels (textWidth); +// titleLayout.Ellipsize = Pango.EllipsizeMode.End; +// titleLayout.SetMarkup (WelcomePageSection.FormatText (TitleFontFace, TitleFontSize, Pango.Weight.Bold, MediumTitleColor, title)); +// +// Pango.Layout subtitleLayout = null; +// +// if (!string.IsNullOrEmpty (subtitle)) +// { +// subtitleLayout = new Pango.Layout (PangoContext); +// subtitleLayout.Width = Pango.Units.FromPixels (textWidth); +// subtitleLayout.Ellipsize = Pango.EllipsizeMode.Start; +// subtitleLayout.SetMarkup (WelcomePageSection.FormatText (SmallTitleFontFace, SmallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, subtitle)); +// } +// +// int height = 0; +// int w, h1, h2; +// titleLayout.GetPixelSize (out w, out h1); +// height += h1; +// +// if (subtitleLayout != null) +// { +// height += Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TitleBottomMargin; +// subtitleLayout.GetPixelSize (out w, out h2); +// height += h2; +// } +// +// int tx = Allocation.X + InternalPadding + LeftTextPadding; +// int ty = Allocation.Y + (Allocation.Height - height) / 2; +// DrawLayout (ctx, titleLayout, TitleFontFace, TitleFontSize, Pango.Weight.Bold, MediumTitleColor, tx, ty); +// +// if (subtitleLayout != null) +// { +// ty += h1 + Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TitleBottomMargin; +// DrawLayout (ctx, subtitleLayout, SmallTitleFontFace, SmallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, tx, ty); +// subtitleLayout.Dispose (); +// } +// } +// } +// return true; +// } protected override void OnDestroyed () { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageRow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageRow.cs index bd286473511..9c477822134 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageRow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageRow.cs @@ -44,11 +44,11 @@ public WelcomePageRow (params Gtk.Widget[] children): this () public int MinHeight { get; set; } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - base.OnSizeRequested (ref requisition); + base.OnGetPreferredHeight (out min_height, out natural_height); if (MinHeight != -1) - requisition.Height = Math.Max (requisition.Height, MinHeight); + min_height = Math.Max (min_height, MinHeight); } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs index 262721a191a..d4352690223 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs @@ -110,39 +110,39 @@ public void SetContent (Gtk.Widget w) root.Add (box); } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - using (var ctx = Gdk.CairoHelper.Create (evnt.Window)) { - ctx.LineWidth = 1; - var rect = new Gdk.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); - - var shadowColor = CairoExtensions.ParseColor (Styles.WelcomeScreen.Pad.ShadowColor); - int inset = 2; - var ss = Styles.WelcomeScreen.Pad.ShadowSize; - var r = new Cairo.Rectangle (rect.X + ss + 0.5, rect.Y + ss + 0.5, rect.Width - ss * 2 - 1, rect.Height - ss * 2 - 1); - var sr = new Cairo.Rectangle (r.X + inset, r.Y + inset + Styles.WelcomeScreen.Pad.ShadowVerticalOffset, r.Width - inset * 2, r.Height - inset * 2); - int size = Styles.WelcomeScreen.Pad.ShadowSize; - double alpha = 0.2; - double alphaDec = 0.2 / (double)size; - for (int n=0; n 0) { - using (var context = Gdk.CairoHelper.Create (evnt.Window)) { - DrawOverdraw (context, OverdrawOpacity); - } - } - - return true; - } +// protected override bool OnExposeEvent (EventExpose evnt) +// { +// using (var context = CairoHelper.Create (evnt.Window)) { +// context.SetSourceRGB (backgroundColor.Red, backgroundColor.Green, backgroundColor.Blue); +// context.Operator = Cairo.Operator.Source; +// context.Paint (); +// context.Operator = Cairo.Operator.Over; +// DrawBackground (context, evnt.Area); +// +// if (Owner.LogoImage != null) { +// var lRect = new Rectangle (Allocation.X, Allocation.Y, (int)Owner.LogoImage.Width, (int)Owner.LogoImage.Height); +// if (evnt.Region.RectIn (lRect) != OverlapType.Out) +// context.DrawImage (this, Owner.LogoImage, Allocation.X, Allocation.Y); +// +// var bgRect = new Rectangle (Allocation.X + (int)Owner.LogoImage.Width, Allocation.Y, Allocation.Width - (int)Owner.LogoImage.Width, (int)Owner.TopBorderImage.Height); +// if (evnt.Region.RectIn (bgRect) != OverlapType.Out) +// for (int x = bgRect.X; x < bgRect.Right; x += (int)Owner.TopBorderImage.Width) +// context.DrawImage (this, Owner.TopBorderImage.WithSize (Owner.TopBorderImage.Width, bgRect.Height), x, Allocation.Y); +// } +// } +// +// foreach (Widget widget in Children) +// PropagateExpose (widget, evnt); +// +// if (OverdrawOpacity > 0) { +// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { +// DrawOverdraw (context, OverdrawOpacity); +// } +// } +// +// return true; +// } protected override void OnDestroyed () { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj index fabfbc1d25a..46723f7a15d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj @@ -21,11 +21,21 @@ - - - - - + + gtk-sharp-3.0 + + + gdk-sharp-3.0 + + + glib-sharp-3.0 + + + gtk-sharp-3.0 + + + gtk-sharp-3.0 + ..\..\..\packages\JetBrains.SharpZipLib.Stripped.0.87.20170615.10\lib\net40\ICSharpCode.SharpZipLib.dll @@ -57,7 +67,6 @@ ..\..\..\packages\Microsoft.VisualStudio.Validation.15.3.32\lib\net45\Microsoft.VisualStudio.Validation.dll True - @@ -139,6 +148,12 @@ ..\..\..\build\bin\Microsoft.VisualStudio.CodingConventions.dll False + + gio-sharp-3.0 + + + gtk-sharp-3.0 + @@ -177,9 +192,13 @@ Mono.Addins.Setup False - + + + {410A7DC9-E7DA-43E6-B592-93E2A344B660} + Mono.Addins.GuiGtk3 {90C99ADB-7D4B-4EB4-98C2-40BD1B14C7D2} diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs index d93adc5ac5f..bd8fe09906d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs @@ -33,7 +33,7 @@ using MonoDevelop.Core; using MonoDevelop.Core.Instrumentation; using Mono.Addins; -using Mono.Addins.Gui; +using Mono.Addins.GuiGtk3; using Mono.Addins.Setup; using MonoDevelop.Components.Commands; @@ -78,14 +78,14 @@ public static class IdeApp static EventHandler initializedEvent; public static event EventHandler Initialized { add { - Runtime.RunInMainThread (() => { - if (isInitialized) value (null, EventArgs.Empty); + Runtime.RunInMainThread (() => { + if (isInitialized) value (null, EventArgs.Empty); else initializedEvent += value; }); } - remove { - Runtime.RunInMainThread (() => { - initializedEvent -= value; + remove { + Runtime.RunInMainThread (() => { + initializedEvent -= value; }); } } @@ -339,8 +339,8 @@ public static void Initialize (ProgressMonitor monitor) }; AutoTestService.Start (commandService, Preferences.EnableAutomatedTesting); AutoTestService.NotifyEvent ("MonoDevelop.Ide.IdeStart"); - - Gtk.LinkButton.SetUriHook ((button, uri) => Xwt.Desktop.OpenUrl (uri)); + +// Gtk.LinkButton.SetUriHook ((button, uri) => Xwt.Desktop.OpenUrl (uri)); } static void KeyBindingFailed (object sender, KeyBindingFailedEventArgs e) @@ -406,9 +406,9 @@ internal static async void OpenFiles (IEnumerable files, Op } } else if (file.FileName.HasExtension ("mpack")) { var service = new SetupService (AddinManager.Registry); - AddinManagerWindow.RunToInstallFile (Workbench.RootWindow, - service, - file.FileName.FullPath); +// AddinManagerWindow.RunToInstallFile (Workbench.RootWindow, +// service, +// file.FileName.FullPath); } else { filteredFiles.Add (file); } From 6297e23bb508db28e41df042a255aef1d95a389d Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 26 Jul 2018 15:16:41 -0400 Subject: [PATCH 007/382] Made it show an error popup! --- .../MonoDevelop.Components/IdeTheme.cs | 4 +-- .../MonoDevelop.Components/ImageView.cs | 4 +-- .../MonoDevelop.Components/PangoUtil.cs | 6 ++-- .../MonoDevelop.Ide.Gui/Styles.cs | 32 +++++++++---------- .../MonoDevelop.Ide/IdeStartup.cs | 6 ++-- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs index 18161bd058f..63bd66abec3 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs @@ -61,8 +61,8 @@ static IdeTheme () internal static void InitializeGtk (string progname, ref string[] args) { - if (Gtk.Settings.Default != null) - throw new InvalidOperationException ("Gtk already initialized!"); + // if (Gtk.Settings.Default != null) + // throw new InvalidOperationException ("Gtk already initialized!"); //HACK: we must initilize some Gtk rc before Gtk.Application is initialized on Mac/Windows // otherwise it will not be loaded correctly and theme switching won't work. diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs index 386523db885..7405f04a336 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs @@ -95,19 +95,19 @@ public string IconId { protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { min_height = Ypad * 2; - natural_height = 0; if (image != null) { min_height += (int)(image.Height); } + natural_height = min_height; } protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { min_width = Xpad * 2; - natural_width = 0; if (image != null) { min_width += (int)(image.Width); } + natural_width = min_width; } bool IsParentDisabled () diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs index 1fbaac2946a..b8080570ac3 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs @@ -32,15 +32,15 @@ namespace MonoDevelop.Components { public static class PangoUtil { - internal const string LIBGTK = "libgtk-win32-2.0-0.dll"; + internal const string LIBGTK = "libgtk-3-0.dll"; internal const string LIBATK = "libatk-1.0-0.dll"; internal const string LIBGLIB = "libglib-2.0-0.dll"; - internal const string LIBGDK = "libgdk-win32-2.0-0.dll"; + internal const string LIBGDK = "libgdk-3-0.dll"; internal const string LIBGOBJECT = "libgobject-2.0-0.dll"; internal const string LIBPANGO = "libpango-1.0-0.dll"; internal const string LIBPANGOCAIRO = "libpangocairo-1.0-0.dll"; internal const string LIBQUARTZ = "libgtk-quartz-2.0.dylib"; - internal const string LIBGTKGLUE = "gtksharpglue-2"; + internal const string LIBGTKGLUE = "libgtksharpglue-3.so"; /// /// This doesn't leak Pango layouts, unlike some other ways to create them in GTK# <= 2.12.11 diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs index f68074f3d2c..0d494f2f590 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs @@ -334,33 +334,33 @@ static Styles () TooltipInfoSpacing = 0; else TooltipInfoSpacing = -4; - LoadStyle (); +// LoadStyle (); } internal static void LoadStyle () { - Gtk.Style defaultStyle; + Gtk.StyleContext defaultStyle; Gtk.Widget styledWidget; - if (IdeApp.Workbench == null || IdeApp.Workbench.RootWindow == null) { +// if (IdeApp.Workbench == null || IdeApp.Workbench.RootWindow == null) { styledWidget = new Gtk.Label (String.Empty); - defaultStyle = styledWidget.Style; - } else { - styledWidget = IdeApp.Workbench.RootWindow; - defaultStyle = Gtk.Rc.GetStyle (styledWidget); - } - - BackgroundColor = defaultStyle.Background (Gtk.StateType.Normal).ToXwtColor (); // must be the bg color from Gtkrc - BaseBackgroundColor = defaultStyle.Base (Gtk.StateType.Normal).ToXwtColor (); // must be the base color from Gtkrc - BaseForegroundColor = defaultStyle.Foreground (Gtk.StateType.Normal).ToXwtColor (); // must be the text color from Gtkrc - BaseSelectionBackgroundColor = defaultStyle.Base (Gtk.StateType.Selected).ToXwtColor (); - BaseSelectionTextColor = defaultStyle.Text (Gtk.StateType.Selected).ToXwtColor (); + defaultStyle = styledWidget.StyleContext; +// } else { +// styledWidget = IdeApp.Workbench.RootWindow; +// defaultStyle = Gtk.Rc.GetStyle (styledWidget); +// } + +// BackgroundColor = defaultStyle.Background.ToXwtColor (); // must be the bg color from Gtkrc +// BaseBackgroundColor = defaultStyle.Base (Gtk.StateType.Normal).ToXwtColor (); // must be the base color from Gtkrc +// BaseForegroundColor = defaultStyle.Foreground (Gtk.StateType.Normal).ToXwtColor (); // must be the text color from Gtkrc +// BaseSelectionBackgroundColor = defaultStyle.Base (Gtk.StateType.Selected).ToXwtColor (); +// BaseSelectionTextColor = defaultStyle.Text (Gtk.StateType.Selected).ToXwtColor (); LinkForegroundColor = ((Gdk.Color)styledWidget.StyleGetProperty ("link-color")).ToXwtColor (); if (LinkForegroundColor == Colors.Black) // the style returs black when not initialized LinkForegroundColor = Colors.Blue; // set the link color to generic blue until initialization is finished - DefaultFont = defaultStyle.FontDescription.Copy (); - DefaultFontName = DefaultFont.ToString (); +// DefaultFont = defaultStyle.FontDescription.Copy (); +// DefaultFontName = DefaultFont.ToString (); if (IdeApp.Preferences == null || IdeApp.Preferences.UserInterfaceTheme == Theme.Light) LoadLightStyle (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs index 0b66b61642d..6500baa7fe2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs @@ -114,7 +114,7 @@ int Run (MonoDevelopOptions options) SetupExceptionManager (); // explicit GLib type system initialization for GLib < 2.36 before any other type system access - GLib.GType.Init (); + //GLib.GType.Init (); IdeApp.Customizer = options.IdeCustomizer ?? new IdeCustomizer (); try { @@ -137,8 +137,8 @@ int Run (MonoDevelopOptions options) // XWT initialization FilePath p = typeof(IdeStartup).Assembly.Location; - Runtime.LoadAssemblyFrom (p.ParentDirectory.Combine("Xwt.Gtk.dll")); - Xwt.Application.InitializeAsGuest (Xwt.ToolkitType.Gtk); + Runtime.LoadAssemblyFrom (p.ParentDirectory.Combine("Xwt.Gtk3.dll")); + Xwt.Application.InitializeAsGuest (Xwt.ToolkitType.Gtk3); Xwt.Toolkit.CurrentEngine.RegisterBackend (); Xwt.Toolkit.CurrentEngine.RegisterBackend (); IdeTheme.SetupXwtTheme (); From b16963a529e80a9d2a37add875117894dd147772 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 26 Jul 2018 16:09:37 -0400 Subject: [PATCH 008/382] More build fixes --- .../ExceptionCaughtDialog.cs | 2 +- .../MonoDevelop.Debugger/ObjectValueTreeView.cs | 2 +- .../MonoDevelop.Debugger/StackTracePad.cs | 10 +++++----- .../MonoDevelop.Debugger/TreePathReference.cs | 4 ++-- ...p.WebReferences.Dialogs.UserPasswordDialog.cs | 4 ++-- ...elop.WebReferences.Dialogs.WCFConfigWidget.cs | 16 ++++++++-------- ...p.WebReferences.Dialogs.WebReferenceDialog.cs | 8 ++++---- .../WCFConfigWidget.cs | 4 ++-- .../MonoDevelop.WebReferences.csproj | 1 + main/tests/IdeUnitTests/IdeUnitTests.csproj | 2 ++ 10 files changed, 28 insertions(+), 25 deletions(-) diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs index 39b7352f9c5..e40831c09fc 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs @@ -244,7 +244,7 @@ void Expander_Activated (object sender, EventArgs e) paned.Position = paned.MinPosition; } - static void StackFrameLayout (CellLayout layout, CellRenderer cr, TreeModel model, TreeIter iter) + static void StackFrameLayout (CellLayout layout, CellRenderer cr, ITreeModel model, TreeIter iter) { var frame = (ExceptionStackFrame)model.GetValue (iter, (int)ModelColumn.StackFrame); var renderer = (StackFrameCellRenderer)cr; diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs index 89db6240e61..16cbdeaafad 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs @@ -419,7 +419,7 @@ public ObjectValueTreeView () focus_line_width = (int)this.StyleGetProperty ("focus-line-width") * 2;//we just use *2 version in GetMaxWidth } - static void ValueDataFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + static void ValueDataFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { var val = (ObjectValue)model.GetValue (iter, ObjectColumn); Xwt.Drawing.Color? color; diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs index f2f694f3db9..a79253759f0 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs @@ -179,17 +179,17 @@ void LoadColumnsVisibility () void StoreColumnsVisibility () { PropertyService.Set ("Monodevelop.StackTrace.ColumnsVisibility", string.Join (";", tree.Columns.Select (c => c.Visible ? "TRUE" : "FALSE"))); - } + } void OnDebuggingServiceStopped (object sender, EventArgs e) { TreeIter iter; - + if (store != null && store.GetIterFirst (out iter) && (store.GetValue (iter, FrameColumn) as StackFrame)?.DebuggerSession == sender) - store.Clear (); + store.Clear (); } - static bool Search (TreeModel model, int column, string key, TreeIter iter) + static bool Search (ITreeModel model, int column, string key, TreeIter iter) { string value = (string)model.GetValue (iter, column); @@ -485,7 +485,7 @@ internal void OnSelectAll () internal void OnCopy () { var txt = new StringBuilder (); - TreeModel model; + ITreeModel model; TreeIter iter; foreach (TreePath path in tree.Selection.GetSelectedRows (out model)) { diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/TreePathReference.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/TreePathReference.cs index e35b3b8d4d4..9e6dcabc917 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/TreePathReference.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/TreePathReference.cs @@ -34,7 +34,7 @@ public sealed class TreePathReference : IDisposable int[] indices; TreePath path; - public TreePathReference (TreeModel model, TreePath path) + public TreePathReference (ITreeModel model, TreePath path) { model.RowsReordered += HandleRowsReordered; model.RowInserted += HandleRowInserted; @@ -122,7 +122,7 @@ void HandleRowDeleted (object o, RowDeletedArgs args) } } - public TreeModel Model { + public ITreeModel Model { get; private set; } diff --git a/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.UserPasswordDialog.cs b/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.UserPasswordDialog.cs index 64a41202be0..c5d0ea60809 100644 --- a/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.UserPasswordDialog.cs +++ b/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.UserPasswordDialog.cs @@ -22,7 +22,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Credentials"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.WebReferences.Dialogs.UserPasswordDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -101,7 +101,7 @@ protected virtual void Build () w8.Expand = false; w8.Fill = false; // Internal child MonoDevelop.WebReferences.Dialogs.UserPasswordDialog.ActionArea - global::Gtk.HButtonBox w9 = this.ActionArea; + global::Gtk.HButtonBox w9 = (Gtk.HButtonBox)this.ActionArea; w9.Name = "dialog1_ActionArea"; w9.Spacing = 10; w9.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.WCFConfigWidget.cs b/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.WCFConfigWidget.cs index 86913f1a6cc..1de2abdfdb7 100644 --- a/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.WCFConfigWidget.cs +++ b/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.WCFConfigWidget.cs @@ -8,7 +8,7 @@ public partial class WCFConfigWidget private global::Gtk.Table wcfOptions; - private global::Gtk.ComboBox dictionaryCollection; + private global::Gtk.ComboBoxText dictionaryCollection; private global::Gtk.Label label1; @@ -18,11 +18,11 @@ public partial class WCFConfigWidget private global::Gtk.Label label4; - private global::Gtk.ComboBox listAccess; + private global::Gtk.ComboBoxText listAccess; - private global::Gtk.ComboBox listAsync; + private global::Gtk.ComboBoxText listAsync; - private global::Gtk.ComboBox listCollection; + private global::Gtk.ComboBoxText listCollection; protected virtual void Build () { @@ -40,7 +40,7 @@ protected virtual void Build () this.wcfOptions.RowSpacing = ((uint)(6)); this.wcfOptions.ColumnSpacing = ((uint)(6)); // Container child wcfOptions.Gtk.Table+TableChild - this.dictionaryCollection = global::Gtk.ComboBox.NewText (); + this.dictionaryCollection = new global::Gtk.ComboBoxText (); this.dictionaryCollection.Name = "dictionaryCollection"; this.wcfOptions.Add (this.dictionaryCollection); global::Gtk.Table.TableChild w1 = ((global::Gtk.Table.TableChild)(this.wcfOptions [this.dictionaryCollection])); @@ -93,7 +93,7 @@ protected virtual void Build () w5.XOptions = ((global::Gtk.AttachOptions)(4)); w5.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child wcfOptions.Gtk.Table+TableChild - this.listAccess = global::Gtk.ComboBox.NewText (); + this.listAccess = new global::Gtk.ComboBoxText (); this.listAccess.AppendText (global::Mono.Unix.Catalog.GetString ("Public")); this.listAccess.AppendText (global::Mono.Unix.Catalog.GetString ("Internal")); this.listAccess.Name = "listAccess"; @@ -107,7 +107,7 @@ protected virtual void Build () w6.XOptions = ((global::Gtk.AttachOptions)(7)); w6.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child wcfOptions.Gtk.Table+TableChild - this.listAsync = global::Gtk.ComboBox.NewText (); + this.listAsync = new global::Gtk.ComboBoxText (); this.listAsync.AppendText (global::Mono.Unix.Catalog.GetString ("No")); this.listAsync.AppendText (global::Mono.Unix.Catalog.GetString ("Async")); this.listAsync.Name = "listAsync"; @@ -121,7 +121,7 @@ protected virtual void Build () w7.XOptions = ((global::Gtk.AttachOptions)(4)); w7.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child wcfOptions.Gtk.Table+TableChild - this.listCollection = global::Gtk.ComboBox.NewText (); + this.listCollection = new global::Gtk.ComboBoxText (); this.listCollection.Name = "listCollection"; this.wcfOptions.Add (this.listCollection); global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.wcfOptions [this.listCollection])); diff --git a/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs b/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs index a1d6fde953c..bb094aaaf85 100644 --- a/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs +++ b/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs @@ -34,7 +34,7 @@ internal partial class WebReferenceDialog private global::Gtk.HBox hbox1; - private global::Gtk.ComboBox comboModel; + private global::Gtk.ComboBoxText comboModel; private global::Gtk.Label label1; @@ -77,7 +77,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Add Web Reference"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.VBox - global::Gtk.VBox w2 = this.VBox; + global::Gtk.VBox w2 = (Gtk.VBox)this.ContentArea; w2.Events = ((global::Gdk.EventMask)(256)); w2.Name = "dlgWindow"; w2.BorderWidth = ((uint)(2)); @@ -162,7 +162,7 @@ protected virtual void Build () this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild - this.comboModel = global::Gtk.ComboBox.NewText (); + this.comboModel = new global::Gtk.ComboBoxText (); this.comboModel.AppendText (global::Mono.Unix.Catalog.GetString ("Windows Communication Foundation (WCF)")); this.comboModel.AppendText (global::Mono.Unix.Catalog.GetString (".NET 2.0 Web Services")); this.comboModel.Name = "comboModel"; @@ -244,7 +244,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(w2 [this.vbxContainer])); w17.Position = 0; // Internal child MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.ActionArea - global::Gtk.HButtonBox w18 = this.ActionArea; + global::Gtk.HButtonBox w18 = (Gtk.HButtonBox)this.ActionArea; w18.Events = ((global::Gdk.EventMask)(256)); w18.Name = "pnlActionArea"; w18.Spacing = 6; diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Dialogs/WCFConfigWidget.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Dialogs/WCFConfigWidget.cs index cfbea294124..a4e1e0bc478 100644 --- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Dialogs/WCFConfigWidget.cs +++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Dialogs/WCFConfigWidget.cs @@ -148,7 +148,7 @@ internal static string GetTypeName (Type type) return pos < 0 ? name : name.Substring (0, pos); } - void PopulateBox (ComboBox box, string category, List types) + void PopulateBox (ComboBoxText box, string category, List types) { var mapping = Options.CollectionMappings.FirstOrDefault (m => m.Category == category); @@ -167,7 +167,7 @@ void PopulateBox (ComboBox box, string category, List types) box.Active = types.IndexOf (current); } - void UpdateBox (ComboBox box, string category, IList types) + void UpdateBox (ComboBoxText box, string category, IList types) { var mapping = Options.CollectionMappings.FirstOrDefault (m => m.Category == category); if (mapping == null) { diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj index 0c8c37d86d6..0882b96bb80 100644 --- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj +++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj @@ -20,6 +20,7 @@ + diff --git a/main/tests/IdeUnitTests/IdeUnitTests.csproj b/main/tests/IdeUnitTests/IdeUnitTests.csproj index e910798fce5..b0fdf13ce67 100644 --- a/main/tests/IdeUnitTests/IdeUnitTests.csproj +++ b/main/tests/IdeUnitTests/IdeUnitTests.csproj @@ -12,6 +12,8 @@ + + ..\..\packages\Microsoft.VisualStudio.Composition.15.6.36\lib\net45\Microsoft.VisualStudio.Composition.dll From d30cfabb00ce1c5a6e78ace3c6c73a7c0ebb3dd2 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 27 Jul 2018 12:17:26 -0400 Subject: [PATCH 009/382] More build fixes --- ...p.Deployment.Linux.DotDesktopViewWidget.cs | 10 +- ...oyment.Linux.MenuCategorySelectorDialog.cs | 4 +- .../BasicOptionPanelWidget.cs | 4 +- .../MenuCategorySelectorDialog.cs | 2 +- ...Develop.Deployment.DeployFileListWidget.cs | 4 +- ...onoDevelop.Deployment.FileReplaceDialog.cs | 8 +- ....Deployment.Gui.BinariesZipEditorWidget.cs | 12 +- ...MonoDevelop.Deployment.Gui.DeployDialog.cs | 14 +- ...evelop.Deployment.Gui.EditPackageDialog.cs | 4 +- ...yment.Gui.FileCopyConfigurationSelector.cs | 4 +- ...onoDevelop.Deployment.Gui.InstallDialog.cs | 4 +- ...p.Deployment.Gui.SourcesZipEditorWidget.cs | 8 +- .../DeployDialog.cs | 2 +- .../DeployDirectoryInfoEditor.cs | 4 +- .../PackageBuilderEditor.cs | 2 +- ...velop.Autotools.GenerateMakefilesDialog.cs | 12 +- ...lop.Autotools.MakefileOptionPanelWidget.cs | 40 +-- ...oDevelop.Autotools.MakefileSwitchEditor.cs | 4 +- ...op.Autotools.TarballBuilderEditorWidget.cs | 8 +- .../ImportMakefileDialog.cs | 2 +- .../MakefileOptionPanelWidget.cs | 4 +- .../ExceptionCaughtDialog.cs | 94 ++--- .../ObjectValueTreeView.cs | 176 +++++----- .../MonoDevelop.Debugger/ThreadsPad.cs | 16 +- .../ToolboxWidget.cs | 320 +++++++++--------- .../MonoDevelop.DesignerSupport.csproj | 23 +- .../DocumentOutlinePad.cs | 2 +- .../RemoteDesignerProcess.cs | 6 +- ...Support.Toolbox.ComponentSelectorDialog.cs | 140 ++++---- .../gtk-gui/gui.stetic | 4 +- ...lop.Gettext.Editor.CatalogHeadersWidget.cs | 4 +- ...Gettext.TranslationProjectOptionsDialog.cs | 6 +- ...ettext.Translator.LanguageChooserDialog.cs | 8 +- .../POEditorWidget.cs | 16 +- .../MonoDevelop.Gettext.csproj | 23 +- .../MonoDevelop.RegexToolkit.csproj | 23 +- .../ElementHelpWidget.cs | 2 +- 37 files changed, 528 insertions(+), 491 deletions(-) diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/Gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/Gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs index 120b92e40ad..198fe7ff466 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/Gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/Gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs @@ -9,11 +9,11 @@ public partial class DotDesktopViewWidget private global::Gtk.VBox vbox4; private global::Gtk.HBox hbox2; private global::Gtk.Label label9; - private global::Gtk.ComboBox comboType; + private global::Gtk.ComboBoxText comboType; private global::Gtk.HSeparator hseparator4; private global::Gtk.HBox hbox3; private global::Gtk.Label label1; - private global::Gtk.ComboBox comboLocales; + private global::Gtk.ComboBoxText comboLocales; private global::Gtk.Button buttonNewLocale; private global::Gtk.Table table6; private global::Gtk.Entry entryComment; @@ -115,7 +115,7 @@ protected virtual void Build () w2.Expand = false; w2.Fill = false; // Container child hbox2.Gtk.Box+BoxChild - this.comboType = global::Gtk.ComboBox.NewText (); + this.comboType = new global::Gtk.ComboBoxText (); this.comboType.AppendText (global::Mono.Unix.Catalog.GetString ("Application")); this.comboType.AppendText (global::Mono.Unix.Catalog.GetString ("Link")); this.comboType.AppendText (global::Mono.Unix.Catalog.GetString ("Directory")); @@ -154,7 +154,7 @@ protected virtual void Build () w6.Expand = false; w6.Fill = false; // Container child hbox3.Gtk.Box+BoxChild - this.comboLocales = global::Gtk.ComboBox.NewText (); + this.comboLocales = new global::Gtk.ComboBoxText (); this.comboLocales.Name = "comboLocales"; this.hbox3.Add (this.comboLocales); global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.comboLocales])); @@ -538,7 +538,7 @@ protected virtual void Build () this.radioAlwaysShow.Name = "radioAlwaysShow"; this.radioAlwaysShow.Active = true; this.radioAlwaysShow.DrawIndicator = true; - this.radioAlwaysShow.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.radioAlwaysShow.Group = new Gtk.RadioButton [0]; this.boxMenu.Add (this.radioAlwaysShow); global::Gtk.Box.BoxChild w46 = ((global::Gtk.Box.BoxChild)(this.boxMenu [this.radioAlwaysShow])); w46.Position = 4; diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/Gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/Gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs index 015d510670b..9c2609cb98d 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/Gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/Gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs @@ -20,7 +20,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Menu Category Selection"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -55,7 +55,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5])); w5.Position = 0; // Internal child MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.ActionArea - global::Gtk.HButtonBox w6 = this.ActionArea; + global::Gtk.HButtonBox w6 = (Gtk.HButtonBox)this.ActionArea; w6.Name = "dialog1_ActionArea"; w6.Spacing = 10; w6.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanelWidget.cs b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanelWidget.cs index c1464cdb01d..8a8c7917eb8 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanelWidget.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanelWidget.cs @@ -15,8 +15,8 @@ public partial class BasicOptionPanelWidget : Gtk.Bin public BasicOptionPanelWidget (Project entry, bool creatingProject) { this.Build(); - - WidgetFlags |= Gtk.WidgetFlags.NoShowAll; + + this.NoShowAll = true; this.entry = entry; if (entry is DotNetProject) { diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/MenuCategorySelectorDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/MenuCategorySelectorDialog.cs index 2b1e5435c02..093e3aaed35 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/MenuCategorySelectorDialog.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/MenuCategorySelectorDialog.cs @@ -57,7 +57,7 @@ public ArrayList Selection { get { return selection; } } - private int CompareNodes (TreeModel model, TreeIter iter1, TreeIter iter2) + private int CompareNodes (ITreeModel model, TreeIter iter1, TreeIter iter2) { if ((string) store.GetValue (iter1, 0) == "__other") return 1; diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.DeployFileListWidget.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.DeployFileListWidget.cs index 1bd1c7505fb..8f884d6643d 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.DeployFileListWidget.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.DeployFileListWidget.cs @@ -7,7 +7,7 @@ internal partial class DeployFileListWidget private global::Gtk.VBox vbox2; private global::Gtk.HBox hbox1; private global::Gtk.Label labelFiles; - private global::Gtk.ComboBox comboConfigs; + private global::Gtk.ComboBoxText comboConfigs; private global::Gtk.ScrolledWindow scrolledwindow1; private global::Gtk.TreeView fileList; private global::Gtk.HBox hbox2; @@ -37,7 +37,7 @@ protected virtual void Build () w1.Expand = false; w1.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.comboConfigs = global::Gtk.ComboBox.NewText (); + this.comboConfigs = new global::Gtk.ComboBoxText (); this.comboConfigs.Name = "comboConfigs"; this.hbox1.Add (this.comboConfigs); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.comboConfigs])); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.FileReplaceDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.FileReplaceDialog.cs index d03d1fcd67b..aeecc2b19f8 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.FileReplaceDialog.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.FileReplaceDialog.cs @@ -90,9 +90,9 @@ protected virtual void Build () this.Modal = true; this.BorderWidth = ((uint)(6)); this.Resizable = false; - this.AllowGrow = false; +// this.AllowGrow = false; // Internal child MonoDevelop.Deployment.FileReplaceDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.Spacing = 4; w1.BorderWidth = ((uint)(2)); @@ -175,7 +175,7 @@ protected virtual void Build () this.radioReplace.Name = "radioReplace"; this.radioReplace.DrawIndicator = true; this.radioReplace.UseUnderline = true; - this.radioReplace.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.radioReplace.Group = new Gtk.RadioButton [0]; this.radioReplace.Remove (this.radioReplace.Child); // Container child radioReplace.Gtk.Container+ContainerChild this.vbox5 = new global::Gtk.VBox (); @@ -418,7 +418,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w37 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox2])); w37.Position = 2; // Internal child MonoDevelop.Deployment.FileReplaceDialog.ActionArea - global::Gtk.HButtonBox w38 = this.ActionArea; + global::Gtk.HButtonBox w38 = (Gtk.HButtonBox)this.ActionArea; w38.Name = "dialog1_ActionArea"; w38.Spacing = 6; w38.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.BinariesZipEditorWidget.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.BinariesZipEditorWidget.cs index 54c24348827..00863935033 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.BinariesZipEditorWidget.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.BinariesZipEditorWidget.cs @@ -7,12 +7,12 @@ internal partial class BinariesZipEditorWidget private global::Gtk.VBox vbox2; private global::Gtk.Label label4; private global::Gtk.Table table1; - private global::Gtk.ComboBox comboConfiguration; - private global::Gtk.ComboBox comboPlatform; + private global::Gtk.ComboBoxText comboConfiguration; + private global::Gtk.ComboBoxText comboPlatform; private global::MonoDevelop.Components.FolderEntry folderEntry; private global::Gtk.HBox hbox1; private global::Gtk.Entry entryZip; - private global::Gtk.ComboBox comboZip; + private global::Gtk.ComboBoxText comboZip; private global::Gtk.Label label1; private global::Gtk.Label label2; private global::Gtk.Label label3; @@ -45,7 +45,7 @@ protected virtual void Build () this.table1.RowSpacing = ((uint)(6)); this.table1.ColumnSpacing = ((uint)(6)); // Container child table1.Gtk.Table+TableChild - this.comboConfiguration = global::Gtk.ComboBox.NewText (); + this.comboConfiguration = new global::Gtk.ComboBoxText (); this.comboConfiguration.Name = "comboConfiguration"; this.table1.Add (this.comboConfiguration); global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.comboConfiguration])); @@ -54,7 +54,7 @@ protected virtual void Build () w2.XOptions = ((global::Gtk.AttachOptions)(4)); w2.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.comboPlatform = global::Gtk.ComboBox.NewText (); + this.comboPlatform = new global::Gtk.ComboBoxText (); this.comboPlatform.Name = "comboPlatform"; this.table1.Add (this.comboPlatform); global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.comboPlatform])); @@ -88,7 +88,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.entryZip])); w5.Position = 0; // Container child hbox1.Gtk.Box+BoxChild - this.comboZip = global::Gtk.ComboBox.NewText (); + this.comboZip = new global::Gtk.ComboBoxText (); this.comboZip.Name = "comboZip"; this.hbox1.Add (this.comboZip); global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.comboZip])); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.DeployDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.DeployDialog.cs index 470a2685c87..add11925578 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.DeployDialog.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.DeployDialog.cs @@ -84,7 +84,7 @@ internal partial class DeployDialog private global::Gtk.Table tableNewProject; - private global::Gtk.ComboBox comboCreateProject; + private global::Gtk.ComboBoxText comboCreateProject; private global::Gtk.Entry entryProjectName; @@ -100,7 +100,7 @@ internal partial class DeployDialog private global::Gtk.Label label12; - private global::Gtk.ComboBox comboSelProject; + private global::Gtk.ComboBoxText comboSelProject; private global::Gtk.Label label8; @@ -119,7 +119,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Create Package"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Deployment.Gui.DeployDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Events = ((global::Gdk.EventMask)(256)); w1.Name = "dialog_VBox"; w1.BorderWidth = ((uint)(2)); @@ -416,7 +416,7 @@ protected virtual void Build () this.radioCreateProject.Active = true; this.radioCreateProject.DrawIndicator = true; this.radioCreateProject.UseUnderline = true; - this.radioCreateProject.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.radioCreateProject.Group = new Gtk.RadioButton [0]; this.vboxSaveProject.Add (this.radioCreateProject); global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.vboxSaveProject [this.radioCreateProject])); w30.Position = 2; @@ -441,7 +441,7 @@ protected virtual void Build () this.tableNewProject.RowSpacing = ((uint)(6)); this.tableNewProject.ColumnSpacing = ((uint)(6)); // Container child tableNewProject.Gtk.Table+TableChild - this.comboCreateProject = global::Gtk.ComboBox.NewText (); + this.comboCreateProject = new global::Gtk.ComboBoxText (); this.comboCreateProject.Name = "comboCreateProject"; this.tableNewProject.Add (this.comboCreateProject); global::Gtk.Table.TableChild w32 = ((global::Gtk.Table.TableChild)(this.tableNewProject [this.comboCreateProject])); @@ -528,7 +528,7 @@ protected virtual void Build () w40.Expand = false; w40.Fill = false; // Container child boxAddProject.Gtk.Box+BoxChild - this.comboSelProject = global::Gtk.ComboBox.NewText (); + this.comboSelProject = new global::Gtk.ComboBoxText (); this.comboSelProject.Name = "comboSelProject"; this.boxAddProject.Add (this.comboSelProject); global::Gtk.Box.BoxChild w41 = ((global::Gtk.Box.BoxChild)(this.boxAddProject [this.comboSelProject])); @@ -566,7 +566,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w47 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox1])); w47.Position = 0; // Internal child MonoDevelop.Deployment.Gui.DeployDialog.ActionArea - global::Gtk.HButtonBox w48 = this.ActionArea; + global::Gtk.HButtonBox w48 = (Gtk.HButtonBox)this.ActionArea; w48.Name = "MonoDevelop.Deployment.DeployDialog_ActionArea"; w48.Spacing = 6; w48.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs index 45eb5ebf7e8..3a244163c91 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs @@ -29,7 +29,7 @@ protected virtual void Build () this.Name = "MonoDevelop.Deployment.Gui.EditPackageDialog"; this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Deployment.Gui.EditPackageDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -151,7 +151,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w13.Position = 0; // Internal child MonoDevelop.Deployment.Gui.EditPackageDialog.ActionArea - global::Gtk.HButtonBox w14 = this.ActionArea; + global::Gtk.HButtonBox w14 = (Gtk.HButtonBox)this.ActionArea; w14.Name = "dialog1_ActionArea"; w14.Spacing = 6; w14.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.FileCopyConfigurationSelector.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.FileCopyConfigurationSelector.cs index 6e75b890ea3..ed5b35da4f0 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.FileCopyConfigurationSelector.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.FileCopyConfigurationSelector.cs @@ -7,7 +7,7 @@ public partial class FileCopyConfigurationSelector private global::Gtk.VBox vbox1; private global::Gtk.HBox hbox1; private global::Gtk.Label label1; - private global::Gtk.ComboBox comboHandlers; + private global::Gtk.ComboBoxText comboHandlers; private global::Gtk.HSeparator hseparator1; private global::Gtk.EventBox editorBox; @@ -37,7 +37,7 @@ protected virtual void Build () w1.Expand = false; w1.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.comboHandlers = global::Gtk.ComboBox.NewText (); + this.comboHandlers = new global::Gtk.ComboBoxText (); this.comboHandlers.Name = "comboHandlers"; this.hbox1.Add (this.comboHandlers); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.comboHandlers])); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.InstallDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.InstallDialog.cs index 560a6db7e55..a099d4003af 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.InstallDialog.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.InstallDialog.cs @@ -22,7 +22,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Install Project"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Deployment.Gui.InstallDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Events = ((global::Gdk.EventMask)(256)); w1.Name = "dialog_VBox"; w1.BorderWidth = ((uint)(2)); @@ -85,7 +85,7 @@ protected virtual void Build () w7.Expand = false; w7.Fill = false; // Internal child MonoDevelop.Deployment.Gui.InstallDialog.ActionArea - global::Gtk.HButtonBox w8 = this.ActionArea; + global::Gtk.HButtonBox w8 = (Gtk.HButtonBox)this.ActionArea; w8.Name = "MonoDevelop.Deployment.InstallDialog_ActionArea"; w8.Spacing = 10; w8.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.SourcesZipEditorWidget.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.SourcesZipEditorWidget.cs index 189d5a04613..a8f420198aa 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.SourcesZipEditorWidget.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.SourcesZipEditorWidget.cs @@ -7,11 +7,11 @@ internal partial class SourcesZipEditorWidget private global::Gtk.VBox vbox2; private global::Gtk.Label label4; private global::Gtk.Table table1; - private global::Gtk.ComboBox comboFormat; + private global::Gtk.ComboBoxText comboFormat; private global::MonoDevelop.Components.FolderEntry folderEntry; private global::Gtk.HBox hbox1; private global::Gtk.Entry entryZip; - private global::Gtk.ComboBox comboZip; + private global::Gtk.ComboBoxText comboZip; private global::Gtk.Label label1; private global::Gtk.Label label2; private global::Gtk.Label label3; @@ -43,7 +43,7 @@ protected virtual void Build () this.table1.RowSpacing = ((uint)(6)); this.table1.ColumnSpacing = ((uint)(6)); // Container child table1.Gtk.Table+TableChild - this.comboFormat = global::Gtk.ComboBox.NewText (); + this.comboFormat = new global::Gtk.ComboBoxText (); this.comboFormat.Name = "comboFormat"; this.table1.Add (this.comboFormat); global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.comboFormat])); @@ -75,7 +75,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.entryZip])); w4.Position = 0; // Container child hbox1.Gtk.Box+BoxChild - this.comboZip = global::Gtk.ComboBox.NewText (); + this.comboZip = new global::Gtk.ComboBoxText (); this.comboZip.Name = "comboZip"; this.hbox1.Add (this.comboZip); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.comboZip])); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployDialog.cs index 4fbe017f7ba..b079d56a9be 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployDialog.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployDialog.cs @@ -158,7 +158,7 @@ void SelectBuilder (PackageBuilder builder) PackageBuilder GetBuilderSelection () { - Gtk.TreeModel model; + Gtk.ITreeModel model; Gtk.TreeIter iter; if (targetsTree.Selection.GetSelected (out model, out iter)) { diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployDirectoryInfoEditor.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployDirectoryInfoEditor.cs index a61c075a749..31010ad4cfb 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployDirectoryInfoEditor.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployDirectoryInfoEditor.cs @@ -26,7 +26,7 @@ protected override IPropertyEditor CreateEditor (Rectangle cell_area, StateType class DeployDirectoryInfoEditorWidget : Gtk.HBox, IPropertyEditor { Gtk.EventBox ebox; - Gtk.ComboBoxEntry combo; + Gtk.ComboBoxText combo; DeployDirectoryInfo[] values; public DeployDirectoryInfoEditorWidget () : base (false, 0) @@ -40,7 +40,7 @@ public void Initialize (EditSession session) ebox.Show (); PackStart (ebox, true, true, 0); - combo = Gtk.ComboBoxEntry.NewText (); + combo = new Gtk.ComboBoxText (); combo.Changed += combo_Changed; combo.Entry.IsEditable = false; combo.Entry.HasFrame = false; diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/PackageBuilderEditor.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/PackageBuilderEditor.cs index 528de0a9074..834214a108e 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/PackageBuilderEditor.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/PackageBuilderEditor.cs @@ -46,7 +46,7 @@ public PackageBuilderEditor (PackageBuilder target) PackStart (editor.CreateEditor (target), true, true, 0); } catch (Exception ex) { LoggingService.LogError (ex.ToString ()); - PackStart (new Gtk.Label ("Could not create editor for deploy target of type " + target)); + PackStart (new Gtk.Label ("Could not create editor for deploy target of type " + target), false, true, 0); } ShowAll (); } diff --git a/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs b/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs index 7de0624318c..21e6ec3477b 100644 --- a/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs +++ b/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs @@ -15,7 +15,7 @@ public partial class GenerateMakefilesDialog private global::Gtk.Label label3; private global::Gtk.HBox hbox1; private global::Gtk.Label label1; - private global::Gtk.ComboBox comboConfigs; + private global::Gtk.ComboBoxText comboConfigs; private global::Gtk.Button buttonCancel; private global::Gtk.Button buttonOk; @@ -27,9 +27,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Generate Makefiles"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.Resizable = false; - this.AllowGrow = false; +// this.AllowGrow = false; // Internal child MonoDevelop.Autotools.GenerateMakefilesDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -57,7 +57,7 @@ protected virtual void Build () this.rbSimple.Name = "rbSimple"; this.rbSimple.DrawIndicator = true; this.rbSimple.UseUnderline = true; - this.rbSimple.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.rbSimple.Group = new Gtk.RadioButton [0]; this.rbSimple.Remove (this.rbSimple.Child); // Container child rbSimple.Gtk.Container+ContainerChild this.label4 = new global::Gtk.Label (); @@ -132,7 +132,7 @@ protected virtual void Build () w10.Expand = false; w10.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.comboConfigs = global::Gtk.ComboBox.NewText (); + this.comboConfigs = new global::Gtk.ComboBoxText (); this.comboConfigs.Name = "comboConfigs"; this.hbox1.Add (this.comboConfigs); global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.comboConfigs])); @@ -151,7 +151,7 @@ protected virtual void Build () w13.Expand = false; w13.Fill = false; // Internal child MonoDevelop.Autotools.GenerateMakefilesDialog.ActionArea - global::Gtk.HButtonBox w14 = this.ActionArea; + global::Gtk.HButtonBox w14 = (Gtk.HButtonBox)this.ActionArea; w14.Name = "dialog1_ActionArea"; w14.Spacing = 6; w14.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.MakefileOptionPanelWidget.cs b/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.MakefileOptionPanelWidget.cs index 17c232b52a4..a4f4e95287c 100644 --- a/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.MakefileOptionPanelWidget.cs +++ b/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.MakefileOptionPanelWidget.cs @@ -14,9 +14,9 @@ public partial class MakefileOptionPanelWidget private global::Gtk.CheckButton cbRunTarget; private global::MonoDevelop.Components.FileEntry fileEntryMakefilePath; private global::Gtk.HBox hbox1; - private global::Gtk.ComboBox comboAssemblyName; + private global::Gtk.ComboBoxText comboAssemblyName; private global::Gtk.HBox hbox2; - private global::Gtk.ComboBox comboOutputDir; + private global::Gtk.ComboBoxText comboOutputDir; private global::Gtk.HBox hbox3; private global::Gtk.Entry BuildTargetName; private global::Gtk.HBox hbox4; @@ -39,10 +39,10 @@ public partial class MakefileOptionPanelWidget private global::Gtk.CheckButton cbKeepFilesSync; private global::Gtk.CheckButton cbKeepOthersSync; private global::Gtk.CheckButton cbKeepResourcesSync; - private global::Gtk.ComboBox comboDeployFilesVar; - private global::Gtk.ComboBox comboFilesVar; - private global::Gtk.ComboBox comboOthersVar; - private global::Gtk.ComboBox comboResourcesVar; + private global::Gtk.ComboBoxText comboDeployFilesVar; + private global::Gtk.ComboBoxText comboFilesVar; + private global::Gtk.ComboBoxText comboOthersVar; + private global::Gtk.ComboBoxText comboResourcesVar; private global::Gtk.Entry entryDeployFilesPattern; private global::Gtk.Entry entryFilesPattern; private global::Gtk.Entry entryResourcesPattern; @@ -57,9 +57,9 @@ public partial class MakefileOptionPanelWidget private global::Gtk.HSeparator hseparator5; private global::Gtk.Table table4; private global::Gtk.CheckButton cbAutotoolsProject; - private global::Gtk.ComboBox comboAsmRefVar; - private global::Gtk.ComboBox comboPackageRefVar; - private global::Gtk.ComboBox comboProjectRefVar; + private global::Gtk.ComboBoxText comboAsmRefVar; + private global::Gtk.ComboBoxText comboPackageRefVar; + private global::Gtk.ComboBoxText comboProjectRefVar; private global::Gtk.Entry entryAsmRefPattern; private global::Gtk.Entry entryPackageRefPattern; private global::Gtk.Entry entryProjectRefPattern; @@ -79,7 +79,7 @@ public partial class MakefileOptionPanelWidget private global::Gtk.Entry entryErrorRegex; private global::Gtk.Entry entryWarningRegex; private global::Gtk.HBox hbox6; - private global::Gtk.ComboBox comboMessageType; + private global::Gtk.ComboBoxText comboMessageType; private global::Gtk.Label lblErrorRegex; private global::Gtk.Label lblMessageType; private global::Gtk.Label lblWarningRegex; @@ -179,7 +179,7 @@ protected virtual void Build () this.hbox1 = new global::Gtk.HBox (); this.hbox1.Name = "hbox1"; // Container child hbox1.Gtk.Box+BoxChild - this.comboAssemblyName = global::Gtk.ComboBox.NewText (); + this.comboAssemblyName = new global::Gtk.ComboBoxText (); this.comboAssemblyName.WidthRequest = 300; this.comboAssemblyName.Name = "comboAssemblyName"; this.hbox1.Add (this.comboAssemblyName); @@ -199,7 +199,7 @@ protected virtual void Build () this.hbox2 = new global::Gtk.HBox (); this.hbox2.Name = "hbox2"; // Container child hbox2.Gtk.Box+BoxChild - this.comboOutputDir = global::Gtk.ComboBox.NewText (); + this.comboOutputDir = new global::Gtk.ComboBoxText (); this.comboOutputDir.WidthRequest = 300; this.comboOutputDir.Name = "comboOutputDir"; this.hbox2.Add (this.comboOutputDir); @@ -457,7 +457,7 @@ protected virtual void Build () w31.XOptions = ((global::Gtk.AttachOptions)(4)); w31.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table3.Gtk.Table+TableChild - this.comboDeployFilesVar = global::Gtk.ComboBox.NewText (); + this.comboDeployFilesVar = new global::Gtk.ComboBoxText (); this.comboDeployFilesVar.WidthRequest = 200; this.comboDeployFilesVar.Name = "comboDeployFilesVar"; this.table3.Add (this.comboDeployFilesVar); @@ -468,7 +468,7 @@ protected virtual void Build () w32.RightAttach = ((uint)(2)); w32.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table3.Gtk.Table+TableChild - this.comboFilesVar = global::Gtk.ComboBox.NewText (); + this.comboFilesVar = new global::Gtk.ComboBoxText (); this.comboFilesVar.WidthRequest = 200; this.comboFilesVar.Name = "comboFilesVar"; this.table3.Add (this.comboFilesVar); @@ -479,7 +479,7 @@ protected virtual void Build () w33.RightAttach = ((uint)(2)); w33.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table3.Gtk.Table+TableChild - this.comboOthersVar = global::Gtk.ComboBox.NewText (); + this.comboOthersVar = new global::Gtk.ComboBoxText (); this.comboOthersVar.WidthRequest = 200; this.comboOthersVar.Name = "comboOthersVar"; this.table3.Add (this.comboOthersVar); @@ -490,7 +490,7 @@ protected virtual void Build () w34.RightAttach = ((uint)(2)); w34.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table3.Gtk.Table+TableChild - this.comboResourcesVar = global::Gtk.ComboBox.NewText (); + this.comboResourcesVar = new global::Gtk.ComboBoxText (); this.comboResourcesVar.WidthRequest = 200; this.comboResourcesVar.Name = "comboResourcesVar"; this.table3.Add (this.comboResourcesVar); @@ -655,7 +655,7 @@ protected virtual void Build () w48.RightAttach = ((uint)(3)); w48.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table4.Gtk.Table+TableChild - this.comboAsmRefVar = global::Gtk.ComboBox.NewText (); + this.comboAsmRefVar = new global::Gtk.ComboBoxText (); this.comboAsmRefVar.WidthRequest = 200; this.comboAsmRefVar.Name = "comboAsmRefVar"; this.table4.Add (this.comboAsmRefVar); @@ -666,7 +666,7 @@ protected virtual void Build () w49.RightAttach = ((uint)(2)); w49.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table4.Gtk.Table+TableChild - this.comboPackageRefVar = global::Gtk.ComboBox.NewText (); + this.comboPackageRefVar = new global::Gtk.ComboBoxText (); this.comboPackageRefVar.WidthRequest = 200; this.comboPackageRefVar.Name = "comboPackageRefVar"; this.table4.Add (this.comboPackageRefVar); @@ -677,7 +677,7 @@ protected virtual void Build () w50.RightAttach = ((uint)(2)); w50.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table4.Gtk.Table+TableChild - this.comboProjectRefVar = global::Gtk.ComboBox.NewText (); + this.comboProjectRefVar = new global::Gtk.ComboBoxText (); this.comboProjectRefVar.WidthRequest = 200; this.comboProjectRefVar.Name = "comboProjectRefVar"; this.table4.Add (this.comboProjectRefVar); @@ -904,7 +904,7 @@ protected virtual void Build () this.hbox6 = new global::Gtk.HBox (); this.hbox6.Name = "hbox6"; // Container child hbox6.Gtk.Box+BoxChild - this.comboMessageType = global::Gtk.ComboBox.NewText (); + this.comboMessageType = new global::Gtk.ComboBoxText (); this.comboMessageType.WidthRequest = 150; this.comboMessageType.Name = "comboMessageType"; this.hbox6.Add (this.comboMessageType); diff --git a/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.MakefileSwitchEditor.cs b/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.MakefileSwitchEditor.cs index 4c84c767053..00a615a549e 100644 --- a/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.MakefileSwitchEditor.cs +++ b/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.MakefileSwitchEditor.cs @@ -16,7 +16,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Switch editor"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Autotools.MakefileSwitchEditor.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -26,7 +26,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(w1 [this.align])); w2.Position = 0; // Internal child MonoDevelop.Autotools.MakefileSwitchEditor.ActionArea - global::Gtk.HButtonBox w3 = this.ActionArea; + global::Gtk.HButtonBox w3 = (Gtk.HButtonBox)this.ActionArea; w3.Name = "dialog1_ActionArea"; w3.Spacing = 6; w3.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.TarballBuilderEditorWidget.cs b/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.TarballBuilderEditorWidget.cs index f6c92ec5dba..6990cb47361 100644 --- a/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.TarballBuilderEditorWidget.cs +++ b/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.TarballBuilderEditorWidget.cs @@ -14,7 +14,7 @@ public partial class TarballBuilderEditorWidget private global::Gtk.HBox boxConfig; private global::Gtk.Label label4; private global::Gtk.Label label3; - private global::Gtk.ComboBox comboConfigs; + private global::Gtk.ComboBoxText comboConfigs; private global::Gtk.HBox boxConfig1; private global::Gtk.Label label5; private global::Gtk.Label label6; @@ -72,7 +72,7 @@ protected virtual void Build () this.radioUseExisting.Active = true; this.radioUseExisting.DrawIndicator = true; this.radioUseExisting.UseUnderline = true; - this.radioUseExisting.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.radioUseExisting.Group = new Gtk.RadioButton [0]; this.vbox2.Add (this.radioUseExisting); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.radioUseExisting])); w4.Position = 1; @@ -117,7 +117,7 @@ protected virtual void Build () w7.Expand = false; w7.Fill = false; // Container child boxConfig.Gtk.Box+BoxChild - this.comboConfigs = global::Gtk.ComboBox.NewText (); + this.comboConfigs = new global::Gtk.ComboBoxText (); this.comboConfigs.Name = "comboConfigs"; this.boxConfig.Add (this.comboConfigs); global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.boxConfig [this.comboConfigs])); @@ -174,7 +174,7 @@ protected virtual void Build () this.rbAutotools.Active = true; this.rbAutotools.DrawIndicator = true; this.rbAutotools.UseUnderline = true; - this.rbAutotools.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.rbAutotools.Group = new Gtk.RadioButton [0]; this.rbAutotools.Remove (this.rbAutotools.Child); // Container child rbAutotools.Gtk.Container+ContainerChild this.label9 = new global::Gtk.Label (); diff --git a/main/src/addins/MonoDevelop.Autotools/ImportMakefileDialog.cs b/main/src/addins/MonoDevelop.Autotools/ImportMakefileDialog.cs index 876d093afef..b44d638dd1f 100644 --- a/main/src/addins/MonoDevelop.Autotools/ImportMakefileDialog.cs +++ b/main/src/addins/MonoDevelop.Autotools/ImportMakefileDialog.cs @@ -48,7 +48,7 @@ public ImportMakefileDialog (Project project, MakefileData tmpData, string name) box.PackStart (optionsWidget, false, false, 0); box.BorderWidth = 6; - this.VBox.PackStart (box, true, true, 0); + this.ContentArea.PackStart (box, true, true, 0); this.AddButton (Gtk.Stock.Cancel, ResponseType.Cancel); this.AddButton (Gtk.Stock.Ok, ResponseType.Ok); diff --git a/main/src/addins/MonoDevelop.Autotools/MakefileOptionPanelWidget.cs b/main/src/addins/MonoDevelop.Autotools/MakefileOptionPanelWidget.cs index 2b8e9474dff..34773dabfe8 100644 --- a/main/src/addins/MonoDevelop.Autotools/MakefileOptionPanelWidget.cs +++ b/main/src/addins/MonoDevelop.Autotools/MakefileOptionPanelWidget.cs @@ -14,7 +14,7 @@ namespace MonoDevelop.Autotools public partial class MakefileOptionPanelWidget : Gtk.Bin { MakefileData data; - ComboBox [] combos = null; + ComboBoxText [] combos = null; bool isDotNetProject; bool loading = true; Window parentDialog; @@ -137,7 +137,7 @@ public void SetImportMode () public MakefileOptionPanelWidget() { this.Build(); - combos = new ComboBox [7] { + combos = new ComboBoxText [7] { comboFilesVar, comboDeployFilesVar, comboResourcesVar, comboOthersVar, comboPackageRefVar, comboAsmRefVar, comboProjectRefVar}; //comboAssemblyName, comboOutputDir}; diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs index e40831c09fc..062badd3838 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs @@ -681,53 +681,53 @@ class CellRendererInnerException : CellRenderer Pango.FontDescription font = Pango.FontDescription.FromString (Platform.IsWindows ? "9" : "11"); - public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - using (var layout = new Pango.Layout (widget.PangoContext)) { - layout.FontDescription = font; - Pango.Rectangle ink, logical; - layout.SetMarkup ("" + Text + ""); - layout.GetPixelExtents (out ink, out logical); - width = logical.Width + 10; - height = logical.Height + 2; - - x_offset = 0; - y_offset = 0; - } - } - - protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - { - using (var cr = Gdk.CairoHelper.Create (window)) { - cr.Rectangle (background_area.X, background_area.Y, background_area.Width, background_area.Height); - - using (var layout = new Pango.Layout (widget.PangoContext)) { - layout.FontDescription = font; - - if ((flags & CellRendererState.Selected) != 0) { - cr.SetSourceRGB (Styles.ExceptionCaughtDialog.TreeSelectedBackgroundColor.Red, - Styles.ExceptionCaughtDialog.TreeSelectedBackgroundColor.Green, - Styles.ExceptionCaughtDialog.TreeSelectedBackgroundColor.Blue); // selected - cr.Fill (); - cr.SetSourceRGB (Styles.ExceptionCaughtDialog.TreeSelectedTextColor.Red, - Styles.ExceptionCaughtDialog.TreeSelectedTextColor.Green, - Styles.ExceptionCaughtDialog.TreeSelectedTextColor.Blue); - } else { - cr.SetSourceRGB (Styles.ExceptionCaughtDialog.TreeBackgroundColor.Red, - Styles.ExceptionCaughtDialog.TreeBackgroundColor.Green, - Styles.ExceptionCaughtDialog.TreeBackgroundColor.Blue); // background - cr.Fill (); - cr.SetSourceRGB (Styles.ExceptionCaughtDialog.TreeTextColor.Red, - Styles.ExceptionCaughtDialog.TreeTextColor.Green, - Styles.ExceptionCaughtDialog.TreeTextColor.Blue); - } - - layout.SetMarkup (Text); - cr.Translate (cell_area.X + 10, cell_area.Y + 1); - cr.ShowLayout (layout); - } - } - } +// public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) +// { +// using (var layout = new Pango.Layout (widget.PangoContext)) { +// layout.FontDescription = font; +// Pango.Rectangle ink, logical; +// layout.SetMarkup ("" + Text + ""); +// layout.GetPixelExtents (out ink, out logical); +// width = logical.Width + 10; +// height = logical.Height + 2; +// +// x_offset = 0; +// y_offset = 0; +// } +// } + +// protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) +// { +// using (var cr = Gdk.CairoHelper.Create (window)) { +// cr.Rectangle (background_area.X, background_area.Y, background_area.Width, background_area.Height); +// +// using (var layout = new Pango.Layout (widget.PangoContext)) { +// layout.FontDescription = font; +// +// if ((flags & CellRendererState.Selected) != 0) { +// cr.SetSourceRGB (Styles.ExceptionCaughtDialog.TreeSelectedBackgroundColor.Red, +// Styles.ExceptionCaughtDialog.TreeSelectedBackgroundColor.Green, +// Styles.ExceptionCaughtDialog.TreeSelectedBackgroundColor.Blue); // selected +// cr.Fill (); +// cr.SetSourceRGB (Styles.ExceptionCaughtDialog.TreeSelectedTextColor.Red, +// Styles.ExceptionCaughtDialog.TreeSelectedTextColor.Green, +// Styles.ExceptionCaughtDialog.TreeSelectedTextColor.Blue); +// } else { +// cr.SetSourceRGB (Styles.ExceptionCaughtDialog.TreeBackgroundColor.Red, +// Styles.ExceptionCaughtDialog.TreeBackgroundColor.Green, +// Styles.ExceptionCaughtDialog.TreeBackgroundColor.Blue); // background +// cr.Fill (); +// cr.SetSourceRGB (Styles.ExceptionCaughtDialog.TreeTextColor.Red, +// Styles.ExceptionCaughtDialog.TreeTextColor.Green, +// Styles.ExceptionCaughtDialog.TreeTextColor.Blue); +// } +// +// layout.SetMarkup (Text); +// cr.Translate (cell_area.X + 10, cell_area.Y + 1); +// cr.ShowLayout (layout); +// } +// } +// } } protected override bool OnKeyReleaseEvent (Gdk.EventKey evnt) diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs index 16cbdeaafad..558c9b4fc41 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs @@ -207,44 +207,44 @@ public string TextUrl { } } - public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - if (Compact) - this.Ellipsize = Pango.EllipsizeMode.None; - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - if (Compact) - this.Ellipsize = Pango.EllipsizeMode.End; - } +// public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) +// { +// if (Compact) +// this.Ellipsize = Pango.EllipsizeMode.None; +// base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); +// if (Compact) +// this.Ellipsize = Pango.EllipsizeMode.End; +// } } class CellRendererColorPreview : CellRenderer { - protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - { - var darkColor = Color.WithIncreasedLight (-0.15); - - using (Cairo.Context cr = Gdk.CairoHelper.Create (window)) { - double center_x = cell_area.X + Math.Round ((double)(cell_area.Width / 2d)); - double center_y = cell_area.Y + Math.Round ((double)(cell_area.Height / 2d)); - - // TODO: VV: On retina this should be LineWidth = 0.5 and Arc size needs to match - - // @1x: - cr.LineWidth = 1; - cr.Arc (center_x, center_y, 5.5f, 0, 2 * Math.PI); - - cr.SetSourceRGBA (Color.Red, Color.Green, Color.Blue, 1); - cr.FillPreserve (); - cr.SetSourceRGBA (darkColor.Red, darkColor.Green, darkColor.Blue, 1); - cr.Stroke (); - } - } - - public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - x_offset = y_offset = 0; - height = width = 16; - } +// protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) +// { +// var darkColor = Color.WithIncreasedLight (-0.15); +// +// using (Cairo.Context cr = Gdk.CairoHelper.Create (window)) { +// double center_x = cell_area.X + Math.Round ((double)(cell_area.Width / 2d)); +// double center_y = cell_area.Y + Math.Round ((double)(cell_area.Height / 2d)); +// +// // TODO: VV: On retina this should be LineWidth = 0.5 and Arc size needs to match +// +// // @1x: +// cr.LineWidth = 1; +// cr.Arc (center_x, center_y, 5.5f, 0, 2 * Math.PI); +// +// cr.SetSourceRGBA (Color.Red, Color.Green, Color.Blue, 1); +// cr.FillPreserve (); +// cr.SetSourceRGBA (darkColor.Red, darkColor.Green, darkColor.Blue, 1); +// cr.Stroke (); +// } +// } + +// public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) +// { +// x_offset = y_offset = 0; +// height = width = 16; +// } public Xwt.Drawing.Color Color { get; set; } } @@ -252,60 +252,60 @@ public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out in class CellRendererRoundedButton : CellRendererText { const int TopBottomPadding = 1; - protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - { - if (string.IsNullOrEmpty (Text)) { - return; - } - using (var cr = Gdk.CairoHelper.Create (window)) { - using (var layout = new Pango.Layout (widget.PangoContext)) { - layout.SetText (Text); - layout.FontDescription = FontDesc; - layout.FontDescription.Family = Family; - int w, h; - layout.GetPixelSize (out w, out h); - int xpad = (int)Xpad; - cr.RoundedRectangle ( - cell_area.X + xpad + 0.5, - cell_area.Y + TopBottomPadding + 0.5, - w + (cell_area.Height - 2 * TopBottomPadding) - 1, - cell_area.Height - TopBottomPadding * 2 - 1, - (cell_area.Height - (TopBottomPadding * 2)) / 2); - cr.LineWidth = 1; - cr.SetSourceColor (Styles.ObjectValueTreeValuesButtonBackground.ToCairoColor ()); - cr.FillPreserve (); - cr.SetSourceColor (Styles.ObjectValueTreeValuesButtonBorder.ToCairoColor ()); - cr.Stroke (); - - int YOffset = (cell_area.Height - h) / 2; - if (((ObjectValueTreeView)widget).CompactView && !Platform.IsWindows) - YOffset += 1; - cr.SetSourceColor (Styles.ObjectValueTreeValuesButtonText.ToCairoColor ()); - cr.MoveTo (cell_area.X + (cell_area.Height - TopBottomPadding * 2 + 1) / 2 + xpad, - cell_area.Y + YOffset); - cr.ShowLayout (layout); - } - } - } - - public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - x_offset = y_offset = 0; - if (string.IsNullOrEmpty (Text)) { - width = 0; - height = 0; - return; - } - using (var layout = new Pango.Layout (widget.PangoContext)) { - layout.SetText (Text); - layout.FontDescription = FontDesc; - layout.FontDescription.Family = Family; - int w, h; - layout.GetPixelSize (out w, out h); - width = w + (height - 2 * TopBottomPadding) + 2 * (int)Xpad; - } - } +// protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) +// { +// if (string.IsNullOrEmpty (Text)) { +// return; +// } +// using (var cr = Gdk.CairoHelper.Create (window)) { +// using (var layout = new Pango.Layout (widget.PangoContext)) { +// layout.SetText (Text); +// layout.FontDescription = FontDesc; +// layout.FontDescription.Family = Family; +// int w, h; +// layout.GetPixelSize (out w, out h); +// int xpad = (int)Xpad; +// cr.RoundedRectangle ( +// cell_area.X + xpad + 0.5, +// cell_area.Y + TopBottomPadding + 0.5, +// w + (cell_area.Height - 2 * TopBottomPadding) - 1, +// cell_area.Height - TopBottomPadding * 2 - 1, +// (cell_area.Height - (TopBottomPadding * 2)) / 2); +// cr.LineWidth = 1; +// cr.SetSourceColor (Styles.ObjectValueTreeValuesButtonBackground.ToCairoColor ()); +// cr.FillPreserve (); +// cr.SetSourceColor (Styles.ObjectValueTreeValuesButtonBorder.ToCairoColor ()); +// cr.Stroke (); +// +// int YOffset = (cell_area.Height - h) / 2; +// if (((ObjectValueTreeView)widget).CompactView && !Platform.IsWindows) +// YOffset += 1; +// cr.SetSourceColor (Styles.ObjectValueTreeValuesButtonText.ToCairoColor ()); +// cr.MoveTo (cell_area.X + (cell_area.Height - TopBottomPadding * 2 + 1) / 2 + xpad, +// cell_area.Y + YOffset); +// cr.ShowLayout (layout); +// } +// } +// } + +// public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) +// { +// base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); +// x_offset = y_offset = 0; +// if (string.IsNullOrEmpty (Text)) { +// width = 0; +// height = 0; +// return; +// } +// using (var layout = new Pango.Layout (widget.PangoContext)) { +// layout.SetText (Text); +// layout.FontDescription = FontDesc; +// layout.FontDescription.Family = Family; +// int w, h; +// layout.GetPixelSize (out w, out h); +// width = w + (height - 2 * TopBottomPadding) + 2 * (int)Xpad; +// } +// } } public ObjectValueTreeView () diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs index 0435aeb74c7..3e9a9669aac 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs @@ -195,14 +195,14 @@ void CopyExecution_Clicked (object sender, ContextMenuItemClickedEventArgs e) clipboard.Text = bufferText; } - public override void Dispose () - { - base.Dispose (); - DebuggingService.CallStackChanged -= OnStackChanged; - DebuggingService.PausedEvent -= OnDebuggerPaused; - DebuggingService.ResumedEvent -= OnDebuggerResumed; - DebuggingService.StoppedEvent -= OnDebuggerStopped; - } +// public override void Dispose () +// { +// base.Dispose (); +// DebuggingService.CallStackChanged -= OnStackChanged; +// DebuggingService.PausedEvent -= OnDebuggerPaused; +// DebuggingService.ResumedEvent -= OnDebuggerResumed; +// DebuggingService.StoppedEvent -= OnDebuggerStopped; +// } void OnStackChanged (object s, EventArgs a) { diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs index b9e133f9494..df5ee91bdac 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs @@ -208,123 +208,123 @@ static Cairo.Color Convert (Gdk.Color color) const int ItemIconTextItemSpacing = 4; const int IconModePadding = 2; - protected override bool OnExposeEvent (Gdk.EventExpose e) - { - Cairo.Context cr = Gdk.CairoHelper.Create (e.Window); - - Gdk.Rectangle area = e.Area; - - if (this.categories.Count == 0 || !string.IsNullOrEmpty (CustomMessage)) { - Pango.Layout messageLayout = new Pango.Layout (this.PangoContext); - messageLayout.Alignment = Pango.Alignment.Center; - messageLayout.Width = (int)(Allocation.Width * 2 / 3 * Pango.Scale.PangoScale); - if (!string.IsNullOrEmpty (CustomMessage)) - messageLayout.SetText (CustomMessage); - else - messageLayout.SetText (MonoDevelop.Core.GettextCatalog.GetString ("There are no tools available for the current document.")); - cr.MoveTo (Allocation.Width * 1 / 6, 12); - cr.SetSourceColor (Style.Text (StateType.Normal).ToCairoColor ()); - Pango.CairoHelper.ShowLayout (cr, messageLayout); - messageLayout.Dispose (); - ((IDisposable)cr).Dispose (); - return true; - } - - var backColor = Style.Base (StateType.Normal).ToCairoColor (); - cr.SetSourceColor (backColor); - cr.Rectangle (area.X, area.Y, area.Width, area.Height); - cr.Fill (); - - int xpos = (this.hAdjustement != null ? (int)this.hAdjustement.Value : 0); - int vadjustment = (this.vAdjustement != null ? (int)this.vAdjustement.Value : 0); - int ypos = -vadjustment; - Category lastCategory = null; - int lastCategoryYpos = 0; - - cr.LineWidth = 1; - - Iterate (ref xpos, ref ypos, delegate (Category category, Gdk.Size itemDimension) { - ProcessExpandAnimation (cr, lastCategory, lastCategoryYpos, backColor, area, ref ypos); - - if (!area.IntersectsWith (new Gdk.Rectangle (new Gdk.Point (xpos, ypos), itemDimension))) - return true; - cr.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); - cr.SetSourceColor (Ide.Gui.Styles.PadCategoryBackgroundColor.ToCairoColor ()); - cr.Fill (); - - if (lastCategory == null || lastCategory.IsExpanded || lastCategory.AnimatingExpand) { - cr.MoveTo (xpos, ypos + 0.5); - cr.LineTo (itemDimension.Width, ypos + 0.5); - } - cr.MoveTo (0, ypos + itemDimension.Height - 0.5); - cr.LineTo (xpos + Allocation.Width, ypos + itemDimension.Height - 0.5); - cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryBorderColor.ToCairoColor ()); - cr.Stroke (); - - headerLayout.SetMarkup (category.Text); - int width, height; - cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryLabelColor.ToCairoColor ()); - layout.GetPixelSize (out width, out height); - cr.MoveTo (xpos + CategoryLeftPadding, ypos + (double)(Math.Round ((double)(itemDimension.Height - height) / 2))); - Pango.CairoHelper.ShowLayout (cr, headerLayout); - - var img = category.IsExpanded ? discloseUp : discloseDown; - cr.DrawImage (this, img, Allocation.Width - img.Width - CategoryRightPadding, ypos + Math.Round ((itemDimension.Height - img.Height) / 2)); - - lastCategory = category; - lastCategoryYpos = ypos + itemDimension.Height; - - return true; - }, delegate (Category curCategory, Item item, Gdk.Size itemDimension) { - if (!area.IntersectsWith (new Gdk.Rectangle (new Gdk.Point (xpos, ypos), itemDimension))) - return true; - - var icon = item.Icon; - if (!icon.HasFixedSize) { - var maxIconSize = Math.Min (itemDimension.Width, itemDimension.Height); - var fittingIconSize = maxIconSize > 32 ? Xwt.IconSize.Large : maxIconSize > 16 ? Xwt.IconSize.Medium : Xwt.IconSize.Small; - icon = item.Icon.WithSize (fittingIconSize); - } - if (item == SelectedItem) { - icon = icon.WithStyles ("sel"); - cr.SetSourceColor (Style.Base (StateType.Selected).ToCairoColor ()); - cr.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); - cr.Fill (); - } - if (listMode || !curCategory.CanIconizeItems) { - cr.DrawImage (this, icon, xpos + ItemLeftPadding, ypos + Math.Round ((itemDimension.Height - icon.Height) / 2)); - layout.SetMarkup (item.Text); - int width, height; - layout.GetPixelSize (out width, out height); - cr.SetSourceColor (Style.Text (item != this.SelectedItem ? StateType.Normal : StateType.Selected).ToCairoColor ()); - cr.MoveTo (xpos + ItemLeftPadding + IconSize.Width + ItemIconTextItemSpacing, ypos + (double)(Math.Round ((double)(itemDimension.Height - height) / 2))); - Pango.CairoHelper.ShowLayout (cr, layout); - } else { - cr.DrawImage (this, icon, xpos + Math.Round ((itemDimension.Width - icon.Width) / 2), ypos + Math.Round ((itemDimension.Height - icon.Height) / 2)); - } - - if (item == mouseOverItem) { - cr.SetSourceColor (Style.Dark (StateType.Prelight).ToCairoColor ()); - cr.Rectangle (xpos + 0.5, ypos + 0.5, itemDimension.Width - 1, itemDimension.Height - 1); - cr.Stroke (); - } - - return true; - }); - - ProcessExpandAnimation (cr, lastCategory, lastCategoryYpos, backColor, area, ref ypos); - - if (lastCategory != null && lastCategory.AnimatingExpand) { - // Closing line when animating the last group of the toolbox - cr.MoveTo (area.X, ypos + 0.5); - cr.RelLineTo (area.Width, 0); - cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryBorderColor.ToCairoColor ()); - cr.Stroke (); - } - - ((IDisposable)cr).Dispose (); - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose e) +// { +// Cairo.Context cr = Gdk.CairoHelper.Create (e.Window); +// +// Gdk.Rectangle area = e.Area; +// +// if (this.categories.Count == 0 || !string.IsNullOrEmpty (CustomMessage)) { +// Pango.Layout messageLayout = new Pango.Layout (this.PangoContext); +// messageLayout.Alignment = Pango.Alignment.Center; +// messageLayout.Width = (int)(Allocation.Width * 2 / 3 * Pango.Scale.PangoScale); +// if (!string.IsNullOrEmpty (CustomMessage)) +// messageLayout.SetText (CustomMessage); +// else +// messageLayout.SetText (MonoDevelop.Core.GettextCatalog.GetString ("There are no tools available for the current document.")); +// cr.MoveTo (Allocation.Width * 1 / 6, 12); +// cr.SetSourceColor (Style.Text (StateType.Normal).ToCairoColor ()); +// Pango.CairoHelper.ShowLayout (cr, messageLayout); +// messageLayout.Dispose (); +// ((IDisposable)cr).Dispose (); +// return true; +// } +// +// var backColor = Style.Base (StateType.Normal).ToCairoColor (); +// cr.SetSourceColor (backColor); +// cr.Rectangle (area.X, area.Y, area.Width, area.Height); +// cr.Fill (); +// +// int xpos = (this.hAdjustement != null ? (int)this.hAdjustement.Value : 0); +// int vadjustment = (this.vAdjustement != null ? (int)this.vAdjustement.Value : 0); +// int ypos = -vadjustment; +// Category lastCategory = null; +// int lastCategoryYpos = 0; +// +// cr.LineWidth = 1; +// +// Iterate (ref xpos, ref ypos, delegate (Category category, Gdk.Size itemDimension) { +// ProcessExpandAnimation (cr, lastCategory, lastCategoryYpos, backColor, area, ref ypos); +// +// if (!area.IntersectsWith (new Gdk.Rectangle (new Gdk.Point (xpos, ypos), itemDimension))) +// return true; +// cr.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); +// cr.SetSourceColor (Ide.Gui.Styles.PadCategoryBackgroundColor.ToCairoColor ()); +// cr.Fill (); +// +// if (lastCategory == null || lastCategory.IsExpanded || lastCategory.AnimatingExpand) { +// cr.MoveTo (xpos, ypos + 0.5); +// cr.LineTo (itemDimension.Width, ypos + 0.5); +// } +// cr.MoveTo (0, ypos + itemDimension.Height - 0.5); +// cr.LineTo (xpos + Allocation.Width, ypos + itemDimension.Height - 0.5); +// cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryBorderColor.ToCairoColor ()); +// cr.Stroke (); +// +// headerLayout.SetMarkup (category.Text); +// int width, height; +// cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryLabelColor.ToCairoColor ()); +// layout.GetPixelSize (out width, out height); +// cr.MoveTo (xpos + CategoryLeftPadding, ypos + (double)(Math.Round ((double)(itemDimension.Height - height) / 2))); +// Pango.CairoHelper.ShowLayout (cr, headerLayout); +// +// var img = category.IsExpanded ? discloseUp : discloseDown; +// cr.DrawImage (this, img, Allocation.Width - img.Width - CategoryRightPadding, ypos + Math.Round ((itemDimension.Height - img.Height) / 2)); +// +// lastCategory = category; +// lastCategoryYpos = ypos + itemDimension.Height; +// +// return true; +// }, delegate (Category curCategory, Item item, Gdk.Size itemDimension) { +// if (!area.IntersectsWith (new Gdk.Rectangle (new Gdk.Point (xpos, ypos), itemDimension))) +// return true; +// +// var icon = item.Icon; +// if (!icon.HasFixedSize) { +// var maxIconSize = Math.Min (itemDimension.Width, itemDimension.Height); +// var fittingIconSize = maxIconSize > 32 ? Xwt.IconSize.Large : maxIconSize > 16 ? Xwt.IconSize.Medium : Xwt.IconSize.Small; +// icon = item.Icon.WithSize (fittingIconSize); +// } +// if (item == SelectedItem) { +// icon = icon.WithStyles ("sel"); +// cr.SetSourceColor (Style.Base (StateType.Selected).ToCairoColor ()); +// cr.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); +// cr.Fill (); +// } +// if (listMode || !curCategory.CanIconizeItems) { +// cr.DrawImage (this, icon, xpos + ItemLeftPadding, ypos + Math.Round ((itemDimension.Height - icon.Height) / 2)); +// layout.SetMarkup (item.Text); +// int width, height; +// layout.GetPixelSize (out width, out height); +// cr.SetSourceColor (Style.Text (item != this.SelectedItem ? StateType.Normal : StateType.Selected).ToCairoColor ()); +// cr.MoveTo (xpos + ItemLeftPadding + IconSize.Width + ItemIconTextItemSpacing, ypos + (double)(Math.Round ((double)(itemDimension.Height - height) / 2))); +// Pango.CairoHelper.ShowLayout (cr, layout); +// } else { +// cr.DrawImage (this, icon, xpos + Math.Round ((itemDimension.Width - icon.Width) / 2), ypos + Math.Round ((itemDimension.Height - icon.Height) / 2)); +// } +// +// if (item == mouseOverItem) { +// cr.SetSourceColor (Style.Dark (StateType.Prelight).ToCairoColor ()); +// cr.Rectangle (xpos + 0.5, ypos + 0.5, itemDimension.Width - 1, itemDimension.Height - 1); +// cr.Stroke (); +// } +// +// return true; +// }); +// +// ProcessExpandAnimation (cr, lastCategory, lastCategoryYpos, backColor, area, ref ypos); +// +// if (lastCategory != null && lastCategory.AnimatingExpand) { +// // Closing line when animating the last group of the toolbox +// cr.MoveTo (area.X, ypos + 0.5); +// cr.RelLineTo (area.Width, 0); +// cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryBorderColor.ToCairoColor ()); +// cr.Stroke (); +// } +// +// ((IDisposable)cr).Dispose (); +// return true; +// } void ProcessExpandAnimation (Cairo.Context cr, Category lastCategory, int lastCategoryYpos, Cairo.Color backColor, Gdk.Rectangle area, ref int ypos) { @@ -811,21 +811,21 @@ public void ScrollToSelectedItem () this.vAdjustement.Value = rect.Bottom - this.Allocation.Height; } - protected override void OnSetScrollAdjustments (Adjustment hAdjustement, Adjustment vAdjustement) - { - this.hAdjustement = hAdjustement; - if (this.hAdjustement != null) { - this.hAdjustement.ValueChanged += delegate { - this.QueueDraw (); - }; - } - this.vAdjustement = vAdjustement; - if (this.vAdjustement != null) { - this.vAdjustement.ValueChanged += delegate { - this.QueueDraw (); - }; - } - } +// protected override void OnSetScrollAdjustments (Adjustment hAdjustement, Adjustment vAdjustement) +// { +// this.hAdjustement = hAdjustement; +// if (this.hAdjustement != null) { +// this.hAdjustement.ValueChanged += delegate { +// this.QueueDraw (); +// }; +// } +// this.vAdjustement = vAdjustement; +// if (this.vAdjustement != null) { +// this.vAdjustement.ValueChanged += delegate { +// this.QueueDraw (); +// }; +// } +// } #endregion #region Item & Category iteration @@ -901,34 +901,34 @@ void Iterate (ref int xpos, ref int ypos, CategoryAction catAction, ItemAction a #region Control size management bool realSizeRequest; - protected override void OnSizeRequested (ref Requisition req) - { - if (!realSizeRequest) { - // Request a minimal width, to size recalculation infinite loops with - // small widths, due to the vscrollbar being shown and hidden. - req.Width = 50; - req.Height = 0; - return; - } - int xpos = 0; - int ypos = 0; - Iterate (ref xpos, ref ypos, null, null); - req.Width = 50; - req.Height = ypos; - if (this.vAdjustement != null) { - this.vAdjustement.SetBounds (0, - ypos, - 20, - Allocation.Height, - Allocation.Height); - if (ypos < Allocation.Height) - this.vAdjustement.Value = 0; - if (vAdjustement.Value + vAdjustement.PageSize > vAdjustement.Upper) - vAdjustement.Value = vAdjustement.Upper - vAdjustement.PageSize; - if (vAdjustement.Value < 0) - vAdjustement.Value = 0; - } - } +// protected override void OnSizeRequested (ref Requisition req) +// { +// if (!realSizeRequest) { +// // Request a minimal width, to size recalculation infinite loops with +// // small widths, due to the vscrollbar being shown and hidden. +// req.Width = 50; +// req.Height = 0; +// return; +// } +// int xpos = 0; +// int ypos = 0; +// Iterate (ref xpos, ref ypos, null, null); +// req.Width = 50; +// req.Height = ypos; +// if (this.vAdjustement != null) { +// this.vAdjustement.SetBounds (0, +// ypos, +// 20, +// Allocation.Height, +// Allocation.Height); +// if (ypos < Allocation.Height) +// this.vAdjustement.Value = 0; +// if (vAdjustement.Value + vAdjustement.PageSize > vAdjustement.Upper) +// vAdjustement.Value = vAdjustement.Upper - vAdjustement.PageSize; +// if (vAdjustement.Value < 0) +// vAdjustement.Value = 0; +// } +// } protected override void OnSizeAllocated (Gdk.Rectangle allocation) { diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj index b06b9efb42a..807f74848a8 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj @@ -17,11 +17,21 @@ - - - - - + + glib-sharp-3.0 + + + gtk-sharp-3.0 + + + gtk-sharp-3.0 + + + gdk-sharp-3.0 + + + gtk-sharp-3.0 + @@ -52,6 +62,9 @@ ..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.Rocks.dll False + + gio-sharp-3.0 + diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs index d2ff1ca73f2..cbc9a9d735e 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs @@ -171,7 +171,7 @@ private class WrappedCentreLabel : Gtk.Widget public WrappedCentreLabel () { - WidgetFlags |= Gtk.WidgetFlags.NoWindow; + this.HasWindow = false; } public WrappedCentreLabel (string text) diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs index 01a080e9fe3..4b44cf22b10 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs @@ -55,8 +55,8 @@ public RemoteDesignerProcess () designerFrame = new Gtk.Frame (); propGridFrame = new Gtk.Frame (); - designerFrame.Shadow = ShadowType.None; - propGridFrame.Shadow = ShadowType.None; +// designerFrame.Shadow = ShadowType.None; +// propGridFrame.Shadow = ShadowType.None; designerFrame.BorderWidth = 0; designerFrame.Show (); @@ -151,7 +151,7 @@ protected void ShowText (string markup) Frame padFrame = new Gtk.Frame (); padFrame.Add (label); padFrame.BorderWidth = 10; - padFrame.Shadow = ShadowType.None; +// padFrame.Shadow = ShadowType.None; ScrolledWindow scrollW = new ScrolledWindow (); scrollW.AddWithViewport (padFrame); diff --git a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs index 2aa30754454..273ee02fb77 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs @@ -5,184 +5,184 @@ namespace MonoDevelop.DesignerSupport.Toolbox internal partial class ComponentSelectorDialog { private global::Gtk.VBox vbox2; - + private global::Gtk.HBox hbox1; - + private global::Gtk.Label label1; - - private global::Gtk.ComboBox comboType; - + + private global::Gtk.ComboBoxText comboType; + private global::Gtk.VSeparator vseparator1; - + private global::Gtk.Button button24; - + private global::Gtk.HBox hbox2; - + private global::MonoDevelop.Components.ImageView imageview1; - + private global::Gtk.Label label2; - + private global::Gtk.ScrolledWindow scrolledwindow1; - + private global::Gtk.TreeView listView; - + private global::Gtk.CheckButton checkGroupByCat; - + private global::Gtk.Button buttonCancel; - + private global::Gtk.Button buttonOk; - protected virtual void Build () + protected virtual void Build() { - global::Stetic.Gui.Initialize (this); + global::Stetic.Gui.Initialize(this); // Widget MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog this.Name = "MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog"; - this.Title = global::Mono.Unix.Catalog.GetString ("Toolbox Item Selector"); + this.Title = global::Mono.Unix.Catalog.GetString("Toolbox Item Selector"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild - this.vbox2 = new global::Gtk.VBox (); + this.vbox2 = new global::Gtk.VBox(); this.vbox2.Name = "vbox2"; this.vbox2.Spacing = 6; this.vbox2.BorderWidth = ((uint)(6)); // Container child vbox2.Gtk.Box+BoxChild - this.hbox1 = new global::Gtk.HBox (); + this.hbox1 = new global::Gtk.HBox(); this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild - this.label1 = new global::Gtk.Label (); + this.label1 = new global::Gtk.Label(); this.label1.Name = "label1"; this.label1.Xalign = 0F; - this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("Type of component:"); - this.hbox1.Add (this.label1); - global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label1])); + this.label1.LabelProp = global::Mono.Unix.Catalog.GetString("Type of component:"); + this.hbox1.Add(this.label1); + global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.label1])); w2.Position = 0; w2.Expand = false; w2.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.comboType = global::Gtk.ComboBox.NewText (); + this.comboType = new global::Gtk.ComboBoxText(); this.comboType.Name = "comboType"; - this.hbox1.Add (this.comboType); - global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.comboType])); + this.hbox1.Add(this.comboType); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.comboType])); w3.Position = 1; // Container child hbox1.Gtk.Box+BoxChild - this.vseparator1 = new global::Gtk.VSeparator (); + this.vseparator1 = new global::Gtk.VSeparator(); this.vseparator1.Name = "vseparator1"; - this.hbox1.Add (this.vseparator1); - global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vseparator1])); + this.hbox1.Add(this.vseparator1); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.vseparator1])); w4.Position = 2; w4.Expand = false; w4.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.button24 = new global::Gtk.Button (); + this.button24 = new global::Gtk.Button(); this.button24.CanFocus = true; this.button24.Name = "button24"; // Container child button24.Gtk.Container+ContainerChild - this.hbox2 = new global::Gtk.HBox (); + this.hbox2 = new global::Gtk.HBox(); this.hbox2.Name = "hbox2"; this.hbox2.Spacing = 2; // Container child hbox2.Gtk.Box+BoxChild - this.imageview1 = new global::MonoDevelop.Components.ImageView (); + this.imageview1 = new global::MonoDevelop.Components.ImageView(); this.imageview1.Name = "imageview1"; this.imageview1.IconId = "gtk-add"; - this.imageview1.IconSize = ((global::Gtk.IconSize)(1)); - this.hbox2.Add (this.imageview1); - global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.imageview1])); + this.hbox2.Add(this.imageview1); + global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.imageview1])); w5.Position = 0; w5.Expand = false; w5.Fill = false; // Container child hbox2.Gtk.Box+BoxChild - this.label2 = new global::Gtk.Label (); + this.label2 = new global::Gtk.Label(); this.label2.Name = "label2"; - this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Add Assembly..."); + this.label2.LabelProp = global::Mono.Unix.Catalog.GetString("Add Assembly..."); this.label2.UseUnderline = true; - this.hbox2.Add (this.label2); - global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.label2])); + this.hbox2.Add(this.label2); + global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.label2])); w6.Position = 1; w6.Expand = false; w6.Fill = false; - this.button24.Add (this.hbox2); - this.hbox1.Add (this.button24); - global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.button24])); + this.button24.Add(this.hbox2); + this.hbox1.Add(this.button24); + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.button24])); w8.Position = 3; w8.Expand = false; - this.vbox2.Add (this.hbox1); - global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); + this.vbox2.Add(this.hbox1); + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1])); w9.Position = 0; w9.Expand = false; w9.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.scrolledwindow1 = new global::Gtk.ScrolledWindow (); + this.scrolledwindow1 = new global::Gtk.ScrolledWindow(); this.scrolledwindow1.CanFocus = true; this.scrolledwindow1.Name = "scrolledwindow1"; this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child scrolledwindow1.Gtk.Container+ContainerChild - this.listView = new global::Gtk.TreeView (); + this.listView = new global::Gtk.TreeView(); this.listView.CanFocus = true; this.listView.Name = "listView"; - this.scrolledwindow1.Add (this.listView); - this.vbox2.Add (this.scrolledwindow1); - global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.scrolledwindow1])); + this.scrolledwindow1.Add(this.listView); + this.vbox2.Add(this.scrolledwindow1); + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.scrolledwindow1])); w11.Position = 1; // Container child vbox2.Gtk.Box+BoxChild - this.checkGroupByCat = new global::Gtk.CheckButton (); + this.checkGroupByCat = new global::Gtk.CheckButton(); this.checkGroupByCat.CanFocus = true; this.checkGroupByCat.Name = "checkGroupByCat"; - this.checkGroupByCat.Label = global::Mono.Unix.Catalog.GetString ("Group by component category"); + this.checkGroupByCat.Label = global::Mono.Unix.Catalog.GetString("Group by component category"); this.checkGroupByCat.DrawIndicator = true; this.checkGroupByCat.UseUnderline = true; - this.vbox2.Add (this.checkGroupByCat); - global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.checkGroupByCat])); + this.vbox2.Add(this.checkGroupByCat); + global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.checkGroupByCat])); w12.Position = 2; w12.Expand = false; w12.Fill = false; - w1.Add (this.vbox2); - global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + w1.Add(this.vbox2); + global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(w1[this.vbox2])); w13.Position = 0; // Internal child MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.ActionArea - global::Gtk.HButtonBox w14 = this.ActionArea; + global::Gtk.HButtonBox w14 = (Gtk.HButtonBox)this.ActionArea; w14.Name = "dialog1_ActionArea"; w14.Spacing = 10; w14.BorderWidth = ((uint)(5)); w14.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild - this.buttonCancel = new global::Gtk.Button (); + this.buttonCancel = new global::Gtk.Button(); this.buttonCancel.CanDefault = true; this.buttonCancel.CanFocus = true; this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.UseStock = true; this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; - this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w15 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w14 [this.buttonCancel])); + this.AddActionWidget(this.buttonCancel, -6); + global::Gtk.ButtonBox.ButtonBoxChild w15 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w14[this.buttonCancel])); w15.Expand = false; w15.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild - this.buttonOk = new global::Gtk.Button (); + this.buttonOk = new global::Gtk.Button(); this.buttonOk.CanDefault = true; this.buttonOk.CanFocus = true; this.buttonOk.Name = "buttonOk"; this.buttonOk.UseStock = true; this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; - w14.Add (this.buttonOk); - global::Gtk.ButtonBox.ButtonBoxChild w16 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w14 [this.buttonOk])); + w14.Add(this.buttonOk); + global::Gtk.ButtonBox.ButtonBoxChild w16 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w14[this.buttonOk])); w16.Position = 1; w16.Expand = false; w16.Fill = false; - if ((this.Child != null)) { - this.Child.ShowAll (); + if ((this.Child != null)) + { + this.Child.ShowAll(); } this.DefaultWidth = 642; this.DefaultHeight = 433; - this.Hide (); - this.comboType.Changed += new global::System.EventHandler (this.OnComboTypeChanged); - this.button24.Clicked += new global::System.EventHandler (this.OnButton24Clicked); - this.checkGroupByCat.Clicked += new global::System.EventHandler (this.OnCheckbutton1Clicked); - this.buttonOk.Clicked += new global::System.EventHandler (this.OnButtonOkClicked); + this.Hide(); + this.comboType.Changed += new global::System.EventHandler(this.OnComboTypeChanged); + this.button24.Clicked += new global::System.EventHandler(this.OnButton24Clicked); + this.checkGroupByCat.Clicked += new global::System.EventHandler(this.OnCheckbutton1Clicked); + this.buttonOk.Clicked += new global::System.EventHandler(this.OnButtonOkClicked); } } } diff --git a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/gui.stetic b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/gui.stetic index be5dc01e5f1..d69a54be5d9 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/gui.stetic +++ b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/gui.stetic @@ -2,11 +2,10 @@ .. - 2.12 + 3.0 - @@ -80,7 +79,6 @@ gtk-add - Menu 0 diff --git a/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs b/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs index a013ebc396f..787b396f1ae 100644 --- a/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs +++ b/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs @@ -21,7 +21,7 @@ internal partial class CatalogHeadersWidget private global::Gtk.TextView textviewComments; private global::Gtk.Label label3; private global::Gtk.Table table2; - private global::Gtk.ComboBoxEntry comboboxentryCharset; + private global::Gtk.ComboBoxText comboboxentryCharset; private global::Gtk.Entry entryLanguageGroupEmail; private global::Gtk.Entry entryLanguageGroupName; private global::Gtk.Entry entryTranslatorEmail; @@ -221,7 +221,7 @@ protected virtual void Build () this.table2.ColumnSpacing = ((uint)(6)); this.table2.BorderWidth = ((uint)(8)); // Container child table2.Gtk.Table+TableChild - this.comboboxentryCharset = new global::Gtk.ComboBoxEntry (); + this.comboboxentryCharset = new global::Gtk.ComboBoxText (); this.comboboxentryCharset.Name = "comboboxentryCharset"; this.table2.Add (this.comboboxentryCharset); global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table2 [this.comboboxentryCharset])); diff --git a/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs b/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs index 59809433693..3e75522c0c7 100644 --- a/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs +++ b/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs @@ -42,7 +42,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Gettext.TranslationProjectOptionsDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -125,7 +125,7 @@ protected virtual void Build () this.radiobuttonRelPath.Name = "radiobuttonRelPath"; this.radiobuttonRelPath.DrawIndicator = true; this.radiobuttonRelPath.UseUnderline = true; - this.radiobuttonRelPath.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.radiobuttonRelPath.Group = new Gtk.RadioButton [0]; this.table1.Add (this.radiobuttonRelPath); global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1 [this.radiobuttonRelPath])); w7.XOptions = ((global::Gtk.AttachOptions)(4)); @@ -249,7 +249,7 @@ protected virtual void Build () w23.Expand = false; w23.Fill = false; // Internal child MonoDevelop.Gettext.TranslationProjectOptionsDialog.ActionArea - global::Gtk.HButtonBox w24 = this.ActionArea; + global::Gtk.HButtonBox w24 = (Gtk.HButtonBox)this.ActionArea; w24.Name = "dialog1_ActionArea"; w24.Spacing = 6; w24.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs b/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs index 71d7d8bd454..de130dfea3f 100644 --- a/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs +++ b/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs @@ -39,11 +39,11 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.Modal = true; this.Resizable = false; - this.AllowGrow = false; +// this.AllowGrow = false; this.Gravity = ((global::Gdk.Gravity)(5)); this.SkipTaskbarHint = true; // Internal child MonoDevelop.Gettext.Translator.LanguageChooserDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Events = ((global::Gdk.EventMask)(256)); w1.Name = "dialog_VBox"; w1.BorderWidth = ((uint)(2)); @@ -146,7 +146,7 @@ protected virtual void Build () this.radiobuttonKnown.Name = "radiobuttonKnown"; this.radiobuttonKnown.DrawIndicator = true; this.radiobuttonKnown.UseUnderline = true; - this.radiobuttonKnown.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.radiobuttonKnown.Group = new Gtk.RadioButton [0]; this.frame1.LabelWidget = this.radiobuttonKnown; this.vbox3.Add (this.frame1); global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.frame1])); @@ -205,7 +205,7 @@ protected virtual void Build () w19.Expand = false; w19.Fill = false; // Internal child MonoDevelop.Gettext.Translator.LanguageChooserDialog.ActionArea - global::Gtk.HButtonBox w20 = this.ActionArea; + global::Gtk.HButtonBox w20 = (Gtk.HButtonBox)this.ActionArea; w20.Name = "MonoDevelop.Gettext.LanguageChooserDialog_ActionArea"; w20.Spacing = 6; w20.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs index 98cf507fa30..c0488d2e588 100644 --- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs +++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs @@ -272,21 +272,21 @@ void HandleCellRendFuzzyToggled (object sender, ToggledArgs args) } } - void CatalogIconDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + void CatalogIconDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { CatalogEntry entry = (CatalogEntry)model.GetValue (iter, 0); ((CellRendererImage)cell).Image = ImageService.GetIcon (GetStockForEntry (entry), IconSize.Menu); cell.CellBackgroundGdk = GetRowColorForEntry (entry); } - void FuzzyToggleDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + void FuzzyToggleDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { CatalogEntry entry = (CatalogEntry)model.GetValue (iter, 0); ((CellRendererToggle)cell).Active = entry.IsFuzzy; cell.CellBackgroundGdk = GetRowColorForEntry (entry); } - void OriginalTextDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + void OriginalTextDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { CatalogEntry entry = (CatalogEntry)model.GetValue (iter, 0); ((CellRendererText)cell).Text = EscapeForTreeView (entry.String); @@ -294,7 +294,7 @@ void OriginalTextDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk ((CellRendererText)cell).ForegroundGdk = GetForeColorForEntry (entry); } - void TranslationTextDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + void TranslationTextDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { CatalogEntry entry = (CatalogEntry)model.GetValue (iter, 0); ((CellRendererText)cell).Text = EscapeForTreeView (entry.GetTranslation (0)); @@ -375,7 +375,7 @@ public Menu CreateOptionsMenu () Menu sub = new Menu (); searchInMenu.Submenu = sub; Gtk.RadioMenuItem original = null, translated = null, both = null; - GLib.SList group = new GLib.SList (IntPtr.Zero); + var group = new Gtk.RadioMenuItem [0]; original = new Gtk.RadioMenuItem (group, GettextCatalog.GetString ("_Original")); group = original.Group; original.ButtonPressEvent += delegate { original.Activate (); }; @@ -832,17 +832,17 @@ void UpdateFromCatalog () } - newStore.SetSortFunc (0, delegate (TreeModel model, TreeIter iter1, TreeIter iter2) { + newStore.SetSortFunc (0, delegate (ITreeModel model, TreeIter iter1, TreeIter iter2) { CatalogEntry entry1 = (CatalogEntry)model.GetValue (iter1, 0); CatalogEntry entry2 = (CatalogEntry)model.GetValue (iter2, 0); return GetTypeSortIndicator (entry1).CompareTo (GetTypeSortIndicator (entry2)); }); - newStore.SetSortFunc (1, delegate (TreeModel model, TreeIter iter1, TreeIter iter2) { + newStore.SetSortFunc (1, delegate (ITreeModel model, TreeIter iter1, TreeIter iter2) { CatalogEntry entry1 = (CatalogEntry)model.GetValue (iter1, 0); CatalogEntry entry2 = (CatalogEntry)model.GetValue (iter2, 0); return entry1.String.CompareTo (entry2.String); }); - newStore.SetSortFunc (2, delegate (TreeModel model, TreeIter iter1, TreeIter iter2) { + newStore.SetSortFunc (2, delegate (ITreeModel model, TreeIter iter1, TreeIter iter2) { CatalogEntry entry1 = (CatalogEntry)model.GetValue (iter1, 0); CatalogEntry entry2 = (CatalogEntry)model.GetValue (iter2, 0); return entry1.GetTranslation (0).CompareTo (entry2.GetTranslation (0)); diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj index 9b63d060866..29f84a4190d 100644 --- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj +++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj @@ -13,11 +13,21 @@ - - - - - + + glib-sharp-3.0 + + + gtk-sharp-3.0 + + + gtk-sharp-3.0 + + + gdk-sharp-3.0 + + + gtk-sharp-3.0 + ..\..\..\build\bin\System.Reflection.Metadata.dll @@ -31,6 +41,9 @@ ..\..\..\build\bin\Microsoft.CodeAnalysis.dll False + + gio-sharp-3.0 + diff --git a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj index 9c1636b9cc4..6464eabcb49 100644 --- a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj +++ b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj @@ -16,11 +16,21 @@ - - - - - + + gdk-sharp-3.0 + + + gtk-sharp-3.0 + + + glib-sharp-3.0 + + + gtk-sharp-3.0 + + + gtk-sharp-3.0 + ..\..\..\build\bin\Microsoft.CodeAnalysis.CSharp.dll False @@ -45,6 +55,9 @@ ..\..\..\build\bin\System.Collections.Immutable.dll False + + gio-sharp-3.0 + diff --git a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ElementHelpWidget.cs b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ElementHelpWidget.cs index 59c8a35c7de..bd3ab39b786 100644 --- a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ElementHelpWidget.cs +++ b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ElementHelpWidget.cs @@ -91,7 +91,7 @@ public ElementHelpWidget (IWorkbenchWindow workbenchWindow, RegexToolkitWidget r Show (); } - static void ElementDescriptionFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) + static void ElementDescriptionFunc (TreeViewColumn column, CellRenderer cell, ITreeModel model, TreeIter iter) { string str = (string)model.GetValue (iter, 2); if (string.IsNullOrEmpty (str)) { From ed1ab724836db6f2517f3b2080a296be248c067d Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 26 Jul 2018 20:31:26 -0400 Subject: [PATCH 010/382] Always use ToolkitType.Gtk3 for XWT --- .../fsharpbinding/MonoDevelop.FSharp.Tests/TestHelpers.fs | 2 +- main/src/addins/MacPlatform/ExtendedTitleBarDialogBackend.cs | 2 +- main/src/addins/MacPlatform/ExtendedTitleBarWindowBackend.cs | 2 +- .../MonoDevelop.DotNetCore.Tests/DotNetCoreTestBase.cs | 2 +- .../MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs | 2 +- .../core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs | 2 +- .../core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs | 2 +- .../MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs | 1 + .../MonoDevelop.Components/TooltipPopoverWindow.cs | 2 +- .../src/core/MonoDevelop.Ide/MonoDevelop.Components/Window.cs | 2 +- .../MonoDevelop.Components/WindowTransparencyDecorator.cs | 2 +- .../MonoDevelop.Ide/MonoDevelop.Components/Xwt/XwtPopup.cs | 4 ++-- .../MonoDevelop.Components/XwtWindowControl.cs | 2 +- .../MonoDevelop.Ide.BuildOutputView/BuildOutputWidget.cs | 2 +- .../MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs | 2 +- .../MonoDevelop.Ide.Gui.Wizard/WizardDialog.cs | 2 +- main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs | 2 +- main/tests/IdeUnitTests/IdeTestBase.cs | 2 +- 18 files changed, 19 insertions(+), 18 deletions(-) diff --git a/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/TestHelpers.fs b/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/TestHelpers.fs index 9513d2ccf7b..ea898ded8eb 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/TestHelpers.fs +++ b/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/TestHelpers.fs @@ -16,7 +16,7 @@ module FixtureSetup = //Environment.SetEnvironmentVariable ("MONO_ADDINS_REGISTRY", "/tmp") //Environment.SetEnvironmentVariable ("XDG_CONFIG_HOME", "/tmp") MonoDevelop.FSharp.MDLanguageService.DisableVirtualFileSystem() - Xwt.Application.Initialize (Xwt.ToolkitType.Gtk) + Xwt.Application.Initialize (Xwt.ToolkitType.Gtk3) Runtime.Initialize (true) MonoDevelop.Ide.DesktopService.Initialize() diff --git a/main/src/addins/MacPlatform/ExtendedTitleBarDialogBackend.cs b/main/src/addins/MacPlatform/ExtendedTitleBarDialogBackend.cs index 279b9c9afd5..d93943c4d6f 100644 --- a/main/src/addins/MacPlatform/ExtendedTitleBarDialogBackend.cs +++ b/main/src/addins/MacPlatform/ExtendedTitleBarDialogBackend.cs @@ -109,7 +109,7 @@ public override void Initialize () }; toolbar = new CustomToolbar (); - toolbar.Background = (Gdk.Pixbuf)Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk).GetNativeImage (image); + toolbar.Background = (Gdk.Pixbuf)Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk3).GetNativeImage (image); toolbar.TitleBarHeight = MacPlatformService.GetTitleBarHeight (); MainBox.PackStart (toolbar, false, false, 0); ((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0; diff --git a/main/src/addins/MacPlatform/ExtendedTitleBarWindowBackend.cs b/main/src/addins/MacPlatform/ExtendedTitleBarWindowBackend.cs index 269b091e55a..53bd4722bac 100644 --- a/main/src/addins/MacPlatform/ExtendedTitleBarWindowBackend.cs +++ b/main/src/addins/MacPlatform/ExtendedTitleBarWindowBackend.cs @@ -110,7 +110,7 @@ public override void Initialize () }; toolbar = new CustomToolbar (); - toolbar.Background = (Gdk.Pixbuf)Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk).GetNativeImage (image); + toolbar.Background = (Gdk.Pixbuf)Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk3).GetNativeImage (image); toolbar.TitleBarHeight = MacPlatformService.GetTitleBarHeight (); MainBox.PackStart (toolbar, false, false, 0); ((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0; diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreTestBase.cs b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreTestBase.cs index 24633db2f9f..38b5e2bf757 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreTestBase.cs +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreTestBase.cs @@ -36,7 +36,7 @@ class DotNetCoreTestBase : TestBase protected override void InternalSetup (string rootDir) { base.InternalSetup (rootDir); - Xwt.Application.Initialize (Xwt.ToolkitType.Gtk); + Xwt.Application.Initialize (Xwt.ToolkitType.Gtk3); DesktopService.Initialize (); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs index 10bbc0f6143..03a6cf6450f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs @@ -171,7 +171,7 @@ public SearchPopupWidget () headerColor = Styles.GlobalSearch.HeaderTextColor; selectionBackgroundColor = Styles.GlobalSearch.SelectionBackgroundColor; - Toolkit.Load (ToolkitType.Gtk).Invoke (() => declarationviewwindow = new TooltipInformationWindow ()); + Toolkit.Load (ToolkitType.Gtk3).Invoke (() => declarationviewwindow = new TooltipInformationWindow ()); categories.Add (new RoslynSearchCategory ()); categories.Add (new FileSearchCategory ()); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs index c29810cb611..cb5f82c1e40 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs @@ -160,7 +160,7 @@ public static implicit operator Xwt.Widget (Control d) return ((AbstractXwtControl)d).Widget; object nativeWidget; - if (Xwt.Toolkit.CurrentEngine.Type == Xwt.ToolkitType.Gtk && (nativeWidget = d?.GetNativeWidget ()) != null) { + if (Xwt.Toolkit.CurrentEngine.Type == Xwt.ToolkitType.Gtk3 && (nativeWidget = d?.GetNativeWidget ()) != null) { return Xwt.Toolkit.CurrentEngine.WrapWidget (nativeWidget, Xwt.NativeWidgetSizing.DefaultPreferredSize); } #if MAC diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs index e1d08c2c356..d2f73ccc920 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs @@ -44,7 +44,7 @@ public static class GtkUtil internal static Xwt.Toolkit GtkToolkit { get { if (gtkToolkit == null) - gtkToolkit = Xwt.Toolkit.LoadedToolkits.FirstOrDefault (t => t.Type == Xwt.ToolkitType.Gtk); + gtkToolkit = Xwt.Toolkit.LoadedToolkits.FirstOrDefault (t => t.Type == Xwt.ToolkitType.Gtk3); return gtkToolkit; } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs index 1ae5ab73c85..8859bb5c392 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs @@ -910,6 +910,7 @@ public static void UpdateNativeShadow (Gtk.Window window) // per-instance delegates. public static void FixContainerLeak (Gtk.Container c) { +return; if (containerLeakFixed) { return; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipPopoverWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipPopoverWindow.cs index dfa4390f5d1..319af574003 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipPopoverWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipPopoverWindow.cs @@ -43,7 +43,7 @@ public class TooltipPopoverWindow: XwtThemedPopup static TooltipPopoverWindow () { - preferredEngine = Platform.IsWindows? Toolkit.Load (ToolkitType.Gtk) : Toolkit.NativeEngine; + preferredEngine = Platform.IsWindows? Toolkit.Load (ToolkitType.Gtk3) : Toolkit.NativeEngine; } public static TooltipPopoverWindow Create (bool tryNative = true) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Window.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Window.cs index 0f96807a200..a67f602480b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Window.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Window.cs @@ -110,7 +110,7 @@ public static implicit operator Xwt.WindowFrame (Window d) return d.GetNativeWidget (); if (d.nativeWidget is Gtk.Window) - return Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk).WrapWindow ((Gtk.Window)d); + return Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk3).WrapWindow ((Gtk.Window)d); #if MAC if (d.nativeWidget is AppKit.NSWindow) return Xwt.Toolkit.Load (Xwt.ToolkitType.XamMac).WrapWindow ((AppKit.NSWindow)d); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/WindowTransparencyDecorator.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/WindowTransparencyDecorator.cs index d1d02ab9615..590093cd543 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/WindowTransparencyDecorator.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/WindowTransparencyDecorator.cs @@ -62,7 +62,7 @@ public static WindowTransparencyDecorator Attach (Gtk.Window window) public static WindowTransparencyDecorator Attach (Xwt.WindowFrame window) { //var gtkWindow = (Xwt.Toolkit.GetBackend (window) as Xwt.Backends.IWindowFrameBackend)?.Window as Gtk.Window; - var gtkWindow = Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk).GetNativeWindow (window) as Gtk.Window; + var gtkWindow = Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk3).GetNativeWindow (window) as Gtk.Window; if (gtkWindow != null) return new WindowTransparencyDecorator (gtkWindow); throw new NotSupportedException (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Xwt/XwtPopup.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Xwt/XwtPopup.cs index 3df66109024..121257b40a9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Xwt/XwtPopup.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Xwt/XwtPopup.cs @@ -188,7 +188,7 @@ void ShowPopup (Gtk.Widget parent, Gdk.EventButton evt, Gdk.Rectangle targetRect Gtk.Window parentWindow = parent.Toplevel as Gtk.Window; if (parentWindow != null) try { - TransientFor = Toolkit.Load (ToolkitType.Gtk).WrapWindow (parentWindow); + TransientFor = Toolkit.Load (ToolkitType.Gtk3).WrapWindow (parentWindow); } catch { if (MessageDialog.RootWindow != null) TransientFor = MessageDialog.RootWindow; @@ -243,7 +243,7 @@ static Point TranslateCoordinates (Xwt.Toolkit sourceToolkit, Xwt.Toolkit target static Toolkit GetToolkitForWidget (object nativeWidget) { if (nativeWidget is Gtk.Widget) - return Toolkit.Load (ToolkitType.Gtk); + return Toolkit.Load (ToolkitType.Gtk3); #if MAC if (nativeWidget is AppKit.NSView) return Toolkit.Load (ToolkitType.XamMac); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/XwtWindowControl.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/XwtWindowControl.cs index 2e8a8416a5f..4741a4f2c2f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/XwtWindowControl.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/XwtWindowControl.cs @@ -48,7 +48,7 @@ public static implicit operator AppKit.NSWindow (XwtWindowControl d) public static implicit operator Gtk.Window (XwtWindowControl d) { - return Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk).GetNativeWindow (d.Window) as Gtk.Window; + return Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk3).GetNativeWindow (d.Window) as Gtk.Window; } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.BuildOutputView/BuildOutputWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.BuildOutputView/BuildOutputWidget.cs index 513d2f96b17..dabb06cae68 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.BuildOutputView/BuildOutputWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.BuildOutputView/BuildOutputWidget.cs @@ -140,7 +140,7 @@ void Initialize (DocumentToolbar toolbar) // FIXME: DocumentToolbar does not support native widgets // Toolbar items must use Gtk, for now - Xwt.Toolkit.Load (ToolkitType.Gtk).Invoke (() => { + Xwt.Toolkit.Load (ToolkitType.Gtk3).Invoke (() => { showDiagnosticsButton = new CheckBox (GettextCatalog.GetString ("Diagnostic log verbosity")); showDiagnosticsButton.HeightRequest = 17; showDiagnosticsButton.Accessible.Identifier = "BuildOutputWidget.ShowDiagnosticsButton"; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs index eb2142d770a..e6d09cbc114 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs @@ -183,7 +183,7 @@ public virtual void ShowTooltipWindow (TextEditor editor, Window tipWindow, Tool y = geometry.Top; xwtWindow.Location = new Xwt.Point(x, y); - var gtkWindow = Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk).GetNativeWindow (xwtWindow) as Gtk.Window; + var gtkWindow = Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk3).GetNativeWindow (xwtWindow) as Gtk.Window; if (gtkWindow != null) gtkWindow.ShowAll (); else diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Wizard/WizardDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Wizard/WizardDialog.cs index d83a62bb537..672c0d5bac8 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Wizard/WizardDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Wizard/WizardDialog.cs @@ -222,7 +222,7 @@ public WizardDialog (IWizardDialogController controller) Dialog.Content = container; - if (Toolkit.CurrentEngine.Type == ToolkitType.Gtk) { + if (Toolkit.CurrentEngine.Type == ToolkitType.Gtk3) { var nativeNext = nextButton.Surface.NativeWidget as Gtk.Button; nativeNext.CanDefault = true; nativeNext.GrabDefault (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs index 0d494f2f590..0767b488500 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs @@ -355,7 +355,7 @@ internal static void LoadStyle () // BaseSelectionBackgroundColor = defaultStyle.Base (Gtk.StateType.Selected).ToXwtColor (); // BaseSelectionTextColor = defaultStyle.Text (Gtk.StateType.Selected).ToXwtColor (); - LinkForegroundColor = ((Gdk.Color)styledWidget.StyleGetProperty ("link-color")).ToXwtColor (); + LinkForegroundColor = Colors.Blue;//((Gdk.Color)styledWidget.StyleGetProperty ("link-color")).ToXwtColor (); if (LinkForegroundColor == Colors.Black) // the style returs black when not initialized LinkForegroundColor = Colors.Blue; // set the link color to generic blue until initialization is finished diff --git a/main/tests/IdeUnitTests/IdeTestBase.cs b/main/tests/IdeUnitTests/IdeTestBase.cs index 4e441b985db..799c10b880e 100644 --- a/main/tests/IdeUnitTests/IdeTestBase.cs +++ b/main/tests/IdeUnitTests/IdeTestBase.cs @@ -33,7 +33,7 @@ protected override void InternalSetup(string rootDir) { base.InternalSetup(rootDir); - Xwt.Application.Initialize(Xwt.ToolkitType.Gtk); + Xwt.Application.Initialize(Xwt.ToolkitType.Gtk3); Gtk.Application.Init(); DesktopService.Initialize(); } From feb07e0f2b23262b1f948bde5fc9bcaff6a1b2c4 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 26 Jul 2018 20:37:44 -0400 Subject: [PATCH 011/382] Retrieve version number in a non-weird way --- .../MonoDevelop.Ide/IdeVersionInfo.cs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeVersionInfo.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeVersionInfo.cs index 7125638f14f..1b80bcd26b3 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeVersionInfo.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeVersionInfo.cs @@ -51,24 +51,7 @@ static string GetMonoVersionNumber () public static string GetGtkVersion () { - uint v1 = 2, v2 = 0, v3 = 0; - - while (v1 < 99 && Gtk.Global.CheckVersion (v1, v2, v3) == null) - v1++; - v1--; - - while (v2 < 99 && Gtk.Global.CheckVersion (v1, v2, v3) == null) - v2++; - v2--; - - v3 = 0; - while (v3 < 99 && Gtk.Global.CheckVersion (v1, v2, v3) == null) - v3++; - v3--; - - if (v1 == 99 || v2 == 99 || v3 == 99) - return "unknown"; - return v1 +"." + v2 + "."+ v3; + return Gtk.Global.MajorVersion + "." + Gtk.Global.MinorVersion + "." + Gtk.Global.MicroVersion; } static string GetGtkTheme () From d7a532b1625296485bfa17e9b083c58f7f35c7cf Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 26 Jul 2018 20:48:46 -0400 Subject: [PATCH 012/382] Work around lack of font loading, due to style service stubs --- main/src/addins/GnomePlatform/GnomePlatform.cs | 10 ++++++++++ .../MonoDevelop.Ide.Fonts/FontService.cs | 12 ++++++++++-- .../MonoDevelop.Ide/DesktopService.cs | 5 +++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/main/src/addins/GnomePlatform/GnomePlatform.cs b/main/src/addins/GnomePlatform/GnomePlatform.cs index 6f1abf8d73a..fa52aa921a7 100644 --- a/main/src/addins/GnomePlatform/GnomePlatform.cs +++ b/main/src/addins/GnomePlatform/GnomePlatform.cs @@ -97,6 +97,16 @@ public override string DefaultMonospaceFont { } } } + + public override string DefaultSansFont { + get { + try { + return (string)(Gio.GetGSettingsString ("org.gnome.desktop.interface", "document-font-name")); + } catch (Exception) { + return "Sans 11"; + } + } + } public override string Name { get { return "Gnome"; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs index 815c4360c59..6179a607029 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs @@ -40,7 +40,9 @@ public static class FontService static Properties fontProperties; static string defaultMonospaceFontName = String.Empty; + static string defaultSansFontName = String.Empty; static FontDescription defaultMonospaceFont = new FontDescription (); + static FontDescription defaultSansFont = new FontDescription (); static void LoadDefaults () { @@ -48,9 +50,15 @@ static void LoadDefaults () defaultMonospaceFont.Dispose (); } + if (defaultSansFont != null) { + defaultSansFont.Dispose (); + } + #pragma warning disable 618 defaultMonospaceFontName = DesktopService.DefaultMonospaceFont; defaultMonospaceFont = FontDescription.FromString (defaultMonospaceFontName); + defaultSansFontName = DesktopService.DefaultSansFont; + defaultSansFont = FontDescription.FromString (defaultSansFontName); #pragma warning restore 618 } @@ -85,10 +93,10 @@ internal static void Initialize () } public static FontDescription MonospaceFont { get { return defaultMonospaceFont; } } - public static FontDescription SansFont { get { return Gui.Styles.DefaultFont; } } + public static FontDescription SansFont { get { return defaultSansFont; } } public static string MonospaceFontName { get { return defaultMonospaceFontName; } } - public static string SansFontName { get { return Gui.Styles.DefaultFontName; } } + public static string SansFontName { get { return defaultSansFontName; } } [Obsolete ("Use MonospaceFont")] public static FontDescription DefaultMonospaceFontDescription { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs index 69756e0c1be..493cb33634f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs @@ -113,6 +113,11 @@ public static string DefaultMonospaceFont { get { return PlatformService.DefaultMonospaceFont; } } + [Obsolete ("Use FontService")] + public static string DefaultSansFont { + get { return PlatformService.DefaultSansFont; } + } + public static string PlatformName { get { return PlatformService.Name; } } From e5ae6e7dc0a990b9a2cc06af0721d243bef135a6 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 26 Jul 2018 21:19:48 -0400 Subject: [PATCH 013/382] Get something displaying!!! --- .../CustomSoftDebuggerEngine.cs | 4 +- .../MonoDevelop.Debugger.Soft.csproj | 23 +- ...oDevelop.Debugger.AttachToProcessDialog.cs | 8 +- ...onoDevelop.Debugger.BusyEvaluatorDialog.cs | 4 +- ...Develop.Debugger.DebugApplicationDialog.cs | 4 +- ...elop.Debugger.ExpressionEvaluatorDialog.cs | 4 +- ....Debugger.Viewers.ValueVisualizerDialog.cs | 4 +- .../PreviewVisualizerWindow.cs | 4 +- .../MonoDevelop.Debugger.csproj | 26 +- .../ExceptionCaughtDialog.cs | 117 ++--- .../ObjectValueTreeView.cs | 140 +++--- .../MonoDevelop.Debugger/StackTracePad.cs | 18 +- .../ToolboxWidget.cs | 433 +++++++++--------- .../POEditorWidget.cs | 4 +- .../Gui/CodeSegmentPreviewWindow.cs | 64 +-- .../Mono.TextEditor/Gui/TextArea.cs | 2 +- .../HighlightingPanel.cs | 2 +- .../HoverCloseButton.cs | 20 +- .../OverlayMessageWindow.cs | 45 +- .../SourceEditorWidget.cs | 10 +- .../Xml/Editor/BaseXmlEditorExtension.cs | 2 +- .../Xml/Editor/XmlSchemasPanelWidget.cs | 12 +- main/src/addins/Xml/MonoDevelop.Xml.csproj | 23 +- 23 files changed, 508 insertions(+), 465 deletions(-) diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs index bafd6278f61..c8639b5701f 100644 --- a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs +++ b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs @@ -216,7 +216,7 @@ public DebuggerOptionsDialog () : base ( var table = new Gtk.Table (5, 2, false); table.BorderWidth = 6; - VBox.PackStart (table, true, true, 0); + ContentArea.PackStart (table, true, true, 0); table.Attach (new Gtk.Label ("Command:") { Xalign = 0 }, 0, 1, 0, 1); table.Attach (new Gtk.Label ("Arguments:") { Xalign = 0 }, 0, 1, 1, 2); @@ -290,7 +290,7 @@ public DebuggerOptionsDialog () : base ( CheckValid (); - VBox.ShowAll (); + ContentArea.ShowAll (); } int? ParsePort (string port) diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj index 8b6ba5c56c5..aee755216b0 100644 --- a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj +++ b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj @@ -12,11 +12,21 @@ - - - - - + + gtk-sharp-3.0 + + + glib-sharp-3.0 + + + gdk-sharp-3.0 + + + gtk-sharp-3.0 + + + gtk-sharp-3.0 + ..\..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.dll False @@ -33,6 +43,9 @@ ..\..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.Rocks.dll False + + gio-sharp-3.0 + diff --git a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.AttachToProcessDialog.cs b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.AttachToProcessDialog.cs index 2223b616666..d53583a10e1 100644 --- a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.AttachToProcessDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.AttachToProcessDialog.cs @@ -12,7 +12,7 @@ public partial class AttachToProcessDialog private global::Gtk.TreeView tree; private global::Gtk.HBox hbox2; private global::Gtk.Label label2; - private global::Gtk.ComboBox comboDebs; + private global::Gtk.ComboBoxText comboDebs; private global::Gtk.Button buttonCancel; private global::Gtk.Button buttonOk; @@ -25,7 +25,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(3)); // Internal child MonoDevelop.Debugger.AttachToProcessDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -87,7 +87,7 @@ protected virtual void Build () w7.Expand = false; w7.Fill = false; // Container child hbox2.Gtk.Box+BoxChild - this.comboDebs = global::Gtk.ComboBox.NewText (); + this.comboDebs = new global::Gtk.ComboBoxText (); this.comboDebs.Name = "comboDebs"; this.hbox2.Add (this.comboDebs); global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.comboDebs])); @@ -103,7 +103,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w10.Position = 0; // Internal child MonoDevelop.Debugger.AttachToProcessDialog.ActionArea - global::Gtk.HButtonBox w11 = this.ActionArea; + global::Gtk.HButtonBox w11 = (Gtk.HButtonBox)this.ActionArea; w11.Name = "dialog1_ActionArea"; w11.Spacing = 6; w11.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.BusyEvaluatorDialog.cs b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.BusyEvaluatorDialog.cs index c9d8a12e761..ea425a263f1 100644 --- a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.BusyEvaluatorDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.BusyEvaluatorDialog.cs @@ -18,7 +18,7 @@ protected virtual void Build() this.Title = global::Mono.Unix.Catalog.GetString("The Debugger is Busy"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Debugger.BusyEvaluatorDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -40,7 +40,7 @@ protected virtual void Build() global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(w1[this.vbox2])); w3.Position = 0; // Internal child MonoDevelop.Debugger.BusyEvaluatorDialog.ActionArea - global::Gtk.HButtonBox w4 = this.ActionArea; + global::Gtk.HButtonBox w4 = (Gtk.HButtonBox)this.ActionArea; w4.Name = "dialog1_ActionArea"; w4.Spacing = 10; w4.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.DebugApplicationDialog.cs b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.DebugApplicationDialog.cs index 7eee0e3f583..5f6d2bedb8a 100644 --- a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.DebugApplicationDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.DebugApplicationDialog.cs @@ -36,7 +36,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Debug Application"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Debugger.DebugApplicationDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -141,7 +141,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5])); w11.Position = 0; // Internal child MonoDevelop.Debugger.DebugApplicationDialog.ActionArea - global::Gtk.HButtonBox w12 = this.ActionArea; + global::Gtk.HButtonBox w12 = (Gtk.HButtonBox)this.ActionArea; w12.Name = "dialog1_ActionArea"; w12.Spacing = 10; w12.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs index 38404d7c741..272bac9bef6 100644 --- a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs @@ -20,7 +20,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Expression Evaluator"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Debugger.ExpressionEvaluatorDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -82,7 +82,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w7.Position = 0; // Internal child MonoDevelop.Debugger.ExpressionEvaluatorDialog.ActionArea - global::Gtk.HButtonBox w8 = this.ActionArea; + global::Gtk.HButtonBox w8 = (Gtk.HButtonBox)this.ActionArea; w8.Name = "dialog1_ActionArea"; w8.Spacing = 6; w8.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.Viewers.ValueVisualizerDialog.cs b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.Viewers.ValueVisualizerDialog.cs index d328add073b..c71ae9855d2 100644 --- a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.Viewers.ValueVisualizerDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.Viewers.ValueVisualizerDialog.cs @@ -22,7 +22,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Value Visualizer"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Debugger.Viewers.ValueVisualizerDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -52,7 +52,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.mainBox])); w4.Position = 0; // Internal child MonoDevelop.Debugger.Viewers.ValueVisualizerDialog.ActionArea - global::Gtk.HButtonBox w5 = this.ActionArea; + global::Gtk.HButtonBox w5 = (Gtk.HButtonBox)this.ActionArea; w5.Name = "dialog1_ActionArea"; w5.Spacing = 10; w5.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs index 380f94226f4..140fc315891 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs @@ -91,7 +91,7 @@ public PreviewVisualizerWindow (ObjectValue val, Gtk.Widget invokingWidget) : ba } else { headerTable.Attach (new Label (), 2, 3, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill | AttachOptions.Expand, 10, 0); } - mainBox.PackStart (headerTable); + mainBox.PackStart (headerTable, false, true, 0); mainBox.ShowAll (); var previewVisualizer = DebuggingService.GetPreviewVisualizer (val); @@ -109,7 +109,7 @@ public PreviewVisualizerWindow (ObjectValue val, Gtk.Widget invokingWidget) : ba alignment.SetPadding (3, 5, 5, 5); alignment.Show (); alignment.Add (widget); - mainBox.PackStart (alignment); + mainBox.PackStart (alignment, false, true, 0); ContentBox.Add (mainBox); } diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj index aed5919b873..a75ba456d8b 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj @@ -14,13 +14,23 @@ - - - - + + glib-sharp-3.0 + + + gtk-sharp-3.0 + + + gtk-sharp-3.0 + + + gdk-sharp-3.0 + - + + gtk-sharp-3.0 + @@ -48,6 +58,12 @@ ..\..\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll False + + gio-sharp-3.0 + + + gtk-sharp-3.0 + diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs index 062badd3838..ca51f5e859c 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs @@ -146,7 +146,7 @@ Widget CreateExceptionHeader () var frame = new Frame (); frame.Add (hBox); frame.BorderWidth = (uint)(Platform.IsWindows ? 5 : 10); // on Windows we need to have smaller border due to ExceptionTypeLabel vertical misalignment - frame.Shadow = ShadowType.None; +// frame.Shadow = ShadowType.None; frame.ShadowType = ShadowType.None; eventBox.Add (frame); @@ -206,11 +206,12 @@ public ExpanderWithMinSize (string label) : base (label) { } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredHeight (out int minimum_height, out int natural_height) { - base.OnSizeRequested (ref requisition); - requisition.Height = 28; + base.OnGetPreferredHeight (out minimum_height, out natural_height); + minimum_height = natural_height = 28; } + } Expander WrapInExpander (string title, Widget widget) @@ -244,21 +245,21 @@ void Expander_Activated (object sender, EventArgs e) paned.Position = paned.MinPosition; } - static void StackFrameLayout (CellLayout layout, CellRenderer cr, ITreeModel model, TreeIter iter) - { - var frame = (ExceptionStackFrame)model.GetValue (iter, (int)ModelColumn.StackFrame); - var renderer = (StackFrameCellRenderer)cr; - - renderer.Markup = (string)model.GetValue (iter, (int)ModelColumn.Markup); - renderer.Frame = frame; - - if (frame == null) { - renderer.IsUserCode = false; - return; - } - - renderer.IsUserCode = (bool)model.GetValue (iter, (int)ModelColumn.IsUserCode); - } +// static void StackFrameLayout (CellLayout layout, CellRenderer cr, ITreeModel model, TreeIter iter) +// { +// var frame = (ExceptionStackFrame)model.GetValue (iter, (int)ModelColumn.StackFrame); +// var renderer = (StackFrameCellRenderer)cr; +// +// renderer.Markup = (string)model.GetValue (iter, (int)ModelColumn.Markup); +// renderer.Frame = frame; +// +// if (frame == null) { +// renderer.IsUserCode = false; +// return; +// } +// +// renderer.IsUserCode = (bool)model.GetValue (iter, (int)ModelColumn.IsUserCode); +// } Widget CreateStackTraceTreeView () { @@ -273,7 +274,7 @@ Widget CreateStackTraceTreeView () var renderer = new StackFrameCellRenderer (StackTraceTreeView.PangoContext); - StackTraceTreeView.AppendColumn ("", renderer, (CellLayoutDataFunc)StackFrameLayout); +// StackTraceTreeView.AppendColumn ("", renderer, (CellLayoutDataFunc)StackFrameLayout); StackTraceTreeView.RowActivated += StackFrameActivated; @@ -793,43 +794,43 @@ string GetFileMarkup (bool selected) return markup; } - public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - using (var layout = new Pango.Layout (Context)) { - Pango.Rectangle ink, logical; - layout.FontDescription = font; - layout.SetMarkup (GetMethodMarkup (false)); - layout.GetPixelExtents (out ink, out logical); - - height = logical.Height; - width = 0; - x_offset = 0; - y_offset = 0; - } - } +// public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) +// { +// using (var layout = new Pango.Layout (Context)) { +// Pango.Rectangle ink, logical; +// layout.FontDescription = font; +// layout.SetMarkup (GetMethodMarkup (false)); +// layout.GetPixelExtents (out ink, out logical); +// +// height = logical.Height; +// width = 0; +// x_offset = 0; +// y_offset = 0; +// } +// } - protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - { - using (var cr = Gdk.CairoHelper.Create (window)) { - Pango.Rectangle ink, logical; - using (var layout = new Pango.Layout (Context)) { - layout.FontDescription = font; - layout.SetMarkup (GetFileMarkup ((flags & CellRendererState.Selected) != 0)); - layout.GetPixelExtents (out ink, out logical); - var width = widget.Allocation.Width; - cr.Translate (width - logical.Width - 10, cell_area.Y); - cr.ShowLayout (layout); - - cr.IdentityMatrix (); - - layout.SetMarkup (GetMethodMarkup ((flags & CellRendererState.Selected) != 0)); - layout.Width = (int)((width - logical.Width - 35) * Pango.Scale.PangoScale); - layout.Ellipsize = Pango.EllipsizeMode.Middle; - cr.Translate (cell_area.X + 10, cell_area.Y); - cr.ShowLayout (layout); - } - } - } +// protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) +// { +// using (var cr = Gdk.CairoHelper.Create (window)) { +// Pango.Rectangle ink, logical; +// using (var layout = new Pango.Layout (Context)) { +// layout.FontDescription = font; +// layout.SetMarkup (GetFileMarkup ((flags & CellRendererState.Selected) != 0)); +// layout.GetPixelExtents (out ink, out logical); +// var width = widget.Allocation.Width; +// cr.Translate (width - logical.Width - 10, cell_area.Y); +// cr.ShowLayout (layout); +// +// cr.IdentityMatrix (); +// +// layout.SetMarkup (GetMethodMarkup ((flags & CellRendererState.Selected) != 0)); +// layout.Width = (int)((width - logical.Width - 35) * Pango.Scale.PangoScale); +// layout.Ellipsize = Pango.EllipsizeMode.Middle; +// cr.Translate (cell_area.X + 10, cell_area.Y); +// cr.ShowLayout (layout); +// } +// } +// } } class ExceptionCaughtMessage : IDisposable @@ -985,7 +986,7 @@ public override Control CreateWidget () CanFocus = false, Name = "exceptionTypeLabel" }; - vb.PackStart (typeLabel); + vb.PackStart (typeLabel, false, true, 0); messageLabel = new Label { Xalign = 0, NoShowAll = true, @@ -993,7 +994,7 @@ public override Control CreateWidget () CanFocus = false, Name = "exceptionMessageLabel" }; - vb.PackStart (messageLabel); + vb.PackStart (messageLabel, false, true, 0); var detailsBtn = new Xwt.LinkLabel (GettextCatalog.GetString ("Show Details")); var hh = new HBox (); diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs index 558c9b4fc41..307e5eb6e61 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs @@ -152,31 +152,31 @@ Xwt.Drawing.Image img { } } - public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - if (!icon.IsNull) - width += (int)(Xpad * 2 + img.Width); - } - - protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - { - base.Render (window, widget, background_area, cell_area, expose_area, flags); - if (!icon.IsNull) { - using (var ctx = Gdk.CairoHelper.Create (window)) { - using (var layout = new Pango.Layout (widget.PangoContext)) { - layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); - layout.FontDescription.Family = Family; - layout.SetText (Text); - int w, h; - layout.GetPixelSize (out w, out h); - var x = cell_area.X + w + 3 * Xpad; - var y = cell_area.Y + cell_area.Height / 2 - (int)(img.Height / 2); - ctx.DrawImage (widget, img, x, y); - } - } - } - } +// public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) +// { +// base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); +// if (!icon.IsNull) +// width += (int)(Xpad * 2 + img.Width); +// } + +// protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) +// { +// base.Render (window, widget, background_area, cell_area, expose_area, flags); +// if (!icon.IsNull) { +// using (var ctx = Gdk.CairoHelper.Create (window)) { +// using (var layout = new Pango.Layout (widget.PangoContext)) { +// layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); +// layout.FontDescription.Family = Family; +// layout.SetText (Text); +// int w, h; +// layout.GetPixelSize (out w, out h); +// var x = cell_area.X + w + 3 * Xpad; +// var y = cell_area.Y + cell_area.Height / 2 - (int)(img.Height / 2); +// ctx.DrawImage (widget, img, x, y); +// } +// } +// } +// } } class ValueCellRenderer : CellRendererText @@ -410,7 +410,7 @@ public ObjectValueTreeView () createMsg = GettextCatalog.GetString ("Click here to add a new watch"); CompletionWindowManager.WindowClosed += HandleCompletionWindowClosed; PreviewWindowManager.WindowClosed += HandlePreviewWindowClosed; - ScrollAdjustmentsSet += HandleScrollAdjustmentsSet; +// ScrollAdjustmentsSet += HandleScrollAdjustmentsSet; expanderSize = (int)this.StyleGetProperty ("expander-size") + 4;//+4 is hardcoded in gtk.c code @@ -454,15 +454,15 @@ int GetMaxWidth (TreeViewColumn column, TreeIter iter) column.CellSetCellData (Model, iter, false, false); var area = new Gdk.Rectangle (0, 0, 1000, 1000); bool firstCell = true; - foreach (var cellRenderer in column.CellRenderers) { - if (!cellRenderer.Visible) - continue; - if (!firstCell && columnWidth > 0) - columnWidth += column.Spacing; - cellRenderer.GetSize (this, ref area, out x, out y, out w, out h); - columnWidth += w + focus_line_width; - firstCell = false; - } +// foreach (var cellRenderer in column.CellRenderers) { +// if (!cellRenderer.Visible) +// continue; +// if (!firstCell && columnWidth > 0) +// columnWidth += column.Spacing; +// cellRenderer.GetSize (this, ref area, out x, out y, out w, out h); +// columnWidth += w + focus_line_width; +// firstCell = false; +// } if (ExpanderColumn == column) { columnWidth += horizontal_separator + (path.Depth - 1) * LevelIndentation; if (ShowExpanders) @@ -511,17 +511,17 @@ void HandleSelectionChanged (object sender, EventArgs e) Adjustment oldHadjustment; Adjustment oldVadjustment; //Don't convert this event handler to override OnSetScrollAdjustments as it causes problems - void HandleScrollAdjustmentsSet (object o, ScrollAdjustmentsSetArgs args) - { - if (oldHadjustment != null) { - oldHadjustment.ValueChanged -= UpdatePreviewPosition; - oldVadjustment.ValueChanged -= UpdatePreviewPosition; - } - oldHadjustment = Hadjustment; - oldVadjustment = Vadjustment; - oldHadjustment.ValueChanged += UpdatePreviewPosition; - oldVadjustment.ValueChanged += UpdatePreviewPosition; - } +// void HandleScrollAdjustmentsSet (object o, ScrollAdjustmentsSetArgs args) +// { +// if (oldHadjustment != null) { +// oldHadjustment.ValueChanged -= UpdatePreviewPosition; +// oldVadjustment.ValueChanged -= UpdatePreviewPosition; +// } +// oldHadjustment = Hadjustment; +// oldVadjustment = Vadjustment; +// oldHadjustment.ValueChanged += UpdatePreviewPosition; +// oldVadjustment.ValueChanged += UpdatePreviewPosition; +// } void UpdatePreviewPosition (object sender, EventArgs e) { @@ -577,7 +577,7 @@ protected override void OnDestroyed () valueCol.RemoveNotification ("width", OnColumnWidthChanged); expCol.RemoveNotification ("width", OnColumnWidthChanged); - ScrollAdjustmentsSet -= HandleScrollAdjustmentsSet; +// ScrollAdjustmentsSet -= HandleScrollAdjustmentsSet; if (oldHadjustment != null) { oldHadjustment.ValueChanged -= UpdatePreviewPosition; oldVadjustment.ValueChanged -= UpdatePreviewPosition; @@ -2057,7 +2057,7 @@ protected void OnCopy () return; if (selected.Length == 1) { - var editable = IdeApp.Workbench.RootWindow.Focus as Editable; + var editable = IdeApp.Workbench.RootWindow.Focus as IEditable; if (editable != null) { editable.CopyClipboard (); @@ -2198,28 +2198,28 @@ bool GetCellAtPos (int x, int y, out TreePath path, out TreeViewColumn col, out if (GetPathAtPos (x, y, out path, out col)) { var cellArea = GetCellArea (path, col); x -= cellArea.X; - foreach (CellRenderer cr in col.CellRenderers) { - int xo, w; - col.CellGetPosition (cr, out xo, out w); - var visible = cr.Visible; - if (cr == crpViewer) { - if (store.GetIter (out var it, path)) { - visible = (bool)store.GetValue (it, ViewerButtonVisibleColumn); - } - } else if (cr == evaluateStatusCell) { - if (store.GetIter (out var it, path)) { - visible = (bool)store.GetValue (it, EvaluateStatusIconVisibleColumn); - } - } else if (cr == crpButton) { - if (store.GetIter (out var it, path)) { - visible = (bool)store.GetValue (it, ValueButtonVisibleColumn); - } - } - if (visible && x >= xo && x < xo + w) { - cellRenderer = cr; - return true; - } - } +// foreach (CellRenderer cr in col.CellRenderers) { +// int xo, w; +// col.CellGetPosition (cr, out xo, out w); +// var visible = cr.Visible; +// if (cr == crpViewer) { +// if (store.GetIter (out var it, path)) { +// visible = (bool)store.GetValue (it, ViewerButtonVisibleColumn); +// } +// } else if (cr == evaluateStatusCell) { +// if (store.GetIter (out var it, path)) { +// visible = (bool)store.GetValue (it, EvaluateStatusIconVisibleColumn); +// } +// } else if (cr == crpButton) { +// if (store.GetIter (out var it, path)) { +// visible = (bool)store.GetValue (it, ValueButtonVisibleColumn); +// } +// } +// if (visible && x >= xo && x < xo + w) { +// cellRenderer = cr; +// return true; +// } +// } } cellRenderer = null; return false; diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs index a79253759f0..7981d8d64c8 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs @@ -298,15 +298,15 @@ bool GetCellAtPos (int x, int y, out TreePath path, out TreeViewColumn col, out if (tree.GetPathAtPos (x, y, out path, out col, out cx, out cy)) { tree.GetCellArea (path, col); - foreach (CellRenderer cr in col.CellRenderers) { - int xo, w; - - col.CellGetPosition (cr, out xo, out w); - if (cr.Visible && cx >= xo && cx < xo + w) { - cellRenderer = cr; - return true; - } - } +// foreach (CellRenderer cr in col.CellRenderers) { +// int xo, w; +// +// col.CellGetPosition (cr, out xo, out w); +// if (cr.Visible && cx >= xo && cx < xo + w) { +// cellRenderer = cr; +// return true; +// } +// } } cellRenderer = null; diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs index df5ee91bdac..87eaa4c23ad 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs @@ -60,7 +60,7 @@ public bool IsListMode { set { listMode = value; this.QueueResize (); - this.ScrollToSelectedItem (); +// this.ScrollToSelectedItem (); } } @@ -81,7 +81,7 @@ public bool ShowCategories { set { showCategories = value; this.QueueResize (); - this.ScrollToSelectedItem (); +// this.ScrollToSelectedItem (); } } @@ -153,7 +153,7 @@ public ToolboxWidget () handCursor = new Cursor (CursorType.Hand1); var actionHandler = new ActionDelegate (this); - actionHandler.PerformShowMenu += PerformShowMenu; +// actionHandler.PerformShowMenu += PerformShowMenu; } protected override void OnStyleSet (Gtk.Style previous_style) @@ -182,7 +182,7 @@ protected override void OnStyleSet (Gtk.Style previous_style) protected override void OnDestroyed () { - HideTooltipWindow (); +// HideTooltipWindow (); if (this.layout != null) { this.layout.Dispose (); this.layout = null; @@ -332,11 +332,11 @@ void ProcessExpandAnimation (Cairo.Context cr, Category lastCategory, int lastCa int newypos = lastCategory.IsExpanded ? lastCategoryYpos + lastCategory.AnimationHeight : ypos + lastCategory.AnimationHeight; if (newypos < lastCategoryYpos) { newypos = lastCategoryYpos; - StopExpandAnimation (lastCategory); +// StopExpandAnimation (lastCategory); } if (newypos > ypos) { newypos = ypos; - StopExpandAnimation (lastCategory); +// StopExpandAnimation (lastCategory); } // Clear the area where the category will be drawn since it will be @@ -348,158 +348,158 @@ void ProcessExpandAnimation (Cairo.Context cr, Category lastCategory, int lastCa } } - protected override bool OnKeyPressEvent (Gdk.EventKey evnt) - { - Item nextItem; - - // Handle keyboard toolip popup - if ((evnt.Key == Gdk.Key.F1 && (evnt.State & Gdk.ModifierType.ControlMask) == Gdk.ModifierType.ControlMask)) { - if (this.SelectedItem != null) { - int vadjustment = (this.vAdjustement != null ? (int)this.vAdjustement.Value : 0); - Gdk.Rectangle rect = GetItemExtends (SelectedItem); - ShowTooltip (SelectedItem, 0,rect.X, rect.Bottom - vadjustment ); - } - return true; - } - - switch (evnt.Key) { - case Gdk.Key.KP_Enter: - case Gdk.Key.Return: - if (this.SelectedItem != null) - this.OnActivateSelectedItem (EventArgs.Empty); - return true; - case Gdk.Key.KP_Up: - case Gdk.Key.Up: - if (this.listMode || this.SelectedItem is Category) { - this.SelectedItem = GetPrevItem (this.SelectedItem); - } else { - nextItem = GetItemAbove (this.SelectedItem); - this.SelectedItem = nextItem != this.SelectedItem ? nextItem : GetCategory (this.SelectedItem); - } - this.QueueDraw (); - return true; - case Gdk.Key.KP_Down: - case Gdk.Key.Down: - if (this.listMode || this.SelectedItem is Category) { - this.SelectedItem = GetNextItem (this.SelectedItem); - } else { - nextItem = GetItemBelow (this.SelectedItem); - if (nextItem == this.SelectedItem) { - Category category = GetCategory (this.SelectedItem); - nextItem = GetNextCategory (category); - if (nextItem == category) - nextItem = this.SelectedItem; - } - this.SelectedItem = nextItem; - } - this.QueueDraw (); - return true; - - case Gdk.Key.KP_Left: - case Gdk.Key.Left: - if (this.SelectedItem is Category) { - SetCategoryExpanded ((Category)this.SelectedItem, false); - } else { - if (this.listMode) { - this.SelectedItem = GetCategory (this.SelectedItem); - } else { - this.SelectedItem = GetItemLeft (this.SelectedItem); - } - } - this.QueueDraw (); - return true; - - case Gdk.Key.KP_Right: - case Gdk.Key.Right: - if (this.SelectedItem is Category) { - Category selectedCategory = ((Category)this.SelectedItem); - if (selectedCategory.IsExpanded) { - if (selectedCategory.ItemCount > 0) - this.SelectedItem = selectedCategory.Items[0]; - } else { - SetCategoryExpanded (selectedCategory, true); - } - } else { - if (this.listMode) { - // nothing - } else { - this.SelectedItem = GetItemRight (this.SelectedItem); - } - } - this.QueueDraw (); - return true; - - } - return false; - } +// protected override bool OnKeyPressEvent (Gdk.EventKey evnt) +// { +// Item nextItem; +// +// // Handle keyboard toolip popup +// if ((evnt.Key == Gdk.Key.F1 && (evnt.State & Gdk.ModifierType.ControlMask) == Gdk.ModifierType.ControlMask)) { +// if (this.SelectedItem != null) { +// int vadjustment = (this.vAdjustement != null ? (int)this.vAdjustement.Value : 0); +// Gdk.Rectangle rect = GetItemExtends (SelectedItem); +// ShowTooltip (SelectedItem, 0,rect.X, rect.Bottom - vadjustment ); +// } +// return true; +// } +// +// switch (evnt.Key) { +// case Gdk.Key.KP_Enter: +// case Gdk.Key.Return: +// if (this.SelectedItem != null) +// this.OnActivateSelectedItem (EventArgs.Empty); +// return true; +// case Gdk.Key.KP_Up: +// case Gdk.Key.Up: +// if (this.listMode || this.SelectedItem is Category) { +// this.SelectedItem = GetPrevItem (this.SelectedItem); +// } else { +// nextItem = GetItemAbove (this.SelectedItem); +// this.SelectedItem = nextItem != this.SelectedItem ? nextItem : GetCategory (this.SelectedItem); +// } +// this.QueueDraw (); +// return true; +// case Gdk.Key.KP_Down: +// case Gdk.Key.Down: +// if (this.listMode || this.SelectedItem is Category) { +// this.SelectedItem = GetNextItem (this.SelectedItem); +// } else { +// nextItem = GetItemBelow (this.SelectedItem); +// if (nextItem == this.SelectedItem) { +// Category category = GetCategory (this.SelectedItem); +// nextItem = GetNextCategory (category); +// if (nextItem == category) +// nextItem = this.SelectedItem; +// } +// this.SelectedItem = nextItem; +// } +// this.QueueDraw (); +// return true; +// +// case Gdk.Key.KP_Left: +// case Gdk.Key.Left: +// if (this.SelectedItem is Category) { +// SetCategoryExpanded ((Category)this.SelectedItem, false); +// } else { +// if (this.listMode) { +// this.SelectedItem = GetCategory (this.SelectedItem); +// } else { +// this.SelectedItem = GetItemLeft (this.SelectedItem); +// } +// } +// this.QueueDraw (); +// return true; +// +// case Gdk.Key.KP_Right: +// case Gdk.Key.Right: +// if (this.SelectedItem is Category) { +// Category selectedCategory = ((Category)this.SelectedItem); +// if (selectedCategory.IsExpanded) { +// if (selectedCategory.ItemCount > 0) +// this.SelectedItem = selectedCategory.Items[0]; +// } else { +// SetCategoryExpanded (selectedCategory, true); +// } +// } else { +// if (this.listMode) { +// // nothing +// } else { +// this.SelectedItem = GetItemRight (this.SelectedItem); +// } +// } +// this.QueueDraw (); +// return true; +// +// } +// return false; +// } - protected override void OnUnrealized () - { - HideTooltipWindow (); - base.OnUnrealized (); - } +// protected override void OnUnrealized () +// { +// HideTooltipWindow (); +// base.OnUnrealized (); +// } - protected override bool OnLeaveNotifyEvent (Gdk.EventCrossing evnt) - { - if (evnt.Mode == CrossingMode.Normal) { - HideTooltipWindow (); - ClearMouseOverItem (); - } - GdkWindow.Cursor = null; - return base.OnLeaveNotifyEvent (evnt); - } +// protected override bool OnLeaveNotifyEvent (Gdk.EventCrossing evnt) +// { +// if (evnt.Mode == CrossingMode.Normal) { +// HideTooltipWindow (); +// ClearMouseOverItem (); +// } +// GdkWindow.Cursor = null; +// return base.OnLeaveNotifyEvent (evnt); +// } - protected override bool OnScrollEvent (Gdk.EventScroll evnt) - { - HideTooltipWindow (); - ClearMouseOverItem (); - return base.OnScrollEvent (evnt); - } +// protected override bool OnScrollEvent (Gdk.EventScroll evnt) +// { +// HideTooltipWindow (); +// ClearMouseOverItem (); +// return base.OnScrollEvent (evnt); +// } public Action DoPopupMenu { get; set; } - protected override bool OnButtonPressEvent (Gdk.EventButton e) - { - this.GrabFocus (); - HideTooltipWindow (); - if (this.mouseOverItem is Category) { - if (!e.TriggersContextMenu () && e.Button == 1 && e.Type == EventType.ButtonPress) { - Category mouseOverCateogry = (Category)this.mouseOverItem; - SetCategoryExpanded (mouseOverCateogry, !mouseOverCateogry.IsExpanded); - return true; - } - this.SelectedItem = mouseOverItem; - this.QueueResize (); - } else { - this.SelectedItem = mouseOverItem; - this.QueueDraw (); - } - if (e.TriggersContextMenu ()) { - if (DoPopupMenu != null) { - DoPopupMenu (e); - return true; - } - } else if (e.Type == EventType.TwoButtonPress && this.SelectedItem != null) { - this.OnActivateSelectedItem (EventArgs.Empty); - return true; - } - return base.OnButtonPressEvent (e); - } +// protected override bool OnButtonPressEvent (Gdk.EventButton e) +// { +// this.GrabFocus (); +// HideTooltipWindow (); +// if (this.mouseOverItem is Category) { +// if (!e.TriggersContextMenu () && e.Button == 1 && e.Type == EventType.ButtonPress) { +// Category mouseOverCateogry = (Category)this.mouseOverItem; +// SetCategoryExpanded (mouseOverCateogry, !mouseOverCateogry.IsExpanded); +// return true; +// } +// this.SelectedItem = mouseOverItem; +// this.QueueResize (); +// } else { +// this.SelectedItem = mouseOverItem; +// this.QueueDraw (); +// } +// if (e.TriggersContextMenu ()) { +// if (DoPopupMenu != null) { +// DoPopupMenu (e); +// return true; +// } +// } else if (e.Type == EventType.TwoButtonPress && this.SelectedItem != null) { +// this.OnActivateSelectedItem (EventArgs.Empty); +// return true; +// } +// return base.OnButtonPressEvent (e); +// } - void PerformShowMenu (object sender, EventArgs args) - { - DoPopupMenu?.Invoke (null); - } +// void PerformShowMenu (object sender, EventArgs args) +// { +// DoPopupMenu?.Invoke (null); +// } void SetCategoryExpanded (Category cat, bool expanded) { if (cat.IsExpanded == expanded) return; cat.IsExpanded = expanded; - if (cat.IsExpanded) - StartExpandAnimation (cat); - else - StartCollapseAnimation (cat); +// if (cat.IsExpanded) +// StartExpandAnimation (cat); +// else +// StartCollapseAnimation (cat); } void StartExpandAnimation (Category cat) @@ -509,11 +509,11 @@ void StartExpandAnimation (Category cat) cat.AnimationHeight = 0; cat.AnimatingExpand = true; - cat.AnimationHandle = GLib.Timeout.Add (animationTimeSpan, delegate { - cat.AnimationHeight += animationStepSize; - QueueResize (); - return true; - }); +// cat.AnimationHandle = GLib.Timeout.Add (animationTimeSpan, delegate { +// cat.AnimationHeight += animationStepSize; +// QueueResize (); +// return true; +// }); } void StartCollapseAnimation (Category cat) @@ -523,11 +523,11 @@ void StartCollapseAnimation (Category cat) cat.AnimationHeight = 0; cat.AnimatingExpand = true; - cat.AnimationHandle = GLib.Timeout.Add (animationTimeSpan, delegate { - cat.AnimationHeight -= animationStepSize; - QueueResize (); - return true; - }); +// cat.AnimationHandle = GLib.Timeout.Add (animationTimeSpan, delegate { +// cat.AnimationHeight -= animationStepSize; +// QueueResize (); +// return true; +// }); } void StopExpandAnimation (Category cat) @@ -540,59 +540,60 @@ void StopExpandAnimation (Category cat) protected override bool OnPopupMenu () { - if (DoPopupMenu != null) { - DoPopupMenu (null); - return true; - } - return base.OnPopupMenu (); + // if (DoPopupMenu != null) { + // DoPopupMenu (null); + // return true; + // } + // return base.OnPopupMenu (); + return false; } - protected override bool OnMotionNotifyEvent (Gdk.EventMotion e) - { - int xpos = 0; - int ypos = 0; - HideTooltipWindow (); - var oldItem = mouseOverItem; - mouseOverItem = null; - Gdk.Rectangle newItemExtents = Gdk.Rectangle.Zero; - this.mouseX = (int)e.X + (int)(this.hAdjustement != null ? this.hAdjustement.Value : 0); - this.mouseY = (int)e.Y + (int)(this.vAdjustement != null ? this.vAdjustement.Value : 0); - Iterate (ref xpos, ref ypos, delegate (Category category, Gdk.Size itemDimension) { - if (xpos <= mouseX && mouseX <= xpos + itemDimension.Width && - ypos <= mouseY && mouseY <= ypos + itemDimension.Height) { - mouseOverItem = category; - GdkWindow.Cursor = handCursor; - if (!e.State.HasFlag (ModifierType.Button1Mask)) - ShowTooltip (mouseOverItem, TipTimer, (int)e.X + 2, (int)e.Y + 16); - newItemExtents = new Gdk.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); - return false; - } - return true; - }, delegate (Category curCategory, Item item, Gdk.Size itemDimension) { - if (xpos <= mouseX && mouseX <= xpos + itemDimension.Width && - ypos <= mouseY && mouseY <= ypos + itemDimension.Height) { - mouseOverItem = item; - GdkWindow.Cursor = null; - if (!e.State.HasFlag (ModifierType.Button1Mask)) - ShowTooltip (mouseOverItem, TipTimer, (int)e.X + 2, (int)e.Y + 16); - newItemExtents = new Gdk.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); - return false; - } - return true; - }); - - if (mouseOverItem == null) - GdkWindow.Cursor = null; - - if (oldItem != mouseOverItem) { - this.QueueDraw (); - var oldItemExtents = GetItemExtends (oldItem); - QueueDrawArea (oldItemExtents.X, oldItemExtents.Y, oldItemExtents.Width, oldItemExtents.Height); - QueueDrawArea (newItemExtents.X, newItemExtents.Y, newItemExtents.Width, newItemExtents.Height); - } - - return base.OnMotionNotifyEvent (e); - } +// protected override bool OnMotionNotifyEvent (Gdk.EventMotion e) +// { +// int xpos = 0; +// int ypos = 0; +// HideTooltipWindow (); +// var oldItem = mouseOverItem; +// mouseOverItem = null; +// Gdk.Rectangle newItemExtents = Gdk.Rectangle.Zero; +// this.mouseX = (int)e.X + (int)(this.hAdjustement != null ? this.hAdjustement.Value : 0); +// this.mouseY = (int)e.Y + (int)(this.vAdjustement != null ? this.vAdjustement.Value : 0); +// Iterate (ref xpos, ref ypos, delegate (Category category, Gdk.Size itemDimension) { +// if (xpos <= mouseX && mouseX <= xpos + itemDimension.Width && +// ypos <= mouseY && mouseY <= ypos + itemDimension.Height) { +// mouseOverItem = category; +// GdkWindow.Cursor = handCursor; +// if (!e.State.HasFlag (ModifierType.Button1Mask)) +// ShowTooltip (mouseOverItem, TipTimer, (int)e.X + 2, (int)e.Y + 16); +// newItemExtents = new Gdk.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); +// return false; +// } +// return true; +// }, delegate (Category curCategory, Item item, Gdk.Size itemDimension) { +// if (xpos <= mouseX && mouseX <= xpos + itemDimension.Width && +// ypos <= mouseY && mouseY <= ypos + itemDimension.Height) { +// mouseOverItem = item; +// GdkWindow.Cursor = null; +// if (!e.State.HasFlag (ModifierType.Button1Mask)) +// ShowTooltip (mouseOverItem, TipTimer, (int)e.X + 2, (int)e.Y + 16); +// newItemExtents = new Gdk.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); +// return false; +// } +// return true; +// }); +// +// if (mouseOverItem == null) +// GdkWindow.Cursor = null; +// +// if (oldItem != mouseOverItem) { +// this.QueueDraw (); +// var oldItemExtents = GetItemExtends (oldItem); +// QueueDrawArea (oldItemExtents.X, oldItemExtents.Y, oldItemExtents.Width, oldItemExtents.Height); +// QueueDrawArea (newItemExtents.X, newItemExtents.Y, newItemExtents.Width, newItemExtents.Height); +// } +// +// return base.OnMotionNotifyEvent (e); +// } #region Item selection logic Item selectedItem = null; @@ -930,16 +931,16 @@ void Iterate (ref int xpos, ref int ypos, CategoryAction catAction, ItemAction a // } // } - protected override void OnSizeAllocated (Gdk.Rectangle allocation) - { - base.OnSizeAllocated (allocation); - if (!realSizeRequest) { - realSizeRequest = true; - QueueResize (); - } - else - realSizeRequest = false; - } +// protected override void OnSizeAllocated (Gdk.Rectangle allocation) +// { +// base.OnSizeAllocated (allocation); +// if (!realSizeRequest) { +// realSizeRequest = true; +// QueueResize (); +// } +// else +// realSizeRequest = false; +// } #endregion diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs index c0488d2e588..5d2a9dd4eeb 100644 --- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs +++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs @@ -375,7 +375,7 @@ public Menu CreateOptionsMenu () Menu sub = new Menu (); searchInMenu.Submenu = sub; Gtk.RadioMenuItem original = null, translated = null, both = null; - var group = new Gtk.RadioMenuItem [0]; + Gtk.RadioMenuItem [] group = new Gtk.RadioMenuItem [0]; original = new Gtk.RadioMenuItem (group, GettextCatalog.GetString ("_Original")); group = original.Group; original.ButtonPressEvent += delegate { original.Activate (); }; @@ -1267,4 +1267,4 @@ public bool EnableRedo { } #endregion } -} \ No newline at end of file +} diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs index 745eff5ecf0..492f82aae9f 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs @@ -155,38 +155,38 @@ protected override bool OnKeyPressEvent (EventKey evnt) return base.OnKeyPressEvent (evnt); } - Gdk.GC textGC, foldGC, textBgGC, foldBgGC; +// Gdk.GC textGC, foldGC, textBgGC, foldBgGC; - protected override bool OnExposeEvent (Gdk.EventExpose ev) - { - if (textGC == null) { - var plainText = SyntaxHighlightingService.GetColor (editor.EditorTheme, EditorThemeColors.Foreground); - textGC = plainText.CreateGC (ev.Window); - - plainText = SyntaxHighlightingService.GetColor (editor.EditorTheme, EditorThemeColors.Background); - textBgGC = plainText.CreateGC (ev.Window); - - var collapsedText = SyntaxHighlightingService.GetColor (editor.EditorTheme, EditorThemeColors.CollapsedText); - foldGC = collapsedText.CreateGC (ev.Window); - - collapsedText = SyntaxHighlightingService.GetColor (editor.EditorTheme, EditorThemeColors.Background); - foldBgGC = collapsedText.CreateGC (ev.Window); - } - - ev.Window.DrawRectangle (textBgGC, true, ev.Area); - ev.Window.DrawLayout (textGC, 5, 4, layout); - ev.Window.DrawRectangle (textBgGC, false, 1, 1, this.Allocation.Width - 3, this.Allocation.Height - 3); - ev.Window.DrawRectangle (foldGC, false, 0, 0, this.Allocation.Width - 1, this.Allocation.Height - 1); - - if (!HideCodeSegmentPreviewInformString) { - informLayout.SetText (CodeSegmentPreviewInformString); - int w, h; - informLayout.GetPixelSize (out w, out h); - PreviewInformStringHeight = h; - ev.Window.DrawRectangle (foldBgGC, true, Allocation.Width - w - 3, Allocation.Height - h, w + 2, h - 1); - ev.Window.DrawLayout (foldGC, Allocation.Width - w - 4, Allocation.Height - h - 3, informLayout); - } - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose ev) +// { +// if (textGC == null) { +// var plainText = SyntaxHighlightingService.GetColor (editor.EditorTheme, EditorThemeColors.Foreground); +// textGC = plainText.CreateGC (ev.Window); +// +// plainText = SyntaxHighlightingService.GetColor (editor.EditorTheme, EditorThemeColors.Background); +// textBgGC = plainText.CreateGC (ev.Window); +// +// var collapsedText = SyntaxHighlightingService.GetColor (editor.EditorTheme, EditorThemeColors.CollapsedText); +// foldGC = collapsedText.CreateGC (ev.Window); +// +// collapsedText = SyntaxHighlightingService.GetColor (editor.EditorTheme, EditorThemeColors.Background); +// foldBgGC = collapsedText.CreateGC (ev.Window); +// } +// +// ev.Window.DrawRectangle (textBgGC, true, ev.Area); +// ev.Window.DrawLayout (textGC, 5, 4, layout); +// ev.Window.DrawRectangle (textBgGC, false, 1, 1, this.Allocation.Width - 3, this.Allocation.Height - 3); +// ev.Window.DrawRectangle (foldGC, false, 0, 0, this.Allocation.Width - 1, this.Allocation.Height - 1); +// +// if (!HideCodeSegmentPreviewInformString) { +// informLayout.SetText (CodeSegmentPreviewInformString); +// int w, h; +// informLayout.GetPixelSize (out w, out h); +// PreviewInformStringHeight = h; +// ev.Window.DrawRectangle (foldBgGC, true, Allocation.Width - w - 3, Allocation.Height - h, w + 2, h - 1); +// ev.Window.DrawLayout (foldGC, Allocation.Width - w - 4, Allocation.Height - h - 3, informLayout); +// } +// return true; +// } } } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs index d24e715ffcb..c2b80240757 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs @@ -3134,7 +3134,7 @@ public int ReplaceAll (string withPattern) int nextTipOffset = 0; int nextTipX=0; int nextTipY=0; Gdk.ModifierType nextTipModifierState = ModifierType.None; - DateTime nextTipScheduledTime; // Time at which we want the tooltip to show + System.DateTime nextTipScheduledTime; // Time at which we want the tooltip to show void ShowTooltip (Gdk.ModifierType modifierState, DocumentLocation location) { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs index 5ab781ecb9d..9fbc542fc4d 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs @@ -62,7 +62,7 @@ public HighlightingPanel () MonoDevelop.Ide.Gui.Styles.Changed += HandleThemeChanged; } - static void ImageDataFunc (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) + static void ImageDataFunc (TreeViewColumn tree_column, CellRenderer cell, ITreeModel tree_model, TreeIter iter) { var isError = (bool)tree_model.GetValue (iter, 2); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs index 74da4193b8c..ae698937395 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs @@ -39,10 +39,10 @@ public HoverCloseButton () Events |= EventMask.LeaveNotifyMask | EventMask.EnterNotifyMask | EventMask.ButtonPressMask | EventMask.ButtonReleaseMask; } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredWidth (out int minimum_width, out int natural_width) { - base.OnSizeRequested (ref requisition); - requisition.Width = requisition.Height = 16; + base.OnGetPreferredWidth (out minimum_width, out natural_width); + minimum_width = natural_width = 16; } protected override bool OnEnterNotifyEvent (Gdk.EventCrossing evnt) @@ -84,13 +84,13 @@ protected virtual void OnClicked (EventArgs e) handler (this, e); } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - using (var cr = CairoHelper.Create (evnt.Window)) { - DrawCloseButton (cr, new Gdk.Point (Allocation.X + Allocation.Width / 2, Allocation.Y + Allocation.Height / 2), hovered, 1.0, 0); - } - return base.OnExposeEvent (evnt); - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// using (var cr = CairoHelper.Create (evnt.Window)) { +// DrawCloseButton (cr, new Gdk.Point (Allocation.X + Allocation.Width / 2, Allocation.Y + Allocation.Height / 2), hovered, 1.0, 0); +// } +// return base.OnExposeEvent (evnt); +// } static void DrawCloseButton (Cairo.Context context, Gdk.Point center, bool hovered, double opacity, double animationProgress) { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs index 4b75da1e03a..81c20a8f3f0 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs @@ -75,14 +75,13 @@ protected override void OnDestroyed () } } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredWidth (out int minimum_width, out int natural_width) { - base.OnSizeRequested (ref requisition); + base.OnGetPreferredWidth (out minimum_width, out natural_width); - if (SizeFunc != null) { - requisition.Width = Math.Min (SizeFunc (), textEditor.Allocation.Width - border * 2); + if (sizeFunc != null) { + minimum_width = natural_width = Math.Min (SizeFunc (), textEditor.Allocation.Width - border * 2); } - } protected override void OnSizeAllocated (Gdk.Rectangle allocation) @@ -101,24 +100,24 @@ void AdjustPositionInEditor (Gdk.Rectangle alloc) textEditor.MoveTopLevelWidget (this, (textEditor.Allocation.Width - alloc.Width) / 2, textEditor.Allocation.Height - alloc.Height - 8); } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - using (var cr = CairoHelper.Create (evnt.Window)) { - cr.LineWidth = 1; - cr.Rectangle (0, 0, Allocation.Width, Allocation.Height); - - cr.SetSourceColor (SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.NotificationTextBackground)); - cr.Fill (); - cr.RoundedRectangle (0, 0, Allocation.Width, Allocation.Height, 3); - cr.SetSourceColor (SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.NotificationTextBackground)); - cr.FillPreserve (); - - cr.SetSourceColor (SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.NotificationBorder)); - cr.Stroke(); - } - - return base.OnExposeEvent (evnt); - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// using (var cr = CairoHelper.Create (evnt.Window)) { +// cr.LineWidth = 1; +// cr.Rectangle (0, 0, Allocation.Width, Allocation.Height); +// +// cr.SetSourceColor (SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.NotificationTextBackground)); +// cr.Fill (); +// cr.RoundedRectangle (0, 0, Allocation.Width, Allocation.Height, 3); +// cr.SetSourceColor (SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.NotificationTextBackground)); +// cr.FillPreserve (); +// +// cr.SetSourceColor (SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.NotificationBorder)); +// cr.Stroke(); +// } +// +// return base.OnExposeEvent (evnt); +// } } } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs index 5ed17703426..6d5f85bd413 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs @@ -195,11 +195,11 @@ static bool HasAnyFocusedChild (Widget widget) class Border : Gtk.DrawingArea { - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - evnt.Window.DrawRectangle (this.Style.DarkGC (State), true, evnt.Area); - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose evnt) +// { +// evnt.Window.DrawRectangle (this.Style.DarkGC (State), true, evnt.Area); +// return true; +// } } diff --git a/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs b/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs index 6889969c84f..64bf78e8b70 100644 --- a/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs +++ b/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs @@ -1158,7 +1158,7 @@ static void BuildTreeChildren (TreeStore store, TreeIter parent, XContainer p) } } - void outlineTreeDataFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) + void outlineTreeDataFunc (TreeViewColumn column, CellRenderer cell, ITreeModel model, TreeIter iter) { var txtRenderer = (CellRendererText) cell; var n = (XNode) model.GetValue (iter, 0); diff --git a/main/src/addins/Xml/Editor/XmlSchemasPanelWidget.cs b/main/src/addins/Xml/Editor/XmlSchemasPanelWidget.cs index c68f0f423a5..a7f82b7acea 100644 --- a/main/src/addins/Xml/Editor/XmlSchemasPanelWidget.cs +++ b/main/src/addins/Xml/Editor/XmlSchemasPanelWidget.cs @@ -62,13 +62,13 @@ public XmlSchemasPanelWidget () registeredSchemasView.SearchColumn = -1; // disable the interactive search registeredSchemasView.AppendColumn (GettextCatalog.GetString ("Namespace"), textRenderer, - (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) => { + (TreeViewColumn col, CellRenderer cell, ITreeModel model, TreeIter iter) => { ((CellRendererText)cell).Text = GetSchema (iter).NamespaceUri; } ); registeredSchemasView.AppendColumn (GettextCatalog.GetString ("Type"), textRenderer, - (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) => { + (TreeViewColumn col, CellRenderer cell, ITreeModel model, TreeIter iter) => { ((CellRendererText)cell).Text = GetSchema (iter).ReadOnly? GettextCatalog.GetString ("Built in") : GettextCatalog.GetString ("User schema"); @@ -192,13 +192,13 @@ static XmlSchemaCompletionData GetSchema (ListStore registeredSchemasStore, Tree return (XmlSchemaCompletionData) registeredSchemasStore.GetValue (iter, 0); } - IEnumerable WalkStore (TreeModel model, int column) + IEnumerable WalkStore (ITreeModel model, int column) { foreach (TreeIter iter in WalkStore (model)) yield return model.GetValue (iter, column); } - IEnumerable WalkStore (TreeModel model) + IEnumerable WalkStore (ITreeModel model) { TreeIter iter; bool valid = model.GetIterFirst (out iter); @@ -208,7 +208,7 @@ IEnumerable WalkStore (TreeModel model) } } - static int SortSchemas (TreeModel model, TreeIter a, TreeIter b) + static int SortSchemas (ITreeModel model, TreeIter a, TreeIter b) { var listStore = (ListStore)model; return string.Compare (GetSchema (listStore, a).NamespaceUri, GetSchema (listStore, b).NamespaceUri, StringComparison.Ordinal); @@ -476,7 +476,7 @@ protected virtual void addRegisteredSchema (object sender, EventArgs args) void ScrollToSelection (TreeView view) { TreeIter iter; - TreeModel model; + ITreeModel model; if (!registeredSchemasView.Selection.GetSelected (out model, out iter)) return; view.ScrollToCell (model.GetPath (iter), null, false, 0, 0); diff --git a/main/src/addins/Xml/MonoDevelop.Xml.csproj b/main/src/addins/Xml/MonoDevelop.Xml.csproj index 0bcaaa97764..3c9f4d66fda 100644 --- a/main/src/addins/Xml/MonoDevelop.Xml.csproj +++ b/main/src/addins/Xml/MonoDevelop.Xml.csproj @@ -16,11 +16,21 @@ - - - - - + + glib-sharp-3.0 + + + gtk-sharp-3.0 + + + gtk-sharp-3.0 + + + gdk-sharp-3.0 + + + gtk-sharp-3.0 + ..\..\..\build\bin\Microsoft.CodeAnalysis.dll @@ -34,6 +44,9 @@ ..\..\..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll False + + gio-sharp-3.0 + From 85160e10e0a198cd35d6de8164ec8598dc714a1a Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 26 Jul 2018 23:39:38 -0400 Subject: [PATCH 014/382] Fix natural_* == 0 in OnGetPreferred* events --- .../MonoDevelop.Components.Docking/DockContainer.cs | 4 ++-- .../MonoDevelop.Components.Docking/DockItemContainer.cs | 4 ++-- .../MonoDevelop.Components.Docking/DockItemTitleTab.cs | 4 ++-- .../PropertyGridTable.cs | 6 ++---- .../MonoDevelop.Components/DropDownBox.cs | 8 ++------ .../MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs | 4 ++-- .../MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs | 6 ++---- .../MonoDevelop.Components/RoundedFrame.cs | 4 ++-- .../MonoDevelop.Components/SectionList.cs | 6 ++---- .../MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs | 3 +-- .../MonoDevelop.Ide.Gui/DocumentSwitcher.cs | 9 ++++----- .../MonoDevelop.Ide.Projects/SelectReferenceDialog.cs | 2 +- 12 files changed, 24 insertions(+), 36 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs index 6243593022a..7029a4465e0 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs @@ -134,22 +134,22 @@ public void StoreAllocation () protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { - natural_width = 0; min_width = 0; if (layout != null) { LayoutWidgets (); min_width = layout.SizeRequest ().Width; } + natural_width = min_width; } protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - natural_height = 0; min_height = 0; if (layout != null) { LayoutWidgets (); min_height = layout.SizeRequest ().Height; } + natural_height = min_height; } protected override void OnSizeAllocated (Gdk.Rectangle rect) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs index 454fe812001..53eba561646 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs @@ -266,24 +266,24 @@ protected override void OnRemoved (Widget widget) protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { - natural_width = 0; if (child != null) { min_width = child.SizeRequest ().Width; min_width += leftMargin + rightMargin + leftPadding + rightPadding; } else { min_width = 0; } + natural_width = min_width; } protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - natural_height = 0; if (child != null) { min_height = child.SizeRequest ().Height; min_height += topMargin + bottomMargin + topPadding + bottomPadding; } else { min_height = 0; } + natural_height = min_height; } protected override void OnSizeAllocated (Gdk.Rectangle allocation) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs index efc50ce765b..baec65b0280 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs @@ -695,7 +695,6 @@ protected override void OnRealized () protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { min_height = 0; - natural_height = 0; if (Child != null) { Requisition req = Child.SizeRequest (); if (active) @@ -703,16 +702,17 @@ protected override void OnGetPreferredHeight (out int min_height, out int natura else min_height += (int)(TabPadding.Top + TabPadding.Bottom); } + natural_height = min_height; } protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { min_width = 0; - natural_width = 0; if (Child != null) { Requisition req = Child.SizeRequest (); min_width += (int)(TabPadding.Left + TabPadding.Right); } + natural_width = min_width; } protected override void OnSizeAllocated (Gdk.Rectangle rect) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs index 0f512bfafde..3658ceda1aa 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs @@ -450,8 +450,7 @@ protected override void ForAll (bool includeInternals, Gtk.Callback callback) protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { - min_width = 20; - natural_width = 0; + min_width = natural_width = 20; foreach (var c in children) c.Key.SizeRequest (); @@ -459,12 +458,11 @@ protected override void OnGetPreferredWidth (out int min_width, out int natural_ protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - natural_height = 0; int dx = (int)((double)Allocation.Width * dividerPosition) - PropertyContentLeftPadding; if (dx < 0) dx = 0; int y = 0; MeasureHeight (rows, ref y); - min_height = y; + min_height = natural_height = y; foreach (var c in children) c.Key.SizeRequest (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs index 4235527b3b9..00dd100af55 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs @@ -185,8 +185,6 @@ protected override void OnDestroyed () protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { int width, height; - natural_width = 0; - min_width = 0; layout.GetPixelSize (out width, out height); if (Pixbuf != null) { @@ -198,14 +196,12 @@ protected override void OnGetPreferredWidth (out int min_width, out int natural_ int arrowHeight = height / 2; int arrowWidth = arrowHeight + 1; - min_width = FixedWidth > 0 ? FixedWidth : width + arrowWidth + leftSpacing; + min_width = natural_width = FixedWidth > 0 ? FixedWidth : width + arrowWidth + leftSpacing; } protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { int width, height; - natural_height = 0; - min_height = 0; layout.GetPixelSize (out width, out height); if (Pixbuf != null) { @@ -216,7 +212,7 @@ protected override void OnGetPreferredHeight (out int min_height, out int natura int arrowHeight = height / 2; - min_height = FixedHeight >0 ? FixedHeight : height + ySpacing * 2; + min_height = natural_height = FixedHeight >0 ? FixedHeight : height + ySpacing * 2; } protected override bool OnFocusOutEvent (Gdk.EventFocus evnt) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs index 26b7225abc4..e997c169879 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs @@ -129,24 +129,24 @@ protected override void OnAdded (Widget widget) protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - natural_height = 0; if (child != null) { min_height = child.SizeRequest ().Height; min_height += topMargin + bottomMargin + topPadding + bottomPadding; } else { min_height = 0; } + natural_height = min_height; } protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { - natural_width = 0; if (child != null) { min_width = child.SizeRequest ().Width; min_width += leftMargin + rightMargin + leftPadding + rightPadding; } else { min_width = 0; } + natural_width = min_width; } protected override void OnSizeAllocated (Gdk.Rectangle allocation) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs index 19b1725374e..b0605efe52d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs @@ -306,15 +306,13 @@ public void SetActive (int index) protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - natural_height = 0; - min_height = height + topPadding + bottomPadding; + min_height = natural_height = height + topPadding + bottomPadding; } protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { - natural_width = 0; EnsureWidths (); - min_width = Math.Max (WidthRequest, 0); + min_width = natural_width = Math.Max (WidthRequest, 0); } int[] GetCurrentWidths (out bool widthReduced) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs index bc19581b0b9..41b5be2dcbd 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs @@ -102,7 +102,6 @@ protected override void OnRealized () protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - natural_height = 0; if (child != null && child.Visible) { // Add the child's width/height Requisition child_requisition = child.SizeRequest (); @@ -113,11 +112,11 @@ protected override void OnGetPreferredHeight (out int min_height, out int natura // Add the frame border min_height += ((int)BorderWidth + frame_width) * 2; + natural_height = min_height; } protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { - natural_width = 0; if (child != null && child.Visible) { // Add the child's width/height Requisition child_requisition = child.SizeRequest (); @@ -128,6 +127,7 @@ protected override void OnGetPreferredWidth (out int min_width, out int natural_ // Add the frame border min_width += ((int)BorderWidth + frame_width) * 2; + natural_width = min_width; } protected override void OnSizeAllocated (Gdk.Rectangle allocation) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs index 1a0ddacae32..cf0da4b9d4c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs @@ -217,7 +217,6 @@ protected override void OnShown () protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { int hr = 0; - natural_height = 0; foreach (var section in sections) { var req = section.Child.SizeRequest (); hr = Math.Max (hr, req.Height); @@ -231,13 +230,12 @@ protected override void OnGetPreferredHeight (out int min_height, out int natura hr = Math.Max (hr, HeightRequest); - min_height = hr; + min_height = natural_height = hr; } protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { int wr = 0; - natural_width = 0; foreach (var section in sections) { var req = section.Child.SizeRequest (); wr = Math.Max (wr, req.Width); @@ -250,7 +248,7 @@ protected override void OnGetPreferredWidth (out int min_width, out int natural_ wr = Math.Max (wr, WidthRequest); - min_width = wr; + min_width = natural_width = wr; } protected override void OnSizeAllocated (Gdk.Rectangle allocation) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs index 3265a7ee78d..9ec02c437be 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs @@ -209,8 +209,7 @@ protected override bool OnLeaveNotifyEvent (Gdk.EventCrossing evnt) protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - natural_height = 0; - min_height = (int)Math.Ceiling (tabSizes.Max (p => p.Y)); + min_height = natural_height = (int)Math.Ceiling (tabSizes.Max (p => p.Y)); } // protected override bool OnExposeEvent (Gdk.EventExpose evnt) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs index 9f60e8cc7ce..af0d2a6a34c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs @@ -499,8 +499,7 @@ Category GetPrevCat (int i) protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - min_height = 0; - natural_height = 0; + min_height = natural_height = 0; maxLength = 15; foreach (var cat in categories) { foreach (var item in cat.Items) { @@ -526,12 +525,12 @@ protected override void OnGetPreferredHeight (out int min_height, out int natura var headerHeight = h + headerDistance; totalHeight = Math.Max (totalHeight, headerHeight + (Math.Min (cat.Items.Count, maxItems)) * iconHeight); } + natural_height = min_height; } protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { - min_width = 0; - natural_width = 0; + min_width = natural_width = 0; maxLength = 15; foreach (var cat in categories) { foreach (var item in cat.Items) { @@ -557,7 +556,7 @@ protected override void OnGetPreferredWidth (out int min_width, out int natural_ var headerHeight = h + headerDistance; totalWidth += (1 + Math.Min (maxRows - 1, cat.Items.Count / maxItems)) * iconWidth; } - min_width = totalWidth + padding * 2 + (categories.Count - 1) * padding; + min_width = natural_width = totalWidth + padding * 2 + (categories.Count - 1) * padding; } public class Item diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs index 9dac5de9c3c..4270af0eccb 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs @@ -540,10 +540,10 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { min_width = 0; - natural_width = 0; if (Child != null) min_width = Child.SizeRequest ().Width; min_width += filterEntry.SizeRequest ().Width; + natural_width = min_width; } void RepositionFilter () From b615c4e56128b10b851cd514992fc34e632764e4 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 27 Jul 2018 12:45:56 -0400 Subject: [PATCH 015/382] Minor natural_height fix --- .../MonoDevelop.Components/CompactScrolledWindow.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs index a17f2d45220..e4f968d9a6f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs @@ -69,6 +69,7 @@ protected override void OnGetPreferredHeight (out int min_height, out int natura if (showBorderLine) { min_height += HScrollbar.Visible? 1 : 2; } + natural_height = min_height; } protected override void OnGetPreferredWidth (out int min_width, out int natural_width) @@ -79,6 +80,7 @@ protected override void OnGetPreferredWidth (out int min_width, out int natural_ if (showBorderLine) { min_width += VScrollbar.Visible? 1 : 2; } + natural_width = min_width; } protected override void OnSizeAllocated (Gdk.Rectangle allocation) From c5374d0332a735c51bf2b1d9fd03c08e123d871d Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 27 Jul 2018 14:44:44 -0400 Subject: [PATCH 016/382] My first port from OnExposeEvent to OnDrawn --- .../MonoDevelop.Components/ImageView.cs | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs index 7405f04a336..916db6e3113 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs @@ -24,6 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; +using Cairo; using Gdk; namespace MonoDevelop.Components @@ -125,21 +126,19 @@ bool IsParentDisabled () return false; } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// if (image != null) { -// var alloc = Allocation; -// alloc.Inflate (-Xpad, -Ypad); -// using (var ctx = CairoHelper.Create (evnt.Window)) { -// var x = Math.Round (alloc.X + (alloc.Width - image.Width) * Xalign); -// var y = Math.Round (alloc.Y + (alloc.Height - image.Height) * Yalign); -// ctx.Save (); -// ctx.DrawImage (this, IsParentDisabled () ? image.WithAlpha (0.4) : image, x, y); -// ctx.Restore (); -// } -// } -// return true; -// } + protected override bool OnDrawn (Context cr) + { + if (image != null) { + var alloc = Allocation; + alloc.Inflate (-Xpad, -Ypad); + var x = Math.Round (alloc.X + (alloc.Width - image.Width) * Xalign); + var y = Math.Round (alloc.Y + (alloc.Height - image.Height) * Yalign); + cr.Save (); + cr.DrawImage (this, IsParentDisabled () ? image.WithAlpha (0.4) : image, x, y); + cr.Restore (); + } + return true; + } } } From 02d2daeb60e3c3410d44358dbe12232c1f0a9e9d Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Fri, 27 Jul 2018 20:15:49 -0400 Subject: [PATCH 017/382] Fix Gtk3 on Mac --- .../MonoDevelop.Components/GtkWorkarounds.cs | 14 +++++++------- .../MonoDevelop.Ide/MonoDevelop.Ide.dll.config | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs index 8859bb5c392..1e3a01dcf7b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs @@ -148,13 +148,13 @@ static GtkWorkarounds () } //opt into the fixes on GTK+ >= 2.24.8 - if (Platform.IsMac) { - try { - gdk_quartz_set_fix_modifiers (true); - } catch (EntryPointNotFoundException) { - oldMacKeyHacks = true; - } - } +// if (Platform.IsMac) { +// try { +// gdk_quartz_set_fix_modifiers (true); +// } catch (EntryPointNotFoundException) { +// oldMacKeyHacks = true; +// } +// } keymap.KeysChanged += delegate { mappedKeys.Clear (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.dll.config b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.dll.config index 3fd15269140..0e9f8ff6cc9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.dll.config +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.dll.config @@ -11,8 +11,8 @@ - - + + \ No newline at end of file From 765a54daa85a1559291ca597395ac603df644f18 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Sat, 28 Jul 2018 17:01:07 -0400 Subject: [PATCH 018/382] Better Linux OS name detection in Help/About --- .../LinuxSystemInformation.cs | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LinuxSystemInformation.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LinuxSystemInformation.cs index f99a90ee927..baf5bcd52f3 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LinuxSystemInformation.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LinuxSystemInformation.cs @@ -25,6 +25,8 @@ // THE SOFTWARE. using System; +using System.Collections.Generic; +using System.IO; using System.Text; namespace MonoDevelop.Core @@ -33,9 +35,37 @@ class LinuxSystemInformation : UnixSystemInformation { internal override void AppendOperatingSystem (StringBuilder sb) { - sb.AppendLine ("\tLinux"); + string OSName = "", OSVersion = ""; + try { + foreach (var line in File.ReadAllLines ("/etc/os-release")) { + var parsedline = Parse (line); + if (parsedline.Key.Equals ("NAME")) { + OSName = parsedline.Value; + } + if (parsedline.Key.Equals ("VERSION")) { + OSVersion = parsedline.Value; + } + } + } catch { + OSName = "Linux"; + OSVersion = "Unknown"; + } + if (string.IsNullOrWhiteSpace (OSName) || string.IsNullOrWhiteSpace (OSVersion)) { + OSName = "Linux"; + OSVersion = "Unknown"; + } + sb.AppendLine ("\t" + OSName + " " + OSVersion); base.AppendOperatingSystem (sb); } + + KeyValuePair Parse (string inputstring) + { + string [] parsed = inputstring.Split ('='); + if (parsed.Length != 2) { + return new KeyValuePair (); + } + return new KeyValuePair (parsed [0], parsed [1].Trim ('"')); + } } } From 0b740aee769c2377238f44ec27ff0316bf258de4 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Sat, 28 Jul 2018 17:19:33 -0400 Subject: [PATCH 019/382] more updates --- .../SmartScrolledWindow.cs | 24 +++++++++----- .../Mono.TextEditor/Gui/MonoTextEditor.cs | 10 ++++-- .../QuickTaskOverviewMode.cs | 6 ++-- .../MonoDevelop.SourceEditor.csproj | 4 ++- .../MessageBubbleCache.cs | 33 +++++++++++++++---- 5 files changed, 56 insertions(+), 21 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs index 13d6d059cb8..3b4a440d85f 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs @@ -100,12 +100,12 @@ protected override void OnDestroyed () Child.Destroy (); if (vAdjustment != null) { vAdjustment.Changed -= HandleAdjustmentChanged; - vAdjustment.Destroy (); +// vAdjustment.Destroy (); vAdjustment = null; } if (hAdjustment != null) { hAdjustment.Changed -= HandleAdjustmentChanged; - hAdjustment.Destroy (); +// hAdjustment.Destroy (); hAdjustment = null; } if (vScrollBar != null) { @@ -161,8 +161,8 @@ public void AddChild (Gtk.Widget child, ChildPosition position) protected override void OnAdded (Widget widget) { base.OnAdded (widget); - if (widget == Child) - widget.SetScrollAdjustments (hAdjustment, vAdjustment); +// if (widget == Child) +// widget.SetScrollAdjustments (hAdjustment, vAdjustment); } protected override void OnRemoved (Widget widget) @@ -232,14 +232,22 @@ protected override bool OnScrollEvent (EventScroll evnt) return (dx != 0.0 || dy != 0.0) || base.OnScrollEvent (evnt); } - - protected override void OnSizeRequested (ref Gtk.Requisition requisition) + + protected override void OnGetPreferredWidth (out int minimum_width, out int natural_width) { - base.OnSizeRequested (ref requisition); + base.OnGetPreferredWidth (out minimum_width, out natural_width); if (Child != null) Child.SizeRequest (); - vScrollBar.SizeRequest (); hScrollBar.SizeRequest (); + children.ForEach (Child => Child.Child.SizeRequest ()); + } + + protected override void OnGetPreferredHeight (out int minimum_height, out int natural_width) + { + base.OnGetPreferredHeight (out minimum_height, out natural_width); + if (Child != null) + Child.SizeRequest (); + vScrollBar.SizeRequest (); children.ForEach (child => child.Child.SizeRequest ()); } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/MonoTextEditor.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/MonoTextEditor.cs index ac69266d8e4..52078b95884 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/MonoTextEditor.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/MonoTextEditor.cs @@ -179,9 +179,15 @@ protected override void OnSizeAllocated (Rectangle allocation) SetChildrenPositions (allocation); } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredWidth (out int minimum_width, out int natural_width) { - base.OnSizeRequested (ref requisition); + base.OnGetPreferredWidth (out minimum_width, out natural_width); + containerChildren.ForEach (c => c.Child.SizeRequest ()); + } + + protected override void OnGetPreferredHeight (out int minimum_height, out int natural_height) + { + base.OnGetPreferredHeight (out minimum_height, out natural_height); containerChildren.ForEach (c => c.Child.SizeRequest ()); } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs index aba38914eb6..e56bdd1f041 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs @@ -678,10 +678,10 @@ void DrawIndicator (Cairo.Context cr, Xwt.Drawing.Image img) cr.DrawImage (this, img, Math.Round ((Allocation.Width - img.Width) / 2), -1); } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredWidth (out int minimum_width, out int natural_width) { - base.OnSizeRequested (ref requisition); - requisition.Width = MonoDevelop.Core.Platform.IsWindows ? win81ScrollbarWidth : 15; + base.OnGetPreferredWidth (out minimum_width, out natural_width); + minimum_width = natural_width = MonoDevelop.Core.Platform.IsWindows ? win81ScrollbarWidth : 15; } double LineToY (int logicalLine) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj index f277993b274..c564711d358 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj @@ -86,7 +86,6 @@ - ..\..\..\build\bin\System.Reflection.Metadata.dll False @@ -105,6 +104,9 @@ ..\..\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll False + + gtk-sharp-3.0 + diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs index 38959fc4319..ebd4ebfefe2 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs @@ -110,30 +110,49 @@ public MessageBubblePopoverWindow (MessageBubbleCache cache, MessageBubbleTextMa readonly int maxTextWidth = (int)(260 * Pango.Scale.PangoScale); - protected override void OnSizeRequested (ref Gtk.Requisition requisition) + protected override void OnGetPreferredWidth (out int minimum_width, out int natural_width) { - base.OnSizeRequested (ref requisition); - double y = verticalTextBorder * 2 - verticalTextSpace + (MonoDevelop.Core.Platform.IsWindows ? 10 : 2); + base.OnGetPreferredWidth (out minimum_width, out natural_width); using (var drawingLayout = new Pango.Layout (this.PangoContext)) { drawingLayout.FontDescription = cache.tooltipFontDescription; foreach (var msg in marker.Errors) { - if (marker.Layouts.Count == 1) + if (marker.Layouts.Count == 1) drawingLayout.Width = maxTextWidth; drawingLayout.SetText (msg.FullErrorMessage); int w; int h; drawingLayout.GetPixelSize (out w, out h); - if (marker.Layouts.Count > 1) + if (marker.Layouts.Count > 1) w += (int)warningPixbuf.Width + iconTextSpacing; - requisition.Width = Math.Max (w + textBorder * 2, requisition.Width); + minimum_width = natural_width = Math.Max (w + textBorder * 2, minimum_width); + } + } + } + + protected override void OnGetPreferredHeight (out int minimum_height, out int natural_height) + { + base.OnGetPreferredHeight (out minimum_height, out natural_height); + double y = verticalTextBorder * 2 - verticalTextSpace + (MonoDevelop.Core.Platform.IsWindows ? 10 : 2); + + using (var drawingLayout = new Pango.Layout (this.PangoContext)) { + drawingLayout.FontDescription = cache.tooltipFontDescription; + + foreach (var msg in marker.Errors) { + if (marker.Layouts.Count == 1) + drawingLayout.Width = maxTextWidth; + drawingLayout.SetText (msg.FullErrorMessage); + int w; + int h; + drawingLayout.GetPixelSize (out w, out h); + y += h + verticalTextSpace - 3; } } - requisition.Height = (int)y; + minimum_height = natural_height = (int)y; } protected override bool OnEnterNotifyEvent (Gdk.EventCrossing evnt) From bcc8c79f425976bf22fd98e34ce77811ffb5dc87 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Sat, 28 Jul 2018 17:48:52 -0400 Subject: [PATCH 020/382] More sourceeditor fixes --- .../Mono.TextEditor.PopupWindow/ListWidget.cs | 31 ++++--- .../ModeHelpWindow.cs | 91 +++++++++---------- .../AnimatedWidget.cs | 46 ++++++---- .../QuickTaskMiniMapMode.cs | 6 +- 4 files changed, 92 insertions(+), 82 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs index c4e0b3afec5..77a59428785 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs @@ -30,6 +30,7 @@ using System; using System.Text; using MonoDevelop.Components; +using Cairo; namespace Mono.TextEditor.PopupWindow { @@ -150,7 +151,7 @@ protected override bool OnMotionNotifyEvent (EventMotion e) return base.OnMotionNotifyEvent (e); int winWidth, winHeight; - this.GdkWindow.GetSize (out winWidth, out winHeight); +// this.GdkWindow.GetSize (out winWidth, out winHeight); /* int ypos = (int) e.Y; if (ypos < 0) { @@ -166,14 +167,14 @@ protected override bool OnMotionNotifyEvent (EventMotion e) Adjustment hadj; Adjustment vadj; - protected override void OnSetScrollAdjustments (Adjustment hadj, Adjustment vadj) - { - this.hadj = hadj; - this.vadj = vadj; - if (this.vadj != null) - this.vadj.ValueChanged += (sender, e) => QueueDraw (); - base.OnSetScrollAdjustments (hadj, vadj); - } +// protected override void OnSetScrollAdjustments (Adjustment hadj, Adjustment vadj) +// { +// this.hadj = hadj; +// this.vadj = vadj; +// if (this.vadj != null) +// this.vadj.ValueChanged += (sender, e) => QueueDraw (); +// base.OnSetScrollAdjustments (hadj, vadj); +// } void SetAdjustments (Gdk.Rectangle allocation) { @@ -189,12 +190,12 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) base.OnSizeAllocated (allocation); } - protected override bool OnExposeEvent (Gdk.EventExpose args) - { - base.OnExposeEvent (args); - DrawList (args); - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose args) +// { +// base.OnExposeEvent (args); +// DrawList (args); +// return true; +// } public int TextOffset { get { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs index a3e37b92000..8aa7c1efb5a 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs @@ -30,6 +30,7 @@ using System.Text.RegularExpressions; using Mono.Unix; using MonoDevelop.Components; +using Cairo; namespace Mono.TextEditor.PopupWindow { @@ -474,60 +475,58 @@ protected override void OnDestroyed () const int yDescriptionBorder = 8; const int yTitleBorder = 8; - protected override bool OnExposeEvent (Gdk.EventExpose args) + protected override bool OnDrawn (Context g) { - using (var g = Gdk.CairoHelper.Create (args.Window)) { - g.Translate (Allocation.X, Allocation.Y); - g.LineWidth = 1; - titleLayout.SetMarkup (TitleText); - int width, height; - titleLayout.GetPixelSize (out width, out height); - var tw = SupportsAlpha ? triangleWidth : 0; - var th = SupportsAlpha ? triangleHeight : 0; - width += xDescriptionBorder * 2; + g.Translate (Allocation.X, Allocation.Y); + g.LineWidth = 1; + titleLayout.SetMarkup (TitleText); + int width, height; + titleLayout.GetPixelSize (out width, out height); + var tw = SupportsAlpha ? triangleWidth : 0; + var th = SupportsAlpha ? triangleHeight : 0; + width += xDescriptionBorder * 2; - if (SupportsAlpha) { - FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, true, true, tw + 0.5, 0.5, 12, Allocation.Width - 1 - tw, Allocation.Height); - } else { - g.Rectangle (0, 0, Allocation.Width, Allocation.Height); - } + if (SupportsAlpha) { + FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, true, true, tw + 0.5, 0.5, 12, Allocation.Width - 1 - tw, Allocation.Height); + } else { + g.Rectangle (0, 0, Allocation.Width, Allocation.Height); + } + g.SetSourceColor (Styles.InsertionCursorBackgroundColor.ToCairoColor ()); + g.FillPreserve (); + g.SetSourceColor (Styles.InsertionCursorBorderColor.ToCairoColor ()); + g.Stroke (); + + + g.MoveTo (tw + xDescriptionBorder, yTitleBorder); + g.SetSourceColor (Styles.InsertionCursorTitleTextColor.ToCairoColor ()); + g.ShowLayout (titleLayout); + + if (SupportsAlpha) { + g.MoveTo (tw, Allocation.Height / 2 - th / 2); + g.LineTo (0, Allocation.Height / 2); + g.LineTo (tw, Allocation.Height / 2 + th / 2); + g.LineTo (tw + 5, Allocation.Height / 2 + th / 2); + g.LineTo (tw + 5, Allocation.Height / 2 - th / 2); + g.ClosePath (); g.SetSourceColor (Styles.InsertionCursorBackgroundColor.ToCairoColor ()); - g.FillPreserve (); + g.Fill (); + + g.MoveTo (tw, Allocation.Height / 2 - th / 2); + g.LineTo (0, Allocation.Height / 2); + g.LineTo (tw, Allocation.Height / 2 + th / 2); g.SetSourceColor (Styles.InsertionCursorBorderColor.ToCairoColor ()); g.Stroke (); - - - g.MoveTo (tw + xDescriptionBorder, yTitleBorder); - g.SetSourceColor (Styles.InsertionCursorTitleTextColor.ToCairoColor ()); - g.ShowLayout (titleLayout); - - if (SupportsAlpha) { - g.MoveTo (tw, Allocation.Height / 2 - th / 2); - g.LineTo (0, Allocation.Height / 2); - g.LineTo (tw, Allocation.Height / 2 + th / 2); - g.LineTo (tw + 5, Allocation.Height / 2 + th / 2); - g.LineTo (tw + 5, Allocation.Height / 2 - th / 2); - g.ClosePath (); - g.SetSourceColor (Styles.InsertionCursorBackgroundColor.ToCairoColor ()); - g.Fill (); - - g.MoveTo (tw, Allocation.Height / 2 - th / 2); - g.LineTo (0, Allocation.Height / 2); - g.LineTo (tw, Allocation.Height / 2 + th / 2); - g.SetSourceColor (Styles.InsertionCursorBorderColor.ToCairoColor ()); - g.Stroke (); - } + } - int y = height + yTitleBorder + yDescriptionBorder; - int x = tw + xDescriptionBorder; - g.SetSourceColor (Styles.InsertionCursorTextColor.ToCairoColor ()); + int y = height + yTitleBorder + yDescriptionBorder; + int x = tw + xDescriptionBorder; + g.SetSourceColor (Styles.InsertionCursorTextColor.ToCairoColor ()); - foreach (var desc in descTexts) { - desc.Render (g, x, y + 4); - y += desc.Height + 8; - } + foreach (var desc in descTexts) { + desc.Render (g, x, y + 4); + y += desc.Height + 8; } - return base.OnExposeEvent (args); + return base.OnDrawn (g); } } } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs index 5b95f77f471..921bd1126dc 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs @@ -120,11 +120,11 @@ protected override void OnRemoved (Widget widget) protected override void OnRealized () { - WidgetFlags |= WidgetFlags.Realized; + this.IsRealized = true; Gdk.WindowAttr attributes = new Gdk.WindowAttr (); attributes.WindowType = Gdk.WindowType.Child; - attributes.Wclass = Gdk.WindowClass.InputOutput; +// attributes.Wclass = Gdk.WindowClass.InputOutput; attributes.EventMask = (int)Gdk.EventMask.ExposureMask; GdkWindow = new Gdk.Window (Parent.GdkWindow, attributes, 0); GdkWindow.UserData = Handle; @@ -132,24 +132,34 @@ protected override void OnRealized () Style.Attach (GdkWindow); } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredWidth (out int minimum_width, out int natural_width) { if (Widget != null) { Requisition req = Widget.SizeRequest (); widget_alloc.Width = req.Width; - widget_alloc.Height = req.Height; } - + if (horizontal) { Width = Choreographer.PixelCompose (percent, widget_alloc.Width + StartPadding + EndPadding, Easing); - Height = widget_alloc.Height; } else { Width = widget_alloc.Width; + } + minimum_width = natural_width = Width; + } + + protected override void OnGetPreferredHeight (out int minimum_height, out int natural_height) + { + if (Widget != null) { + Requisition req = Widget.SizeRequest (); + widget_alloc.Height = req.Height; + } + + if (horizontal) { + Height = widget_alloc.Height; + } else { Height = Choreographer.PixelCompose (percent, widget_alloc.Height + StartPadding + EndPadding, Easing); } - - requisition.Width = Width; - requisition.Height = Height; + minimum_height = natural_height = Height; } protected override void OnSizeAllocated (Rectangle allocation) @@ -176,15 +186,15 @@ protected override void OnSizeAllocated (Rectangle allocation) } } - protected override bool OnExposeEvent (EventExpose evnt) - { - if (canvas != null) { - GdkWindow.DrawDrawable (Style.BackgroundGC (State), canvas, 0, 0, widget_alloc.X, widget_alloc.Y, widget_alloc.Width, widget_alloc.Height); - return true; - } - - return base.OnExposeEvent (evnt); - } +// protected override bool OnExposeEvent (EventExpose evnt) +// { +// if (canvas != null) { +// GdkWindow.DrawDrawable (Style.BackgroundGC (State), canvas, 0, 0, widget_alloc.X, widget_alloc.Y, widget_alloc.Width, widget_alloc.Height); +// return true; +// } +// +// return base.OnExposeEvent (evnt); +// } protected override void ForAll (bool include_internals, Callback callback) { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskMiniMapMode.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskMiniMapMode.cs index 75b74ea8f28..37728cee949 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskMiniMapMode.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskMiniMapMode.cs @@ -151,10 +151,10 @@ protected override void MovePosition (double y) vadjustment.Value = position; } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredWidth (out int minimum_width, out int natural_width) { - base.OnSizeRequested (ref requisition); - requisition.Width = 150; + base.OnGetPreferredWidth (out minimum_width, out natural_width); + minimum_width = natural_width = 150; } void DestroyBgBuffer () From 6606b918a6d4db15d5a719aa7f343844a75d631f Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Sun, 29 Jul 2018 09:12:37 -0400 Subject: [PATCH 021/382] More build stubbing --- .../CodeIssuePanelWidget.cs | 4 +- .../RefactoringPreviewDialog.cs | 4 +- ...SourceEditor.OptionPanels.BehaviorPanel.cs | 8 +- ...tor.OptionPanels.CompletionOptionsPanel.cs | 2 +- ...Editor.OptionPanels.GeneralOptionsPanel.cs | 4 +- ...p.SourceEditor.OptionPanels.MarkerPanel.cs | 4 +- ...Editor.OptionPanels.NewColorShemeDialog.cs | 8 +- .../Mono.TextEditor.PopupWindow/ListWidget.cs | 126 +++---- .../Mono.TextEditor.PopupWindow/ListWindow.cs | 18 +- .../ModeHelpWindow.cs | 222 ++++++----- .../Mono.TextEditor.Theatrics/AnimatedBox.cs | 38 +- .../AnimatedWidget.cs | 16 +- .../BounceFadePopupWindow.cs | 47 ++- .../SmartScrolledWindow.cs | 96 +++-- .../Gui/CodeSegmentPreviewWindow.cs | 14 +- .../Mono.TextEditor/Gui/MonoTextEditor.cs | 34 +- .../Mono.TextEditor/Gui/TextArea.cs | 171 ++++----- .../Mono.TextEditor/Gui/TextViewMargin.cs | 140 +++---- .../QuickTaskMiniMapMode.cs | 154 ++++---- .../QuickTaskOverviewMode.cs | 72 ++-- .../MonoDevelop.SourceEditor.csproj | 3 + .../DebugValueWindow.cs | 3 +- .../GotoLineNumberWidget.cs | 6 +- .../SourceEditorWidget.cs | 40 +- .../Gui/ImportsOptionsPanelWidget.cs | 2 +- ...Binding.ConfigurationOptionsPanelWidget.cs | 4 +- ....VBNetBinding.ProjectOptionsPanelWidget.cs | 28 +- .../Gui/ProjectOptionsPanelWidget.cs | 2 +- .../ChangeSetView.cs | 4 +- .../LogWidget.cs | 16 +- .../StatusView.cs | 4 +- .../MonoDevelop.TextEditor.Tests.csproj | 19 +- main/src/tools/mdmonitor/TimeLineView.cs | 348 +++++++++--------- ...mentation.Monitor.CounterSelectorDialog.cs | 4 +- main/src/tools/mdmonitor/gtk-gui/gui.stetic | 2 +- main/src/tools/mdmonitor/mdmonitor.csproj | 27 +- 36 files changed, 876 insertions(+), 818 deletions(-) diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs index 5d84535924f..859617a1309 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs @@ -354,7 +354,7 @@ protected override void OnDestroyed() } // TODO: Make static. - void TitleColDataFunc (TreeViewColumn treeColumn, CellRenderer cell, TreeModel model, TreeIter iter) + void TitleColDataFunc (TreeViewColumn treeColumn, CellRenderer cell, ITreeModel model, TreeIter iter) { var provider = (Tuple)model.GetValue (iter, 1); if (provider == null) { @@ -366,7 +366,7 @@ void TitleColDataFunc (TreeViewColumn treeColumn, CellRenderer cell, TreeModel m } // TODO: Make static. - void ComboDataFunc (TreeViewColumn treeColumn, CellRenderer cell, TreeModel model, TreeIter iter) + void ComboDataFunc (TreeViewColumn treeColumn, CellRenderer cell, ITreeModel model, TreeIter iter) { var provider = (Tuple)treeStore.GetValue (iter, 1); if (provider == null) { diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs index bfb8a69ea8a..5a3e762e2ac 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs @@ -97,7 +97,7 @@ public RefactoringPreviewDialog (IList changes) FillChanges (); } - void SetLocationTextData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + void SetLocationTextData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { CellRendererText cellRendererText = (CellRendererText)cell; Change change = store.GetValue (iter, objColumn) as Change; @@ -122,7 +122,7 @@ void SetLocationTextData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, } } - void SetDiffCellData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + void SetDiffCellData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { try { CellRendererDiff cellRendererDiff = (CellRendererDiff)cell; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs index e8a1e30986d..c45bc4bc3da 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs @@ -40,7 +40,7 @@ partial class BehaviorPanel private global::Gtk.Label label1; - private global::Gtk.ComboBox indentationCombobox; + private global::Gtk.ComboBoxText indentationCombobox; private global::Gtk.CheckButton tabAsReindentCheckbutton; @@ -56,7 +56,7 @@ partial class BehaviorPanel private global::Gtk.Label label2; - private global::Gtk.ComboBox controlLeftRightCombobox; + private global::Gtk.ComboBoxText controlLeftRightCombobox; protected virtual void Build() { @@ -228,7 +228,7 @@ protected virtual void Build() w14.Expand = false; w14.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.indentationCombobox = global::Gtk.ComboBox.NewText(); + this.indentationCombobox = new global::Gtk.ComboBoxText(); this.indentationCombobox.Name = "indentationCombobox"; this.hbox1.Add(this.indentationCombobox); global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.indentationCombobox])); @@ -304,7 +304,7 @@ protected virtual void Build() w22.Expand = false; w22.Fill = false; // Container child hbox3.Gtk.Box+BoxChild - this.controlLeftRightCombobox = global::Gtk.ComboBox.NewText(); + this.controlLeftRightCombobox = new global::Gtk.ComboBoxText(); this.controlLeftRightCombobox.Name = "controlLeftRightCombobox"; this.hbox3.Add(this.controlLeftRightCombobox); global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.controlLeftRightCombobox])); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.CompletionOptionsPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.CompletionOptionsPanel.cs index 471fa7d3fcb..f593592dc15 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.CompletionOptionsPanel.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.CompletionOptionsPanel.cs @@ -205,7 +205,7 @@ protected virtual void Build () this.openingRadiobutton.Name = "openingRadiobutton"; this.openingRadiobutton.DrawIndicator = true; this.openingRadiobutton.UseUnderline = true; - this.openingRadiobutton.Group = new global::GLib.SList (global::System.IntPtr.Zero); + this.openingRadiobutton.Group = new Gtk.RadioButton [0]; this.hbox2.Add (this.openingRadiobutton); global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.openingRadiobutton])); w14.Position = 1; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs index 32e5661d417..2aba84da7ce 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs @@ -20,7 +20,7 @@ internal partial class GeneralOptionsPanel private global::Gtk.Label label1; - private global::Gtk.ComboBox comboboxLineEndings; + private global::Gtk.ComboBoxText comboboxLineEndings; private global::Gtk.Label GtkLabel14; @@ -106,7 +106,7 @@ protected virtual void Build() w4.Expand = false; w4.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.comboboxLineEndings = global::Gtk.ComboBox.NewText(); + this.comboboxLineEndings = new global::Gtk.ComboBoxText(); this.comboboxLineEndings.Name = "comboboxLineEndings"; this.hbox1.Add(this.comboboxLineEndings); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.comboboxLineEndings])); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs index eda778d4059..af0fd707e18 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs @@ -40,7 +40,7 @@ partial class MarkerPanel private global::Gtk.Label label1; - private global::Gtk.ComboBox showWhitespacesCombobox; + private global::Gtk.ComboBoxText showWhitespacesCombobox; protected virtual void Build() { @@ -239,7 +239,7 @@ protected virtual void Build() w14.XOptions = ((global::Gtk.AttachOptions)(4)); w14.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.showWhitespacesCombobox = global::Gtk.ComboBox.NewText(); + this.showWhitespacesCombobox = new global::Gtk.ComboBoxText(); this.showWhitespacesCombobox.Name = "showWhitespacesCombobox"; this.table1.Add(this.showWhitespacesCombobox); global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table1[this.showWhitespacesCombobox])); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.cs b/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.cs index 28252a8d01f..338ea74461f 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.cs @@ -6,7 +6,7 @@ partial class NewColorShemeDialog { private global::Gtk.Table table1; - private global::Gtk.ComboBox comboboxBaseStyle; + private global::Gtk.ComboBoxText comboboxBaseStyle; private global::Gtk.Entry entryDescription; @@ -31,7 +31,7 @@ protected virtual void Build() this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -40,7 +40,7 @@ protected virtual void Build() this.table1.RowSpacing = ((uint)(6)); this.table1.ColumnSpacing = ((uint)(6)); // Container child table1.Gtk.Table+TableChild - this.comboboxBaseStyle = global::Gtk.ComboBox.NewText(); + this.comboboxBaseStyle = new global::Gtk.ComboBoxText(); this.comboboxBaseStyle.Name = "comboboxBaseStyle"; this.table1.Add(this.comboboxBaseStyle); global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1[this.comboboxBaseStyle])); @@ -115,7 +115,7 @@ protected virtual void Build() w8.Expand = false; w8.Fill = false; // Internal child MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.ActionArea - global::Gtk.HButtonBox w9 = this.ActionArea; + global::Gtk.HButtonBox w9 = (Gtk.HButtonBox)this.ActionArea; w9.Name = "dialog1_ActionArea"; w9.Spacing = 10; w9.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs index 77a59428785..096ed710b01 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs @@ -213,10 +213,10 @@ void DrawList (Gdk.EventExpose args) var window = args.Window; int winWidth, winHeight; - window.GetSize (out winWidth, out winHeight); +// window.GetSize (out winWidth, out winHeight); int ypos = margin; - int lineWidth = winWidth - margin*2; +// int lineWidth = winWidth - margin*2; int xpos = margin + padding; using (var cr = this.CreateXwtContext ()) { @@ -227,67 +227,67 @@ void DrawList (Gdk.EventExpose args) int n = 0; n = (int)(vadj.Value / rowHeight); - while (ypos < winHeight - margin && n < win.DataProvider.Count) { - bool hasMarkup = false; - IMarkupListDataProvider markupListDataProvider = win.DataProvider as IMarkupListDataProvider; - if (markupListDataProvider != null) { - if (markupListDataProvider.HasMarkup (n)) { - layout.Markup = (markupListDataProvider.GetMarkup (n) ?? "<null>"); - hasMarkup = true; - } - } - - if (!hasMarkup) - layout.Text = (win.DataProvider.GetText (n) ?? ""); - - Xwt.Drawing.Image icon = win.DataProvider.GetIcon (n); - int iconHeight, iconWidth; - - if (icon != null) { - iconWidth = (int)icon.Width; - iconHeight = (int)icon.Height; - } else if (!Gtk.Icon.SizeLookup (Gtk.IconSize.Menu, out iconWidth, out iconHeight)) { - iconHeight = iconWidth = 24; - } - - var s = layout.GetSize (); - int typos, iypos; - int he = (int)s.Height; - - typos = he < rowHeight ? ypos + (rowHeight - he) / 2 : ypos; - iypos = iconHeight < rowHeight ? ypos + (rowHeight - iconHeight) / 2 : ypos; - - if (n == selection) { - if (!disableSelection) { - cr.Rectangle (margin, ypos, lineWidth, he + padding); - cr.SetColor (this.Style.Base (StateType.Selected).ToXwtColor ()); - cr.Fill (); - - cr.SetColor (this.Style.Text (StateType.Selected).ToXwtColor ()); - cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos); - } else { - cr.Rectangle (margin, ypos, lineWidth, he + padding); - cr.SetColor (this.Style.Base (StateType.Selected).ToXwtColor ()); - cr.Stroke (); - - cr.SetColor (textColor); - cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos); - } - } else { - cr.SetColor (textColor); - cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos); - } - - if (icon != null) - cr.DrawImage (icon, xpos, iypos); - - ypos += rowHeight; - n++; - - //reset the markup or it carries over to the next SetText - if (hasMarkup) - layout.Markup = string.Empty; - } +// while (ypos < winHeight - margin && n < win.DataProvider.Count) { +// bool hasMarkup = false; +// IMarkupListDataProvider markupListDataProvider = win.DataProvider as IMarkupListDataProvider; +// if (markupListDataProvider != null) { +// if (markupListDataProvider.HasMarkup (n)) { +// layout.Markup = (markupListDataProvider.GetMarkup (n) ?? "<null>"); +// hasMarkup = true; +// } +// } +// +// if (!hasMarkup) +// layout.Text = (win.DataProvider.GetText (n) ?? ""); +// +// Xwt.Drawing.Image icon = win.DataProvider.GetIcon (n); +// int iconHeight, iconWidth; +// +// if (icon != null) { +// iconWidth = (int)icon.Width; +// iconHeight = (int)icon.Height; +// } else if (!Gtk.Icon.SizeLookup (Gtk.IconSize.Menu, out iconWidth, out iconHeight)) { +// iconHeight = iconWidth = 24; +// } +// +// var s = layout.GetSize (); +// int typos, iypos; +// int he = (int)s.Height; +// +// typos = he < rowHeight ? ypos + (rowHeight - he) / 2 : ypos; +// iypos = iconHeight < rowHeight ? ypos + (rowHeight - iconHeight) / 2 : ypos; +// +// if (n == selection) { +// if (!disableSelection) { +// cr.Rectangle (margin, ypos, lineWidth, he + padding); +// cr.SetColor (this.Style.Base (StateType.Selected).ToXwtColor ()); +// cr.Fill (); +// +// cr.SetColor (this.Style.Text (StateType.Selected).ToXwtColor ()); +// cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos); +// } else { +// cr.Rectangle (margin, ypos, lineWidth, he + padding); +// cr.SetColor (this.Style.Base (StateType.Selected).ToXwtColor ()); +// cr.Stroke (); +// +// cr.SetColor (textColor); +// cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos); +// } +// } else { +// cr.SetColor (textColor); +// cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos); +// } +// +// if (icon != null) +// cr.DrawImage (icon, xpos, iypos); +// +// ypos += rowHeight; +// n++; +// +// //reset the markup or it carries over to the next SetText +// if (hasMarkup) +// layout.Markup = string.Empty; +// } } } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWindow.cs index 8ef8f91b91e..d5375bdfdef 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWindow.cs @@ -368,15 +368,15 @@ protected virtual void OnSelectionChanged () { } - protected override bool OnExposeEvent (Gdk.EventExpose args) - { - base.OnExposeEvent (args); - - int winWidth, winHeight; - this.GetSize (out winWidth, out winHeight); - this.GdkWindow.DrawRectangle (this.Style.ForegroundGC (StateType.Insensitive), false, 0, 0, winWidth-1, winHeight-1); - return false; - } +// protected override bool OnExposeEvent (Gdk.EventExpose args) +// { +// base.OnExposeEvent (args); +// +// int winWidth, winHeight; +// this.GetSize (out winWidth, out winHeight); +// this.GdkWindow.DrawRectangle (this.Style.ForegroundGC (StateType.Insensitive), false, 0, 0, winWidth-1, winHeight-1); +// return false; +// } public int TextOffset { get { return list.TextOffset + (int) this.BorderWidth; } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs index 8aa7c1efb5a..bb70872901f 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs @@ -60,11 +60,11 @@ public ModeHelpWindow () void CheckScreenColormap () { - Colormap = Screen.RgbaColormap; - if (Colormap == null) { - Colormap = Screen.RgbColormap; - SupportsAlpha = false; - } else +// Colormap = Screen.RgbaColormap; +// if (Colormap == null) { +// Colormap = Screen.RgbColormap; +// SupportsAlpha = false; +// } else SupportsAlpha = true; } @@ -85,16 +85,14 @@ public TableLayoutModeHelpWindow () layout = new Pango.Layout (PangoContext); } - protected override void OnSizeRequested (ref Gtk.Requisition requisition) + protected override void OnGetPreferredWidth (out int minimum_width, out int natural_width) { - base.OnSizeRequested (ref requisition); + base.OnGetPreferredWidth (out minimum_width, out natural_width); int descriptionWidth = 1; - int totalHeight = yBorder * 2 + 1; - + int width, height; layout.SetText (TitleText); layout.GetPixelSize (out width, out height); - totalHeight += height; xSpacer = 0; foreach (var pair in Items) { int w1, w2; @@ -105,13 +103,31 @@ protected override void OnSizeRequested (ref Gtk.Requisition requisition) layout.GetPixelSize (out w2, out height); descriptionWidth = System.Math.Max (descriptionWidth, w2); xSpacer = System.Math.Max (xSpacer, w1); - - totalHeight += height; } xSpacer += xBorder * 2 + 1; - - requisition.Width = descriptionWidth + xSpacer + xBorder * 2 + 1; - requisition.Height = totalHeight; + + minimum_width = natural_width = descriptionWidth + xSpacer + xBorder * 2 + 1; + } + + protected override void OnGetPreferredHeight (out int minimum_height, out int natural_height) + { + base.OnGetPreferredHeight (out minimum_height, out natural_height); + int totalHeight = yBorder * 2 + 1; + + int width, height; + layout.SetText (TitleText); + layout.GetPixelSize (out width, out height); + totalHeight += height; + foreach (var pair in Items) { + int w1, w2; + layout.SetMarkup (pair.Key); + layout.GetPixelSize (out w1, out height); + + layout.SetMarkup (pair.Value); + layout.GetPixelSize (out w2, out height); + totalHeight += height; + } + minimum_height = natural_height = totalHeight; } int xSpacer = 0; @@ -128,89 +144,84 @@ protected override void OnDestroyed () const int xBorder = 4; const int yBorder = 2; - - protected override bool OnExposeEvent (Gdk.EventExpose args) - { - using (var g = Gdk.CairoHelper.Create (args.Window)) { - g.Translate (Allocation.X, Allocation.Y); - g.LineWidth = 1; - - Gdk.GC gc = new Gdk.GC (args.Window); - layout.SetMarkup (TitleText); - int width, height; + + protected override bool OnDrawn (Context g) + { + g.Translate (Allocation.X, Allocation.Y); + g.LineWidth = 1; +// Gdk.GC gc = new Gdk.GC (args.Window); + layout.SetMarkup (TitleText); + int width, height; + layout.GetPixelSize (out width, out height); + width += xBorder * 2; + FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, true, false, 0.5, 0.5, height + yBorder * 2 + 1.5, width, height + yBorder * 2); + g.SetSourceColor (Styles.TableLayoutModeTitleBackgroundColor.ToCairoColor ()); + g.FillPreserve (); + g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); + g.Stroke (); + + g.Save (); + g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ()); + g.Translate (xBorder, yBorder); + g.ShowLayout (layout); + g.Restore (); + + FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, 0.5, height * 2 + yBorder * 2 + 0.5, height, Allocation.Width - 1, Allocation.Height - height * 2 - yBorder * 2 - 1); + g.SetSourceColor (Styles.TableLayoutModeBackgroundColor.ToCairoColor ()); + g.FillPreserve (); + g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); + g.Stroke (); + + g.MoveTo (xSpacer + 0.5, height * 2 + yBorder * 2); + g.LineTo (xSpacer + 0.5, Allocation.Height - 1); + g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); + g.Stroke (); + + int y = height + yBorder * 2; + + for (int i = 0; i < Items.Count; i++) { + KeyValuePair pair = Items [i]; + + layout.SetMarkup (pair.Key); layout.GetPixelSize (out width, out height); - width += xBorder * 2; - FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, true, false, 0.5, 0.5, height + yBorder * 2 + 1.5, width, height + yBorder * 2); - g.SetSourceColor (Styles.TableLayoutModeTitleBackgroundColor.ToCairoColor ()); - g.FillPreserve (); - g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); - g.Stroke (); + if (i == 0) { + FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, false, false, 0, y + 0.5, height + 1.5, Allocation.Width, height); + g.SetSourceColor (Styles.TableLayoutModeCategoryBackgroundColor.ToCairoColor ()); + g.FillPreserve (); + g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); + g.Stroke (); + + g.MoveTo (xSpacer + 0.5, height + yBorder * 2 + 1); + g.LineTo (xSpacer + 0.5, height * 2 + yBorder * 2 + 1); + g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); + g.Stroke (); + } + +// gc.RgbFgColor = (HslColor)(i == 0 ? Styles.TableLayoutModeBackgroundColor : Styles.TableLayoutModeTextColor).ToCairoColor (); g.Save (); g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ()); - g.Translate (xBorder, yBorder); + g.Translate (xBorder, y); g.ShowLayout (layout); g.Restore (); - FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, 0.5, height * 2 + yBorder * 2 + 0.5, height, Allocation.Width - 1, Allocation.Height - height * 2 - yBorder * 2 - 1); - g.SetSourceColor (Styles.TableLayoutModeBackgroundColor.ToCairoColor ()); - g.FillPreserve (); - g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); - g.Stroke (); - - g.MoveTo (xSpacer + 0.5, height * 2 + yBorder * 2); - g.LineTo (xSpacer + 0.5, Allocation.Height - 1); - g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); - g.Stroke (); - - int y = height + yBorder * 2; - - for (int i = 0; i < Items.Count; i++) { - KeyValuePair pair = Items[i]; - - layout.SetMarkup (pair.Key); - layout.GetPixelSize (out width, out height); - - if (i == 0) { - FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, false, false, 0, y + 0.5, height + 1.5, Allocation.Width, height); - g.SetSourceColor (Styles.TableLayoutModeCategoryBackgroundColor.ToCairoColor ()); - g.FillPreserve (); - g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); - g.Stroke (); - - g.MoveTo (xSpacer + 0.5, height + yBorder * 2 + 1); - g.LineTo (xSpacer + 0.5, height * 2 + yBorder * 2 + 1); - g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); - g.Stroke (); - } - - gc.RgbFgColor = (HslColor)(i == 0 ? Styles.TableLayoutModeBackgroundColor : Styles.TableLayoutModeTextColor).ToCairoColor (); - g.Save (); - g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ()); - g.Translate (xBorder, y); - g.ShowLayout (layout); - g.Restore (); - - g.Save (); - g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ()); - g.Translate (xSpacer + xBorder, y); - layout.SetMarkup (pair.Value); - g.ShowLayout (layout); - g.Restore (); - - // draw top line - if (i > 0) { - g.MoveTo (1, y + 0.5); - g.LineTo (Allocation.Width - 1, y + 0.5); - g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); - g.Stroke (); - } - y += height; + g.Save (); + g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ()); + g.Translate (xSpacer + xBorder, y); + layout.SetMarkup (pair.Value); + g.ShowLayout (layout); + g.Restore (); + + // draw top line + if (i > 0) { + g.MoveTo (1, y + 0.5); + g.LineTo (Allocation.Width - 1, y + 0.5); + g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); + g.Stroke (); } - gc.Dispose (); + y += height; } - - return base.OnExposeEvent (args); + return base.OnDrawn (g); } } @@ -426,29 +437,40 @@ public InsertionCursorLayoutModeHelpWindow () titleLayout.FontDescription = desc; } - protected override void OnSizeRequested (ref Gtk.Requisition requisition) + protected override void OnGetPreferredWidth (out int minimum_width, out int natural_width) { - base.OnSizeRequested (ref requisition); + base.OnGetPreferredWidth (out minimum_width, out natural_width); int descriptionWidth = 1; - int totalHeight = yTitleBorder * 2 + yDescriptionBorder * 2 + 1; - + int width, height; titleLayout.SetText (TitleText); titleLayout.GetPixelSize (out width, out height); - totalHeight += height; xSpacer = 0; - int h2 = descTexts.Sum (x => x.Height + x.Spacing); int w2 = descTexts.Max (x => x.Width + x.Spacing * 2); - totalHeight += h2 + 4; xSpacer = System.Math.Max (width, w2); xSpacer += xDescriptionBorder * 2 + 1; - - requisition.Width = triangleWidth + descriptionWidth + xSpacer; - requisition.Height = totalHeight; + + minimum_width = natural_width = triangleWidth + descriptionWidth + xSpacer; } - + + protected override void OnGetPreferredHeight (out int minimum_height, out int natural_height) + { + base.OnGetPreferredHeight (out minimum_height, out natural_height); + int totalHeight = yTitleBorder * 2 + yDescriptionBorder * 2 + 1; + + int width, height; + titleLayout.SetText (TitleText); + titleLayout.GetPixelSize (out width, out height); + totalHeight += height; + + int h2 = descTexts.Sum (x => x.Height + x.Spacing); + totalHeight += h2 + 4; + + minimum_height = natural_height = totalHeight; + } + int xSpacer = 0; protected override void OnDestroyed () diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedBox.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedBox.cs index 7eed8ddcd40..6beb2f0fd01 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedBox.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedBox.cs @@ -61,8 +61,8 @@ abstract class AnimatedBox : Container protected AnimatedBox (bool horizontal) { GtkWorkarounds.FixContainerLeak (this); - - WidgetFlags |= WidgetFlags.NoWindow; + + this.HasWindow = false; this.horizontal = horizontal; stage.ActorStep += OnActorStep; border_stage.Iteration += OnBorderIteration; @@ -179,30 +179,44 @@ protected override void OnAdded (Widget widget) PackStart (widget, duration, easing, blocking); } - protected override void OnSizeRequested (ref Requisition requisition) + protected override void OnGetPreferredWidth (out int minimum_width, out int natural_width) { int width = 0; - int height = 0; - + if (horizontal) { width = start_border + end_border; - } else { - height = start_border + end_border; } - + foreach (AnimatedWidget widget in Widgets) { Requisition req = widget.SizeRequest (); if (horizontal) { width += req.Width; - height = System.Math.Max (height, req.Height); } else { width = System.Math.Max (width, req.Width); + } + } + + minimum_width = natural_width = width; + } + + protected override void OnGetPreferredHeight (out int minimum_height, out int natural_height) + { + int height = 0; + + if (!horizontal) { + height = start_border + end_border; + } + + foreach (AnimatedWidget widget in Widgets) { + Requisition req = widget.SizeRequest (); + if (horizontal) { + height = System.Math.Max (height, req.Height); + } else { height += req.Height; } } - - requisition.Width = width; - requisition.Height = height; + + minimum_height = natural_height = height; } protected override void OnSizeAllocated (Rectangle allocation) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs index 921bd1126dc..e8e2aa283b7 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs @@ -63,7 +63,7 @@ internal class AnimatedWidget : Container private readonly bool horizontal; private double percent; private Rectangle widget_alloc; - private Pixmap canvas; +// private Pixmap canvas; public AnimatedWidget (Widget widget, uint duration, Easing easing, Blocking blocking, bool horizontal) { @@ -95,13 +95,13 @@ private void OnWidgetDestroyed (object sender, EventArgs args) return; } - canvas = new Pixmap (GdkWindow, widget_alloc.Width, widget_alloc.Height); - if (Platform.IsMac) { - //FIXME: quick hack to make less ugly on Mac, because Mac GTK doesn't yet support offscreen drawing - canvas.DrawRectangle (Style.BackgroundGC (State), true, 0, 0, widget_alloc.Width, widget_alloc.Height); - } else { - canvas.DrawDrawable (Style.BackgroundGC (State), GdkWindow, widget_alloc.X, widget_alloc.Y, 0, 0, widget_alloc.Width, widget_alloc.Height); - } +// canvas = new Pixmap (GdkWindow, widget_alloc.Width, widget_alloc.Height); +// if (Platform.IsMac) { +// //FIXME: quick hack to make less ugly on Mac, because Mac GTK doesn't yet support offscreen drawing +// canvas.DrawRectangle (Style.BackgroundGC (State), true, 0, 0, widget_alloc.Width, widget_alloc.Height); +// } else { +// canvas.DrawDrawable (Style.BackgroundGC (State), GdkWindow, widget_alloc.X, widget_alloc.Y, 0, 0, widget_alloc.Width, widget_alloc.Height); +// } if (AnimationState != AnimationState.Going) { WidgetDestroyed (this, args); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs index 58f7b9ada62..97547a1f5aa 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs @@ -26,6 +26,7 @@ // THE SOFTWARE. using System; +using Cairo; using Gdk; using MonoDevelop.Core; @@ -52,7 +53,7 @@ public BounceFadePopupWindow (MonoTextEditor editor) : base (Gtk.WindowType.Popu DoubleBuffered = true; Decorated = false; BorderWidth = 0; - HasFrame = true; +// HasFrame = true; this.editor = editor; Events = Gdk.EventMask.ExposureMask; Duration = 500; @@ -60,10 +61,10 @@ public BounceFadePopupWindow (MonoTextEditor editor) : base (Gtk.WindowType.Popu ExpandHeight = 2; BounceEasing = Easing.Sine; - var rgbaColormap = Screen.RgbaColormap; - if (rgbaColormap == null) +// var rgbaColormap = Screen.RgbaColormap; +// if (rgbaColormap == null) return; - Colormap = rgbaColormap; +// Colormap = rgbaColormap; stage.ActorStep += OnAnimationActorStep; stage.Iteration += OnAnimationIteration; @@ -87,7 +88,7 @@ public BounceFadePopupWindow (MonoTextEditor editor) : base (Gtk.WindowType.Popu int x, y; protected int width, height; double vValue, hValue; - protected Rectangle bounds; +// protected Rectangle bounds; public virtual void Popup () { @@ -96,13 +97,13 @@ public virtual void Popup () return; } editor.GdkWindow.GetOrigin (out x, out y); - bounds = CalculateInitialBounds (); - x = x + bounds.X - (int)(ExpandWidth / 2); - y = y + bounds.Y - (int)(ExpandHeight / 2); +// bounds = CalculateInitialBounds (); +// x = x + bounds.X - (int)(ExpandWidth / 2); +// y = y + bounds.Y - (int)(ExpandHeight / 2); Move (x, y); - width = System.Math.Max (1, bounds.Width + (int)ExpandWidth); - height = System.Math.Max (1, bounds.Height + (int)ExpandHeight); +// width = System.Math.Max (1, bounds.Width + (int)ExpandWidth); +// height = System.Math.Max (1, bounds.Height + (int)ExpandHeight); Resize (width, height); @@ -215,7 +216,7 @@ internal virtual void StopPlaying () } } - protected abstract Rectangle CalculateInitialBounds (); +// protected abstract Rectangle CalculateInitialBounds (); @@ -239,7 +240,7 @@ public BounceFadePopupWidget (MonoTextEditor editor) throw new InvalidOperationException ("Only works with composited screen. Check Widget.IsComposited."); if (editor == null) throw new ArgumentNullException ("Editor"); - WidgetFlags |= Gtk.WidgetFlags.NoWindow; + this.HasWindow = false; this.editor = editor; Events = EventMask.ExposureMask; Duration = 500; @@ -247,10 +248,10 @@ public BounceFadePopupWidget (MonoTextEditor editor) ExpandHeight = 2; BounceEasing = Easing.Sine; - var rgbaColormap = Screen.RgbaColormap; - if (rgbaColormap == null) +// var rgbaColormap = Screen.RgbaColormap; +// if (rgbaColormap == null) return; - Colormap = rgbaColormap; +// Colormap = rgbaColormap; stage.ActorStep += OnAnimationActorStep; stage.Iteration += OnAnimationIteration; @@ -337,18 +338,16 @@ protected virtual bool OnAnimationActorStep (Actor actor) return true; } - protected override bool OnExposeEvent (EventExpose evnt) + protected override bool OnDrawn (Context cr) { try { var alloc = Allocation; - using (var cr = CairoHelper.Create (evnt.Window)) { - cr.Translate (alloc.X, alloc.Y); - cr.Translate (xExpandedOffset * (1 - scale), yExpandedOffset * (1 - scale)); - var scaleX = (alloc.Width / userspaceArea.Width - 1) * scale + 1; - var scaleY = (alloc.Height / userspaceArea.Height - 1) * scale + 1; - cr.Scale (scaleX, scaleY); - Draw (cr, userspaceArea); - } + cr.Translate (alloc.X, alloc.Y); + cr.Translate (xExpandedOffset * (1 - scale), yExpandedOffset * (1 - scale)); + var scaleX = (alloc.Width / userspaceArea.Width - 1) * scale + 1; + var scaleY = (alloc.Height / userspaceArea.Height - 1) * scale + 1; + cr.Scale (scaleX, scaleY); + Draw (cr, userspaceArea); } catch (Exception e) { LoggingService.LogError ("Exception in animation:", e); } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs index 3b4a440d85f..85a96a8ba62 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs @@ -4,6 +4,7 @@ using Gdk; using System.Collections.Generic; using MonoDevelop.Components; +using Cairo; namespace Mono.TextEditor.Theatrics { @@ -184,34 +185,34 @@ protected override void OnRemoved (Widget widget) } base.OnRemoved (widget); } - protected override void OnSizeAllocated (Rectangle allocation) - { - base.OnSizeAllocated (allocation); - - int margin = BorderVisible ? 1 : 0; - int vwidth = vScrollBar.Visible ? vScrollBar.Requisition.Width : 0; - int hheight = hScrollBar.Visible ? hScrollBar.Requisition.Height : 0; - var childRectangle = new Rectangle (allocation.X + margin, allocation.Y + margin, allocation.Width - vwidth - margin*2, allocation.Height - hheight - margin*2); - - if (Child != null) - Child.SizeAllocate (childRectangle); - if (vScrollBar.Visible) { - int vChildTopHeight = -1; - foreach (var child in children.Where (child => child.ChildPosition == ChildPosition.Top)) { - child.Child.SizeAllocate (new Rectangle (childRectangle.RightInside (), childRectangle.Y + vChildTopHeight, allocation.Width - vwidth, child.Child.Requisition.Height)); - vChildTopHeight += child.Child.Requisition.Height; - } - int v = vScrollBar is Scrollbar && hScrollBar.Visible ? hScrollBar.Requisition.Height : 0; - vScrollBar.SizeAllocate (new Rectangle (childRectangle.X + childRectangle.Width + margin, childRectangle.Y + vChildTopHeight, vwidth, Allocation.Height - v - vChildTopHeight - margin)); - vAdjustment.Value = System.Math.Max (System.Math.Min (vAdjustment.Upper - vAdjustment.PageSize, vAdjustment.Value), vAdjustment.Lower); - } - - if (hScrollBar.Visible) { - int v = vScrollBar.Visible ? vScrollBar.Requisition.Width : 0; - hScrollBar.SizeAllocate (new Rectangle (allocation.X, childRectangle.Y + childRectangle.Height + margin, allocation.Width - v, hheight)); - hScrollBar.Value = System.Math.Max (System.Math.Min (hAdjustment.Upper - hAdjustment.PageSize, hScrollBar.Value), hAdjustment.Lower); - } - } +// protected override void OnSizeAllocated (Rectangle allocation) +// { +// base.OnSizeAllocated (allocation); +// +// int margin = BorderVisible ? 1 : 0; +// int vwidth = vScrollBar.Visible ? vScrollBar.Requisition.Width : 0; +// int hheight = hScrollBar.Visible ? hScrollBar.Requisition.Height : 0; +// var childRectangle = new Rectangle (allocation.X + margin, allocation.Y + margin, allocation.Width - vwidth - margin*2, allocation.Height - hheight - margin*2); +// +// if (Child != null) +// Child.SizeAllocate (childRectangle); +// if (vScrollBar.Visible) { +// int vChildTopHeight = -1; +// foreach (var child in children.Where (child => child.ChildPosition == ChildPosition.Top)) { +// child.Child.SizeAllocate (new Rectangle (childRectangle.RightInside (), childRectangle.Y + vChildTopHeight, allocation.Width - vwidth, child.Child.Requisition.Height)); +// vChildTopHeight += child.Child.Requisition.Height; +// } +// int v = vScrollBar is Scrollbar && hScrollBar.Visible ? hScrollBar.Requisition.Height : 0; +// vScrollBar.SizeAllocate (new Rectangle (childRectangle.X + childRectangle.Width + margin, childRectangle.Y + vChildTopHeight, vwidth, Allocation.Height - v - vChildTopHeight - margin)); +// vAdjustment.Value = System.Math.Max (System.Math.Min (vAdjustment.Upper - vAdjustment.PageSize, vAdjustment.Value), vAdjustment.Lower); +// } +// +// if (hScrollBar.Visible) { +// int v = vScrollBar.Visible ? vScrollBar.Requisition.Width : 0; +// hScrollBar.SizeAllocate (new Rectangle (allocation.X, childRectangle.Y + childRectangle.Height + margin, allocation.Width - v, hheight)); +// hScrollBar.Value = System.Math.Max (System.Math.Min (hAdjustment.Upper - hAdjustment.PageSize, hScrollBar.Value), hAdjustment.Lower); +// } +// } static double Clamp (double min, double val, double max) { @@ -250,30 +251,27 @@ protected override void OnGetPreferredHeight (out int minimum_height, out int na vScrollBar.SizeRequest (); children.ForEach (child => child.Child.SizeRequest ()); } - - protected override bool OnExposeEvent (EventExpose evnt) + + protected override bool OnDrawn (Context cr) { if (BorderVisible) { - using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) { - cr.LineWidth = 1; - - var alloc = Allocation; - int right = alloc.RightInside (); - int bottom = alloc.BottomInside (); - - cr.SharpLineX (alloc.X, alloc.Y, alloc.X, bottom); - cr.SharpLineX (right, alloc.Y, right, bottom); - - cr.SharpLineY (alloc.X, alloc.Y, right, alloc.Y); - cr.SharpLineY (alloc.X, bottom, right, bottom); - - cr.SetSourceColor ((HslColor)Style.Dark (State)); - cr.Stroke (); - } + cr.LineWidth = 1; + + var alloc = Allocation; + int right = alloc.RightInside (); + int bottom = alloc.BottomInside (); + + cr.SharpLineX (alloc.X, alloc.Y, alloc.X, bottom); + cr.SharpLineX (right, alloc.Y, right, bottom); + + cr.SharpLineY (alloc.X, alloc.Y, right, alloc.Y); + cr.SharpLineY (alloc.X, bottom, right, bottom); + + cr.SetSourceColor ((HslColor)Style.Dark (State)); + cr.Stroke (); } - return base.OnExposeEvent (evnt); + return base.OnDrawn (cr); } - - } +} } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs index 492f82aae9f..34b54fde9ed 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs @@ -138,13 +138,13 @@ protected override void OnDestroyed () informLayout = informLayout.Kill (); fontDescription = fontDescription.Kill (); fontInform = fontInform.Kill (); - if (textGC != null) { - textGC.Dispose (); - textBgGC.Dispose (); - foldGC.Dispose (); - foldBgGC.Dispose (); - textGC = textBgGC = foldGC = foldBgGC = null; - } +// if (textGC != null) { +// textGC.Dispose (); +// textBgGC.Dispose (); +// foldGC.Dispose (); +// foldBgGC.Dispose (); +// textGC = textBgGC = foldGC = foldBgGC = null; +// } editor = null; base.OnDestroyed (); } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/MonoTextEditor.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/MonoTextEditor.cs index 52078b95884..37f1b50a2aa 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/MonoTextEditor.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/MonoTextEditor.cs @@ -85,7 +85,7 @@ internal MonoTextEditor (TextDocument doc, ITextEditorOptions options, EditMode this.Direction = TextDirection.Ltr; uiThread = Thread.CurrentThread; GtkWorkarounds.FixContainerLeak (this); - WidgetFlags |= WidgetFlags.NoWindow; + this.HasWindow = false; LayoutCache = new LayoutCache (this); this.textArea = new TextArea (doc, options, initialMode); this.textArea.Initialize (this, doc, options, initialMode); @@ -146,22 +146,22 @@ void UnregisterAdjustments () Adjustment hAdjustement; Adjustment vAdjustement; - protected override void OnSetScrollAdjustments (Adjustment hAdjustement, Adjustment vAdjustement) - { - UnregisterAdjustments (); - this.vAdjustement = vAdjustement; - this.hAdjustement = hAdjustement; - base.OnSetScrollAdjustments (hAdjustement, vAdjustement); - textArea.SetTextEditorScrollAdjustments (hAdjustement, vAdjustement); - if (hAdjustement != null) { - hAdjustement.ValueChanged += HandleAdjustmentValueChange; - } - - if (vAdjustement != null) { - vAdjustement.ValueChanged += HandleAdjustmentValueChange; - } - OnScrollAdjustmentsSet (); - } +// protected override void OnSetScrollAdjustments (Adjustment hAdjustement, Adjustment vAdjustement) +// { +// UnregisterAdjustments (); +// this.vAdjustement = vAdjustement; +// this.hAdjustement = hAdjustement; +// base.OnSetScrollAdjustments (hAdjustement, vAdjustement); +// textArea.SetTextEditorScrollAdjustments (hAdjustement, vAdjustement); +// if (hAdjustement != null) { +// hAdjustement.ValueChanged += HandleAdjustmentValueChange; +// } +// +// if (vAdjustement != null) { +// vAdjustement.ValueChanged += HandleAdjustmentValueChange; +// } +// OnScrollAdjustmentsSet (); +// } void HandleAdjustmentValueChange (object sender, EventArgs e) { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs index c2b80240757..e147449737a 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs @@ -50,6 +50,7 @@ using MonoDevelop.Core.Text; using MonoDevelop.Ide.Editor; using MonoDevelop.Ide.Editor.Highlighting; +using Cairo; namespace Mono.TextEditor { @@ -220,7 +221,7 @@ protected virtual void HAdjustmentValueChanged () textViewMargin.HideCodeSegmentPreviewWindow (); QueueDrawArea ((int)this.textViewMargin.XOffset, 0, this.Allocation.Width - (int)this.textViewMargin.XOffset, this.Allocation.Height); OnHScroll (EventArgs.Empty); - SetChildrenPositions (Allocation); +// SetChildrenPositions (Allocation); } void VAdjustmentValueChanged (object sender, EventArgs args) @@ -228,7 +229,7 @@ void VAdjustmentValueChanged (object sender, EventArgs args) var alloc = this.Allocation; alloc.X = alloc.Y = 0; VAdjustmentValueChanged (); - SetChildrenPositions (alloc); +// SetChildrenPositions (alloc); } protected virtual void VAdjustmentValueChanged () @@ -326,7 +327,7 @@ int TooltipKeySnooper (Gtk.Widget widget, EventKey evnt) nextTipX = tipX; nextTipY = tipY; nextTipOffset = tipOffset; - nextTipScheduledTime = DateTime.FromBinary (0); + nextTipScheduledTime = System.DateTime.FromBinary (0); tipItem = null; TooltipTimer (); } @@ -438,9 +439,9 @@ internal void Initialize (MonoTextEditor editor, TextDocument doc, ITextEditorOp args.RetVal = true; }; - using (Pixmap inv = new Pixmap (null, 1, 1, 1)) { - invisibleCursor = new Cursor (inv, inv, Gdk.Color.Zero, Gdk.Color.Zero, 0, 0); - } +// using (Pixmap inv = new Pixmap (null, 1, 1, 1)) { +// invisibleCursor = new Cursor (inv, inv, Gdk.Color.Zero, Gdk.Color.Zero, 0, 0); +// } InitAnimations (); this.Document.HeightChanged += HandleDocumentHeightChanged; @@ -883,27 +884,27 @@ protected override void OnFocusGrabbed() protected override void OnRealized () { - WidgetFlags |= WidgetFlags.Realized; + this.IsRealized = true; WindowAttr attributes = new WindowAttr () { WindowType = Gdk.WindowType.Child, X = Allocation.X, Y = Allocation.Y, Width = Allocation.Width, Height = Allocation.Height, - Wclass = WindowClass.InputOutput, +// Wclass = WindowClass.InputOutput, Visual = this.Visual, - Colormap = this.Colormap, +// Colormap = this.Colormap, EventMask = (int)(this.Events | Gdk.EventMask.ExposureMask), Mask = this.Events | Gdk.EventMask.ExposureMask, }; - WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y | WindowAttributesType.Colormap | WindowAttributesType.Visual; - GdkWindow = new Gdk.Window (ParentWindow, attributes, mask); - GdkWindow.UserData = Raw; - GdkWindow.Background = Style.Background (StateType.Normal); - Style = Style.Attach (GdkWindow); +// WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y | WindowAttributesType.Colormap | WindowAttributesType.Visual; +// GdkWindow = new Gdk.Window (ParentWindow, attributes, mask); +// GdkWindow.UserData = Raw; +// GdkWindow.Background = Style.Background (StateType.Normal); +// Style = Style.Attach (GdkWindow); - imContext.ClientWindow = this.GdkWindow; +// imContext.ClientWindow = this.GdkWindow; Caret.PositionChanged += CaretPositionChanged; SetWidgetBgFromStyle (); @@ -1117,12 +1118,12 @@ internal void RedrawLine (int logicalLine, bool removeLineCache = true) public new void QueueDrawArea (int x, int y, int w, int h) { - if (GdkWindow != null) { - GdkWindow.InvalidateRect (new Rectangle (x, y, w, h), false); +// if (GdkWindow != null) { +// GdkWindow.InvalidateRect (new Rectangle (x, y, w, h), false); #if DEBUG_EXPOSE Console.WriteLine ("invalidated {0},{1} {2}x{3}", x, y, w, h); #endif - } +// } } public new void QueueDraw () @@ -1326,19 +1327,19 @@ bool HandleMarginKeyCommand (EventKey evnt) GtkWorkarounds.MapKeys (evnt, out key, out mod, out accels); - if (key == Gdk.Key.space) { - cm.HandleItemCommand (Margin.ItemCommand.ActivateCurrentItem); - } else if (key == Gdk.Key.Up) { - cm.HandleItemCommand (Margin.ItemCommand.FocusPreviousItem); - } else if (key == Gdk.Key.Down) { - cm.HandleItemCommand (Margin.ItemCommand.FocusNextItem); - } else if (key == Gdk.Key.Tab || key == Gdk.Key.Right) { - return FocusNextMargin (Gtk.DirectionType.TabForward); - } else if (key == Gdk.Key.ISO_Left_Tab || key == Gdk.Key.Left) { - return FocusNextMargin (DirectionType.TabBackward); - } else { +// if (key == Gdk.Key.space) { +// cm.HandleItemCommand (Margin.ItemCommand.ActivateCurrentItem); +// } else if (key == Gdk.Key.Up) { +// cm.HandleItemCommand (Margin.ItemCommand.FocusPreviousItem); +// } else if (key == Gdk.Key.Down) { +// cm.HandleItemCommand (Margin.ItemCommand.FocusNextItem); +// } else if (key == Gdk.Key.Tab || key == Gdk.Key.Right) { +// return FocusNextMargin (Gtk.DirectionType.TabForward); +// } else if (key == Gdk.Key.ISO_Left_Tab || key == Gdk.Key.Left) { +// return FocusNextMargin (DirectionType.TabBackward); +// } else { return false; - } +// } return true; } @@ -1520,18 +1521,18 @@ protected override void OnDragDataReceived (DragContext context, int x, int y, S { var undo = OpenUndoGroup (); int dragOffset = Document.LocationToOffset (dragCaretPos); - if (context.Action == DragAction.Move) { - if (CanEdit (Caret.Line) && !selection.IsEmpty) { - var selectionRange = selection.GetSelectionRange (textEditorData); - if (selectionRange.Offset < dragOffset) - dragOffset -= selectionRange.Length; - Caret.PreserveSelection = true; - textEditorData.DeleteSelection (selection); - Caret.PreserveSelection = false; - - selection = MonoDevelop.Ide.Editor.Selection.Empty; - } - } +// if (context.Action == DragAction.Move) { +// if (CanEdit (Caret.Line) && !selection.IsEmpty) { +// var selectionRange = selection.GetSelectionRange (textEditorData); +// if (selectionRange.Offset < dragOffset) +// dragOffset -= selectionRange.Length; +// Caret.PreserveSelection = true; +// textEditorData.DeleteSelection (selection); +// Caret.PreserveSelection = false; +// +// selection = MonoDevelop.Ide.Editor.Selection.Empty; +// } +// } if (selection_data.Length > 0 && selection_data.Format == 8) { Caret.Offset = dragOffset; if (CanEdit (dragCaretPos.Line)) { @@ -2046,7 +2047,7 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) sizeHasBeenAllocated = true; if (Options.WrapLines) textViewMargin.PurgeLayoutCache (); - SetChildrenPositions (allocation); +// SetChildrenPositions (allocation); UpdateMarginRects (allocation); } @@ -2284,27 +2285,27 @@ void UpdateAdjustments () #if DEBUG_EXPOSE DateTime started = DateTime.Now; #endif - protected override bool OnExposeEvent (Gdk.EventExpose e) + protected override bool OnDrawn (Context cr) { if (this.isDisposed) return false; - try { - ExposeEventInternal (e); - } catch (Exception ex) { - GLib.ExceptionManager.RaiseUnhandledException (ex, false); - } +// try { +// ExposeEventInternal (e); +// } catch (Exception ex) { +// GLib.ExceptionManager.RaiseUnhandledException (ex, false); +// } keyPressTimings.EndTimer (true); - return base.OnExposeEvent (e); + return base.OnDrawn (cr); } void ExposeEventInternal (Gdk.EventExpose e) { UpdateAdjustments (); - var area = e.Region.Clipbox; - var cairoArea = new Cairo.Rectangle (area.X, area.Y, area.Width, area.Height); +// var area = e.Region.Clipbox; +// var cairoArea = new Cairo.Rectangle (area.X, area.Y, area.Width, area.Height); using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) using (Cairo.Context textViewCr = Gdk.CairoHelper.Create (e.Window)) { UpdateMarginXOffsets (); @@ -2312,7 +2313,7 @@ void ExposeEventInternal (Gdk.EventExpose e) cr.LineWidth = Options.Zoom; textViewCr.LineWidth = Options.Zoom; - RenderMargins (cr, textViewCr, cairoArea); +// RenderMargins (cr, textViewCr, cairoArea); #if DEBUG_EXPOSE Console.WriteLine ("{0} expose {1},{2} {3}x{4}", (long)(DateTime.Now - started).TotalMilliseconds, @@ -2327,11 +2328,11 @@ void ExposeEventInternal (Gdk.EventExpose e) animation.Drawer.Draw (cr); } - OnPainted (new PaintEventArgs (cr, cairoArea)); +// OnPainted (new PaintEventArgs (cr, cairoArea)); } - if (Caret.IsVisible) - textViewMargin.DrawCaret (e.Window, Allocation); +// if (Caret.IsVisible) +// textViewMargin.DrawCaret (e.Window, Allocation); } protected virtual void OnPainted (PaintEventArgs e) @@ -3195,7 +3196,7 @@ void ShowTooltip (Gdk.ModifierType modifierState, int offset, int xloc, int yloc nextTipY = yloc; nextTipOffset = offset; nextTipModifierState = modifierState; - nextTipScheduledTime = DateTime.Now + TimeSpan.FromMilliseconds (TooltipTimeout); + nextTipScheduledTime = System.DateTime.Now + TimeSpan.FromMilliseconds (TooltipTimeout); // If a tooltip is already scheduled, there is no need to create a new timer. if (tipShowTimeoutId == 0) tipShowTimeoutId = GLib.Timeout.Add (timeOut, () => { TooltipTimer (); return false; }); @@ -3209,7 +3210,7 @@ async void TooltipTimer () if (nextTipOffset == -1) return; - int remainingMs = (int) (nextTipScheduledTime - DateTime.Now).TotalMilliseconds; + int remainingMs = (int) (nextTipScheduledTime - System.DateTime.Now).TotalMilliseconds; if (remainingMs > 50) { // Still some significant time left. Re-schedule the timer tipShowTimeoutId = GLib.Timeout.Add ((uint) remainingMs, () => { TooltipTimer (); return false; }); @@ -3478,18 +3479,18 @@ void RemoveAnimation (Animation animation) { if (animation == null) return; - Rectangle bounds = animation.Drawer.AnimationBounds; +// Rectangle bounds = animation.Drawer.AnimationBounds; actors.Remove (animation); if (animation is IDisposable) ((IDisposable)animation).Dispose (); - QueueDrawArea (bounds.X, bounds.Y, bounds.Width, bounds.Height); +// QueueDrawArea (bounds.X, bounds.Y, bounds.Width, bounds.Height); } void OnAnimationIteration (object sender, EventArgs args) { foreach (Animation actor in actors) { - Rectangle bounds = actor.Drawer.AnimationBounds; - QueueDrawArea (bounds.X, bounds.Y, bounds.Width, bounds.Height); +// Rectangle bounds = actor.Drawer.AnimationBounds; +// QueueDrawArea (bounds.X, bounds.Y, bounds.Width, bounds.Height); } } #endregion @@ -3622,7 +3623,7 @@ public void AddTopLevelWidget (Gtk.Widget widget, int x, int y) var newContainerChildren = new List (containerChildren); newContainerChildren.Add (info); containerChildren = newContainerChildren; - ResizeChild (Allocation, info); +// ResizeChild (Allocation, info); SetAdjustments (); } @@ -3634,8 +3635,8 @@ public void MoveTopLevelWidget (Gtk.Widget widget, int x, int y) break; info.X = x; info.Y = y; - if (widget.Visible) - ResizeChild (Allocation, info); +// if (widget.Visible) +// ResizeChild (Allocation, info); break; } } @@ -3694,7 +3695,7 @@ protected override void ForAll (bool include_internals, Gtk.Callback callback) protected override void OnMapped () { - WidgetFlags |= WidgetFlags.Mapped; + this.IsMapped = true; // Note: SourceEditorWidget.ShowAutoSaveWarning() might have set TextEditor.Visible to false, // in which case we want to not map it (would cause a gtk+ critical error). containerChildren.ForEach (child => { if (child.Child.Visible) child.Child.Map (); }); @@ -3703,7 +3704,7 @@ protected override void OnMapped () protected override void OnUnmapped () { - WidgetFlags &= ~WidgetFlags.Mapped; + this.IsMapped = false; // We hide the window first so that the user doesn't see widgets disappearing one by one. GdkWindow.Hide (); @@ -3711,26 +3712,26 @@ protected override void OnUnmapped () containerChildren.ForEach (child => child.Child.Unmap ()); } - void ResizeChild (Rectangle allocation, MonoTextEditor.EditorContainerChild child) - { - Requisition req = child.Child.SizeRequest (); - var childRectangle = new Gdk.Rectangle (child.X, child.Y, req.Width, req.Height); - if (!child.FixedPosition) { +// void ResizeChild (Rectangle allocation, MonoTextEditor.EditorContainerChild child) +// { +// Requisition req = child.Child.SizeRequest (); +// var childRectangle = new Gdk.Rectangle (child.X, child.Y, req.Width, req.Height); +// if (!child.FixedPosition) { // double zoom = Options.Zoom; - childRectangle.X = (int)(child.X /* * zoom */- HAdjustment.Value); - childRectangle.Y = (int)(child.Y /* * zoom */- VAdjustment.Value); - } - // childRectangle.X += allocation.X; - // childRectangle.Y += allocation.Y; - child.Child.SizeAllocate (childRectangle); - } +// childRectangle.X = (int)(child.X /* * zoom */- HAdjustment.Value); +// childRectangle.Y = (int)(child.Y /* * zoom */- VAdjustment.Value); +// } +// // childRectangle.X += allocation.X; +// // childRectangle.Y += allocation.Y; +// child.Child.SizeAllocate (childRectangle); +// } - void SetChildrenPositions (Rectangle allocation) - { - foreach (var child in containerChildren.ToArray ()) { - ResizeChild (allocation, child); - } - } +// void SetChildrenPositions (Rectangle allocation) +// { +// foreach (var child in containerChildren.ToArray ()) { +// ResizeChild (allocation, child); +// } +// } #endregion } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs index 5cc890f3d09..6f97e2d16fe 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs @@ -840,81 +840,81 @@ char GetCaretChar () return caretChar; } - public void DrawCaret (Gdk.Drawable win, Gdk.Rectangle rect) - { - if (!this.textEditor.IsInDrag && !(this.caretX >= 0 && (!this.textEditor.IsSomethingSelected || this.textEditor.SelectionRange.Length == 0))) - return; - if (win == null || Settings.Default.CursorBlink && !Caret.IsVisible || !caretBlink) - return; - using (Cairo.Context cr = Gdk.CairoHelper.Create (win)) { - cr.Rectangle (XOffset, 0, textEditor.Allocation.Width - XOffset, textEditor.Allocation.Height); - cr.Clip (); - cr.LineWidth = System.Math.Max (1, System.Math.Floor (textEditor.Options.Zoom)); - cr.Antialias = Cairo.Antialias.None; - var curRect = new Gdk.Rectangle ((int)caretX, (int)caretY, (int)this.charWidth, (int)LineHeight - 1); - if (curRect != caretRectangle) { - caretRectangle = curRect; +// public void DrawCaret (Gdk.Drawable win, Gdk.Rectangle rect) +// { +// if (!this.textEditor.IsInDrag && !(this.caretX >= 0 && (!this.textEditor.IsSomethingSelected || this.textEditor.SelectionRange.Length == 0))) +// return; +// if (win == null || Settings.Default.CursorBlink && !Caret.IsVisible || !caretBlink) +// return; +// using (Cairo.Context cr = Gdk.CairoHelper.Create (win)) { +// cr.Rectangle (XOffset, 0, textEditor.Allocation.Width - XOffset, textEditor.Allocation.Height); +// cr.Clip (); +// cr.LineWidth = System.Math.Max (1, System.Math.Floor (textEditor.Options.Zoom)); +// cr.Antialias = Cairo.Antialias.None; +// var curRect = new Gdk.Rectangle ((int)caretX, (int)caretY, (int)this.charWidth, (int)LineHeight - 1); +// if (curRect != caretRectangle) { +// caretRectangle = curRect; // textEditor.TextArea.QueueDrawArea (caretRectangle.X - (int)textEditor.Options.Zoom, // (int)(caretRectangle.Y + (-textEditor.VAdjustment.Value + caretVAdjustmentValue)), // caretRectangle.Width + (int)textEditor.Options.Zoom, // caretRectangle.Height + 1); - caretVAdjustmentValue = textEditor.VAdjustment.Value; - } - - var fgColor = SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.Foreground); +// caretVAdjustmentValue = textEditor.VAdjustment.Value; +// } +// +// var fgColor = SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.Foreground); // var bgColor = textEditor.ColorStyle.Default.CairoBackgroundColor; - var line = Document.GetLine (Caret.Line); - if (line != null) { - foreach (var marker in Document.GetMarkers (line)) { - var style = marker as StyleTextLineMarker; - if (style == null) - continue; - // if (style.IncludedStyles.HasFlag (StyleTextLineMarker.StyleFlag.BackgroundColor)) - // bgColor = style.BackgroundColor; - if (style.IncludedStyles.HasFlag (StyleTextLineMarker.StyleFlag.Color)) - fgColor = style.Color; - } - } - /* - var foreground = ((HslColor)fgColor).ToPixel (); - var background = ((HslColor)color).ToPixel (); - var caretColor = (foreground ^ background) & 0xFFFFFF; - color = HslColor.FromPixel (caretColor);*/ - var color = fgColor; - - switch (Caret.Mode) { - case CaretMode.Insert: - cr.DrawLine (color, - caretRectangle.X + 0.5, - caretRectangle.Y + 0.5, - caretRectangle.X + 0.5, - caretRectangle.Y + caretRectangle.Height); - break; - case CaretMode.Block: - cr.SetSourceColor (color); - cr.Rectangle (caretRectangle.X + 0.5, caretRectangle.Y + 0.5, caretRectangle.Width, caretRectangle.Height); - cr.Fill (); - char caretChar = GetCaretChar (); - if (!char.IsWhiteSpace (caretChar) && caretChar != '\0') { - using (var layout = textEditor.LayoutCache.RequestLayout ()) { - layout.FontDescription = textEditor.Options.Font; - layout.SetText (caretChar.ToString ()); - cr.MoveTo (caretRectangle.X, caretRectangle.Y); - cr.SetSourceColor (SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.Background)); - cr.ShowLayout (layout); - } - } - break; - case CaretMode.Underscore: - cr.DrawLine (color, - caretRectangle.X + 0.5, - caretRectangle.Y + caretRectangle.Height + 0.5, - caretRectangle.X + caretRectangle.Width, - caretRectangle.Y + caretRectangle.Height + 0.5); - break; - } - } - } +// var line = Document.GetLine (Caret.Line); +// if (line != null) { +// foreach (var marker in Document.GetMarkers (line)) { +// var style = marker as StyleTextLineMarker; +// if (style == null) +// continue; +// // if (style.IncludedStyles.HasFlag (StyleTextLineMarker.StyleFlag.BackgroundColor)) +// // bgColor = style.BackgroundColor; +// if (style.IncludedStyles.HasFlag (StyleTextLineMarker.StyleFlag.Color)) +// fgColor = style.Color; +// } +// } +// /* +// var foreground = ((HslColor)fgColor).ToPixel (); +// var background = ((HslColor)color).ToPixel (); +// var caretColor = (foreground ^ background) & 0xFFFFFF; +// color = HslColor.FromPixel (caretColor);*/ +// var color = fgColor; +// +// switch (Caret.Mode) { +// case CaretMode.Insert: +// cr.DrawLine (color, +// caretRectangle.X + 0.5, +// caretRectangle.Y + 0.5, +// caretRectangle.X + 0.5, +// caretRectangle.Y + caretRectangle.Height); +// break; +// case CaretMode.Block: +// cr.SetSourceColor (color); +// cr.Rectangle (caretRectangle.X + 0.5, caretRectangle.Y + 0.5, caretRectangle.Width, caretRectangle.Height); +// cr.Fill (); +// char caretChar = GetCaretChar (); +// if (!char.IsWhiteSpace (caretChar) && caretChar != '\0') { +// using (var layout = textEditor.LayoutCache.RequestLayout ()) { +// layout.FontDescription = textEditor.Options.Font; +// layout.SetText (caretChar.ToString ()); +// cr.MoveTo (caretRectangle.X, caretRectangle.Y); +// cr.SetSourceColor (SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.Background)); +// cr.ShowLayout (layout); +// } +// } +// break; +// case CaretMode.Underscore: +// cr.DrawLine (color, +// caretRectangle.X + 0.5, +// caretRectangle.Y + caretRectangle.Height + 0.5, +// caretRectangle.X + caretRectangle.Width, +// caretRectangle.Y + caretRectangle.Height + 0.5); +// break; +// } +// } +// } void GetSelectionOffsets (DocumentLine line, out int selectionStart, out int selectionEnd) { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskMiniMapMode.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskMiniMapMode.cs index 37728cee949..f16748d7e71 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskMiniMapMode.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskMiniMapMode.cs @@ -83,7 +83,7 @@ public Minimpap (QuickTaskStrip parent) : base (parent) doc.Folded += HandleFolded; } - Pixmap backgroundPixbuf, backgroundBuffer; +// Pixmap backgroundPixbuf, backgroundBuffer; uint redrawTimeout; TextDocument doc; @@ -113,8 +113,8 @@ public void RequestRedraw () curUpdate.RemoveHandler (); curUpdate = null; } - if (backgroundPixbuf != null) - curUpdate = new BgBufferUpdate (this); +// if (backgroundPixbuf != null) +// curUpdate = new BgBufferUpdate (this); redrawTimeout = 0; return false; }); @@ -161,12 +161,12 @@ void DestroyBgBuffer () { if (curUpdate != null) curUpdate.RemoveHandler (); - if (backgroundPixbuf != null) { - backgroundPixbuf.Dispose (); - backgroundBuffer.Dispose (); - backgroundPixbuf = backgroundBuffer = null; - curWidth = curHeight = -1; - } +// if (backgroundPixbuf != null) { +// backgroundPixbuf.Dispose (); +// backgroundBuffer.Dispose (); +// backgroundPixbuf = backgroundBuffer = null; +// curWidth = curHeight = -1; +// } } protected override void OnDestroyed () @@ -187,8 +187,8 @@ protected override void OnSizeAllocated (Rectangle allocation) protected override void OnMapped () { - if (backgroundPixbuf == null && Allocation.Width > 1) - CreateBgBuffer (); +// if (backgroundPixbuf == null && Allocation.Width > 1) +// CreateBgBuffer (); base.OnMapped (); } @@ -201,9 +201,9 @@ protected override void OnUnmapped () BgBufferUpdate curUpdate = null; void SwapBuffer () { - var tmp = backgroundPixbuf; - backgroundPixbuf = backgroundBuffer; - backgroundBuffer = tmp; +// var tmp = backgroundPixbuf; +// backgroundPixbuf = backgroundBuffer; +// backgroundBuffer = tmp; } int curWidth = -1, curHeight = -1; @@ -215,15 +215,15 @@ void CreateBgBuffer () if (GdkWindow == null || curWidth < 1 || curHeight < 1) return; var displayScale = Platform.IsWindows ? GtkWorkarounds.GetScaleFactor (this) : 1.0; - backgroundPixbuf = new Pixmap (GdkWindow, (int)(curWidth * displayScale), (int)(curHeight * displayScale)); - backgroundBuffer = new Pixmap (GdkWindow, (int)(curWidth * displayScale), (int)(curHeight * displayScale)); +// backgroundPixbuf = new Pixmap (GdkWindow, (int)(curWidth * displayScale), (int)(curHeight * displayScale)); +// backgroundBuffer = new Pixmap (GdkWindow, (int)(curWidth * displayScale), (int)(curHeight * displayScale)); if (TextEditor.EditorTheme != null) { - using (var cr = Gdk.CairoHelper.Create (backgroundPixbuf)) { - cr.Rectangle (0, 0, curWidth * displayScale, curHeight * displayScale); - cr.SetSourceColor (SyntaxHighlightingService.GetColor (TextEditor.EditorTheme, EditorThemeColors.Background)); - cr.Fill (); - } +// using (var cr = Gdk.CairoHelper.Create (backgroundPixbuf)) { +// cr.Rectangle (0, 0, curWidth * displayScale, curHeight * displayScale); +// cr.SetSourceColor (SyntaxHighlightingService.GetColor (TextEditor.EditorTheme, EditorThemeColors.Background)); +// cr.Fill (); +// } } curUpdate = new BgBufferUpdate (this); } @@ -245,20 +245,20 @@ public BgBufferUpdate (Minimpap mode) { this.mode = mode; - cr = Gdk.CairoHelper.Create (mode.backgroundBuffer); +// cr = Gdk.CairoHelper.Create (mode.backgroundBuffer); - cr.LineWidth = 1; - int w = mode.backgroundBuffer.ClipRegion.Clipbox.Width; - int h = mode.backgroundBuffer.ClipRegion.Clipbox.Height; - cr.Rectangle (0, 0, w, h); - if (mode.TextEditor.EditorTheme != null) - cr.SetSourceColor (SyntaxHighlightingService.GetColor (mode.TextEditor.EditorTheme, EditorThemeColors.Background)); - cr.Fill (); +// cr.LineWidth = 1; +// int w = mode.backgroundBuffer.ClipRegion.Clipbox.Width; +// int h = mode.backgroundBuffer.ClipRegion.Clipbox.Height; +// cr.Rectangle (0, 0, w, h); +// if (mode.TextEditor.EditorTheme != null) +// cr.SetSourceColor (SyntaxHighlightingService.GetColor (mode.TextEditor.EditorTheme, EditorThemeColors.Background)); +// cr.Fill (); maxLine = mode.TextEditor.GetTextEditorData ().VisibleLineCount; - sx = w / (double)mode.TextEditor.Allocation.Width; - sy = Math.Min (1, lineHeight * maxLine / (double)mode.TextEditor.GetTextEditorData ().TotalHeight); - cr.Scale (sx, sy); +// sx = w / (double)mode.TextEditor.Allocation.Width; +// sy = Math.Min (1, lineHeight * maxLine / (double)mode.TextEditor.GetTextEditorData ().TotalHeight); +// cr.Scale (sx, sy); handler = GLib.Idle.Add (BgBufferUpdater); } @@ -315,54 +315,54 @@ bool BgBufferUpdater () int GetBufferYOffset () { var displayScale = Platform.IsWindows ? GtkWorkarounds.GetScaleFactor (this) : 1.0; - int h = (int)(backgroundPixbuf.ClipRegion.Clipbox.Height / displayScale) - Allocation.Height; - if (h < 0) +// int h = (int)(backgroundPixbuf.ClipRegion.Clipbox.Height / displayScale) - Allocation.Height; +// if (h < 0) return 0; - return Math.Max (0, (int)(h * (vadjustment.Value) / (vadjustment.Upper - vadjustment.Lower - vadjustment.PageSize))); +// return Math.Max (0, (int)(h * (vadjustment.Value) / (vadjustment.Upper - vadjustment.Lower - vadjustment.PageSize))); } - protected override bool OnExposeEvent (Gdk.EventExpose e) - { - if (TextEditor == null) - return true; - using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { - cr.LineWidth = 1; - if (backgroundPixbuf != null) { - e.Window.DrawDrawable (Style.BlackGC, backgroundPixbuf, 0, GetBufferYOffset (), 0, 0, Allocation.Width, Allocation.Height); - } else { - cr.Rectangle (0, 0, Allocation.Width, Allocation.Height); - if (TextEditor.EditorTheme != null) - cr.SetSourceColor (SyntaxHighlightingService.GetColor (TextEditor.EditorTheme, EditorThemeColors.Background)); - cr.Fill (); - } - /* - cr.Color = (HslColor)Style.Dark (State); - cr.MoveTo (-0.5, 0.5); - cr.LineTo (Allocation.Width, 0.5); - cr.MoveTo (-0.5, Allocation.Height - 0.5); - cr.LineTo (Allocation.Width, Allocation.Height - 0.5); - cr.Stroke ();*/ - - if (backgroundPixbuf != null) { - int y = GetBufferYOffset (); - - int startLine = TextEditor.YToLine (vadjustment.Value); - double dy = TextEditor.LogicalToVisualLocation (startLine, 1).Line * lineHeight; - - cr.Rectangle (0, - dy - y, - Allocation.Width, - lineHeight * vadjustment.PageSize / TextEditor.LineHeight); - var c = (Cairo.Color)(HslColor)Style.Dark (State); - c.A = 0.2; - cr.SetSourceColor (c); - cr.Fill (); - } - DrawLeftBorder (cr); - } - - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose e) +// { +// if (TextEditor == null) +// return true; +// using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { +// cr.LineWidth = 1; +// if (backgroundPixbuf != null) { +// e.Window.DrawDrawable (Style.BlackGC, backgroundPixbuf, 0, GetBufferYOffset (), 0, 0, Allocation.Width, Allocation.Height); +// } else { +// cr.Rectangle (0, 0, Allocation.Width, Allocation.Height); +// if (TextEditor.EditorTheme != null) +// cr.SetSourceColor (SyntaxHighlightingService.GetColor (TextEditor.EditorTheme, EditorThemeColors.Background)); +// cr.Fill (); +// } +// /* +// cr.Color = (HslColor)Style.Dark (State); +// cr.MoveTo (-0.5, 0.5); +// cr.LineTo (Allocation.Width, 0.5); +// cr.MoveTo (-0.5, Allocation.Height - 0.5); +// cr.LineTo (Allocation.Width, Allocation.Height - 0.5); +// cr.Stroke ();*/ +// +// if (backgroundPixbuf != null) { +// int y = GetBufferYOffset (); +// +// int startLine = TextEditor.YToLine (vadjustment.Value); +// double dy = TextEditor.LogicalToVisualLocation (startLine, 1).Line * lineHeight; +// +// cr.Rectangle (0, +// dy - y, +// Allocation.Width, +// lineHeight * vadjustment.PageSize / TextEditor.LineHeight); +// var c = (Cairo.Color)(HslColor)Style.Dark (State); +// c.A = 0.2; +// cr.SetSourceColor (c); +// cr.Fill (); +// } +// DrawLeftBorder (cr); +// } +// +// return true; +// } } } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs index e56bdd1f041..a85d43dde80 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs @@ -432,7 +432,7 @@ QuickTask GetHoverTask (double y) void UpdateState (StateType state) { if (State != state) { - State = state; +// State = state; QueueDraw (); } } @@ -911,56 +911,52 @@ void DrawSearchResults (Cairo.Context cr, IndicatorDrawingState state, int i) } IndicatorDrawingState currentDrawingState = IndicatorDrawingState.Create (); SurfaceWrapper backgroundSurface, indicatorSurface, swapIndicatorSurface; - protected override bool OnExposeEvent (Gdk.EventExpose e) + protected override bool OnDrawn (Cairo.Context cr) { if (TextEditor == null) return true; - using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { - - cr.Save (); - var allocation = Allocation; - var displayScale = Core.Platform.IsMac ? GtkWorkarounds.GetScaleFactor (this) : 1.0; - cr.Scale (1 / displayScale, 1 / displayScale); - if (indicatorSurface != null) { - cr.SetSourceSurface (indicatorSurface.Surface, 0, 0); - cr.Paint (); - } else { - CachedDraw (cr, - ref backgroundSurface, - allocation, - draw: (c, o) => DrawBackground (c, allocation), forceScale: displayScale); - } - if (TextEditor == null) - return true; + cr.Save (); + var allocation = Allocation; + var displayScale = Core.Platform.IsMac ? GtkWorkarounds.GetScaleFactor (this) : 1.0; + cr.Scale (1 / displayScale, 1 / displayScale); + if (indicatorSurface != null) { + cr.SetSourceSurface (indicatorSurface.Surface, 0, 0); + cr.Paint (); + } else { + CachedDraw (cr, + ref backgroundSurface, + allocation, + draw: (c, o) => DrawBackground (c, allocation), forceScale: displayScale); + } + if (TextEditor == null) + return true; - DrawCaret (cr); + DrawCaret (cr); - if (QuickTaskStrip.MergeScrollBarAndQuickTasks) - DrawBar (cr); + if (QuickTaskStrip.MergeScrollBarAndQuickTasks) + DrawBar (cr); - cr.Restore (); + cr.Restore (); - if (HasFocus) { - switch (currentFocus) { - case FocusWidget.Indicator: - cr.LineWidth = 1.0; + if (HasFocus) { + switch (currentFocus) { + case FocusWidget.Indicator: + cr.LineWidth = 1.0; - cr.SetSourceColor (Styles.FocusColor.ToCairoColor ()); - cr.Rectangle (1, 1, Allocation.Width - 2, Allocation.Width - 2); - cr.SetDash (new double [] { 1, 1 }, 0.5); - cr.Stroke (); - break; + cr.SetSourceColor (Styles.FocusColor.ToCairoColor ()); + cr.Rectangle (1, 1, Allocation.Width - 2, Allocation.Width - 2); + cr.SetDash (new double [] { 1, 1 }, 0.5); + cr.Stroke (); + break; - case FocusWidget.Tasks: - break; + case FocusWidget.Tasks: + break; - case FocusWidget.Usages: - break; - } + case FocusWidget.Usages: + break; } } - return false; } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj index c564711d358..9fbb5067958 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj @@ -107,6 +107,9 @@ gtk-sharp-3.0 + + gio-sharp-3.0 + diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs index 3a992d85675..df0dd7c7b17 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs @@ -78,8 +78,7 @@ static void UpdateTreeStyle (Cairo.Color newBgColor) public DebugValueWindow (TextEditor editor, int offset, StackFrame frame, ObjectValue value, PinnedWatch watch) : base (Gtk.WindowType.Toplevel) { this.TypeHint = WindowTypeHint.PopupMenu; - this.AllowShrink = false; - this.AllowGrow = false; + this.Resizable = false; this.Decorated = false; TransientFor = (Gtk.Window) (editor.GetNativeWidget ()).Toplevel; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/GotoLineNumberWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/GotoLineNumberWidget.cs index 565c1954fd9..22f261fe250 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/GotoLineNumberWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/GotoLineNumberWidget.cs @@ -92,9 +92,9 @@ public GotoLineNumberWidget (MonoTextEditor textEditor, Widget frame) Gtk.Widget oldWidget = null; this.FocusChildSet += delegate (object sender, Gtk.FocusChildSetArgs args) { // only store state when the focus comes from a non child widget - if (args.Widget != null && oldWidget == null) - StoreWidgetState (); - oldWidget = args.Widget; +// if (args.Widget != null && oldWidget == null) +// StoreWidgetState (); +// oldWidget = args.Widget; }; this.entryLineNumber.Changed += delegate { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs index 6d5f85bd413..5e984860a41 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs @@ -273,27 +273,27 @@ void SetSuppressScrollbar (bool value) return; suppressScrollbar = value; - if (suppressScrollbar) { - scrolledWindow.VScrollbar.SizeRequested += SuppressSize; - scrolledWindow.VScrollbar.ExposeEvent += SuppressExpose; - } else { - scrolledWindow.VScrollbar.SizeRequested -= SuppressSize; - scrolledWindow.VScrollbar.ExposeEvent -= SuppressExpose; - } +// if (suppressScrollbar) { +// scrolledWindow.VScrollbar.SizeRequested += SuppressSize; +// scrolledWindow.VScrollbar.ExposeEvent += SuppressExpose; +// } else { +// scrolledWindow.VScrollbar.SizeRequested -= SuppressSize; +// scrolledWindow.VScrollbar.ExposeEvent -= SuppressExpose; +// } } - [GLib.ConnectBefore] - static void SuppressExpose (object o, ExposeEventArgs args) - { - args.RetVal = true; - } +// [GLib.ConnectBefore] +// static void SuppressExpose (object o, ExposeEventArgs args) +// { +// args.RetVal = true; +// } - [GLib.ConnectBefore] - static void SuppressSize (object o, SizeRequestedArgs args) - { - args.Requisition = Requisition.Zero; - args.RetVal = true; - } +// [GLib.ConnectBefore] +// static void SuppressSize (object o, SizeRequestedArgs args) +// { +// args.Requisition = Requisition.Zero; +// args.RetVal = true; +// } public void AddQuickTaskProvider (IQuickTaskProvider p) { @@ -335,8 +335,8 @@ protected override void OnDestroyed () SetSuppressScrollbar (false); QuickTaskStrip.EnableFancyFeatures.Changed -= FancyFeaturesChanged; scrolledWindow.ButtonPressEvent -= PrepareEvent; - scrolledWindow.Vadjustment.Destroy (); - scrolledWindow.Hadjustment.Destroy (); +// scrolledWindow.Vadjustment.Destroy (); +// scrolledWindow.Hadjustment.Destroy (); scrolledWindow.Destroy (); scrolledWindow = null; strip.Destroy (); diff --git a/main/src/addins/VBNetBinding/Gui/ImportsOptionsPanelWidget.cs b/main/src/addins/VBNetBinding/Gui/ImportsOptionsPanelWidget.cs index d71c87fa2d1..1f7c00694f7 100644 --- a/main/src/addins/VBNetBinding/Gui/ImportsOptionsPanelWidget.cs +++ b/main/src/addins/VBNetBinding/Gui/ImportsOptionsPanelWidget.cs @@ -81,7 +81,7 @@ protected virtual void OnCmdRemoveClicked (object sender, System.EventArgs e) bool removed = false; Console.WriteLine ("OnCmdRemoveClicked"); - treeview1.Selection.SelectedForeach (delegate (Gtk.TreeModel model, Gtk.TreePath path, Gtk.TreeIter iter) + treeview1.Selection.SelectedForeach (delegate (Gtk.ITreeModel model, Gtk.TreePath path, Gtk.TreeIter iter) { string import; GLib.Value value = new GLib.Value (); diff --git a/main/src/addins/VBNetBinding/Gui/MonoDevelop.VBNetBinding.ConfigurationOptionsPanelWidget.cs b/main/src/addins/VBNetBinding/Gui/MonoDevelop.VBNetBinding.ConfigurationOptionsPanelWidget.cs index 3c2ad28d94a..27eef6de2c3 100644 --- a/main/src/addins/VBNetBinding/Gui/MonoDevelop.VBNetBinding.ConfigurationOptionsPanelWidget.cs +++ b/main/src/addins/VBNetBinding/Gui/MonoDevelop.VBNetBinding.ConfigurationOptionsPanelWidget.cs @@ -9,7 +9,7 @@ public partial class ConfigurationOptionsPanelWidget private global::Gtk.HBox hbox1; private global::Gtk.Label label76; private global::Gtk.Table table1; - private global::Gtk.ComboBox cmbDebugType; + private global::Gtk.ComboBoxText cmbDebugType; private global::Gtk.ComboBox cmbDefineDEBUG; private global::Gtk.ComboBox cmbDefineTRACE; private global::Gtk.ComboBox cmbOptimize; @@ -80,7 +80,7 @@ protected virtual void Build () this.table1.RowSpacing = ((uint)(6)); this.table1.ColumnSpacing = ((uint)(6)); // Container child table1.Gtk.Table+TableChild - this.cmbDebugType = new global::Gtk.ComboBox (); + this.cmbDebugType = new global::Gtk.ComboBoxText (); this.cmbDebugType.Name = "cmbDebugType"; this.table1.Add (this.cmbDebugType); global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.cmbDebugType])); diff --git a/main/src/addins/VBNetBinding/Gui/MonoDevelop.VBNetBinding.ProjectOptionsPanelWidget.cs b/main/src/addins/VBNetBinding/Gui/MonoDevelop.VBNetBinding.ProjectOptionsPanelWidget.cs index 5e13948c128..82fa5a6224c 100644 --- a/main/src/addins/VBNetBinding/Gui/MonoDevelop.VBNetBinding.ProjectOptionsPanelWidget.cs +++ b/main/src/addins/VBNetBinding/Gui/MonoDevelop.VBNetBinding.ProjectOptionsPanelWidget.cs @@ -6,13 +6,13 @@ public partial class ProjectOptionsPanelWidget { private global::Gtk.VBox vbox5; private global::Gtk.Table table1; - private global::Gtk.ComboBoxEntry cmbCodePage; - private global::Gtk.ComboBox cmbOptionCompare; - private global::Gtk.ComboBox cmbOptionExplicit; - private global::Gtk.ComboBox cmbOptionInfer; - private global::Gtk.ComboBox cmbOptionStrict; + private global::Gtk.ComboBoxText cmbCodePage; + private global::Gtk.ComboBoxText cmbOptionCompare; + private global::Gtk.ComboBoxText cmbOptionExplicit; + private global::Gtk.ComboBoxText cmbOptionInfer; + private global::Gtk.ComboBoxText cmbOptionStrict; private global::Gtk.ComboBox compileTargetCombo; - private global::Gtk.ComboBoxEntry entryMainClass; + private global::Gtk.ComboBoxText entryMainClass; private global::MonoDevelop.Components.FileEntry iconEntry; private global::Gtk.Label label1; private global::Gtk.Label label3; @@ -23,7 +23,7 @@ public partial class ProjectOptionsPanelWidget private global::Gtk.Label label8; private global::Gtk.Label label86; private global::Gtk.Label label88; - private global::Gtk.ComboBoxEntry txtMyType; + private global::Gtk.ComboBoxText txtMyType; protected virtual void Build () { @@ -41,7 +41,7 @@ protected virtual void Build () this.table1.RowSpacing = ((uint)(6)); this.table1.ColumnSpacing = ((uint)(6)); // Container child table1.Gtk.Table+TableChild - this.cmbCodePage = global::Gtk.ComboBoxEntry.NewText (); + this.cmbCodePage = new global::Gtk.ComboBoxText (); this.cmbCodePage.Name = "cmbCodePage"; this.table1.Add (this.cmbCodePage); global::Gtk.Table.TableChild w1 = ((global::Gtk.Table.TableChild)(this.table1 [this.cmbCodePage])); @@ -52,7 +52,7 @@ protected virtual void Build () w1.XOptions = ((global::Gtk.AttachOptions)(4)); w1.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.cmbOptionCompare = new global::Gtk.ComboBox (); + this.cmbOptionCompare = new global::Gtk.ComboBoxText (); this.cmbOptionCompare.Name = "cmbOptionCompare"; this.table1.Add (this.cmbOptionCompare); global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.cmbOptionCompare])); @@ -63,7 +63,7 @@ protected virtual void Build () w2.XOptions = ((global::Gtk.AttachOptions)(4)); w2.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.cmbOptionExplicit = new global::Gtk.ComboBox (); + this.cmbOptionExplicit = new global::Gtk.ComboBoxText (); this.cmbOptionExplicit.Name = "cmbOptionExplicit"; this.table1.Add (this.cmbOptionExplicit); global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.cmbOptionExplicit])); @@ -74,7 +74,7 @@ protected virtual void Build () w3.XOptions = ((global::Gtk.AttachOptions)(4)); w3.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.cmbOptionInfer = new global::Gtk.ComboBox (); + this.cmbOptionInfer = new global::Gtk.ComboBoxText (); this.cmbOptionInfer.Name = "cmbOptionInfer"; this.table1.Add (this.cmbOptionInfer); global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1 [this.cmbOptionInfer])); @@ -85,7 +85,7 @@ protected virtual void Build () w4.XOptions = ((global::Gtk.AttachOptions)(4)); w4.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.cmbOptionStrict = new global::Gtk.ComboBox (); + this.cmbOptionStrict = new global::Gtk.ComboBoxText (); this.cmbOptionStrict.Name = "cmbOptionStrict"; this.table1.Add (this.cmbOptionStrict); global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.cmbOptionStrict])); @@ -105,7 +105,7 @@ protected virtual void Build () w6.XOptions = ((global::Gtk.AttachOptions)(4)); w6.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.entryMainClass = new global::Gtk.ComboBoxEntry (); + this.entryMainClass = new global::Gtk.ComboBoxText (); this.entryMainClass.Name = "entryMainClass"; this.table1.Add (this.entryMainClass); global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1 [this.entryMainClass])); @@ -225,7 +225,7 @@ protected virtual void Build () w17.XOptions = ((global::Gtk.AttachOptions)(4)); w17.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.txtMyType = new global::Gtk.ComboBoxEntry (); + this.txtMyType = new global::Gtk.ComboBoxText (); this.txtMyType.Name = "txtMyType"; this.table1.Add (this.txtMyType); global::Gtk.Table.TableChild w18 = ((global::Gtk.Table.TableChild)(this.table1 [this.txtMyType])); diff --git a/main/src/addins/VBNetBinding/Gui/ProjectOptionsPanelWidget.cs b/main/src/addins/VBNetBinding/Gui/ProjectOptionsPanelWidget.cs index bb130ea23c6..109d79b40f2 100644 --- a/main/src/addins/VBNetBinding/Gui/ProjectOptionsPanelWidget.cs +++ b/main/src/addins/VBNetBinding/Gui/ProjectOptionsPanelWidget.cs @@ -68,7 +68,7 @@ public ProjectOptionsPanelWidget (MonoDevelop.Projects.Project project) store.AppendValues ("Windows"); store.AppendValues ("Console"); txtMyType.Model = store; - txtMyType.TextColumn = 0; +// txtMyType.TextColumn = 0; switch (this.project.MyType) { case "WindowsForms": txtMyType.Active = 0; diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ChangeSetView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ChangeSetView.cs index 0df03a9b53b..f922fa4f380 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ChangeSetView.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ChangeSetView.cs @@ -143,7 +143,7 @@ public void Clear () Update (); } - int CompareNodes (Gtk.TreeModel model, Gtk.TreeIter a, Gtk.TreeIter b) + int CompareNodes (Gtk.ITreeModel model, Gtk.TreeIter a, Gtk.TreeIter b) { int col, val=0; SortType type; @@ -409,7 +409,7 @@ void FillDifs (DiffData ddata) while (filestore.IterNext (ref it)); } - void SetDiffCellData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + void SetDiffCellData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { if (disposed) return; diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs index 4801dc0450b..93c1f8f74e0 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs @@ -510,7 +510,7 @@ protected override void OnDestroyed () base.OnDestroyed (); } - static void DateFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + static void DateFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { CellRendererText renderer = (CellRendererText)cell; var rev = (Revision)model.GetValue (iter, 0); @@ -529,7 +529,7 @@ static void DateFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk renderer.Text = string.Format ("{0} {1:HH:mm}", day, rev.Time); } - static void GraphFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + static void GraphFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { var renderer = (RevisionGraphCellRenderer)cell; Gtk.TreeIter node; @@ -540,7 +540,7 @@ static void GraphFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gt renderer.LastNode = node.Equals (iter); } - static string GetCurrentFilter (Gtk.TreeModel model) + static string GetCurrentFilter (Gtk.ITreeModel model) { TreeIter filterIter; string filter = string.Empty; @@ -550,7 +550,7 @@ static string GetCurrentFilter (Gtk.TreeModel model) return filter; } - static void MessageFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + static void MessageFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { string filter = GetCurrentFilter (model); @@ -570,7 +570,7 @@ static void MessageFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, } } - static void AuthorFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + static void AuthorFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { string filter = GetCurrentFilter (model); @@ -588,7 +588,7 @@ static void AuthorFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, G renderer.Markup = EscapeWithFilterMarker (author, filter); } - static void AuthorIconFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + static void AuthorIconFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { CellRendererImage renderer = (CellRendererImage)cell; var rev = (Revision)model.GetValue (iter, 0); @@ -606,7 +606,7 @@ static void AuthorIconFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cel } } - static void RevisionFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + static void RevisionFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { string filter = GetCurrentFilter (model); @@ -618,7 +618,7 @@ static void RevisionFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, renderer.Markup = EscapeWithFilterMarker (rev, filter); } - static void SetDiffCellData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + static void SetDiffCellData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { CellRendererDiff rc = (CellRendererDiff)cell; string[] lines = (string[])model.GetValue (iter, colDiff); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs index 628bc2e0d43..ad887f101a1 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs @@ -356,7 +356,7 @@ protected override void OnWorkbenchWindowChanged () toolbar.ShowAll (); } - int CompareNodes (Gtk.TreeModel model, Gtk.TreeIter a, Gtk.TreeIter b) + int CompareNodes (Gtk.ITreeModel model, Gtk.TreeIter a, Gtk.TreeIter b) { int col, val=0; SortType type; @@ -1119,7 +1119,7 @@ void FillDifs () while (filestore.IterNext (ref it)); } - void SetDiffCellData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + void SetDiffCellData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { if (disposed) return; diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj b/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj index c47c4cc8ecf..1a6f4979b63 100644 --- a/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj +++ b/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj @@ -17,11 +17,22 @@ - - - + + gdk-sharp-3.0 + + + glib-sharp-3.0 + + + gtk-sharp-3.0 + - + + gtk-sharp-3.0 + + + gio-sharp-3.0 + diff --git a/main/src/tools/mdmonitor/TimeLineView.cs b/main/src/tools/mdmonitor/TimeLineView.cs index d345819c7d9..1f6346a9a39 100644 --- a/main/src/tools/mdmonitor/TimeLineView.cs +++ b/main/src/tools/mdmonitor/TimeLineView.cs @@ -346,181 +346,181 @@ protected override bool OnButtonPressEvent (EventButton evnt) } - protected override bool OnExposeEvent (EventExpose evnt) - { - if (data == null) - BuildData (); - - hostSpots.Clear (); - int ytop = padding; - int markerX = 3; - int lx = markerX + MarkerWidth + 1; - int tx = 250; - int ty = ytop; - int maxx = lx; - int maxy = 0; - - DateTime initialTime = mainValue.TimeStamp; - - Cairo.Context ctx = CairoHelper.Create (GdkWindow); - - using (Gdk.GC gc = new Gdk.GC (GdkWindow)) { - gc.RgbFgColor = Style.White; - GdkWindow.DrawRectangle (gc, true, 0, 0, Allocation.Width, Allocation.Height); - - // Draw full time marker - - ctx.NewPath (); - ctx.Rectangle (markerX, ytop + baseTime + 0.5, MarkerWidth / 2, ((mainValue.Duration.TotalMilliseconds * scale) / 1000)); - HslColor hsl = Style.Foreground (Gtk.StateType.Normal); - hsl.L = 0.8; - ctx.SetSourceColor (hsl); - ctx.Fill (); - - // Draw values - - foreach (CounterValueInfo val in data) { - DrawValue (ctx, gc, initialTime, ytop, lx, tx, ref ty, ref maxx, ref maxy, 0, val); - } - - if (ty > maxy) - maxy = ty; - - int totalms = (int)mainValue.Duration.TotalMilliseconds; - int marks = (totalms / 1000) + 1; - - ctx.LineWidth = 1; - gc.RgbFgColor = Style.Foreground (Gtk.StateType.Normal); - - for (int n = 0; n <= marks; n++) { - ctx.NewPath (); - int y = ytop + (int)(n * scale) + baseTime; - ctx.MoveTo (markerX, y + 0.5); - ctx.LineTo (markerX + MarkerWidth, y + 0.5); - ctx.SetSourceColor (Style.Foreground (Gtk.StateType.Normal).ToCairoColor ()); - ctx.Stroke (); - - y += 2; - layout.SetText (n + "s"); - GdkWindow.DrawLayout (gc, markerX + 1, y + 2, layout); - - int tw, th; - layout.GetPixelSize (out tw, out th); - y += th; - - if (y > maxy) - maxy = y; - } - } - - ((IDisposable)ctx).Dispose (); - - maxy += padding; - maxx += padding; - - if (lastHeight != maxy || lastWidth != maxx) { - lastWidth = maxx; - lastHeight = maxy; - SetSizeRequest (maxx, maxy); - } - - return true; - } +// protected override bool OnExposeEvent (EventExpose evnt) +// { +// if (data == null) +// BuildData (); +// +// hostSpots.Clear (); +// int ytop = padding; +// int markerX = 3; +// int lx = markerX + MarkerWidth + 1; +// int tx = 250; +// int ty = ytop; +// int maxx = lx; +// int maxy = 0; +// +// DateTime initialTime = mainValue.TimeStamp; +// +// Cairo.Context ctx = CairoHelper.Create (GdkWindow); +// +// using (Gdk.GC gc = new Gdk.GC (GdkWindow)) { +// gc.RgbFgColor = Style.White; +// GdkWindow.DrawRectangle (gc, true, 0, 0, Allocation.Width, Allocation.Height); +// +// // Draw full time marker +// +// ctx.NewPath (); +// ctx.Rectangle (markerX, ytop + baseTime + 0.5, MarkerWidth / 2, ((mainValue.Duration.TotalMilliseconds * scale) / 1000)); +// HslColor hsl = Style.Foreground (Gtk.StateType.Normal); +// hsl.L = 0.8; +// ctx.SetSourceColor (hsl); +// ctx.Fill (); +// +// // Draw values +// +// foreach (CounterValueInfo val in data) { +// DrawValue (ctx, gc, initialTime, ytop, lx, tx, ref ty, ref maxx, ref maxy, 0, val); +// } +// +// if (ty > maxy) +// maxy = ty; +// +// int totalms = (int)mainValue.Duration.TotalMilliseconds; +// int marks = (totalms / 1000) + 1; +// +// ctx.LineWidth = 1; +// gc.RgbFgColor = Style.Foreground (Gtk.StateType.Normal); +// +// for (int n = 0; n <= marks; n++) { +// ctx.NewPath (); +// int y = ytop + (int)(n * scale) + baseTime; +// ctx.MoveTo (markerX, y + 0.5); +// ctx.LineTo (markerX + MarkerWidth, y + 0.5); +// ctx.SetSourceColor (Style.Foreground (Gtk.StateType.Normal).ToCairoColor ()); +// ctx.Stroke (); +// +// y += 2; +// layout.SetText (n + "s"); +// GdkWindow.DrawLayout (gc, markerX + 1, y + 2, layout); +// +// int tw, th; +// layout.GetPixelSize (out tw, out th); +// y += th; +// +// if (y > maxy) +// maxy = y; +// } +// } +// +// ((IDisposable)ctx).Dispose (); +// +// maxy += padding; +// maxx += padding; +// +// if (lastHeight != maxy || lastWidth != maxx) { +// lastWidth = maxx; +// lastHeight = maxy; +// SetSizeRequest (maxx, maxy); +// } +// +// return true; +// } - void DrawValue (Cairo.Context ctx, Gdk.GC gc, DateTime initialTime, int ytop, int lx, int tx, ref int ty, ref int maxx, ref int maxy, int indent, CounterValueInfo val) - { - Gdk.Color color; - if (val.Counter != null) - color = val.Counter.GetColor (); - else - color = Style.Black; - - // Draw text - gc.RgbFgColor = color; - - double ms = (val.Time - initialTime).TotalMilliseconds; - - string txt = (ms / 1000).ToString ("0.00000") + ": " + (val.Duration.TotalMilliseconds / 1000).ToString ("0.00000") + " " + val.Trace; - layout.SetText (txt); - GdkWindow.DrawLayout (gc, tx + indent, ty, layout); - int tw, th; - layout.GetPixelSize (out tw, out th); - if (tx + tw + indent > maxx) - maxx = tx + tw + indent; - - HotSpot hp = AddHotSpot (tx + indent, ty, tw, th); - int tempTy = ty; - hp.Action = delegate { - int ytm = ytop + (int) ((ms * scale) / 1000); - SetBaseTime ((int) (tempTy + (th / 2) + 0.5) - ytm); - }; - hp.OnMouseOver += delegate { - overValue = val; - QueueDraw (); - }; - hp.Action += delegate { - focusedValue = val; - QueueDraw (); - }; - - // Draw time marker - int ytime = ytop + (int) ((ms * scale) / 1000) + baseTime; - - if (val == focusedValue || val == overValue) { - ctx.NewPath (); - double dx = val == focusedValue ? 0 : 2; - ctx.Rectangle (lx + 0.5 + dx - SelectedValuePadding, ytime + 0.5, LineEndWidth - dx*2 + SelectedValuePadding, ((val.Duration.TotalMilliseconds * scale) / 1000)); - HslColor hsl = color; - hsl.L = val == focusedValue ? 0.9 : 0.8; - ctx.SetSourceColor (hsl); - ctx.Fill (); - } - - ctx.NewPath (); - ctx.LineWidth = 1; - ctx.MoveTo (lx + 0.5, ytime + 0.5); - ctx.LineTo (lx + LineEndWidth + 0.5, ytime + 0.5); - ctx.LineTo (tx - 3 - LineEndWidth + 0.5, ty + (th / 2) + 0.5); - ctx.LineTo (tx + indent - 3 + 0.5, ty + (th / 2) + 0.5); - ctx.SetSourceColor (color.ToCairoColor ()); - ctx.Stroke (); - - // Expander - - bool incLine = true; - - if (val.CanExpand) { - double ex = tx + indent - 3 - ExpanderSize - 2 + 0.5; - double ey = ty + (th / 2) - (ExpanderSize/2) + 0.5; - hp = AddHotSpot (ex, ey, ExpanderSize, ExpanderSize); - DrawExpander (ctx, ex, ey, val.Expanded, false); - hp.OnMouseOver = delegate { - using (Cairo.Context c = CairoHelper.Create (GdkWindow)) { - DrawExpander (c, ex, ey, val.Expanded, true); - } - }; - hp.OnMouseLeave = delegate { - using (Cairo.Context c = CairoHelper.Create (GdkWindow)) { - DrawExpander (c, ex, ey, val.Expanded, false); - } - }; - hp.Action = delegate { - ToggleExpand (val); - }; - - if (val.Expanded && val.ExpandedTimerTraces.Count > 0) { - ty += th + LineSpacing; - foreach (CounterValueInfo cv in val.ExpandedTimerTraces) - DrawValue (ctx, gc, initialTime, ytop, lx, tx, ref ty, ref maxx, ref maxy, indent + ChildIndent, cv); - incLine = false; - } - } - if (incLine) - ty += th + LineSpacing; - - if (ytime > maxy) - maxy = ytime; - } +// void DrawValue (Cairo.Context ctx, Gdk.GC gc, DateTime initialTime, int ytop, int lx, int tx, ref int ty, ref int maxx, ref int maxy, int indent, CounterValueInfo val) +// { +// Gdk.Color color; +// if (val.Counter != null) +// color = val.Counter.GetColor (); +// else +// color = Style.Black; +// +// // Draw text +// gc.RgbFgColor = color; +// +// double ms = (val.Time - initialTime).TotalMilliseconds; +// +// string txt = (ms / 1000).ToString ("0.00000") + ": " + (val.Duration.TotalMilliseconds / 1000).ToString ("0.00000") + " " + val.Trace; +// layout.SetText (txt); +// GdkWindow.DrawLayout (gc, tx + indent, ty, layout); +// int tw, th; +// layout.GetPixelSize (out tw, out th); +// if (tx + tw + indent > maxx) +// maxx = tx + tw + indent; +// +// HotSpot hp = AddHotSpot (tx + indent, ty, tw, th); +// int tempTy = ty; +// hp.Action = delegate { +// int ytm = ytop + (int) ((ms * scale) / 1000); +// SetBaseTime ((int) (tempTy + (th / 2) + 0.5) - ytm); +// }; +// hp.OnMouseOver += delegate { +// overValue = val; +// QueueDraw (); +// }; +// hp.Action += delegate { +// focusedValue = val; +// QueueDraw (); +// }; +// +// // Draw time marker +// int ytime = ytop + (int) ((ms * scale) / 1000) + baseTime; +// +// if (val == focusedValue || val == overValue) { +// ctx.NewPath (); +// double dx = val == focusedValue ? 0 : 2; +// ctx.Rectangle (lx + 0.5 + dx - SelectedValuePadding, ytime + 0.5, LineEndWidth - dx*2 + SelectedValuePadding, ((val.Duration.TotalMilliseconds * scale) / 1000)); +// HslColor hsl = color; +// hsl.L = val == focusedValue ? 0.9 : 0.8; +// ctx.SetSourceColor (hsl); +// ctx.Fill (); +// } +// +// ctx.NewPath (); +// ctx.LineWidth = 1; +// ctx.MoveTo (lx + 0.5, ytime + 0.5); +// ctx.LineTo (lx + LineEndWidth + 0.5, ytime + 0.5); +// ctx.LineTo (tx - 3 - LineEndWidth + 0.5, ty + (th / 2) + 0.5); +// ctx.LineTo (tx + indent - 3 + 0.5, ty + (th / 2) + 0.5); +// ctx.SetSourceColor (color.ToCairoColor ()); +// ctx.Stroke (); +// +// // Expander +// +// bool incLine = true; +// +// if (val.CanExpand) { +// double ex = tx + indent - 3 - ExpanderSize - 2 + 0.5; +// double ey = ty + (th / 2) - (ExpanderSize/2) + 0.5; +// hp = AddHotSpot (ex, ey, ExpanderSize, ExpanderSize); +// DrawExpander (ctx, ex, ey, val.Expanded, false); +// hp.OnMouseOver = delegate { +// using (Cairo.Context c = CairoHelper.Create (GdkWindow)) { +// DrawExpander (c, ex, ey, val.Expanded, true); +// } +// }; +// hp.OnMouseLeave = delegate { +// using (Cairo.Context c = CairoHelper.Create (GdkWindow)) { +// DrawExpander (c, ex, ey, val.Expanded, false); +// } +// }; +// hp.Action = delegate { +// ToggleExpand (val); +// }; +// +// if (val.Expanded && val.ExpandedTimerTraces.Count > 0) { +// ty += th + LineSpacing; +// foreach (CounterValueInfo cv in val.ExpandedTimerTraces) +// DrawValue (ctx, gc, initialTime, ytop, lx, tx, ref ty, ref maxx, ref maxy, indent + ChildIndent, cv); +// incLine = false; +// } +// } +// if (incLine) +// ty += th + LineSpacing; +// +// if (ytime > maxy) +// maxy = ytime; +// } void DrawExpander (Cairo.Context ctx, double ex, double ey, bool expanded, bool hilight) { diff --git a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.CounterSelectorDialog.cs b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.CounterSelectorDialog.cs index f37cb343d14..7442d7b8db2 100644 --- a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.CounterSelectorDialog.cs +++ b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.CounterSelectorDialog.cs @@ -17,7 +17,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Select Counter"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child Mono.Instrumentation.Monitor.CounterSelectorDialog.VBox - global::Gtk.VBox w1 = this.VBox; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -34,7 +34,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(w1 [this.GtkScrolledWindow])); w3.Position = 0; // Internal child Mono.Instrumentation.Monitor.CounterSelectorDialog.ActionArea - global::Gtk.HButtonBox w4 = this.ActionArea; + global::Gtk.HButtonBox w4 = (Gtk.HButtonBox)this.ActionArea; w4.Name = "dialog1_ActionArea"; w4.Spacing = 10; w4.BorderWidth = ((uint)(5)); diff --git a/main/src/tools/mdmonitor/gtk-gui/gui.stetic b/main/src/tools/mdmonitor/gtk-gui/gui.stetic index cee108d72d8..50557221fcf 100644 --- a/main/src/tools/mdmonitor/gtk-gui/gui.stetic +++ b/main/src/tools/mdmonitor/gtk-gui/gui.stetic @@ -2,7 +2,7 @@ .. - 2.12 + 3.0 diff --git a/main/src/tools/mdmonitor/mdmonitor.csproj b/main/src/tools/mdmonitor/mdmonitor.csproj index 6a1cb39daaf..6dc347b4442 100644 --- a/main/src/tools/mdmonitor/mdmonitor.csproj +++ b/main/src/tools/mdmonitor/mdmonitor.csproj @@ -16,14 +16,29 @@ - - - - - - + + gtk-sharp-3.0 + + + gdk-sharp-3.0 + + + glib-sharp-3.0 + + + gtk-sharp-3.0 + + + gtk-sharp-3.0 + + + gtk-sharp-3.0 + + + gio-sharp-3.0 + From b08b7c532f3372052fd8f3a8bc386ae5d531cc69 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Mon, 30 Jul 2018 09:46:58 -0400 Subject: [PATCH 022/382] Bump Xwt submodule, for Mac dllmap fix --- main/external/xwt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/external/xwt b/main/external/xwt index dba5955385d..3187770c012 160000 --- a/main/external/xwt +++ b/main/external/xwt @@ -1 +1 @@ -Subproject commit dba5955385d8d3c44cd5f38886fc94398619edea +Subproject commit 3187770c01285054e48819ff1f2990d287953bb7 From 7da6b8e281ba9e2dcec5473f31063efbfbe577eb Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:26:56 +0100 Subject: [PATCH 023/382] Update MonoDevelop.AspNet.csproj --- main/src/addins/AspNet/MonoDevelop.AspNet.csproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/main/src/addins/AspNet/MonoDevelop.AspNet.csproj b/main/src/addins/AspNet/MonoDevelop.AspNet.csproj index f137f9b88da..21e7bf15219 100644 --- a/main/src/addins/AspNet/MonoDevelop.AspNet.csproj +++ b/main/src/addins/AspNet/MonoDevelop.AspNet.csproj @@ -82,14 +82,6 @@ -<<<<<<< HEAD -======= - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 2813a07ea7cdceaaac6b769dc6b5ce29fa4f27e6 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:27:29 +0100 Subject: [PATCH 024/382] Update MonoDevelop.AspNet.Tests.csproj --- .../Tests/MonoDevelop.AspNet.Tests.csproj | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj b/main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj index ed10ba502e5..48f291c5057 100644 --- a/main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj +++ b/main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj @@ -18,33 +18,6 @@ -<<<<<<< HEAD -======= - - - - - - ..\..\..\..\build\bin\System.Reflection.Metadata.dll - False - - - ..\..\..\..\build\bin\System.Collections.Immutable.dll - False - - - ..\..\..\..\build\bin\Microsoft.CodeAnalysis.Workspaces.dll - False - - - ..\..\..\..\build\bin\Microsoft.CodeAnalysis.dll - False - - - ..\..\..\..\build\bin\Microsoft.CodeAnalysis.CSharp.dll - False - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 5382325085b07454ead0f439052fd82470c95812 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:28:13 +0100 Subject: [PATCH 025/382] Update CSharpBinding.AspNet.csproj --- .../CSharpBinding/AspNet/CSharpBinding.AspNet.csproj | 9 --------- 1 file changed, 9 deletions(-) diff --git a/main/src/addins/CSharpBinding/AspNet/CSharpBinding.AspNet.csproj b/main/src/addins/CSharpBinding/AspNet/CSharpBinding.AspNet.csproj index 1aef80293ea..c12fa966e8c 100644 --- a/main/src/addins/CSharpBinding/AspNet/CSharpBinding.AspNet.csproj +++ b/main/src/addins/CSharpBinding/AspNet/CSharpBinding.AspNet.csproj @@ -18,16 +18,7 @@ -<<<<<<< HEAD -======= - - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From c0099bfa670906916d6c7b5a4d868800544a22d1 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:29:01 +0100 Subject: [PATCH 026/382] Update CSharpBinding.csproj --- main/src/addins/CSharpBinding/CSharpBinding.csproj | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/main/src/addins/CSharpBinding/CSharpBinding.csproj b/main/src/addins/CSharpBinding/CSharpBinding.csproj index 73897eca563..9d445c25a9a 100644 --- a/main/src/addins/CSharpBinding/CSharpBinding.csproj +++ b/main/src/addins/CSharpBinding/CSharpBinding.csproj @@ -98,19 +98,6 @@ -<<<<<<< HEAD -======= - - - ..\..\..\packages\ICSharpCode.Decompiler.3.0.0.3403-beta4\lib\net46\ICSharpCode.Decompiler.dll - false - - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From ba6a7b52a5ddd0c98af13c5b31e721ff06dce564 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:29:58 +0100 Subject: [PATCH 027/382] Update ChangeLogAddIn.csproj --- main/src/addins/ChangeLogAddIn/ChangeLogAddIn.csproj | 9 --------- 1 file changed, 9 deletions(-) diff --git a/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.csproj b/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.csproj index e9ad5eff0d0..b1dfbffbf80 100644 --- a/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.csproj +++ b/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.csproj @@ -54,15 +54,6 @@ -<<<<<<< HEAD -======= - - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 22543e7bf4cc805529f44e9d9560348e0943c841 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:30:46 +0100 Subject: [PATCH 028/382] Update MonoDevelop.Deployment.Linux.csproj --- .../MonoDevelop.Deployment.Linux.csproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.csproj b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.csproj index 3618fdc79e4..776ae71ea9b 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.csproj +++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.csproj @@ -42,14 +42,6 @@ -<<<<<<< HEAD -======= - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 962d499414982508e7c1d75f465953e6c74374fc Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:32:17 +0100 Subject: [PATCH 029/382] Update MonoDevelop.Deployment.csproj --- .../MonoDevelop.Deployment.csproj | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj index 48aa49e365c..dae57a5defa 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj @@ -17,22 +17,6 @@ -<<<<<<< HEAD -======= - - - - - - - ..\..\..\..\packages\JetBrains.SharpZipLib.Stripped.0.87.20170615.10\lib\net40\ICSharpCode.SharpZipLib.dll - False - - - ..\..\..\..\build\bin\System.Collections.Immutable.dll - False - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From c81b86270a8a852c4e0e8fd370c9901654d3c659 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:32:55 +0100 Subject: [PATCH 030/382] Update GnomePlatform.csproj --- main/src/addins/GnomePlatform/GnomePlatform.csproj | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/main/src/addins/GnomePlatform/GnomePlatform.csproj b/main/src/addins/GnomePlatform/GnomePlatform.csproj index 7cad6d96d5b..2fc9333ab0b 100644 --- a/main/src/addins/GnomePlatform/GnomePlatform.csproj +++ b/main/src/addins/GnomePlatform/GnomePlatform.csproj @@ -11,19 +11,10 @@ true -<<<<<<< HEAD -======= - - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 @@ -38,4 +29,4 @@ - \ No newline at end of file + From 02ed7dc49c1b5e07d9e7732023c45f5ae1fbf7f0 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:33:30 +0100 Subject: [PATCH 031/382] Update GnomePlatform.cs --- main/src/addins/GnomePlatform/GnomePlatform.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/main/src/addins/GnomePlatform/GnomePlatform.cs b/main/src/addins/GnomePlatform/GnomePlatform.cs index 48ca5ddb657..96437cdd2f0 100644 --- a/main/src/addins/GnomePlatform/GnomePlatform.cs +++ b/main/src/addins/GnomePlatform/GnomePlatform.cs @@ -89,8 +89,6 @@ public override string DefaultMonospaceFont { } } -<<<<<<< HEAD -======= public override string DefaultSansFont { get { try { @@ -100,8 +98,7 @@ public override string DefaultSansFont { } } } - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 + public override string Name { get { return "Gnome"; } } From cdf55fe6ea5e7e0f342143928b4e2f1b4959599d Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:34:23 +0100 Subject: [PATCH 032/382] Update ILAsmBinding.csproj --- main/src/addins/ILAsmBinding/ILAsmBinding.csproj | 9 --------- 1 file changed, 9 deletions(-) diff --git a/main/src/addins/ILAsmBinding/ILAsmBinding.csproj b/main/src/addins/ILAsmBinding/ILAsmBinding.csproj index 53cf7694922..36911bfc65b 100644 --- a/main/src/addins/ILAsmBinding/ILAsmBinding.csproj +++ b/main/src/addins/ILAsmBinding/ILAsmBinding.csproj @@ -13,15 +13,6 @@ -<<<<<<< HEAD -======= - - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From ca4a6d8085972ef4d7b9826172f65fc1343a3d65 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:36:09 +0100 Subject: [PATCH 033/382] Update MacPlatform.csproj --- main/src/addins/MacPlatform/MacPlatform.csproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/main/src/addins/MacPlatform/MacPlatform.csproj b/main/src/addins/MacPlatform/MacPlatform.csproj index c080bcb6f7c..c8f82afd781 100644 --- a/main/src/addins/MacPlatform/MacPlatform.csproj +++ b/main/src/addins/MacPlatform/MacPlatform.csproj @@ -17,14 +17,6 @@ -<<<<<<< HEAD -======= - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 687b670919bb8846f3be60395d7c75bcfa2067f2 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:36:41 +0100 Subject: [PATCH 034/382] Update MonoDevelop.AspNetCore.csproj --- .../MonoDevelop.AspNetCore.csproj | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.csproj b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.csproj index 76c1777412a..6b18dd3fa04 100644 --- a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.csproj +++ b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.csproj @@ -15,23 +15,10 @@ -<<<<<<< HEAD -======= - - - - - - - - ..\..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - False - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From af429f1caca40510f505a617df8341ef75741152 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:37:09 +0100 Subject: [PATCH 035/382] Update MonoDevelop.AssemblyBrowser.csproj --- .../MonoDevelop.AssemblyBrowser.csproj | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.csproj b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.csproj index f1c04054c44..d91cc0ab5e9 100644 --- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.csproj +++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.csproj @@ -17,18 +17,6 @@ -<<<<<<< HEAD -======= - - ..\..\..\packages\ICSharpCode.Decompiler.3.0.0.3403-beta4\lib\net46\ICSharpCode.Decompiler.dll - false - - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From fd146a4e4ef11c48faef176d1ddccdeee8d7ff9a Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:38:00 +0100 Subject: [PATCH 036/382] Update MonoDevelop.Autotools.csproj --- .../MonoDevelop.Autotools/MonoDevelop.Autotools.csproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.csproj b/main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.csproj index 777e1e6f37a..18f00662651 100644 --- a/main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.csproj +++ b/main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.csproj @@ -39,14 +39,6 @@ -<<<<<<< HEAD -======= - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From c87d85c3e582422d5d17d0d08c5e2abdfea412a2 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:38:30 +0100 Subject: [PATCH 037/382] Update MonoDevelop.ConnectedServices.csproj --- .../MonoDevelop.ConnectedServices.csproj | 53 ------------------- 1 file changed, 53 deletions(-) diff --git a/main/src/addins/MonoDevelop.ConnectedServices/MonoDevelop.ConnectedServices.csproj b/main/src/addins/MonoDevelop.ConnectedServices/MonoDevelop.ConnectedServices.csproj index e0119253cd9..408fc35ff6b 100644 --- a/main/src/addins/MonoDevelop.ConnectedServices/MonoDevelop.ConnectedServices.csproj +++ b/main/src/addins/MonoDevelop.ConnectedServices/MonoDevelop.ConnectedServices.csproj @@ -13,59 +13,6 @@ -<<<<<<< HEAD -======= - - - - - - - - ..\..\..\build\bin\System.Collections.Immutable.dll - False - - - ..\..\..\build\bin\ICSharpCode.NRefactory.dll - False - - - ..\..\..\build\bin\ICSharpCode.NRefactory.CSharp.dll - False - - - ..\..\..\build\bin\System.Composition.AttributedModel.dll - False - - - ..\..\..\build\bin\System.Collections.Immutable.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.Workspaces.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.CSharp.Workspaces.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.CSharp.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.Workspaces.Desktop.dll - False - - - ..\..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - False - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 520a4d9e0dd5d5c9740ba66e66524d10a09be62a Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:38:58 +0100 Subject: [PATCH 038/382] Update MonoDevelop.Debugger.Soft.AspNet.csproj --- .../MonoDevelop.Debugger.Soft.AspNet.csproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/MonoDevelop.Debugger.Soft.AspNet.csproj b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/MonoDevelop.Debugger.Soft.AspNet.csproj index 3b876fb1d13..7062f7d3195 100644 --- a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/MonoDevelop.Debugger.Soft.AspNet.csproj +++ b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/MonoDevelop.Debugger.Soft.AspNet.csproj @@ -13,14 +13,6 @@ -<<<<<<< HEAD -======= - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From eb9ce4a691a0744d7483246361cbfa961325d91a Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:39:26 +0100 Subject: [PATCH 039/382] Update MonoDevelop.Debugger.Soft.csproj --- .../MonoDevelop.Debugger.Soft.csproj | 37 ------------------- 1 file changed, 37 deletions(-) diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj index f7f6d858167..e36a3db61a9 100644 --- a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj +++ b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj @@ -13,43 +13,6 @@ -<<<<<<< HEAD -======= - - gtk-sharp-3.0 - - - glib-sharp-3.0 - - - gdk-sharp-3.0 - - - gtk-sharp-3.0 - - - gtk-sharp-3.0 - - - ..\..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.dll - False - - - ..\..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.Mdb.dll - False - - - ..\..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.Pdb.dll - False - - - ..\..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.Rocks.dll - False - - - gio-sharp-3.0 - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 0361d43027abf5507527c6a33943d60ced02e14d Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:40:30 +0100 Subject: [PATCH 040/382] Update MonoDevelop.Debugger.csproj --- .../MonoDevelop.Debugger.csproj | 53 ------------------- 1 file changed, 53 deletions(-) diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj index 195f944b97b..b8d81890b6f 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj @@ -21,68 +21,15 @@ -<<<<<<< HEAD -======= - - glib-sharp-3.0 - - - gtk-sharp-3.0 - - - gtk-sharp-3.0 - - - gdk-sharp-3.0 - - - - - gtk-sharp-3.0 - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 -<<<<<<< HEAD -======= - - ..\..\..\build\bin\System.Reflection.Metadata.dll - False - - - ..\..\..\build\bin\System.Collections.Immutable.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.Workspaces.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.CSharp.dll - False - - - ..\..\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll - False - - - gio-sharp-3.0 - - - gtk-sharp-3.0 - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From ea77cab859ec82152bdb78b6471683ba1edbfef6 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:41:07 +0100 Subject: [PATCH 041/382] Update MonoDevelop.DesignerSupport.csproj --- .../MonoDevelop.DesignerSupport.csproj | 52 ------------------- 1 file changed, 52 deletions(-) diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj index bac207aaeee..b89174a85de 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj @@ -29,59 +29,7 @@ -<<<<<<< HEAD -======= - - - glib-sharp-3.0 - - - gtk-sharp-3.0 - - - gtk-sharp-3.0 - - - gdk-sharp-3.0 - - - gtk-sharp-3.0 - - - - - ..\..\..\build\bin\System.Reflection.Metadata.dll - False - - - ..\..\..\build\bin\System.Collections.Immutable.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.dll - False - - - ..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.dll - False - - - ..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.Mdb.dll - False - - - ..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.Pdb.dll - False - - - ..\..\..\packages\Mono.Cecil.0.10.0-beta6\lib\net40\Mono.Cecil.Rocks.dll - False - - - gio-sharp-3.0 - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 5c2479e18b0893736dfe025a78faed770ba272a7 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:41:57 +0100 Subject: [PATCH 042/382] Update MonoDevelop.DocFood.csproj --- .../MonoDevelop.DocFood.csproj | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.csproj b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.csproj index c92079d9536..d8c2d993ec9 100644 --- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.csproj +++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.csproj @@ -16,43 +16,8 @@ -<<<<<<< HEAD -======= - - - - - - - - - - ..\..\..\build\bin\System.Reflection.Metadata.dll - False - - - ..\..\..\build\bin\System.Collections.Immutable.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.CSharp.Workspaces.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.CSharp.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.Workspaces.dll - False - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 206e13bd8c4c50eb85e03fd2e56010942b1fdb7d Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:42:47 +0100 Subject: [PATCH 043/382] Update DotNetCoreTestBase.cs --- .../DotNetCoreTestBase.cs | 131 +++++++++--------- 1 file changed, 63 insertions(+), 68 deletions(-) diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreTestBase.cs b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreTestBase.cs index 16c5be509d7..e30e89bf22f 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreTestBase.cs +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreTestBase.cs @@ -1,70 +1,65 @@ -// -// DotNetCoreTestBase.cs -// -// Author: -// Matt Ward -// -// Copyright (c) 2017 Xamarin Inc. (http://xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - +// +// DotNetCoreTestBase.cs +// +// Author: +// Matt Ward +// +// Copyright (c) 2017 Xamarin Inc. (http://xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + using System.IO; -using System.Threading.Tasks; +using System.Threading.Tasks; using MonoDevelop.Core; -using MonoDevelop.Ide; -using MonoDevelop.Ide.TypeSystem; -using UnitTests; - -namespace MonoDevelop.DotNetCore.Tests -{ - [RequireService (typeof (TypeSystemService))] - class DotNetCoreTestBase : TestBase - { - protected override Task InternalSetup (string rootDir) - { -<<<<<<< HEAD - Xwt.Application.Initialize (Xwt.ToolkitType.Gtk); - return base.InternalSetup (rootDir); -======= - base.InternalSetup (rootDir); - Xwt.Application.Initialize (Xwt.ToolkitType.Gtk3); - DesktopService.Initialize (); ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 - } - - /// - /// Clear all other package sources and just use the main NuGet package source when - /// restoring the packages for the project temlate tests. - /// - protected static void CreateNuGetConfigFile (FilePath directory) - { - var fileName = directory.Combine ("NuGet.Config"); - - string xml = - "\r\n" + - " \r\n" + - " \r\n" + - " \r\n" + - " \r\n" + - ""; - - File.WriteAllText (fileName, xml); - } - } -} +using MonoDevelop.Ide; +using MonoDevelop.Ide.TypeSystem; +using UnitTests; + +namespace MonoDevelop.DotNetCore.Tests +{ + [RequireService (typeof (TypeSystemService))] + class DotNetCoreTestBase : TestBase + { + protected override Task InternalSetup (string rootDir) + { + base.InternalSetup (rootDir); + Xwt.Application.Initialize (Xwt.ToolkitType.Gtk3); + DesktopService.Initialize (); + } + + /// + /// Clear all other package sources and just use the main NuGet package source when + /// restoring the packages for the project temlate tests. + /// + protected static void CreateNuGetConfigFile (FilePath directory) + { + var fileName = directory.Combine ("NuGet.Config"); + + string xml = + "\r\n" + + " \r\n" + + " \r\n" + + " \r\n" + + " \r\n" + + ""; + + File.WriteAllText (fileName, xml); + } + } +} From 331eadd992e02efe8315c49e3180ccf05e0a72c4 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:43:09 +0100 Subject: [PATCH 044/382] Update MonoDevelop.DotNetCore.csproj --- .../MonoDevelop.DotNetCore.csproj | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj index 76dfd18134e..b1518171d39 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj @@ -17,19 +17,6 @@ -<<<<<<< HEAD -======= - - - - - - ..\..\..\external\nuget-binary\NuGet.Versioning.dll - False - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From da954e4bc40614f8aad199cce7061dcc54f0a7bd Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:43:58 +0100 Subject: [PATCH 045/382] Update MonoDevelop.Gettext.csproj --- .../MonoDevelop.Gettext.csproj | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj index d98cf10e761..5e743d130bb 100644 --- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj +++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj @@ -17,41 +17,7 @@ -<<<<<<< HEAD -======= - - glib-sharp-3.0 - - - gtk-sharp-3.0 - - - gtk-sharp-3.0 - - - gdk-sharp-3.0 - - - gtk-sharp-3.0 - - - - ..\..\..\build\bin\System.Reflection.Metadata.dll - False - - - ..\..\..\build\bin\System.Collections.Immutable.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.dll - False - - - gio-sharp-3.0 - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From ffe60ee1beae905ab6b8f995afc80975ad154988 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:44:55 +0100 Subject: [PATCH 046/382] Update MonoDevelop.HexEditor.csproj --- .../MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj index 19ac6c7a0e4..a2ffa3c2ddb 100644 --- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj +++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj @@ -15,14 +15,6 @@ -<<<<<<< HEAD -======= - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 71979e7d7821a186ef3645a650fe296c1138a47e Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:45:28 +0100 Subject: [PATCH 047/382] Update MonoDevelop.PackageManagement.csproj --- .../MonoDevelop.PackageManagement.csproj | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj index 4ed6d5e9a85..1cf8c76547c 100644 --- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj +++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj @@ -13,22 +13,9 @@ -<<<<<<< HEAD -======= - - - - - - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 22629cd8004e98311c69bfd1d0ad0c10dd585b3b Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:46:01 +0100 Subject: [PATCH 048/382] Update MonoDevelop.Packaging.csproj --- .../MonoDevelop.Packaging.csproj | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.csproj b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.csproj index 5b168e7718a..bc0bde87a36 100644 --- a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.csproj +++ b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.csproj @@ -14,40 +14,6 @@ -<<<<<<< HEAD -======= - - - - - - - ..\..\..\external\nuget-binary\NuGet.Protocol.dll - False - - - ..\..\..\external\nuget-binary\NuGet.Packaging.dll - False - - - ..\..\..\external\nuget-binary\NuGet.Packaging.Core.dll - False - - - ..\..\..\external\nuget-binary\NuGet.Frameworks.dll - False - - - ..\..\..\external\nuget-binary\NuGet.Versioning.dll - False - - - - - ..\..\..\external\nuget-binary\NuGet.PackageManagement.dll - False - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From af3e1487cae1889d9aedf6ecbab6fd4b855ed9a0 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:46:25 +0100 Subject: [PATCH 049/382] Update MonoDevelop.UnitTesting.csproj --- .../MonoDevelop.UnitTesting.csproj | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj index 2282daa42a7..9a663105aa5 100644 --- a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj +++ b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj @@ -13,16 +13,6 @@ -<<<<<<< HEAD -======= - - - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From be49f290179be154f0e0f145b7bf0582e334ad30 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:46:57 +0100 Subject: [PATCH 050/382] Update MonoDevelop.WebReferences.csproj --- .../MonoDevelop.WebReferences.csproj | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj index 520dc07245c..83605bad3ec 100644 --- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj +++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj @@ -15,16 +15,6 @@ -<<<<<<< HEAD -======= - - - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 @@ -129,4 +119,4 @@ - \ No newline at end of file + From 148cff8389f9f91fff433f11ef69cec44c6f9ee0 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:47:44 +0100 Subject: [PATCH 051/382] Update MonoDevelop.Refactoring.csproj --- .../MonoDevelop.Refactoring.csproj | 9 --------- 1 file changed, 9 deletions(-) diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj index e2f39112c2a..2b62d424255 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj @@ -18,15 +18,6 @@ -<<<<<<< HEAD -======= - - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From d5abead1ce1512f9f5aa7bc448fddc74a6422a95 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:48:29 +0100 Subject: [PATCH 052/382] Update MonoDevelop.RegexToolkit.csproj --- .../MonoDevelop.RegexToolkit.csproj | 45 ------------------- 1 file changed, 45 deletions(-) diff --git a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj index 12e15a524b2..1078f0c129a 100644 --- a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj +++ b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj @@ -16,51 +16,6 @@ -<<<<<<< HEAD -======= - - gdk-sharp-3.0 - - - gtk-sharp-3.0 - - - glib-sharp-3.0 - - - gtk-sharp-3.0 - - - gtk-sharp-3.0 - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.CSharp.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.CSharp.Workspaces.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.Workspaces.dll - False - - - ..\..\..\build\bin\System.Composition.AttributedModel.dll - False - - - ..\..\..\build\bin\System.Collections.Immutable.dll - False - - - gio-sharp-3.0 - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 17ab891be1c8f5590ca4073837a7a8041b0457fa Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:49:26 +0100 Subject: [PATCH 053/382] Update MonoDevelop.SourceEditor.csproj --- .../MonoDevelop.SourceEditor.csproj | 50 ------------------- 1 file changed, 50 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj index abf87cd6d9b..274782dac28 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj @@ -62,7 +62,6 @@ Mono.Debugging False -<<<<<<< HEAD @@ -92,55 +91,6 @@ ..\..\..\external\Xamarin.Mac.dll -======= - - - {3B25FD1F-CEBA-4450-8893-DC330FDB56A7} - Xwt.Gtk3 - False - - - - - False - ..\..\..\build\bin\Microsoft.VisualStudio.Threading.dll - False - - - ..\..\..\build\bin\Microsoft.VisualStudio.Text.Implementation.dll - False - - - - - - - - - - - - - ..\..\..\build\bin\System.Reflection.Metadata.dll - False - - - ..\..\..\build\bin\System.Collections.Immutable.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.dll - False - - - - - ..\..\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 False From 5b56310bb95d83b0d11ea6beb80b6e524ed18d40 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:49:55 +0100 Subject: [PATCH 054/382] Update MonoDeveloperExtensions.csproj --- .../MonoDeveloperExtensions/MonoDeveloperExtensions.csproj | 7 ------- 1 file changed, 7 deletions(-) diff --git a/main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.csproj b/main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.csproj index a8627206eeb..174cc152e20 100644 --- a/main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.csproj +++ b/main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.csproj @@ -30,13 +30,6 @@ -<<<<<<< HEAD -======= - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 8e8489335a14d5b31edf3f4632c46003fff942d9 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:50:22 +0100 Subject: [PATCH 055/382] Update PerformanceDiagnosticsAddIn.csproj --- .../PerformanceDiagnosticsAddIn.csproj | 6 ------ 1 file changed, 6 deletions(-) diff --git a/main/src/addins/PerformanceDiagnostics/PerformanceDiagnostics/PerformanceDiagnosticsAddIn.csproj b/main/src/addins/PerformanceDiagnostics/PerformanceDiagnostics/PerformanceDiagnosticsAddIn.csproj index bc470acf9f6..59b6af744fc 100644 --- a/main/src/addins/PerformanceDiagnostics/PerformanceDiagnostics/PerformanceDiagnosticsAddIn.csproj +++ b/main/src/addins/PerformanceDiagnostics/PerformanceDiagnostics/PerformanceDiagnosticsAddIn.csproj @@ -12,12 +12,6 @@ -<<<<<<< HEAD -======= - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 ..\..\..\..\external\Xamarin.Mac.dll False From 07c4c3f8914cdb6baa33f332f02c7447b140dd32 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:50:46 +0100 Subject: [PATCH 056/382] Update MonoDevelop.TextTemplating.csproj --- .../MonoDevelop.TextTemplating.csproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/MonoDevelop.TextTemplating.csproj b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/MonoDevelop.TextTemplating.csproj index 4c88ea9db3e..93a403d0a04 100644 --- a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/MonoDevelop.TextTemplating.csproj +++ b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/MonoDevelop.TextTemplating.csproj @@ -35,14 +35,6 @@ -<<<<<<< HEAD -======= - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 5ba3fcecc046b333b3b684957d677f9482920d22 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:51:11 +0100 Subject: [PATCH 057/382] Update VBNetBinding.csproj --- main/src/addins/VBNetBinding/VBNetBinding.csproj | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/main/src/addins/VBNetBinding/VBNetBinding.csproj b/main/src/addins/VBNetBinding/VBNetBinding.csproj index 1ad16d76dbd..3ce864fc2db 100644 --- a/main/src/addins/VBNetBinding/VBNetBinding.csproj +++ b/main/src/addins/VBNetBinding/VBNetBinding.csproj @@ -38,15 +38,6 @@ -<<<<<<< HEAD -======= - - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 @@ -81,4 +72,4 @@ - \ No newline at end of file + From e0f5fc9b65ca11bafeb2101dadae8e86097950b5 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:51:35 +0100 Subject: [PATCH 058/382] Update MonoDevelop.VersionControl.Git.Tests.csproj --- .../MonoDevelop.VersionControl.Git.Tests.csproj | 6 ------ 1 file changed, 6 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj index 92ceb28918f..446294e90ee 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj @@ -21,12 +21,6 @@ -<<<<<<< HEAD -======= - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From dad8d99042d26278d7094474878fa882583af77b Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:51:51 +0100 Subject: [PATCH 059/382] Update MonoDevelop.VersionControl.Git.csproj --- .../MonoDevelop.VersionControl.Git.csproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj index c928d6e0821..ce3af25c5a0 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj @@ -18,14 +18,6 @@ -<<<<<<< HEAD -======= - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 5ab92f3aef517fd816a9ac5a1108987b9ab325f3 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:52:11 +0100 Subject: [PATCH 060/382] Update MonoDevelop.VersionControl.Subversion.csproj --- .../MonoDevelop.VersionControl.Subversion.csproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj index e6e60275197..4e7abfcd914 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj @@ -45,14 +45,6 @@ -<<<<<<< HEAD -======= - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From ff1da9e2239d9e8c49519b43077e380da2e98f24 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:52:36 +0100 Subject: [PATCH 061/382] Update MonoDevelop.VersionControl.csproj --- .../MonoDevelop.VersionControl.csproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj index a4430ef802f..44f75e5d313 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj @@ -57,14 +57,6 @@ -<<<<<<< HEAD -======= - - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 ..\..\..\..\build\bin\System.Reflection.Metadata.dll From bbedacc670c074493a631ba9d1d434ceadf0cbfa Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:53:01 +0100 Subject: [PATCH 062/382] Update WindowsPlatform.csproj --- .../WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj | 7 ------- 1 file changed, 7 deletions(-) diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj index 420fb7d4032..9739a3ea01f 100644 --- a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj +++ b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj @@ -11,13 +11,6 @@ -<<<<<<< HEAD -======= - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 7c45b25a6e56f89d06e7ea7300d9a9e8ac567126 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:53:35 +0100 Subject: [PATCH 063/382] Update MonoDevelop.Xml.csproj --- main/src/addins/Xml/MonoDevelop.Xml.csproj | 35 ---------------------- 1 file changed, 35 deletions(-) diff --git a/main/src/addins/Xml/MonoDevelop.Xml.csproj b/main/src/addins/Xml/MonoDevelop.Xml.csproj index 4cf985e0f70..0be0e468629 100644 --- a/main/src/addins/Xml/MonoDevelop.Xml.csproj +++ b/main/src/addins/Xml/MonoDevelop.Xml.csproj @@ -20,42 +20,7 @@ -<<<<<<< HEAD -======= - - - glib-sharp-3.0 - - - gtk-sharp-3.0 - - - gtk-sharp-3.0 - - - gdk-sharp-3.0 - - - gtk-sharp-3.0 - - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.dll - False - - - ..\..\..\build\bin\System.Collections.Immutable.dll - False - - - ..\..\..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll - False - - - gio-sharp-3.0 - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 33a4e56a8960b49aeaf971d04879df4fb19bef2c Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:56:02 +0100 Subject: [PATCH 064/382] Update mdmonitor.csproj --- main/src/tools/mdmonitor/mdmonitor.csproj | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/main/src/tools/mdmonitor/mdmonitor.csproj b/main/src/tools/mdmonitor/mdmonitor.csproj index d6c45764d1a..92be31c9de7 100644 --- a/main/src/tools/mdmonitor/mdmonitor.csproj +++ b/main/src/tools/mdmonitor/mdmonitor.csproj @@ -17,25 +17,6 @@ -<<<<<<< HEAD -======= - - - gtk-sharp-3.0 - - - gdk-sharp-3.0 - - - glib-sharp-3.0 - - - gtk-sharp-3.0 - - - gtk-sharp-3.0 - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From b7c7a2d2afa2be7550f62c988bbe8b029990d090 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:56:56 +0100 Subject: [PATCH 065/382] Update MonoDevelop.Ide.csproj --- .../MonoDevelop.Ide/MonoDevelop.Ide.csproj | 50 ------------------- 1 file changed, 50 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj index 373de7980c7..dce8d91583d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj @@ -17,56 +17,6 @@ -<<<<<<< HEAD -======= - - gtk-sharp-3.0 - - - gdk-sharp-3.0 - - - glib-sharp-3.0 - - - gtk-sharp-3.0 - - - gtk-sharp-3.0 - - - ..\..\..\packages\JetBrains.SharpZipLib.Stripped.0.87.20170615.10\lib\net40\ICSharpCode.SharpZipLib.dll - - - ..\..\..\packages\Microsoft.TemplateEngine.Abstractions.1.0.0-beta3-20171117-314\lib\net45\Microsoft.TemplateEngine.Abstractions.dll - - - ..\..\..\packages\Microsoft.TemplateEngine.Core.1.0.0-beta3-20171117-314\lib\net45\Microsoft.TemplateEngine.Core.dll - - - ..\..\..\packages\Microsoft.TemplateEngine.Core.Contracts.1.0.0-beta3-20171117-314\lib\net45\Microsoft.TemplateEngine.Core.Contracts.dll - - - ..\..\..\packages\Microsoft.TemplateEngine.Edge.1.0.0-beta3-20171117-314\lib\net45\Microsoft.TemplateEngine.Edge.dll - - - ..\..\..\packages\Microsoft.TemplateEngine.Orchestrator.RunnableProjects.1.0.0-beta3-20171117-314\lib\net45\Microsoft.TemplateEngine.Orchestrator.RunnableProjects.dll - - - ..\..\..\packages\Microsoft.TemplateEngine.Utils.1.0.0-beta3-20171117-314\lib\net45\Microsoft.TemplateEngine.Utils.dll - - - ..\..\..\packages\Microsoft.VisualStudio.Composition.15.6.36\lib\net45\Microsoft.VisualStudio.Composition.dll - - - ..\..\..\packages\Microsoft.VisualStudio.Threading.15.6.46\lib\net45\Microsoft.VisualStudio.Threading.dll - - - ..\..\..\packages\Microsoft.VisualStudio.Validation.15.3.32\lib\net45\Microsoft.VisualStudio.Validation.dll - True - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 587b2e08c3a0b7eba64ff59aea100003e63860b0 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:57:22 +0100 Subject: [PATCH 066/382] Update MonoDevelop.TextEditor.Tests.csproj --- .../MonoDevelop.TextEditor.Tests.csproj | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj b/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj index 9a1ef652877..02bd19d40e7 100644 --- a/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj +++ b/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj @@ -16,26 +16,7 @@ -<<<<<<< HEAD -======= - - gdk-sharp-3.0 - - - glib-sharp-3.0 - - - gtk-sharp-3.0 - - - - gtk-sharp-3.0 - - - gio-sharp-3.0 - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From cf1e8bf439f19dd99bd32289e9fd4b9f9573c6ca Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:08:31 +0100 Subject: [PATCH 067/382] Update TestHelpers.fs --- .../fsharpbinding/MonoDevelop.FSharp.Tests/TestHelpers.fs | 3 --- 1 file changed, 3 deletions(-) diff --git a/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/TestHelpers.fs b/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/TestHelpers.fs index 19432ef5c1a..097b94fea12 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/TestHelpers.fs +++ b/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/TestHelpers.fs @@ -24,10 +24,7 @@ module FixtureSetup = //Environment.SetEnvironmentVariable ("MONO_ADDINS_REGISTRY", "/tmp") //Environment.SetEnvironmentVariable ("XDG_CONFIG_HOME", "/tmp") MonoDevelop.FSharp.MDLanguageService.DisableVirtualFileSystem() -<<<<<<< HEAD -======= Xwt.Application.Initialize (Xwt.ToolkitType.Gtk3) ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 Runtime.Initialize (true) do! IdeApp.Initialize ((new ConsoleProgressMonitor())) do! Runtime.GetService () From a0c8729614e6d71dee5c61c687ff464da78a329f Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:12:44 +0100 Subject: [PATCH 068/382] Update DebugValueWindow.cs --- .../MonoDevelop.Debugger/DebugValueWindow.cs | 527 +++++++++--------- 1 file changed, 260 insertions(+), 267 deletions(-) diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugValueWindow.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugValueWindow.cs index 638b18ae254..38d5a11aeb9 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugValueWindow.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugValueWindow.cs @@ -1,270 +1,263 @@ -// DebugValueWindow.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (c) 2008 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -// - -// Note: This is only used by the old (Gtk) TextEditor. - -using System; - -using Gdk; -using Gtk; - -using Mono.Debugging.Client; - -using MonoDevelop.Ide; -using MonoDevelop.Core; -using MonoDevelop.Components; - -namespace MonoDevelop.Debugger -{ - [Obsolete ("This API is only used by the old Gtk TextEditor")] - class DebugValueWindow : PopoverWindow - { - readonly bool useNewTreeView = PropertyService.Get ("MonoDevelop.Debugger.UseNewTreeView", true); - readonly ObjectValueTreeViewController controller; - readonly ObjectValueTreeView objValueTreeView; - readonly TreeView treeView; - readonly ScrolledWindow sw; - - static readonly string innerTreeName = "MonoDevelop.SourceEditor.DebugValueWindow.ObjectValueTreeView"; - static string currentBgColor; - - static DebugValueWindow () - { - UpdateTreeStyle (Ide.Gui.Styles.PopoverWindow.DefaultBackgroundColor.ToCairoColor ()); - Ide.Gui.Styles.Changed += (sender, e) => UpdateTreeStyle (Ide.Gui.Styles.PopoverWindow.DefaultBackgroundColor.ToCairoColor ()); - } - - static void UpdateTreeStyle (Cairo.Color newBgColor) - { - string oddRowColor, bgColor; - - bgColor = CairoExtensions.ColorGetHex (newBgColor); - if (bgColor == currentBgColor) - return; - - if (IdeApp.Preferences.UserInterfaceTheme == Ide.Theme.Light) - oddRowColor = CairoExtensions.ColorGetHex (newBgColor.AddLight (-0.02)); - else - oddRowColor = CairoExtensions.ColorGetHex (newBgColor.AddLight (-0.02)); - - string rc = "style \"" + innerTreeName + "\" = \"treeview\" {\n"; - rc += string.Format ("GtkTreeView::odd-row-color = \"{0}\"\n", oddRowColor); - rc += string.Format ("base[NORMAL] = \"{0}\"\n", bgColor); - rc += "\n}\n"; - rc += string.Format ("widget \"*.{0}\" style \"{0}\" ", innerTreeName); - - Rc.ParseString (rc); - currentBgColor = bgColor; - } - - public DebugValueWindow (Gtk.Window transientFor, PinnedWatchLocation location, StackFrame frame, ObjectValue value, PinnedWatch watch) : base (Gtk.WindowType.Toplevel) - { -<<<<<<< HEAD:main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugValueWindow.cs - TypeHint = WindowTypeHint.PopupMenu; - AllowShrink = false; - AllowGrow = false; - Decorated = false; -======= - this.TypeHint = WindowTypeHint.PopupMenu; - this.Resizable = false; - this.Decorated = false; ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69:main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs - - TransientFor = transientFor; - // Avoid getting the focus when the window is shown. We'll get it when the mouse enters the window - AcceptFocus = false; - - sw = new ScrolledWindow { - HscrollbarPolicy = PolicyType.Never, - VscrollbarPolicy = PolicyType.Never - }; - - UpdateTreeStyle (Theme.BackgroundColor); - - if (useNewTreeView) { - controller = new ObjectValueTreeViewController (); - controller.SetStackFrame (frame); - controller.AllowEditing = true; - controller.PinnedWatch = watch; - controller.PinnedWatchLocation = location; - - treeView = controller.GetGtkControl (ObjectValueTreeViewFlags.TooltipFlags); - - if (treeView is IObjectValueTreeView ovtv) { - ovtv.StartEditing += OnStartEditing; - ovtv.EndEditing += OnEndEditing; - ovtv.NodePinned += OnPinStatusChanged; - } - - controller.AddValue (value); - } else { - objValueTreeView = new ObjectValueTreeView (); - objValueTreeView.RootPinAlwaysVisible = true; - objValueTreeView.HeadersVisible = false; - objValueTreeView.AllowEditing = true; - objValueTreeView.AllowPinning = true; - objValueTreeView.CompactView = true; - objValueTreeView.PinnedWatch = watch; - objValueTreeView.PinnedWatchLocation = location; - objValueTreeView.Frame = frame; - - objValueTreeView.AddValue (value); - - objValueTreeView.PinStatusChanged += OnPinStatusChanged; - objValueTreeView.StartEditing += OnStartEditing; - objValueTreeView.EndEditing += OnEndEditing; - - treeView = objValueTreeView; - } - - treeView.Name = innerTreeName; - treeView.Selection.UnselectAll (); - treeView.SizeAllocated += OnTreeSizeChanged; - - sw.Add (treeView); - ContentBox.Add (sw); - sw.ShowAll (); - - ShowArrow = true; - Theme.CornerRadius = 3; - PreviewWindowManager.WindowClosed += PreviewWindowManager_WindowClosed; - } - - public DebuggerSession GetDebuggerSession () - { - if (useNewTreeView) - return controller.GetStackFrame ()?.DebuggerSession; - - return objValueTreeView.Frame?.DebuggerSession; - } - - void OnStartEditing (object sender, EventArgs args) - { - Modal = true; - } - - void OnEndEditing (object sender, EventArgs args) - { - Modal = false; - } - - void OnPinStatusChanged (object sender, EventArgs args) - { - Destroy (); - } - +// DebugValueWindow.cs +// +// Author: +// Lluis Sanchez Gual +// +// Copyright (c) 2008 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +// Note: This is only used by the old (Gtk) TextEditor. + +using System; + +using Gdk; +using Gtk; + +using Mono.Debugging.Client; + +using MonoDevelop.Ide; +using MonoDevelop.Core; +using MonoDevelop.Components; + +namespace MonoDevelop.Debugger +{ + [Obsolete ("This API is only used by the old Gtk TextEditor")] + class DebugValueWindow : PopoverWindow + { + readonly bool useNewTreeView = PropertyService.Get ("MonoDevelop.Debugger.UseNewTreeView", true); + readonly ObjectValueTreeViewController controller; + readonly ObjectValueTreeView objValueTreeView; + readonly TreeView treeView; + readonly ScrolledWindow sw; + + static readonly string innerTreeName = "MonoDevelop.SourceEditor.DebugValueWindow.ObjectValueTreeView"; + static string currentBgColor; + + static DebugValueWindow () + { + UpdateTreeStyle (Ide.Gui.Styles.PopoverWindow.DefaultBackgroundColor.ToCairoColor ()); + Ide.Gui.Styles.Changed += (sender, e) => UpdateTreeStyle (Ide.Gui.Styles.PopoverWindow.DefaultBackgroundColor.ToCairoColor ()); + } + + static void UpdateTreeStyle (Cairo.Color newBgColor) + { + string oddRowColor, bgColor; + + bgColor = CairoExtensions.ColorGetHex (newBgColor); + if (bgColor == currentBgColor) + return; + + if (IdeApp.Preferences.UserInterfaceTheme == Ide.Theme.Light) + oddRowColor = CairoExtensions.ColorGetHex (newBgColor.AddLight (-0.02)); + else + oddRowColor = CairoExtensions.ColorGetHex (newBgColor.AddLight (-0.02)); + + string rc = "style \"" + innerTreeName + "\" = \"treeview\" {\n"; + rc += string.Format ("GtkTreeView::odd-row-color = \"{0}\"\n", oddRowColor); + rc += string.Format ("base[NORMAL] = \"{0}\"\n", bgColor); + rc += "\n}\n"; + rc += string.Format ("widget \"*.{0}\" style \"{0}\" ", innerTreeName); + + Rc.ParseString (rc); + currentBgColor = bgColor; + } + + public DebugValueWindow (Gtk.Window transientFor, PinnedWatchLocation location, StackFrame frame, ObjectValue value, PinnedWatch watch) : base (Gtk.WindowType.Toplevel) + { + this.TypeHint = WindowTypeHint.PopupMenu; + this.Resizable = false; + this.Decorated = false; + + TransientFor = transientFor; + // Avoid getting the focus when the window is shown. We'll get it when the mouse enters the window + AcceptFocus = false; + + sw = new ScrolledWindow { + HscrollbarPolicy = PolicyType.Never, + VscrollbarPolicy = PolicyType.Never + }; + + UpdateTreeStyle (Theme.BackgroundColor); + + if (useNewTreeView) { + controller = new ObjectValueTreeViewController (); + controller.SetStackFrame (frame); + controller.AllowEditing = true; + controller.PinnedWatch = watch; + controller.PinnedWatchLocation = location; + + treeView = controller.GetGtkControl (ObjectValueTreeViewFlags.TooltipFlags); + + if (treeView is IObjectValueTreeView ovtv) { + ovtv.StartEditing += OnStartEditing; + ovtv.EndEditing += OnEndEditing; + ovtv.NodePinned += OnPinStatusChanged; + } + + controller.AddValue (value); + } else { + objValueTreeView = new ObjectValueTreeView (); + objValueTreeView.RootPinAlwaysVisible = true; + objValueTreeView.HeadersVisible = false; + objValueTreeView.AllowEditing = true; + objValueTreeView.AllowPinning = true; + objValueTreeView.CompactView = true; + objValueTreeView.PinnedWatch = watch; + objValueTreeView.PinnedWatchLocation = location; + objValueTreeView.Frame = frame; + + objValueTreeView.AddValue (value); + + objValueTreeView.PinStatusChanged += OnPinStatusChanged; + objValueTreeView.StartEditing += OnStartEditing; + objValueTreeView.EndEditing += OnEndEditing; + + treeView = objValueTreeView; + } + + treeView.Name = innerTreeName; + treeView.Selection.UnselectAll (); + treeView.SizeAllocated += OnTreeSizeChanged; + + sw.Add (treeView); + ContentBox.Add (sw); + sw.ShowAll (); + + ShowArrow = true; + Theme.CornerRadius = 3; + PreviewWindowManager.WindowClosed += PreviewWindowManager_WindowClosed; + } + + public DebuggerSession GetDebuggerSession () + { + if (useNewTreeView) + return controller.GetStackFrame ()?.DebuggerSession; + + return objValueTreeView.Frame?.DebuggerSession; + } + + void OnStartEditing (object sender, EventArgs args) + { + Modal = true; + } + + void OnEndEditing (object sender, EventArgs args) + { + Modal = false; + } + + void OnPinStatusChanged (object sender, EventArgs args) + { + Destroy (); + } + protected override void OnDestroyed () - { - if (useNewTreeView) { - if (treeView is IObjectValueTreeView ovtv) { - ovtv.StartEditing -= OnStartEditing; - ovtv.EndEditing -= OnEndEditing; - ovtv.NodePinned -= OnPinStatusChanged; - } - } else { - objValueTreeView.PinStatusChanged -= OnPinStatusChanged; - objValueTreeView.StartEditing -= OnStartEditing; - objValueTreeView.EndEditing -= OnEndEditing; - } - - treeView.SizeAllocated -= OnTreeSizeChanged; - - PreviewWindowManager.WindowClosed -= PreviewWindowManager_WindowClosed; + { + if (useNewTreeView) { + if (treeView is IObjectValueTreeView ovtv) { + ovtv.StartEditing -= OnStartEditing; + ovtv.EndEditing -= OnEndEditing; + ovtv.NodePinned -= OnPinStatusChanged; + } + } else { + objValueTreeView.PinStatusChanged -= OnPinStatusChanged; + objValueTreeView.StartEditing -= OnStartEditing; + objValueTreeView.EndEditing -= OnEndEditing; + } + + treeView.SizeAllocated -= OnTreeSizeChanged; + + PreviewWindowManager.WindowClosed -= PreviewWindowManager_WindowClosed; base.OnDestroyed (); - } - - protected override bool OnEnterNotifyEvent (EventCrossing evnt) - { - if (!AcceptFocus) - AcceptFocus = true; - return base.OnEnterNotifyEvent (evnt); - } - - void OnTreeSizeChanged (object s, SizeAllocatedArgs a) - { - int x, y, w, h; - GetPosition (out x, out y); - h = (int)sw.Vadjustment.Upper; - w = (int)sw.Hadjustment.Upper; - int dy = y + h - Screen.Height; - int dx = x + w - Screen.Width; - - if (dy > 0 && sw.VscrollbarPolicy == PolicyType.Never) { - sw.VscrollbarPolicy = PolicyType.Always; - sw.HeightRequest = h - dy - 20; - } else if (sw.VscrollbarPolicy == PolicyType.Always && sw.Vadjustment.Upper == sw.Vadjustment.PageSize) { - sw.VscrollbarPolicy = PolicyType.Never; - sw.HeightRequest = -1; - } - - if (dx > 0 && sw.HscrollbarPolicy == PolicyType.Never) { - sw.HscrollbarPolicy = PolicyType.Always; - sw.WidthRequest = w - dx - 20; - } else if (sw.HscrollbarPolicy == PolicyType.Always && sw.Hadjustment.Upper == sw.Hadjustment.PageSize) { - sw.HscrollbarPolicy = PolicyType.Never; - sw.WidthRequest = -1; - } - // Force a redraw of the whole window. This is a workaround for bug 7538 - QueueDraw (); - } - - protected override void OnSizeAllocated (Rectangle allocation) - { - if (Platform.IsMac || Platform.IsWindows) { - // fails on linux see: Bug 8481 - Debug value tooltips very often appear at the top-left corner of the screen instead of near the element to inspect - const int edgeGap = 2; - int oldY, x, y; - - GetPosition (out x, out y); - oldY = y; - - var geometry = IdeServices.DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (x, y)); - int top = (int)geometry.Top; - if (allocation.Height <= geometry.Height && y + allocation.Height >= geometry.Y + geometry.Height - edgeGap) - y = top + ((int)geometry.Height - allocation.Height - edgeGap); - if (y < top + edgeGap) - y = top + edgeGap; - - if (y != oldY) { - Move (x, y); - // If the window is moved, hide the arrow since it will be pointing to the wrong place - ShowArrow = false; - } - } - base.OnSizeAllocated (allocation); - } - - void PreviewWindowManager_WindowClosed (object sender, EventArgs e) - { - // When Preview window is closed we want to put focus(IsActive=true) back on DebugValueWindow - // otherwise CommandManager will think IDE doesn't have any window Active/Focused and think - // user switched to another app and DebugValueWindow will closed itself on "FocusOut" event - Present (); - } - } -} + } + + protected override bool OnEnterNotifyEvent (EventCrossing evnt) + { + if (!AcceptFocus) + AcceptFocus = true; + return base.OnEnterNotifyEvent (evnt); + } + + void OnTreeSizeChanged (object s, SizeAllocatedArgs a) + { + int x, y, w, h; + GetPosition (out x, out y); + h = (int)sw.Vadjustment.Upper; + w = (int)sw.Hadjustment.Upper; + int dy = y + h - Screen.Height; + int dx = x + w - Screen.Width; + + if (dy > 0 && sw.VscrollbarPolicy == PolicyType.Never) { + sw.VscrollbarPolicy = PolicyType.Always; + sw.HeightRequest = h - dy - 20; + } else if (sw.VscrollbarPolicy == PolicyType.Always && sw.Vadjustment.Upper == sw.Vadjustment.PageSize) { + sw.VscrollbarPolicy = PolicyType.Never; + sw.HeightRequest = -1; + } + + if (dx > 0 && sw.HscrollbarPolicy == PolicyType.Never) { + sw.HscrollbarPolicy = PolicyType.Always; + sw.WidthRequest = w - dx - 20; + } else if (sw.HscrollbarPolicy == PolicyType.Always && sw.Hadjustment.Upper == sw.Hadjustment.PageSize) { + sw.HscrollbarPolicy = PolicyType.Never; + sw.WidthRequest = -1; + } + // Force a redraw of the whole window. This is a workaround for bug 7538 + QueueDraw (); + } + + protected override void OnSizeAllocated (Rectangle allocation) + { + if (Platform.IsMac || Platform.IsWindows) { + // fails on linux see: Bug 8481 - Debug value tooltips very often appear at the top-left corner of the screen instead of near the element to inspect + const int edgeGap = 2; + int oldY, x, y; + + GetPosition (out x, out y); + oldY = y; + + var geometry = IdeServices.DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (x, y)); + int top = (int)geometry.Top; + if (allocation.Height <= geometry.Height && y + allocation.Height >= geometry.Y + geometry.Height - edgeGap) + y = top + ((int)geometry.Height - allocation.Height - edgeGap); + if (y < top + edgeGap) + y = top + edgeGap; + + if (y != oldY) { + Move (x, y); + // If the window is moved, hide the arrow since it will be pointing to the wrong place + ShowArrow = false; + } + } + base.OnSizeAllocated (allocation); + } + + void PreviewWindowManager_WindowClosed (object sender, EventArgs e) + { + // When Preview window is closed we want to put focus(IsActive=true) back on DebugValueWindow + // otherwise CommandManager will think IDE doesn't have any window Active/Focused and think + // user switched to another app and DebugValueWindow will closed itself on "FocusOut" event + Present (); + } + } +} From 8795ab6bbc22ff1ca9f06495eeaa806f5764851c Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:15:27 +0100 Subject: [PATCH 069/382] Update MonoDevelop.UserInterfaceTesting.csproj --- .../MonoDevelop.UserInterfaceTesting.csproj | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/main/tests/ui/MonoDevelop.UserInterfaceTesting/MonoDevelop.UserInterfaceTesting.csproj b/main/tests/ui/MonoDevelop.UserInterfaceTesting/MonoDevelop.UserInterfaceTesting.csproj index b073f0481fc..ffbbd936e5f 100644 --- a/main/tests/ui/MonoDevelop.UserInterfaceTesting/MonoDevelop.UserInterfaceTesting.csproj +++ b/main/tests/ui/MonoDevelop.UserInterfaceTesting/MonoDevelop.UserInterfaceTesting.csproj @@ -13,17 +13,7 @@ -<<<<<<< HEAD -======= - - ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - - - ..\..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 68b8dfcc0dd3af40ba9afe0a63040a79c2790a36 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:17:12 +0100 Subject: [PATCH 070/382] Update UserInterfaceTests.csproj --- .../UserInterfaceTests.csproj | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/main/tests/UserInterfaceTests/UserInterfaceTests.csproj b/main/tests/UserInterfaceTests/UserInterfaceTests.csproj index 14c4cfa2924..af73eff3a78 100644 --- a/main/tests/UserInterfaceTests/UserInterfaceTests.csproj +++ b/main/tests/UserInterfaceTests/UserInterfaceTests.csproj @@ -19,25 +19,6 @@ -<<<<<<< HEAD -======= - - - ..\..\packages\NUnit.Runners.2.6.4\tools\lib\nunit.core.dll - False - - - ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - False - - - ..\..\packages\NUnit.Runners.2.6.4\tools\lib\nunit.core.interfaces.dll - False - - - - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 14c77e71c593b754d90f18d87379381b854b5fcf Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:18:01 +0100 Subject: [PATCH 071/382] Update TestRunner.csproj --- main/tests/TestRunner/TestRunner.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/main/tests/TestRunner/TestRunner.csproj b/main/tests/TestRunner/TestRunner.csproj index f86d1e48d5d..24a1305cf51 100644 --- a/main/tests/TestRunner/TestRunner.csproj +++ b/main/tests/TestRunner/TestRunner.csproj @@ -12,10 +12,6 @@ -<<<<<<< HEAD -======= - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 5e7317ade470991644ce815252a815827bb51181 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:19:17 +0100 Subject: [PATCH 072/382] Update IdeUnitTests.csproj --- main/tests/IdeUnitTests/IdeUnitTests.csproj | 9 --------- 1 file changed, 9 deletions(-) diff --git a/main/tests/IdeUnitTests/IdeUnitTests.csproj b/main/tests/IdeUnitTests/IdeUnitTests.csproj index 8195e58091b..a4cb2c8c118 100644 --- a/main/tests/IdeUnitTests/IdeUnitTests.csproj +++ b/main/tests/IdeUnitTests/IdeUnitTests.csproj @@ -17,16 +17,7 @@ -<<<<<<< HEAD -======= - - - - - ..\..\packages\Microsoft.VisualStudio.Composition.15.6.36\lib\net45\Microsoft.VisualStudio.Composition.dll - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 3a20fe8a3b020c9f3ee5964984bcbebeec6e1cb1 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:21:12 +0100 Subject: [PATCH 073/382] Update IdeUnitTests.csproj --- main/tests/IdeUnitTests/IdeUnitTests.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/main/tests/IdeUnitTests/IdeUnitTests.csproj b/main/tests/IdeUnitTests/IdeUnitTests.csproj index a4cb2c8c118..e432d2a2b44 100644 --- a/main/tests/IdeUnitTests/IdeUnitTests.csproj +++ b/main/tests/IdeUnitTests/IdeUnitTests.csproj @@ -74,12 +74,8 @@ -<<<<<<< HEAD -======= - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 From 44d74ffaa08dfd9e9794e45ea5293016191f7bfb Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:23:29 +0100 Subject: [PATCH 074/382] Update IdeStartup.cs --- .../core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs index ef124bbc13f..fd10852716a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs @@ -158,19 +158,11 @@ int Run (MonoDevelopOptions options) LoggingService.LogInfo ("Using GTK+ {0}", IdeVersionInfo.GetGtkVersion ()); // XWT initialization -<<<<<<< HEAD - FilePath p = typeof (IdeStartup).Assembly.Location; - Runtime.LoadAssemblyFrom (p.ParentDirectory.Combine ("Xwt.Gtk.dll")); - Xwt.Application.InitializeAsGuest (Xwt.ToolkitType.Gtk); - Xwt.Toolkit.CurrentEngine.RegisterBackend (); - Xwt.Toolkit.CurrentEngine.RegisterBackend (); -======= FilePath p = typeof(IdeStartup).Assembly.Location; Runtime.LoadAssemblyFrom (p.ParentDirectory.Combine("Xwt.Gtk3.dll")); Xwt.Application.InitializeAsGuest (Xwt.ToolkitType.Gtk3); Xwt.Toolkit.CurrentEngine.RegisterBackend (); Xwt.Toolkit.CurrentEngine.RegisterBackend (); ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 IdeTheme.SetupXwtTheme (); IdeStartupTracker.StartupTracker.MarkSection ("XwtInitialization"); From 340503e4ccaff45bd91850d0f2d4a6f103ff094c Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:24:41 +0100 Subject: [PATCH 075/382] Update Ide.cs --- main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs index 51fcd8a4451..36fcb867485 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs @@ -33,15 +33,7 @@ using MonoDevelop.Core; using MonoDevelop.Core.Instrumentation; using Mono.Addins; -<<<<<<< HEAD -#if GTK3 using Mono.Addins.GuiGtk3; -#else -using Mono.Addins.Gui; -#endif -======= -using Mono.Addins.GuiGtk3; ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 using Mono.Addins.Setup; using MonoDevelop.Components.Commands; From 5c156f3cf81911b6277d7d73ec9247676bc5fd16 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:26:26 +0100 Subject: [PATCH 076/382] Update Ide.cs --- .../core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs index 36fcb867485..7eb9f7fa0e4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs @@ -288,19 +288,15 @@ public static async Task Initialize (ProgressMonitor monitor, bool hideWelcomePa }; AutoTestService.Start (commandService, Preferences.EnableAutomatedTesting); AutoTestService.NotifyEvent ("MonoDevelop.Ide.IdeStart"); -<<<<<<< HEAD - Gtk.LinkButton.SetUriHook ((button, uri) => Xwt.Desktop.OpenUrl (uri)); + + //Gtk.LinkButton.SetUriHook ((button, uri) => Xwt.Desktop.OpenUrl (uri)); // Start initializing the type system service in the background Runtime.GetService ().Ignore (); // The ide is now initialized OnInitialized (); -======= - -// Gtk.LinkButton.SetUriHook ((button, uri) => Xwt.Desktop.OpenUrl (uri)); ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 } static void OnInitialized () @@ -381,15 +377,9 @@ internal static async Task OpenFilesAsync (IEnumerable>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 } else { filteredFiles.Add (file); } From 612df2eda0ae40bbbb9ba0897655d9679c846e02 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:28:43 +0100 Subject: [PATCH 077/382] Update DesktopService.cs --- .../MonoDevelop.Ide/DesktopService.cs | 976 +++++++++--------- 1 file changed, 486 insertions(+), 490 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs index de50c512b1f..1fa14012897 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs @@ -1,491 +1,487 @@ -// -// IdeApp.DesktopService.cs -// -// Author: -// Lluis Sanchez Gual -// -// Copyright (c) 2009 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; +// +// IdeApp.DesktopService.cs +// +// Author: +// Lluis Sanchez Gual +// +// Copyright (c) 2009 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; using Microsoft.VisualStudio.Utilities; -using Mono.Addins; -using MonoDevelop.Components; -using MonoDevelop.Components.MainToolbar; -using System.Threading.Tasks; -using MonoDevelop.Core; -using MonoDevelop.Ide.Desktop; -using MonoDevelop.Ide.Fonts; - -namespace MonoDevelop.Ide -{ - [DefaultServiceImplementation] - public class DesktopService : Service - { - PlatformService platformService; - Xwt.Toolkit nativeToolkit; - - PlatformService PlatformService { - get { - if (platformService == null) - throw new InvalidOperationException ("Not initialized"); - return platformService; - } - } - - protected override Task OnInitialize (ServiceProvider serviceProvider) - { - object [] platforms = AddinManager.GetExtensionObjects ("/MonoDevelop/Core/PlatformService"); - if (platforms.Length > 0) - platformService = (PlatformService)platforms [0]; - else { - platformService = new DefaultPlatformService (); - LoggingService.LogFatalError ("A platform service implementation has not been found."); - } - PlatformService.Initialize (); - - if (PlatformService.CanOpenTerminal) - Runtime.ProcessService.SetExternalConsoleHandler (PlatformService.StartConsoleProcess); - - FileService.FileRemoved += NotifyFileRemoved; - FileService.FileRenamed += NotifyFileRenamed; - - // Ensure we initialize the native toolkit on the UI thread immediately - // so that we can safely access this property later in other threads - GC.KeepAlive (NativeToolkit); - - MemoryMonitor = platformService.CreateMemoryMonitor (); - MemoryMonitor.StatusChanged += OnMemoryStatusChanged; - - ThermalMonitor = platformService.CreateThermalMonitor (); - ThermalMonitor.StatusChanged += OnThermalStatusChanged; - - return Task.CompletedTask; - } - - protected override Task OnDispose () - { - if (PlatformService.CanOpenTerminal) - Runtime.ProcessService.SetExternalConsoleHandler (null); - - FileService.FileRemoved -= NotifyFileRemoved; - FileService.FileRenamed -= NotifyFileRenamed; - - MemoryMonitor.StatusChanged -= OnMemoryStatusChanged; - ThermalMonitor.StatusChanged -= OnThermalStatusChanged; - - return Task.CompletedTask; - } - - static void OnMemoryStatusChanged (object sender, PlatformMemoryStatusEventArgs args) - { - Counters.MemoryPressure.Inc (args.CounterMetadata); - } - - static void OnThermalStatusChanged (object sender, PlatformThermalStatusEventArgs args) - { - Counters.ThermalNotification.Inc (args.CounterMetadata); - } - - /// - /// Returns the XWT toolkit for the native toolkit (Cocoa on Mac, WPF on Windows) - /// - /// The native toolkit. - public Xwt.Toolkit NativeToolkit { - get { - if (nativeToolkit == null) - nativeToolkit = platformService.LoadNativeToolkit (); - return nativeToolkit; - } - } - - public void SetGlobalProgress (double progress) - { - platformService.SetGlobalProgressBar (progress); - } - - public void ShowGlobalProgressIndeterminate () - { - platformService.ShowGlobalProgressBarIndeterminate (); - } - - public void ShowGlobalProgressError () - { - platformService.ShowGlobalProgressBarError (); - } - - public IEnumerable GetApplications (string filename) - { - return PlatformService.GetApplications (filename); - } - - public IEnumerable GetApplications (string filename, DesktopApplicationRole role) - { - return PlatformService.GetApplications (filename, role); - } - - internal string DefaultMonospaceFont { - get { return PlatformService.DefaultMonospaceFont; } - } - -<<<<<<< HEAD - public string PlatformName { -======= - [Obsolete ("Use FontService")] - public static string DefaultSansFont { - get { return PlatformService.DefaultSansFont; } - } - - public static string PlatformName { ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 - get { return PlatformService.Name; } - } - - public void ShowUrl (string url) - { - PlatformService.ShowUrl (url); - } - - public void OpenFile (string filename) - { - PlatformService.OpenFile (filename); - } - - public void OpenFolder (FilePath folderPath, params FilePath [] selectFiles) - { - PlatformService.OpenFolder (folderPath, selectFiles); - } - - public string GetMimeTypeForRoslynLanguage (string roslynLanguage) - => MimeTypeCatalog.Instance.GetMimeTypeForRoslynLanguage (roslynLanguage); - - public IEnumerable GetMimeTypeInheritanceChainForRoslynLanguage (string roslynLanguage) - => MimeTypeCatalog.Instance.GetMimeTypeInheritanceChainForRoslynLanguage (roslynLanguage); - - public string GetRoslynLanguageForMimeType (string mimeType) - => MimeTypeCatalog.Instance.GetRoslynLanguageForMimeType (mimeType); - - public string GetMimeTypeForContentType (IContentType contentType) - => MimeTypeCatalog.Instance.GetMimeTypeForContentType (contentType); - - public IEnumerable GetMimeTypeInheritanceChainForContentType (IContentType contentType) - => MimeTypeCatalog.Instance.GetMimeTypeInheritanceChainForContentType (contentType); - - public IContentType GetContentTypeForMimeType (string mimeType) - => MimeTypeCatalog.Instance.GetContentTypeForMimeType (mimeType); - - public string GetMimeTypeForUri (string uri) - { - return PlatformService.GetMimeTypeForUri (uri); - } - - public string GetMimeTypeDescription (string mimeType) - { - return PlatformService.GetMimeTypeDescription (mimeType); - } - - public bool GetMimeTypeIsText (string mimeType) - { - return MimeTypeCatalog.Instance.GetMimeTypeIsText (mimeType); - } - - public bool GetFileIsText (string file, string mimeType = null) - { - if (mimeType == null) { - mimeType = GetMimeTypeForUri (file); - } - if (mimeType != "application/octet-stream" && mimeType != "application/x-msdownload") { - return GetMimeTypeIsText (mimeType); - } - - if (!File.Exists (file)) - return false; - - return !MonoDevelop.Core.Text.TextFileUtility.IsBinary (file); - } - - public async Task GetFileIsTextAsync (string file, string mimeType = null) - { - if (mimeType == null) { - mimeType = GetMimeTypeForUri (file); - } - - if (mimeType != "application/octet-stream") { - return GetMimeTypeIsText (mimeType); - } - - return await Task.Factory.StartNew (delegate { - if (!File.Exists (file)) - return false; - - using (var f = File.OpenRead (file)) { - var buf = new byte [8192]; - var read = f.Read (buf, 0, buf.Length); - for (int i = 0; i < read; i++) - if (buf [i] == 0) - return false; - } - return true; - }); - } - - public bool GetMimeTypeIsSubtype (string subMimeType, string baseMimeType) - { - return MimeTypeCatalog.Instance.GetMimeTypeIsSubtype (subMimeType, baseMimeType); - } - - public IEnumerable GetMimeTypeInheritanceChain (string mimeType) - { - return MimeTypeCatalog.Instance.GetMimeTypeInheritanceChain (mimeType); - } - - public IEnumerable GetMimeTypeInheritanceChainForFile (string filename) - { - return GetMimeTypeInheritanceChain (GetMimeTypeForUri (filename)); - } - - public Xwt.Drawing.Image GetIconForFile (string filename) - { - return PlatformService.GetIconForFile (filename); - } - - public Xwt.Drawing.Image GetIconForFile (string filename, Gtk.IconSize size) - { - return PlatformService.GetIconForFile (filename).WithSize (size); - } - - public Xwt.Drawing.Image GetIconForType (string mimeType) - { - return PlatformService.GetIconForType (mimeType); - } - - public Xwt.Drawing.Image GetIconForType (string mimeType, Gtk.IconSize size) - { - return PlatformService.GetIconForType (mimeType).WithSize (size); - } - - internal bool SetGlobalMenu (MonoDevelop.Components.Commands.CommandManager commandManager, - string commandMenuAddinPath, string appMenuAddinPath) - { - return PlatformService.SetGlobalMenu (commandManager, commandMenuAddinPath, appMenuAddinPath); - } - - // Used for preserve the file attributes when monodevelop opens & writes a file. - // This should work on unix & mac platform. - public object GetFileAttributes (string fileName) - { - return PlatformService.GetFileAttributes (fileName); - } - - public void SetFileAttributes (string fileName, object attributes) - { - PlatformService.SetFileAttributes (fileName, attributes); - } - - public Xwt.Rectangle GetUsableMonitorGeometry (int screenNumber, int monitorNumber) - { - return PlatformService.GetUsableMonitorGeometry (screenNumber, monitorNumber); - } - - public bool CanOpenTerminal { - get { - return PlatformService.CanOpenTerminal; - } - } - - /// - /// Opens an external terminal window. - /// - /// Working directory. - /// Environment variables. - /// Window title. - public void OpenTerminal ( - FilePath workingDirectory, - IDictionary environmentVariables = null, - string windowTitle = null) - { - PlatformService.OpenTerminal (workingDirectory, environmentVariables, windowTitle); - } - - public RecentFiles RecentFiles { - get { - PlatformService.RecentFiles.DesktopService = this; - return PlatformService.RecentFiles; - } - } - - void NotifyFileRemoved (object sender, FileEventArgs args) - { - foreach (FileEventInfo e in args) { - if (!e.IsDirectory) { - PlatformService.RecentFiles.NotifyFileRemoved (e.FileName); - } - } - } - - void NotifyFileRenamed (object sender, FileCopyEventArgs args) - { - if (args.IsExternal) - return; - - foreach (FileEventInfo e in args) { - if (!e.IsDirectory) { - PlatformService.RecentFiles.NotifyFileRenamed (e.SourceFile, e.TargetFile); - } - } - } - - internal string GetUpdaterUrl () - { - return PlatformService.GetUpdaterUrl (); - } - - internal IEnumerable GetUpdaterEnvironmentFlags () - { - return PlatformService.GetUpdaterEnviromentFlags (); - } - - internal void StartUpdatesInstaller (FilePath installerDataFile, FilePath updatedInstallerPath) - { - PlatformService.StartUpdatesInstaller (installerDataFile, updatedInstallerPath); - } - - /// - /// Grab the desktop focus for the window. - /// - internal void GrabDesktopFocus (Gtk.Window window) - { - PlatformService.GrabDesktopFocus (window); - } - - public Window GetParentForModalWindow () - { - return PlatformService.GetParentForModalWindow (); - } - - public Window GetFocusedTopLevelWindow () - { - return PlatformService.GetFocusedTopLevelWindow (); - } - - public void FocusWindow (Window window) - { - if (window != null) - PlatformService.FocusWindow (window); - } - - public void RemoveWindowShadow (Window window) - { - PlatformService.RemoveWindowShadow (window); - } - - - public void SetMainWindowDecorations (Window window) - { - PlatformService.SetMainWindowDecorations (window); - } - - internal MainToolbarController CreateMainToolbar (Gtk.Window window) - { - return new MainToolbarController (PlatformService.CreateMainToolbar (window)); - } - - internal void AttachMainToolbar (Gtk.VBox parent, MainToolbarController toolbar) - { - PlatformService.AttachMainToolbar (parent, toolbar.ToolbarView); - toolbar.Initialize (); - } - - public bool GetIsFullscreen (Window window) - { - return PlatformService.GetIsFullscreen (window); - } - - public void SetIsFullscreen (Window window, bool isFullscreen) - { - PlatformService.SetIsFullscreen (window, isFullscreen); - } - - public bool IsModalDialogRunning () - { - return PlatformService.IsModalDialogRunning (); - } - - internal void AddChildWindow (Gtk.Window parent, Gtk.Window child) - { - PlatformService.AddChildWindow (parent, child); - } - - internal void RemoveChildWindow (Gtk.Window parent, Gtk.Window child) - { - PlatformService.RemoveChildWindow (parent, child); - } - - internal void PlaceWindow (Gtk.Window window, int x, int y, int width, int height) - { - PlatformService.PlaceWindow (window, x, y, width, height); - } - - /// - /// Restarts MonoDevelop - /// - /// false if the user cancels exiting. - /// true to reopen current workspace. - internal void RestartIde (bool reopenWorkspace) - { - PlatformService.RestartIde (reopenWorkspace); - } - - public void MakeAccessibilityAnnouncement(string text) - { - PlatformService.MakeAccessibilityAnnouncement (text); - } - - public bool AccessibilityInUse { - get { - return PlatformService.AccessibilityInUse; - } - } - - public bool AccessibilityKeyboardFocusInUse { - get { - return PlatformService.AccessibilityKeyboardFocusInUse; - } - } - - internal string GetNativeRuntimeDescription () => PlatformService.GetNativeRuntimeDescription (); - - public ThermalMonitor ThermalMonitor { get; private set; } - public MemoryMonitor MemoryMonitor { get; private set; } - - IPlatformTelemetryDetails platformTelemetryDetails; - - public IPlatformTelemetryDetails PlatformTelemetry { - get { - if (platformTelemetryDetails == null) - platformTelemetryDetails = PlatformService.CreatePlatformTelemetryDetails (); - return platformTelemetryDetails; - } - } - } -} +using Mono.Addins; +using MonoDevelop.Components; +using MonoDevelop.Components.MainToolbar; +using System.Threading.Tasks; +using MonoDevelop.Core; +using MonoDevelop.Ide.Desktop; +using MonoDevelop.Ide.Fonts; + +namespace MonoDevelop.Ide +{ + [DefaultServiceImplementation] + public class DesktopService : Service + { + PlatformService platformService; + Xwt.Toolkit nativeToolkit; + + PlatformService PlatformService { + get { + if (platformService == null) + throw new InvalidOperationException ("Not initialized"); + return platformService; + } + } + + protected override Task OnInitialize (ServiceProvider serviceProvider) + { + object [] platforms = AddinManager.GetExtensionObjects ("/MonoDevelop/Core/PlatformService"); + if (platforms.Length > 0) + platformService = (PlatformService)platforms [0]; + else { + platformService = new DefaultPlatformService (); + LoggingService.LogFatalError ("A platform service implementation has not been found."); + } + PlatformService.Initialize (); + + if (PlatformService.CanOpenTerminal) + Runtime.ProcessService.SetExternalConsoleHandler (PlatformService.StartConsoleProcess); + + FileService.FileRemoved += NotifyFileRemoved; + FileService.FileRenamed += NotifyFileRenamed; + + // Ensure we initialize the native toolkit on the UI thread immediately + // so that we can safely access this property later in other threads + GC.KeepAlive (NativeToolkit); + + MemoryMonitor = platformService.CreateMemoryMonitor (); + MemoryMonitor.StatusChanged += OnMemoryStatusChanged; + + ThermalMonitor = platformService.CreateThermalMonitor (); + ThermalMonitor.StatusChanged += OnThermalStatusChanged; + + return Task.CompletedTask; + } + + protected override Task OnDispose () + { + if (PlatformService.CanOpenTerminal) + Runtime.ProcessService.SetExternalConsoleHandler (null); + + FileService.FileRemoved -= NotifyFileRemoved; + FileService.FileRenamed -= NotifyFileRenamed; + + MemoryMonitor.StatusChanged -= OnMemoryStatusChanged; + ThermalMonitor.StatusChanged -= OnThermalStatusChanged; + + return Task.CompletedTask; + } + + static void OnMemoryStatusChanged (object sender, PlatformMemoryStatusEventArgs args) + { + Counters.MemoryPressure.Inc (args.CounterMetadata); + } + + static void OnThermalStatusChanged (object sender, PlatformThermalStatusEventArgs args) + { + Counters.ThermalNotification.Inc (args.CounterMetadata); + } + + /// + /// Returns the XWT toolkit for the native toolkit (Cocoa on Mac, WPF on Windows) + /// + /// The native toolkit. + public Xwt.Toolkit NativeToolkit { + get { + if (nativeToolkit == null) + nativeToolkit = platformService.LoadNativeToolkit (); + return nativeToolkit; + } + } + + public void SetGlobalProgress (double progress) + { + platformService.SetGlobalProgressBar (progress); + } + + public void ShowGlobalProgressIndeterminate () + { + platformService.ShowGlobalProgressBarIndeterminate (); + } + + public void ShowGlobalProgressError () + { + platformService.ShowGlobalProgressBarError (); + } + + public IEnumerable GetApplications (string filename) + { + return PlatformService.GetApplications (filename); + } + + public IEnumerable GetApplications (string filename, DesktopApplicationRole role) + { + return PlatformService.GetApplications (filename, role); + } + + internal string DefaultMonospaceFont { + get { return PlatformService.DefaultMonospaceFont; } + } + + [Obsolete ("Use FontService")] + public static string DefaultSansFont { + get { return PlatformService.DefaultSansFont; } + } + + public static string PlatformName { + get { return PlatformService.Name; } + } + + public void ShowUrl (string url) + { + PlatformService.ShowUrl (url); + } + + public void OpenFile (string filename) + { + PlatformService.OpenFile (filename); + } + + public void OpenFolder (FilePath folderPath, params FilePath [] selectFiles) + { + PlatformService.OpenFolder (folderPath, selectFiles); + } + + public string GetMimeTypeForRoslynLanguage (string roslynLanguage) + => MimeTypeCatalog.Instance.GetMimeTypeForRoslynLanguage (roslynLanguage); + + public IEnumerable GetMimeTypeInheritanceChainForRoslynLanguage (string roslynLanguage) + => MimeTypeCatalog.Instance.GetMimeTypeInheritanceChainForRoslynLanguage (roslynLanguage); + + public string GetRoslynLanguageForMimeType (string mimeType) + => MimeTypeCatalog.Instance.GetRoslynLanguageForMimeType (mimeType); + + public string GetMimeTypeForContentType (IContentType contentType) + => MimeTypeCatalog.Instance.GetMimeTypeForContentType (contentType); + + public IEnumerable GetMimeTypeInheritanceChainForContentType (IContentType contentType) + => MimeTypeCatalog.Instance.GetMimeTypeInheritanceChainForContentType (contentType); + + public IContentType GetContentTypeForMimeType (string mimeType) + => MimeTypeCatalog.Instance.GetContentTypeForMimeType (mimeType); + + public string GetMimeTypeForUri (string uri) + { + return PlatformService.GetMimeTypeForUri (uri); + } + + public string GetMimeTypeDescription (string mimeType) + { + return PlatformService.GetMimeTypeDescription (mimeType); + } + + public bool GetMimeTypeIsText (string mimeType) + { + return MimeTypeCatalog.Instance.GetMimeTypeIsText (mimeType); + } + + public bool GetFileIsText (string file, string mimeType = null) + { + if (mimeType == null) { + mimeType = GetMimeTypeForUri (file); + } + if (mimeType != "application/octet-stream" && mimeType != "application/x-msdownload") { + return GetMimeTypeIsText (mimeType); + } + + if (!File.Exists (file)) + return false; + + return !MonoDevelop.Core.Text.TextFileUtility.IsBinary (file); + } + + public async Task GetFileIsTextAsync (string file, string mimeType = null) + { + if (mimeType == null) { + mimeType = GetMimeTypeForUri (file); + } + + if (mimeType != "application/octet-stream") { + return GetMimeTypeIsText (mimeType); + } + + return await Task.Factory.StartNew (delegate { + if (!File.Exists (file)) + return false; + + using (var f = File.OpenRead (file)) { + var buf = new byte [8192]; + var read = f.Read (buf, 0, buf.Length); + for (int i = 0; i < read; i++) + if (buf [i] == 0) + return false; + } + return true; + }); + } + + public bool GetMimeTypeIsSubtype (string subMimeType, string baseMimeType) + { + return MimeTypeCatalog.Instance.GetMimeTypeIsSubtype (subMimeType, baseMimeType); + } + + public IEnumerable GetMimeTypeInheritanceChain (string mimeType) + { + return MimeTypeCatalog.Instance.GetMimeTypeInheritanceChain (mimeType); + } + + public IEnumerable GetMimeTypeInheritanceChainForFile (string filename) + { + return GetMimeTypeInheritanceChain (GetMimeTypeForUri (filename)); + } + + public Xwt.Drawing.Image GetIconForFile (string filename) + { + return PlatformService.GetIconForFile (filename); + } + + public Xwt.Drawing.Image GetIconForFile (string filename, Gtk.IconSize size) + { + return PlatformService.GetIconForFile (filename).WithSize (size); + } + + public Xwt.Drawing.Image GetIconForType (string mimeType) + { + return PlatformService.GetIconForType (mimeType); + } + + public Xwt.Drawing.Image GetIconForType (string mimeType, Gtk.IconSize size) + { + return PlatformService.GetIconForType (mimeType).WithSize (size); + } + + internal bool SetGlobalMenu (MonoDevelop.Components.Commands.CommandManager commandManager, + string commandMenuAddinPath, string appMenuAddinPath) + { + return PlatformService.SetGlobalMenu (commandManager, commandMenuAddinPath, appMenuAddinPath); + } + + // Used for preserve the file attributes when monodevelop opens & writes a file. + // This should work on unix & mac platform. + public object GetFileAttributes (string fileName) + { + return PlatformService.GetFileAttributes (fileName); + } + + public void SetFileAttributes (string fileName, object attributes) + { + PlatformService.SetFileAttributes (fileName, attributes); + } + + public Xwt.Rectangle GetUsableMonitorGeometry (int screenNumber, int monitorNumber) + { + return PlatformService.GetUsableMonitorGeometry (screenNumber, monitorNumber); + } + + public bool CanOpenTerminal { + get { + return PlatformService.CanOpenTerminal; + } + } + + /// + /// Opens an external terminal window. + /// + /// Working directory. + /// Environment variables. + /// Window title. + public void OpenTerminal ( + FilePath workingDirectory, + IDictionary environmentVariables = null, + string windowTitle = null) + { + PlatformService.OpenTerminal (workingDirectory, environmentVariables, windowTitle); + } + + public RecentFiles RecentFiles { + get { + PlatformService.RecentFiles.DesktopService = this; + return PlatformService.RecentFiles; + } + } + + void NotifyFileRemoved (object sender, FileEventArgs args) + { + foreach (FileEventInfo e in args) { + if (!e.IsDirectory) { + PlatformService.RecentFiles.NotifyFileRemoved (e.FileName); + } + } + } + + void NotifyFileRenamed (object sender, FileCopyEventArgs args) + { + if (args.IsExternal) + return; + + foreach (FileEventInfo e in args) { + if (!e.IsDirectory) { + PlatformService.RecentFiles.NotifyFileRenamed (e.SourceFile, e.TargetFile); + } + } + } + + internal string GetUpdaterUrl () + { + return PlatformService.GetUpdaterUrl (); + } + + internal IEnumerable GetUpdaterEnvironmentFlags () + { + return PlatformService.GetUpdaterEnviromentFlags (); + } + + internal void StartUpdatesInstaller (FilePath installerDataFile, FilePath updatedInstallerPath) + { + PlatformService.StartUpdatesInstaller (installerDataFile, updatedInstallerPath); + } + + /// + /// Grab the desktop focus for the window. + /// + internal void GrabDesktopFocus (Gtk.Window window) + { + PlatformService.GrabDesktopFocus (window); + } + + public Window GetParentForModalWindow () + { + return PlatformService.GetParentForModalWindow (); + } + + public Window GetFocusedTopLevelWindow () + { + return PlatformService.GetFocusedTopLevelWindow (); + } + + public void FocusWindow (Window window) + { + if (window != null) + PlatformService.FocusWindow (window); + } + + public void RemoveWindowShadow (Window window) + { + PlatformService.RemoveWindowShadow (window); + } + + + public void SetMainWindowDecorations (Window window) + { + PlatformService.SetMainWindowDecorations (window); + } + + internal MainToolbarController CreateMainToolbar (Gtk.Window window) + { + return new MainToolbarController (PlatformService.CreateMainToolbar (window)); + } + + internal void AttachMainToolbar (Gtk.VBox parent, MainToolbarController toolbar) + { + PlatformService.AttachMainToolbar (parent, toolbar.ToolbarView); + toolbar.Initialize (); + } + + public bool GetIsFullscreen (Window window) + { + return PlatformService.GetIsFullscreen (window); + } + + public void SetIsFullscreen (Window window, bool isFullscreen) + { + PlatformService.SetIsFullscreen (window, isFullscreen); + } + + public bool IsModalDialogRunning () + { + return PlatformService.IsModalDialogRunning (); + } + + internal void AddChildWindow (Gtk.Window parent, Gtk.Window child) + { + PlatformService.AddChildWindow (parent, child); + } + + internal void RemoveChildWindow (Gtk.Window parent, Gtk.Window child) + { + PlatformService.RemoveChildWindow (parent, child); + } + + internal void PlaceWindow (Gtk.Window window, int x, int y, int width, int height) + { + PlatformService.PlaceWindow (window, x, y, width, height); + } + + /// + /// Restarts MonoDevelop + /// + /// false if the user cancels exiting. + /// true to reopen current workspace. + internal void RestartIde (bool reopenWorkspace) + { + PlatformService.RestartIde (reopenWorkspace); + } + + public void MakeAccessibilityAnnouncement(string text) + { + PlatformService.MakeAccessibilityAnnouncement (text); + } + + public bool AccessibilityInUse { + get { + return PlatformService.AccessibilityInUse; + } + } + + public bool AccessibilityKeyboardFocusInUse { + get { + return PlatformService.AccessibilityKeyboardFocusInUse; + } + } + + internal string GetNativeRuntimeDescription () => PlatformService.GetNativeRuntimeDescription (); + + public ThermalMonitor ThermalMonitor { get; private set; } + public MemoryMonitor MemoryMonitor { get; private set; } + + IPlatformTelemetryDetails platformTelemetryDetails; + + public IPlatformTelemetryDetails PlatformTelemetry { + get { + if (platformTelemetryDetails == null) + platformTelemetryDetails = PlatformService.CreatePlatformTelemetryDetails (); + return platformTelemetryDetails; + } + } + } +} From 5cd97d55a1ac35dab5debf5673c25c41b566014d Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:30:58 +0100 Subject: [PATCH 078/382] Update MonoDevelop.Ide.csproj --- .../core/MonoDevelop.Ide/MonoDevelop.Ide.csproj | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj index dce8d91583d..6ef28938438 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj @@ -88,17 +88,8 @@ ..\..\..\external\Xamarin.Mac.dll -<<<<<<< HEAD -======= - - gio-sharp-3.0 - - - gtk-sharp-3.0 - ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 @@ -118,8 +109,6 @@ {92494904-35FA-4DC9-BDE9-3A3E87AC49D3} Xwt -<<<<<<< HEAD -======= 0;) { - if (i == ActiveTab) { - active = tabs [i]; - continue; - } - var tab = tabs[i]; - if (!tab.Visible) - continue; - var bounds = GetBounds (tab); - tab.HoverPosition = tab == hoverTab ? new Cairo.PointD (mx - bounds.X, my) : new Cairo.PointD (-1, -1); - tab.Draw (cr, bounds); - } - if (active != null && active.Visible) { - active.Draw (cr, GetBounds (active)); - } - } - - return base.OnExposeEvent (evnt); - } -======= min_height = natural_height = (int)Math.Ceiling (tabSizes.Max (p => p.Y)); } @@ -372,7 +339,6 @@ protected override bool OnExposeEvent (Gdk.EventExpose evnt) // // return base.OnExposeEvent (evnt); // } ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 int focusedTab = -1; From e04934e28552d1b0b070b24265a669da7c7c982c Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sun, 10 Dec 2023 17:27:47 +0100 Subject: [PATCH 141/382] Update PathBar.cs --- .../MonoDevelop.Components/PathBar.cs | 158 ------------------ 1 file changed, 158 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs index 8c95a63cf56..e086809c32e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs @@ -340,163 +340,6 @@ void SetAccessibilityFrame (PathEntry entry, int x, int width) entry.Accessible.FrameInParent = rect; } -<<<<<<< HEAD - protected override bool OnExposeEvent (EventExpose evnt) - { - Gdk.Rectangle focusRect = new Gdk.Rectangle (0, 0, 0, 0); - - using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { - int index = 0; - ctx.Rectangle (0, 0, Allocation.Width, Allocation.Height); - ctx.SetSourceColor (Styles.BreadcrumbBackgroundColor.ToCairoColor ()); - ctx.Fill (); - - if (widths == null) - return true; - - // Calculate the total required with, and the reduction to be applied in case it doesn't fit the available space - - bool widthReduced; - var currentWidths = GetCurrentWidths (out widthReduced); - - // Render the paths - - int textTopPadding = topPadding + (height - textHeight) / 2; - int xpos = leftPadding, ypos = topPadding; - - for (int i = 0; i < leftPath.Length; i++, index++) { - bool last = i == leftPath.Length - 1; - - // Reduce the item size when required - int itemWidth = currentWidths [i]; - int x = xpos; - xpos += itemWidth; - - SetAccessibilityFrame (leftPath [i], x, itemWidth); - - if (hoverIndex >= 0 && hoverIndex < Path.Length && leftPath [i] == Path [hoverIndex] && (menuVisible || pressed || hovering)) - DrawButtonBorder (ctx, x - padding, itemWidth + padding + padding); - - if (index == focusedPathIndex) { - focusRect = new Gdk.Rectangle (x - padding, 0, itemWidth + (padding * 2) ,0); - } - int textOffset = 0; - if (leftPath [i].DarkIcon != null) { - int iy = (height - (int)leftPath [i].DarkIcon.Height) / 2 + topPadding; - ctx.DrawImage (this, leftPath [i].DarkIcon, x, iy); - textOffset += (int) leftPath [i].DarkIcon.Width + iconSpacing; - } - - layout.Attributes = (i == activeIndex) ? boldAtts : null; - layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); - layout.SetMarkup (GetFirstLineFromMarkup (leftPath [i].Markup)); - - ctx.Save (); - - // If size is being reduced, ellipsize it - bool showText = true; - if (widthReduced) { - int w = itemWidth - textOffset; - if (w > 0) { - ctx.Rectangle (x + textOffset, textTopPadding, w, height); - ctx.Clip (); - } else - showText = false; - } else - layout.Width = -1; - - if (showText) { - // Text - ctx.SetSourceColor (Styles.BreadcrumbTextColor.ToCairoColor ()); - ctx.MoveTo (x + textOffset, textTopPadding); - Pango.CairoHelper.ShowLayout (ctx, layout); - } - ctx.Restore (); - - if (!last) { - xpos += arrowLeftPadding; - if (leftPath [i].IsPathEnd) { - Style.PaintVline (Style, GdkWindow, State, evnt.Area, this, "", ypos, ypos + height, xpos - arrowSize / 2); - } else { - int arrowH = Math.Min (height, arrowSize); - int arrowY = ypos + (height - arrowH) / 2; - DrawPathSeparator (ctx, xpos, arrowY, arrowH); - } - xpos += arrowSize + arrowRightPadding; - } - } - - int xposRight = Allocation.Width - rightPadding; - for (int i = 0; i < rightPath.Length; i++, index++) { - // bool last = i == rightPath.Length - 1; - - // Reduce the item size when required - int itemWidth = currentWidths [i + leftPath.Length]; - xposRight -= itemWidth; - xposRight -= arrowSize; - - int x = xposRight; - - SetAccessibilityFrame (rightPath [i], x, itemWidth); - - if (hoverIndex >= 0 && hoverIndex < Path.Length && rightPath [i] == Path [hoverIndex] && (menuVisible || pressed || hovering)) - DrawButtonBorder (ctx, x - padding, itemWidth + padding + padding); - - if (index == focusedPathIndex) { - focusRect = new Gdk.Rectangle (x - padding, 0, itemWidth + (padding * 2), 0); - } - - int textOffset = 0; - if (rightPath [i].DarkIcon != null) { - ctx.DrawImage (this, rightPath [i].DarkIcon, x, ypos); - textOffset += (int) rightPath [i].DarkIcon.Width + padding; - } - - layout.Attributes = (i == activeIndex) ? boldAtts : null; - layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); - layout.SetMarkup (GetFirstLineFromMarkup (rightPath [i].Markup)); - - ctx.Save (); - - // If size is being reduced, ellipsize it - bool showText = true; - if (widthReduced) { - int w = itemWidth - textOffset; - if (w > 0) { - ctx.Rectangle (x + textOffset, textTopPadding, w, height); - ctx.Clip (); - } else - showText = false; - } else - layout.Width = -1; - - if (showText) { - // Text - ctx.SetSourceColor (Styles.BreadcrumbTextColor.ToCairoColor ()); - ctx.MoveTo (x + textOffset, textTopPadding); - Pango.CairoHelper.ShowLayout (ctx, layout); - } - - ctx.Restore (); - } - - if (DrawBottomBorder) { - ctx.MoveTo (0, Allocation.Height - 0.5); - ctx.RelLineTo (Allocation.Width, 0); - ctx.SetSourceColor (Styles.BreadcrumbBottomBorderColor.ToCairoColor ()); - ctx.LineWidth = 1; - ctx.Stroke (); - } - if (HasFocus) { - int focusY = topPadding - buttonPadding; - int focusHeight = Allocation.Height - topPadding - bottomPadding + buttonPadding * 2; - - Gtk.Style.PaintFocus (Style, GdkWindow, State, Allocation, this, "label", focusRect.X, focusY, focusRect.Width, focusHeight); - } - } - return true; - } -======= // protected override bool OnExposeEvent (EventExpose evnt) // { // Gdk.Rectangle focusRect = new Gdk.Rectangle (0, 0, 0, 0); @@ -652,7 +495,6 @@ protected override bool OnExposeEvent (EventExpose evnt) // } // return true; // } ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 void DrawPathSeparator (Cairo.Context ctx, double x, double y, double size) { From 8ff734c69d499f2749b3d63589f41d90579783a6 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sun, 10 Dec 2023 17:30:58 +0100 Subject: [PATCH 142/382] Update HPanedThin.cs --- .../core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs index 67ce00b0852..efe65e590a4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs @@ -115,7 +115,6 @@ protected CustomPanedHandle (Gtk.Paned parent) Parent = parent; } -<<<<<<< HEAD protected virtual void OnParentSizeRequested (Gtk.SizeRequestedArgs args) { SizeRequest (); @@ -128,13 +127,11 @@ protected virtual void OnParentSizeAllocated (Gtk.SizeAllocatedArgs args) void HandleSizeRequested (object o, Gtk.SizeRequestedArgs args) { OnParentSizeRequested (args); -======= // parent.SizeRequested += delegate { // SizeRequest (); // }; parent.SizeAllocated += HandleSizeAllocated; HandleWidget = null; ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 } void HandleSizeAllocated (object o, Gtk.SizeAllocatedArgs args) From cef1c3b7ea3eea1b495cf561400435c8cb75b835 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sun, 10 Dec 2023 17:34:52 +0100 Subject: [PATCH 143/382] Update ReferencesGtk.props --- main/msbuild/ReferencesGtk.props | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main/msbuild/ReferencesGtk.props b/main/msbuild/ReferencesGtk.props index 480551d1975..76605e28be4 100644 --- a/main/msbuild/ReferencesGtk.props +++ b/main/msbuild/ReferencesGtk.props @@ -12,22 +12,22 @@ - + $(ReferencesGtkCopyToOutput) - + $(ReferencesGtkCopyToOutput) - + $(ReferencesGtkCopyToOutput) - + $(ReferencesGtkCopyToOutput) - + $(ReferencesGtkCopyToOutput) - + $(ReferencesGtkCopyToOutput) @@ -40,4 +40,4 @@ - \ No newline at end of file + From 290e13adf04dfecf15aebedc8103f753e3fd0ee5 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sun, 10 Dec 2023 17:56:37 +0100 Subject: [PATCH 144/382] Update MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs --- ...Support.Toolbox.ComponentSelectorDialog.cs | 162 +----------------- 1 file changed, 2 insertions(+), 160 deletions(-) diff --git a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs index 899883488fb..ddf3b19d47f 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs @@ -10,35 +10,6 @@ namespace MonoDevelop.DesignerSupport.Toolbox internal partial class ComponentSelectorDialog { -<<<<<<< HEAD - private VBox vbox2; - - private HBox hbox1; - - private Label label1; - - private ComboBox comboType; - - private VSeparator vseparator1; - - private Button button24; - - private HBox hbox2; - - private ImageView imageview1; - - private Label label2; - - private ScrolledWindow scrolledwindow1; - - private TreeView listView; - - private CheckButton checkGroupByCat; - - private Button buttonCancel; - - private Button buttonOk; -======= private global::Gtk.VBox vbox2; private global::Gtk.HBox hbox1; @@ -66,19 +37,9 @@ internal partial class ComponentSelectorDialog private global::Gtk.Button buttonCancel; private global::Gtk.Button buttonOk; ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 protected virtual void Build() { -<<<<<<< HEAD - Gui.Initialize (this); - // Widget MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog - Name = "MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog"; - Title = Catalog.GetString ("Toolbox Item Selector"); - WindowPosition = WindowPosition.CenterOnParent; - // Internal child MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.VBox - var w1 = VBox; -======= global::Stetic.Gui.Initialize(this); // Widget MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog this.Name = "MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog"; @@ -86,19 +47,9 @@ protected virtual void Build() this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.VBox global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 w1.Name = "dialog1_VBox"; w1.BorderWidth = 2; // Container child dialog1_VBox.Gtk.Box+BoxChild -<<<<<<< HEAD - vbox2 = new VBox {Name = "vbox2", Spacing = 6, BorderWidth = 6}; - // Container child vbox2.Gtk.Box+BoxChild - hbox1 = new HBox {Name = "hbox1", Spacing = 6}; - // Container child hbox1.Gtk.Box+BoxChild - label1 = new Label {Name = "label1", Xalign = 0F, LabelProp = Catalog.GetString ("Type of component:")}; - hbox1.Add (label1); - var w2 = (Box.BoxChild) hbox1[label1]; -======= this.vbox2 = new global::Gtk.VBox(); this.vbox2.Name = "vbox2"; this.vbox2.Spacing = 6; @@ -114,22 +65,11 @@ protected virtual void Build() this.label1.LabelProp = global::Mono.Unix.Catalog.GetString("Type of component:"); this.hbox1.Add(this.label1); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.label1])); ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 w2.Position = 0; w2.Expand = false; w2.Fill = false; // Container child hbox1.Gtk.Box+BoxChild -<<<<<<< HEAD - comboType = ComboBox.NewText (); - comboType.Name = "comboType"; - hbox1.Add (comboType); - var w3 = (Box.BoxChild) hbox1[comboType]; - w3.Position = 1; - // Container child hbox1.Gtk.Box+BoxChild - vseparator1 = new VSeparator {Name = "vseparator1"}; - hbox1.Add (vseparator1); - var w4 = (Box.BoxChild) hbox1[vseparator1]; -======= + this.comboType = new global::Gtk.ComboBoxText(); this.comboType.Name = "comboType"; this.hbox1.Add(this.comboType); @@ -140,20 +80,10 @@ protected virtual void Build() this.vseparator1.Name = "vseparator1"; this.hbox1.Add(this.vseparator1); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.vseparator1])); ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 w4.Position = 2; w4.Expand = false; w4.Fill = false; // Container child hbox1.Gtk.Box+BoxChild -<<<<<<< HEAD - button24 = new Button {CanFocus = true, Name = "button24"}; - // Container child button24.Gtk.Container+ContainerChild - hbox2 = new HBox {Name = "hbox2", Spacing = 2}; - // Container child hbox2.Gtk.Box+BoxChild - imageview1 = new ImageView {Name = "imageview1", IconId = "gtk-add", IconSize = IconSize.Menu}; - hbox2.Add (imageview1); - var w5 = (Box.BoxChild) hbox2[imageview1]; -======= this.button24 = new global::Gtk.Button(); this.button24.CanFocus = true; this.button24.Name = "button24"; @@ -167,28 +97,10 @@ protected virtual void Build() this.imageview1.IconId = "gtk-add"; this.hbox2.Add(this.imageview1); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.imageview1])); ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 w5.Position = 0; w5.Expand = false; w5.Fill = false; // Container child hbox2.Gtk.Box+BoxChild -<<<<<<< HEAD - label2 = new Label { - Name = "label2", LabelProp = Catalog.GetString ("Add Assembly..."), UseUnderline = true - }; - hbox2.Add (label2); - var w6 = (Box.BoxChild) hbox2[label2]; - w6.Position = 1; - w6.Expand = false; - w6.Fill = false; - button24.Add (hbox2); - hbox1.Add (button24); - var w8 = (Box.BoxChild) hbox1[button24]; - w8.Position = 3; - w8.Expand = false; - vbox2.Add (hbox1); - var w9 = (Box.BoxChild) vbox2[hbox1]; -======= this.label2 = new global::Gtk.Label(); this.label2.Name = "label2"; this.label2.LabelProp = global::Mono.Unix.Catalog.GetString("Add Assembly..."); @@ -205,39 +117,10 @@ protected virtual void Build() w8.Expand = false; this.vbox2.Add(this.hbox1); global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1])); ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 w9.Position = 0; w9.Expand = false; w9.Fill = false; // Container child vbox2.Gtk.Box+BoxChild -<<<<<<< HEAD - scrolledwindow1 = - new ScrolledWindow {CanFocus = true, Name = "scrolledwindow1", ShadowType = ShadowType.In}; - // Container child scrolledwindow1.Gtk.Container+ContainerChild - listView = new TreeView {CanFocus = true, Name = "listView"}; - scrolledwindow1.Add (listView); - vbox2.Add (scrolledwindow1); - var w11 = (Box.BoxChild) vbox2[scrolledwindow1]; - w11.Position = 1; - // Container child vbox2.Gtk.Box+BoxChild - checkGroupByCat = new CheckButton { - CanFocus = true, - Name = "checkGroupByCat", - Label = Catalog.GetString ("Group by component category"), - DrawIndicator = true, - UseUnderline = true - }; - vbox2.Add (checkGroupByCat); - var w12 = (Box.BoxChild) vbox2[checkGroupByCat]; - w12.Position = 2; - w12.Expand = false; - w12.Fill = false; - w1.Add (vbox2); - var w13 = (Box.BoxChild) w1[vbox2]; - w13.Position = 0; - // Internal child MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.ActionArea - var w14 = ActionArea; -======= this.scrolledwindow1 = new global::Gtk.ScrolledWindow(); this.scrolledwindow1.CanFocus = true; this.scrolledwindow1.Name = "scrolledwindow1"; @@ -267,51 +150,11 @@ protected virtual void Build() w13.Position = 0; // Internal child MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.ActionArea global::Gtk.HButtonBox w14 = (Gtk.HButtonBox)this.ActionArea; ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 w14.Name = "dialog1_ActionArea"; w14.Spacing = 10; w14.BorderWidth = 5; w14.LayoutStyle = ButtonBoxStyle.End; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild -<<<<<<< HEAD - buttonCancel = new Button { - CanDefault = true, - CanFocus = true, - Name = "buttonCancel", - UseStock = true, - UseUnderline = true, - Label = "gtk-cancel" - }; - AddActionWidget (buttonCancel, -6); - var w15 = (ButtonBox.ButtonBoxChild) w14[buttonCancel]; - w15.Expand = false; - w15.Fill = false; - // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild - buttonOk = new Button { - CanDefault = true, - CanFocus = true, - Name = "buttonOk", - UseStock = true, - UseUnderline = true, - Label = "gtk-ok" - }; - w14.Add (buttonOk); - var w16 = (ButtonBox.ButtonBoxChild) w14[buttonOk]; - w16.Position = 1; - w16.Expand = false; - w16.Fill = false; - if (Child != null) { - Child.ShowAll (); - } - - DefaultWidth = 642; - DefaultHeight = 433; - Hide (); - comboType.Changed += OnComboTypeChanged; - button24.Clicked += OnButton24Clicked; - checkGroupByCat.Clicked += OnCheckbutton1Clicked; - buttonOk.Clicked += OnButtonOkClicked; -======= this.buttonCancel = new global::Gtk.Button(); this.buttonCancel.CanDefault = true; this.buttonCancel.CanFocus = true; @@ -347,8 +190,7 @@ protected virtual void Build() this.button24.Clicked += new global::System.EventHandler(this.OnButton24Clicked); this.checkGroupByCat.Clicked += new global::System.EventHandler(this.OnCheckbutton1Clicked); this.buttonOk.Clicked += new global::System.EventHandler(this.OnButtonOkClicked); ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 } } -} \ No newline at end of file +} From 91197e83977abfd741dbec2eb5ec24f7e67cddbf Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sun, 10 Dec 2023 18:04:34 +0100 Subject: [PATCH 145/382] Update SearchEntry.cs --- .../MonoDevelop.Components/SearchEntry.cs | 41 ------------------- 1 file changed, 41 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs index 6ff7150d7ec..3da3ba08067 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs @@ -762,46 +762,6 @@ public static Gdk.Color ColorBlend (Gdk.Color a, Gdk.Color b) // Gdk.Colormap.System.AllocColor (ref color, true, true); return color; } - -<<<<<<< HEAD - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - // The Entry's GdkWindow is the top level window onto which - // the frame is drawn; the actual text entry is drawn into a - // separate window, so we can ensure that for themes that don't - // respect HasFrame, we never ever allow the base frame drawing - // to happen - if (evnt.Window == GdkWindow) { - return true; - } - - bool ret = base.OnExposeEvent (evnt); - - if (text_gc == null) { - text_gc = new Gdk.GC (evnt.Window); - text_gc.Copy (Style.TextGC (StateType.Normal)); - Gdk.Color color_a = parent.Style.Base (StateType.Normal); - Gdk.Color color_b = parent.Style.Text (StateType.Normal); - text_gc.RgbFgColor = ColorBlend (color_a, color_b); - } - - if (Text.Length > 0 || HasFocus || parent.EmptyMessage == null) { - return ret; - } - - if (layout == null) { - layout = new Pango.Layout (PangoContext); - layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); - } - - int width, height; - layout.SetMarkup (parent.EmptyMessage); - layout.GetPixelSize (out width, out height); - evnt.Window.DrawLayout (text_gc, 2, (SizeRequest ().Height - height) / 2, layout); - - return ret; - } -======= // protected override bool OnExposeEvent (Gdk.EventExpose evnt) // { // // The Entry's GdkWindow is the top level window onto which @@ -839,7 +799,6 @@ protected override bool OnExposeEvent (Gdk.EventExpose evnt) // // return ret; // } ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 } } } From 5d7c2944d7b38524c9f80312b9ffa68240c1f50a Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sun, 10 Dec 2023 18:06:45 +0100 Subject: [PATCH 146/382] Update PadTreeView.cs --- .../MonoDevelop.Ide.Gui.Components/PadTreeView.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/PadTreeView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/PadTreeView.cs index 5a0e610eb62..5e5f2771586 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/PadTreeView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/PadTreeView.cs @@ -58,13 +58,8 @@ public PadTreeView () { Init (); } -<<<<<<< HEAD - - public PadTreeView (TreeModel model) : base (model) -======= public PadTreeView (ITreeModel model) : base (model) ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 { Init (); } From bc9129542ad903326bb53ce812c08ecbfb8dad90 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sun, 10 Dec 2023 18:10:01 +0100 Subject: [PATCH 147/382] Update SelectReferenceDialog.cs --- .../MonoDevelop.Ide.Projects/SelectReferenceDialog.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs index c3127d6265a..3cef30f49ff 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs @@ -543,18 +543,11 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { -<<<<<<< HEAD - requisition = Child?.SizeRequest () ?? Requisition.Zero; - var entryRequest = filterEntry.SizeRequest (); - requisition.Width += entryRequest.Width; - requisition.Height = Math.Max (requisition.Height, entryRequest.Height); -======= min_width = 0; if (Child != null) min_width = Child.SizeRequest ().Width; min_width += filterEntry.SizeRequest ().Width; natural_width = min_width; ->>>>>>> b08b7c532f3372052fd8f3a8bc386ae5d531cc69 } void RepositionFilter () From 3d4dc523c829da2833441ac0fcddf4635e418b7a Mon Sep 17 00:00:00 2001 From: makiwolf Date: Mon, 25 Dec 2023 17:17:26 +0100 Subject: [PATCH 148/382] change to own fork --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index f3398dc03a4..7b13fc037bc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -42,4 +42,4 @@ branch = dotdevelop [submodule "main/external/xwt"] path = main/external/xwt - url = https://github.com/dotdevelop/xwt.git + url = https://github.com/MakiWolf/xwt.git From 505e1ee5a341bda3315fb12b0741611a95ae93d0 Mon Sep 17 00:00:00 2001 From: makiwolf Date: Mon, 25 Dec 2023 17:29:46 +0100 Subject: [PATCH 149/382] update --- main/external/xwt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/external/xwt b/main/external/xwt index b191f50b079..8108d5603f1 160000 --- a/main/external/xwt +++ b/main/external/xwt @@ -1 +1 @@ -Subproject commit b191f50b079c49df4426302fe84c53baeec6c721 +Subproject commit 8108d5603f141f19129f4b0ee2a7bfca0127b65f From 2e2670c37f52bcca5c25c696b950e05d5ec052a0 Mon Sep 17 00:00:00 2001 From: makiwolf Date: Mon, 25 Dec 2023 17:59:16 +0100 Subject: [PATCH 150/382] update --- main/Main.sln | 2 +- .../MonoDevelop.FSharp.fsproj | 60 ------------------- 2 files changed, 1 insertion(+), 61 deletions(-) diff --git a/main/Main.sln b/main/Main.sln index ec27372aa98..33946c5180e 100644 --- a/main/Main.sln +++ b/main/Main.sln @@ -474,7 +474,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TextUIGtkUtil", "external\v EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.Debugger.DotNetCore", "external\Monodevelop.Netcoredbg\MonoDevelop.Debugger.DotNetCore\MonoDevelop.Debugger.DotNetCore.csproj", "{F71A259D-C08F-48D9-93B7-EE51497EB390}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xwt.Gtk2", "external\xwt\Xwt.Gtk2\Xwt.Gtk2.csproj", "{FED3E127-B64A-4E57-8D2A-C8817C5D593A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xwt.Gtk3", "external\xwt\Xwt.Gtk\Xwt.Gtk3.csproj", "{FED3E127-B64A-4E57-8D2A-C8817C5D593A}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xwt.GtkSharp", "external\xwt\Xwt.GtkSharp\Xwt.GtkSharp.csproj", "{8F0B736F-8353-4A6C-B471-192D826BDD81}" EndProject diff --git a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.fsproj b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.fsproj index a75882b713d..fdd8356ac05 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.fsproj +++ b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.fsproj @@ -144,66 +144,6 @@ {100568FC-F4E8-439B-94AD-41D11724E45B} MonoDevelop.Refactoring - - - - - - - - - - - - - - - - - False - ..\..\..\build\bin\Mono.Addins.dll - - - False - ..\..\..\build\bin\Xwt.dll - - - False - ..\..\..\build\bin\Xwt.Gtk.dll - - - - {FD0D1033-9145-48E5-8ED8-E2365252878C} - MonoDevelop.FSharp.Gui - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.dll - False - - - ..\..\..\build\bin\Xamarin.Mac.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.Workspaces.dll - False - - - ..\..\..\build\bin\Microsoft.CodeAnalysis.Features.dll - False - - - {AF5FEAD5-B50E-4F07-A274-32F23D5C504D} - MonoDevelop.FSharp.Shared - - - {2357AABD-08C7-4808-A495-8FF2D3CDFDB0} - MonoDevelop.Debugger - False - - - {7525BB88-6142-4A26-93B9-A30C6983390A} - MonoDevelop.Core False From 8fe8797f6276a7815a35c6fbf0e51739a15c6f8d Mon Sep 17 00:00:00 2001 From: makiwolf Date: Mon, 25 Dec 2023 18:53:21 +0100 Subject: [PATCH 151/382] update --- .gitmodules | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 7b13fc037bc..510f2e7c5f7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,8 +13,7 @@ url = https://github.com/dotdevelop/mdtestharness.git [submodule "main/external/mono-addins"] path = main/external/mono-addins - url = https://github.com/dotdevelop/mono-addins.git - branch = dotdevelop_gtksharp + url = https://github.com/MakiWolf/mono-addins.git [submodule "main/external/mono-tools"] path = main/external/mono-tools url = https://github.com/dotdevelop/mono-tools.git From d330325556d46e2ad5c8dc6d81f62372000cf88d Mon Sep 17 00:00:00 2001 From: makiwolf Date: Mon, 25 Dec 2023 18:59:13 +0100 Subject: [PATCH 152/382] update --- main/external/mono-addins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/external/mono-addins b/main/external/mono-addins index cddcc8052c5..05d4e10b3c9 160000 --- a/main/external/mono-addins +++ b/main/external/mono-addins @@ -1 +1 @@ -Subproject commit cddcc8052c57447c9422a85dabbbf2a872b4e415 +Subproject commit 05d4e10b3c98f23cc8de9cd012805a3e4196ff39 From 528a10eec56d1cf0c0317db76aa9a291d217fdbe Mon Sep 17 00:00:00 2001 From: makiwolf Date: Mon, 25 Dec 2023 19:08:25 +0100 Subject: [PATCH 153/382] older version --- main/external/mono-addins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/external/mono-addins b/main/external/mono-addins index 05d4e10b3c9..a543fa00110 160000 --- a/main/external/mono-addins +++ b/main/external/mono-addins @@ -1 +1 @@ -Subproject commit 05d4e10b3c98f23cc8de9cd012805a3e4196ff39 +Subproject commit a543fa0011098232041c99bc5acb6416cb4acbe0 From d884937a887b7600f60b8401a2ddc3de4a06eb3f Mon Sep 17 00:00:00 2001 From: makiwolf Date: Wed, 27 Dec 2023 23:53:17 +0100 Subject: [PATCH 154/382] comment out --- .github/workflows/monodevelop.yml | 2 +- main/Main.sln | 46 +- main/msbuild/ReferencesGtk.props | 2 +- .../MonoDevelop.Debugger.Soft.csproj | 6 + .../GenericPreviewVisualizer.cs | 2 +- .../PreviewVisualizerWindow.cs | 6 +- .../MonoDevelop.Debugger.csproj | 6 + .../DebuggerOptionsPanelWidget.cs | 2 +- .../ExceptionCaughtDialog.cs | 42 +- .../ObjectValue/Gtk/GtkObjectValueTreeView.cs | 386 ++++++------- .../ObjectValue/ObjectValueTreeView.cs | 14 +- .../Toolbox.cs | 2 +- .../ToolboxWidget.cs | 116 ++-- .../MonoDevelop.DesignerSupport.csproj | 4 + .../MonoDevelop.Gettext.csproj | 3 + .../MonoDevelop.RegexToolkit.csproj | 3 + .../ModeHelpWindow.cs | 262 ++++----- .../BounceFadePopupWindow.cs | 30 +- .../SmartScrolledWindow.cs | 32 +- .../Mono.TextEditor/Gui/CodePreviewWindow.cs | 26 +- .../Gui/CodeSegmentPreviewWindow.cs | 8 +- .../Mono.TextEditor/Gui/TextArea.cs | 28 +- .../QuickTaskOverviewMode.cs | 126 ++--- .../TooltipProviderWrapper.cs | 8 +- .../MonoDevelop.SourceEditor.csproj | 8 +- .../MessageBubbleCache.cs | 62 +-- ...ultSignatureHelpPresenterSurfaceElement.cs | 2 +- .../VSEditor/MDUtils.cs | 108 ++-- .../MonoDevelop.WebReferences.csproj | 2 + main/src/addins/Xml/MonoDevelop.Xml.csproj | 6 + .../MonoDevelop.Core/Runtime.cs | 12 +- ...p.Ide.Gui.OptionPanels.BuildPanelWidget.cs | 12 +- .../BasicChart.cs | 2 +- .../TabStrip.cs | 2 +- .../MonoDevelop.Components.Docking/DockBar.cs | 8 +- .../DockBarItem.cs | 2 +- .../DockItemTitleTab.cs | 8 +- .../StatusArea.cs | 22 +- .../CollectionEditor.cs | 58 +- .../PropertyEditorCell.cs | 2 +- .../PropertyGrid.cs | 326 +++++------ .../ContextMenuTreeView.cs | 7 +- .../DropDownBoxListWindow.cs | 2 +- .../MonoDevelop.Components/GtkWorkarounds.cs | 526 +++++++++--------- .../MonoDevelop.Components/HPanedThin.cs | 68 +-- .../MonoDevelop.Components/ImageView.cs | 26 +- .../Shared/GtkWorkarounds.cs | 24 +- .../MonoDevelop.Components/Tabstrip.cs | 6 +- .../TooltipPopoverWindow.cs | 2 +- .../BuildOutputTreeCellView.cs | 282 +++++----- .../ListWidget.cs | 6 +- .../ParameterInformationWindow.cs | 2 +- .../RoslynCompletionData.cs | 2 +- .../SignatureHelpParameterHintingData.cs | 130 ++--- .../TooltipInformationWindow.cs | 26 +- .../ShowTextMateScopesHandler.cs | 2 +- .../MonoDevelop.Ide.Editor/TooltipProvider.cs | 68 +-- .../MonoDevelop.Ide.Fonts/FontService.cs | 2 +- .../MonoDevelop.Ide.Gui.Components/LogView.cs | 2 +- .../TreeNodeNavigator.cs | 2 +- .../DirtyFilesDialog.cs | 30 +- .../FileSelectorDialog.cs | 37 +- .../MultiConfigItemOptionsPanel.cs | 8 +- .../OpenFileDialog.cs | 18 +- .../KeyBindingsPanel.cs | 126 ++--- .../ShowAllFilesBuilderExtension.cs | 26 +- .../MonodocTreePad.cs | 2 +- .../ConfigurationComboBox.cs | 2 +- .../MonoDevelopStatusBar.cs | 78 +-- .../MonoDevelop.Ide.Gui/ToolbarComboBox.cs | 2 +- .../GtkNewProjectDialogBackend.UI.cs | 6 +- .../GtkNewProjectDialogBackend.cs | 54 +- .../GtkTemplateCellRenderer.cs | 18 +- .../SelectReferenceDialog.cs | 82 +-- .../WelcomePageTipOfTheDaySection.cs | 2 +- .../MonoDevelop.Ide/MonoDevelop.Ide.csproj | 10 +- .../MonoDevelop.Ide/DesktopService.cs | 16 +- .../MonoDevelop.Ide/IdeInstanceConnection.cs | 6 +- .../MonoDevelop.TextEditor.Tests.csproj | 3 + .../tools/mdmonitor/CounterSelectorDialog.cs | 2 +- ...tation.Monitor.InstrumentationChartView.cs | 12 +- ...ion.Monitor.InstrumentationViewerDialog.cs | 18 +- ...Mono.Instrumentation.Monitor.NewProfile.cs | 40 +- ...trumentation.Monitor.TimeLineViewWindow.cs | 10 +- main/src/tools/mdmonitor/gtk-gui/generated.cs | 88 +-- main/src/tools/mdtool/src/mdtool.cs | 6 +- main/tests/IdeUnitTests/IdeUnitTests.csproj | 1 + 87 files changed, 1875 insertions(+), 1817 deletions(-) diff --git a/.github/workflows/monodevelop.yml b/.github/workflows/monodevelop.yml index 6ee4aab56cc..47115499a38 100644 --- a/.github/workflows/monodevelop.yml +++ b/.github/workflows/monodevelop.yml @@ -45,7 +45,7 @@ jobs: # Synchronise Mono SSL certs cert-sync /etc/ssl/certs/ca-certificates.crt # Install extra packages required for dotdevelop build - sudo apt-get install -y sed git build-essential intltool nuget fsharp gtk-sharp2 + sudo apt-get install -y sed git build-essential intltool nuget fsharp gtk-sharp3 sudo apt-get install -y software-properties-common sudo apt-get update - name: Verify OS and tools versions diff --git a/main/Main.sln b/main/Main.sln index 33946c5180e..b9dbab9ec00 100644 --- a/main/Main.sln +++ b/main/Main.sln @@ -476,8 +476,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.Debugger.DotNet EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xwt.Gtk3", "external\xwt\Xwt.Gtk\Xwt.Gtk3.csproj", "{FED3E127-B64A-4E57-8D2A-C8817C5D593A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xwt.GtkSharp", "external\xwt\Xwt.GtkSharp\Xwt.GtkSharp.csproj", "{8F0B736F-8353-4A6C-B471-192D826BDD81}" -EndProject +#Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xwt.Gtk", "external\xwt\Xwt.Gtk\Xwt.Gtk.csproj", "{8F0B736F-8353-4A6C-B471-192D826BDD81}" +#EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Addins.GuiGtk3", "external\mono-addins\Mono.Addins.GuiGtk3\Mono.Addins.GuiGtk3.csproj", "{410A7DC9-E7DA-43E6-B592-93E2A344B660}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.GtkExtensions", "src\core\MonoDevelop.GtkExtensions\MonoDevelop.GtkExtensions.csproj", "{0A8EB4EA-60B4-4708-BA45-68C5E730ED00}" @@ -2871,26 +2871,26 @@ Global {FED3E127-B64A-4E57-8D2A-C8817C5D593A}.Debug|x86.Build.0 = Debug|Any CPU {FED3E127-B64A-4E57-8D2A-C8817C5D593A}.Release|x86.ActiveCfg = Release|Any CPU {FED3E127-B64A-4E57-8D2A-C8817C5D593A}.Release|x86.Build.0 = Release|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.DebugGnome|Any CPU.ActiveCfg = Debug|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.DebugGnome|Any CPU.Build.0 = Debug|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.DebugMac|Any CPU.Build.0 = Debug|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.Release|Any CPU.Build.0 = Release|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.ReleaseGnome|Any CPU.ActiveCfg = Debug|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.ReleaseGnome|Any CPU.Build.0 = Debug|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.ReleaseMac|Any CPU.ActiveCfg = Debug|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.ReleaseMac|Any CPU.Build.0 = Debug|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.ReleaseWin32|Any CPU.ActiveCfg = Debug|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.ReleaseWin32|Any CPU.Build.0 = Debug|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.Debug|x86.ActiveCfg = Debug|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.Debug|x86.Build.0 = Debug|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.Release|x86.ActiveCfg = Release|Any CPU - {8F0B736F-8353-4A6C-B471-192D826BDD81}.Release|x86.Build.0 = Release|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.Debug|Any CPU.Build.0 = Debug|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.DebugGnome|Any CPU.ActiveCfg = Debug|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.DebugGnome|Any CPU.Build.0 = Debug|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.DebugMac|Any CPU.Build.0 = Debug|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.Release|Any CPU.ActiveCfg = Release|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.Release|Any CPU.Build.0 = Release|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.ReleaseGnome|Any CPU.ActiveCfg = Debug|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.ReleaseGnome|Any CPU.Build.0 = Debug|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.ReleaseMac|Any CPU.ActiveCfg = Debug|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.ReleaseMac|Any CPU.Build.0 = Debug|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.ReleaseWin32|Any CPU.ActiveCfg = Debug|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.ReleaseWin32|Any CPU.Build.0 = Debug|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.Debug|x86.ActiveCfg = Debug|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.Debug|x86.Build.0 = Debug|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.Release|x86.ActiveCfg = Release|Any CPU + #{8F0B736F-8353-4A6C-B471-192D826BDD81}.Release|x86.Build.0 = Release|Any CPU {410A7DC9-E7DA-43E6-B592-93E2A344B660}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {410A7DC9-E7DA-43E6-B592-93E2A344B660}.Debug|Any CPU.Build.0 = Debug|Any CPU {410A7DC9-E7DA-43E6-B592-93E2A344B660}.DebugGnome|Any CPU.ActiveCfg = Debug|Any CPU @@ -3149,7 +3149,7 @@ Global {209B27AE-712E-4B87-8846-BB149874D44E} = {745BF6CA-BC7C-4863-B1B4-C423A828820A} {F71A259D-C08F-48D9-93B7-EE51497EB390} = {A026D596-3C8D-4521-BB42-2C898FA3BE2D} {FED3E127-B64A-4E57-8D2A-C8817C5D593A} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258} - {8F0B736F-8353-4A6C-B471-192D826BDD81} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258} + #{8F0B736F-8353-4A6C-B471-192D826BDD81} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258} {410A7DC9-E7DA-43E6-B592-93E2A344B660} = {B8897B76-1A12-4DFA-8B60-7944CC4C9654} {0A8EB4EA-60B4-4708-BA45-68C5E730ED00} = {9D360D43-0C05-49D6-84DB-4E7AB2F38F82} EndGlobalSection diff --git a/main/msbuild/ReferencesGtk.props b/main/msbuild/ReferencesGtk.props index 76605e28be4..7f87d8567b0 100644 --- a/main/msbuild/ReferencesGtk.props +++ b/main/msbuild/ReferencesGtk.props @@ -30,7 +30,7 @@ $(ReferencesGtkCopyToOutput) - + diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj index e36a3db61a9..6e1ae059a80 100644 --- a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj +++ b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj @@ -13,6 +13,12 @@ + + gio-sharp-3.0 + + + gtk-sharp-3.0 + diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs index 030282437da..60105564e22 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs @@ -69,7 +69,7 @@ public override Control GetVisualizerWidget (ObjectValue val) label = new Label (); label.Text = value; - label.ModifyFont (IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11)); + //label.ModifyFont (IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11)); label.ModifyFg (StateType.Normal, col); label.SetPadding (4, 4); diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs index eb8a0c0ae0d..741a3e76504 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs @@ -72,9 +72,9 @@ public PreviewVisualizerWindow (ObjectValue val, Gtk.Widget invokingWidget) : ba var headerTitle = new Label (); headerTitle.ModifyFg (StateType.Normal, Styles.PreviewVisualizerHeaderTextColor.ToGdkColor ()); - var font = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale12); - font.Weight = Pango.Weight.Bold; - headerTitle.ModifyFont (font); + //var font = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale12); + //font.Weight = Pango.Weight.Bold; + //headerTitle.ModifyFont (font); headerTitle.Text = val.TypeName; var vbTitle = new VBox (); vbTitle.PackStart (headerTitle, false, false, 3); diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj index b8d81890b6f..d7c912bf630 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj @@ -25,6 +25,12 @@ + + gio-sharp-3.0 + + + gtk-sharp-3.0 + diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs index 04da2882de7..78ed97708c7 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs @@ -86,7 +86,7 @@ void Build () var label = new Label { Text = GettextCatalog.GetString ("The debugger will step into code and hit exceptions in dependencies that aren’t considered part of your project, like packages and references."), - Font = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11).ToXwtFont (), + //Font = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11).ToXwtFont (), TextColor = Ide.Gui.Styles.SecondaryTextColor, MarginLeft = 30, Wrap = WrapMode.Word, diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs index 94b6c17045b..a720a9365ad 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs @@ -320,12 +320,12 @@ Expander WrapInExpander (string title, Widget widget) void Expander_Activated (object sender, EventArgs e) { - if (expanderProperties.Expanded && expanderStacktrace.Expanded) - paned.PositionSet = false; - else if (expanderStacktrace.Expanded) - paned.Position = paned.MaxPosition; - else - paned.Position = paned.MinPosition; + // if (expanderProperties.Expanded && expanderStacktrace.Expanded) + // paned.PositionSet = false; + // else if (expanderStacktrace.Expanded) + // paned.Position = paned.MaxPosition; + // else + // paned.Position = paned.MinPosition; } // static void StackFrameLayout (CellLayout layout, CellRenderer cr, ITreeModel model, TreeIter iter) @@ -624,11 +624,11 @@ Widget CreateInnerExceptionsTree () } }); exception.Changed += delegate { - Application.Invoke ((o, args) => { - innerExceptionsStore.EmitRowChanged (innerExceptionsStore.GetPath (iter), iter); - updateInnerExceptions (); - innerExceptionsTreeView.ExpandRow (innerExceptionsStore.GetPath (iter), true); - }); + // Application.Invoke ((o, args) => { + // innerExceptionsStore.EmitRowChanged (innerExceptionsStore.GetPath (iter), iter); + // updateInnerExceptions (); + // innerExceptionsTreeView.ExpandRow (innerExceptionsStore.GetPath (iter), true); + // }); }; updateInnerExceptions (); } @@ -746,11 +746,11 @@ void UpdateDisplay () void ExceptionChanged (object sender, EventArgs e) { - Application.Invoke ((o, args) => { - if (hadInnerException != HasInnerException ()) - Build (); - UpdateDisplay (); - }); + // Application.Invoke ((o, args) => { + // if (hadInnerException != HasInnerException ()) + // Build (); + // UpdateDisplay (); + // }); } void OnlyShowMyCodeToggled (object sender, EventArgs e) @@ -1139,11 +1139,11 @@ public override Control CreateWidget () vb.PackStart (closeButton, false, false, 0); box.PackStart (vb, false, false, 0); - exception.Changed += delegate { - Application.Invoke ((o, args) => { - LoadData (); - }); - }; + // exception.Changed += delegate { + // Application.Invoke ((o, args) => { + // LoadData (); + // }); + // }; LoadData (); var eb = new PopoverWidget (); diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Gtk/GtkObjectValueTreeView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Gtk/GtkObjectValueTreeView.cs index fe7731a123c..72598c442bd 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Gtk/GtkObjectValueTreeView.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Gtk/GtkObjectValueTreeView.cs @@ -200,11 +200,11 @@ public GtkObjectValueTreeView ( Pango.FontDescription newFont; - if (compactView) { - newFont = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); - } else { - newFont = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale12); - } + //if (compactView) { + //newFont = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); + //} else { + //newFont = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale12); + //} liveIcon = ImageService.GetIcon ("md-live", IconSize.Menu); noLiveIcon = liveIcon.WithAlpha (0.5); @@ -215,7 +215,7 @@ public GtkObjectValueTreeView ( expCol.PackStart (crp, false); expCol.AddAttribute (crp, "stock_id", IconColumn); crtExp = new CellRendererTextWithIcon (); - crtExp.FontDesc = newFont; + //crtExp.FontDesc = newFont; expCol.PackStart (crtExp, true); expCol.AddAttribute (crtExp, "text", NameColumn); expCol.AddAttribute (crtExp, "editable", NameEditableColumn); @@ -238,7 +238,7 @@ public GtkObjectValueTreeView ( valueCol.PackStart (crColorPreview, false); valueCol.SetCellDataFunc (crColorPreview, ValueDataFunc); crpButton = new CellRendererRoundedButton (); - crpButton.FontDesc = newFont; + //crpButton.FontDesc = newFont; valueCol.PackStart (crpButton, false); valueCol.AddAttribute (crpButton, "visible", ValueButtonVisibleColumn); valueCol.AddAttribute (crpButton, "text", ValueButtonTextColumn); @@ -252,7 +252,7 @@ public GtkObjectValueTreeView ( crtValue = new ValueCellRenderer (); crtValue.Ellipsize = Pango.EllipsizeMode.End; crtValue.Compact = compactView; - crtValue.FontDesc = newFont; + //crtValue.FontDesc = newFont; valueCol.PackStart (crtValue, true); valueCol.AddAttribute (crtValue, "texturl", ValueColumn); valueCol.AddAttribute (crtValue, "editable", ValueEditableColumn); @@ -268,7 +268,7 @@ public GtkObjectValueTreeView ( typeCol.Title = GettextCatalog.GetString ("Type"); typeCol.Visible = !compactView; crtType = new CellRendererText (); - crtType.FontDesc = newFont; + //crtType.FontDesc = newFont; typeCol.PackStart (crtType, true); typeCol.AddAttribute (crtType, "text", TypeColumn); typeCol.Resizable = true; @@ -304,7 +304,7 @@ public GtkObjectValueTreeView ( createMsg = GettextCatalog.GetString ("Add item to watch"); CompletionWindowManager.WindowClosed += HandleCompletionWindowClosed; PreviewWindowManager.WindowClosed += HandlePreviewWindowClosed; - ScrollAdjustmentsSet += HandleScrollAdjustmentsSet; + //ScrollAdjustmentsSet += HandleScrollAdjustmentsSet; expanderSize = (int)StyleGetProperty ("expander-size") + 4; //+4 is hardcoded in gtk.c code horizontal_separator = (int)StyleGetProperty ("horizontal-separator"); @@ -455,13 +455,13 @@ protected override void OnDestroyed () valueCol.RemoveNotification ("width", OnColumnWidthChanged); expCol.RemoveNotification ("width", OnColumnWidthChanged); - ScrollAdjustmentsSet -= HandleScrollAdjustmentsSet; - if (oldHadjustment != null) { - oldHadjustment.ValueChanged -= UpdatePreviewPosition; - oldVadjustment.ValueChanged -= UpdatePreviewPosition; - oldHadjustment = null; - oldVadjustment = null; - } + // ScrollAdjustmentsSet -= HandleScrollAdjustmentsSet; + // if (oldHadjustment != null) { + // oldHadjustment.ValueChanged -= UpdatePreviewPosition; + // oldVadjustment.ValueChanged -= UpdatePreviewPosition; + // oldHadjustment = null; + // oldVadjustment = null; + // } disposed = true; controller.CancelAsyncTasks (); @@ -528,7 +528,7 @@ void IObjectValueTreeView.Appended (ObjectValueNode node) /// /// Notifies the treeview that the specified nodes have been added to the root node's children - /// + /// /// The nodes that were appended. void IObjectValueTreeView.Appended (IList nodes) { @@ -770,11 +770,11 @@ void HandleValueButton (TreeIter it) NodeRefresh?.Invoke (this, new ObjectValueNodeEventArgs (node)); // update the tree - if (store.IterParent (out TreeIter parentIter, it)) { - SetValues (parentIter, it, null, node); - } else { - SetValues (TreeIter.Zero, it, null, node); - } + // if (store.IterParent (out TreeIter parentIter, it)) { + // SetValues (parentIter, it, null, node); + // } else { + // SetValues (TreeIter.Zero, it, null, node); + // } } } @@ -1482,7 +1482,7 @@ protected void OnCopy () return; if (selected.Length == 1) { - var editable = IdeApp.Workbench.RootWindow.Focus as Editable; + var editable = IdeApp.Workbench.RootWindow.Focus as IEditable; if (editable != null) { editable.CopyClipboard (); @@ -1631,28 +1631,28 @@ bool GetCellAtPos (int x, int y, out TreePath path, out TreeViewColumn col, out if (GetPathAtPos (x, y, out path, out col)) { var cellArea = GetCellArea (path, col); x -= cellArea.X; - foreach (var cr in col.CellRenderers) { - int xo, w; - col.CellGetPosition (cr, out xo, out w); - var visible = cr.Visible; - if (cr == crpViewer) { - if (store.GetIter (out var it, path)) { - visible = (bool) store.GetValue (it, ViewerButtonVisibleColumn); - } - } else if (cr == evaluateStatusCell) { - if (store.GetIter (out var it, path)) { - visible = (bool) store.GetValue (it, EvaluateStatusIconVisibleColumn); - } - } else if (cr == crpButton) { - if (store.GetIter (out var it, path)) { - visible = (bool) store.GetValue (it, ValueButtonVisibleColumn); - } - } - if (visible && x >= xo && x < xo + w) { - cellRenderer = cr; - return true; - } - } + // foreach (var cr in col.CellRenderers) { + // int xo, w; + // col.CellGetPosition (cr, out xo, out w); + // var visible = cr.Visible; + // if (cr == crpViewer) { + // if (store.GetIter (out var it, path)) { + // visible = (bool) store.GetValue (it, ViewerButtonVisibleColumn); + // } + // } else if (cr == evaluateStatusCell) { + // if (store.GetIter (out var it, path)) { + // visible = (bool) store.GetValue (it, EvaluateStatusIconVisibleColumn); + // } + // } else if (cr == crpButton) { + // if (store.GetIter (out var it, path)) { + // visible = (bool) store.GetValue (it, ValueButtonVisibleColumn); + // } + // } + // if (visible && x >= xo && x < xo + w) { + // cellRenderer = cr; + // return true; + // } + // } } cellRenderer = null; return false; @@ -1799,7 +1799,7 @@ internal void SetCustomFont (Pango.FontDescription font) #region UI support - static void ValueDataFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + static void ValueDataFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { Xwt.Drawing.Color? color; ObjectValue val = null; @@ -1839,31 +1839,31 @@ int GetMaxWidth (TreeViewColumn column, TreeIter iter) column.CellSetCellData (Model, iter, false, false); var area = new Gdk.Rectangle (0, 0, 1000, 1000); bool firstCell = true; - foreach (var cellRenderer in column.CellRenderers) { - if (!cellRenderer.Visible) - continue; - if (!firstCell && columnWidth > 0) - columnWidth += column.Spacing; - cellRenderer.GetSize (this, ref area, out x, out y, out w, out h); - columnWidth += w + focus_line_width; - firstCell = false; - } - if (ExpanderColumn == column) { - columnWidth += horizontal_separator + (path.Depth - 1) * LevelIndentation; - if (ShowExpanders) - columnWidth += path.Depth * expanderSize; - } else { - columnWidth += horizontal_separator; - } - if (this.GetRowExpanded (path)) { - var childrenCount = Model.IterNChildren (iter); - for (int i = 0; i < childrenCount; i++) { - TreeIter childIter; - if (!Model.IterNthChild (out childIter, iter, i)) - break; - columnWidth = Math.Max (columnWidth, GetMaxWidth (column, childIter)); - } - } + // foreach (var cellRenderer in column.CellRenderers) { + // if (!cellRenderer.Visible) + // continue; + // if (!firstCell && columnWidth > 0) + // columnWidth += column.Spacing; + // cellRenderer.GetSize (this, ref area, out x, out y, out w, out h); + // columnWidth += w + focus_line_width; + // firstCell = false; + // } + // if (ExpanderColumn == column) { + // columnWidth += horizontal_separator + (path.Depth - 1) * LevelIndentation; + // if (ShowExpanders) + // columnWidth += path.Depth * expanderSize; + // } else { + // columnWidth += horizontal_separator; + // } + // if (this.GetRowExpanded (path)) { + // var childrenCount = Model.IterNChildren (iter); + // for (int i = 0; i < childrenCount; i++) { + // TreeIter childIter; + // if (!Model.IterNthChild (out childIter, iter, i)) + // break; + // columnWidth = Math.Max (columnWidth, GetMaxWidth (column, childIter)); + // } + // } return columnWidth; } @@ -1945,17 +1945,17 @@ void HandleSelectionChanged (object sender, EventArgs e) } //Don't convert this event handler to override OnSetScrollAdjustments as it causes problems - void HandleScrollAdjustmentsSet (object o, ScrollAdjustmentsSetArgs args) - { - if (oldHadjustment != null) { - oldHadjustment.ValueChanged -= UpdatePreviewPosition; - oldVadjustment.ValueChanged -= UpdatePreviewPosition; - } - oldHadjustment = Hadjustment; - oldVadjustment = Vadjustment; - oldHadjustment.ValueChanged += UpdatePreviewPosition; - oldVadjustment.ValueChanged += UpdatePreviewPosition; - } + // void HandleScrollAdjustmentsSet (object o, ScrollAdjustmentsSetArgs args) + // { + // if (oldHadjustment != null) { + // oldHadjustment.ValueChanged -= UpdatePreviewPosition; + // oldVadjustment.ValueChanged -= UpdatePreviewPosition; + // } + // oldHadjustment = Hadjustment; + // oldVadjustment = Vadjustment; + // oldHadjustment.ValueChanged += UpdatePreviewPosition; + // oldVadjustment.ValueChanged += UpdatePreviewPosition; + // } void UpdatePreviewPosition (object sender, EventArgs e) { @@ -2076,31 +2076,31 @@ Xwt.Drawing.Image img { } } - public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - if (!icon.IsNull) - width += (int)(Xpad * 2 + img.Width); - } - - protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - { - base.Render (window, widget, background_area, cell_area, expose_area, flags); - if (!icon.IsNull) { - using (var ctx = Gdk.CairoHelper.Create (window)) { - using (var layout = new Pango.Layout (widget.PangoContext)) { - layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); - layout.FontDescription.Family = Family; - layout.SetText (Text); - int w, h; - layout.GetPixelSize (out w, out h); - var x = cell_area.X + w + 3 * Xpad; - var y = cell_area.Y + cell_area.Height / 2 - (int)(img.Height / 2); - ctx.DrawImage (widget, img, x, y); - } - } - } - } + // public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + // { + // base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); + // if (!icon.IsNull) + // width += (int)(Xpad * 2 + img.Width); + // } + + // protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) + // { + // base.Render (window, widget, background_area, cell_area, expose_area, flags); + // if (!icon.IsNull) { + // using (var ctx = Gdk.CairoHelper.Create (window)) { + // using (var layout = new Pango.Layout (widget.PangoContext)) { + // layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); + // layout.FontDescription.Family = Family; + // layout.SetText (Text); + // int w, h; + // layout.GetPixelSize (out w, out h); + // var x = cell_area.X + w + 3 * Xpad; + // var y = cell_area.Y + cell_area.Height / 2 - (int)(img.Height / 2); + // ctx.DrawImage (widget, img, x, y); + // } + // } + // } + // } } class ValueCellRenderer : CellRendererText @@ -2131,44 +2131,44 @@ public string TextUrl { } } - public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - if (Compact) - this.Ellipsize = Pango.EllipsizeMode.None; - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - if (Compact) - this.Ellipsize = Pango.EllipsizeMode.End; - } + // public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + // { + // if (Compact) + // this.Ellipsize = Pango.EllipsizeMode.None; + // base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); + // if (Compact) + // this.Ellipsize = Pango.EllipsizeMode.End; + // } } class CellRendererColorPreview : CellRenderer { - protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - { - var darkColor = Color.WithIncreasedLight (-0.15); + // protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) + // { + // var darkColor = Color.WithIncreasedLight (-0.15); - using (Cairo.Context cr = Gdk.CairoHelper.Create (window)) { - double center_x = cell_area.X + Math.Round ((double)(cell_area.Width / 2d)); - double center_y = cell_area.Y + Math.Round ((double)(cell_area.Height / 2d)); + // using (Cairo.Context cr = Gdk.CairoHelper.Create (window)) { + // double center_x = cell_area.X + Math.Round ((double)(cell_area.Width / 2d)); + // double center_y = cell_area.Y + Math.Round ((double)(cell_area.Height / 2d)); - // TODO: VV: On retina this should be LineWidth = 0.5 and Arc size needs to match + // // TODO: VV: On retina this should be LineWidth = 0.5 and Arc size needs to match - // @1x: - cr.LineWidth = 1; - cr.Arc (center_x, center_y, 5.5f, 0, 2 * Math.PI); + // // @1x: + // cr.LineWidth = 1; + // cr.Arc (center_x, center_y, 5.5f, 0, 2 * Math.PI); - cr.SetSourceRGBA (Color.Red, Color.Green, Color.Blue, 1); - cr.FillPreserve (); - cr.SetSourceRGBA (darkColor.Red, darkColor.Green, darkColor.Blue, 1); - cr.Stroke (); - } - } + // cr.SetSourceRGBA (Color.Red, Color.Green, Color.Blue, 1); + // cr.FillPreserve (); + // cr.SetSourceRGBA (darkColor.Red, darkColor.Green, darkColor.Blue, 1); + // cr.Stroke (); + // } + // } - public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - x_offset = y_offset = 0; - height = width = 16; - } + // public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + // { + // x_offset = y_offset = 0; + // height = width = 16; + // } public Xwt.Drawing.Color Color { get; set; } } @@ -2177,60 +2177,60 @@ class CellRendererRoundedButton : CellRendererText { const int TopBottomPadding = 1; - protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - { - if (string.IsNullOrEmpty (Text)) { - return; - } - using (var cr = Gdk.CairoHelper.Create (window)) { - using (var layout = new Pango.Layout (widget.PangoContext)) { - layout.SetText (Text); - layout.FontDescription = FontDesc; - layout.FontDescription.Family = Family; - int w, h; - layout.GetPixelSize (out w, out h); - int xpad = (int)Xpad; - cr.RoundedRectangle ( - cell_area.X + xpad + 0.5, - cell_area.Y + TopBottomPadding + 0.5, - w + (cell_area.Height - 2 * TopBottomPadding) - 1, - cell_area.Height - TopBottomPadding * 2 - 1, - (cell_area.Height - (TopBottomPadding * 2)) / 2); - cr.LineWidth = 1; - cr.SetSourceColor (Styles.ObjectValueTreeValuesButtonBackground.ToCairoColor ()); - cr.FillPreserve (); - cr.SetSourceColor (Styles.ObjectValueTreeValuesButtonBorder.ToCairoColor ()); - cr.Stroke (); - - int YOffset = (cell_area.Height - h) / 2; - if (((GtkObjectValueTreeView)widget).compactView && !Platform.IsWindows) - YOffset += 1; - cr.SetSourceColor (Styles.ObjectValueTreeValuesButtonText.ToCairoColor ()); - cr.MoveTo (cell_area.X + (cell_area.Height - TopBottomPadding * 2 + 1) / 2 + xpad, - cell_area.Y + YOffset); - cr.ShowLayout (layout); - } - } - } - - public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - x_offset = y_offset = 0; - if (string.IsNullOrEmpty (Text)) { - width = 0; - height = 0; - return; - } - using (var layout = new Pango.Layout (widget.PangoContext)) { - layout.SetText (Text); - layout.FontDescription = FontDesc; - layout.FontDescription.Family = Family; - int w, h; - layout.GetPixelSize (out w, out h); - width = w + (height - 2 * TopBottomPadding) + 2 * (int)Xpad; - } - } + // protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) + // { + // if (string.IsNullOrEmpty (Text)) { + // return; + // } + // using (var cr = Gdk.CairoHelper.Create (window)) { + // using (var layout = new Pango.Layout (widget.PangoContext)) { + // layout.SetText (Text); + // layout.FontDescription = FontDesc; + // layout.FontDescription.Family = Family; + // int w, h; + // layout.GetPixelSize (out w, out h); + // int xpad = (int)Xpad; + // cr.RoundedRectangle ( + // cell_area.X + xpad + 0.5, + // cell_area.Y + TopBottomPadding + 0.5, + // w + (cell_area.Height - 2 * TopBottomPadding) - 1, + // cell_area.Height - TopBottomPadding * 2 - 1, + // (cell_area.Height - (TopBottomPadding * 2)) / 2); + // cr.LineWidth = 1; + // cr.SetSourceColor (Styles.ObjectValueTreeValuesButtonBackground.ToCairoColor ()); + // cr.FillPreserve (); + // cr.SetSourceColor (Styles.ObjectValueTreeValuesButtonBorder.ToCairoColor ()); + // cr.Stroke (); + + // int YOffset = (cell_area.Height - h) / 2; + // if (((GtkObjectValueTreeView)widget).compactView && !Platform.IsWindows) + // YOffset += 1; + // cr.SetSourceColor (Styles.ObjectValueTreeValuesButtonText.ToCairoColor ()); + // cr.MoveTo (cell_area.X + (cell_area.Height - TopBottomPadding * 2 + 1) / 2 + xpad, + // cell_area.Y + YOffset); + // cr.ShowLayout (layout); + // } + // } + // } + + // public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + // { + // base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); + // x_offset = y_offset = 0; + // if (string.IsNullOrEmpty (Text)) { + // width = 0; + // height = 0; + // return; + // } + // using (var layout = new Pango.Layout (widget.PangoContext)) { + // layout.SetText (Text); + // layout.FontDescription = FontDesc; + // layout.FontDescription.Family = Family; + // int w, h; + // layout.GetPixelSize (out w, out h); + // width = w + (height - 2 * TopBottomPadding) + 2 * (int)Xpad; + // } + // } } #endregion @@ -2238,13 +2238,13 @@ public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out in //================================================================================================================== #region Locator methods - static ObjectValueNode GetNodeAtIter (TreeIter iter, TreeModel model) + static ObjectValueNode GetNodeAtIter (TreeIter iter, ITreeModel model) { return (ObjectValueNode) model.GetValue (iter, ObjectNodeColumn); } // TODO: clean up, maybe even remove this method - static ObjectValue GetDebuggerObjectValueAtIter (TreeIter iter, TreeModel model) + static ObjectValue GetDebuggerObjectValueAtIter (TreeIter iter, ITreeModel model) { var node = GetNodeAtIter (iter, model); diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/ObjectValueTreeView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/ObjectValueTreeView.cs index d733b0ecdc3..d0c6da9b353 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/ObjectValueTreeView.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/ObjectValueTreeView.cs @@ -320,7 +320,7 @@ public ObjectValueTreeView () Selection.Changed += HandleSelectionChanged; ResetColumnSizes (); - Pango.FontDescription newFont = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); + //Pango.FontDescription newFont = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); liveIcon = ImageService.GetIcon ("md-live", IconSize.Menu); noLiveIcon = liveIcon.WithAlpha (0.5); @@ -768,19 +768,19 @@ public bool CompactView { compact = value; Pango.FontDescription newFont; if (compact) { - newFont = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); + //newFont = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); valueCol.MaxWidth = 800; crpViewer.Image = ImageService.GetIcon (Stock.Edit).WithSize (12,12); } else { - newFont = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale12); + //newFont = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale12); valueCol.MaxWidth = int.MaxValue; } crtValue.Compact = compact; typeCol.Visible = !compact; - crtExp.FontDesc = newFont; - crtValue.FontDesc = newFont; - crtType.FontDesc = newFont; - crpButton.FontDesc = newFont; + //crtExp.FontDesc = newFont; + //crtValue.FontDesc = newFont; + //crtType.FontDesc = newFont; + //crpButton.FontDesc = newFont; ResetColumnSizes (); AdjustColumnSizes (); } diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs index 03fcf0d1a0e..01e83ee4b05 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs @@ -133,7 +133,7 @@ public Toolbox (ToolboxService toolboxService, IPadWindow container) fontChanger = new MonoDevelop.Ide.Gui.PadFontChanger (toolboxWidget, toolboxWidget.SetCustomFont, toolboxWidget.QueueResize); - this.toolboxWidget.DoPopupMenu = ShowPopup; + //this.toolboxWidget.DoPopupMenu = ShowPopup; scrolledWindow = new MonoDevelop.Components.CompactScrolledWindow (); base.PackEnd (scrolledWindow, true, true, 0); base.FocusChain = new Gtk.Widget [] { scrolledWindow }; diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs index 571071de5f9..b9638bdc9b0 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs @@ -325,24 +325,24 @@ static Cairo.Color Convert (Gdk.Color color) void ProcessExpandAnimation (Cairo.Context cr, ToolboxWidgetCategory lastCategory, int lastCategoryYpos, Cairo.Color backColor, Gdk.Rectangle area, ref int ypos) { - if (lastCategory != null && lastCategory.AnimatingExpand) { - int newypos = lastCategory.IsExpanded ? lastCategoryYpos + lastCategory.AnimationHeight : ypos + lastCategory.AnimationHeight; - if (newypos < lastCategoryYpos) { - newypos = lastCategoryYpos; + //if (lastCategory != null && lastCategory.AnimatingExpand) { + //int newypos = lastCategory.IsExpanded ? lastCategoryYpos + lastCategory.AnimationHeight : ypos + lastCategory.AnimationHeight; + //if (newypos < lastCategoryYpos) { + // newypos = lastCategoryYpos; // StopExpandAnimation (lastCategory); - } - if (newypos > ypos) { - newypos = ypos; + //} + //if (newypos > ypos) { + // newypos = ypos; // StopExpandAnimation (lastCategory); - } + //} // Clear the area where the category will be drawn since it will be // drawn over the items being hidden/shown - cr.SetSourceColor (backColor); - cr.Rectangle (area.X, newypos, area.Width, ypos - lastCategoryYpos); - cr.Fill (); - ypos = newypos; - } + //cr.SetSourceColor (backColor); + //cr.Rectangle (area.X, newypos, area.Width, ypos - lastCategoryYpos); + //cr.Fill (); + //ypos = newypos; + //} } // protected override bool OnKeyPressEvent (Gdk.EventKey evnt) @@ -453,7 +453,7 @@ void ProcessExpandAnimation (Cairo.Context cr, ToolboxWidgetCategory lastCategor // return base.OnScrollEvent (evnt); // } - public Action DoPopupMenu { get; set; } +// public Action DoPopupMenu { get; set; } // protected override bool OnButtonPressEvent (Gdk.EventButton e) // { @@ -501,69 +501,69 @@ void SetCategoryExpanded (ToolboxWidgetCategory cat, bool expanded) Xwt.Motion.Tweener tweener; - void StartExpandAnimation (ToolboxWidgetCategory cat) - { - if (tweener != null) { - tweener.Stop (); + // void StartExpandAnimation (ToolboxWidgetCategory cat) + // { + // if (tweener != null) { + // tweener.Stop (); - if (cat.AnimatingExpand) - GLib.Source.Remove (cat.AnimationHandle); + // if (cat.AnimatingExpand) + // GLib.Source.Remove (cat.AnimationHandle); - cat.AnimationHeight = 0; - cat.AnimatingExpand = true; + // cat.AnimationHeight = 0; + //cat.AnimatingExpand = true; // cat.AnimationHandle = GLib.Timeout.Add (animationTimeSpan, delegate { // cat.AnimationHeight += animationStepSize; // QueueResize (); // return true; // }); - } + // } - void StartCollapseAnimation (Category cat) - { - if (cat.AnimatingExpand) - GLib.Source.Remove (cat.AnimationHandle); + // void StartCollapseAnimation (Category cat) + // { + // if (cat.AnimatingExpand) + // GLib.Source.Remove (cat.AnimationHandle); - cat.AnimationHeight = 0; - cat.AnimatingExpand = true; + // cat.AnimationHeight = 0; + // cat.AnimatingExpand = true; // cat.AnimationHandle = GLib.Timeout.Add (animationTimeSpan, delegate { // cat.AnimationHeight -= animationStepSize; // QueueResize (); // return true; // }); - } - - void StopExpandAnimation (Category cat) - { - if (cat.AnimatingExpand) { - cat.AnimatingExpand = false; - GLib.Source.Remove (cat.AnimationHandle); - } - - cat.AnimatingExpand = true; - cat.AnimationPosition = 0.0f; - - tweener = new Xwt.Motion.Tweener (animationDurationMs, 10) { Easing = Xwt.Motion.Easing.SinOut }; - tweener.ValueUpdated += (sender, e) => { - cat.AnimationPosition = tweener.Value; - QueueDraw (); - }; - tweener.Finished += (sender, e) => { - cat.AnimatingExpand = false; - QueueDraw (); - }; - tweener.Start (); - QueueDraw (); - } - - protected override bool OnPopupMenu () - { + // } + + // void StopExpandAnimation (Category cat) + // { + // if (cat.AnimatingExpand) { + // cat.AnimatingExpand = false; + // GLib.Source.Remove (cat.AnimationHandle); + // } + + // cat.AnimatingExpand = true; + // cat.AnimationPosition = 0.0f; + + // tweener = new Xwt.Motion.Tweener (animationDurationMs, 10) { Easing = Xwt.Motion.Easing.SinOut }; + // tweener.ValueUpdated += (sender, e) => { + // cat.AnimationPosition = tweener.Value; + // QueueDraw (); + // }; + // tweener.Finished += (sender, e) => { + // cat.AnimatingExpand = false; + // QueueDraw (); + // }; + // tweener.Start (); + // QueueDraw (); + // } + + // protected override bool OnPopupMenu () + //{ // if (DoPopupMenu != null) { // DoPopupMenu (null); // return true; // } // return base.OnPopupMenu (); - return false; - } + // return false; + //} // protected override bool OnMotionNotifyEvent (Gdk.EventMotion e) // { diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj index b89174a85de..712bfcac5bb 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj @@ -30,6 +30,10 @@ + + + gio-sharp-3.0 + diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj index 5e743d130bb..a7c6c7d5fc9 100644 --- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj +++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj @@ -18,6 +18,9 @@ + + gio-sharp-3.0 + diff --git a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj index 1078f0c129a..fc8d29c5e69 100644 --- a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj +++ b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj @@ -16,6 +16,9 @@ + + gio-sharp-3.0 + diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs index bb70872901f..93f9a06a3db 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs @@ -145,84 +145,84 @@ protected override void OnDestroyed () const int xBorder = 4; const int yBorder = 2; - protected override bool OnDrawn (Context g) - { - g.Translate (Allocation.X, Allocation.Y); - g.LineWidth = 1; -// Gdk.GC gc = new Gdk.GC (args.Window); - layout.SetMarkup (TitleText); - int width, height; - layout.GetPixelSize (out width, out height); - width += xBorder * 2; - FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, true, false, 0.5, 0.5, height + yBorder * 2 + 1.5, width, height + yBorder * 2); - g.SetSourceColor (Styles.TableLayoutModeTitleBackgroundColor.ToCairoColor ()); - g.FillPreserve (); - g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); - g.Stroke (); - - g.Save (); - g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ()); - g.Translate (xBorder, yBorder); - g.ShowLayout (layout); - g.Restore (); - - FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, 0.5, height * 2 + yBorder * 2 + 0.5, height, Allocation.Width - 1, Allocation.Height - height * 2 - yBorder * 2 - 1); - g.SetSourceColor (Styles.TableLayoutModeBackgroundColor.ToCairoColor ()); - g.FillPreserve (); - g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); - g.Stroke (); - - g.MoveTo (xSpacer + 0.5, height * 2 + yBorder * 2); - g.LineTo (xSpacer + 0.5, Allocation.Height - 1); - g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); - g.Stroke (); - - int y = height + yBorder * 2; - - for (int i = 0; i < Items.Count; i++) { - KeyValuePair pair = Items [i]; - - layout.SetMarkup (pair.Key); - layout.GetPixelSize (out width, out height); - - if (i == 0) { - FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, false, false, 0, y + 0.5, height + 1.5, Allocation.Width, height); - g.SetSourceColor (Styles.TableLayoutModeCategoryBackgroundColor.ToCairoColor ()); - g.FillPreserve (); - g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); - g.Stroke (); - - g.MoveTo (xSpacer + 0.5, height + yBorder * 2 + 1); - g.LineTo (xSpacer + 0.5, height * 2 + yBorder * 2 + 1); - g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); - g.Stroke (); - } - -// gc.RgbFgColor = (HslColor)(i == 0 ? Styles.TableLayoutModeBackgroundColor : Styles.TableLayoutModeTextColor).ToCairoColor (); - g.Save (); - g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ()); - g.Translate (xBorder, y); - g.ShowLayout (layout); - g.Restore (); - - g.Save (); - g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ()); - g.Translate (xSpacer + xBorder, y); - layout.SetMarkup (pair.Value); - g.ShowLayout (layout); - g.Restore (); - - // draw top line - if (i > 0) { - g.MoveTo (1, y + 0.5); - g.LineTo (Allocation.Width - 1, y + 0.5); - g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); - g.Stroke (); - } - y += height; - } - return base.OnDrawn (g); - } +// protected override bool OnDrawn (Context g) +// { +// g.Translate (Allocation.X, Allocation.Y); +// g.LineWidth = 1; +// // Gdk.GC gc = new Gdk.GC (args.Window); +// layout.SetMarkup (TitleText); +// int width, height; +// layout.GetPixelSize (out width, out height); +// width += xBorder * 2; +// FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, true, false, 0.5, 0.5, height + yBorder * 2 + 1.5, width, height + yBorder * 2); +// g.SetSourceColor (Styles.TableLayoutModeTitleBackgroundColor.ToCairoColor ()); +// g.FillPreserve (); +// g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); +// g.Stroke (); + +// g.Save (); +// g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ()); +// g.Translate (xBorder, yBorder); +// g.ShowLayout (layout); +// g.Restore (); + +// FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, 0.5, height * 2 + yBorder * 2 + 0.5, height, Allocation.Width - 1, Allocation.Height - height * 2 - yBorder * 2 - 1); +// g.SetSourceColor (Styles.TableLayoutModeBackgroundColor.ToCairoColor ()); +// g.FillPreserve (); +// g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); +// g.Stroke (); + +// g.MoveTo (xSpacer + 0.5, height * 2 + yBorder * 2); +// g.LineTo (xSpacer + 0.5, Allocation.Height - 1); +// g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); +// g.Stroke (); + +// int y = height + yBorder * 2; + +// for (int i = 0; i < Items.Count; i++) { +// KeyValuePair pair = Items [i]; + +// layout.SetMarkup (pair.Key); +// layout.GetPixelSize (out width, out height); + +// if (i == 0) { +// FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, false, false, 0, y + 0.5, height + 1.5, Allocation.Width, height); +// g.SetSourceColor (Styles.TableLayoutModeCategoryBackgroundColor.ToCairoColor ()); +// g.FillPreserve (); +// g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); +// g.Stroke (); + +// g.MoveTo (xSpacer + 0.5, height + yBorder * 2 + 1); +// g.LineTo (xSpacer + 0.5, height * 2 + yBorder * 2 + 1); +// g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); +// g.Stroke (); +// } + +// // gc.RgbFgColor = (HslColor)(i == 0 ? Styles.TableLayoutModeBackgroundColor : Styles.TableLayoutModeTextColor).ToCairoColor (); +// g.Save (); +// g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ()); +// g.Translate (xBorder, y); +// g.ShowLayout (layout); +// g.Restore (); + +// g.Save (); +// g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ()); +// g.Translate (xSpacer + xBorder, y); +// layout.SetMarkup (pair.Value); +// g.ShowLayout (layout); +// g.Restore (); + +// // draw top line +// if (i > 0) { +// g.MoveTo (1, y + 0.5); +// g.LineTo (Allocation.Width - 1, y + 0.5); +// g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); +// g.Stroke (); +// } +// y += height; +// } +// return base.OnDrawn (g); +// } } enum SymbolTokenType { @@ -497,58 +497,58 @@ protected override void OnDestroyed () const int yDescriptionBorder = 8; const int yTitleBorder = 8; - protected override bool OnDrawn (Context g) - { - g.Translate (Allocation.X, Allocation.Y); - g.LineWidth = 1; - titleLayout.SetMarkup (TitleText); - int width, height; - titleLayout.GetPixelSize (out width, out height); - var tw = SupportsAlpha ? triangleWidth : 0; - var th = SupportsAlpha ? triangleHeight : 0; - width += xDescriptionBorder * 2; - - if (SupportsAlpha) { - FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, true, true, tw + 0.5, 0.5, 12, Allocation.Width - 1 - tw, Allocation.Height); - } else { - g.Rectangle (0, 0, Allocation.Width, Allocation.Height); - } - g.SetSourceColor (Styles.InsertionCursorBackgroundColor.ToCairoColor ()); - g.FillPreserve (); - g.SetSourceColor (Styles.InsertionCursorBorderColor.ToCairoColor ()); - g.Stroke (); - - - g.MoveTo (tw + xDescriptionBorder, yTitleBorder); - g.SetSourceColor (Styles.InsertionCursorTitleTextColor.ToCairoColor ()); - g.ShowLayout (titleLayout); - - if (SupportsAlpha) { - g.MoveTo (tw, Allocation.Height / 2 - th / 2); - g.LineTo (0, Allocation.Height / 2); - g.LineTo (tw, Allocation.Height / 2 + th / 2); - g.LineTo (tw + 5, Allocation.Height / 2 + th / 2); - g.LineTo (tw + 5, Allocation.Height / 2 - th / 2); - g.ClosePath (); - g.SetSourceColor (Styles.InsertionCursorBackgroundColor.ToCairoColor ()); - g.Fill (); - - g.MoveTo (tw, Allocation.Height / 2 - th / 2); - g.LineTo (0, Allocation.Height / 2); - g.LineTo (tw, Allocation.Height / 2 + th / 2); - g.SetSourceColor (Styles.InsertionCursorBorderColor.ToCairoColor ()); - g.Stroke (); - } - - int y = height + yTitleBorder + yDescriptionBorder; - int x = tw + xDescriptionBorder; - g.SetSourceColor (Styles.InsertionCursorTextColor.ToCairoColor ()); - - foreach (var desc in descTexts) { - desc.Render (g, x, y + 4); - y += desc.Height + 8; - } - return base.OnDrawn (g); - } + // protected override bool OnDrawn (Context g) + // { + // g.Translate (Allocation.X, Allocation.Y); + // g.LineWidth = 1; + // titleLayout.SetMarkup (TitleText); + // int width, height; + // titleLayout.GetPixelSize (out width, out height); + // var tw = SupportsAlpha ? triangleWidth : 0; + // var th = SupportsAlpha ? triangleHeight : 0; + // width += xDescriptionBorder * 2; + + // if (SupportsAlpha) { + // FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, true, true, tw + 0.5, 0.5, 12, Allocation.Width - 1 - tw, Allocation.Height); + // } else { + // g.Rectangle (0, 0, Allocation.Width, Allocation.Height); + // } + // g.SetSourceColor (Styles.InsertionCursorBackgroundColor.ToCairoColor ()); + // g.FillPreserve (); + // g.SetSourceColor (Styles.InsertionCursorBorderColor.ToCairoColor ()); + // g.Stroke (); + + + // g.MoveTo (tw + xDescriptionBorder, yTitleBorder); + // g.SetSourceColor (Styles.InsertionCursorTitleTextColor.ToCairoColor ()); + // g.ShowLayout (titleLayout); + + // if (SupportsAlpha) { + // g.MoveTo (tw, Allocation.Height / 2 - th / 2); + // g.LineTo (0, Allocation.Height / 2); + // g.LineTo (tw, Allocation.Height / 2 + th / 2); + // g.LineTo (tw + 5, Allocation.Height / 2 + th / 2); + // g.LineTo (tw + 5, Allocation.Height / 2 - th / 2); + // g.ClosePath (); + // g.SetSourceColor (Styles.InsertionCursorBackgroundColor.ToCairoColor ()); + // g.Fill (); + + // g.MoveTo (tw, Allocation.Height / 2 - th / 2); + // g.LineTo (0, Allocation.Height / 2); + // g.LineTo (tw, Allocation.Height / 2 + th / 2); + // g.SetSourceColor (Styles.InsertionCursorBorderColor.ToCairoColor ()); + // g.Stroke (); + // } + + // int y = height + yTitleBorder + yDescriptionBorder; + // int x = tw + xDescriptionBorder; + // g.SetSourceColor (Styles.InsertionCursorTextColor.ToCairoColor ()); + + // foreach (var desc in descTexts) { + // desc.Render (g, x, y + 4); + // y += desc.Height + 8; + // } + // return base.OnDrawn (g); + // } } } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs index 5873275cd85..0fd55e2cbc5 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs @@ -338,21 +338,21 @@ protected virtual bool OnAnimationActorStep (Actor actor) return true; } - protected override bool OnDrawn (Context cr) - { - try { - var alloc = Allocation; - cr.Translate (alloc.X, alloc.Y); - cr.Translate (xExpandedOffset * (1 - scale), yExpandedOffset * (1 - scale)); - var scaleX = (alloc.Width / userspaceArea.Width - 1) * scale + 1; - var scaleY = (alloc.Height / userspaceArea.Height - 1) * scale + 1; - cr.Scale (scaleX, scaleY); - Draw (cr, userspaceArea); - } catch (Exception e) { - LoggingService.LogError ("Exception in animation:", e); - } - return true; - } + // protected override bool OnDrawn (Context cr) + // { + // try { + // var alloc = Allocation; + // cr.Translate (alloc.X, alloc.Y); + // cr.Translate (xExpandedOffset * (1 - scale), yExpandedOffset * (1 - scale)); + // var scaleX = (alloc.Width / userspaceArea.Width - 1) * scale + 1; + // var scaleY = (alloc.Height / userspaceArea.Height - 1) * scale + 1; + // cr.Scale (scaleX, scaleY); + // Draw (cr, userspaceArea); + // } catch (Exception e) { + // LoggingService.LogError ("Exception in animation:", e); + // } + // return true; + // } protected abstract void Draw (Cairo.Context context, Cairo.Rectangle area); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs index 85a96a8ba62..d6f1703f63c 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs @@ -252,26 +252,26 @@ protected override void OnGetPreferredHeight (out int minimum_height, out int na children.ForEach (child => child.Child.SizeRequest ()); } - protected override bool OnDrawn (Context cr) - { - if (BorderVisible) { - cr.LineWidth = 1; + // protected override bool OnDrawn (Context cr) + // { + // if (BorderVisible) { + // cr.LineWidth = 1; - var alloc = Allocation; - int right = alloc.RightInside (); - int bottom = alloc.BottomInside (); + // var alloc = Allocation; + // int right = alloc.RightInside (); + // int bottom = alloc.BottomInside (); - cr.SharpLineX (alloc.X, alloc.Y, alloc.X, bottom); - cr.SharpLineX (right, alloc.Y, right, bottom); + // cr.SharpLineX (alloc.X, alloc.Y, alloc.X, bottom); + // cr.SharpLineX (right, alloc.Y, right, bottom); - cr.SharpLineY (alloc.X, alloc.Y, right, alloc.Y); - cr.SharpLineY (alloc.X, bottom, right, bottom); + // cr.SharpLineY (alloc.X, alloc.Y, right, alloc.Y); + // cr.SharpLineY (alloc.X, bottom, right, bottom); - cr.SetSourceColor ((HslColor)Style.Dark (State)); - cr.Stroke (); - } - return base.OnDrawn (cr); - } + // cr.SetSourceColor ((HslColor)Style.Dark (State)); + // cr.Stroke (); + // } + // return base.OnDrawn (cr); + // } } } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodePreviewWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodePreviewWindow.cs index 2d9f5e366e2..f518e6712d8 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodePreviewWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodePreviewWindow.cs @@ -73,9 +73,9 @@ public CodePreviewWindow ( } layout.Ellipsize = Pango.EllipsizeMode.End; - var geometry = Screen.GetUsableMonitorGeometry (Screen.GetMonitorAtWindow (ParentWindow)); - maxWidth = geometry.Width * 2 / 5; - maxHeight = geometry.Height * 2 / 5; + // var geometry = Screen.GetUsableMonitorGeometry (Screen.GetMonitorAtWindow (ParentWindow)); + // maxWidth = geometry.Width * 2 / 5; + // maxHeight = geometry.Height * 2 / 5; layout.SetText ("n"); layout.GetPixelSize (out int _, out int lineHeight); @@ -167,16 +167,16 @@ protected override void OnDestroyed () base.OnDestroyed (); } - protected override bool OnExposeEvent (EventExpose evnt) - { - using (var cr = CairoHelper.Create (GdkWindow)) { - CairoHelper.Region (cr, evnt.Region); - cr.Clip (); - cr.Translate (Allocation.X, Allocation.Y); - Draw (cr); - } - return true; - } + // protected override bool OnExposeEvent (EventExpose evnt) + // { + // using (var cr = CairoHelper.Create (GdkWindow)) { + // CairoHelper.Region (cr, evnt.Region); + // cr.Clip (); + // cr.Translate (Allocation.X, Allocation.Y); + // Draw (cr); + // } + // return true; + // } void Draw (Cairo.Context cr) { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs index ea6157fccec..f98d97d8492 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs @@ -72,10 +72,10 @@ public void SetSegment (ISegment segment, bool removeIndent) protected override void OnDestroyed () { - layout = layout.Kill (); - informLayout = informLayout.Kill (); - fontDescription = fontDescription.Kill (); - fontInform = fontInform.Kill (); + //layout = layout.Kill (); + //informLayout = informLayout.Kill (); + //fontDescription = fontDescription.Kill (); + //fontInform = fontInform.Kill (); // if (textGC != null) { // textGC.Dispose (); // textBgGC.Dispose (); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs index 05c87c60a24..6dc57819c8d 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs @@ -2329,20 +2329,20 @@ void UpdateAdjustments () DateTime started = DateTime.Now; #endif Stopwatch timingsWatch = new Stopwatch (); - protected override bool OnDrawn (Context cr) - { - if (this.isDisposed) - return false; - -// try { -// ExposeEventInternal (e); -// } catch (Exception ex) { -// GLib.ExceptionManager.RaiseUnhandledException (ex, false); -// } - - keyPressTimings.EndTimer (true); - return base.OnDrawn (cr); - } +// protected override bool OnDrawn (Context cr) +// { +// if (this.isDisposed) +// return false; + +// // try { +// // ExposeEventInternal (e); +// // } catch (Exception ex) { +// // GLib.ExceptionManager.RaiseUnhandledException (ex, false); +// // } + +// keyPressTimings.EndTimer (true); +// return base.OnDrawn (cr); +// } void ExposeEventInternal (Gdk.EventExpose e) { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs index f42aefda63c..65676c550ea 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs @@ -937,69 +937,69 @@ void DrawSearchResults (Cairo.Context cr, IndicatorDrawingState state, int i) } IndicatorDrawingState currentDrawingState = IndicatorDrawingState.Create (); SurfaceWrapper backgroundSurface, indicatorSurface, swapIndicatorSurface; - protected override bool OnDrawn (Cairo.Context cr) - { - if (TextEditor == null) - return true; - - cr.Save (); - var allocation = Allocation; - var displayScale = Core.Platform.IsMac ? GtkWorkarounds.GetScaleFactor (this) : 1.0; - cr.Scale (1 / displayScale, 1 / displayScale); - if (indicatorSurface != null) { - cr.SetSourceSurface (indicatorSurface.Surface, 0, 0); - cr.Paint (); - } else { - CachedDraw (cr, - ref backgroundSurface, - allocation, - draw: (c, o) => DrawBackground (c, allocation), forceScale: displayScale); - } - if (TextEditor == null) - return true; - - cr.Save (); - var allocation = Allocation; - var displayScale = Core.Platform.IsMac ? GtkWorkarounds.GetScaleFactor (this) : 1.0; - cr.Scale (1 / displayScale, 1 / displayScale); - if (indicatorSurface != null) { - cr.SetSourceSurface (indicatorSurface.Surface, 0, 0); - cr.Paint (); - } else { - CachedDraw (cr, - ref backgroundSurface, - e.Area, - draw: (c, o) => DrawBackground (c, allocation), forceScale: displayScale); - } - if (TextEditor == null) - return true; - - DrawCaret (cr); - - if (QuickTaskStrip.MergeScrollBarAndQuickTasks) - DrawBar (cr); - - cr.Restore (); - if (HasFocus) { - switch (currentFocus) { - case FocusWidget.Indicator: - cr.LineWidth = 1.0; - - cr.SetSourceColor (Styles.FocusColor.ToCairoColor ()); - cr.Rectangle (1, 1, Allocation.Width - 2, Allocation.Width - 2); - cr.SetDash (new double [] { 1, 1 }, 0.5); - cr.Stroke (); - break; - - case FocusWidget.Tasks: - break; - - case FocusWidget.Usages: - break; - } - } - return false; - } + // protected override bool OnDrawn (Cairo.Context cr) + // { + // if (TextEditor == null) + // return true; + + // cr.Save (); + // var allocation = Allocation; + // var displayScale = Core.Platform.IsMac ? GtkWorkarounds.GetScaleFactor (this) : 1.0; + // cr.Scale (1 / displayScale, 1 / displayScale); + // if (indicatorSurface != null) { + // cr.SetSourceSurface (indicatorSurface.Surface, 0, 0); + // cr.Paint (); + // } else { + // CachedDraw (cr, + // ref backgroundSurface, + // allocation, + // draw: (c, o) => DrawBackground (c, allocation), forceScale: displayScale); + // } + // if (TextEditor == null) + // return true; + + // cr.Save (); + // var allocation = Allocation; + // var displayScale = Core.Platform.IsMac ? GtkWorkarounds.GetScaleFactor (this) : 1.0; + // cr.Scale (1 / displayScale, 1 / displayScale); + // if (indicatorSurface != null) { + // cr.SetSourceSurface (indicatorSurface.Surface, 0, 0); + // cr.Paint (); + // } else { + // CachedDraw (cr, + // ref backgroundSurface, + // e.Area, + // draw: (c, o) => DrawBackground (c, allocation), forceScale: displayScale); + // } + // if (TextEditor == null) + // return true; + + // DrawCaret (cr); + + // if (QuickTaskStrip.MergeScrollBarAndQuickTasks) + // DrawBar (cr); + + // cr.Restore (); + // if (HasFocus) { + // switch (currentFocus) { + // case FocusWidget.Indicator: + // cr.LineWidth = 1.0; + + // cr.SetSourceColor (Styles.FocusColor.ToCairoColor ()); + // cr.Rectangle (1, 1, Allocation.Width - 2, Allocation.Width - 2); + // cr.SetDash (new double [] { 1, 1 }, 0.5); + // cr.Stroke (); + // break; + + // case FocusWidget.Tasks: + // break; + + // case FocusWidget.Usages: + // break; + // } + // } + // return false; + // } CancellationTokenSource src; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs index d85d6d2db1d..2c63dac0a27 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs @@ -157,10 +157,10 @@ public void Dispose () lastItem = null; } - public override bool TryCloseTooltipWindow (Xwt.WindowFrame tipWindow, Ide.Editor.TooltipCloseReason reason) - { - return provider.TryCloseTooltipWindow (tipWindow, reason); - } + // public override bool TryCloseTooltipWindow (Xwt.WindowFrame tipWindow, Ide.Editor.TooltipCloseReason reason) + // { + // return provider.TryCloseTooltipWindow (tipWindow, reason); + // } #endregion } } \ No newline at end of file diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj index 274782dac28..cbc58cb159b 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj @@ -70,7 +70,7 @@ - + {C3887A93-B2BD-4097-8E2F-3A063EFF32FD} Xwt.Gtk2 @@ -82,6 +82,12 @@ + + gtk-sharp-3.0 + + + gio-sharp-3.0 + diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs index 41e44a6fae4..a61835203cb 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs @@ -161,48 +161,48 @@ protected override bool OnEnterNotifyEvent (Gdk.EventCrossing evnt) return base.OnEnterNotifyEvent (evnt); } - protected override void OnDrawContent (Gdk.EventExpose evnt, Cairo.Context g) - { - g.Rectangle (0, 0, Allocation.Width, Allocation.Height); - g.SetSourceColor (marker.TooltipColor); - g.Fill (); + // protected override void OnDrawContent (Gdk.EventExpose evnt, Cairo.Context g) + // { + // g.Rectangle (0, 0, Allocation.Width, Allocation.Height); + // g.SetSourceColor (marker.TooltipColor); + // g.Fill (); - using (var drawingLayout = new Pango.Layout (this.PangoContext)) { - drawingLayout.FontDescription = cache.tooltipFontDescription; + // using (var drawingLayout = new Pango.Layout (this.PangoContext)) { + // drawingLayout.FontDescription = cache.tooltipFontDescription; - double y = verticalTextBorder; - var showBulletedList = marker.Errors.Count > 1; + // double y = verticalTextBorder; + // var showBulletedList = marker.Errors.Count > 1; - foreach (var msg in marker.Errors) { - var icon = msg.IsError ? errorPixbuf : warningPixbuf; - int w, h; + // foreach (var msg in marker.Errors) { + // var icon = msg.IsError ? errorPixbuf : warningPixbuf; + // int w, h; - if (!showBulletedList) - drawingLayout.Width = maxTextWidth; + // if (!showBulletedList) + // drawingLayout.Width = maxTextWidth; - drawingLayout.SetText (msg.FullErrorMessage); - drawingLayout.GetPixelSize (out w, out h); + // drawingLayout.SetText (msg.FullErrorMessage); + // drawingLayout.GetPixelSize (out w, out h); - if (showBulletedList) { - g.Save (); + // if (showBulletedList) { + // g.Save (); - g.Translate (textBorder, y + verticalTextSpace / 2 + Math.Max (0, (h - icon.Height) / 2)); - g.DrawImage (this, icon, 0, 0); - g.Restore (); - } + // g.Translate (textBorder, y + verticalTextSpace / 2 + Math.Max (0, (h - icon.Height) / 2)); + // g.DrawImage (this, icon, 0, 0); + // g.Restore (); + // } - g.Save (); + // g.Save (); - g.Translate (showBulletedList ? textBorder + iconTextSpacing + icon.Width: textBorder, y + verticalTextSpace / 2); - g.SetSourceColor (marker.TagColor2); - g.ShowLayout (drawingLayout); + // g.Translate (showBulletedList ? textBorder + iconTextSpacing + icon.Width: textBorder, y + verticalTextSpace / 2); + // g.SetSourceColor (marker.TagColor2); + // g.ShowLayout (drawingLayout); - g.Restore (); + // g.Restore (); - y += h + verticalTextSpace; - } - } - } + // y += h + verticalTextSpace; + // } + // } + // } } public void StartHover (MessageBubbleTextMarker marker, double bubbleX, double bubbleY, double bubbleWidth, bool isReduced) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/VSEditor/Language/Impl/Intellisense/SignatureHelp/DefaultSignatureHelpPresenterSurfaceElement.cs b/main/src/addins/MonoDevelop.SourceEditor2/VSEditor/Language/Impl/Intellisense/SignatureHelp/DefaultSignatureHelpPresenterSurfaceElement.cs index 31dd15adcf8..4f666740745 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/VSEditor/Language/Impl/Intellisense/SignatureHelp/DefaultSignatureHelpPresenterSurfaceElement.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/VSEditor/Language/Impl/Intellisense/SignatureHelp/DefaultSignatureHelpPresenterSurfaceElement.cs @@ -86,7 +86,7 @@ void UpdateStyle() if (!scheme.FitsIdeTheme(IdeApp.Preferences.UserInterfaceTheme)) scheme = SyntaxHighlightingService.GetDefaultColorStyle(IdeApp.Preferences.UserInterfaceTheme); Theme.SetSchemeColors(scheme); - Theme.Font = IdeServices.FontService.SansFont.CopyModified(Styles.FontScale11).ToXwtFont(); + //Theme.Font = IdeServices.FontService.SansFont.CopyModified(Styles.FontScale11).ToXwtFont(); Theme.ShadowColor = Styles.PopoverWindow.ShadowColor; foreColor = Styles.PopoverWindow.DefaultTextColor.ToCairoColor(); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/VSEditor/MDUtils.cs b/main/src/addins/MonoDevelop.SourceEditor2/VSEditor/MDUtils.cs index 5a70528b2d6..69281479004 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/VSEditor/MDUtils.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/VSEditor/MDUtils.cs @@ -9,7 +9,7 @@ using MonoDevelop.Ide; using MonoDevelop.Ide.Editor; using MonoDevelop.Ide.Editor.Highlighting; -using MonoDevelop.Ide.Fonts; +using MonoDevelop.Ide.Fonts; using MonoDevelop.Ide.TypeSystem; namespace Microsoft.VisualStudio.Language.Intellisense.Implementation @@ -24,69 +24,69 @@ public static string ClassificationsToMarkup (ITextSnapshot snapshot, IList"); + //markup.Append (""); markup.AppendLine (); - } - else { - markup.Append (""); + } + else { + markup.Append (""); + } + } + + if (locus is Span locusSpan && part.Span.Intersection (locusSpan) is SnapshotSpan intersection) { + if (intersection.Start == part.Span.Start) { + if (intersection.End == part.Span.End) { + markup.Append (""); + markup.Append (Ambience.EscapeText (snapshot.GetText (part.Span))); + markup.Append (""); + } + else { + markup.Append (""); + markup.Append (Ambience.EscapeText (snapshot.GetText (intersection))); + markup.Append (""); + markup.Append (Ambience.EscapeText (snapshot.GetText (intersection.End, part.Span.End - intersection.End))); + } + } + else { + if (intersection.End == part.Span.End) { + markup.Append (Ambience.EscapeText (snapshot.GetText (part.Span.Start, intersection.Start - part.Span.Start))); + markup.Append (""); + markup.Append (Ambience.EscapeText (snapshot.GetText (intersection))); + markup.Append (""); + } + else { + markup.Append (Ambience.EscapeText (snapshot.GetText (part.Span.Start, intersection.Start - part.Span.Start))); + markup.Append (""); + markup.Append (Ambience.EscapeText (snapshot.GetText (intersection))); + markup.Append (""); + markup.Append (Ambience.EscapeText (snapshot.GetText (intersection.End, part.Span.End - intersection.End))); + } } } - - if (locus is Span locusSpan && part.Span.Intersection (locusSpan) is SnapshotSpan intersection) { - if (intersection.Start == part.Span.Start) { - if (intersection.End == part.Span.End) { - markup.Append (""); - markup.Append (Ambience.EscapeText (snapshot.GetText (part.Span))); - markup.Append (""); - } - else { - markup.Append (""); - markup.Append (Ambience.EscapeText (snapshot.GetText (intersection))); - markup.Append (""); - markup.Append (Ambience.EscapeText (snapshot.GetText (intersection.End, part.Span.End - intersection.End))); - } - } - else { - if (intersection.End == part.Span.End) { - markup.Append (Ambience.EscapeText (snapshot.GetText (part.Span.Start, intersection.Start - part.Span.Start))); - markup.Append (""); - markup.Append (Ambience.EscapeText (snapshot.GetText (intersection))); - markup.Append (""); - } - else { - markup.Append (Ambience.EscapeText (snapshot.GetText (part.Span.Start, intersection.Start - part.Span.Start))); - markup.Append (""); - markup.Append (Ambience.EscapeText (snapshot.GetText (intersection))); - markup.Append (""); - markup.Append (Ambience.EscapeText (snapshot.GetText (intersection.End, part.Span.End - intersection.End))); - } - } - } else { - if (inDocumentation) { - AppendAndBreakText (markup, snapshot.GetText (part.Span), 0, MaxParamColumnCount); - } else { + if (inDocumentation) { + AppendAndBreakText (markup, snapshot.GetText (part.Span), 0, MaxParamColumnCount); + } else { markup.Append(Ambience.EscapeText (snapshot.GetText (part.Span))); - } + } } - if (!inDocumentation) - markup.Append (""); - } + if (!inDocumentation) + markup.Append (""); + } if (inDocumentation) markup.Append (""); - + if (currentParameter != null) { if (!string.IsNullOrEmpty(currentParameter.Documentation)) { - markup.Append (""); + //markup.Append (" size='small'>"); markup.AppendLine (); markup.AppendLine (); markup.Append (""); @@ -123,9 +123,9 @@ private static void AppendSpan (ITextSnapshot snapshot, StringBuilder markup, Ed markup.Append (""); } - static string GetThemeColor (EditorTheme theme, string scope) - { - return SyntaxHighlightingService.GetColorFromScope (theme, scope, EditorThemeColors.Foreground).ToPangoString (); + static string GetThemeColor (EditorTheme theme, string scope) + { + return SyntaxHighlightingService.GetColorFromScope (theme, scope, EditorThemeColors.Foreground).ToPangoString (); } static string GetThemeColor (string type) diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj index 83605bad3ec..11d82b56e9a 100644 --- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj +++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj @@ -19,6 +19,8 @@ + + diff --git a/main/src/addins/Xml/MonoDevelop.Xml.csproj b/main/src/addins/Xml/MonoDevelop.Xml.csproj index 0be0e468629..f6091e766a3 100644 --- a/main/src/addins/Xml/MonoDevelop.Xml.csproj +++ b/main/src/addins/Xml/MonoDevelop.Xml.csproj @@ -21,6 +21,12 @@ + + glib-sharp-3.0 + + + gio-sharp-3.0 + diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs index 7ebefad6146..9af00c02df1 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs @@ -131,7 +131,7 @@ public static void Initialize (bool updateAddinRegistry) WebRequestHelper.Initialize (); Web.HttpClientProvider.Initialize (); - Mono.Addins.Setup.HttpClientProvider.SetHttpClientFactory (Web.HttpClientProvider.CreateHttpClient); + //Mono.Addins.Setup.HttpClientProvider.SetHttpClientFactory (Web.HttpClientProvider.CreateHttpClient); //have to do this after the addin service and property service have initialized if (UserDataMigrationService.HasSource) { @@ -448,19 +448,19 @@ public static void AssertMainThread () { if (!IsMainThread) throw new InvalidOperationException ("Operation not supported in background thread"); - } - + } + /// /// Asserts that the current thread is the main thread. It will log a warning if it isn't. /// public static void CheckMainThread () { if (IsMainThread) { - return; + return; } - if (System.Diagnostics.Debugger.IsAttached) { - System.Diagnostics.Debugger.Break (); + if (System.Diagnostics.Debugger.IsAttached) { + System.Diagnostics.Debugger.Break (); } LoggingService.LogWarning ("Operation not supported in background thread. Location: " + Environment.StackTrace); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs index 268ee796335..0a9e69de397 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs @@ -97,12 +97,12 @@ protected virtual void Build() label.LabelProp = global::Mono.Unix.Catalog.GetString("Log _verbosity:"); label.UseUnderline = true; logContainer.PackStart (label, false, false, 6); - this.verbosityCombo = global::Gtk.ComboBox.NewText (); - this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Quiet")); - this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Minimal")); - this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Normal")); - this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Detailed")); - this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Diagnostic")); + //this.verbosityCombo = global::Gtk.ComboBox.NewText (); + //this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Quiet")); + //this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Minimal")); + //this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Normal")); + //this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Detailed")); + //this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Diagnostic")); this.verbosityCombo.Name = "verbosityCombo"; this.verbosityCombo.Active = 2; logContainer.PackStart (this.verbosityCombo, false, false, 6); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs index 8857b37527b..9c6aaec9097 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs @@ -769,7 +769,7 @@ int MeasureTicksSize (TickEnumerator e, AxisDimension ad) { int max = 0; Pango.Layout layout = new Pango.Layout (this.PangoContext); - layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); + //layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); double start = GetStart (ad); double end = GetEnd (ad); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs index dbf883f8c76..8e911e2c4d1 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs @@ -1269,7 +1269,7 @@ static void DrawTabBackground (Widget widget, Context ctx, Gdk.Rectangle allocat Pango.Layout CreateSizedLayout (bool active) { var la = new Pango.Layout (PangoContext); - la.FontDescription = IdeServices.FontService.SansFont.Copy (); + //la.FontDescription = IdeServices.FontService.SansFont.Copy (); if (!Core.Platform.IsWindows) la.FontDescription.Weight = Pango.Weight.Bold; la.FontDescription.AbsoluteSize = Pango.Units.FromPixels (VerticalTextSize); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs index 78c781341e0..c2f19f5e7f4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs @@ -124,8 +124,8 @@ internal DockBarItem AddItem (DockItem item, int size) box.PackStart (it, false, false, 0); it.ShowAll (); UpdateVisibility (); - it.Shown += OnItemVisibilityChanged; - it.Hidden += OnItemVisibilityChanged; + //it.Shown += OnItemVisibilityChanged; + //it.Hidden += OnItemVisibilityChanged; return it; } @@ -166,8 +166,8 @@ internal void RemoveItem (DockBarItem it) { DisableHoverActivation (); box.Remove (it); - it.Shown -= OnItemVisibilityChanged; - it.Hidden -= OnItemVisibilityChanged; + //it.Shown -= OnItemVisibilityChanged; + //it.Hidden -= OnItemVisibilityChanged; UpdateVisibility (); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs index 4c4209e42fe..39863fbdb40 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs @@ -261,7 +261,7 @@ public void UpdateTab () label = new Label (it.Label); label.Accessible.SetShouldIgnore (true); label.UseMarkup = true; - label.ModifyFont (IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11)); + //label.ModifyFont (IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11)); if (bar.Orientation == Orientation.Vertical) label.Angle = 270; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs index 9227e3ab3b7..23de71b53d8 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs @@ -195,10 +195,10 @@ void UpdateVisualStyle () } if (IsRealized && labelWidget?.Visible == true) { - var font = IdeServices.FontService.SansFont.CopyModified (null, Pango.Weight.Bold); - font.AbsoluteSize = Pango.Units.FromPixels (11); - labelWidget.ModifyFont (font); - labelWidget.ModifyText (StateType.Normal, (active ? visualStyle.PadTitleLabelColor.Value : visualStyle.InactivePadTitleLabelColor.Value).ToGdkColor ()); + //var font = IdeServices.FontService.SansFont.CopyModified (null, Pango.Weight.Bold); + //font.AbsoluteSize = Pango.Units.FromPixels (11); + //labelWidget.ModifyFont (font); + //labelWidget.ModifyText (StateType.Normal, (active ? visualStyle.PadTitleLabelColor.Value : visualStyle.InactivePadTitleLabelColor.Value).ToGdkColor ()); } var r = WidthRequest; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs index 41666ad57ce..4a2b83ddfea 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs @@ -327,17 +327,17 @@ public Widget CreateBuildResultsWidget (Orientation orientation) } - using (var font = IdeServices.FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11)) { - errors.Visible = ec > 0; - errors.ModifyFont (font); - errors.Text = ec.ToString (); - errorImage.Visible = ec > 0; - - warnings.Visible = wc > 0; - warnings.ModifyFont (font); - warnings.Text = wc.ToString (); - warningImage.Visible = wc > 0; - } + // using (var font = IdeServices.FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11)) { + // errors.Visible = ec > 0; + // errors.ModifyFont (font); + // errors.Text = ec.ToString (); + // errorImage.Visible = ec > 0; + + // warnings.Visible = wc > 0; + // warnings.ModifyFont (font); + // warnings.Text = wc.ToString (); + // warningImage.Visible = wc > 0; + // } ebox.Visible = ec > 0 || wc > 0; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs index 5ae01c7fa97..ede44aba41c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs @@ -324,35 +324,35 @@ void EndTransaction (object obj, DesignerTransaction tran, object oldValue, obje //This and EndTransaction are from Mono internal class System.ComponentModel.ReflectionPropertyDescriptor // Lluis Sanchez Gual (lluis@ximian.com), (C) Novell, Inc, MIT X11 license - DesignerTransaction CreateTransaction (object obj) - { - IComponent com = obj as IComponent; - if (com == null || com.Site == null) return null; - - IDesignerHost dh = (IDesignerHost) com.Site.GetService (typeof(IDesignerHost)); - if (dh == null) return null; - - DesignerTransaction tran = dh.CreateTransaction (); - IComponentChangeService ccs = (IComponentChangeService) com.Site.GetService (typeof(IComponentChangeService)); - if (ccs != null) - ccs.OnComponentChanging (com, Property); - return tran; - } - - void EndTransaction (object obj, DesignerTransaction tran, object oldValue, object newValue, bool commit) - { - if (tran == null) return; - - if (commit) { - IComponent com = obj as IComponent; - IComponentChangeService ccs = (IComponentChangeService) com.Site.GetService (typeof(IComponentChangeService)); - if (ccs != null) - ccs.OnComponentChanged (com, Property, oldValue, newValue); - tran.Commit (); - } - else - tran.Cancel (); - } + // DesignerTransaction CreateTransaction (object obj) + // { + // IComponent com = obj as IComponent; + // if (com == null || com.Site == null) return null; + + // IDesignerHost dh = (IDesignerHost) com.Site.GetService (typeof(IDesignerHost)); + // if (dh == null) return null; + + // DesignerTransaction tran = dh.CreateTransaction (); + // IComponentChangeService ccs = (IComponentChangeService) com.Site.GetService (typeof(IComponentChangeService)); + // if (ccs != null) + // ccs.OnComponentChanging (com, Property); + // return tran; + // } + + // void EndTransaction (object obj, DesignerTransaction tran, object oldValue, object newValue, bool commit) + // { + // if (tran == null) return; + + // if (commit) { + // IComponent com = obj as IComponent; + // IComponentChangeService ccs = (IComponentChangeService) com.Site.GetService (typeof(IComponentChangeService)); + // if (ccs != null) + // ccs.OnComponentChanged (com, Property, oldValue, newValue); + // tran.Commit (); + // } + // else + // tran.Cancel (); + // } static void UpdateIndices (ListStore itemStore) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs index 0a09584c419..d06ede4f604 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs @@ -73,7 +73,7 @@ internal void Initialize (Widget container, EditorManager editorManager, ITypeDe } layout = new Pango.Layout (container.PangoContext); layout.Width = -1; - layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); + //layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); this.context = context; Initialize (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs index d74dfce4795..cfee0ca2d5d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs @@ -4,7 +4,7 @@ * * Authors: * Michael Hutchinson - * Eric Butler + * Eric Butler * Lluis Sanchez Gual * * Copyright (C) 2005 Michael Hutchinson @@ -32,35 +32,35 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -using System; -using System.IO; -using System.Collections; -using System.ComponentModel; - -using Gtk; -using Gdk; -using MonoDevelop.Core; + +using System; +using System.IO; +using System.Collections; +using System.ComponentModel; + +using Gtk; +using Gdk; +using MonoDevelop.Core; using MonoDevelop.Components.PropertyGrid.PropertyEditors; using System.Collections.Generic; using System.Linq; -using MonoDevelop.Ide.Fonts; -using MonoDevelop.Ide; - -namespace MonoDevelop.Components.PropertyGrid -{ +using MonoDevelop.Ide.Fonts; +using MonoDevelop.Ide; + +namespace MonoDevelop.Components.PropertyGrid +{ [System.ComponentModel.Category("MonoDevelop.Components")] [System.ComponentModel.ToolboxItem(true)] - public class PropertyGrid: Gtk.VBox, IPropertyGrid - { - object currentObject; + public class PropertyGrid: Gtk.VBox, IPropertyGrid + { + object currentObject; object[] propertyProviders; PropertyGridTable tree; HSeparator helpSeparator; HSeparator toolbarSeparator; - VPaned vpaned; - + VPaned vpaned; + IToolbarProvider toolbar; RadioButton catButton; RadioButton alphButton; @@ -68,24 +68,24 @@ public class PropertyGrid: Gtk.VBox, IPropertyGrid string descTitle, descText; Label descTitleLabel; TextView descTextView; - Gtk.Widget descFrame; - + Gtk.Widget descFrame; + EditorManager editorManager; - + PropertySort propertySort = PropertySort.Categorized; const string PROP_HELP_KEY = "MonoDevelop.PropertyPad.ShowHelp"; - - public Widget Widget => this; - + + public Widget Widget => this; + public PropertyGrid (): this (new EditorManager ()) { } - internal PropertyGrid (EditorManager editorManager) - { - this.editorManager = editorManager; - + internal PropertyGrid (EditorManager editorManager) + { + this.editorManager = editorManager; + #region Toolbar PropertyGridToolbar tb = new PropertyGridToolbar (); @@ -93,34 +93,34 @@ internal PropertyGrid (EditorManager editorManager) toolbar = tb; catButton = new RadioButton ((Gtk.RadioButton)null); - catButton.Name = "MonoDevelop.PropertyGridToolbar.GtkRadioButton"; + catButton.Name = "MonoDevelop.PropertyGridToolbar.GtkRadioButton"; catButton.DrawIndicator = false; catButton.Relief = ReliefStyle.None; catButton.Image = new ImageView (MonoDevelop.Ide.Gui.Stock.GroupByCategory, IconSize.Menu); catButton.Image.Show (); catButton.TooltipText = GettextCatalog.GetString ("Sort in categories"); catButton.Toggled += new EventHandler (toolbarClick); - toolbar.Insert (catButton, 0); - + toolbar.Insert (catButton, 0); + alphButton = new RadioButton (catButton); alphButton.Name = "MonoDevelop.PropertyGridToolbar.GtkRadioButton"; alphButton.DrawIndicator = false; alphButton.Relief = ReliefStyle.None; alphButton.Image = new ImageView (MonoDevelop.Ide.Gui.Stock.SortAlphabetically, IconSize.Menu); - alphButton.Image.Show (); + alphButton.Image.Show (); alphButton.TooltipText = GettextCatalog.GetString ("Sort alphabetically"); alphButton.Clicked += new EventHandler (toolbarClick); - toolbar.Insert (alphButton, 1); - + toolbar.Insert (alphButton, 1); + catButton.Active = true; #endregion vpaned = new VPaned (); - tree = new PropertyGridTable (editorManager, this); - tree.Changed += delegate { - Update (); + tree = new PropertyGridTable (editorManager, this); + tree.Changed += delegate { + Update (); }; CompactScrolledWindow sw = new CompactScrolledWindow (); @@ -138,9 +138,9 @@ internal PropertyGrid (EditorManager editorManager) helpSeparator = new HSeparator (); tbox.PackStart (helpSeparator, false, false, 0); helpSeparator.NoShowAll = true; - vpaned.Pack1 (tbox, true, true); - - AddPropertyTab (new DefaultPropertyTab ()); + vpaned.Pack1 (tbox, true, true); + + AddPropertyTab (new DefaultPropertyTab ()); AddPropertyTab (new EventPropertyTab ()); base.PackEnd (vpaned, false, true, 0); @@ -166,38 +166,38 @@ public void SetToolbarProvider (IToolbarProvider toolbarProvider) toolbarSeparator.Hide (); toolbar = toolbarProvider; UpdateTabs (); - } - - public event EventHandler Changed { - add { tree.Changed += value; } - remove { tree.Changed -= value; } - } - + } + + public event EventHandler Changed { + add { tree.Changed += value; } + remove { tree.Changed -= value; } + } + internal EditorManager EditorManager { get { return editorManager; } - } - - #region Toolbar state and handlers - - private const int FirstTabIndex = 3; - + } + + #region Toolbar state and handlers + + private const int FirstTabIndex = 3; + void toolbarClick (object sender, EventArgs e) { if (sender == alphButton) PropertySort = PropertySort.Alphabetical; else if (sender == catButton) - PropertySort = PropertySort.Categorized; - else { - TabRadioToolButton button = (TabRadioToolButton) sender; - if (selectedTab == button.Tab) return; - selectedTab = button.Tab; - Populate (saveEditSession: true); + PropertySort = PropertySort.Categorized; + else { + TabRadioToolButton button = (TabRadioToolButton) sender; + if (selectedTab == button.Tab) return; + selectedTab = button.Tab; + Populate (saveEditSession: true); } // If the tree is re-populated while a value is being edited, the focus that the value editor had // is not returned back to the tree. We need to explicitly get it. tree.GrabFocus (); - } - + } + public PropertySort PropertySort { get { return propertySort; } set { @@ -206,64 +206,64 @@ public PropertySort PropertySort { Populate (saveEditSession: true); } } - } - - ArrayList propertyTabs = new ArrayList (); - PropertyTab selectedTab; - - public PropertyTab SelectedTab { - get { return selectedTab; } + } + + ArrayList propertyTabs = new ArrayList (); + PropertyTab selectedTab; + + public PropertyTab SelectedTab { + get { return selectedTab; } } TabRadioToolButton firstTab; - SeparatorToolItem tabSectionSeparator; - - private void AddPropertyTab (PropertyTab tab) - { - TabRadioToolButton rtb; - if (propertyTabs.Count == 0) { - selectedTab = tab; + SeparatorToolItem tabSectionSeparator; + + private void AddPropertyTab (PropertyTab tab) + { + TabRadioToolButton rtb; + if (propertyTabs.Count == 0) { + selectedTab = tab; rtb = new TabRadioToolButton (null); rtb.Active = true; firstTab = rtb; - toolbar.Insert (tabSectionSeparator = new SeparatorToolItem (), FirstTabIndex - 1); - } - else - rtb = new TabRadioToolButton (firstTab); - + toolbar.Insert (tabSectionSeparator = new SeparatorToolItem (), FirstTabIndex - 1); + } + else + rtb = new TabRadioToolButton (firstTab); + //load image from PropertyTab's bitmap var icon = tab.GetIcon (); - if (icon != null) + if (icon != null) rtb.Image = new ImageView (icon); else - rtb.Image = new ImageView (MonoDevelop.Ide.ImageService.GetIcon (Stock.MissingImage, IconSize.Menu)); - + rtb.Image = new ImageView (MonoDevelop.Ide.ImageService.GetIcon (Stock.MissingImage, IconSize.Menu)); + rtb.Tab = tab; rtb.TooltipText = tab.TabName; - rtb.Toggled += new EventHandler (toolbarClick); - - toolbar.Insert (rtb, propertyTabs.Count + FirstTabIndex); - - propertyTabs.Add(tab); - } - - #endregion - + rtb.Toggled += new EventHandler (toolbarClick); + + toolbar.Insert (rtb, propertyTabs.Count + FirstTabIndex); + + propertyTabs.Add(tab); + } + + #endregion + public object CurrentObject { get { return currentObject; } set { SetCurrentObject (value, new object[] {value}); } - } - - public void SetCurrentObject (object obj, object[] propertyProviders) - { + } + + public void SetCurrentObject (object obj, object[] propertyProviders) + { if (this.currentObject == obj) return; if (this.propertyProviders != null) { foreach (var old in this.propertyProviders.OfType ()) old.Dispose (); } - this.currentObject = obj; - this.propertyProviders = propertyProviders; + this.currentObject = obj; + this.propertyProviders = propertyProviders; UpdateTabs (); Populate(saveEditSession: false); } @@ -271,67 +271,67 @@ public void SetCurrentObject (object obj, object[] propertyProviders) public void CommitPendingChanges () { tree.CommitChanges (); - } - - void UpdateTabs () + } + + void UpdateTabs () { - bool visible = currentObject != null && toolbar.Children.OfType ().Count (but => but.Tab.CanExtend (currentObject)) > 1; + bool visible = currentObject != null && toolbar.Children.OfType ().Count (but => but.Tab.CanExtend (currentObject)) > 1; foreach (var w in toolbar.Children.OfType ()) w.Visible = visible; if (tabSectionSeparator != null) tabSectionSeparator.Visible = visible; - } - + } + //TODO: add more intelligence for editing state etc. Maybe need to know which property has changed, then - //just update that - public void Refresh () + //just update that + public void Refresh () { - Update (); - QueueDraw (); + Update (); + QueueDraw (); } - public bool IsEditing { - get { return tree.IsEditing; } + public bool IsEditing { + get { return tree.IsEditing; } } - - public void Populate (bool saveEditSession) - { - PropertyDescriptorCollection properties; - + + public void Populate (bool saveEditSession) + { + PropertyDescriptorCollection properties; + tree.SaveStatus (); if (saveEditSession) tree.SaveEditSession (); - tree.Clear (); - tree.PropertySort = propertySort; - + tree.Clear (); + tree.PropertySort = propertySort; + if (currentObject == null) { - properties = new PropertyDescriptorCollection (new PropertyDescriptor[0] {}); - tree.Populate (properties, currentObject); - } - else { - foreach (object prov in propertyProviders) { + properties = new PropertyDescriptorCollection (new PropertyDescriptor[0] {}); + tree.Populate (properties, currentObject); + } + else { + foreach (object prov in propertyProviders) { properties = selectedTab.GetProperties (prov); - tree.Populate (properties, prov); - } + tree.Populate (properties, prov); + } } tree.RestoreStatus (); tree.RestoreEditSession (); } - void Update () - { - PropertyDescriptorCollection properties; - + void Update () + { + PropertyDescriptorCollection properties; + if (currentObject == null) { - properties = new PropertyDescriptorCollection (new PropertyDescriptor[0] {}); - tree.Update (properties, currentObject); - } - else { - foreach (object prov in propertyProviders) { + properties = new PropertyDescriptorCollection (new PropertyDescriptor[0] {}); + tree.Update (properties, currentObject); + } + else { + foreach (object prov in propertyProviders) { properties = selectedTab.GetProperties (prov); - tree.Update (properties, prov); - } - } + tree.Update (properties, prov); + } + } } public bool ShowToolbar { @@ -344,7 +344,7 @@ public ShadowType ShadowType { set { tree.ShadowType = value; } } - #region Hel Pane + #region Hel Pane public bool ShowHelp { @@ -390,8 +390,8 @@ void AddHelpPane () descTextView.HeightRequest = 70; descTextView.Editable = false; descTextView.LeftMargin = 5; - descTextView.RightMargin = 5; - descTextView.ModifyFont (IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11)); + descTextView.RightMargin = 5; + //descTextView.ModifyFont (IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11)); textScroll.Add (descTextView); @@ -399,8 +399,8 @@ void AddHelpPane () vpaned.Pack2 (descFrame, false, true); descFrame.ShowAll (); UpdateHelp (); - } - + } + public void SetHelp (string title, string description) { descTitle = title; @@ -424,14 +424,14 @@ public void ClearHelp() descTitle = descText = null; UpdateHelp (); } - - public void BlankPad () => CurrentObject = null; - - public void OnPadContentShown () - { - //not implemented - } - + + public void BlankPad () => CurrentObject = null; + + public void OnPadContentShown () + { + //not implemented + } + public interface IToolbarProvider { void Insert (Widget w, int pos); @@ -457,20 +457,20 @@ public void Insert (Widget w, int pos) } } - #endregion - } - - class TabRadioToolButton: RadioButton - { - public TabRadioToolButton (RadioButton group): base (group) + #endregion + } + + class TabRadioToolButton: RadioButton + { + public TabRadioToolButton (RadioButton group): base (group) { - DrawIndicator = false; + DrawIndicator = false; Relief = ReliefStyle.None; NoShowAll = true; Name = "MonoDevelop.PropertyGridToolbar.GtkRadioButton"; - } - - public PropertyTab Tab; + } + + public PropertyTab Tab; } public enum PropertySort @@ -480,4 +480,4 @@ public enum PropertySort Categorized, CategorizedAlphabetical } -} +} diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs index 15a7c478aa7..1ee79632884 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs @@ -25,11 +25,6 @@ // THE SOFTWARE. using System; using MonoDevelop.Components.AtkCocoaHelper; -#if GTK3 -using TreeModel = Gtk.ITreeModel; -#else -using TreeModel = Gtk.TreeModel; -#endif namespace MonoDevelop.Components { @@ -189,7 +184,7 @@ internal void ClearSelectOnRelease () Selection.SelectFunction = DefaultTreeSelectFunction; } - static bool DefaultTreeSelectFunction (Gtk.TreeSelection selection, TreeModel model, Gtk.TreePath path, bool selected) + static bool DefaultTreeSelectFunction (Gtk.TreeSelection selection, Gtk.ITreeModel model, Gtk.TreePath path, bool selected) { return true; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs index 6113ba41cd0..0758b6b8be4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs @@ -613,7 +613,7 @@ void UpdateStyle () layout.Dispose (); layout = new Pango.Layout (PangoContext); layout.Wrap = Pango.WrapMode.Char; - layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); + //layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); CalcRowHeight (); CalcVisibleRows (); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs index 16d7aff3147..1e3a01dcf7b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs @@ -28,7 +28,6 @@ using System.Drawing; using System.Runtime.InteropServices; using System.Collections.Generic; -using System.Linq; using System.Reflection; using System.Reflection.Emit; using Gtk; @@ -39,42 +38,109 @@ #if MAC using AppKit; using MonoDevelop.Components.Mac; -using CoreGraphics; #endif #if WIN32 using System.Windows.Input; #endif -#if GTK3 -using TreeModel = Gtk.ITreeModel; -#endif namespace MonoDevelop.Components { - public static partial class GtkWorkarounds + public static class GtkWorkarounds { -#if DD_GTK3_CHECK_FOR_REMOVE + const string LIBOBJC ="/usr/lib/libobjc.dylib"; const string USER32DLL = "User32.dll"; + [DllImport (LIBOBJC, EntryPoint = "sel_registerName")] + static extern IntPtr sel_registerName (string selector); + + [DllImport (LIBOBJC, EntryPoint = "objc_getClass")] + static extern IntPtr objc_getClass (string klass); + + [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")] + static extern IntPtr objc_msgSend_IntPtr (IntPtr klass, IntPtr selector); + + [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")] + static extern void objc_msgSend_void_bool (IntPtr klass, IntPtr selector, bool arg); + + [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")] + static extern bool objc_msgSend_bool (IntPtr klass, IntPtr selector); + + [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")] + static extern int objc_msgSend_NSInt32_NSInt32 (IntPtr klass, IntPtr selector, int arg); + + [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")] + static extern long objc_msgSend_NSInt64_NSInt64 (IntPtr klass, IntPtr selector, long arg); + + [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")] + static extern uint objc_msgSend_NSUInt32 (IntPtr klass, IntPtr selector); + + [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")] + static extern ulong objc_msgSend_NSUInt64 (IntPtr klass, IntPtr selector); + + [DllImport (LIBOBJC, EntryPoint = "objc_msgSend_stret")] + static extern void objc_msgSend_CGRect32 (out CGRect32 rect, IntPtr klass, IntPtr selector); + + [DllImport (LIBOBJC, EntryPoint = "objc_msgSend_stret")] + static extern void objc_msgSend_CGRect64 (out CGRect64 rect, IntPtr klass, IntPtr selector); + + [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")] + static extern void objc_msgSend_NSInt64_NSInt32 (IntPtr klass, IntPtr selector, int arg); + + [DllImport (PangoUtil.LIBQUARTZ)] + static extern IntPtr gdk_quartz_window_get_nswindow (IntPtr window); + + struct CGRect32 + { + public float X, Y, Width, Height; + } + + struct CGRect64 + { + public double X, Y, Width, Height; + + public CGRect64 (CGRect32 rect32) + { + X = rect32.X; + Y = rect32.Y; + Width = rect32.Width; + Height = rect32.Height; + } + } + + static IntPtr cls_NSScreen; + static IntPtr sel_screens, sel_objectEnumerator, sel_nextObject, sel_frame, sel_visibleFrame, + sel_requestUserAttention, sel_setHasShadow, sel_invalidateShadow, sel_terminate; + static IntPtr sharedApp; + static IntPtr cls_NSEvent; + static IntPtr sel_modifierFlags; + + const int NSCriticalRequest = 0; + const int NSInformationalRequest = 10; + static System.Reflection.MethodInfo glibObjectGetProp, glibObjectSetProp; public static int GtkMinorVersion = 12, GtkMicroVersion = 0; + static bool oldMacKeyHacks = false; static GtkWorkarounds () { - var flags = System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | BindingFlags.DeclaredOnly; + if (Platform.IsMac) { + InitMac (); + } + + var flags = System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic; glibObjectSetProp = typeof (GLib.Object).GetMethod ("SetProperty", flags); glibObjectGetProp = typeof (GLib.Object).GetMethod ("GetProperty", flags); - // Gtk2 stopped at 24, most likely to be installed - for (int i = 24; i >= 14; i -= 2) { - if (Global.CheckVersion (2, (uint)i, 0) == null) { + foreach (int i in new [] { 24, 22, 20, 18, 16, 14 }) { + if (Gtk.Global.CheckVersion (2, (uint)i, 0) == null) { GtkMinorVersion = i; break; } } - for (int i = 1; i < 99; i++) { - if (Global.CheckVersion (2, (uint)GtkMinorVersion, (uint)i) == null) { + for (int i = 1; i < 20; i++) { + if (Gtk.Global.CheckVersion (2, (uint)GtkMinorVersion, (uint)i) == null) { GtkMicroVersion = i; } else { break; @@ -95,19 +161,61 @@ static GtkWorkarounds () }; } -#if MAC - static Gdk.Rectangle MacGetUsableMonitorGeometry (Gdk.Screen screen, int monitor) + static void InitMac () { - var screens = NSScreen.Screens; - if ((uint)monitor >= screens.Length) - return screen.GetMonitorGeometry (monitor); + cls_NSScreen = objc_getClass ("NSScreen"); + cls_NSEvent = objc_getClass ("NSEvent"); + sel_screens = sel_registerName ("screens"); + sel_objectEnumerator = sel_registerName ("objectEnumerator"); + sel_nextObject = sel_registerName ("nextObject"); + sel_visibleFrame = sel_registerName ("visibleFrame"); + sel_frame = sel_registerName ("frame"); + sel_requestUserAttention = sel_registerName ("requestUserAttention:"); + sel_modifierFlags = sel_registerName ("modifierFlags"); + sel_setHasShadow = sel_registerName ("setHasShadow:"); + sel_invalidateShadow = sel_registerName ("invalidateShadow"); + sel_terminate = sel_registerName ("terminate:"); + sharedApp = objc_msgSend_IntPtr (objc_getClass ("NSApplication"), sel_registerName ("sharedApplication")); + } + + static void MacTerminate () + { + objc_msgSend_NSInt64_NSInt32 (sharedApp, sel_terminate, 0); + } - var macScreen = screens [monitor]; - CGRect visible = macScreen.VisibleFrame; - CGRect frame = macScreen.Frame; + public static void Terminate () + { + if (Platform.IsMac) + MacTerminate (); + } + static Gdk.Rectangle MacGetUsableMonitorGeometry (Gdk.Screen screen, int monitor) + { + IntPtr array = objc_msgSend_IntPtr (cls_NSScreen, sel_screens); + IntPtr iter = objc_msgSend_IntPtr (array, sel_objectEnumerator); Gdk.Rectangle ygeometry = screen.GetMonitorGeometry (monitor); Gdk.Rectangle xgeometry = screen.GetMonitorGeometry (0); + IntPtr scrn; + int i = 0; + + while ((scrn = objc_msgSend_IntPtr (iter, sel_nextObject)) != IntPtr.Zero && i < monitor) + i++; + + if (scrn == IntPtr.Zero) + return screen.GetMonitorGeometry (monitor); + + CGRect64 visible, frame; + + if (IntPtr.Size == 8) { + objc_msgSend_CGRect64 (out visible, scrn, sel_visibleFrame); + objc_msgSend_CGRect64 (out frame, scrn, sel_frame); + } else { + CGRect32 visible32, frame32; + objc_msgSend_CGRect32 (out visible32, scrn, sel_visibleFrame); + objc_msgSend_CGRect32 (out frame32, scrn, sel_frame); + visible = new CGRect64 (visible32); + frame = new CGRect64 (frame32); + } // Note: Frame and VisibleFrame rectangles are relative to monitor 0, but we need absolute // coordinates. @@ -142,10 +250,13 @@ static Gdk.Rectangle MacGetUsableMonitorGeometry (Gdk.Screen screen, int monitor static void MacRequestAttention (bool critical) { - NSRequestUserAttentionType kind = critical ? NSRequestUserAttentionType.CriticalRequest : NSRequestUserAttentionType.InformationalRequest; - NSApplication.SharedApplication.RequestUserAttention (kind); + int kind = critical? NSCriticalRequest : NSInformationalRequest; + if (IntPtr.Size == 8) { + objc_msgSend_NSInt64_NSInt64 (sharedApp, sel_requestUserAttention, kind); + } else { + objc_msgSend_NSInt32_NSInt32 (sharedApp, sel_requestUserAttention, kind); + } } -#endif // Note: we can't reuse RectangleF because the layout is different... [StructLayout (LayoutKind.Sequential)] @@ -217,79 +328,60 @@ static Gdk.Rectangle WindowsGetUsableMonitorGeometry (Gdk.Screen screen, int mon return new Gdk.Rectangle (x, y, width, height); } -#endif + public static Gdk.Rectangle GetUsableMonitorGeometry (this Gdk.Screen screen, int monitor) { - return Xwt.GtkBackend.GtkWorkarounds.GetUsableMonitorGeometry (screen, monitor); -#if DD_GTK3_CHECK_FOR_REMOVE -#if WIN32 - return WindowsGetUsableMonitorGeometry (screen, monitor); -#elif MAC - return MacGetUsableMonitorGeometry (screen, monitor); -#else + if (Platform.IsWindows) + return WindowsGetUsableMonitorGeometry (screen, monitor); + + if (Platform.IsMac) + return MacGetUsableMonitorGeometry (screen, monitor); + return screen.GetMonitorGeometry (monitor); -#endif -#endif } public static int RunDialogWithNotification (Gtk.Dialog dialog) { - return Xwt.GtkBackend.GtkWorkarounds.RunDialogWithNotification (dialog); -#if DD_GTK3_CHECK_FOR_REMOVE -#if MAC - MacRequestAttention (dialog.Modal); -#endif -#endif + if (Platform.IsMac) + MacRequestAttention (dialog.Modal); return dialog.Run (); } public static void PresentWindowWithNotification (this Gtk.Window window) { - Xwt.GtkBackend.GtkWorkarounds.PresentWindowWithNotification (window); -#if DD_GTK3_CHECK_FOR_REMOVE window.Present (); -#if MAC - MacRequestAttention (window is Gtk.Dialog && window.Modal); -#endif -#endif + if (Platform.IsMac) { + var dialog = window as Gtk.Dialog; + MacRequestAttention (dialog == null? false : dialog.Modal); + } } public static GLib.Value GetProperty (this GLib.Object obj, string name) { - return Xwt.GtkBackend.GtkWorkarounds.GetProperty (obj, name); -#if DD_GTK3_CHECK_FOR_REMOVE return (GLib.Value) glibObjectGetProp.Invoke (obj, new object[] { name }); -#endif } public static void SetProperty (this GLib.Object obj, string name, GLib.Value value) { - Xwt.GtkBackend.GtkWorkarounds.SetProperty (obj, name,value); -#if DD_GTK3_CHECK_FOR_REMOVE glibObjectSetProp.Invoke (obj, new object[] { name, value }); -#endif } public static bool TriggersContextMenu (this Gdk.EventButton evt) { - return Xwt.GtkBackend.GtkWorkarounds.TriggersContextMenu (evt); -#if DD_GTK3_CHECK_FOR_REMOVE return evt.Type == Gdk.EventType.ButtonPress && IsContextMenuButton (evt); -#endif } public static bool IsContextMenuButton (this Gdk.EventButton evt) { - return Xwt.GtkBackend.GtkWorkarounds.IsContextMenuButton (evt); -#if DD_GTK3_CHECK_FOR_REMOVE if (evt.Button == 3 && (evt.State & (Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button2Mask)) == 0) return true; if (Platform.IsMac) { - if (evt.Button == 1 && + if (!oldMacKeyHacks && + evt.Button == 1 && (evt.State & Gdk.ModifierType.ControlMask) != 0 && (evt.State & (Gdk.ModifierType.Button2Mask | Gdk.ModifierType.Button3Mask)) == 0) { @@ -298,15 +390,11 @@ public static bool IsContextMenuButton (this Gdk.EventButton evt) } return false; -#endif - } public static Gdk.ModifierType GetCurrentKeyModifiers () { - return Xwt.GtkBackend.GtkWorkarounds.GetCurrentKeyModifiers (); -#if DD_GTK3_CHECK_FOR_REMOVE -#if WIN32 + #if WIN32 Gdk.ModifierType mtype = Gdk.ModifierType.None; ModifierKeys mod = Keyboard.Modifiers; if ((mod & ModifierKeys.Shift) > 0) @@ -318,22 +406,36 @@ public static Gdk.ModifierType GetCurrentKeyModifiers () if ((mod & ModifierKeys.Windows) > 0) mtype |= Gdk.ModifierType.Mod2Mask; // Command key return mtype; -#elif MAC - return GtkMacInterop.ConvertModifierMask (NSEvent.CurrentModifierFlags); -#else - Gdk.ModifierType mtype; - Gtk.Global.GetCurrentEventState (out mtype); - return mtype; -#endif -#endif + #else + if (Platform.IsMac) { + Gdk.ModifierType mtype = Gdk.ModifierType.None; + ulong mod; + if (IntPtr.Size == 8) { + mod = objc_msgSend_NSUInt64 (cls_NSEvent, sel_modifierFlags); + } else { + mod = objc_msgSend_NSUInt32 (cls_NSEvent, sel_modifierFlags); + } + if ((mod & (1 << 17)) != 0) + mtype |= Gdk.ModifierType.ShiftMask; + if ((mod & (1 << 18)) != 0) + mtype |= Gdk.ModifierType.ControlMask; + if ((mod & (1 << 19)) != 0) + mtype |= Gdk.ModifierType.Mod1Mask; // Alt key + if ((mod & (1 << 20)) != 0) + mtype |= Gdk.ModifierType.Mod2Mask; // Command key + return mtype; + } + else { + Gdk.ModifierType mtype; + Gtk.Global.GetCurrentEventState (out mtype); + return mtype; + } + #endif } public static void GetPageScrollPixelDeltas (this Gdk.EventScroll evt, double pageSizeX, double pageSizeY, out double deltaX, out double deltaY) { - Xwt.GtkBackend.GtkWorkarounds.GetPageScrollPixelDeltas (evt, pageSizeX, pageSizeY, out deltaX, out deltaY); - -#if DD_GTK3_CHECK_FOR_REMOVE if (!GetEventScrollDeltas (evt, out deltaX, out deltaY)) { var direction = evt.Direction; deltaX = deltaY = 0; @@ -349,27 +451,19 @@ public static void GetPageScrollPixelDeltas (this Gdk.EventScroll evt, double pa deltaX = -deltaX; } } -#endif } public static void AddValueClamped (this Gtk.Adjustment adj, double value) { - Xwt.GtkBackend.GtkWorkarounds.AddValueClamped (adj, value); -#if DD_GTK3_CHECK_FOR_REMOVE adj.Value = System.Math.Max (adj.Lower, System.Math.Min (adj.Value + value, adj.Upper - adj.PageSize)); -#endif } -#if DD_GTK3_CHECK_FOR_REMOVE [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] extern static bool gdk_event_get_scroll_deltas (IntPtr eventScroll, out double deltaX, out double deltaY); static bool scrollDeltasNotSupported; -#endif + public static bool GetEventScrollDeltas (Gdk.EventScroll evt, out double deltaX, out double deltaY) { - return Xwt.GtkBackend.GtkWorkarounds.GetEventScrollDeltas (evt, out deltaX, out deltaY); -#if DD_GTK3_CHECK_FOR_REMOVE - if (!scrollDeltasNotSupported) { try { return gdk_event_get_scroll_deltas (evt.Handle, out deltaX, out deltaY); @@ -379,12 +473,10 @@ public static bool GetEventScrollDeltas (Gdk.EventScroll evt, out double deltaX, } deltaX = deltaY = 0; return false; -#endif } static void ShowContextMenuInternal (Gtk.Menu menu, Gtk.Widget parent, int ix, int iy, Gdk.Rectangle caret, Gdk.Window window, uint time, uint button) { - Gtk.MenuPositionFunc posFunc = null; if (parent != null) { @@ -468,7 +560,6 @@ public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, Gdk.EventB public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, int ix, int iy, Gdk.Rectangle caret) { - int x, y; var window = parent.GdkWindow; var alloc = parent.Allocation; @@ -486,15 +577,11 @@ public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, int ix, in } ShowContextMenuInternal (menu, parent, x, y, caret, window, Gtk.Global.CurrentEventTime, 0); - } public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, Gdk.EventButton evt) { - Xwt.GtkBackend.GtkWorkarounds.ShowContextMenu (menu, parent, evt); -#if DD_GTK3_CHECK_FOR_REMOVE ShowContextMenu (menu, parent, evt, Gdk.Rectangle.Zero); -#endif } public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, int x, int y) @@ -507,7 +594,6 @@ public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, Gdk.Rectan ShowContextMenu (menu, parent, null, caret); } -#if DD_GTK3_CHECK_FOR_REMOVE struct MappedKeys { public Gdk.Key Key; @@ -525,7 +611,6 @@ struct MappedKeys static Gdk.Keymap keymap = Gdk.Keymap.Default; static Dictionary mappedKeys = new Dictionary (); -#endif /// Map raw GTK key input to work around platform bugs and decompose accelerator keys /// The raw key event @@ -535,10 +620,6 @@ struct MappedKeys public static void MapKeys (Gdk.EventKey evt, out Gdk.Key key, out Gdk.ModifierType state, out KeyboardShortcut[] shortcuts) { - Xwt.GtkBackend.GtkWorkarounds.MapKeys (evt,out key, out state, out var _shortcuts); - shortcuts = _shortcuts.Select (s => new KeyboardShortcut (s.Key, s.Modifier)) - .ToArray (); -#if DD_GTK3_CHECK_FOR_REMOVE //this uniquely identifies the raw key ulong id; unchecked { @@ -557,11 +638,8 @@ public static void MapKeys (Gdk.EventKey evt, out Gdk.Key key, out Gdk.ModifierT if (remapKey) { key = (Gdk.Key)evt.KeyValue; } -#endif } -#if DD_GTK3_CHECK_FOR_REMOVE - static MappedKeys MapKeys (Gdk.EventKey evt) { MappedKeys mapped; @@ -579,7 +657,7 @@ static MappedKeys MapKeys (Gdk.EventKey evt) TranslateKeyboardState (evt, modifier, grp, out keyval, out effectiveGroup, out level, out consumedModifiers); mapped.Key = (Gdk.Key)keyval; - mapped.State = evt.State & ~consumedModifiers; + mapped.State = FixMacModifiers (evt.State & ~consumedModifiers, grp); //decompose the key into accel combinations var accelList = new List (); @@ -593,7 +671,7 @@ static MappedKeys MapKeys (Gdk.EventKey evt) //fully decomposed TranslateKeyboardState (evt, Gdk.ModifierType.None, 0, out keyval, out effectiveGroup, out level, out consumedModifiers); - accelList.Add (new KeyboardShortcut ((Gdk.Key)keyval, modifier & accelMods)); + accelList.Add (new KeyboardShortcut ((Gdk.Key)keyval, FixMacModifiers (modifier, grp) & accelMods)); //with shift composed if ((modifier & Gdk.ModifierType.ShiftMask) != 0) { @@ -607,7 +685,7 @@ static MappedKeys MapKeys (Gdk.EventKey evt) // Prevent consumption of non-Shift modifiers (that we didn't even provide!) consumedModifiers &= Gdk.ModifierType.ShiftMask; - var m = (modifier & ~consumedModifiers) & accelMods; + var m = FixMacModifiers ((modifier & ~consumedModifiers), grp) & accelMods; AddIfNotDuplicate (accelList, new KeyboardShortcut ((Gdk.Key)keyval, m)); } @@ -619,7 +697,7 @@ static MappedKeys MapKeys (Gdk.EventKey evt) // Prevent consumption of Shift modifier (that we didn't even provide!) consumedModifiers &= ~Gdk.ModifierType.ShiftMask; - var m = (modifier & ~consumedModifiers) & accelMods; + var m = FixMacModifiers ((modifier & ~consumedModifiers), 0) & accelMods; AddIfNotDuplicate (accelList, new KeyboardShortcut ((Gdk.Key)keyval, m)); } @@ -627,7 +705,7 @@ static MappedKeys MapKeys (Gdk.EventKey evt) if (grp == 1 && (modifier & Gdk.ModifierType.ShiftMask) != 0) { TranslateKeyboardState (evt, modifier, 1, out keyval, out effectiveGroup, out level, out consumedModifiers); - var m = (modifier & ~consumedModifiers) & accelMods; + var m = FixMacModifiers ((modifier & ~consumedModifiers), 0) & accelMods; AddIfNotDuplicate (accelList, new KeyboardShortcut ((Gdk.Key)keyval, m)); } @@ -639,7 +717,7 @@ static MappedKeys MapKeys (Gdk.EventKey evt) } // Workaround for bug "Bug 688247 - Ctrl+Alt key not work on windows7 with bootcamp on a Mac Book Pro" - // Ctrl+Alt should behave like right alt key - unfortunately TranslateKeyboardState doesn't handle it. + // Ctrl+Alt should behave like right alt key - unfortunately TranslateKeyboardState doesn't handle it. static void TranslateKeyboardState (Gdk.EventKey evt, Gdk.ModifierType state, int group, out uint keyval, out int effective_group, out int level, out Gdk.ModifierType consumed_modifiers) { @@ -651,7 +729,7 @@ static void TranslateKeyboardState (Gdk.EventKey evt, Gdk.ModifierType state, in state = (state & ~ctrlAlt) | Gdk.ModifierType.Mod2Mask; group = 1; } - // Case: Caps lock on + shift + key + // Case: Caps lock on + shift + key // See: Bug 8069 - [UI Refresh] If caps lock is on, holding the shift key prevents typed characters from appearing if (state.HasFlag (Gdk.ModifierType.ShiftMask)) { state &= ~Gdk.ModifierType.ShiftMask; @@ -665,7 +743,36 @@ static void TranslateKeyboardState (Gdk.EventKey evt, Gdk.ModifierType state, in keyval = evt.KeyValue; } } -#endif + + static Gdk.ModifierType FixMacModifiers (Gdk.ModifierType mod, byte grp) + { + if (!oldMacKeyHacks) + return mod; + + // Mac GTK+ maps the command key to the Mod1 modifier, which usually means alt/ + // We map this instead to meta, because the Mac GTK+ has mapped the cmd key + // to the meta key (yay inconsistency!). IMO super would have been saner. + if ((mod & Gdk.ModifierType.Mod1Mask) != 0) { + mod ^= Gdk.ModifierType.Mod1Mask; + mod |= Gdk.ModifierType.MetaMask; + } + + //some versions of GTK map opt as mod5, which converts to the virtual super modifier + if ((mod & (Gdk.ModifierType.Mod5Mask | Gdk.ModifierType.SuperMask)) != 0) { + mod ^= (Gdk.ModifierType.Mod5Mask | Gdk.ModifierType.SuperMask); + mod |= Gdk.ModifierType.Mod1Mask; + } + + // When opt modifier is active, we need to decompose this to make the command appear correct for Mac. + // In addition, we can only inspect whether the opt/alt key is pressed by examining + // the key's "group", because the Mac GTK+ treats opt as a group modifier and does + // not expose it as an actual GDK modifier. + if (grp == (byte) 1) { + mod |= Gdk.ModifierType.Mod1Mask; + } + + return mod; + } public static Gdk.Key[] KeysForMod (Gdk.ModifierType mod) { @@ -677,22 +784,20 @@ public static Gdk.Key[] KeysForMod (Gdk.ModifierType mod) case Gdk.ModifierType.ShiftMask: return new Gdk.Key [] { Gdk.Key.Shift_R, Gdk.Key.Shift_L }; case Gdk.ModifierType.MetaMask: - // Just in case we get both of the modifiers - case Gdk.ModifierType.Mod2Mask | Gdk.ModifierType.MetaMask: return new Gdk.Key [] { Gdk.Key.Meta_R, Gdk.Key.Meta_L }; } return new Gdk.Key [0]; } -#if DD_GTK3_CHECK_FOR_REMOVE - static void AddIfNotDuplicate (List list, T item) where T : IEquatable { - if (!list.Contains (item)) - list.Add (item); + for (int i = 0; i < list.Count; i++) { + if (list[i].Equals (item)) + return; + } + list.Add (item); } - [System.Runtime.InteropServices.DllImport (PangoUtil.LIBGDK, CallingConvention = CallingConvention.Cdecl)] static extern IntPtr gdk_win32_drawable_get_handle (IntPtr drawable); @@ -734,13 +839,9 @@ public Win32Rect (int left, int top, int right, int bottom) [DllImport (USER32DLL)] static extern bool GetWindowRect (IntPtr hwnd, out Win32Rect rect); -#endif public static void SetImCursorLocation (Gtk.IMContext ctx, Gdk.Window clientWindow, Gdk.Rectangle cursor) { - Xwt.GtkBackend.GtkWorkarounds.SetImCursorLocation (ctx, clientWindow, cursor); - -#if DD_GTK3_CHECK_FOR_REMOVE // work around GTK+ Bug 663096 - Windows IME position is wrong when Aero glass is enabled // https://bugzilla.gnome.org/show_bug.cgi?id=663096 if (Platform.IsWindows && System.Environment.OSVersion.Version.Major >= 6) { @@ -758,54 +859,48 @@ public static void SetImCursorLocation (Gtk.IMContext ctx, Gdk.Window clientWind } } ctx.CursorLocation = cursor; -#endif } /// X coordinate of the pixels inside the right edge of the rectangle /// Workaround for inconsistency of Right property between GTK# versions - public static int RightInside (this Gdk.Rectangle rect) => Xwt.GtkBackend.GtkWorkarounds.RightInside (rect); + public static int RightInside (this Gdk.Rectangle rect) + { + return rect.X + rect.Width - 1; + } /// Y coordinate of the pixels inside the bottom edge of the rectangle /// Workaround for inconsistency of Bottom property between GTK# versions# - public static int BottomInside (this Gdk.Rectangle rect)=> Xwt.GtkBackend.GtkWorkarounds.BottomInside (rect); + public static int BottomInside (this Gdk.Rectangle rect) + { + return rect.Y + rect.Height - 1; + } /// /// Shows or hides the shadow of the window rendered by the native toolkit /// public static void ShowNativeShadow (Gtk.Window window, bool show) { - Xwt.GtkBackend.GtkWorkarounds.ShowNativeShadow (window, show); -#if DD_GTK3_CHECK_FOR_REMOVE -#if MAC - var nsWindow = GtkMacInterop.GetNSWindow (window); - if (nsWindow != null) - nsWindow.HasShadow = show; -#endif -#endif + if (Platform.IsMac) { + var ptr = gdk_quartz_window_get_nswindow (window.GdkWindow.Handle); + objc_msgSend_void_bool (ptr, sel_setHasShadow, show); + } } public static void UpdateNativeShadow (Gtk.Window window) { - Xwt.GtkBackend.GtkWorkarounds.UpdateNativeShadow (window); -#if DD_GTK3_CHECK_FOR_REMOVE -#if MAC - var nsWindow = GtkMacInterop.GetNSWindow (window); - if (nsWindow != null) - nsWindow.InvalidateShadow (); -#endif -#endif + if (!Platform.IsMac) + return; + var ptr = gdk_quartz_window_get_nswindow (window.GdkWindow.Handle); + objc_msgSend_IntPtr (ptr, sel_invalidateShadow); } -#if DD_GTK3_CHECK_FOR_REMOVE - [DllImport (PangoUtil.LIBGTKGLUE, CallingConvention = CallingConvention.Cdecl)] static extern void gtksharp_container_leak_fixed_marker (); static HashSet fixedContainerTypes; static Dictionary forallCallbacks; static bool containerLeakFixed; -#endif // Works around BXC #3801 - Managed Container subclasses are incorrectly resurrected, then leak. // It does this by registering an alternative callback for gtksharp_container_override_forall, which @@ -815,16 +910,14 @@ public static void UpdateNativeShadow (Gtk.Window window) // per-instance delegates. public static void FixContainerLeak (Gtk.Container c) { - Xwt.GtkBackend.GtkWorkarounds.FixContainerLeak (c); -#if DD_GTK3_CHECK_FOR_REMOVE +return; if (containerLeakFixed) { return; } FixContainerLeak (c.GetType ()); -#endif } -#if DD_GTK3_CHECK_FOR_REMOVE + static void FixContainerLeak (Type t) { if (containerLeakFixed) { @@ -957,19 +1050,29 @@ static ForallDelegate CreateForallCallback (IntPtr gtype) [DllImport(PangoUtil.LIBGTKGLUE, CallingConvention = CallingConvention.Cdecl)] static extern void gtksharp_container_override_forall (IntPtr gtype, ForallDelegate cb); -#endif - public static string MarkupLinks (string text) => Xwt.GtkBackend.GtkWorkarounds.MarkupLinks (text); + const string urlRegexStr = @"(http|ftp)s?\:\/\/[\w\d\.,;_/\-~%@()+:?&^=#!]*[\w\d/]"; + static readonly Regex UrlRegex = new Regex (urlRegexStr, RegexOptions.Compiled | RegexOptions.ExplicitCapture); + + public static string MarkupLinks (string text) + { + if (GtkMinorVersion < 18) + return text; + return UrlRegex.Replace (text, MatchToUrl); + } + + static string MatchToUrl (System.Text.RegularExpressions.Match m) + { + var s = m.ToString (); + return String.Format ("{1}", s, s.Replace ("_", "__")); + } public static void SetLinkHandler (this Gtk.Label label, Action urlHandler) { - Xwt.GtkBackend.GtkWorkarounds.SetLinkHandler (label,urlHandler); -#if DD_GTK3_CHECK_FOR_REMOVE if (GtkMinorVersion >= 18) new UrlHandlerClosure (urlHandler).ConnectTo (label); -#endif } -#if DD_GTK3_CHECK_FOR_REMOVE + //create closure manually so we can apply ConnectBefore class UrlHandlerClosure { @@ -998,9 +1101,7 @@ class ActivateLinkEventArgs : GLib.SignalArgs public string Url { get { return (string)base.Args [0]; } } } } -#endif -#if DD_GTK3_CHECK_FOR_REMOVE static bool canSetOverlayScrollbarPolicy = true; [DllImport (PangoUtil.LIBQUARTZ)] @@ -1008,11 +1109,9 @@ class ActivateLinkEventArgs : GLib.SignalArgs [DllImport (PangoUtil.LIBQUARTZ)] static extern void gtk_scrolled_window_get_overlay_policy (IntPtr sw, out Gtk.PolicyType hpolicy, out Gtk.PolicyType vpolicy); -#endif + public static void SetOverlayScrollbarPolicy (Gtk.ScrolledWindow sw, Gtk.PolicyType hpolicy, Gtk.PolicyType vpolicy) { - Xwt.GtkBackend.GtkWorkarounds.SetOverlayScrollbarPolicy (sw, hpolicy, vpolicy); -#if DD_GTK3_CHECK_FOR_REMOVE // we know the .dll isn't there on Windows, so don't even try (avoids a first-chance DllNotFoundException) if (Platform.IsWindows) { canSetOverlayScrollbarPolicy = false; @@ -1029,13 +1128,10 @@ public static void SetOverlayScrollbarPolicy (Gtk.ScrolledWindow sw, Gtk.PolicyT } catch (EntryPointNotFoundException) { } canSetOverlayScrollbarPolicy = false; -#endif } public static void GetOverlayScrollbarPolicy (Gtk.ScrolledWindow sw, out Gtk.PolicyType hpolicy, out Gtk.PolicyType vpolicy) { - Xwt.GtkBackend.GtkWorkarounds.GetOverlayScrollbarPolicy (sw, out hpolicy, out vpolicy); -#if DD_GTK3_CHECK_FOR_REMOVE if (!canSetOverlayScrollbarPolicy) { hpolicy = vpolicy = 0; return; @@ -1048,33 +1144,26 @@ public static void GetOverlayScrollbarPolicy (Gtk.ScrolledWindow sw, out Gtk.Pol } hpolicy = vpolicy = 0; canSetOverlayScrollbarPolicy = false; -#endif } -#if DD_GTK3_CHECK_FOR_REMOVE + [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] static extern bool gtk_tree_view_get_tooltip_context (IntPtr raw, ref int x, ref int y, bool keyboard_tip, out IntPtr model, out IntPtr path, IntPtr iter); -#endif + //the GTK# version of this has 'out' instead of 'ref', preventing passing the x,y values in public static bool GetTooltipContext (this TreeView tree, ref int x, ref int y, bool keyboardTip, out ITreeModel model, out TreePath path, out Gtk.TreeIter iter) { - return Xwt.GtkBackend.GtkWorkarounds.GetTooltipContext (tree, ref x, ref y, keyboardTip, out model, - out path, out iter); -#if DD_GTK3_CHECK_FOR_REMOVE IntPtr intPtr = Marshal.AllocHGlobal (Marshal.SizeOf (typeof(TreeIter))); IntPtr handle; IntPtr intPtr2; - bool result = - gtk_tree_view_get_tooltip_context (tree.Handle, ref x, ref y, keyboardTip, out handle, out intPtr2, intPtr); + bool result = gtk_tree_view_get_tooltip_context (tree.Handle, ref x, ref y, keyboardTip, out handle, out intPtr2, intPtr); model = TreeModelAdapter.GetObject (handle, false); path = intPtr2 == IntPtr.Zero ? null : ((TreePath)GLib.Opaque.GetOpaque (intPtr2, typeof(TreePath), false)); iter = TreeIter.New (intPtr); Marshal.FreeHGlobal (intPtr); return result; -#endif } -#if DD_GTK3_CHECK_FOR_REMOVE static bool supportsHiResIcons = true; [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] @@ -1097,28 +1186,19 @@ public static bool GetTooltipContext (this TreeView tree, ref int x, ref int y, [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] static extern IntPtr gtk_icon_set_render_icon_scaled (IntPtr handle, IntPtr style, int direction, int state, int size, IntPtr widget, IntPtr intPtr, ref double scale); -#endif public static IntPtr GetData (GLib.Object o, string name) { - return Xwt.GtkBackend.GtkWorkarounds.GetData (o, name); -#if DD_GTK3_CHECK_FOR_REMOVE return g_object_get_data (o.Handle, name); -#endif } public static void SetData (GLib.Object o, string name, IntPtr dataHandle) { - Xwt.GtkBackend.GtkWorkarounds.SetData (o, name, dataHandle); -#if DD_GTK3_CHECK_FOR_REMOVE g_object_set_data (o.Handle, name, dataHandle); -#endif } public static bool SetSourceScale (Gtk.IconSource source, double scale) { - return Xwt.GtkBackend.GtkWorkarounds.SetSourceScale (source, scale); -#if DD_GTK3_CHECK_FOR_REMOVE if (!supportsHiResIcons) return false; @@ -1130,13 +1210,10 @@ public static bool SetSourceScale (Gtk.IconSource source, double scale) } supportsHiResIcons = false; return false; -#endif } public static bool SetSourceScaleWildcarded (Gtk.IconSource source, bool setting) { - return Xwt.GtkBackend.GtkWorkarounds.SetSourceScaleWildcarded (source, setting); -#if DD_GTK3_CHECK_FOR_REMOVE if (!supportsHiResIcons) return false; @@ -1148,13 +1225,10 @@ public static bool SetSourceScaleWildcarded (Gtk.IconSource source, bool setting } supportsHiResIcons = false; return false; -#endif } public static Gdk.Pixbuf Get2xVariant (Gdk.Pixbuf px) { - return Xwt.GtkBackend.GtkWorkarounds.Get2xVariant (px); -#if DD_GTK3_CHECK_FOR_REMOVE if (!supportsHiResIcons) return null; @@ -1169,20 +1243,14 @@ public static Gdk.Pixbuf Get2xVariant (Gdk.Pixbuf px) } supportsHiResIcons = false; return null; -#endif } public static void Set2xVariant (Gdk.Pixbuf px, Gdk.Pixbuf variant2x) { - Xwt.GtkBackend.GtkWorkarounds.Set2xVariant (px, variant2x); -#if DD_GTK3_CHECK_FOR_REMOVE -#endif } public static double GetScaleFactor (Gtk.Widget w) { - return Xwt.GtkBackend.GtkWorkarounds.GetScaleFactor (w); -#if DD_GTK3_CHECK_FOR_REMOVE if (!supportsHiResIcons) return 1; @@ -1193,13 +1261,10 @@ public static double GetScaleFactor (Gtk.Widget w) } supportsHiResIcons = false; return 1; -#endif } public static double GetScaleFactor (this Gdk.Screen screen, int monitor) { - return Xwt.GtkBackend.GtkWorkarounds.GetScaleFactor (screen, monitor); -#if DD_GTK3_CHECK_FOR_REMOVE if (!supportsHiResIcons) return 1; @@ -1210,7 +1275,6 @@ public static double GetScaleFactor (this Gdk.Screen screen, int monitor) } supportsHiResIcons = false; return 1; -#endif } public static double GetScaleFactor () @@ -1220,8 +1284,6 @@ public static double GetScaleFactor () public static Gdk.Pixbuf RenderIcon (this Gtk.IconSet iconset, Gtk.Style style, Gtk.TextDirection direction, Gtk.StateType state, Gtk.IconSize size, Gtk.Widget widget, string detail, double scale) { - return Xwt.GtkBackend.GtkWorkarounds.RenderIcon (iconset,style,direction,state,size,widget,detail,scale); -#if DD_GTK3_CHECK_FOR_REMOVE if (scale == 1d) return iconset.RenderIcon (style, direction, state, size, widget, detail); @@ -1239,10 +1301,8 @@ public static Gdk.Pixbuf RenderIcon (this Gtk.IconSet iconset, Gtk.Style style, } supportsHiResIcons = false; return null; -#endif } -#if DD_GTK3_CHECK_FOR_REMOVE [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] static extern void gtk_object_set_data (IntPtr raw, IntPtr key, IntPtr data); @@ -1260,7 +1320,6 @@ public static Gdk.Pixbuf RenderIcon (this Gtk.IconSet iconset, Gtk.Style style, public static void SetTransparentBgHint (this Widget widget, bool enable) { //SetData (widget, "transparent-bg-hint", enable); - //Xwt.GtkBackend.GtkWorkarounds.SetTransparentBgHint (widget,enable); } public static void SetMarkup (this Gtk.TextView view, string pangoMarkup) @@ -1314,9 +1373,6 @@ public static void InsertMarkup (this Gtk.TextBuffer buffer, TextIter iter, stri public static bool GetTagForAttributes (this Pango.AttrIterator iter, string name, out TextTag tag) { - return Xwt.GtkBackend.GtkWorkarounds.GetTagForAttributes (iter, name, out tag); - -#if DD_GTK3_CHECK_FOR_REMOVE tag = new TextTag (name); bool result = false; Pango.Attribute attr; @@ -1392,18 +1448,13 @@ public static bool GetTagForAttributes (this Pango.AttrIterator iter, string nam } return result; -#endif } -#if DD_GTK3_CHECK_FOR_REMOVE + [DllImport (PangoUtil.LIBPANGO, CallingConvention = CallingConvention.Cdecl)] private static extern IntPtr pango_attr_iterator_get (IntPtr raw, int type); -#endif + public static bool SafeGet (this Pango.AttrIterator iter, Pango.AttrType type, out Pango.Attribute attr) { - attr = Xwt.GtkBackend.GtkWorkarounds.SafeGetCopy (iter, type); - return attr != null; - -#if DD_GTK3_CHECK_FOR_REMOVE attr = null; try { IntPtr raw = pango_attr_iterator_get (iter.Handle, (int)type); @@ -1415,7 +1466,6 @@ public static bool SafeGet (this Pango.AttrIterator iter, Pango.AttrType type, o } catch { return false; } -#endif } public static bool IsChildOf (this Gtk.Widget child, Gtk.Widget widget) @@ -1445,8 +1495,6 @@ static void DisableButtonsInternal (Gtk.Window window) // minimize/maximize buttons. This may be because on Cocoa these are set at window creation and can only // be changed afterwards by directly accessing the window button and disabling it like so. NSWindow nsWindow = GtkMacInterop.GetNSWindow (window); - if (nsWindow == null) - return; nsWindow.StandardWindowButton (NSWindowButton.MiniaturizeButton).Enabled = false; nsWindow.StandardWindowButton (NSWindowButton.ZoomButton).Enabled = false; @@ -1482,60 +1530,28 @@ public static void EmitRemoveSignal(Container container, Widget child) GLib.Signal.Emit(container, "remove", child); #endif } - - internal static bool IsRunFromBundle () - { - bool result = false; -#if MAC - IntPtr mainBundle = GetMainBundle (); - var sel_bundleIdentifier = ObjCRuntime.Selector.GetHandle ("bundleIdentifier"); - - result = Messaging.IntPtr_objc_msgSend (mainBundle, sel_bundleIdentifier) != IntPtr.Zero; - - static IntPtr GetMainBundle () - { - var class_runningApplication = ObjCRuntime.Class.GetHandle ("NSBundle"); - var sel_mainBundle = ObjCRuntime.Selector.GetHandle ("mainBundle"); - - return Messaging.IntPtr_objc_msgSend (class_runningApplication, sel_mainBundle); - } -#endif - return result; - } - -#if MAC - [DllImport ("libgtk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] - static extern IntPtr gtk_get_current_event (); - - public static IntPtr GetCurrentEventHandle () => gtk_get_current_event (); - - [DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] - static extern void gdk_event_free (IntPtr raw); - - public static void FreeEvent (IntPtr raw) - { - if (raw != IntPtr.Zero) - gdk_event_free (raw); - } -#endif - - public static int GtkMinorVersion => Xwt.GtkBackend.GtkWorkarounds.GtkMinorVersion; - } - public readonly struct KeyboardShortcut : IEquatable + public struct KeyboardShortcut : IEquatable { public static readonly KeyboardShortcut Empty = new KeyboardShortcut ((Gdk.Key) 0, (Gdk.ModifierType) 0); + Gdk.ModifierType modifier; + Gdk.Key key; + public KeyboardShortcut (Gdk.Key key, Gdk.ModifierType modifier) { - this.Modifier = modifier; - this.Key = key; + this.modifier = modifier; + this.key = key; } - public Gdk.Key Key { get; } + public Gdk.Key Key { + get { return key; } + } - public Gdk.ModifierType Modifier { get; } + public Gdk.ModifierType Modifier { + get { return modifier; } + } public bool IsEmpty { get { return Key == (Gdk.Key) 0; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs index efe65e590a4..ac6bcc502c4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs @@ -110,39 +110,39 @@ abstract class CustomPanedHandle : Gtk.EventBox protected CustomPanedHandle (Gtk.Paned parent) { ParentPaned = parent; - ParentPaned.SizeRequested += HandleSizeRequested; + //ParentPaned.SizeRequested += HandleSizeRequested; ParentPaned.SizeAllocated += HandleSizeAllocated; Parent = parent; } - protected virtual void OnParentSizeRequested (Gtk.SizeRequestedArgs args) - { - SizeRequest (); - } + // protected virtual void OnParentSizeRequested (Gtk.SizeRequestedArgs args) + // { + // SizeRequest (); + // } - protected virtual void OnParentSizeAllocated (Gtk.SizeAllocatedArgs args) - { - } + // protected virtual void OnParentSizeAllocated (Gtk.SizeAllocatedArgs args) + // { + // } - void HandleSizeRequested (object o, Gtk.SizeRequestedArgs args) - { - OnParentSizeRequested (args); + // void HandleSizeRequested (object o, Gtk.SizeRequestedArgs args) + // { + // OnParentSizeRequested (args); // parent.SizeRequested += delegate { // SizeRequest (); // }; - parent.SizeAllocated += HandleSizeAllocated; - HandleWidget = null; - } + // parent.SizeAllocated += HandleSizeAllocated; + // HandleWidget = null; + // } void HandleSizeAllocated (object o, Gtk.SizeAllocatedArgs args) { - OnParentSizeAllocated (args); + //OnParentSizeAllocated (args); } protected override void OnDestroyed () { if (ParentPaned != null) { - ParentPaned.SizeRequested -= HandleSizeRequested; + //ParentPaned.SizeRequested -= HandleSizeRequested; ParentPaned.SizeAllocated -= HandleSizeAllocated; ParentPaned = null; } @@ -297,24 +297,24 @@ public CustomGtkPanedHandle (Gtk.Paned parent) : base (parent) HandleWidget = null; } - void HandleSizeRequested (object o, Gtk.SizeRequestedArgs args) - { - SizeRequest (); - } - - protected override void OnParentSizeAllocated (Gtk.SizeAllocatedArgs args) - { - if (ParentPaned.Child1 != null && ParentPaned.Child1.Visible && ParentPaned.Child2 != null && ParentPaned.Child2.Visible) { - Show (); - int centerSize = Child == null ? GrabAreaSize / 2 : 0; - if (horizontal) - SizeAllocate (new Gdk.Rectangle (ParentPaned.Child1.Allocation.X + ParentPaned.Child1.Allocation.Width - centerSize, args.Allocation.Y, GrabAreaSize, args.Allocation.Height)); - else - SizeAllocate (new Gdk.Rectangle (args.Allocation.X, ParentPaned.Child1.Allocation.Y + ParentPaned.Child1.Allocation.Height - centerSize, args.Allocation.Width, GrabAreaSize)); - } else - Hide (); - base.OnParentSizeAllocated (args); - } + // void HandleSizeRequested (object o, Gtk.SizeRequestedArgs args) + // { + // SizeRequest (); + // } + + // protected override void OnParentSizeAllocated (Gtk.SizeAllocatedArgs args) + // { + // if (ParentPaned.Child1 != null && ParentPaned.Child1.Visible && ParentPaned.Child2 != null && ParentPaned.Child2.Visible) { + // Show (); + // int centerSize = Child == null ? GrabAreaSize / 2 : 0; + // if (horizontal) + // SizeAllocate (new Gdk.Rectangle (ParentPaned.Child1.Allocation.X + ParentPaned.Child1.Allocation.Width - centerSize, args.Allocation.Y, GrabAreaSize, args.Allocation.Height)); + // else + // SizeAllocate (new Gdk.Rectangle (args.Allocation.X, ParentPaned.Child1.Allocation.Y + ParentPaned.Child1.Allocation.Height - centerSize, args.Allocation.Width, GrabAreaSize)); + // } else + // Hide (); + // base.OnParentSizeAllocated (args); + // } public override int GrabAreaSize { get { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs index 916db6e3113..205098a5c1f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs @@ -126,19 +126,19 @@ bool IsParentDisabled () return false; } - protected override bool OnDrawn (Context cr) - { - if (image != null) { - var alloc = Allocation; - alloc.Inflate (-Xpad, -Ypad); - var x = Math.Round (alloc.X + (alloc.Width - image.Width) * Xalign); - var y = Math.Round (alloc.Y + (alloc.Height - image.Height) * Yalign); - cr.Save (); - cr.DrawImage (this, IsParentDisabled () ? image.WithAlpha (0.4) : image, x, y); - cr.Restore (); - } - return true; - } + // protected override bool OnDrawn (Context cr) + // { + // if (image != null) { + // var alloc = Allocation; + // alloc.Inflate (-Xpad, -Ypad); + // var x = Math.Round (alloc.X + (alloc.Width - image.Width) * Xalign); + // var y = Math.Round (alloc.Y + (alloc.Height - image.Height) * Yalign); + // cr.Save (); + // cr.DrawImage (this, IsParentDisabled () ? image.WithAlpha (0.4) : image, x, y); + // cr.Restore (); + // } + // return true; + // } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Shared/GtkWorkarounds.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Shared/GtkWorkarounds.cs index 0c38af854ff..49f8a0d04e0 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Shared/GtkWorkarounds.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Shared/GtkWorkarounds.cs @@ -32,17 +32,17 @@ // Anything that only needs to be in MonoDevelop.Ide should go into the other part. namespace MonoDevelop.Components { - public static partial class GtkWorkarounds - { - public static void Terminate () - { -#if MAC - var app = Mac.Messaging.IntPtr_objc_msgSend ( - ObjCRuntime.Class.GetHandle ("NSApplication"), - ObjCRuntime.Selector.GetHandle ("sharedApplication")); +// public static partial class GtkWorkarounds +// { +// public static void Terminate () +// { +// #if MAC +// var app = Mac.Messaging.IntPtr_objc_msgSend ( +// ObjCRuntime.Class.GetHandle ("NSApplication"), +// ObjCRuntime.Selector.GetHandle ("sharedApplication")); - Mac.Messaging.void_objc_msgSend_IntPtr (app, ObjCRuntime.Selector.GetHandle ("terminate:"), IntPtr.Zero); -#endif - } - } +// Mac.Messaging.void_objc_msgSend_IntPtr (app, ObjCRuntime.Selector.GetHandle ("terminate:"), IntPtr.Zero); +// #endif +// } +// } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs index cf282490687..fccf12b8ed0 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs @@ -575,7 +575,7 @@ void CreateLayout () layout.Dispose (); layout = PangoUtil.CreateLayout (parent); - layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); + //layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); layout.SetText (label ?? ""); layout.Alignment = Pango.Alignment.Center; layout.GetPixelSize (out w, out h); @@ -621,10 +621,10 @@ public void Draw (Cairo.Context cr, Cairo.Rectangle rectangle) if (Active) { cr.SetSourceColor (Styles.SubTabBarActiveTextColor.ToCairoColor ()); - layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11, Pango.Weight.Bold); + //layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11, Pango.Weight.Bold); } else { cr.SetSourceColor (Styles.SubTabBarTextColor.ToCairoColor ()); - layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); + //layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); } // Pango.Layout.Width is in pango units diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipPopoverWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipPopoverWindow.cs index 14c9009a074..e81328f1bec 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipPopoverWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipPopoverWindow.cs @@ -59,7 +59,7 @@ public static TooltipPopoverWindow Create (bool tryNative = true) public TooltipPopoverWindow () : base (PopupType.Tooltip) { Theme.SetBackgroundColor (Styles.PopoverWindow.DefaultBackgroundColor); - Theme.Font = Xwt.Drawing.Font.FromName (IdeServices.FontService.SansFontName).WithScaledSize (Styles.FontScale11); + //Theme.Font = Xwt.Drawing.Font.FromName (IdeServices.FontService.SansFontName).WithScaledSize (Styles.FontScale11); ShowArrow = true; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.BuildOutputView/BuildOutputTreeCellView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.BuildOutputView/BuildOutputTreeCellView.cs index e055a257743..3e3371a2b89 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.BuildOutputView/BuildOutputTreeCellView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.BuildOutputView/BuildOutputTreeCellView.cs @@ -16,10 +16,10 @@ static class Styles public static Xwt.Drawing.Color CellTextColor { get; internal set; } public static Xwt.Drawing.Color CellTextSelectionColor { get; internal set; } public static Xwt.Drawing.Color CellTextSkippedColor { get; internal set; } - public static Xwt.Drawing.Color CellTextSkippedSelectionColor { get; internal set; } + public static Xwt.Drawing.Color CellTextSkippedSelectionColor { get; internal set; } public static Xwt.Drawing.Color LinkForegroundColor { get; internal set; } public static Xwt.Drawing.Color SearchMatchFocusedBackgroundColor { get; internal set; } - public static Xwt.Drawing.Color SearchMatchUnfocusedBackgroundColor { get; internal set; } + public static Xwt.Drawing.Color SearchMatchUnfocusedBackgroundColor { get; internal set; } public static Xwt.Drawing.Color CellTextSelectionColorSecundary { get; internal set; } @@ -28,7 +28,7 @@ static class Styles public static Color CellWarningBackgroundColor { get; set; } public static Color CellWarningLineBackgroundColor { get; set; } - + static Styles () { LoadStyles (); @@ -72,8 +72,8 @@ public static Color GetTextColor (BuildOutputNode buildOutputNode, bool isSelect { if (isSelected) { return CellTextSelectionColor; - } - + } + if (buildOutputNode.NodeType == BuildOutputNodeType.TargetSkipped) { return CellTextSkippedColor; } @@ -103,63 +103,63 @@ static class Resources public static readonly Xwt.Drawing.Image WarningIconSmall = ImageService.GetIcon (Ide.Gui.Stock.BuildWarningSmall, Gtk.IconSize.Menu); public static readonly Xwt.Drawing.Image FolderIcon = ImageService.GetIcon (Ide.Gui.Stock.OpenFolder, Gtk.IconSize.Menu); public static readonly Xwt.Drawing.Image EmptyIcon = ImageService.GetIcon (Ide.Gui.Stock.Empty); - } - - enum TextSelectionState - { - Clicked, - Selecting, - Selected //selection is finished but we want continue drawing the selection - } - - class TextSelection where T : class - { - const int SelectionDistancePixel = 1; - - Point selectionStartingPoint; - int selectionStart; + } + + enum TextSelectionState + { + Clicked, + Selecting, + Selected //selection is finished but we want continue drawing the selection + } + + class TextSelection where T : class + { + const int SelectionDistancePixel = 1; + + Point selectionStartingPoint; + int selectionStart; int selectionEnd; - - public T Content { get; private set; } - - public TextSelectionState State { get; private set; } = TextSelectionState.Clicked; - public int Index => Math.Min (selectionStart, selectionEnd); - public int Length => Math.Abs (selectionEnd - selectionStart) + 1; - - public bool IsStarting (T currentContent) => State != TextSelectionState.Selected && currentContent == Content; - - public bool IsShown (T currentContent) => (State == TextSelectionState.Selecting || State == TextSelectionState.Selected) && currentContent == Content; - - public void Stop () - { - State = TextSelectionState.Selected; - } - - public void Set (int pos, Point position) - { - selectionEnd = pos; - - if (State == TextSelectionState.Clicked && Away (selectionStartingPoint, position, SelectionDistancePixel)) { - State = TextSelectionState.Selecting; - } - } - - static bool Away (Point first, Point second, double maxPixel) - { - if (Math.Abs (first.X - second.X) > maxPixel) - return true; - if (Math.Abs (first.Y - second.Y) > maxPixel) - return true; - return false; - } - - public void Start (Point position, int pos, T content) - { + + public T Content { get; private set; } + + public TextSelectionState State { get; private set; } = TextSelectionState.Clicked; + public int Index => Math.Min (selectionStart, selectionEnd); + public int Length => Math.Abs (selectionEnd - selectionStart) + 1; + + public bool IsStarting (T currentContent) => State != TextSelectionState.Selected && currentContent == Content; + + public bool IsShown (T currentContent) => (State == TextSelectionState.Selecting || State == TextSelectionState.Selected) && currentContent == Content; + + public void Stop () + { + State = TextSelectionState.Selected; + } + + public void Set (int pos, Point position) + { + selectionEnd = pos; + + if (State == TextSelectionState.Clicked && Away (selectionStartingPoint, position, SelectionDistancePixel)) { + State = TextSelectionState.Selecting; + } + } + + static bool Away (Point first, Point second, double maxPixel) + { + if (Math.Abs (first.X - second.X) > maxPixel) + return true; + if (Math.Abs (first.Y - second.Y) > maxPixel) + return true; + return false; + } + + public void Start (Point position, int pos, T content) + { selectionStart = selectionEnd = pos; State = TextSelectionState.Clicked; selectionStartingPoint = position; - Content = content; - } + Content = content; + } } class BuildOutputTreeCellView : CanvasCellView @@ -198,30 +198,30 @@ class ViewStatus public bool DrawsTopLine { get; set; } public bool DrawsBottomLine { get; set; } - - public bool Expanded { - get { return expanded; } + + public bool Expanded { + get { return expanded; } set { - if (expanded != value) { - expanded = value; + if (expanded != value) { + expanded = value; layout.Width = layout.Height = -1; Reload (); CalculateLayout (LastRenderBounds); - } - } + } + } } internal bool CalculateLayout (Rectangle cellArea) - { - // Relayouting is expensive and not required if the size didn't change. Just update the locations in that case. + { + // Relayouting is expensive and not required if the size didn't change. Just update the locations in that case. if (!LastRenderBounds.IsEmpty && LastRenderBounds.Contains (LastRenderLayoutBounds) && cellArea.Size == LastRenderBounds.Size) { LastRenderExpanderBounds = LastRenderExpanderBounds.Offset (-LastRenderBounds.X, -LastRenderBounds.Y).Offset (cellArea.X, cellArea.Y); LastRenderLayoutBounds = LastRenderLayoutBounds.Offset (-LastRenderBounds.X, -LastRenderBounds.Y).Offset (cellArea.X, cellArea.Y); LastRenderImageBounds = LastRenderImageBounds.Offset (-LastRenderBounds.X, -LastRenderBounds.Y).Offset (cellArea.X, cellArea.Y); LastRenderBounds = cellArea; - return true; // no resize is required + return true; // no resize is required } var imageRect = Rectangle.Zero; @@ -262,34 +262,34 @@ internal bool CalculateLayout (Rectangle cellArea) } layoutBounds.Height = textSize.Height; - layoutBounds.Y += LayoutYPadding; + layoutBounds.Y += LayoutYPadding; LastRenderImageBounds = imageRect; LastRenderExpanderBounds = expanderRect; LastRenderLayoutBounds = layoutBounds; - LastRenderBounds = cellArea; + LastRenderBounds = cellArea; - // check that the text still fits into the cell + // check that the text still fits into the cell if (!cellArea.Contains (layoutBounds)) - return false; // resize required - // if the cell is too large, we need to resize it + return false; // resize required + // if the cell is too large, we need to resize it if (Expanded && Math.Abs (layoutBounds.Height - LayoutYPadding - cellArea.Height) > 1) - return false; // resize required + return false; // resize required return true; } public BuildOutputNode Node { get; private set; } readonly public Image Icon; - public bool IsRootNode => Node.Parent == null; - + public bool IsRootNode => Node.Parent == null; + public bool HasIcon => Icon != Resources.EmptyIcon; public ViewStatus (BuildOutputNode node) { if (node == null) throw new ArgumentNullException (nameof (node)); - Node = node; + Node = node; Icon = Node.GetImage (); layout.Font = GetFont (node); } @@ -319,12 +319,12 @@ public void Reload () // the first line to be always aligned to the left icon in all states. // The heights calculated here will be used to always report the static // height in collapsed state and to calculate the padding. - if (!Expanded || CollapsedLayoutHeight < 0) { - layout.Trimming = TextTrimming.WordElipsis; - var textSize = layout.GetSize (); - CollapsedLayoutHeight = textSize.Height; - CollapsedRowHeight = Math.Max (textSize.Height, ImageSize); - LayoutYPadding = (CollapsedRowHeight - CollapsedLayoutHeight) * .5; + if (!Expanded || CollapsedLayoutHeight < 0) { + layout.Trimming = TextTrimming.WordElipsis; + var textSize = layout.GetSize (); + CollapsedLayoutHeight = textSize.Height; + CollapsedRowHeight = Math.Max (textSize.Height, ImageSize); + LayoutYPadding = (CollapsedRowHeight - CollapsedLayoutHeight) * .5; ExpanderYPadding = (CollapsedRowHeight - BuildExpandIcon.Height) * .5; IconYPadding = (CollapsedRowHeight - ImageSize) * .5; } @@ -336,17 +336,17 @@ public TextLayout GetUnconstrainedLayout () { layout.Width = layout.Height = -1; return layout; - } + } internal string Duration { get; private set; } - - internal void Initialize (bool isShowingDiagnostics) - { + + internal void Initialize (bool isShowingDiagnostics) + { DrawsBottomLine = Node.Next == null || !(Node.Next.NodeType == BuildOutputNodeType.Error || Node.Next.NodeType == BuildOutputNodeType.Warning); DrawsTopLine = Node.Previous == null || !(Node.Previous.NodeType == BuildOutputNodeType.Error || Node.Previous.NodeType == BuildOutputNodeType.Warning); - Duration = Node.GetDurationAsString (isShowingDiagnostics); - Reload (); - } + Duration = Node.GetDurationAsString (isShowingDiagnostics); + Reload (); + } } const int BuildTypeRowContentPadding = 6; @@ -362,7 +362,7 @@ internal void Initialize (bool isShowingDiagnostics) const int MinLayoutWidth = 30; const int DefaultExpandClickDelay = 250; - + DateTime lastExpanderClick = DateTime.Now; public Color StrongSelectionColor { get; set; } @@ -385,10 +385,10 @@ internal void Initialize (bool isShowingDiagnostics) string GetInformationMessage (BuildOutputNode buildOutputNode) => GettextCatalog.GetString ("{0} | {1} Started at {2}", buildOutputNode.Configuration, buildOutputNode.Platform, buildOutputNode.StartTime.ToString ("h:m tt on MMM d, yyyy")); - internal bool IsViewClickable (BuildOutputNode node, Point position) + internal bool IsViewClickable (BuildOutputNode node, Point position) { var view = GetViewStatus (node); - return !view.LastRenderExpanderBounds.Contains (position) && view.LastRenderBounds.Contains (position); + return !view.LastRenderExpanderBounds.Contains (position) && view.LastRenderBounds.Contains (position); } static Font defaultFont; @@ -405,7 +405,7 @@ static BuildOutputTreeCellView () .WithSize (FontSize); defaultBoldFont = fontName.WithWeight (FontWeight.Bold); defaultFont = fontName.WithWeight (FontWeight.Normal); - monospaceFont = IdeServices.FontService.MonospaceFont.ToXwtFont ().WithSize (FontSize); + //monospaceFont = IdeServices.FontService.MonospaceFont.ToXwtFont ().WithSize (FontSize); } public BuildOutputTreeCellView (IBuildOutputContextProvider context) @@ -455,11 +455,11 @@ void FillCellBackground (Context ctx, BuildOutputNode buildOutputNode, ViewStatu } else if (buildOutputNode.NodeType == BuildOutputNodeType.Warning) { FillCellBackground (ctx, Styles.CellWarningBackgroundColor); - if (status.DrawsTopLine) { + if (status.DrawsTopLine) { DrawTopLine (ctx, Styles.CellWarningLineBackgroundColor); } - if (status.DrawsBottomLine) { + if (status.DrawsBottomLine) { DrawBottomLine (ctx, Styles.CellWarningLineBackgroundColor); } } @@ -504,12 +504,12 @@ protected override void OnDraw (Context ctx, Xwt.Rectangle cellArea) status.LastRenderBounds = cellArea; - var layout = status.layout; + var layout = status.layout; var layoutBounds = status.LastRenderLayoutBounds; - - //Draw the image row - if (status.HasIcon) { - //Draw the image row + + //Draw the image row + if (status.HasIcon) { + //Draw the image row DrawImage (ctx, cellArea, status.Icon, status.LastRenderImageBounds.X, ImageSize, isSelected, status.IconYPadding); } @@ -526,8 +526,8 @@ protected override void OnDraw (Context ctx, Xwt.Rectangle cellArea) ctx.DrawTextLayout (layout, layoutBounds.X, layoutBounds.Y); // Draw right hand expander - if (!status.LastRenderExpanderBounds.IsEmpty) { - // Draw the image + if (!status.LastRenderExpanderBounds.IsEmpty) { + // Draw the image Image icon; if (status.Expanded) icon = BuildCollapseIcon; @@ -569,9 +569,9 @@ protected override void OnDraw (Context ctx, Xwt.Rectangle cellArea) size = layout.GetSize (); status.WarningsRectangle.Width = size.Width + ImageSize + 2; - status.WarningsRectangle.Height = size.Height; - - //Right area // based in our DefaultInformationContainerWidth + status.WarningsRectangle.Height = size.Height; + + //Right area // based in our DefaultInformationContainerWidth startX = cellArea.X + (cellArea.Width - DefaultInformationContainerWidth); //Draw of duration based in startX position @@ -583,15 +583,15 @@ protected override void OnDraw (Context ctx, Xwt.Rectangle cellArea) } } - double DrawNodeDuration (Context ctx, Rectangle cellArea, string duration, double textStartX, double padding) - { + double DrawNodeDuration (Context ctx, Rectangle cellArea, string duration, double textStartX, double padding) + { var size = DrawText (ctx, cellArea, textStartX, duration, padding, defaultFont, DefaultInformationContainerWidth).GetSize (); textStartX += size.Width + 10; - return textStartX; + return textStartX; } void DrawNodeInformation (Context ctx, Xwt.Rectangle cellArea, BuildOutputNode buildOutputNode, double padding, bool isSelected, int imageSize, int imagePadding, ViewStatus status) - { + { if (!buildOutputNode.HasChildren) { if (buildOutputNode.NodeType == BuildOutputNodeType.Error || buildOutputNode.NodeType == BuildOutputNodeType.Warning) { if (isSelected) { @@ -619,10 +619,10 @@ void DrawNodeInformation (Context ctx, Xwt.Rectangle cellArea, BuildOutputNode b return; } - UpdateInformationTextColor (ctx, isSelected); - - //Right area // based in our DefaultInformationContainerWidth - var textStartX = cellArea.X + (cellArea.Width - DefaultInformationContainerWidth); + UpdateInformationTextColor (ctx, isSelected); + + //Right area // based in our DefaultInformationContainerWidth + var textStartX = cellArea.X + (cellArea.Width - DefaultInformationContainerWidth); //Duration text var duration = status.Duration; @@ -662,10 +662,10 @@ void DrawNodeInformation (Context ctx, Xwt.Rectangle cellArea, BuildOutputNode b static TextLayout CreateTextLayout (Xwt.Rectangle cellArea, string text, Font font, TextTrimming trimming = TextTrimming.WordElipsis, bool underline = false, double width = 0) { - var descriptionTextLayout = new TextLayout { - Font = font, - Text = text, - Trimming = trimming + var descriptionTextLayout = new TextLayout { + Font = font, + Text = text, + Trimming = trimming }; if (underline) { @@ -726,8 +726,8 @@ protected override Size OnGetRequiredSize (SizeConstraint widthConstraint) if (widthConstraint.IsConstrained) minWidth = Math.Max (minWidth, widthConstraint.AvailableSize); - // in collapsed state we have always the same height and require the minimal width - // if the layout height has not been calculated yet, use the ImageSize for the height + // in collapsed state we have always the same height and require the minimal width + // if the layout height has not been calculated yet, use the ImageSize for the height if (!status.Expanded) { return new Size (minWidth, status.CollapsedRowHeight > -1 ? status.CollapsedRowHeight : ImageSize); } @@ -837,19 +837,19 @@ protected override void OnButtonPressed (ButtonEventArgs args) } if (args.Button == PointerButton.Left && status.LastRenderLayoutBounds.Contains (args.Position)) { - var pos = status.layout.GetIndexFromCoordinates (args.Position.X - status.LastRenderLayoutBounds.X, args.Position.Y - status.LastRenderLayoutBounds.Y); - if (pos != -1) { - if (TextSelection == null) { - TextSelection = new TextSelection (); - } - TextSelection.Start (args.Position, pos, node); - } else { - TextSelection = null; - } + var pos = status.layout.GetIndexFromCoordinates (args.Position.X - status.LastRenderLayoutBounds.X, args.Position.Y - status.LastRenderLayoutBounds.Y); + if (pos != -1) { + if (TextSelection == null) { + TextSelection = new TextSelection (); + } + TextSelection.Start (args.Position, pos, node); + } else { + TextSelection = null; + } QueueDraw (); } - + //HACK: to avoid automatic scroll behaviour in Gtk (we handle the behaviour) //we only want break the normal click behaviour of treeview, in cases when label size is bigger than tree height var treeView = ParentWidget as TreeView; @@ -862,20 +862,20 @@ protected override void OnButtonPressed (ButtonEventArgs args) protected override void OnButtonReleased (ButtonEventArgs args) { - if (TextSelection != null) { - if (TextSelection.State == TextSelectionState.Selecting) { - TextSelection.Stop (); - QueueDraw (); - } else if (TextSelection.State == TextSelectionState.Clicked) { - ClearSelection (); - } - } + if (TextSelection != null) { + if (TextSelection.State == TextSelectionState.Selecting) { + TextSelection.Stop (); + QueueDraw (); + } else if (TextSelection.State == TextSelectionState.Clicked) { + ClearSelection (); + } + } base.OnButtonReleased (args); - } - + } + public void ClearSelection () { - TextSelection = null; + TextSelection = null; QueueDraw (); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs index 0b8ce97d250..945a736b0df 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs @@ -159,9 +159,9 @@ void SetFont () if (noMatchFont != null) noMatchFont.Dispose (); - itemFont = IdeServices.FontService.MonospaceFont.Copy (); - categoryFont = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); - noMatchFont = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); + //itemFont = IdeServices.FontService.MonospaceFont.Copy (); + //categoryFont = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); + //noMatchFont = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); var newItemFontSize = itemFont.Size; var newCategoryFontSize = categoryFont.Size; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindow.cs index 28e08143c20..8628c05ec50 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindow.cs @@ -161,7 +161,7 @@ void UpdateStyle () scheme = SyntaxHighlightingService.GetDefaultColorStyle (IdeApp.Preferences.UserInterfaceTheme); Theme.SetSchemeColors (scheme); - Theme.Font = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11).ToXwtFont (); + //Theme.Font = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11).ToXwtFont (); Theme.ShadowColor = Styles.PopoverWindow.ShadowColor; foreColor = Styles.PopoverWindow.DefaultTextColor.ToCairoColor (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/RoslynCompletionData.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/RoslynCompletionData.cs index 5aa3a95a461..d50641e6f9f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/RoslynCompletionData.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/RoslynCompletionData.cs @@ -337,7 +337,7 @@ internal static async Task CreateTooltipInformation (Microso } else { markup.AppendTaggedText (theme, taggedParts.Take (i)); markup.Append (""); markup.AppendLine (); markup.AppendLine (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/SignatureHelpParameterHintingData.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/SignatureHelpParameterHintingData.cs index 4a9cc06aca7..57f7c823f88 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/SignatureHelpParameterHintingData.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/SignatureHelpParameterHintingData.cs @@ -24,16 +24,16 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -using System.Text; -using System.Threading; -using System.Threading.Tasks; +using System.Text; +using System.Threading; +using System.Threading.Tasks; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.SignatureHelp; +using Microsoft.CodeAnalysis.SignatureHelp; using MonoDevelop.Core; using MonoDevelop.Ide.CodeCompletion; using MonoDevelop.Ide.Editor; using MonoDevelop.Ide.Editor.Highlighting; -using System.Collections; +using System.Collections; using System.Collections.Generic; using System.Linq; using MonoDevelop.Ide.Fonts; @@ -43,82 +43,82 @@ namespace MonoDevelop.Ide.CodeCompletion { /// /// SignatureHelpItem is internal, therefore this class has only internal visibility. - /// - [Obsolete] - class SignatureHelpParameterHintingData : Ide.CodeCompletion.ParameterHintingData - { - public SignatureHelpParameterHintingData (SignatureHelpItem item) + /// + [Obsolete] + class SignatureHelpParameterHintingData : Ide.CodeCompletion.ParameterHintingData + { + public SignatureHelpParameterHintingData (SignatureHelpItem item) { if (item == null) throw new System.ArgumentNullException (nameof (item)); - Item = item; - } - - public SignatureHelpItem Item { get; } - - public override int ParameterCount => Item.Parameters.Length; - - public override bool IsParameterListAllowed => Item.IsVariadic; - + Item = item; + } + + public SignatureHelpItem Item { get; } + + public override int ParameterCount => Item.Parameters.Length; + + public override bool IsParameterListAllowed => Item.IsVariadic; + public override string GetParameterName (int parameter) => Item.Parameters [parameter].Name; - public override bool Equals (object obj) - { - var other = obj as SignatureHelpParameterHintingData; - if (other == null) - return false; - return Item.ToString () == other.Item.ToString (); + public override bool Equals (object obj) + { + var other = obj as SignatureHelpParameterHintingData; + if (other == null) + return false; + return Item.ToString () == other.Item.ToString (); } public override int GetHashCode () { return Item.ToString ().GetHashCode (); } - - const int MaxParamColumnCount = 100; - public override Task CreateTooltipInformation (TextEditor editor, DocumentContext ctx, int currentParameter, bool smartWrap, CancellationToken cancelToken) - { - var tt = new TooltipInformation (); + + const int MaxParamColumnCount = 100; + public override Task CreateTooltipInformation (TextEditor editor, DocumentContext ctx, int currentParameter, bool smartWrap, CancellationToken cancelToken) + { + var tt = new TooltipInformation (); var markup = new StringBuilder (); var theme = SyntaxHighlightingService.GetIdeFittingTheme (DefaultSourceEditorOptions.Instance.GetEditorTheme ()); - markup.AppendTaggedText (theme, Item.PrefixDisplayParts); - var prefixLength = Item.PrefixDisplayParts.GetFullText ().Length; - var prefixSpacer = new string (' ', prefixLength); - var col = 0; - var separatorLength = Item.SeparatorDisplayParts.GetFullText ().Length; - + markup.AppendTaggedText (theme, Item.PrefixDisplayParts); + var prefixLength = Item.PrefixDisplayParts.GetFullText ().Length; + var prefixSpacer = new string (' ', prefixLength); + var col = 0; + var separatorLength = Item.SeparatorDisplayParts.GetFullText ().Length; + for (int i = 0; i < Item.Parameters.Length; i++) { - if (i > 0) { - markup.AppendTaggedText (theme, Item.SeparatorDisplayParts); - col += separatorLength; + if (i > 0) { + markup.AppendTaggedText (theme, Item.SeparatorDisplayParts); + col += separatorLength; } - if (col > MaxParamColumnCount) { - markup.AppendLine (); - markup.Append (prefixSpacer); - col = 0; + if (col > MaxParamColumnCount) { + markup.AppendLine (); + markup.Append (prefixSpacer); + col = 0; } - var p = Item.Parameters [i]; - if (i == currentParameter) - markup.Append (""); - if (p.IsOptional) { - markup.Append ("["); - col++; - } - markup.AppendTaggedText (theme, p.DisplayParts); + var p = Item.Parameters [i]; + if (i == currentParameter) + markup.Append (""); + if (p.IsOptional) { + markup.Append ("["); + col++; + } + markup.AppendTaggedText (theme, p.DisplayParts); col += p.DisplayParts.GetFullText ().Length; - if (p.IsOptional) { - markup.Append ("]"); - col++; - } - if (i == currentParameter) - markup.Append (""); + if (p.IsOptional) { + markup.Append ("]"); + col++; + } + if (i == currentParameter) + markup.Append (""); } - + markup.AppendTaggedText (theme, Item.SuffixDisplayParts); List documentation; @@ -130,9 +130,9 @@ public override Task CreateTooltipInformation (TextEditor ed } if (documentation.Count > 0) { - markup.Append (""); + //markup.Append (""); markup.AppendLine (); markup.AppendLine (); markup.AppendTaggedText (theme, documentation, 0, MaxParamColumnCount); @@ -150,7 +150,7 @@ public override Task CreateTooltipInformation (TextEditor ed } if (documentation.Count > 0) { markup.Append (""); markup.AppendLine (); markup.AppendLine (); @@ -163,10 +163,10 @@ public override Task CreateTooltipInformation (TextEditor ed } } - tt.SignatureMarkup = markup.ToString (); - return Task.FromResult (tt); + tt.SignatureMarkup = markup.ToString (); + return Task.FromResult (tt); } static readonly List EmptyTaggedTextList = new List (); - } + } } \ No newline at end of file diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs index b21841d3d32..e4eaa662bf9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs @@ -275,12 +275,12 @@ internal void SetDefaultScheme () foreColor = Styles.PopoverWindow.DefaultTextColor.ToCairoColor (); headLabel.ModifyFg (StateType.Normal, foreColor.ToGdkColor ()); headLabel.FontDescription = IdeServices.FontService.GetFontDescription ("Editor").CopyModified (Styles.FontScale11); - Theme.Font = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11).ToXwtFont (); + //Theme.Font = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11).ToXwtFont (); Theme.ShadowColor = Styles.PopoverWindow.ShadowColor; - #pragma warning disable CS0612 // Type or member is obsolete - if (this.Visible) - ShowOverload (); - #pragma warning restore CS0612 + #pragma warning disable CS0612 // Type or member is obsolete + if (this.Visible) + ShowOverload (); + #pragma warning restore CS0612 } public TooltipInformationWindow () @@ -323,18 +323,18 @@ public TooltipInformationWindow () protected override bool OnPagerLeftClicked () - { -#pragma warning disable CS0612 // Type or member is obsolete - OverloadLeft (); -#pragma warning restore CS0612 // Type or member is obsolete + { +#pragma warning disable CS0612 // Type or member is obsolete + OverloadLeft (); +#pragma warning restore CS0612 // Type or member is obsolete return base.OnPagerLeftClicked (); } protected override bool OnPagerRightClicked () - { -#pragma warning disable CS0612 // Type or member is obsolete - OverloadRight (); -#pragma warning restore CS0612 // Type or member is obsolete + { +#pragma warning disable CS0612 // Type or member is obsolete + OverloadRight (); +#pragma warning restore CS0612 // Type or member is obsolete return base.OnPagerRightClicked (); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.TextMate/ShowTextMateScopesHandler.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.TextMate/ShowTextMateScopesHandler.cs index 294ee455e5d..5f2fb94c3f6 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.TextMate/ShowTextMateScopesHandler.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.TextMate/ShowTextMateScopesHandler.cs @@ -54,7 +54,7 @@ protected override void Run () var window = new TooltipPopoverWindow (); - window.Markup = "" + sb.ToString () + ""; + //window.Markup = "" + sb.ToString () + ""; editor.ShowTooltipWindow (window); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs index 1eecc240c04..132537ece42 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs @@ -168,7 +168,7 @@ public virtual void ShowTooltipWindow (TextEditor editor, Window tipWindow, Tool var xwtWindow = (Xwt.WindowFrame)tipWindow; - xwtWindow.Location = CalculateWindowLocation (editor, item, xwtWindow, mouseX, mouseY, origin); + //xwtWindow.Location = CalculateWindowLocation (editor, item, xwtWindow, mouseX, mouseY, origin); var gtkWindow = Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk).GetNativeWindow (xwtWindow) as Gtk.Window; if (gtkWindow != null) @@ -177,40 +177,40 @@ public virtual void ShowTooltipWindow (TextEditor editor, Window tipWindow, Tool xwtWindow.Show (); } - protected virtual Xwt.Point CalculateWindowLocation (TextEditor editor, TooltipItem item, Xwt.WindowFrame xwtWindow, int mouseX, int mouseY, Xwt.Point origin) - { - int w; - double xalign; - GetRequiredPosition (editor, xwtWindow, out w, out xalign); - w += 10; - - var allocation = GetAllocation (editor); - int x = (int)(mouseX + origin.X + allocation.X); - int y = (int)(mouseY + origin.Y + allocation.Y); - Gtk.Widget widget = editor; - var geometry = widget.Screen.GetUsableMonitorGeometry (widget.Screen.GetMonitorAtPoint (x, y)); - - x -= (int)((double)w * xalign); - y += 10; - - if (x + w >= geometry.X + geometry.Width) - x = geometry.X + geometry.Width - w; - if (x < geometry.Left) - x = geometry.Left; - - int h = (int)xwtWindow.Size.Height; - if (y + h >= geometry.Y + geometry.Height) - y = geometry.Y + geometry.Height - h; - if (y < geometry.Top) - y = geometry.Top; + // protected virtual Xwt.Point CalculateWindowLocation (TextEditor editor, TooltipItem item, Xwt.WindowFrame xwtWindow, int mouseX, int mouseY, Xwt.Point origin) + // { + // int w; + // double xalign; + // GetRequiredPosition (editor, xwtWindow, out w, out xalign); + // w += 10; + + // var allocation = GetAllocation (editor); + // int x = (int)(mouseX + origin.X + allocation.X); + // int y = (int)(mouseY + origin.Y + allocation.Y); + // Gtk.Widget widget = editor; + // var geometry = widget.Screen.GetUsableMonitorGeometry (widget.Screen.GetMonitorAtPoint (x, y)); + + // x -= (int)((double)w * xalign); + // y += 10; + + // if (x + w >= geometry.X + geometry.Width) + // x = geometry.X + geometry.Width - w; + // if (x < geometry.Left) + // x = geometry.Left; + + // int h = (int)xwtWindow.Size.Height; + // if (y + h >= geometry.Y + geometry.Height) + // y = geometry.Y + geometry.Height - h; + // if (y < geometry.Top) + // y = geometry.Top; - xwtWindow.Location = new Xwt.Point(x, y); - var gtkWindow = Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk3).GetNativeWindow (xwtWindow) as Gtk.Window; - if (gtkWindow != null) - gtkWindow.ShowAll (); - else - xwtWindow.Show (); - } + // xwtWindow.Location = new Xwt.Point(x, y); + // var gtkWindow = Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk3).GetNativeWindow (xwtWindow) as Gtk.Window; + // if (gtkWindow != null) + // gtkWindow.ShowAll (); + // else + // xwtWindow.Show (); + // } protected bool IsDisposed { get; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs index e159fcd599a..d136b3ea46d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs @@ -61,7 +61,7 @@ void LoadDefaults () #pragma warning disable 618 defaultMonospaceFontName = desktopService.DefaultMonospaceFont; defaultMonospaceFont = FontDescription.FromString (defaultMonospaceFontName); - defaultSansFontName = DesktopService.DefaultSansFont; + //defaultSansFontName = DesktopService.DefaultSansFont; defaultSansFont = FontDescription.FromString (defaultSansFontName); #pragma warning restore 618 } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs index 45c555be9f2..e45d64e395e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs @@ -515,7 +515,7 @@ void HandleCustomFontChanged (object sender, EventArgs e) void UpdateCustomFont () { - textEditorControl.ModifyFont (IdeApp.Preferences.CustomOutputPadFont ?? IdeServices.FontService.MonospaceFont); + //textEditorControl.ModifyFont (IdeApp.Preferences.CustomOutputPadFont ?? IdeServices.FontService.MonospaceFont); } //mechanism to to batch copy text when large amounts are being dumped diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeNodeNavigator.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeNodeNavigator.cs index c1ee813b8cc..6cf22514a51 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeNodeNavigator.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeNodeNavigator.cs @@ -108,7 +108,7 @@ public bool Selected { if (value != Selected) { ExpandToNode (); try { - pad.ClearSelectOnRelease (); + //pad.ClearSelectOnRelease (); tree.Selection.SelectIter (currentIter); tree.SetCursor (store.GetPath (currentIter), pad.CompleteColumn, false); } catch (Exception) {} diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs index ec1f225ab58..59cfe88f284 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs @@ -162,14 +162,14 @@ async void SaveAndQuit (object o, EventArgs e) Sensitive = false; List saveTasks = new List (); - tsFiles.Foreach (delegate (ITreeModel model, TreePath path, TreeIter iter) { - var window = tsFiles.GetValue (iter, 2) as SdiWorkspaceWindow; - if (window == null) - return false; - if ((bool)tsFiles.GetValue (iter, 1)) - saveTasks.Add (doc.Save ()); - return false; - }); + // tsFiles.Foreach (delegate (ITreeModel model, TreePath path, TreeIter iter) { + // var window = tsFiles.GetValue (iter, 2) as SdiWorkspaceWindow; + // if (window == null) + // return false; + // if ((bool)tsFiles.GetValue (iter, 1)) + // saveTasks.Add (doc.Save ()); + // return false; + // }); try { await Task.WhenAll (saveTasks); @@ -183,13 +183,13 @@ async void SaveAndQuit (object o, EventArgs e) void Quit (object o, EventArgs e) { - tsFiles.Foreach (delegate (ITreeModel model, TreePath path, TreeIter iter) { - var window = tsFiles.GetValue (iter, 2) as SdiWorkspaceWindow; - if (window == null) - return false; - window.ViewContent.DiscardChanges (); - return false; - }); + //tsFiles.Foreach (delegate (ITreeModel model, TreePath path, TreeIter iter) { + //var window = tsFiles.GetValue (iter, 2) as SdiWorkspaceWindow; + //if (window == null) + // return false; + //window.ViewContent.DiscardChanges (); + //return false; + //}); Respond (Gtk.ResponseType.Ok); Hide (); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs index 0e93473e6a8..467e39a1dde 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs @@ -108,24 +108,25 @@ public FileSelectorDialog (string title, Gtk.FileChooserAction action): base (ti closeWorkspaceCheck.Visible = ShowViewerSelector = false; } - public TextEncoding SelectedEncoding { - get { - if (!ShowEncodingSelector) - return -1; - else if (encodingMenu.Active < firstEncIndex || encodingMenu.Active == selectOption) - return -1; - return TextEncoding.ConversionEncodings [encodingMenu.Active - firstEncIndex].CodePage; - } - set { - for (uint n=0; n < TextEncoding.ConversionEncodings.Length; n++) { - if (TextEncoding.ConversionEncodings [n].CodePage == value) { - encodingMenu.Active = (int)(n + firstEncIndex); - return; - } - } - encodingMenu.Active = 0; - } - } + // public TextEncoding SelectedEncoding { + // get { + // if (!ShowEncodingSelector) + // return -1; + // else if (encodingMenu.Active < firstEncIndex || encodingMenu.Active == selectOption) + // return -1; + // return TextEncoding.ConversionEncodings [encodingMenu.Active - firstEncIndex].CodePage; + // } + // set { + // for (uint n=0; n < TextEncoding.ConversionEncodings.Length; n++) { + + // if (TextEncoding.ConversionEncodings [n].CodePage == value) { + // encodingMenu.Active = (int)(n + firstEncIndex); + // return; + // } + // } + // encodingMenu.Active = 0; + // } + // } public bool ShowEncodingSelector { get { return encodingLabel.Visible; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs index 5f2fe697a77..5f0a9d27373 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs @@ -127,10 +127,10 @@ Control IOptionsPanel.CreatePanelWidget () configurationLabel, GettextCatalog.GetString ("Select a configuration")); - platformCombo.SetCommonAccessibilityAttributes ( - platformCombo.Name, - platformLabel, - GettextCatalog.GetString ("Select a platform")); + //platformCombo.SetCommonAccessibilityAttributes ( + //platformCombo.Name, + //platformLabel, + //GettextCatalog.GetString ("Select a platform")); cbox.Hidden += OnPageHidden; cbox.Shown += OnPageShown; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OpenFileDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OpenFileDialog.cs index 15b069de488..1b4b66678f2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OpenFileDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OpenFileDialog.cs @@ -23,7 +23,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. - + using System; using MonoDevelop.Core; using MonoDevelop.Ide.Extensions; @@ -33,13 +33,13 @@ using Mono.Addins; using System.Text; using MonoDevelop.Projects.Text; - -namespace MonoDevelop.Ide.Gui.Dialogs + +namespace MonoDevelop.Ide.Gui.Dialogs { /// /// Dialog which allows selecting a file to be opened or saved - /// - public class OpenFileDialog: SelectFileDialog + /// + public class OpenFileDialog: SelectFileDialog { public OpenFileDialog () { @@ -54,7 +54,7 @@ public OpenFileDialog (string title, FileChooserAction action) Title = title; Action = action; } - + /// /// Set to true if the encoding selector has to be shown /// @@ -104,7 +104,7 @@ public bool CenterToParent { protected override bool RunDefault () { var win = new FileSelectorDialog (Title, Action.ToGtkAction ()); - win.SelectedEncoding = TextEncoding.GetEncoding (Encoding); + //win.SelectedEncoding = TextEncoding.GetEncoding (Encoding); win.ShowEncodingSelector = ShowEncodingSelector; win.ShowViewerSelector = ShowViewerSelector; bool pathAlreadySet = false; @@ -123,7 +123,7 @@ protected override bool RunDefault () var result = MessageService.RunCustomDialog (win, TransientFor ?? MessageService.RootWindow); if (result == (int)Gtk.ResponseType.Ok) { GetDefaultProperties (win); - data.Encoding = win.SelectedEncoding?.Encoding; + //data.Encoding = win.SelectedEncoding?.Encoding; data.CloseCurrentWorkspace = win.CloseCurrentWorkspace; data.SelectedViewer = win.SelectedViewer; return true; @@ -134,5 +134,5 @@ protected override bool RunDefault () win.Dispose (); } } - } + } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs index cc1fef01f4d..20918f481af 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs @@ -1031,69 +1031,69 @@ bool GetCellPosition (int mx, int my, out int cellx, out int celly, out TreeIter // } // } - HashSet bindingConflicts; - if (keyBindingsPanel.conflicts.TryGetValue (key, out bindingConflicts) && bindingConflicts.Contains (Command)) { - bgColor = Styles.KeyBindingsPanel.KeyConflictBackgroundColor.ToCairoColor (); - fgColor = Styles.KeyBindingsPanel.KeyConflictForegroundColor.ToCairoColor (); - } else if (keyBindingsPanel.duplicates.ContainsKey (key)) { - bgColor = Styles.KeyBindingsPanel.KeyDuplicateBackgroundColor.ToCairoColor (); - fgColor = Styles.KeyBindingsPanel.KeyDuplicateForegroundColor.ToCairoColor (); - } else { - bgColor = Styles.KeyBindingsPanel.KeyBackgroundColor.ToCairoColor (); - fgColor = Styles.KeyBindingsPanel.KeyForegroundColor.ToCairoColor (); - } - - layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); - layout.FontDescription = KeySymbolFont; - layout.GetPixelSize (out w, out h); - - int buttonWidth = w + (2 * KeyHPadding); - int buttonHeight = h + (2 * KeyVPadding); - int x = cell_area.X + xpad; - double y = cell_area.Y + ((cell_area.Height / 2) - (buttonHeight / 2)); - - cr.RoundedRectangle (x, y, buttonWidth, buttonHeight, KeyBgRadius); - cr.LineWidth = 1; - cr.SetSourceColor (bgColor); - cr.FillPreserve (); - cr.SetSourceColor (bgColor); - cr.Stroke (); - - cr.SetSourceColor (fgColor); - cr.MoveTo (x + KeyHPadding, y + KeyVPadding); - cr.ShowLayout (layout); - xpad += buttonWidth + Spacing; - } - } - } - } - - public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - x_offset = y_offset = 0; - if (string.IsNullOrEmpty (Text)) { - width = 0; - height = 0; - return; - } - - using (var layout = new Pango.Layout (widget.PangoContext)) { - height = 0; - width = (int)Xpad; - int w, h, buttonWidth; - foreach (var key in Text.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { - layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); - layout.FontDescription = KeySymbolFont; - layout.GetPixelSize (out w, out h); - if (height == 0) - height = h + (KeyVPadding * 2) + 1; - - buttonWidth = w + (2 * KeyHPadding); - width += buttonWidth + Spacing; - } - } - } + // HashSet bindingConflicts; + // if (keyBindingsPanel.conflicts.TryGetValue (key, out bindingConflicts) && bindingConflicts.Contains (Command)) { + // bgColor = Styles.KeyBindingsPanel.KeyConflictBackgroundColor.ToCairoColor (); + // fgColor = Styles.KeyBindingsPanel.KeyConflictForegroundColor.ToCairoColor (); + // } else if (keyBindingsPanel.duplicates.ContainsKey (key)) { + // bgColor = Styles.KeyBindingsPanel.KeyDuplicateBackgroundColor.ToCairoColor (); + // fgColor = Styles.KeyBindingsPanel.KeyDuplicateForegroundColor.ToCairoColor (); + // } else { + // bgColor = Styles.KeyBindingsPanel.KeyBackgroundColor.ToCairoColor (); + // fgColor = Styles.KeyBindingsPanel.KeyForegroundColor.ToCairoColor (); + // } + + // layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); + // layout.FontDescription = KeySymbolFont; + // layout.GetPixelSize (out w, out h); + + // int buttonWidth = w + (2 * KeyHPadding); + // int buttonHeight = h + (2 * KeyVPadding); + // int x = cell_area.X + xpad; + // double y = cell_area.Y + ((cell_area.Height / 2) - (buttonHeight / 2)); + + // cr.RoundedRectangle (x, y, buttonWidth, buttonHeight, KeyBgRadius); + // cr.LineWidth = 1; + // cr.SetSourceColor (bgColor); + // cr.FillPreserve (); + // cr.SetSourceColor (bgColor); + // cr.Stroke (); + + // cr.SetSourceColor (fgColor); + // cr.MoveTo (x + KeyHPadding, y + KeyVPadding); + // cr.ShowLayout (layout); + // xpad += buttonWidth + Spacing; + // } + // } + // } + // } + + // public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + // { + // base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); + // x_offset = y_offset = 0; + // if (string.IsNullOrEmpty (Text)) { + // width = 0; + // height = 0; + // return; + // } + + // using (var layout = new Pango.Layout (widget.PangoContext)) { + // height = 0; + // width = (int)Xpad; + // int w, h, buttonWidth; + // foreach (var key in Text.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { + // layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); + // layout.FontDescription = KeySymbolFont; + // layout.GetPixelSize (out w, out h); + // if (height == 0) + // height = h + (KeyVPadding * 2) + 1; + + // buttonWidth = w + (2 * KeyHPadding); + // width += buttonWidth + Spacing; + // } + // } + // } // protected override void OnDestroyed() // { // keyBindingsPanel = null; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs index ac643711894..2173d3bfb3e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs @@ -35,8 +35,8 @@ using MonoDevelop.Core; using MonoDevelop.Ide.Gui; using MonoDevelop.Ide.Gui.Components; -using System.Linq; - +using System.Linq; + namespace MonoDevelop.Ide.Gui.Pads.ProjectPad { class ShowAllFilesBuilderExtension: NodeBuilderExtension @@ -141,12 +141,12 @@ public override void BuildChildNodes (ITreeBuilder builder, object dataObject) else if (dataObject is SolutionFolder) folderFiles = ((SolutionFolder)dataObject).Files; - builder.AddChildren (Directory.EnumerateFiles (path) - .Where (file => (project == null || project.Files.GetFile (file) == null) && (folderFiles == null || !folderFiles.Contains (file))) + builder.AddChildren (Directory.EnumerateFiles (path) + .Where (file => (project == null || project.Files.GetFile (file) == null) && (folderFiles == null || !folderFiles.Contains (file))) .Select (file => new SystemFile (file, project))); - - builder.AddChildren (Directory.EnumerateDirectories (path) - .Where (folder => !builder.HasChild (Path.GetFileName (folder), typeof (ProjectFolder))) + + builder.AddChildren (Directory.EnumerateDirectories (path) + .Where (folder => !builder.HasChild (Path.GetFileName (folder), typeof (ProjectFolder))) .Select (folder => new ProjectFolder (folder, project))); } } @@ -248,8 +248,8 @@ ITreeBuilder FindParentFolderNode (string path, Project project, out string last void OnSystemFileAdded (object sender, FileEventArgs args) { - if (Context.Tree.IsDestroyed) - return; + //if (Context.Tree.IsDestroyed) + // return; foreach (FileEventInfo e in args) { Project project = GetProjectForFile (e.FileName); if (project == null) return; @@ -265,8 +265,8 @@ void OnSystemFileAdded (object sender, FileEventArgs args) void OnSystemFileDeleted (object sender, FileEventArgs args) { - if (Context.Tree.IsDestroyed) - return; + //if (Context.Tree.IsDestroyed) + // return; foreach (FileEventInfo e in args) { try { Project project = GetProjectForFile (e.FileName); @@ -302,8 +302,8 @@ void OnSystemFileDeleted (object sender, FileEventArgs args) void OnSystemFileRenamed (object sender, FileCopyEventArgs args) { - if (Context.Tree.IsDestroyed) - return; + //if (Context.Tree.IsDestroyed) + // return; foreach (FileEventInfo e in args) { Project project = GetProjectForFile (e.SourceFile); if (project == null) return; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs index 3cb8f4b0ca7..46cccfbc0b0 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs @@ -124,7 +124,7 @@ void RowActivated (object o, EventArgs e) } Monodoc.Node n = (Monodoc.Node)store.GetValue (iter, 1); - IdeApp.HelpOperations.ShowHelp (n.PublicUrl); + //IdeApp.HelpOperations.ShowHelp (n.PublicUrl); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ConfigurationComboBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ConfigurationComboBox.cs index 96ec15df472..7987710ecde 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ConfigurationComboBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ConfigurationComboBox.cs @@ -84,7 +84,7 @@ public override void SetToolbarStyle (Gtk.Toolbar toolbar) fd = null; } if (toolbar.IconSize == Gtk.IconSize.Menu || toolbar.IconSize == Gtk.IconSize.SmallToolbar) { - fd = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); + //fd = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); } combo.ModifyLabelFont (fd); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs index 74712f2a1dd..30496e5859a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs @@ -67,47 +67,47 @@ internal MonoDevelopStatusBar () // Feedback button - if (FeedbackService.Enabled) { - CustomFrame fr = new CustomFrame (0, 0, 1, 0); - fr.Accessible.Role = Atk.Role.Filler; - var px = Xwt.Drawing.Image.FromResource ("feedback-16.png"); - HBox b = new HBox (false, 3); - b.Accessible.Role = Atk.Role.Filler; - - var im = new Xwt.ImageView (px).ToGtkWidget (); - im.Accessible.Role = Atk.Role.Filler; - b.PackStart (im, false, true, 0); - var label = new Gtk.Label (GettextCatalog.GetString ("Feedback")); - label.Accessible.Role = Atk.Role.Filler; - b.PackStart (label, false, true, 0); - Gtk.Alignment al = new Gtk.Alignment (0f, 0f, 1f, 1f); - al.Accessible.Role = Atk.Role.Filler; - al.RightPadding = 5; - al.LeftPadding = 3; - al.Add (b); - feedbackButton = new MiniButton (al); - feedbackButton.Accessible.SetLabel (GettextCatalog.GetString ("Feedback")); - feedbackButton.Accessible.Description = GettextCatalog.GetString ("Click to send feedback to the development team"); + //if (FeedbackService.Enabled) { + //CustomFrame fr = new CustomFrame (0, 0, 1, 0); + //fr.Accessible.Role = Atk.Role.Filler; + //var px = Xwt.Drawing.Image.FromResource ("feedback-16.png"); + //HBox b = new HBox (false, 3); + //b.Accessible.Role = Atk.Role.Filler; + + //var im = new Xwt.ImageView (px).ToGtkWidget (); + //im.Accessible.Role = Atk.Role.Filler; + //b.PackStart (im, false, true, 0); + //var label = new Gtk.Label (GettextCatalog.GetString ("Feedback")); + //label.Accessible.Role = Atk.Role.Filler; + //b.PackStart (label, false, true, 0); + //Gtk.Alignment al = new Gtk.Alignment (0f, 0f, 1f, 1f); + //al.Accessible.Role = Atk.Role.Filler; + //al.RightPadding = 5; + //al.LeftPadding = 3; + //al.Add (b); + //feedbackButton = new MiniButton (al); + //feedbackButton.Accessible.SetLabel (GettextCatalog.GetString ("Feedback")); + //feedbackButton.Accessible.Description = GettextCatalog.GetString ("Click to send feedback to the development team"); //feedbackButton.BackroundColor = new Gdk.Color (200, 200, 255); - fr.Add (feedbackButton); - mainBox.PackStart (fr, false, false, 0); - feedbackButton.Clicked += HandleFeedbackButtonClicked; - feedbackButton.ButtonPressEvent += HandleFeedbackButtonButtonPressEvent; - ; - feedbackButton.ClickOnRelease = true; - FeedbackService.FeedbackPositionGetter = delegate { - int x, y; - if (feedbackButton.GdkWindow != null) { - feedbackButton.GdkWindow.GetOrigin (out x, out y); - x += feedbackButton.Allocation.Width; - y -= 6; - } else { - x = y = -1; - } - return new Gdk.Point (x, y); - }; - } + //fr.Add (feedbackButton); + //mainBox.PackStart (fr, false, false, 0); + //feedbackButton.Clicked += HandleFeedbackButtonClicked; + //feedbackButton.ButtonPressEvent += HandleFeedbackButtonButtonPressEvent; + //; + //feedbackButton.ClickOnRelease = true; + // FeedbackService.FeedbackPositionGetter = delegate { + // int x, y; + // if (feedbackButton.GdkWindow != null) { + // feedbackButton.GdkWindow.GetOrigin (out x, out y); + // x += feedbackButton.Allocation.Width; + // y -= 6; + // } else { + // x = y = -1; + // } + // return new Gdk.Point (x, y); + // }; + //} // Dock area CustomFrame dfr = new CustomFrame (0, 0, 1, 0); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs index 89b00b0b405..594ff07999b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs @@ -66,7 +66,7 @@ public override void SetToolbarStyle (Gtk.Toolbar toolbar) { if (Style != null) { if (toolbar.IconSize == Gtk.IconSize.Menu || toolbar.IconSize == Gtk.IconSize.SmallToolbar) { - ctx.FontDesc = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); + //ctx.FontDesc = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); } else { ctx.FontDesc = Style.FontDescription; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs index 220f1870dfd..17ebd76e6a9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs @@ -146,7 +146,7 @@ void Build () topLabelHBox.Name = "topLabelHBox"; topLabelHBox.PackStart (topBannerLabel, false, false, 20); topLabelEventBox.Add (topLabelHBox); - ContentArea.PackStart (topBannerTopEdgeLineEventBox, false, false, 0); + //ContentArea.PackStart (topBannerTopEdgeLineEventBox, false, false, 0); ContentArea.PackStart (topLabelEventBox, false, false, 0); ContentArea.PackStart (topBannerBottomEdgeLineEventBox, false, false, 0); // Main templates section. @@ -178,7 +178,7 @@ void Build () templateCategoriesTreeView.Accessible.Description = GettextCatalog.GetString ("Select the project category to see all possible project templates"); templateCategoriesTreeView.BorderWidth = 0; templateCategoriesTreeView.HeadersVisible = false; - templateCategoriesTreeView.Model = templateCategoriesListStore; + //templateCategoriesTreeView.Model = templateCategoriesListStore; templateCategoriesTreeView.SearchColumn = -1; // disable the interactive search templateCategoriesTreeView.AppendColumn (CreateTemplateCategoriesTreeViewColumn ()); templateCategoriesScrolledWindow.Add (templateCategoriesTreeView); @@ -203,7 +203,7 @@ void Build () templatesTreeView.Accessible.SetTitle (GettextCatalog.GetString ("Project Templates")); templatesTreeView.Accessible.Description = GettextCatalog.GetString ("Select the project template"); templatesTreeView.HeadersVisible = false; - templatesTreeView.Model = templatesListStore; + //templatesTreeView.Model = templatesListStore; templatesTreeView.SearchColumn = -1; // disable the interactive search templatesTreeView.AppendColumn (CreateTemplateListTreeViewColumn ()); templatesScrolledWindow.Add (templatesTreeView); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs index df9d1cee8cf..c9ea523635a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs @@ -151,13 +151,13 @@ static void SetLanguageCellData (TreeViewColumn col, CellRenderer renderer, ITre void HandlePopup (SolutionTemplate template, uint eventTime) { if (popupMenu == null) { - popupMenu = new Menu (); - popupMenu.AttachToWidget (this, null); + popupMenu = new Xwt.Menu (); + //popupMenu.AttachToWidget (this, null); } ClearPopupMenuItems (); AddLanguageMenuItems (popupMenu, template); - popupMenu.ModifyBg (StateType.Normal, Styles.NewProjectDialog.TemplateLanguageButtonBackground.ToGdkColor ()); - popupMenu.ShowAll (); + //popupMenu.ModifyBg (StateType.Normal, Styles.NewProjectDialog.TemplateLanguageButtonBackground.ToGdkColor ()); + //popupMenu.ShowAll (); MenuPositionFunc posFunc = (Menu m, out int x, out int y, out bool pushIn) => { Gdk.Rectangle rect = languageCellRenderer.GetLanguageRect (); @@ -166,7 +166,7 @@ void HandlePopup (SolutionTemplate template, uint eventTime) y = screenRect.Bottom; pushIn = false; }; - popupMenu.Popup (null, null, posFunc, 0, eventTime); + //popupMenu.Popup (null, null, posFunc, 0, eventTime); } [GLib.ConnectBefore] @@ -386,21 +386,21 @@ void ShowTemplatesForCategory (TemplateCategory category) { templateTextRenderer.RenderRecentTemplate = false; languageCellRenderer.RenderRecentTemplate = false; - foreach (TemplateCategory subCategory in category.Categories) { - templatesListStore.AppendValues ( - MarkupTopLevelCategoryName (subCategory.Name), - null, - null); - - foreach (SolutionTemplate template in subCategory.Templates) { - if (template.HasProjects || controller.IsNewSolution) { - templatesListStore.AppendValues ( - template.Name, - GetIcon (template.IconId, IconSize.Dnd), - template); - } - } - } + // foreach (TemplateCategory subCategory in category.Categories) { + // templatesListStore.AppendValues ( + // MarkupTopLevelCategoryName (subCategory.Name), + // null, + // null); + + // foreach (SolutionTemplate template in subCategory.Templates) { + // if (template.HasProjects || controller.IsNewSolution) { + // templatesListStore.AppendValues ( + // template.Name, + // GetIcon (template.IconId, IconSize.Dnd), + // template); + // } + // } + // } templatesTreeView.ExpandAll (); } @@ -514,11 +514,11 @@ void SelectRecentTemplatesCategory () { TreeIter iter = TreeIter.Zero; // recent templates entry is always the first one and has no category assigned to it - if (templateCategoriesListStore.GetIterFirst (out iter) && templateCategoriesListStore.GetValue (iter, TemplateCategoryColumn) == null) { - templateCategoriesTreeView.Selection.SelectIter (iter); - TreePath path = templateCategoriesListStore.GetPath (iter); - templateCategoriesTreeView.ScrollToCell (path, null, true, 1, 0); - } + //if (templateCategoriesListStore.GetIterFirst (out iter) && templateCategoriesListStore.GetValue (iter, TemplateCategoryColumn) == null) { + // templateCategoriesTreeView.Selection.SelectIter (iter); + //TreePath path = templateCategoriesListStore.GetPath (iter); + //templateCategoriesTreeView.ScrollToCell (path, null, true, 1, 0); + //} } void SelectFirstSubTemplateCategory () @@ -600,11 +600,11 @@ public async Task MoveToNextPage () try { CanMoveToNextPage = false; // disable all controls on this dialog to prevent users actions - VBox.Sensitive = false; + //VBox.Sensitive = false; await controller.Create (); } catch { // if something goes wrong, we need to enable dialog contols - VBox.Sensitive = true; + //VBox.Sensitive = true; throw; } finally { CanMoveToNextPage = true; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs index cbc3b1c7ac2..e72a81ed343 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs @@ -123,17 +123,17 @@ static bool IsYosemiteOrHigher () // } // } - using (var ctx = CairoHelper.Create (window)) { - using (var layout = new Pango.Layout (widget.PangoContext)) { + // using (var ctx = CairoHelper.Create (window)) { + // using (var layout = new Pango.Layout (widget.PangoContext)) { - Rectangle iconRect = DrawIcon (ctx, widget, cell_area, flags); + // Rectangle iconRect = DrawIcon (ctx, widget, cell_area, flags); - DrawTemplateNameText (window, widget, cell_area, iconRect, flags); - if (RenderRecentTemplate) - DrawCategoryText (ctx, widget, cell_area, iconRect, flags); - } - } - } + // DrawTemplateNameText (window, widget, cell_area, iconRect, flags); + // if (RenderRecentTemplate) + // DrawCategoryText (ctx, widget, cell_area, iconRect, flags); + // } + // } + // } // void DrawTemplateCategoryText (Drawable window, Widget widget, Rectangle cell_area, CellRendererState flags) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs index 3cef30f49ff..20ed1549eea 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs @@ -588,41 +588,41 @@ public string SecondaryTextMarkup { } } - protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - { - StateType st = StateType.Normal; - if ((flags & CellRendererState.Prelit) != 0) - st = StateType.Prelight; - if ((flags & CellRendererState.Focused) != 0) - st = StateType.Normal; - if ((flags & CellRendererState.Insensitive) != 0) - st = StateType.Insensitive; - if ((flags & CellRendererState.Selected) != 0) - st = widget.HasFocus ? StateType.Selected : Gtk.StateType.Active; - - SetupLayout (widget, flags); - - int w, h; - layout.GetPixelSize (out w, out h); - - const int textXOffset = 2; // Shift text up slightly in the row. - int tx = cell_area.X + (int)Xpad; - int ty = cell_area.Y + (cell_area.Height - h) / 2 - textXOffset; - - int textPixelWidth = cell_area.Width - ((int)Xpad * 2) ; - layout.Width = (int)(textPixelWidth * Pango.Scale.PangoScale); - - window.DrawLayout (widget.Style.TextGC (st), tx, ty, layout); - } - - public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - SetupLayout (widget); - - int layoutWidth = 0; - layout.GetPixelSize (out layoutWidth, out height); - } + // protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) + // { + // StateType st = StateType.Normal; + // if ((flags & CellRendererState.Prelit) != 0) + // st = StateType.Prelight; + // if ((flags & CellRendererState.Focused) != 0) + // st = StateType.Normal; + // if ((flags & CellRendererState.Insensitive) != 0) + // st = StateType.Insensitive; + // if ((flags & CellRendererState.Selected) != 0) + // st = widget.HasFocus ? StateType.Selected : Gtk.StateType.Active; + + // SetupLayout (widget, flags); + + // int w, h; + // layout.GetPixelSize (out w, out h); + + // const int textXOffset = 2; // Shift text up slightly in the row. + // int tx = cell_area.X + (int)Xpad; + // int ty = cell_area.Y + (cell_area.Height - h) / 2 - textXOffset; + + // int textPixelWidth = cell_area.Width - ((int)Xpad * 2) ; + // layout.Width = (int)(textPixelWidth * Pango.Scale.PangoScale); + + // window.DrawLayout (widget.Style.TextGC (st), tx, ty, layout); + // } + + // public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + // { + // base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); + // SetupLayout (widget); + + // int layoutWidth = 0; + // layout.GetPixelSize (out layoutWidth, out height); + // } void SetupLayout (Widget widget, CellRendererState flags = 0) { @@ -644,12 +644,12 @@ void SetupLayout (Widget widget, CellRendererState flags = 0) layout.SetMarkup (newmarkup); } - protected override void OnDestroyed () - { - base.OnDestroyed (); - if (layout != null) - layout.Dispose (); - } + // protected override void OnDestroyed () + // { + // base.OnDestroyed (); + // if (layout != null) + // layout.Dispose (); + // } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageTipOfTheDaySection.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageTipOfTheDaySection.cs index 91398ef9345..270455b27ee 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageTipOfTheDaySection.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageTipOfTheDaySection.cs @@ -65,7 +65,7 @@ public WelcomePageTipOfTheDaySection (): base (GettextCatalog.GetString ("Did yo label.Xalign = 0; label.Wrap = true; label.WidthRequest = 200; - label.ModifyFont (IdeServices.FontService.SansFont.CopyModified (Gui.Styles.FontScale11)); + //label.ModifyFont (IdeServices.FontService.SansFont.CopyModified (Gui.Styles.FontScale11)); label.SetPadding (0, 10); label.Text = currentTip != -1 ? tips[currentTip] : ""; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj index 6ef28938438..6c2a317a0ba 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj @@ -33,6 +33,12 @@ + + gio-sharp-3.0 + + + gtk-sharp-3.0 + {FEC19BDA-4904-4005-8C09-68E82E8BEF6A} Mono.Addins.Gui diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs index 1fa14012897..2511de75f68 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs @@ -148,14 +148,14 @@ internal string DefaultMonospaceFont { get { return PlatformService.DefaultMonospaceFont; } } - [Obsolete ("Use FontService")] - public static string DefaultSansFont { - get { return PlatformService.DefaultSansFont; } - } - - public static string PlatformName { - get { return PlatformService.Name; } - } + // [Obsolete ("Use FontService")] + // public static string DefaultSansFont { + // get { return PlatformService.DefaultSansFont; } + // } + + // public static string PlatformName { + // get { return PlatformService.Name; } + // } public void ShowUrl (string url) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeInstanceConnection.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeInstanceConnection.cs index 8e9ddcc3942..c247fcf314b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeInstanceConnection.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeInstanceConnection.cs @@ -50,9 +50,9 @@ public IdeInstanceConnection (bool ipcTcp) // macOS has native support for opening files in an open instance // via AppleEvents for applications distributed as bundles, so disable // this support. - if (Platform.IsMac && Components.GtkWorkarounds.IsRunFromBundle ()) { - return; - } + // if (Platform.IsMac && Components.GtkWorkarounds.IsRunFromBundle ()) { + // return; + // } if (ipcTcp) { listen_socket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP); diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj b/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj index 02bd19d40e7..0ced974a575 100644 --- a/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj +++ b/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj @@ -17,6 +17,9 @@ + + gtk-sharp-3.0 + diff --git a/main/src/tools/mdmonitor/CounterSelectorDialog.cs b/main/src/tools/mdmonitor/CounterSelectorDialog.cs index cd38cbfe7ed..cfb46e3157c 100644 --- a/main/src/tools/mdmonitor/CounterSelectorDialog.cs +++ b/main/src/tools/mdmonitor/CounterSelectorDialog.cs @@ -41,7 +41,7 @@ public CounterSelectorDialog () { this.Build (); - HasSeparator = false; + //HasSeparator = false; store = new TreeStore (typeof(bool), typeof(string), typeof(CounterCategory), typeof(Counter), typeof(bool)); treeCounters.Model = store; diff --git a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationChartView.cs b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationChartView.cs index 288c1812fa6..3d953e09409 100644 --- a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationChartView.cs +++ b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationChartView.cs @@ -81,9 +81,9 @@ protected virtual void Build () this.buttonZoomOut.Relief = ((global::Gtk.ReliefStyle)(2)); this.buttonZoomOut.Label = ""; global::Gtk.Image w3 = new global::Gtk.Image (); - w3.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-zoom-out", global::Gtk.IconSize.Menu); - this.buttonZoomOut.Image = w3; - this.hboxChartBar.Add (this.buttonZoomOut); + // w3.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-zoom-out", global::Gtk.IconSize.Menu); + // this.buttonZoomOut.Image = w3; + // this.hboxChartBar.Add (this.buttonZoomOut); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hboxChartBar [this.buttonZoomOut])); w4.PackType = ((global::Gtk.PackType)(1)); w4.Position = 2; @@ -97,9 +97,9 @@ protected virtual void Build () this.buttonZoomIn.Relief = ((global::Gtk.ReliefStyle)(2)); this.buttonZoomIn.Label = ""; global::Gtk.Image w5 = new global::Gtk.Image (); - w5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-zoom-in", global::Gtk.IconSize.Menu); - this.buttonZoomIn.Image = w5; - this.hboxChartBar.Add (this.buttonZoomIn); + // w5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-zoom-in", global::Gtk.IconSize.Menu); + // this.buttonZoomIn.Image = w5; + // this.hboxChartBar.Add (this.buttonZoomIn); global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hboxChartBar [this.buttonZoomIn])); w6.PackType = ((global::Gtk.PackType)(1)); w6.Position = 3; diff --git a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationViewerDialog.cs b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationViewerDialog.cs index 8f4d1022d38..60ecffec4e6 100644 --- a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationViewerDialog.cs +++ b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationViewerDialog.cs @@ -122,9 +122,9 @@ protected virtual void Build () this.buttonSave.Relief = ((global::Gtk.ReliefStyle)(2)); this.buttonSave.Label = global::Mono.Unix.Catalog.GetString ("Save"); global::Gtk.Image w6 = new global::Gtk.Image (); - w6.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-save", global::Gtk.IconSize.Button); - this.buttonSave.Image = w6; - this.buttonsBox.Add (this.buttonSave); + // w6.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-save", global::Gtk.IconSize.Button); + // this.buttonSave.Image = w6; + // this.buttonsBox.Add (this.buttonSave); global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.buttonsBox [this.buttonSave])); w7.Position = 0; w7.Expand = false; @@ -137,9 +137,9 @@ protected virtual void Build () this.buttonSaveAs.Relief = ((global::Gtk.ReliefStyle)(2)); this.buttonSaveAs.Label = global::Mono.Unix.Catalog.GetString ("Copy"); global::Gtk.Image w8 = new global::Gtk.Image (); - w8.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-copy", global::Gtk.IconSize.Button); - this.buttonSaveAs.Image = w8; - this.buttonsBox.Add (this.buttonSaveAs); + // w8.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-copy", global::Gtk.IconSize.Button); + // this.buttonSaveAs.Image = w8; + // this.buttonsBox.Add (this.buttonSaveAs); global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.buttonsBox [this.buttonSaveAs])); w9.Position = 1; w9.Expand = false; @@ -152,9 +152,9 @@ protected virtual void Build () this.buttonDelete.Relief = ((global::Gtk.ReliefStyle)(2)); this.buttonDelete.Label = global::Mono.Unix.Catalog.GetString ("Delete"); global::Gtk.Image w10 = new global::Gtk.Image (); - w10.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-delete", global::Gtk.IconSize.Button); - this.buttonDelete.Image = w10; - this.buttonsBox.Add (this.buttonDelete); + //w10.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-delete", global::Gtk.IconSize.Button); + //this.buttonDelete.Image = w10; + //this.buttonsBox.Add (this.buttonDelete); global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.buttonsBox [this.buttonDelete])); w11.Position = 2; w11.Expand = false; diff --git a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.NewProfile.cs b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.NewProfile.cs index 9c79fe34a4d..7d5a211d831 100644 --- a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.NewProfile.cs +++ b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.NewProfile.cs @@ -18,9 +18,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("New View"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child Mono.Instrumentation.Monitor.NewProfile.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.BorderWidth = ((uint)(2)); + //global::Gtk.VBox w1 = this.VBox; + //w1.Name = "dialog1_VBox"; + //w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -47,17 +47,17 @@ protected virtual void Build () w3.Position = 1; w3.Expand = false; w3.Fill = false; - w1.Add (this.vbox2); - global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - w4.Position = 0; - w4.Expand = false; - w4.Fill = false; + //w1.Add (this.vbox2); + // global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + // w4.Position = 0; + // w4.Expand = false; + // w4.Fill = false; // Internal child Mono.Instrumentation.Monitor.NewProfile.ActionArea - global::Gtk.HButtonBox w5 = this.ActionArea; - w5.Name = "dialog1_ActionArea"; - w5.Spacing = 10; - w5.BorderWidth = ((uint)(5)); - w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w5 = this.ActionArea; + // w5.Name = "dialog1_ActionArea"; + // w5.Spacing = 10; + // w5.BorderWidth = ((uint)(5)); + // w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -67,9 +67,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel])); - w6.Expand = false; - w6.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel])); + // w6.Expand = false; + // w6.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -79,10 +79,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk])); - w7.Position = 1; - w7.Expand = false; - w7.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk])); + // w7.Position = 1; + // w7.Expand = false; + // w7.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.TimeLineViewWindow.cs b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.TimeLineViewWindow.cs index 42c8abce6ca..7d4cd285635 100644 --- a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.TimeLineViewWindow.cs +++ b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.TimeLineViewWindow.cs @@ -108,8 +108,8 @@ protected virtual void Build () this.button3.UseUnderline = true; this.button3.Label = ""; global::Gtk.Image w9 = new global::Gtk.Image (); - w9.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-zoom-100", global::Gtk.IconSize.Menu); - this.button3.Image = w9; + // w9.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-zoom-100", global::Gtk.IconSize.Menu); + // this.button3.Image = w9; this.vbox1.Add (this.button3); global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.button3])); w10.Position = 0; @@ -148,9 +148,9 @@ protected virtual void Build () this.buttonResetScale.UseUnderline = true; this.buttonResetScale.Label = ""; global::Gtk.Image w13 = new global::Gtk.Image (); - w13.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "stock_draw-dimension-line", global::Gtk.IconSize.Menu); - this.buttonResetScale.Image = w13; - this.vbox1.Add (this.buttonResetScale); + // w13.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "stock_draw-dimension-line", global::Gtk.IconSize.Menu); + // this.buttonResetScale.Image = w13; + // this.vbox1.Add (this.buttonResetScale); global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.buttonResetScale])); w14.Position = 3; w14.Expand = false; diff --git a/main/src/tools/mdmonitor/gtk-gui/generated.cs b/main/src/tools/mdmonitor/gtk-gui/generated.cs index 097e9cb288f..8afacbc5c65 100644 --- a/main/src/tools/mdmonitor/gtk-gui/generated.cs +++ b/main/src/tools/mdmonitor/gtk-gui/generated.cs @@ -23,24 +23,24 @@ internal class BinContainer public static BinContainer Attach (Gtk.Bin bin) { BinContainer bc = new BinContainer (); - bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested); + //bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested); bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated); bin.Added += new Gtk.AddedHandler (bc.OnAdded); return bc; } - private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args) - { - if ((this.child != null)) { - args.Requisition = this.child.SizeRequest (); - } - } + // private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args) + // { + // if ((this.child != null)) { + // args.Requisition = this.child.SizeRequest (); + // } + // } private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args) { - if ((this.child != null)) { - this.child.Allocation = args.Allocation; - } + // if ((this.child != null)) { + // this.child.Allocation = args.Allocation; + // } } private void OnAdded (object sender, Gtk.AddedArgs args) @@ -70,40 +70,40 @@ private void OnRealized (object sender, System.EventArgs args) internal class IconLoader { - public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size) - { - Gdk.Pixbuf res = widget.RenderIcon (name, size, null); - if ((res != null)) { - return res; - } else { - int sz; - int sy; - global::Gtk.Icon.SizeLookup (size, out sz, out sy); - try { - return Gtk.IconTheme.Default.LoadIcon (name, sz, 0); - } catch (System.Exception) { - if ((name != "gtk-missing-image")) { - return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size); - } else { - Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz); - Gdk.GC gc = new Gdk.GC (pmap); - gc.RgbFgColor = new Gdk.Color (255, 255, 255); - pmap.DrawRectangle (gc, true, 0, 0, sz, sz); - gc.RgbFgColor = new Gdk.Color (0, 0, 0); - pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1)); - gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round); - gc.RgbFgColor = new Gdk.Color (255, 0, 0); - pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - - (sz / 4)), ((sz - 1) - - (sz / 4))); - pmap.DrawLine (gc, ((sz - 1) - - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - - (sz / 4))); - return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz); - } - } - } - } + // public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size) + // { + // Gdk.Pixbuf res = widget.RenderIcon (name, size, null); + // if ((res != null)) { + // return res; + // } else { + // int sz; + // int sy; + // global::Gtk.Icon.SizeLookup (size, out sz, out sy); + // try { + // return Gtk.IconTheme.Default.LoadIcon (name, sz, 0); + // } catch (System.Exception) { + // if ((name != "gtk-missing-image")) { + // return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size); + // } else { + //Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz); + //Gdk.GC gc = new Gdk.GC (pmap); + //gc.RgbFgColor = new Gdk.Color (255, 255, 255); + //pmap.DrawRectangle (gc, true, 0, 0, sz, sz); + //gc.RgbFgColor = new Gdk.Color (0, 0, 0); + //pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1)); + //gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round); + //gc.RgbFgColor = new Gdk.Color (255, 0, 0); + //pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) + // - (sz / 4)), ((sz - 1) + // - (sz / 4))); + //pmap.DrawLine (gc, ((sz - 1) + // - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) + // - (sz / 4))); + //return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz); + //} + //} + //} + //} } internal class ActionGroups diff --git a/main/src/tools/mdtool/src/mdtool.cs b/main/src/tools/mdtool/src/mdtool.cs index 778a3f5d7ff..cd929aa3c58 100644 --- a/main/src/tools/mdtool/src/mdtool.cs +++ b/main/src/tools/mdtool/src/mdtool.cs @@ -177,9 +177,9 @@ static void Shutdown (bool terminate) { Runtime.Shutdown (); - if (terminate) { - MonoDevelop.Components.GtkWorkarounds.Terminate (); - } + // if (terminate) { + // MonoDevelop.Components.GtkWorkarounds.Terminate (); + // } } static void ShowHelp (bool shortHelp, string exeName) diff --git a/main/tests/IdeUnitTests/IdeUnitTests.csproj b/main/tests/IdeUnitTests/IdeUnitTests.csproj index e432d2a2b44..9041ff84616 100644 --- a/main/tests/IdeUnitTests/IdeUnitTests.csproj +++ b/main/tests/IdeUnitTests/IdeUnitTests.csproj @@ -40,6 +40,7 @@ + From b5727099a03f5c27ddaab40349c9d36bfc4bbd5e Mon Sep 17 00:00:00 2001 From: makiwolf Date: Sat, 30 Dec 2023 20:03:34 +0100 Subject: [PATCH 155/382] comment out --- .../FSharpOutlineTextEditorExtension.fs | 4 +- .../MonoDevelop.FSharp.fsproj | 6 + .../AspNet/Commands/AddControllerDialog.cs | 6 +- .../addins/AspNet/Commands/AddViewDialog.cs | 408 ++++++++-------- .../AddViewFromControllerCommandHandler.cs | 12 +- .../AspNet/Execution/XspOptionsPanelWidget.cs | 114 ++--- .../addins/AspNet/Html/HtmlEditorExtension.cs | 2 +- .../addins/AspNet/MonoDevelop.AspNet.csproj | 6 + ...tkAspNetProjectTemplateWizardPageWidget.cs | 36 +- .../addins/CSharpBinding/CSharpBinding.csproj | 6 + ...Outline.OutlineSortingPreferencesDialog.cs | 36 +- ...ormatting.CSharpFormattingProfileDialog.cs | 44 +- ...p.Formatting.NewFormattingProfileDialog.cs | 48 +- ...Sharp.Project.CodeGenerationPanelWidget.cs | 34 +- ...harp.Project.CompilerOptionsPanelWidget.cs | 50 +- .../CSharpOutlineTextEditorExtension.cs | 4 +- .../OutlineNodeComparer.cs | 6 +- .../GenerateCodeWindow.cs | 30 +- .../ImportSymbolCompletionData.cs | 12 +- .../CSharpFormattingProfileDialog.cs | 22 +- .../CompilerOptionsPanelWidget.cs | 170 +++---- .../QuickInfoProvider.cs | 6 +- .../SignatureMarkupCreator.cs | 8 +- .../ChangeLogAddIn/AddLogEntryDialog.cs | 8 +- ...evelop.ChangeLogAddIn.AddLogEntryDialog.cs | 42 +- ...ChangeLogAddIn.ProjectOptionPanelWidget.cs | 4 +- .../AssemblyBrowserWidget.cs | 176 +++---- .../DocumentationPanel.cs | 38 +- .../MonoDevelop.ConnectedServices.csproj | 3 + .../MonoDevelop.DocFood/gtk-gui/generated.cs | 20 +- ...DotNetCoreRuntimeOptionsPanelWidget.Gui.cs | 2 +- .../DotNetCoreRuntimeOptionsPanelWidget.cs | 12 +- ...tNetCoreProjectTemplateWizardPageWidget.cs | 22 +- .../DotNetCoreTestBase.cs | 12 +- .../MonoDevelop.DotNetCore.csproj | 3 + .../MonoDevelop.HexEditor.csproj | 1 + .../MonoDevelopHexEditorStyle.cs | 146 +++--- .../PackageSourceCellRenderer.cs | 60 +-- .../PackageSourcesWidget.cs | 24 +- ...mLibraryProjectTemplateWizardPageWidget.cs | 8 +- ...kNuGetPackageMetadataOptionsPanelWidget.cs | 8 +- ...mLibraryProjectTemplateWizardPageWidget.cs | 20 +- ...kNuGetPackageMetadataOptionsPanelWidget.cs | 26 +- ...ackagingProjectTemplateWizardPageWidget.cs | 20 +- ...kProjectNuGetBuildOptionsPanelWidget.UI.cs | 2 +- ...eferenceAssembliesOptionsPanelWidget.UI.cs | 2 +- .../MonoDevelop.Packaging.csproj | 3 + ...op.Refactoring.RefactoringPreviewDialog.cs | 36 +- ...lop.Refactoring.Rename.RenameItemDialog.cs | 48 +- ...g.SignatureChange.SignatureChangeDialog.cs | 38 +- .../ResultTooltipProvider.RectangleMarker.cs | 30 +- .../Gui/ResultTooltipProvider.cs | 90 ++-- .../Gui/ResultsEditorExtension.cs | 2 +- .../RenameItemDialog.cs | 2 +- .../MonoDevelop.Refactoring.csproj | 6 + .../RefactoringPreviewDialog.cs | 186 ++++---- .../RefactoringPreviewTooltipWindow.cs | 88 ++-- .../MonoDevelop.UnitTesting/Gui/TestPad.cs | 30 +- .../Gui/TestResultsPad.cs | 16 +- .../MonoDevelop.UnitTesting.csproj | 6 + ...onoDevelop.VersionControl.Git.Tests.csproj | 3 + ...ionControl.Git.ConflictResolutionDialog.cs | 44 +- ...op.VersionControl.Git.CredentialsDialog.cs | 40 +- ...lop.VersionControl.Git.EditBranchDialog.cs | 40 +- ...lop.VersionControl.Git.EditRemoteDialog.cs | 40 +- ...rsionControl.Git.GitConfigurationDialog.cs | 28 +- ...oDevelop.VersionControl.Git.MergeDialog.cs | 36 +- ...velop.VersionControl.Git.NewStashDialog.cs | 40 +- ...noDevelop.VersionControl.Git.PushDialog.cs | 52 +-- ...p.VersionControl.Git.StashManagerDialog.cs | 36 +- ....VersionControl.Git.UserGitConfigDialog.cs | 40 +- ...rsionControl.Git.UserInfoConflictDialog.cs | 42 +- .../MonoDevelop.VersionControl.Git.csproj | 3 + .../ConflictResolutionDialog.cs | 2 +- .../GitConfigurationDialog.cs | 2 +- .../GitService.cs | 22 +- .../PushDialog.cs | 48 +- ....Subversion.Gui.ClientCertificateDialog.cs | 44 +- ...ion.Gui.ClientCertificatePasswordDialog.cs | 44 +- ...rol.Subversion.Gui.SslServerTrustDialog.cs | 42 +- ...ntrol.Subversion.Gui.UserPasswordDialog.cs | 42 +- ...noDevelop.VersionControl.Subversion.csproj | 3 + ...lop.VersionControl.Dialogs.CommitDialog.cs | 42 +- ...ionControl.Dialogs.EditRepositoryDialog.cs | 48 +- ...nControl.Dialogs.SelectRepositoryDialog.cs | 54 +-- ...VersionControl.UrlBasedRepositoryEditor.cs | 6 +- .../EditRepositoryDialog.cs | 4 +- .../SelectRepositoryDialog.cs | 42 +- .../BlameWidget.cs | 304 ++++++------ .../CellRendererDiff.cs | 366 +++++++-------- .../ChangeSetView.cs | 4 +- .../DiffRendererWidget.cs | 434 +++++++++--------- .../EditorCompareWidgetBase.DiffScrollbar.cs | 108 ++--- .../EditorCompareWidgetBase.MiddleArea.cs | 228 ++++----- .../EditorCompareWidgetBase.cs | 24 +- .../LogWidget.cs | 128 +++--- .../StatusView.cs | 17 +- .../MonoDevelop.VersionControl.csproj | 6 + .../UrlBasedRepositoryEditor.cs | 10 +- .../MonoDevelop.Ide.Gui/GLibLoggingTests.cs | 6 +- .../Ide.Tests/MonoDevelop.Ide.Tests.csproj | 3 + start.sh | 2 + 102 files changed, 2450 insertions(+), 2389 deletions(-) create mode 100755 start.sh diff --git a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/FSharpOutlineTextEditorExtension.fs b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/FSharpOutlineTextEditorExtension.fs index a701e77c912..68c83fecd87 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/FSharpOutlineTextEditorExtension.fs +++ b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/FSharpOutlineTextEditorExtension.fs @@ -76,14 +76,14 @@ type FSharpOutlineTextEditorExtension() as x = let treeStore = new TreeStore(typedefof) let padTreeView = new PadTreeView(treeStore, HeadersVisible = true) - let setCellIcon _column (cellRenderer : CellRenderer) (treeModel : TreeModel) (iter : TreeIter) = + let setCellIcon _column (cellRenderer : CellRenderer) (treeModel : ITreeModel) (iter : TreeIter) = let pixRenderer = cellRenderer :?> CellRendererImage treeModel.GetValue(iter, 0) |> Option.tryCast |> Option.iter(fun item -> pixRenderer.Image <- ImageService.GetIcon(ServiceUtils.getIcon item.[0], Gtk.IconSize.Menu)) - let setCellText _column (cellRenderer : CellRenderer) (treeModel : TreeModel) (iter : TreeIter) = + let setCellText _column (cellRenderer : CellRenderer) (treeModel : ITreeModel) (iter : TreeIter) = let renderer = cellRenderer :?> CellRendererText treeModel.GetValue(iter, 0) |> Option.tryCast diff --git a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.fsproj b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.fsproj index fdd8356ac05..cfd95e14e12 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.fsproj +++ b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.fsproj @@ -49,6 +49,12 @@ ..\..\..\build\bin\Xwt.Gtk.dll + + gtk-sharp-3.0 + + + gio-sharp-3.0 + ..\..\..\build\bin\Microsoft.CodeAnalysis.dll False diff --git a/main/src/addins/AspNet/Commands/AddControllerDialog.cs b/main/src/addins/AspNet/Commands/AddControllerDialog.cs index 7cce727a932..734777879df 100644 --- a/main/src/addins/AspNet/Commands/AddControllerDialog.cs +++ b/main/src/addins/AspNet/Commands/AddControllerDialog.cs @@ -70,7 +70,7 @@ public AddControllerDialog (DotNetProject project) int templateIndex = 0; foreach (string file in loadedTemplateList) { string name = System.IO.Path.GetFileNameWithoutExtension (file); - templateCombo.AppendText (name); + //templateCombo.AppendText (name); if (!foundEmptyTemplate) { if (name == "Empty") { templateCombo.Active = templateIndex; @@ -101,7 +101,7 @@ void Build () AddActionWidget (buttonOk, ResponseType.Ok); nameEntry = new Entry (); - templateCombo = ComboBox.NewText (); + //templateCombo = ComboBox.NewText (); var nameLabel = new Label { TextWithMnemonic = GettextCatalog.GetString ("_Name:"), @@ -123,7 +123,7 @@ void Build () table.Attach (nameEntry, 1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, 0, 0, 0); table.Attach (templateLabel, 0, 1, 1, 2, AttachOptions.Fill, 0, 0, 0); table.Attach (templateCombo, 1, 2, 1, 2, AttachOptions.Fill | AttachOptions.Expand, 0, 0, 0); - VBox.PackStart (table); + //VBox.PackStart (table); Child.ShowAll (); } diff --git a/main/src/addins/AspNet/Commands/AddViewDialog.cs b/main/src/addins/AspNet/Commands/AddViewDialog.cs index 071ca00426f..806b2008514 100644 --- a/main/src/addins/AspNet/Commands/AddViewDialog.cs +++ b/main/src/addins/AspNet/Commands/AddViewDialog.cs @@ -45,20 +45,20 @@ namespace MonoDevelop.AspNet.Commands class AddViewDialog : Dialog { readonly DotNetProject project; - readonly AspNetAppProjectFlavor aspFlavor; - IDictionary> loadedTemplateList; - IDictionary templateStore; - ListStore dataClassStore; - string oldMaster; - string oldEngine; - ListStore primaryPlaceholderStore = new ListStore (typeof (String)); - System.CodeDom.Compiler.CodeDomProvider provider; + readonly AspNetAppProjectFlavor aspFlavor; + IDictionary> loadedTemplateList; + IDictionary templateStore; + ListStore dataClassStore; + string oldMaster; + string oldEngine; + ListStore primaryPlaceholderStore = new ListStore (typeof (String)); + System.CodeDom.Compiler.CodeDomProvider provider; TypeDataProvider classDataProvider; Button buttonCancel, buttonOk, masterButton; Label placeholderLabel; ComboBox viewEngineCombo, templateCombo; - ComboBoxEntry placeholderCombo, dataClassCombo; + //ComboBoxEntry placeholderCombo, dataClassCombo; Entry nameEntry; Entry masterEntry; CheckButton partialCheck, stronglyTypedCheck, masterCheck; @@ -71,16 +71,16 @@ public AddViewDialog (DotNetProject project) Build (); - provider = project.LanguageBinding.GetCodeDomProvider (); - - var viewEngines = GetProperViewEngines (); - loadedTemplateList = new Dictionary> (); - foreach (var engine in viewEngines) { - viewEngineCombo.AppendText (engine); - loadedTemplateList[engine] = aspFlavor.GetCodeTemplates ("AddView", engine); - } - - viewEngineCombo.Active = 0; + provider = project.LanguageBinding.GetCodeDomProvider (); + + var viewEngines = GetProperViewEngines (); + loadedTemplateList = new Dictionary> (); + foreach (var engine in viewEngines) { + //viewEngineCombo.AppendText (engine); + loadedTemplateList[engine] = aspFlavor.GetCodeTemplates ("AddView", engine); + } + + viewEngineCombo.Active = 0; InitializeTemplateStore (loadedTemplateList); ContentPlaceHolders = new List (); @@ -88,7 +88,7 @@ public AddViewDialog (DotNetProject project) if (project.Files.GetFile (siteMaster) != null) masterEntry.Text = "~/Views/Shared/Site.master"; - placeholderCombo.Model = primaryPlaceholderStore; + //placeholderCombo.Model = primaryPlaceholderStore; UpdateTypePanelSensitivity (null, null); UpdateMasterPanelSensitivity (null, null); @@ -102,18 +102,18 @@ void Build () BorderWidth = 6; Resizable = false; - VBox.Spacing = 6; + //VBox.Spacing = 6; buttonCancel = new Button (Gtk.Stock.Cancel); AddActionWidget (buttonCancel, ResponseType.Cancel); buttonOk = new Button (Gtk.Stock.Ok); AddActionWidget (buttonOk, ResponseType.Ok); - var table = new Table (3, 2, false) { ColumnSpacing = 6, RowSpacing = 6 }; + //var table = new Table (3, 2, false) { ColumnSpacing = 6, RowSpacing = 6 }; nameEntry = new Entry { WidthRequest = 350 }; - viewEngineCombo = ComboBox.NewText (); - templateCombo = ComboBox.NewText (); + //viewEngineCombo = ComboBox.NewText (); + //templateCombo = ComboBox.NewText (); var nameLabel = new Label (GettextCatalog.GetString ("_Name")) { MnemonicWidget = nameEntry, @@ -131,14 +131,14 @@ void Build () const AttachOptions expandFill = AttachOptions.Expand | AttachOptions.Fill; const AttachOptions fill = AttachOptions.Fill; - table.Attach (nameLabel, 0, 1, 0, 1, fill, 0, 0, 0); - table.Attach (nameEntry, 1, 2, 0, 1, expandFill, 0, 0, 0); - table.Attach (templateLabel, 0, 1, 1, 2, fill, 0, 0, 0); - table.Attach (templateCombo, 1, 2, 1, 2, expandFill, 0, 0, 0); - table.Attach (engineLabel, 0, 1, 2, 3, fill, 0, 0, 0); - table.Attach (viewEngineCombo, 1, 2, 2, 3, expandFill, 0, 0, 0); + //table.Attach (nameLabel, 0, 1, 0, 1, fill, 0, 0, 0); + //table.Attach (nameEntry, 1, 2, 0, 1, expandFill, 0, 0, 0); + //table.Attach (templateLabel, 0, 1, 1, 2, fill, 0, 0, 0); + //table.Attach (templateCombo, 1, 2, 1, 2, expandFill, 0, 0, 0); + //table.Attach (engineLabel, 0, 1, 2, 3, fill, 0, 0, 0); + //table.Attach (viewEngineCombo, 1, 2, 2, 3, expandFill, 0, 0, 0); - VBox.PackStart (table, false, false, 0); + //VBox.PackStart (table, false, false, 0); var frame = new Frame (GettextCatalog.GetString ("Options")) { BorderWidth = 2 }; var optionsVBox = new VBox { Spacing = 6 }; @@ -155,16 +155,16 @@ void Build () stronglyTypedCheck = new CheckButton (GettextCatalog.GetString ("_Strongly typed")) { UseUnderline = true }; masterCheck = new CheckButton (GettextCatalog.GetString ("Has _master page or layout")) { UseUnderline = true }; - dataClassCombo = ComboBoxEntry.NewText (); + //dataClassCombo = ComboBoxEntry.NewText (); masterEntry = new Entry { WidthRequest = 250 }; - placeholderCombo = ComboBoxEntry.NewText (); + //placeholderCombo = ComboBoxEntry.NewText (); masterButton = new Button ("..."); - optionsVBox.PackStart (partialCheck); - optionsVBox.PackStart (stronglyTypedCheck); - typePanel = WithLabelAndLeftPadding (dataClassCombo, GettextCatalog.GetString ("_Data class:"), true, 24); - optionsVBox.PackStart (typePanel); - optionsVBox.PackStart (masterCheck); + //optionsVBox.PackStart (partialCheck); + //optionsVBox.PackStart (stronglyTypedCheck); + //typePanel = WithLabelAndLeftPadding (dataClassCombo, GettextCatalog.GetString ("_Data class:"), true, 24); + //optionsVBox.PackStart (typePanel); + //optionsVBox.PackStart (masterCheck); var masterLabel = new Label (GettextCatalog.GetString ("_File:")) { @@ -173,24 +173,24 @@ void Build () UseUnderline = true }; - placeholderLabel = new Label (GettextCatalog.GetString ("P_rimary placeholder:")) { - MnemonicWidget = placeholderCombo, - Xalign = 0, - UseUnderline = true - }; + // placeholderLabel = new Label (GettextCatalog.GetString ("P_rimary placeholder:")) { + // MnemonicWidget = placeholderCombo, + // Xalign = 0, + // UseUnderline = true + // }; var masterTable = new Table (2, 3, false) { RowSpacing = 6, ColumnSpacing = 6 }; masterTable.Attach (masterLabel, 0, 1, 0, 1, fill, 0, 0, 0); masterTable.Attach (masterEntry, 1, 3, 0, 1, expandFill, 0, 0, 0); masterTable.Attach (placeholderLabel, 0, 1, 1, 2, expandFill, 0, 0, 0); - masterTable.Attach (placeholderCombo, 1, 2, 1, 2, fill, 0, 0, 0); + //masterTable.Attach (placeholderCombo, 1, 2, 1, 2, fill, 0, 0, 0); masterTable.Attach (masterButton, 2, 3, 1, 2, fill, 0, 0, 0); masterPanel = new Alignment (0.5f, 0.5f, 1f, 1f) { LeftPadding = 24, Child = masterTable }; - optionsVBox.PackStart (masterPanel); + //optionsVBox.PackStart (masterPanel); - VBox.PackStart (frame, false, false, 0); + //VBox.PackStart (frame, false, false, 0); Child.ShowAll (); @@ -199,11 +199,11 @@ void Build () nameEntry.Changed += Validate; partialCheck.Toggled += UpdateMasterPanelSensitivity; stronglyTypedCheck.Toggled += UpdateTypePanelSensitivity; - dataClassCombo.Changed += DataClassChanged; + //dataClassCombo.Changed += DataClassChanged; masterCheck.Toggled += UpdateMasterPanelSensitivity; masterEntry.Changed += MasterChanged; masterButton.Clicked += ShowMasterSelectionDialog; - placeholderCombo.Changed += Validate; + //placeholderCombo.Changed += Validate; } @@ -216,50 +216,50 @@ static Alignment WithLabelAndLeftPadding (Widget w, string labelText, bool under }; var box = new HBox (false, 6); - box.PackStart (label); + //box.PackStart (label); box.PackStart (w, true, true, 0); return new Alignment (0.5f, 0.5f, 1f, 1f) { LeftPadding = leftPadding, Child = box }; - } - - IEnumerable GetProperViewEngines () - { - yield return "Aspx"; - if (aspFlavor.SupportsRazorViewEngine) - yield return "Razor"; - } - - void InitializeTemplateStore (IDictionary> tempList) - { - templateStore = new Dictionary (); - - foreach (var engine in tempList.Keys) { - bool foundEmptyTemplate = false; - templateStore[engine] = new ListStore (typeof (string)); - - foreach (string file in tempList[engine]) { - string name = PP.GetFileNameWithoutExtension (file); - if (!foundEmptyTemplate) { - if (name == "Empty") { - templateStore[engine].InsertWithValues (0, name); - foundEmptyTemplate = true; - } else - templateStore[engine].AppendValues (name); - } - } - - if (!foundEmptyTemplate) - throw new Exception ("The Empty.tt template is missing."); - } - - UpdateTemplateList (); - } - - void UpdateTemplateList () - { - templateCombo.Model = templateStore[ActiveViewEngine]; - oldEngine = ActiveViewEngine; - templateCombo.Active = 0; + } + + IEnumerable GetProperViewEngines () + { + yield return "Aspx"; + if (aspFlavor.SupportsRazorViewEngine) + yield return "Razor"; + } + + void InitializeTemplateStore (IDictionary> tempList) + { + templateStore = new Dictionary (); + + foreach (var engine in tempList.Keys) { + bool foundEmptyTemplate = false; + templateStore[engine] = new ListStore (typeof (string)); + + foreach (string file in tempList[engine]) { + string name = PP.GetFileNameWithoutExtension (file); + if (!foundEmptyTemplate) { + if (name == "Empty") { + templateStore[engine].InsertWithValues (0, name); + foundEmptyTemplate = true; + } else + templateStore[engine].AppendValues (name); + } + } + + if (!foundEmptyTemplate) + throw new Exception ("The Empty.tt template is missing."); + } + + UpdateTemplateList (); + } + + void UpdateTemplateList () + { + // templateCombo.Model = templateStore[ActiveViewEngine]; + // oldEngine = ActiveViewEngine; + // templateCombo.Active = 0; } protected virtual void Validate (object sender, EventArgs e) @@ -276,50 +276,50 @@ protected void UpdateMasterPanelSensitivity (object sender, EventArgs e) { bool canHaveMaster = !IsPartialView; masterCheck.Sensitive = canHaveMaster; - masterPanel.Sensitive = canHaveMaster && HasMaster; - placeholderLabel.Sensitive = placeholderCombo.Sensitive = masterPanel.Sensitive && ActiveViewEngine != "Razor"; + masterPanel.Sensitive = canHaveMaster && HasMaster; + //placeholderLabel.Sensitive = placeholderCombo.Sensitive = masterPanel.Sensitive && ActiveViewEngine != "Razor"; MasterChanged (null, null); Validate (); } protected async void UpdateTypePanelSensitivity (object sender, EventArgs e) - { - bool enabled = typePanel.Sensitive = stronglyTypedCheck.Active; - - if (enabled && classDataProvider == null) { - classDataProvider = new TypeDataProvider (); - await classDataProvider.GetTypes (project); - dataClassStore = new ListStore (typeof (string)); - foreach (var item in classDataProvider.TypeNamesList) - dataClassStore.AppendValues (item); - dataClassCombo.Model = dataClassStore; - if (classDataProvider.TypeNamesList.Count > 0) - dataClassCombo.Active = 0; - } - + { + bool enabled = typePanel.Sensitive = stronglyTypedCheck.Active; + + // if (enabled && classDataProvider == null) { + // classDataProvider = new TypeDataProvider (); + // await classDataProvider.GetTypes (project); + // dataClassStore = new ListStore (typeof (string)); + // foreach (var item in classDataProvider.TypeNamesList) + // dataClassStore.AppendValues (item); + // dataClassCombo.Model = dataClassStore; + // if (classDataProvider.TypeNamesList.Count > 0) + // dataClassCombo.Active = 0; + // } + Validate (); } - public override void Dispose () - { - Destroy (); - base.Dispose (); - } + // public override void Dispose () + // { + // Destroy (); + // base.Dispose (); + // } public bool IsValid () { if (!IsValidIdentifier (ViewName)) - return false; - - if (!IsPartialView && HasMaster && ActiveViewEngine != "Razor") { - if (String.IsNullOrEmpty (MasterFile) || !File.Exists (aspFlavor.VirtualToLocalPath (oldMaster, null))) - return false; - //PrimaryPlaceHolder can be empty - //Layout Page can be empty in Razor Views - it's usually set in _ViewStart.cshtml file - } + return false; + + // if (!IsPartialView && HasMaster && ActiveViewEngine != "Razor") { + // if (String.IsNullOrEmpty (MasterFile) || !File.Exists (aspFlavor.VirtualToLocalPath (oldMaster, null))) + // return false; + // //PrimaryPlaceHolder can be empty + // //Layout Page can be empty in Razor Views - it's usually set in _ViewStart.cshtml file + // } - if (IsStronglyTyped && String.IsNullOrEmpty(ViewDataTypeString)) - return false; + // if (IsStronglyTyped && String.IsNullOrEmpty(ViewDataTypeString)) + // return false; return true; } @@ -330,27 +330,27 @@ bool IsValidIdentifier (string identifier) } protected virtual void ShowMasterSelectionDialog (object sender, EventArgs e) - { - string pattern, title; - if (ActiveViewEngine == "Razor") { - pattern = "*.cshtml"; - title = GettextCatalog.GetString ("Select a Layout file..."); - } else { - pattern = "*.master"; - title = GettextCatalog.GetString ("Select a Master Page..."); - } - var dialog = new MonoDevelop.Ide.Projects.ProjectFileSelectorDialog (project, null, pattern) - { - Title = title, - TransientFor = this, - }; - try { - if (MessageService.RunCustomDialog (dialog) == (int) ResponseType.Ok) - masterEntry.Text = aspFlavor.LocalToVirtualPath (dialog.SelectedFile.FilePath); - } finally { - dialog.Destroy (); - dialog.Dispose (); - } + { + string pattern, title; + // if (ActiveViewEngine == "Razor") { + // pattern = "*.cshtml"; + // title = GettextCatalog.GetString ("Select a Layout file..."); + // } else { + // pattern = "*.master"; + // title = GettextCatalog.GetString ("Select a Master Page..."); + // } + // var dialog = new MonoDevelop.Ide.Projects.ProjectFileSelectorDialog (project, null, pattern) + // { + // Title = title, + // TransientFor = this, + // }; + // try { + // if (MessageService.RunCustomDialog (dialog) == (int) ResponseType.Ok) + // masterEntry.Text = aspFlavor.LocalToVirtualPath (dialog.SelectedFile.FilePath); + // } finally { + // dialog.Destroy (); + // dialog.Dispose (); + // } } protected virtual async void MasterChanged (object sender, EventArgs e) @@ -371,55 +371,55 @@ protected virtual async void MasterChanged (object sender, EventArgs e) var pd = await IdeApp.TypeSystemService.ParseFile (project, realPath) as WebFormsParsedDocument; - if (pd != null) { - try { - ContentPlaceHolders.AddRange (pd.XDocument.GetAllPlaceholderIds ()); + // if (pd != null) { + // try { + // ContentPlaceHolders.AddRange (pd.XDocument.GetAllPlaceholderIds ()); - for (int i = 0; i < ContentPlaceHolders.Count; i++) { - string placeholder = ContentPlaceHolders[i]; - primaryPlaceholderStore.AppendValues (placeholder); + // for (int i = 0; i < ContentPlaceHolders.Count; i++) { + // string placeholder = ContentPlaceHolders[i]; + // primaryPlaceholderStore.AppendValues (placeholder); - if (placeholder.Contains ("main") || placeholder.Contains ("Main") - || placeholder.Contains ("content") || placeholder.Contains ("Content")) - placeholderCombo.Active = i; - } - } catch (Exception ex) { - LoggingService.LogError ("Unhandled exception getting master regions for '" + realPath + "'", ex); - } - } + // if (placeholder.Contains ("main") || placeholder.Contains ("Main") + // || placeholder.Contains ("content") || placeholder.Contains ("Content")) + // placeholderCombo.Active = i; + // } + // } catch (Exception ex) { + // LoggingService.LogError ("Unhandled exception getting master regions for '" + realPath + "'", ex); + // } + // } Validate (); - } - - protected virtual void ViewEngineChanged (object sender, EventArgs e) - { - if (String.IsNullOrEmpty (oldEngine)) - return; - if (oldEngine != ActiveViewEngine) { - UpdateTemplateList (); - UpdateMasterPanelSensitivity (null, null); - } - } - - protected virtual void DataClassChanged (object sender, EventArgs e) - { - Validate (); } - - #region Public properties - - public Type ViewDataType { - get { - return dataClassCombo.Active >= 0 ? (Type)classDataProvider.TypesList[dataClassCombo.Active] : System.Type.GetType(dataClassCombo.ActiveText, false); - } + + protected virtual void ViewEngineChanged (object sender, EventArgs e) + { + if (String.IsNullOrEmpty (oldEngine)) + return; + // if (oldEngine != ActiveViewEngine) { + // UpdateTemplateList (); + // UpdateMasterPanelSensitivity (null, null); + // } } - public string ViewDataTypeString { - get { - return dataClassCombo.ActiveText; - } + protected virtual void DataClassChanged (object sender, EventArgs e) + { + Validate (); } + #region Public properties + + // public Type ViewDataType { + // get { + // return dataClassCombo.Active >= 0 ? (Type)classDataProvider.TypesList[dataClassCombo.Active] : System.Type.GetType(dataClassCombo.ActiveText, false); + // } + // } + + // public string ViewDataTypeString { + // get { + // return dataClassCombo.ActiveText; + // } + // } + public string MasterFile { get { return masterEntry.Text; @@ -432,21 +432,21 @@ public bool HasMaster { } } - public string PrimaryPlaceHolder { - get { - return placeholderCombo.ActiveText; - } - } + // public string PrimaryPlaceHolder { + // get { + // return placeholderCombo.ActiveText; + // } + // } public List ContentPlaceHolders { get; private set; } - public string TemplateFile { - get { - return loadedTemplateList[ActiveViewEngine][templateCombo.Active]; - } - } + // public string TemplateFile { + // get { + // return loadedTemplateList[ActiveViewEngine][templateCombo.Active]; + // } + // } public string ViewName { get { @@ -465,26 +465,26 @@ public bool IsStronglyTyped { get { return stronglyTypedCheck.Active; } } - public string ActiveViewEngine { - get { return viewEngineCombo.ActiveText; } - } + // public string ActiveViewEngine { + // get { return viewEngineCombo.ActiveText; } + // } - #endregion - - class TypeDataProvider - { - public List TypesList { get; private set; } + #endregion + + class TypeDataProvider + { + public List TypesList { get; private set; } public List TypeNamesList { get; private set; } public async Task GetTypes (MonoDevelop.Projects.DotNetProject project) - { + { TypeNamesList = new List (); var ctx = await IdeApp.TypeSystemService.GetCompilationAsync (project); - TypesList = new List (ctx.GetAllTypesInMainAssembly ()); - foreach (var typeDef in TypesList) { + TypesList = new List (ctx.GetAllTypesInMainAssembly ()); + foreach (var typeDef in TypesList) { TypeNamesList.Add (Ambience.EscapeText (typeDef.ToDisplayString (SymbolDisplayFormat.CSharpErrorMessageFormat))); - } - } + } + } } } } diff --git a/main/src/addins/AspNet/Commands/AddViewFromControllerCommandHandler.cs b/main/src/addins/AspNet/Commands/AddViewFromControllerCommandHandler.cs index 83f6868c7d2..41d5aa891e7 100644 --- a/main/src/addins/AspNet/Commands/AddViewFromControllerCommandHandler.cs +++ b/main/src/addins/AspNet/Commands/AddViewFromControllerCommandHandler.cs @@ -74,8 +74,8 @@ public static void AddView (DotNetProject project, string path, string name) return; string ext = ".cshtml"; - if (dialog.ActiveViewEngine == "Aspx") - ext = dialog.IsPartialView ? ".ascx" : ".aspx"; + //if (dialog.ActiveViewEngine == "Aspx") + //ext = dialog.IsPartialView ? ".ascx" : ".aspx"; if (!System.IO.Directory.Exists (path)) System.IO.Directory.CreateDirectory (path); @@ -99,7 +99,7 @@ public static void AddView (DotNetProject project, string path, string name) if (dialog.HasMaster) { host.IsViewContentPage = true; - host.ContentPlaceholder = dialog.PrimaryPlaceHolder; + //host.ContentPlaceholder = dialog.PrimaryPlaceHolder; host.MasterPage = dialog.MasterFile; host.ContentPlaceHolders = dialog.ContentPlaceHolders; } @@ -108,10 +108,10 @@ public static void AddView (DotNetProject project, string path, string name) else host.IsViewPage = true; - if (dialog.IsStronglyTyped) - host.ViewDataTypeString = dialog.ViewDataTypeString; + //if (dialog.IsStronglyTyped) + // host.ViewDataTypeString = dialog.ViewDataTypeString; - host.ProcessTemplate (dialog.TemplateFile, outputFile); + //host.ProcessTemplate (dialog.TemplateFile, outputFile); MonoDevelop.TextTemplating.TextTemplatingService.ShowTemplateHostErrors (host.Errors); } finally { diff --git a/main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs b/main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs index 6f4a5e40b86..979b74d1413 100644 --- a/main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs +++ b/main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs @@ -38,10 +38,10 @@ class XspOptionsPanelWidget : VBox Entry ipAddress = new Entry { WidthChars = 39 }; // sized for IPv6 SpinButton portNumber = new SpinButton (0, Int16.MaxValue, 1) { WidthChars = 5} ; CheckButton verboseCheck = new CheckButton (); - readonly ComboBox sslMode = ComboBox.NewText (); - readonly ComboBox sslProtocol = ComboBox.NewText (); - readonly ComboBox keyType = ComboBox.NewText (); - readonly ComboBox passwordOptions = ComboBox.NewText (); + //readonly ComboBox sslMode = ComboBox.NewText (); + //readonly ComboBox sslProtocol = ComboBox.NewText (); + //readonly ComboBox keyType = ComboBox.NewText (); + //readonly ComboBox passwordOptions = ComboBox.NewText (); readonly FileEntry keyLocation = new FileEntry (); readonly FileEntry certLocation = new FileEntry (); readonly Entry passwordEntry = new Entry { InvisibleChar = '●' }; @@ -53,43 +53,43 @@ public XspOptionsPanelWidget (AspNetAppProjectFlavor project) XspParameters xPar = project.XspParameters; //index should be equivalent to XspSslMode enum - ((ListStore) sslMode.Model).Clear (); - sslMode.AppendText (GettextCatalog.GetString ("None")); - sslMode.AppendText (GettextCatalog.GetString ("Enabled")); - sslMode.AppendText (GettextCatalog.GetString ("Accept Client Certificates")); - sslMode.AppendText (GettextCatalog.GetString ("Require Client Certificates")); + //((ListStore) sslMode.Model).Clear (); + //sslMode.AppendText (GettextCatalog.GetString ("None")); + //sslMode.AppendText (GettextCatalog.GetString ("Enabled")); + //sslMode.AppendText (GettextCatalog.GetString ("Accept Client Certificates")); + //sslMode.AppendText (GettextCatalog.GetString ("Require Client Certificates")); //index should be equivalent to XspSslProtocol enum - ((ListStore) sslProtocol.Model).Clear (); - sslProtocol.AppendText (GettextCatalog.GetString ("Default")); + //((ListStore) sslProtocol.Model).Clear (); + //sslProtocol.AppendText (GettextCatalog.GetString ("Default")); #pragma warning disable MD0005 - sslProtocol.AppendText ("TLS"); - sslProtocol.AppendText ("SSL 2"); - sslProtocol.AppendText ("SSL 3"); + //sslProtocol.AppendText ("TLS"); + //sslProtocol.AppendText ("SSL 2"); + //sslProtocol.AppendText ("SSL 3"); #pragma warning restore MD0005 - ((ListStore) keyType.Model).Clear (); - keyType.AppendText (GettextCatalog.GetString ("None")); + //((ListStore) keyType.Model).Clear (); + //keyType.AppendText (GettextCatalog.GetString ("None")); #pragma warning disable MD0005 - keyType.AppendText ("Pkcs12"); - keyType.AppendText ("PVK"); + //keyType.AppendText ("Pkcs12"); + //keyType.AppendText ("PVK"); #pragma warning restore MD0005 - ((ListStore) passwordOptions.Model).Clear (); - passwordOptions.AppendText (GettextCatalog.GetString ("None")); - passwordOptions.AppendText (GettextCatalog.GetString ("Ask")); - passwordOptions.AppendText (GettextCatalog.GetString ("Store (insecure)")); + //((ListStore) passwordOptions.Model).Clear (); + //passwordOptions.AppendText (GettextCatalog.GetString ("None")); + //passwordOptions.AppendText (GettextCatalog.GetString ("Ask")); + //passwordOptions.AppendText (GettextCatalog.GetString ("Store (insecure)")); //load all options ipAddress.Text = xPar.Address; portNumber.Value = xPar.Port; verboseCheck.Active = xPar.Verbose; - sslMode.Active = (int) xPar.SslMode; - sslProtocol.Active = (int) xPar.SslProtocol; - keyType.Active = (int) xPar.KeyType; + //sslMode.Active = (int) xPar.SslMode; + //sslProtocol.Active = (int) xPar.SslProtocol; + //keyType.Active = (int) xPar.KeyType; keyLocation.Path = xPar.PrivateKeyFile; certLocation.Path = xPar.CertificateFile; - passwordOptions.Active = (int) xPar.PasswordOptions; + //passwordOptions.Active = (int) xPar.PasswordOptions; passwordEntry.Text = xPar.PrivateKeyPassword; } @@ -97,7 +97,7 @@ void Build () { Spacing = 6; - PackStart (new Label { Markup = "" + GettextCatalog.GetString ("General Options") + "", Xalign = 0 }); + //PackStart (new Label { Markup = "" + GettextCatalog.GetString ("General Options") + "", Xalign = 0 }); var gpadLabel = new Label { WidthRequest = 12 }; var ipLabel = new Label (GettextCatalog.GetString ("IP address:")) { Xalign = 0 }; @@ -120,51 +120,51 @@ void Build () ipTable.Attach (portLabel, 1, 2, 1, 2, AttachOptions.Fill, 0, 0, 0); ipTable.Attach (portHbox, 2, 3, 1, 2, AttachOptions.Fill, 0, 0, 0); ipTable.Attach (verboseCheck, 1, 3, 2, 3, AttachOptions.Fill, 0, 0, 0); - PackStart (ipTable); + //PackStart (ipTable); - PackStart (new Label { Markup = "" + GettextCatalog.GetString ("Security") + "", Xalign = 0 }); + //PackStart (new Label { Markup = "" + GettextCatalog.GetString ("Security") + "", Xalign = 0 }); var sslPadLabel = new Label { WidthRequest = 12 }; var sslModeLabel = new Label (GettextCatalog.GetString ("SSL mode:")) { Xalign = 0 }; - var sslModeAlign = new Alignment (0, 0, 0, 0) { Child = sslMode }; + //var sslModeAlign = new Alignment (0, 0, 0, 0) { Child = sslMode }; var sslProtocolLabel = new Label (GettextCatalog.GetString ("SSL protocol:")) { Xalign = 0 }; - var sslProtocolAlign = new Alignment (0, 0, 0, 0) { Child = sslProtocol }; + //var sslProtocolAlign = new Alignment (0, 0, 0, 0) { Child = sslProtocol }; var sslTable = new Table (2, 3, false) { ColumnSpacing = 6, RowSpacing = 6 }; sslTable.Attach (sslPadLabel, 0, 1, 0, 1, AttachOptions.Fill, 0, 0, 0); sslTable.Attach (sslModeLabel, 1, 2, 0, 1, AttachOptions.Fill, 0, 0, 0); - sslTable.Attach (sslModeAlign, 2, 3, 0, 1, AttachOptions.Fill, 0, 0, 0); + //sslTable.Attach (sslModeAlign, 2, 3, 0, 1, AttachOptions.Fill, 0, 0, 0); sslTable.Attach (sslProtocolLabel, 1, 2, 1, 2, AttachOptions.Fill, 0, 0, 0); - sslTable.Attach (sslProtocolAlign, 2, 3, 1, 2, AttachOptions.Fill, 0, 0, 0); - PackStart (sslTable); + //sslTable.Attach (sslProtocolAlign, 2, 3, 1, 2, AttachOptions.Fill, 0, 0, 0); + //PackStart (sslTable); - PackStart (new Label { Markup = "" + GettextCatalog.GetString ("SSL Key") + "", Xalign = 0 }); + //PackStart (new Label { Markup = "" + GettextCatalog.GetString ("SSL Key") + "", Xalign = 0 }); var keyPadLabel = new Label { WidthRequest = 12 }; var keyTypeLabel = new Label (GettextCatalog.GetString ("Key type:")) { Xalign = 0 }; - var keyTypeAlign = new Alignment (0, 0, 0, 0) { Child = keyType }; + //var keyTypeAlign = new Alignment (0, 0, 0, 0) { Child = keyType }; var keyFileLabel = new Label (GettextCatalog.GetString ("Key file:")) { Xalign = 0 }; var certFileLabel = new Label (GettextCatalog.GetString ("Certificate file:")) { Xalign = 0 }; var passwordLabel = new Label (GettextCatalog.GetString ("Password:")) { Xalign = 0 }; var passwordHbox = new HBox (false, 6); - passwordHbox.PackStart (passwordOptions, false, false, 0); + //passwordHbox.PackStart (passwordOptions, false, false, 0); passwordHbox.PackStart (passwordEntry, true, true, 0); var keyTable = new Table (4, 4, false) { ColumnSpacing = 6, RowSpacing = 6 }; keyTable.Attach (keyPadLabel, 0, 1, 0, 1, AttachOptions.Fill, 0, 0, 0); keyTable.Attach (keyTypeLabel, 1, 2, 0, 1, AttachOptions.Fill, 0, 0, 0); - keyTable.Attach (keyTypeAlign, 2, 3, 0, 1, AttachOptions.Fill, 0, 0, 0); + //keyTable.Attach (keyTypeAlign, 2, 3, 0, 1, AttachOptions.Fill, 0, 0, 0); keyTable.Attach (keyFileLabel, 1, 2, 1, 2, AttachOptions.Fill, 0, 0, 0); keyTable.Attach (keyLocation, 2, 4, 1, 2, AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0); keyTable.Attach (certFileLabel, 1, 2, 2, 3, AttachOptions.Fill, 0, 0, 0); keyTable.Attach (certLocation, 2, 4, 2, 3, AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0); keyTable.Attach (passwordLabel, 1, 2, 3, 4, AttachOptions.Fill, 0, 0, 0); keyTable.Attach (passwordHbox, 2, 4, 3, 4, AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0); - PackStart (keyTable); + //PackStart (keyTable); - sslMode.Changed += UpdateSensitivity; - keyType.Changed += UpdateSensitivity; - passwordOptions.Changed += UpdateSensitivity; + //sslMode.Changed += UpdateSensitivity; + //keyType.Changed += UpdateSensitivity; + //passwordOptions.Changed += UpdateSensitivity; ShowAll (); } @@ -176,31 +176,31 @@ public void Store (AspNetAppProjectFlavor project) xPar.Address = ipAddress.Text; xPar.Port = Convert.ToUInt16 (portNumber.Value); xPar.Verbose = verboseCheck.Active; - xPar.SslMode = (XspSslMode) sslMode.Active; - xPar.SslProtocol = (XspSslProtocol) sslProtocol.Active; - xPar.KeyType = (XspKeyType) keyType.Active; + //xPar.SslMode = (XspSslMode) sslMode.Active; + //xPar.SslProtocol = (XspSslProtocol) sslProtocol.Active; + //xPar.KeyType = (XspKeyType) keyType.Active; xPar.PrivateKeyFile = keyLocation.Path; xPar.CertificateFile = certLocation.Path; - xPar.PasswordOptions = (XspPasswordOptions) passwordOptions.Active; + //xPar.PasswordOptions = (XspPasswordOptions) passwordOptions.Active; xPar.PrivateKeyPassword = passwordEntry.Text; } void UpdateSensitivity (object sender, EventArgs e) { - bool sslEnabled = ((XspSslMode) sslMode.Active) != XspSslMode.None; - sslProtocol.Sensitive = sslEnabled; - keyType.Sensitive = sslEnabled; + //bool sslEnabled = ((XspSslMode) sslMode.Active) != XspSslMode.None; + //sslProtocol.Sensitive = sslEnabled; + //keyType.Sensitive = sslEnabled; - bool keyEnabled = (sslEnabled) && (keyType.Active != 0); - keyLocation.Sensitive = keyEnabled; - passwordOptions.Sensitive = keyEnabled; + //bool keyEnabled = (sslEnabled) && (keyType.Active != 0); + //keyLocation.Sensitive = keyEnabled; + //passwordOptions.Sensitive = keyEnabled; - bool certEnabled = (keyEnabled) && (keyType.Active == 2); - certLocation.Sensitive = certEnabled; + //bool certEnabled = (keyEnabled) && (keyType.Active == 2); + //certLocation.Sensitive = certEnabled; - passwordEntry.Sensitive = (keyEnabled) && (passwordOptions.Active == 2); - if (!passwordEntry.Sensitive) - passwordEntry.Text = ""; + //passwordEntry.Sensitive = (keyEnabled) && (passwordOptions.Active == 2); + //if (!passwordEntry.Sensitive) + // passwordEntry.Text = ""; } } } diff --git a/main/src/addins/AspNet/Html/HtmlEditorExtension.cs b/main/src/addins/AspNet/Html/HtmlEditorExtension.cs index b8913eadcdb..348e19ecb52 100644 --- a/main/src/addins/AspNet/Html/HtmlEditorExtension.cs +++ b/main/src/addins/AspNet/Html/HtmlEditorExtension.cs @@ -73,7 +73,7 @@ static void BuildTreeChildren (Gtk.TreeStore store, Gtk.TreeIter parent, XContai } } - void OutlineTreeDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + void OutlineTreeDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { Gtk.CellRendererText txtRenderer = (Gtk.CellRendererText) cell; XNode n = (XNode) model.GetValue (iter, 0); diff --git a/main/src/addins/AspNet/MonoDevelop.AspNet.csproj b/main/src/addins/AspNet/MonoDevelop.AspNet.csproj index 21e7bf15219..483b3003020 100644 --- a/main/src/addins/AspNet/MonoDevelop.AspNet.csproj +++ b/main/src/addins/AspNet/MonoDevelop.AspNet.csproj @@ -85,6 +85,12 @@ + + gio-sharp-3.0 + + + gtk-sharp-3.0 + diff --git a/main/src/addins/AspNet/Projects/GtkAspNetProjectTemplateWizardPageWidget.cs b/main/src/addins/AspNet/Projects/GtkAspNetProjectTemplateWizardPageWidget.cs index 75035713ca2..1fc1669875a 100644 --- a/main/src/addins/AspNet/Projects/GtkAspNetProjectTemplateWizardPageWidget.cs +++ b/main/src/addins/AspNet/Projects/GtkAspNetProjectTemplateWizardPageWidget.cs @@ -66,7 +66,7 @@ public GtkAspNetProjectTemplateWizardPageWidget () backgroundImageView = new ImageView (backgroundImage); backgroundImageView.Xalign = 1.0f; backgroundImageView.Yalign = 1.0f; - backgroundImageView.SizeRequested += BackgroundImageViewSizeRequested; + //backgroundImageView.SizeRequested += BackgroundImageViewSizeRequested; backgroundLargeImageVBox.PackStart (backgroundImageView, true, true, 0); var separatorColor = Ide.Gui.Styles.NewProjectDialog.ProjectConfigurationSeparatorColor.ToGdkColor (); @@ -86,12 +86,12 @@ public GtkAspNetProjectTemplateWizardPageWidget (AspNetProjectTemplateWizardPage WizardPage = wizardPage; } - public override void Dispose () - { - backgroundImageView.SizeRequested -= BackgroundImageViewSizeRequested; - Dispose (backgroundImage); - base.Dispose (); - } + // public override void Dispose () + // { + // backgroundImageView.SizeRequested -= BackgroundImageViewSizeRequested; + // Dispose (backgroundImage); + // base.Dispose (); + // } void Dispose (IDisposable disposable) { @@ -152,17 +152,17 @@ bool IsYosemiteOrHigher () return Platform.OSVersion >= MacSystemInformation.Yosemite; } - void BackgroundImageViewSizeRequested (object o, SizeRequestedArgs args) - { - if (args.Requisition.Width <= backgroundImage.Width) { - // Ensure there is a gap between the image and the left hand side of the wizard - // if the labels have expanded to fit their text. - args.Requisition = new Requisition { - Height = args.Requisition.Height, - Width = args.Requisition.Width + 30 - }; - } - } + // void BackgroundImageViewSizeRequested (object o, SizeRequestedArgs args) + // { + // if (args.Requisition.Width <= backgroundImage.Width) { + // // Ensure there is a gap between the image and the left hand side of the wizard + // // if the labels have expanded to fit their text. + // args.Requisition = new Requisition { + // Height = args.Requisition.Height, + // Width = args.Requisition.Width + 30 + // }; + // } + // } } } diff --git a/main/src/addins/CSharpBinding/CSharpBinding.csproj b/main/src/addins/CSharpBinding/CSharpBinding.csproj index 9d445c25a9a..4aa05f731d6 100644 --- a/main/src/addins/CSharpBinding/CSharpBinding.csproj +++ b/main/src/addins/CSharpBinding/CSharpBinding.csproj @@ -99,6 +99,12 @@ + + gtk-sharp-3.0 + + + gio-sharp-3.0 + diff --git a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.cs b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.cs index 867892a3628..c4b5ab3728b 100644 --- a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.cs +++ b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.cs @@ -24,9 +24,9 @@ protected virtual void Build () this.Modal = true; this.DestroyWithParent = true; // Internal child MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Name = "dialog1_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -49,15 +49,15 @@ protected virtual void Build () this.vbox2.Add (this.priorityList); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.priorityList])); w3.Position = 1; - w1.Add (this.vbox2); - global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - w4.Position = 0; + // w1.Add (this.vbox2); + // global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + // w4.Position = 0; // Internal child MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.ActionArea - global::Gtk.HButtonBox w5 = this.ActionArea; - w5.Name = "dialog1_ActionArea"; - w5.Spacing = 10; - w5.BorderWidth = ((uint)(5)); - w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w5 = this.ActionArea; + // w5.Name = "dialog1_ActionArea"; + // w5.Spacing = 10; + // w5.BorderWidth = ((uint)(5)); + // w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -67,9 +67,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel])); - w6.Expand = false; - w6.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel])); + // w6.Expand = false; + // w6.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -79,10 +79,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk])); - w7.Position = 1; - w7.Expand = false; - w7.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk])); + // w7.Position = 1; + // w7.Expand = false; + // w7.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs index 40dfc5ceedf..d6dbbebdc7b 100644 --- a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs +++ b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs @@ -68,10 +68,10 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.Spacing = 6; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Name = "dialog1_VBox"; + // w1.Spacing = 6; + // w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox5 = new global::Gtk.VBox (); this.vbox5.Name = "vbox5"; @@ -100,9 +100,9 @@ protected virtual void Build () w2.Expand = false; w2.Fill = false; // Container child hbox4.Gtk.Box+BoxChild - this.comboboxCategories = global::Gtk.ComboBox.NewText (); - this.comboboxCategories.Name = "comboboxCategories"; - this.hbox4.Add (this.comboboxCategories); + // this.comboboxCategories = global::Gtk.ComboBox.NewText (); + // this.comboboxCategories.Name = "comboboxCategories"; + // this.hbox4.Add (this.comboboxCategories); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.comboboxCategories])); w3.Position = 1; this.vbox2.Add (this.hbox4); @@ -242,15 +242,15 @@ protected virtual void Build () this.vbox5.Add (this.hpaned1); global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hpaned1])); w21.Position = 0; - w1.Add (this.vbox5); - global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5])); - w22.Position = 0; + // w1.Add (this.vbox5); + // global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5])); + // w22.Position = 0; // Internal child MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.ActionArea - global::Gtk.HButtonBox w23 = this.ActionArea; - w23.Name = "dialog1_ActionArea"; - w23.Spacing = 10; - w23.BorderWidth = ((uint)(5)); - w23.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w23 = this.ActionArea; + // w23.Name = "dialog1_ActionArea"; + // w23.Spacing = 10; + // w23.BorderWidth = ((uint)(5)); + // w23.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -260,9 +260,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w24 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w23 [this.buttonCancel])); - w24.Expand = false; - w24.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w24 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w23 [this.buttonCancel])); + // w24.Expand = false; + // w24.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -272,10 +272,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - global::Gtk.ButtonBox.ButtonBoxChild w25 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w23 [this.buttonOk])); - w25.Position = 1; - w25.Expand = false; - w25.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w25 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w23 [this.buttonOk])); + // w25.Position = 1; + // w25.Expand = false; + // w25.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.cs b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.cs index cd04457ed65..c6566a01c8e 100644 --- a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.cs +++ b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.cs @@ -27,10 +27,10 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.Spacing = 6; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Name = "dialog1_VBox"; + // w1.Spacing = 6; + // w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox4 = new global::Gtk.VBox (); this.vbox4.Name = "vbox4"; @@ -69,24 +69,24 @@ protected virtual void Build () w4.Expand = false; w4.Fill = false; // Container child vbox4.Gtk.Box+BoxChild - this.comboboxInitFrom = global::Gtk.ComboBox.NewText (); - this.comboboxInitFrom.Name = "comboboxInitFrom"; - this.vbox4.Add (this.comboboxInitFrom); + // this.comboboxInitFrom = global::Gtk.ComboBox.NewText (); + // this.comboboxInitFrom.Name = "comboboxInitFrom"; + // this.vbox4.Add (this.comboboxInitFrom); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.comboboxInitFrom])); w5.Position = 3; w5.Expand = false; w5.Fill = false; - w1.Add (this.vbox4); - global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox4])); - w6.Position = 0; - w6.Expand = false; - w6.Fill = false; + //w1.Add (this.vbox4); + // global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox4])); + // w6.Position = 0; + // w6.Expand = false; + // w6.Fill = false; // Internal child MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.ActionArea - global::Gtk.HButtonBox w7 = this.ActionArea; - w7.Name = "dialog1_ActionArea"; - w7.Spacing = 10; - w7.BorderWidth = ((uint)(5)); - w7.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w7 = this.ActionArea; + // w7.Name = "dialog1_ActionArea"; + // w7.Spacing = 10; + // w7.BorderWidth = ((uint)(5)); + // w7.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -96,9 +96,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7 [this.buttonCancel])); - w8.Expand = false; - w8.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7 [this.buttonCancel])); + // w8.Expand = false; + // w8.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -108,10 +108,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - global::Gtk.ButtonBox.ButtonBoxChild w9 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7 [this.buttonOk])); - w9.Position = 1; - w9.Expand = false; - w9.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w9 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7 [this.buttonOk])); + // w9.Position = 1; + // w9.Expand = false; + // w9.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Project.CodeGenerationPanelWidget.cs b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Project.CodeGenerationPanelWidget.cs index a36d4e6666b..96c78cb5970 100644 --- a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Project.CodeGenerationPanelWidget.cs +++ b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Project.CodeGenerationPanelWidget.cs @@ -142,14 +142,14 @@ protected virtual void Build () this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild - this.comboPlatforms = global::Gtk.ComboBox.NewText (); - this.comboPlatforms.AppendText (global::Mono.Unix.Catalog.GetString ("Any CPU")); - this.comboPlatforms.AppendText (global::Mono.Unix.Catalog.GetString ("x86")); - this.comboPlatforms.AppendText (global::Mono.Unix.Catalog.GetString ("x64")); - this.comboPlatforms.AppendText (global::Mono.Unix.Catalog.GetString ("Itanium")); - this.comboPlatforms.Name = "comboPlatforms"; - this.comboPlatforms.Active = 0; - this.hbox1.Add (this.comboPlatforms); + //this.comboPlatforms = global::Gtk.ComboBox.NewText (); + //this.comboPlatforms.AppendText (global::Mono.Unix.Catalog.GetString ("Any CPU")); + //this.comboPlatforms.AppendText (global::Mono.Unix.Catalog.GetString ("x86")); + //this.comboPlatforms.AppendText (global::Mono.Unix.Catalog.GetString ("x64")); + //this.comboPlatforms.AppendText (global::Mono.Unix.Catalog.GetString ("Itanium")); + //this.comboPlatforms.Name = "comboPlatforms"; + //this.comboPlatforms.Active = 0; + //this.hbox1.Add (this.comboPlatforms); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.comboPlatforms])); w5.Position = 0; w5.Expand = false; @@ -167,15 +167,15 @@ protected virtual void Build () this.hbox2.Name = "hbox2"; this.hbox2.Spacing = 6; // Container child hbox2.Gtk.Box+BoxChild - this.comboDebug = global::Gtk.ComboBox.NewText (); - this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("Full")); - this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("Symbols only")); - this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("Portable")); - this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("Embedded")); - this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("None")); - this.comboDebug.Name = "comboDebug"; - this.comboDebug.Active = 0; - this.hbox2.Add (this.comboDebug); + //this.comboDebug = global::Gtk.ComboBox.NewText (); + //this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("Full")); + //this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("Symbols only")); + //this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("Portable")); + //this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("Embedded")); + // this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("None")); + // this.comboDebug.Name = "comboDebug"; + // this.comboDebug.Active = 0; + // this.hbox2.Add (this.comboDebug); global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.comboDebug])); w7.Position = 0; w7.Expand = false; diff --git a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget.cs b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget.cs index 15aaf60a494..e4d0b992dc4 100644 --- a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget.cs +++ b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget.cs @@ -18,7 +18,7 @@ partial class CompilerOptionsPanelWidget private global::Gtk.Table table7; - private global::Gtk.ComboBoxEntry codepageEntry; + //private global::Gtk.ComboBoxEntry codepageEntry; private global::Gtk.HBox hbox57; @@ -34,7 +34,7 @@ partial class CompilerOptionsPanelWidget private global::Gtk.Label label88; - private global::Gtk.ComboBoxEntry mainClassEntry; + //private global::Gtk.ComboBoxEntry mainClassEntry; private global::Gtk.CheckButton noStdLibCheckButton; @@ -102,16 +102,16 @@ protected virtual void Build () this.table7.RowSpacing = ((uint)(6)); this.table7.ColumnSpacing = ((uint)(6)); // Container child table7.Gtk.Table+TableChild - this.codepageEntry = global::Gtk.ComboBoxEntry.NewText (); - this.codepageEntry.Name = "codepageEntry"; - this.table7.Add (this.codepageEntry); - global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table7 [this.codepageEntry])); - w3.TopAttach = ((uint)(3)); - w3.BottomAttach = ((uint)(4)); - w3.LeftAttach = ((uint)(1)); - w3.RightAttach = ((uint)(2)); - w3.XOptions = ((global::Gtk.AttachOptions)(4)); - w3.YOptions = ((global::Gtk.AttachOptions)(4)); + //this.codepageEntry = global::Gtk.ComboBoxEntry.NewText (); + //this.codepageEntry.Name = "codepageEntry"; + //this.table7.Add (this.codepageEntry); + // global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table7 [this.codepageEntry])); + // w3.TopAttach = ((uint)(3)); + // w3.BottomAttach = ((uint)(4)); + // w3.LeftAttach = ((uint)(1)); + // w3.RightAttach = ((uint)(2)); + // w3.XOptions = ((global::Gtk.AttachOptions)(4)); + // w3.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table7.Gtk.Table+TableChild this.hbox57 = new global::Gtk.HBox (); this.hbox57.Name = "hbox57"; @@ -185,15 +185,15 @@ protected virtual void Build () w10.XOptions = ((global::Gtk.AttachOptions)(4)); w10.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table7.Gtk.Table+TableChild - this.mainClassEntry = new global::Gtk.ComboBoxEntry (); - this.mainClassEntry.Name = "mainClassEntry"; - this.table7.Add (this.mainClassEntry); - global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table7 [this.mainClassEntry])); - w11.TopAttach = ((uint)(1)); - w11.BottomAttach = ((uint)(2)); - w11.LeftAttach = ((uint)(1)); - w11.RightAttach = ((uint)(2)); - w11.YOptions = ((global::Gtk.AttachOptions)(4)); + //this.mainClassEntry = new global::Gtk.ComboBoxEntry (); + //this.mainClassEntry.Name = "mainClassEntry"; + //this.table7.Add (this.mainClassEntry); + // global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table7 [this.mainClassEntry])); + // w11.TopAttach = ((uint)(1)); + // w11.BottomAttach = ((uint)(2)); + // w11.LeftAttach = ((uint)(1)); + // w11.RightAttach = ((uint)(2)); + // w11.YOptions = ((global::Gtk.AttachOptions)(4)); this.vbox2.Add (this.table7); global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.table7])); w12.Position = 0; @@ -274,9 +274,9 @@ protected virtual void Build () w19.YOptions = ((global::Gtk.AttachOptions)(4)); w19.XPadding = 6; // Container child table2.Gtk.Table+TableChild - this.langVerCombo = global::Gtk.ComboBox.NewText (); - this.langVerCombo.Name = "langVerCombo"; - this.table2.Add (this.langVerCombo); + //this.langVerCombo = global::Gtk.ComboBox.NewText (); + //this.langVerCombo.Name = "langVerCombo"; + //this.table2.Add (this.langVerCombo); global::Gtk.Table.TableChild w20 = ((global::Gtk.Table.TableChild)(this.table2 [this.langVerCombo])); w20.LeftAttach = ((uint)(1)); w20.RightAttach = ((uint)(2)); @@ -312,7 +312,7 @@ protected virtual void Build () if ((this.Child != null)) { this.Child.ShowAll (); } - this.label88.MnemonicWidget = this.mainClassEntry; + //this.label88.MnemonicWidget = this.mainClassEntry; this.Show (); } } diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtension.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtension.cs index ec2ba8e078b..f7b7ebcf0d3 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtension.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtension.cs @@ -288,7 +288,7 @@ void JumpToDeclaration (bool focusEditor) } } - static void OutlineTreeIconFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) + static void OutlineTreeIconFunc (TreeViewColumn column, CellRenderer cell, ITreeModel model, TreeIter iter) { var pixRenderer = (CellRendererImage)cell; object o = model.GetValue (iter, 0); @@ -299,7 +299,7 @@ static void OutlineTreeIconFunc (TreeViewColumn column, CellRenderer cell, TreeM } } - static void OutlineTreeTextFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) + static void OutlineTreeTextFunc (TreeViewColumn column, CellRenderer cell, ITreeModel model, TreeIter iter) { var astAmbience = new AstAmbience (IdeApp.TypeSystemService.Workspace.Options); var txtRenderer = (CellRendererText)cell; diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/OutlineNodeComparer.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/OutlineNodeComparer.cs index ea844666b03..d78b5fef2f6 100755 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/OutlineNodeComparer.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/OutlineNodeComparer.cs @@ -48,7 +48,7 @@ class OutlineNodeComparer : IComparer const string DEFAULT_REGION_NAME = "region"; AstAmbience ambience; - TreeModel model; + ITreeModel model; OutlineSettings settings; int[] groupTable; @@ -61,7 +61,7 @@ class OutlineNodeComparer : IComparer /// /// The model containing the nodes to compare. /// - public OutlineNodeComparer (AstAmbience ambience, OutlineSettings settings, TreeModel model) + public OutlineNodeComparer (AstAmbience ambience, OutlineSettings settings, ITreeModel model) { this.ambience = ambience; this.settings = settings; @@ -95,7 +95,7 @@ public int Compare (TreeIter a, TreeIter b) /// Zero if nodeA == nodeB. /// Greater than zero if nodeA > nodeB. /// - public int CompareNodes (TreeModel model, TreeIter node1, TreeIter node2) + public int CompareNodes (ITreeModel model, TreeIter node1, TreeIter node2) { object o1 = model.GetValue (node1, 0); object o2 = model.GetValue (node2, 0); diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs index 21bfd6ec2c0..6bff31a6dfe 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs @@ -207,22 +207,22 @@ public BorderBox () : base (false, 8) BorderWidth = 3; } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - Style.PaintFlatBox (Style, - evnt.Window, - StateType.Normal, - ShadowType.Out, - evnt.Area, - this, - "tooltip", - Allocation.X + 1, - Allocation.Y + 1, - Allocation.Width - 2, - Allocation.Height - 2); + // protected override bool OnExposeEvent (Gdk.EventExpose evnt) + // { + // Style.PaintFlatBox (Style, + // evnt.Window, + // StateType.Normal, + // ShadowType.Out, + // evnt.Area, + // this, + // "tooltip", + // Allocation.X + 1, + // Allocation.Y + 1, + // Allocation.Width - 2, + // Allocation.Height - 2); - return base.OnExposeEvent (evnt); - } + // return base.OnExposeEvent (evnt); + // } } /* protected override bool OnExposeEvent (Gdk.EventExpose evnt) diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs index 82876359b6f..2512fa86be0 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs @@ -217,9 +217,9 @@ public override async Task CreateTooltipInformation (bool sm markup.AppendTaggedText (theme, taggedParts); } else { markup.AppendTaggedText (theme, taggedParts.Take (i)); - markup.Append (""); + //markup.Append (""); markup.AppendLine (); markup.AppendLine (); markup.AppendTaggedText (theme, taggedParts.Skip (i + 1)); @@ -227,9 +227,9 @@ public override async Task CreateTooltipInformation (bool sm } markup.AppendLine (); markup.AppendLine (); - markup.Append (""); + //markup.Append (""); markup.AppendLine (GettextCatalog.GetString ("Note: creates an using for namespace:")); markup.Append (""); markup.Append (Ambience.EscapeText (type.ContainingNamespace.ToDisplayString ())); diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs index 71de4934b4b..c28d52f7feb 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs @@ -117,16 +117,16 @@ public CSharpFormattingProfileDialog (CSharpFormattingPolicy profile) return; } - TreeModel model; + ITreeModel model; TreeIter iter; if (treeView.Selection.GetSelected (out model, out iter)) UpdateExample (model, iter); }; notebookCategories.ShowTabs = false; - comboboxCategories.AppendText (GettextCatalog.GetString ("Indentation")); - comboboxCategories.AppendText (GettextCatalog.GetString ("New Lines")); - comboboxCategories.AppendText (GettextCatalog.GetString ("Spacing")); - comboboxCategories.AppendText (GettextCatalog.GetString ("Wrapping")); + //comboboxCategories.AppendText (GettextCatalog.GetString ("Indentation")); + //comboboxCategories.AppendText (GettextCatalog.GetString ("New Lines")); + //comboboxCategories.AppendText (GettextCatalog.GetString ("Spacing")); + //comboboxCategories.AppendText (GettextCatalog.GetString ("Wrapping")); comboboxCategories.Changed += delegate { texteditor.Text = ""; notebookCategories.Page = comboboxCategories.Active; @@ -634,7 +634,7 @@ static TreeIter AddOption (TreeStore model, TreeIter parent, string propertyName void TreeSelectionChanged (object sender, EventArgs e) { var treeSelection = (TreeSelection)sender; - TreeModel model; + ITreeModel model; TreeIter iter; if (treeSelection.GetSelected (out model, out iter)) { var info = GetProperty (model, iter); @@ -650,7 +650,7 @@ void TreeSelectionChanged (object sender, EventArgs e) } - void UpdateExample (TreeModel model, TreeIter iter) + void UpdateExample (ITreeModel model, TreeIter iter) { string example = (string)model.GetValue (iter, exampleTextColumn); UpdateExample (example); @@ -671,7 +671,7 @@ void UpdateExample (string example) texteditor.Text = CSharpFormatter.FormatText (profile.CreateOptions (textPolicy), text, 0, text.Length); } - static PropertyInfo GetProperty (TreeModel model, TreeIter iter) + static PropertyInfo GetProperty (ITreeModel model, TreeIter iter) { string propertyName = (string)model.GetValue (iter, propertyColumn); if (string.IsNullOrEmpty (propertyName)) @@ -685,7 +685,7 @@ object GetValue (string propertyName) return info.GetValue (profile, null); } - static void RenderIcon (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) + static void RenderIcon (TreeViewColumn col, CellRenderer cell, ITreeModel model, TreeIter iter) { var pixbufCellRenderer = (CellRendererImage)cell; if (model.IterHasChild (iter)) { @@ -695,7 +695,7 @@ static void RenderIcon (TreeViewColumn col, CellRenderer cell, TreeModel model, } } - static void ComboboxDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) + static void ComboboxDataFunc (TreeViewColumn col, CellRenderer cell, ITreeModel model, TreeIter iter) { var cellRenderer = (CellRendererCombo)cell; var info = GetProperty (model, iter); @@ -710,7 +710,7 @@ static void ComboboxDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel m cellRenderer.Text = value is Enum ? TranslateValue (value) : value.ToString (); } - static void ToggleDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) + static void ToggleDataFunc (TreeViewColumn col, CellRenderer cell, ITreeModel model, TreeIter iter) { var cellRenderer = (CellRendererToggle)cell; var info = GetProperty (model, iter); diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs index c238a692118..4d482c10882 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs @@ -37,7 +37,7 @@ using MonoDevelop.Components.AtkCocoaHelper; using MonoDevelop.Core; using MonoDevelop.Projects; -using MonoDevelop.Projects.Text; +using MonoDevelop.Projects.Text; using MonoDevelop.Ide.Gui.Dialogs; using MonoDevelop.Ide; using MonoDevelop.Ide.TypeSystem; @@ -50,7 +50,7 @@ namespace MonoDevelop.CSharp.Project partial class CompilerOptionsPanelWidget : Gtk.Bin { DotNetProject project; - ListStore classListStore; + ListStore classListStore; bool classListFilled; LanguageVersion[] unsupportedLanguageVersions = { }; @@ -63,35 +63,35 @@ public CompilerOptionsPanelWidget (DotNetProject project) CSharpCompilerParameters compilerParameters = (CSharpCompilerParameters) configuration.CompilationParameters; var csproject = (CSharpProject)project; - compileTargetCombo.CompileTarget = configuration.CompileTarget; + compileTargetCombo.CompileTarget = configuration.CompileTarget; compileTargetCombo.Changed += new EventHandler (OnTargetChanged); if (project.IsLibraryBasedProjectType) { //fixme: should we totally hide these? compileTargetCombo.Sensitive = false; - mainClassEntry.Sensitive = false; + //mainClassEntry.Sensitive = false; } else { - classListStore = new ListStore (typeof(string)); - mainClassEntry.Model = classListStore; - mainClassEntry.TextColumn = 0; - ((Entry)mainClassEntry.Child).Text = csproject.MainClass ?? string.Empty; + classListStore = new ListStore (typeof(string)); + //mainClassEntry.Model = classListStore; + //mainClassEntry.TextColumn = 0; + //((Entry)mainClassEntry.Child).Text = csproject.MainClass ?? string.Empty; UpdateTarget (); } // Load the codepage. If it matches any of the supported encodigs, use the encoding name string foundEncoding = null; - foreach (TextEncoding e in TextEncoding.SupportedEncodings) { - if (e.CodePage == -1) - continue; - if (e.CodePage == csproject.CodePage) - foundEncoding = e.Id; - codepageEntry.AppendText (e.Id); - } - if (foundEncoding != null) - codepageEntry.Entry.Text = foundEncoding; - else if (csproject.CodePage != 0) - codepageEntry.Entry.Text = csproject.CodePage.ToString (); + //foreach (TextEncoding e in TextEncoding.SupportedEncodings) { + // if (e.CodePage == -1) + // continue; + // if (e.CodePage == csproject.CodePage) + // foundEncoding = e.Id; + //codepageEntry.AppendText (e.Id); + //} + //if (foundEncoding != null) + // codepageEntry.Entry.Text = foundEncoding; + //else if (csproject.CodePage != 0) + // codepageEntry.Entry.Text = csproject.CodePage.ToString (); iconEntry.Path = csproject.Win32Icon; iconEntry.DefaultPath = project.BaseDirectory; @@ -155,17 +155,17 @@ void SetupAccessibility () compileTargetCombo.SetCommonAccessibilityAttributes ("CodeGeneration.CompileTarget", label86, GettextCatalog.GetString ("Select the compile target for the code generation")); - mainClassEntry.SetCommonAccessibilityAttributes ("CodeGeneration.MainClass", label88, - GettextCatalog.GetString ("Enter the main class for the code generation")); + //mainClassEntry.SetCommonAccessibilityAttributes ("CodeGeneration.MainClass", label88, + // GettextCatalog.GetString ("Enter the main class for the code generation")); iconEntry.SetEntryAccessibilityAttributes ("CodeGeneration.WinIcon", "", GettextCatalog.GetString ("Enter the file to use as the icon on Windows")); iconEntry.SetAccessibilityLabelRelationship (label3); - codepageEntry.SetCommonAccessibilityAttributes ("CodeGeneration.CodePage", label1, - GettextCatalog.GetString ("Select the compiler code page")); + //codepageEntry.SetCommonAccessibilityAttributes ("CodeGeneration.CodePage", label1, + // GettextCatalog.GetString ("Select the compiler code page")); - noStdLibCheckButton.SetCommonAccessibilityAttributes ("CodeGeneration.NoStdLib", "", GettextCatalog.GetString ("Whether or not to include a reference to mscorlib.dll")); + //noStdLibCheckButton.SetCommonAccessibilityAttributes ("CodeGeneration.NoStdLib", "", GettextCatalog.GetString ("Whether or not to include a reference to mscorlib.dll")); langVerCombo.SetCommonAccessibilityAttributes ("CodeGeneration.LanguageVersion", label2, GettextCatalog.GetString ("Select the version of C# to use")); @@ -176,23 +176,23 @@ void SetupAccessibility () public bool ValidateChanges () { - if (codepageEntry.Entry.Text.Length > 0) { + //if (codepageEntry.Entry.Text.Length > 0) { // Get the codepage. If the user specified an encoding name, find it. int trialCodePage = -1; - foreach (TextEncoding e in TextEncoding.SupportedEncodings) { - if (e.Id == codepageEntry.Entry.Text) { - trialCodePage = e.CodePage; - break; - } - } + // foreach (TextEncoding e in TextEncoding.SupportedEncodings) { + // if (e.Id == codepageEntry.Entry.Text) { + // trialCodePage = e.CodePage; + // break; + // } + // } - if (trialCodePage == -1) { - if (!int.TryParse (codepageEntry.Entry.Text, out trialCodePage)) { - MessageService.ShowError (GettextCatalog.GetString ("Invalid code page number.")); - return false; - } - } - } + // if (trialCodePage == -1) { + // if (!int.TryParse (codepageEntry.Entry.Text, out trialCodePage)) { + // MessageService.ShowError (GettextCatalog.GetString ("Invalid code page number.")); + // return false; + // } + // } + //} return true; } @@ -208,25 +208,25 @@ public void Store (ItemConfigurationCollection configs) isBadVersion = (bool)langVerCombo.Model.GetValue (iter, 2); } - if (codepageEntry.Entry.Text.Length > 0) { + //if (codepageEntry.Entry.Text.Length > 0) { // Get the codepage. If the user specified an encoding name, find it. - int trialCodePage = -1; - foreach (TextEncoding e in TextEncoding.SupportedEncodings) { - if (e.Id == codepageEntry.Entry.Text) { - trialCodePage = e.CodePage; - break; - } - } + //int trialCodePage = -1; + // foreach (TextEncoding e in TextEncoding.SupportedEncodings) { + // if (e.Id == codepageEntry.Entry.Text) { + // trialCodePage = e.CodePage; + // break; + // } + // } - if (trialCodePage != -1) - codePage = trialCodePage; - else { - if (!int.TryParse (codepageEntry.Entry.Text, out trialCodePage)) { - return; - } - codePage = trialCodePage; - } - } else + //if (trialCodePage != -1) + // codePage = trialCodePage; + // else { + // if (!int.TryParse (codepageEntry.Entry.Text, out trialCodePage)) { + // return; + // } + // codePage = trialCodePage; + // } + //} else codePage = 0; project.CompileTarget = compileTargetCombo.CompileTarget; @@ -238,8 +238,8 @@ public void Store (ItemConfigurationCollection configs) if (iconEntry.Sensitive) csproject.Win32Icon = iconEntry.Path; - if (mainClassEntry.Sensitive) - csproject.MainClass = mainClassEntry.Entry.Text; + // if (mainClassEntry.Sensitive) + // csproject.MainClass = mainClassEntry.Entry.Text; foreach (DotNetProjectConfiguration configuration in configs) { CSharpCompilerParameters compilerParameters = (CSharpCompilerParameters) configuration.CompilationParameters; compilerParameters.UnsafeCode = allowUnsafeCodeCheckButton.Active; @@ -249,36 +249,36 @@ public void Store (ItemConfigurationCollection configs) } } - void OnTargetChanged (object s, EventArgs a) - { - UpdateTarget (); + void OnTargetChanged (object s, EventArgs a) + { + UpdateTarget (); } - void UpdateTarget () - { - if (compileTargetCombo.CompileTarget == CompileTarget.Library) { - iconEntry.Sensitive = false; - } else { - iconEntry.Sensitive = true; + void UpdateTarget () + { + if (compileTargetCombo.CompileTarget == CompileTarget.Library) { + iconEntry.Sensitive = false; + } else { + iconEntry.Sensitive = true; if (!classListFilled) - FillClasses (); - } + FillClasses (); + } } - void FillClasses () - { + void FillClasses () + { try { var ctx = IdeApp.TypeSystemService.GetCompilationAsync (project).Result; if (ctx == null) // Project not found in parser database return; - foreach (var c in ctx.Assembly.GlobalNamespace.GetTypeMembers ()) { - foreach (var m in c.GetMembers().OfType ()) { - if (m.IsStatic && m.Name == "Main") - classListStore.AppendValues (c.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat)); - } - } - classListFilled = true; + foreach (var c in ctx.Assembly.GlobalNamespace.GetTypeMembers ()) { + foreach (var m in c.GetMembers().OfType ()) { + if (m.IsStatic && m.Name == "Main") + classListStore.AppendValues (c.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat)); + } + } + classListFilled = true; } catch (InvalidOperationException) { // Project not found in parser database } @@ -287,19 +287,19 @@ void FillClasses () class CompilerOptionsPanel : ItemOptionsPanel { - CompilerOptionsPanelWidget widget; - - public override Control CreatePanelWidget () - { - return (widget = new CompilerOptionsPanelWidget ((DotNetProject) ConfiguredProject)); - } - + CompilerOptionsPanelWidget widget; + + public override Control CreatePanelWidget () + { + return (widget = new CompilerOptionsPanelWidget ((DotNetProject) ConfiguredProject)); + } + public override bool ValidateChanges () { return widget.ValidateChanges (); } - public override void ApplyChanges () + public override void ApplyChanges () { MultiConfigItemOptionsDialog dlg = (MultiConfigItemOptionsDialog) ParentDialog; widget.Store (dlg.Configurations); diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/QuickInfoProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/QuickInfoProvider.cs index 54968ba2a05..20b43d10872 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/QuickInfoProvider.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/QuickInfoProvider.cs @@ -84,9 +84,9 @@ static class QuickInfoProvider var formatter = ctx.RoslynWorkspace.Services.GetLanguageServices (model.Language).GetService (); var documentation = symbol.GetDocumentationParts (model, caretOffset, formatter, cancellationToken); - sb.Append (""); + //sb.Append (""); if (documentation != null && documentation.Any ()) { sb.AppendLine (); diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/SignatureMarkupCreator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/SignatureMarkupCreator.cs index 2093e8b2b34..3482bdd03a0 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/SignatureMarkupCreator.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/SignatureMarkupCreator.cs @@ -1810,10 +1810,10 @@ Gdk.Color AlphaBlend (Gdk.Color color, Gdk.Color color2, double alpha) ); } - Gdk.Color AlphaBlend (Cairo.Color color, Cairo.Color color2, double alpha) - { - return AlphaBlend ((Gdk.Color)((HslColor)color), (Gdk.Color)((HslColor)color2), alpha); - } + // Gdk.Color AlphaBlend (Cairo.Color color, Cairo.Color color2, double alpha) + // { + // return AlphaBlend ((Gdk.Color)((HslColor)color), (Gdk.Color)((HslColor)color2), alpha); + // } HslColor AlphaBlend (HslColor color, HslColor color2, double alpha) { diff --git a/main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs b/main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs index 8611a4ee2b5..33a5b35dd49 100644 --- a/main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs +++ b/main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs @@ -47,15 +47,15 @@ public AddLogEntryDialog (Dictionary entries) { Build (); - textview.ModifyFont (IdeServices.FontService.MonospaceFont); + //textview.ModifyFont (IdeServices.FontService.MonospaceFont); textview.WrapMode = WrapMode.None; textview.AcceptsTab = true; Pango.TabArray tabs = new Pango.TabArray (1, true); tabs.SetTab (0, Pango.TabAlign.Left, GetStringWidth (" ") * 4); textview.Tabs = tabs; - textview.SizeRequested += delegate { - textview.WidthRequest = GetStringWidth (String.Empty.PadRight (80)); - }; + // textview.SizeRequested += delegate { + // textview.WidthRequest = GetStringWidth (String.Empty.PadRight (80)); + // }; store = new ListStore (typeof(ChangeLogEntry), typeof(Xwt.Drawing.Image), typeof(string)); fileList.Model = store; diff --git a/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs b/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs index 1147223786f..63f17ba95c7 100644 --- a/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs +++ b/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs @@ -58,11 +58,11 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Events = ((global::Gdk.EventMask)(256)); - w1.Name = "dialog_VBox"; - w1.Spacing = 6; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Events = ((global::Gdk.EventMask)(256)); + // w1.Name = "dialog_VBox"; + // w1.Spacing = 6; + // w1.BorderWidth = ((uint)(2)); // Container child dialog_VBox.Gtk.Box+BoxChild this.vbox1 = new global::Gtk.VBox (); this.vbox1.Name = "vbox1"; @@ -239,16 +239,16 @@ protected virtual void Build () w20.Position = 3; w20.Expand = false; w20.Fill = false; - w1.Add (this.vbox1); - global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox1])); - w21.Position = 0; + // w1.Add (this.vbox1); + // global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox1])); + // w21.Position = 0; // Internal child MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.ActionArea - global::Gtk.HButtonBox w22 = this.ActionArea; - w22.Events = ((global::Gdk.EventMask)(256)); - w22.Name = "ChangeLogAddIn.AddLogEntryDialog_ActionArea"; - w22.Spacing = 6; - w22.BorderWidth = ((uint)(5)); - w22.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w22 = this.ActionArea; + // w22.Events = ((global::Gdk.EventMask)(256)); + // w22.Name = "ChangeLogAddIn.AddLogEntryDialog_ActionArea"; + // w22.Spacing = 6; + // w22.BorderWidth = ((uint)(5)); + // w22.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child ChangeLogAddIn.AddLogEntryDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button7 = new global::Gtk.Button (); this.button7.CanDefault = true; @@ -258,9 +258,9 @@ protected virtual void Build () this.button7.UseUnderline = true; this.button7.Label = "gtk-cancel"; this.AddActionWidget (this.button7, -6); - global::Gtk.ButtonBox.ButtonBoxChild w23 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w22 [this.button7])); - w23.Expand = false; - w23.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w23 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w22 [this.button7])); + // w23.Expand = false; + // w23.Fill = false; // Container child ChangeLogAddIn.AddLogEntryDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button119 = new global::Gtk.Button (); this.button119.CanDefault = true; @@ -270,10 +270,10 @@ protected virtual void Build () this.button119.UseUnderline = true; this.button119.Label = "gtk-ok"; this.AddActionWidget (this.button119, -5); - global::Gtk.ButtonBox.ButtonBoxChild w24 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w22 [this.button119])); - w24.Position = 1; - w24.Expand = false; - w24.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w24 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w22 [this.button119])); + // w24.Position = 1; + // w24.Expand = false; + // w24.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs b/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs index 70e36654d4d..b9aaf694fd8 100644 --- a/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs +++ b/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs @@ -47,8 +47,8 @@ protected virtual void Build () this.noneRadioButton.Active = true; this.noneRadioButton.DrawIndicator = true; this.noneRadioButton.UseUnderline = true; - this.noneRadioButton.Group = new global::GLib.SList (global::System.IntPtr.Zero); - this.noneRadioButton.Remove (this.noneRadioButton.Child); + // this.noneRadioButton.Group = new global::GLib.SList (global::System.IntPtr.Zero); + // this.noneRadioButton.Remove (this.noneRadioButton.Child); // Container child noneRadioButton.Gtk.Container+ContainerChild this.label3 = new global::Gtk.Label (); this.label3.Name = "label3"; diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs index ae8cca33f86..4a081b9d872 100644 --- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs +++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs @@ -112,16 +112,16 @@ public AssemblyBrowserWidget () { this.Build (); - comboboxVisibilty = ComboBox.NewText (); - comboboxVisibilty.InsertText (0, GettextCatalog.GetString ("Only public members")); - comboboxVisibilty.InsertText (1, GettextCatalog.GetString ("All members")); - comboboxVisibilty.Active = Math.Min (1, Math.Max (0, PropertyService.Get ("AssemblyBrowser.MemberSelection", 0))); - comboboxVisibilty.Changed += delegate { - if (TreeView != null) - TreeView.PublicApiOnly = comboboxVisibilty.Active == 0; - PropertyService.Set ("AssemblyBrowser.MemberSelection", comboboxVisibilty.Active); - GenerateOutput (); - }; + //comboboxVisibilty = ComboBox.NewText (); + //comboboxVisibilty.InsertText (0, GettextCatalog.GetString ("Only public members")); + //comboboxVisibilty.InsertText (1, GettextCatalog.GetString ("All members")); + //comboboxVisibilty.Active = Math.Min (1, Math.Max (0, PropertyService.Get ("AssemblyBrowser.MemberSelection", 0))); + //comboboxVisibilty.Changed += delegate { + // if (TreeView != null) + // TreeView.PublicApiOnly = comboboxVisibilty.Active == 0; + // PropertyService.Set ("AssemblyBrowser.MemberSelection", comboboxVisibilty.Active); + // GenerateOutput (); + //}; searchentry1 = new MonoDevelop.Components.SearchEntry (); searchentry1.Ready = true; @@ -171,12 +171,12 @@ public AssemblyBrowserWidget () }; - languageCombobox = Gtk.ComboBox.NewText (); - languageCombobox.AppendText (GettextCatalog.GetString ("Summary")); - languageCombobox.AppendText (GettextCatalog.GetString ("IL")); - languageCombobox.AppendText (GettextCatalog.GetString ("C#")); - languageCombobox.Active = Math.Min (2, Math.Max (0, PropertyService.Get ("AssemblyBrowser.Language", 0))); - languageCombobox.Changed += LanguageComboboxhandleChanged; + //languageCombobox = Gtk.ComboBox.NewText (); + //languageCombobox.AppendText (GettextCatalog.GetString ("Summary")); + //languageCombobox.AppendText (GettextCatalog.GetString ("IL")); + //languageCombobox.AppendText (GettextCatalog.GetString ("C#")); + //languageCombobox.Active = Math.Min (2, Math.Max (0, PropertyService.Get ("AssemblyBrowser.Language", 0))); + //languageCombobox.Changed += LanguageComboboxhandleChanged; #pragma warning disable 618 TreeView = new AssemblyBrowserTreeView (new NodeBuilder[] { new ErrorNodeBuilder (), @@ -224,7 +224,7 @@ public AssemblyBrowserWidget () documentationScrolledWindow.PackStart (inspectEditor, true, true, 0); - this.ExposeEvent += HPaneExpose; + //this.ExposeEvent += HPaneExpose; hpaned1 = hpaned1.ReplaceWithWidget (new HPanedThin (), true); hpaned1.Position = 271; @@ -455,15 +455,15 @@ void CreateColumns () crt = new Gtk.CellRendererText (); col.PackStart (crp, false); col.PackStart (crt, true); - col.SetCellDataFunc (crp, RenderImage); - col.SetCellDataFunc (crt, RenderText); + //col.SetCellDataFunc (crp, RenderImage); + //col.SetCellDataFunc (crt, RenderText); col.SortColumnId = 1; searchTreeview.AppendColumn (col); col.Resizable = true; col = searchTreeview.AppendColumn (GettextCatalog.GetString ("Declaring Type"), crt = new Gtk.CellRendererText ()); col.FixedWidth = 300; col.Sizing = TreeViewColumnSizing.Fixed; - col.SetCellDataFunc (crt, RenderDeclaringTypeOrNamespace); + //col.SetCellDataFunc (crt, RenderDeclaringTypeOrNamespace); col.SortColumnId = 2; col.Resizable = true; searchTreeview.Model = resultListStore; @@ -475,8 +475,8 @@ void CreateColumns () crt = new Gtk.CellRendererText (); col.PackStart (crp, false); col.PackStart (crt, true); - col.SetCellDataFunc (crp, RenderImage); - col.SetCellDataFunc (crt, RenderText); + //col.SetCellDataFunc (crp, RenderImage); + //col.SetCellDataFunc (crt, RenderText); col.SortColumnId = 1; searchTreeview.AppendColumn (col); @@ -484,7 +484,7 @@ void CreateColumns () col.Sizing = TreeViewColumnSizing.Fixed; col.Resizable = true; col = searchTreeview.AppendColumn (GettextCatalog.GetString ("Parent"), crt = new Gtk.CellRendererText ()); - col.SetCellDataFunc (crt, RenderDeclaringTypeOrNamespace); + //col.SetCellDataFunc (crt, RenderDeclaringTypeOrNamespace); col.SortColumnId = 2; col.FixedWidth = 300; @@ -499,8 +499,8 @@ void CreateColumns () crt = new Gtk.CellRendererText (); col.PackStart (crp, false); col.PackStart (crt, true); - col.SetCellDataFunc (crp, RenderImage); - col.SetCellDataFunc (crt, RenderText); + //col.SetCellDataFunc (crp, RenderImage); + //col.SetCellDataFunc (crt, RenderText); col.SortColumnId = 1; searchTreeview.AppendColumn (col); col.FixedWidth = 400; @@ -508,7 +508,7 @@ void CreateColumns () col.Resizable = true; col = searchTreeview.AppendColumn (GettextCatalog.GetString ("Namespace"), crt = new Gtk.CellRendererText ()); - col.SetCellDataFunc (crt, RenderDeclaringTypeOrNamespace); + //col.SetCellDataFunc (crt, RenderDeclaringTypeOrNamespace); col.SortColumnId = 2; col.FixedWidth = 300; col.Sizing = TreeViewColumnSizing.Fixed; @@ -518,60 +518,60 @@ void CreateColumns () } } - void RenderDeclaringTypeOrNamespace (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) - { - var ct = (Gtk.CellRendererText)cell; - var entity = tree_model.GetValue (iter, 0) as IEntity; - if (entity != null) { - if (entity.DeclaringType != null) { - ct.Text = entity.DeclaringType.FullName; - return; - } - if (entity is ITypeDefinition type) { - ct.Text = type.Namespace; - } else { - ct.Text = entity.DeclaringType?.Namespace ?? ""; - } - } - } - - void RenderText (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) - { - var ct = (Gtk.CellRendererText)cell; - var entity = tree_model.GetValue (iter, 0) as INamedElement; - if (entity != null) - ct.Text = entity.Name; - } - - void RenderImage (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) - { - var ct = (CellRendererImage)cell; - var entity = tree_model.GetValue (iter, 0) as IEntity; - if (entity is IEvent evt) { - ct.Image = ImageService.GetIcon (EventDefinitionNodeBuilder.GetStockIcon (evt), Gtk.IconSize.Menu); - return; - } - - if (entity is IField field) { - ct.Image = ImageService.GetIcon (FieldDefinitionNodeBuilder.GetStockIcon (field), Gtk.IconSize.Menu); - return; - } - - if (entity is IMethod method) { - ct.Image = ImageService.GetIcon (MethodDefinitionNodeBuilder.GetStockIcon (method), Gtk.IconSize.Menu); - return; - } - - if (entity is IProperty property) { - ct.Image = ImageService.GetIcon (PropertyDefinitionNodeBuilder.GetStockIcon (property), Gtk.IconSize.Menu); - return; - } + // void RenderDeclaringTypeOrNamespace (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) + // { + // var ct = (Gtk.CellRendererText)cell; + // var entity = tree_model.GetValue (iter, 0) as IEntity; + // if (entity != null) { + // if (entity.DeclaringType != null) { + // ct.Text = entity.DeclaringType.FullName; + // return; + // } + // if (entity is ITypeDefinition type) { + // ct.Text = type.Namespace; + // } else { + // ct.Text = entity.DeclaringType?.Namespace ?? ""; + // } + // } + // } + + // void RenderText (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) + // { + // var ct = (Gtk.CellRendererText)cell; + // var entity = tree_model.GetValue (iter, 0) as INamedElement; + // if (entity != null) + // ct.Text = entity.Name; + // } + + // void RenderImage (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) + // { + // var ct = (CellRendererImage)cell; + // var entity = tree_model.GetValue (iter, 0) as IEntity; + // if (entity is IEvent evt) { + // ct.Image = ImageService.GetIcon (EventDefinitionNodeBuilder.GetStockIcon (evt), Gtk.IconSize.Menu); + // return; + // } + + // if (entity is IField field) { + // ct.Image = ImageService.GetIcon (FieldDefinitionNodeBuilder.GetStockIcon (field), Gtk.IconSize.Menu); + // return; + // } + + // if (entity is IMethod method) { + // ct.Image = ImageService.GetIcon (MethodDefinitionNodeBuilder.GetStockIcon (method), Gtk.IconSize.Menu); + // return; + // } + + // if (entity is IProperty property) { + // ct.Image = ImageService.GetIcon (PropertyDefinitionNodeBuilder.GetStockIcon (property), Gtk.IconSize.Menu); + // return; + // } - if (entity is ITypeDefinition type) { - ct.Image = ImageService.GetIcon (TypeDefinitionNodeBuilder.GetStockIcon (type), Gtk.IconSize.Menu); - return; - } - } + // if (entity is ITypeDefinition type) { + // ct.Image = ImageService.GetIcon (TypeDefinitionNodeBuilder.GetStockIcon (type), Gtk.IconSize.Menu); + // return; + // } + // } CancellationTokenSource searchTokenSource = new CancellationTokenSource (); @@ -912,14 +912,14 @@ void GenerateOutput () } int oldSize2 = -1; - void HPaneExpose (object sender, Gtk.ExposeEventArgs args) - { - int size = this.Allocation.Width; - if (size == oldSize2) - return; - oldSize2 = size; - this.hpaned1.Position = Math.Min (350, this.Allocation.Width * 2 / 3); - } + // void HPaneExpose (object sender, Gtk.ExposeEventArgs args) + // { + // int size = this.Allocation.Width; + // if (size == oldSize2) + // return; + // oldSize2 = size; + // this.hpaned1.Position = Math.Min (350, this.Allocation.Width * 2 / 3); + // } internal void Open (string url, AssemblyLoader? currentAssembly = null, bool expandNode = true) { @@ -1132,7 +1132,7 @@ protected override void OnDestroyed () // this.searchInCombobox.Changed -= SearchInComboboxhandleChanged; // this.searchEntry.Changed -= SearchEntryhandleChanged; this.searchTreeview.RowActivated -= SearchTreeviewhandleRowActivated; - hpaned1.ExposeEvent -= HPaneExpose; + //hpaned1.ExposeEvent -= HPaneExpose; base.OnDestroyed (); } diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DocumentationPanel.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DocumentationPanel.cs index b7191c7738a..dbf84f2fbdd 100644 --- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DocumentationPanel.cs +++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DocumentationPanel.cs @@ -58,25 +58,25 @@ protected override void OnDestroyed () base.OnDestroyed (); } - protected override bool OnExposeEvent (EventExpose evnt) - { - Gdk.Window win = evnt.Window; - win.DrawRectangle (Style.BaseGC (string.IsNullOrEmpty (Markup) ? StateType.Insensitive : StateType.Normal), true, evnt.Area); - int x = 0; - int y = 0; - if (string.IsNullOrEmpty (Markup)) { - layout.SetMarkup (GettextCatalog.GetString ("No documentation available.")); - int width, height; - layout.GetPixelSize (out width, out height); - x = (Allocation.Width - width) / 2; - y = (Allocation.Height - height) / 2; - } else { - layout.SetMarkup (Markup); - } - layout.Width = Allocation.Width * (int)Pango.Scale.PangoScale; - win.DrawLayout (Style.TextGC (StateType.Normal), x, y, layout); - return true; - } + // protected override bool OnExposeEvent (EventExpose evnt) + // { + // Gdk.Window win = evnt.Window; + // win.DrawRectangle (Style.BaseGC (string.IsNullOrEmpty (Markup) ? StateType.Insensitive : StateType.Normal), true, evnt.Area); + // int x = 0; + // int y = 0; + // if (string.IsNullOrEmpty (Markup)) { + // layout.SetMarkup (GettextCatalog.GetString ("No documentation available.")); + // int width, height; + // layout.GetPixelSize (out width, out height); + // x = (Allocation.Width - width) / 2; + // y = (Allocation.Height - height) / 2; + // } else { + // layout.SetMarkup (Markup); + // } + // layout.Width = Allocation.Width * (int)Pango.Scale.PangoScale; + // win.DrawLayout (Style.TextGC (StateType.Normal), x, y, layout); + // return true; + // } public void CalculateSize () { diff --git a/main/src/addins/MonoDevelop.ConnectedServices/MonoDevelop.ConnectedServices.csproj b/main/src/addins/MonoDevelop.ConnectedServices/MonoDevelop.ConnectedServices.csproj index 408fc35ff6b..0259e79c023 100644 --- a/main/src/addins/MonoDevelop.ConnectedServices/MonoDevelop.ConnectedServices.csproj +++ b/main/src/addins/MonoDevelop.ConnectedServices/MonoDevelop.ConnectedServices.csproj @@ -13,6 +13,9 @@ + + gtk-sharp-3.0 + diff --git a/main/src/addins/MonoDevelop.DocFood/gtk-gui/generated.cs b/main/src/addins/MonoDevelop.DocFood/gtk-gui/generated.cs index c75fb5f90c7..6f178c192f8 100644 --- a/main/src/addins/MonoDevelop.DocFood/gtk-gui/generated.cs +++ b/main/src/addins/MonoDevelop.DocFood/gtk-gui/generated.cs @@ -23,24 +23,24 @@ internal class BinContainer public static BinContainer Attach (Gtk.Bin bin) { BinContainer bc = new BinContainer (); - bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested); + //bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested); bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated); bin.Added += new Gtk.AddedHandler (bc.OnAdded); return bc; } - private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args) - { - if ((this.child != null)) { - args.Requisition = this.child.SizeRequest (); - } - } + // private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args) + // { + // if ((this.child != null)) { + // args.Requisition = this.child.SizeRequest (); + // } + // } private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args) { - if ((this.child != null)) { - this.child.Allocation = args.Allocation; - } + // if ((this.child != null)) { + // this.child.Allocation = args.Allocation; + // } } private void OnAdded (object sender, Gtk.AddedArgs args) diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/DotNetCoreRuntimeOptionsPanelWidget.Gui.cs b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/DotNetCoreRuntimeOptionsPanelWidget.Gui.cs index 5467472836c..1c7b46496fc 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/DotNetCoreRuntimeOptionsPanelWidget.Gui.cs +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/DotNetCoreRuntimeOptionsPanelWidget.Gui.cs @@ -57,7 +57,7 @@ void Build () targetFrameworkLabel.UseUnderline = true; mainHBox.PackStart (targetFrameworkLabel, false, true, 0); - runtimeVersionCombo = ComboBox.NewText (); + //runtimeVersionCombo = ComboBox.NewText (); runtimeVersionCombo.Name = "runtimeVersionCombo"; mainHBox.PackStart (runtimeVersionCombo, false, false, 0); mainVBox.PackStart (mainHBox, false, false, 0); diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/DotNetCoreRuntimeOptionsPanelWidget.cs b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/DotNetCoreRuntimeOptionsPanelWidget.cs index c5cf91c091b..5ad02cbeb92 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/DotNetCoreRuntimeOptionsPanelWidget.cs +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/DotNetCoreRuntimeOptionsPanelWidget.cs @@ -50,7 +50,7 @@ public DotNetCoreRuntimeOptionsPanelWidget (DotNetProject project) } if (project.HasMultipleTargetFrameworks) { - runtimeVersionCombo.AppendText (GettextCatalog.GetString ("(Multiple Frameworks)")); + //runtimeVersionCombo.AppendText (GettextCatalog.GetString ("(Multiple Frameworks)")); runtimeVersionCombo.Active = 0; Sensitive = false; } else { @@ -76,11 +76,11 @@ public DotNetCoreRuntimeOptionsPanelWidget (DotNetProject project) for (int i = 0; i < knownFrameworks.Count; i++) { var fx = knownFrameworks[i]; - if (installedFrameworks.Any (f => f.Id == fx.Id)) { - runtimeVersionCombo.AppendText (fx.GetDisplayName ()); - } else { - runtimeVersionCombo.AppendText (GettextCatalog.GetString ("{0} (Not installed)", fx.GetDisplayName ())); - } + //if (installedFrameworks.Any (f => f.Id == fx.Id)) { + //runtimeVersionCombo.AppendText (fx.GetDisplayName ()); + //} else { + //runtimeVersionCombo.AppendText (GettextCatalog.GetString ("{0} (Not installed)", fx.GetDisplayName ())); + //} if (project.TargetFramework.Id == fx.Id) { runtimeVersionCombo.Active = i; diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/GtkDotNetCoreProjectTemplateWizardPageWidget.cs b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/GtkDotNetCoreProjectTemplateWizardPageWidget.cs index c5ad9384cf8..fa46fbd3b92 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/GtkDotNetCoreProjectTemplateWizardPageWidget.cs +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/GtkDotNetCoreProjectTemplateWizardPageWidget.cs @@ -99,9 +99,9 @@ public GtkDotNetCoreProjectTemplateWizardPageWidget (DotNetCoreProjectTemplateWi void PopulateTargetFrameworks () { - foreach (TargetFramework framework in wizardPage.TargetFrameworks) { - targetFrameworkComboBox.AppendText (framework.GetDisplayName ()); - } + // foreach (TargetFramework framework in wizardPage.TargetFrameworks) { + // targetFrameworkComboBox.AppendText (framework.GetDisplayName ()); + // } targetFrameworkComboBox.Active = wizardPage.SelectedTargetFrameworkIndex; } @@ -113,9 +113,9 @@ void TargetFrameworkComboBoxChanged (object sender, EventArgs e) void PopulateAuthentications () { - foreach (var authentication in wizardPage.SupportedAuthentications) { - authenticationComboBox.AppendText (authentication.Description); - } + // foreach (var authentication in wizardPage.SupportedAuthentications) { + // authenticationComboBox.AppendText (authentication.Description); + // } authenticationComboBox.Active = wizardPage.SelectedAuthenticationIndex; authenticationInformationLabel.LabelProp = wizardPage.SupportedAuthentications [wizardPage.SelectedAuthenticationIndex].Information; @@ -180,8 +180,8 @@ protected virtual void Build () configurationBottomEventBox = new EventBox { Name = "configurationBottomEventBox" }; - configurationVBox.PackStart (configurationBottomEventBox); - mainHBox.PackStart (configurationVBox); + //configurationVBox.PackStart (configurationBottomEventBox); + //mainHBox.PackStart (configurationVBox); // Add the image backgroundLargeImageEventBox = new EventBox { @@ -191,7 +191,7 @@ protected virtual void Build () Name = "backgroundLargeImageVBox" }; backgroundLargeImageEventBox.Add (backgroundLargeImageVBox); - mainHBox.PackStart (backgroundLargeImageEventBox); + //mainHBox.PackStart (backgroundLargeImageEventBox); Add (mainHBox); @@ -204,7 +204,7 @@ protected virtual void Build () void AddFrameworkSelection() { - targetFrameworkComboBox = ComboBox.NewText (); + //targetFrameworkComboBox = ComboBox.NewText (); targetFrameworkComboBox.WidthRequest = 350; targetFrameworkComboBox.Name = "targetFrameworkComboBox"; configurationTable.Attach (targetFrameworkComboBox, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0); @@ -232,7 +232,7 @@ void AddFrameworkSelection() void AddAuthenticationSelection(uint primaryRow) { - authenticationComboBox = ComboBox.NewText (); + //authenticationComboBox = ComboBox.NewText (); authenticationComboBox.WidthRequest = 350; authenticationComboBox.Name = "authenticationComboBox"; configurationTable.Attach (authenticationComboBox, 1, 2, primaryRow, primaryRow + 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0); diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreTestBase.cs b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreTestBase.cs index e30e89bf22f..82ea595776a 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreTestBase.cs +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreTestBase.cs @@ -36,12 +36,12 @@ namespace MonoDevelop.DotNetCore.Tests [RequireService (typeof (TypeSystemService))] class DotNetCoreTestBase : TestBase { - protected override Task InternalSetup (string rootDir) - { - base.InternalSetup (rootDir); - Xwt.Application.Initialize (Xwt.ToolkitType.Gtk3); - DesktopService.Initialize (); - } + //protected override Task InternalSetup (string rootDir) + //{ + //base.InternalSetup (rootDir); + //Xwt.Application.Initialize (Xwt.ToolkitType.Gtk3); + //DesktopService.Initialize (); + //} /// /// Clear all other package sources and just use the main NuGet package source when diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj index b1518171d39..db05c9738ac 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj @@ -17,6 +17,9 @@ + + gtk-sharp-3.0 + diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj index a2ffa3c2ddb..d6d3d118690 100644 --- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj +++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj @@ -15,6 +15,7 @@ + diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/MonoDevelopHexEditorStyle.cs b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/MonoDevelopHexEditorStyle.cs index fb5cfd0115a..3cf74e59fd9 100644 --- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/MonoDevelopHexEditorStyle.cs +++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/MonoDevelopHexEditorStyle.cs @@ -70,17 +70,17 @@ public void Dispose () IdeApp.Preferences.ColorScheme.Changed -= ColorSchemeChanged; } - public override Color HexOffset { - get { - return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.LineNumbers)); - } - } - - public override Color HexOffsetBg { - get { - return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.LineNumbersBackground)); - } - } + // public override Color HexOffset { + // get { + // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.LineNumbers)); + // } + // } + + // public override Color HexOffsetBg { + // get { + // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.LineNumbersBackground)); + // } + // } /* public override Color HexOffsetHighlighted { get { @@ -88,70 +88,70 @@ public override Color HexOffsetBg { } }*/ - public override Color HexDigit { - get { - return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Foreground)); - } - } - - public override Color HexDigitBg { - get { - return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Background)); - } - } - - public override Color DashedLineFg { - get { - return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Foreground)); - } - } - - public override Color DashedLineBg { - get { - return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Background)); - } - } - - public override Color IconBarBg { - get { - return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.IndicatorMarginSeparator)); - } - } - - public override Color IconBarSeperator { - get { - return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.IndicatorMarginSeparator)); - } - } - - public override Color BookmarkColor1 { - get { - return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.MessageBubbleWarningLine)); - } - } - - public override Color BookmarkColor2 { - get { - return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.MessageBubbleWarningLine2)); - } - } + // public override Color HexDigit { + // get { + // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Foreground)); + // } + // } + + // public override Color HexDigitBg { + // get { + // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Background)); + // } + // } + + // public override Color DashedLineFg { + // get { + // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Foreground)); + // } + // } + + // public override Color DashedLineBg { + // get { + // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Background)); + // } + // } + + // public override Color IconBarBg { + // get { + // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.IndicatorMarginSeparator)); + // } + // } + + // public override Color IconBarSeperator { + // get { + // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.IndicatorMarginSeparator)); + // } + // } + + // public override Color BookmarkColor1 { + // get { + // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.MessageBubbleWarningLine)); + // } + // } + + // public override Color BookmarkColor2 { + // get { + // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.MessageBubbleWarningLine2)); + // } + // } - public override Color Selection { - get { - return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Foreground)); - } - } + // public override Color Selection { + // get { + // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Foreground)); + // } + // } - public override Color SelectionBg { - get { - return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Selection)); - } - } + // public override Color SelectionBg { + // get { + // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Selection)); + // } + // } - public override Color HighlightOffset { - get { - return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.FindHighlight)); - } - } + // public override Color HighlightOffset { + // get { + // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.FindHighlight)); + // } + // } } } diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourceCellRenderer.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourceCellRenderer.cs index f8d3cd7f91b..bbd5985699d 100644 --- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourceCellRenderer.cs +++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourceCellRenderer.cs @@ -54,34 +54,34 @@ public string Text { const int textSpacing = 7; const int textTopSpacing = 3; - protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - { - base.Render (window, widget, background_area, cell_area, expose_area, flags); + // protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) + // { + // base.Render (window, widget, background_area, cell_area, expose_area, flags); - if (PackageSourceViewModel == null) - return; + // if (PackageSourceViewModel == null) + // return; - using (var layout = new Pango.Layout (widget.PangoContext)) { - layout.Alignment = Pango.Alignment.Left; - layout.SetMarkup (GetPackageSourceNameMarkup ()); - int packageSourceNameWidth = GetLayoutWidth (layout); - StateType state = GetState (widget, flags); + // using (var layout = new Pango.Layout (widget.PangoContext)) { + // layout.Alignment = Pango.Alignment.Left; + // layout.SetMarkup (GetPackageSourceNameMarkup ()); + // int packageSourceNameWidth = GetLayoutWidth (layout); + // StateType state = GetState (widget, flags); - layout.SetMarkup (GetPackageSourceDescriptionMarkup (flags)); + // layout.SetMarkup (GetPackageSourceDescriptionMarkup (flags)); - window.DrawLayout (widget.Style.TextGC (state), cell_area.X + textSpacing, cell_area.Y + textTopSpacing, layout); + // window.DrawLayout (widget.Style.TextGC (state), cell_area.X + textSpacing, cell_area.Y + textTopSpacing, layout); - if (!PackageSourceViewModel.IsValid) { - using (var ctx = Gdk.CairoHelper.Create (window)) { - ctx.DrawImage (widget, warningImage, cell_area.X + textSpacing + packageSourceNameWidth + imageSpacing, cell_area.Y + textTopSpacing); - } + // if (!PackageSourceViewModel.IsValid) { + // using (var ctx = Gdk.CairoHelper.Create (window)) { + // ctx.DrawImage (widget, warningImage, cell_area.X + textSpacing + packageSourceNameWidth + imageSpacing, cell_area.Y + textTopSpacing); + // } - layout.SetMarkup (GetPackageSourceErrorMarkup (flags)); - int packageSourceErrorTextX = cell_area.X + textSpacing + packageSourceNameWidth + (int)warningImage.Width + (2 * imageSpacing); - window.DrawLayout (widget.Style.TextGC (state), packageSourceErrorTextX, cell_area.Y + textTopSpacing, layout); - } - } - } + // layout.SetMarkup (GetPackageSourceErrorMarkup (flags)); + // int packageSourceErrorTextX = cell_area.X + textSpacing + packageSourceNameWidth + (int)warningImage.Width + (2 * imageSpacing); + // window.DrawLayout (widget.Style.TextGC (state), packageSourceErrorTextX, cell_area.Y + textTopSpacing, layout); + // } + // } + // } StateType GetState (Widget widget, CellRendererState flags) { @@ -132,15 +132,15 @@ string GetPackageSourceErrorMarkup (CellRendererState flags = CellRendererState. PackageSourceViewModel.ValidationFailureMessage); } - public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); + // public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + // { + // base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - using (var layout = new Pango.Layout (widget.PangoContext)) { - layout.SetMarkup (GetPackageSourceDescriptionMarkup ()); - height = GetLayoutSize (layout).Height + 8 + textTopSpacing; - } - } + // using (var layout = new Pango.Layout (widget.PangoContext)) { + // layout.SetMarkup (GetPackageSourceDescriptionMarkup ()); + // height = GetLayoutSize (layout).Height + 8 + textTopSpacing; + // } + // } } } diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesWidget.cs index 533b75385da..ca0a88b09f2 100644 --- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesWidget.cs +++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesWidget.cs @@ -7,10 +7,10 @@ using MonoDevelop.PackageManagement; using MonoDevelop.Core; using MonoDevelop.Components; -using MonoDevelop.Components.AutoTest; -using MonoDevelop.Ide; -using System.ComponentModel; - +using MonoDevelop.Components.AutoTest; +using MonoDevelop.Ide; +using System.ComponentModel; + namespace MonoDevelop.PackageManagement { [System.ComponentModel.ToolboxItem(true)] @@ -41,13 +41,13 @@ void AddEventHandlers () this.viewModel.PackageSourceChanged += PackageSourceChanged; } - public override void Dispose () - { - this.viewModel.PackageSourceViewModels.CollectionChanged -= PackageSourceViewModelsCollectionChanged; - this.viewModel.PackageSourceChanged -= PackageSourceChanged; - this.viewModel.Dispose (); - base.Dispose (); - } + // public override void Dispose () + // { + // this.viewModel.PackageSourceViewModels.CollectionChanged -= PackageSourceViewModelsCollectionChanged; + // this.viewModel.PackageSourceChanged -= PackageSourceChanged; + // this.viewModel.Dispose (); + // base.Dispose (); + // } void InitializeTreeView () { @@ -56,7 +56,7 @@ void InitializeTreeView () "store__IconId", "store__Model"); TypeDescriptor.AddAttributes (packageSourcesStore, modelAttr); packageSourcesTreeView.Model = packageSourcesStore; - packageSourcesTreeView.SearchColumn = -1; // disable the interactive search + packageSourcesTreeView.SearchColumn = -1; // disable the interactive search packageSourcesTreeView.AppendColumn (CreateTreeViewColumn ()); packageSourcesTreeView.Selection.Changed += PackageSourcesTreeViewSelectionChanged; packageSourcesTreeView.RowActivated += PackageSourcesTreeViewRowActivated; diff --git a/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkCrossPlatformLibraryProjectTemplateWizardPageWidget.cs b/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkCrossPlatformLibraryProjectTemplateWizardPageWidget.cs index a3774a6aeaf..3df7c86d521 100644 --- a/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkCrossPlatformLibraryProjectTemplateWizardPageWidget.cs +++ b/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkCrossPlatformLibraryProjectTemplateWizardPageWidget.cs @@ -259,10 +259,10 @@ protected virtual void Build () this.sharedProjectRadioButton.Active = true; this.sharedProjectRadioButton.DrawIndicator = true; this.sharedProjectRadioButton.UseUnderline = true; - this.sharedProjectRadioButton.Group = new global::GLib.SList (global::System.IntPtr.Zero); - this.usePortableClassLibraryHBox.Add (this.sharedProjectRadioButton); - global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.usePortableClassLibraryHBox [this.sharedProjectRadioButton])); - w14.Position = 0; + //this.sharedProjectRadioButton.Group = new global::GLib.SList (global::System.IntPtr.Zero); + //this.usePortableClassLibraryHBox.Add (this.sharedProjectRadioButton); + //global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.usePortableClassLibraryHBox [this.sharedProjectRadioButton])); + //w14.Position = 0; // Container child usePortableClassLibraryHBox.Gtk.Box+BoxChild this.usePortableLibraryInfoVBox = new global::Gtk.VBox (); this.usePortableLibraryInfoVBox.Name = "usePortableLibraryInfoVBox"; diff --git a/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkNuGetPackageMetadataOptionsPanelWidget.cs b/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkNuGetPackageMetadataOptionsPanelWidget.cs index 7af75f47b56..09c5e0851f2 100644 --- a/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkNuGetPackageMetadataOptionsPanelWidget.cs +++ b/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkNuGetPackageMetadataOptionsPanelWidget.cs @@ -258,7 +258,7 @@ protected virtual void Build() this.packageCopyrightTextBox.CanFocus = true; this.packageCopyrightTextBox.Name = "packageCopyrightTextBox"; this.packageCopyrightTextBox.IsEditable = true; - this.packageCopyrightTextBox.InvisibleChar = '●'; + //this.packageCopyrightTextBox.InvisibleChar = '●'; this.detailsTable.Add(this.packageCopyrightTextBox); global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.detailsTable[this.packageCopyrightTextBox])); w14.TopAttach = ((uint)(1)); @@ -321,9 +321,9 @@ protected virtual void Build() this.packageLanguageHBox.Name = "packageLanguageHBox"; this.packageLanguageHBox.Spacing = 6; // Container child packageLanguageHBox.Gtk.Box+BoxChild - this.packageLanguageComboBox = global::Gtk.ComboBox.NewText(); - this.packageLanguageComboBox.Name = "packageLanguageComboBox"; - this.packageLanguageHBox.Add(this.packageLanguageComboBox); + //this.packageLanguageComboBox = global::Gtk.ComboBox.NewText(); + //this.packageLanguageComboBox.Name = "packageLanguageComboBox"; + //this.packageLanguageHBox.Add(this.packageLanguageComboBox); global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.packageLanguageHBox[this.packageLanguageComboBox])); w19.Position = 0; w19.Expand = false; diff --git a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkCrossPlatformLibraryProjectTemplateWizardPageWidget.cs b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkCrossPlatformLibraryProjectTemplateWizardPageWidget.cs index ad4b94ac118..57d4446e3be 100644 --- a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkCrossPlatformLibraryProjectTemplateWizardPageWidget.cs +++ b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkCrossPlatformLibraryProjectTemplateWizardPageWidget.cs @@ -113,10 +113,10 @@ protected override void OnFocusGrabbed () void NameTextInserted (object o, TextInsertedArgs args) { - if (args.Text.IndexOf ('\r') >= 0) { - var textBox = (Entry)o; - textBox.Text = textBox.Text.Replace ("\r", string.Empty); - } + // if (args.Text.IndexOf ('\r') >= 0) { + // var textBox = (Entry)o; + // textBox.Text = textBox.Text.Replace ("\r", string.Empty); + // } } void NameTextChanged (object sender, EventArgs e) @@ -165,13 +165,13 @@ void SharedProjectRadioButtonToggled (object sender, EventArgs e) wizardPage.IsSharedProjectSelected = sharedProjectRadioButton.Active; } - public override void Dispose () - { - Dispose (nameTooltip); - Dispose (backgroundImage); + // public override void Dispose () + // { + // Dispose (nameTooltip); + // Dispose (backgroundImage); - base.Dispose (); - } + // base.Dispose (); + // } void Dispose (IDisposable disposable) { diff --git a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkNuGetPackageMetadataOptionsPanelWidget.cs b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkNuGetPackageMetadataOptionsPanelWidget.cs index 8e2ab47e58b..8a0b3d504dc 100644 --- a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkNuGetPackageMetadataOptionsPanelWidget.cs +++ b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkNuGetPackageMetadataOptionsPanelWidget.cs @@ -234,7 +234,7 @@ void UpdateMetadata () metadata.Copyright = packageCopyrightTextBox.Text; metadata.DevelopmentDependency = packageDevelopmentDependencyCheckBox.Active; metadata.IconUrl = packageIconUrlTextBox.Text; - metadata.Language = GetSelectedLanguage (); + //metadata.Language = GetSelectedLanguage (); metadata.LicenseUrl = packageLicenseUrlTextBox.Text; metadata.Owners = packageOwnersTextBox.Text; metadata.ProjectUrl = packageProjectUrlTextBox.Text; @@ -245,21 +245,21 @@ void UpdateMetadata () metadata.Title = packageTitleTextBox.Text; } - string GetSelectedLanguage () - { - if (packageLanguageComboBox.Active == 0) { - // 'None' selected. - return string.Empty; - } + // string GetSelectedLanguage () + // { + // if (packageLanguageComboBox.Active == 0) { + // // 'None' selected. + // return string.Empty; + // } - int languageIndex = packageLanguageComboBox.Active - 1; - if (languageIndex < languages.Count) { - return languages [languageIndex].Name; - } + // int languageIndex = packageLanguageComboBox.Active - 1; + // if (languageIndex < languages.Count) { + // return languages [languageIndex].Name; + // } // No match for language so just return the combo box text. - return packageLanguageComboBox.ActiveText; - } + //return packageLanguageComboBox.ActiveText; + //} void PopulateLanguages () { diff --git a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkPackagingProjectTemplateWizardPageWidget.cs b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkPackagingProjectTemplateWizardPageWidget.cs index 23eb2f2a092..1462febd243 100644 --- a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkPackagingProjectTemplateWizardPageWidget.cs +++ b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkPackagingProjectTemplateWizardPageWidget.cs @@ -95,10 +95,10 @@ protected override void OnFocusGrabbed () void PackageIdTextInserted (object o, TextInsertedArgs args) { - if (args.Text.IndexOf ('\r') >= 0) { - var textBox = (Entry)o; - textBox.Text = textBox.Text.Replace ("\r", string.Empty); - } + // if (args.Text.IndexOf ('\r') >= 0) { + // var textBox = (Entry)o; + // textBox.Text = textBox.Text.Replace ("\r", string.Empty); + // } } void PackageIdTextBoxChanged (object sender, EventArgs e) @@ -131,13 +131,13 @@ void PackageDescriptionTextChanged (object sender, EventArgs e) wizardPage.Description = packageDescriptionTextBox.Text; } - public override void Dispose () - { - Dispose (idTooltip); - Dispose (backgroundImage); + // public override void Dispose () + // { + // Dispose (idTooltip); + // Dispose (backgroundImage); - base.Dispose (); - } + // base.Dispose (); + // } void Dispose (IDisposable disposable) { diff --git a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkProjectNuGetBuildOptionsPanelWidget.UI.cs b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkProjectNuGetBuildOptionsPanelWidget.UI.cs index 31f1b86255d..5274037f38e 100644 --- a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkProjectNuGetBuildOptionsPanelWidget.UI.cs +++ b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkProjectNuGetBuildOptionsPanelWidget.UI.cs @@ -56,7 +56,7 @@ void Build () missingMetadataLabel.WidthRequest = 600; missingMetadataLabel.Text = GettextCatalog.GetString ("The project does not have NuGet package metadata so a NuGet package will not be created. NuGet package metadata can be specified in the Metadata section in Project Options"); - vbox.PackStart (missingMetadataLabel); + //vbox.PackStart (missingMetadataLabel); Add (vbox); diff --git a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkReferenceAssembliesOptionsPanelWidget.UI.cs b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkReferenceAssembliesOptionsPanelWidget.UI.cs index 754586f6efa..5491e5b215e 100644 --- a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkReferenceAssembliesOptionsPanelWidget.UI.cs +++ b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkReferenceAssembliesOptionsPanelWidget.UI.cs @@ -80,7 +80,7 @@ void Build () pclProfilesStore = new ListStore (typeof (bool), typeof (string), typeof (string), typeof (object)); pclProfilesTreeView.Model = pclProfilesStore; - vbox.PackStart (scrolledWindow); + //vbox.PackStart (scrolledWindow); Add (vbox); diff --git a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.csproj b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.csproj index bc0bde87a36..92b58af1f06 100644 --- a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.csproj +++ b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.csproj @@ -14,6 +14,9 @@ + + gtk-sharp-3.0 + diff --git a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.RefactoringPreviewDialog.cs b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.RefactoringPreviewDialog.cs index 68a18de8419..3758a3cec60 100644 --- a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.RefactoringPreviewDialog.cs +++ b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.RefactoringPreviewDialog.cs @@ -25,9 +25,9 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Refactoring.RefactoringPreviewDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Name = "dialog1_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -55,15 +55,15 @@ protected virtual void Build () this.vbox2.Add (this.GtkScrolledWindow); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.GtkScrolledWindow])); w4.Position = 1; - w1.Add (this.vbox2); - global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - w5.Position = 0; + //w1.Add (this.vbox2); + // global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + // w5.Position = 0; // Internal child MonoDevelop.Refactoring.RefactoringPreviewDialog.ActionArea - global::Gtk.HButtonBox w6 = this.ActionArea; - w6.Name = "dialog1_ActionArea"; - w6.Spacing = 10; - w6.BorderWidth = ((uint)(5)); - w6.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w6 = this.ActionArea; + // w6.Name = "dialog1_ActionArea"; + // w6.Spacing = 10; + // w6.BorderWidth = ((uint)(5)); + // w6.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -73,9 +73,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w6 [this.buttonCancel])); - w7.Expand = false; - w7.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w6 [this.buttonCancel])); + // w7.Expand = false; + // w7.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -85,10 +85,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w6 [this.buttonOk])); - w8.Position = 1; - w8.Expand = false; - w8.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w6 [this.buttonOk])); + // w8.Position = 1; + // w8.Expand = false; + // w8.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs index e17029853a8..04ea5baac4e 100644 --- a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs +++ b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs @@ -37,9 +37,9 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Refactoring.Rename.RenameItemDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Name = "dialog1_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox = new global::Gtk.VBox (); this.vbox.Name = "vbox"; @@ -126,17 +126,17 @@ protected virtual void Build () w9.Position = 3; w9.Expand = false; w9.Fill = false; - w1.Add (this.vbox); - global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox])); - w10.Position = 0; - w10.Expand = false; - w10.Fill = false; + //w1.Add (this.vbox); + // global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox])); + // w10.Position = 0; + // w10.Expand = false; + // w10.Fill = false; // Internal child MonoDevelop.Refactoring.Rename.RenameItemDialog.ActionArea - global::Gtk.HButtonBox w11 = this.ActionArea; - w11.Name = "dialog1_ActionArea"; - w11.Spacing = 10; - w11.BorderWidth = ((uint)(5)); - w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w11 = this.ActionArea; + // w11.Name = "dialog1_ActionArea"; + // w11.Spacing = 10; + // w11.BorderWidth = ((uint)(5)); + // w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -146,9 +146,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonCancel])); - w12.Expand = false; - w12.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonCancel])); + // w12.Expand = false; + // w12.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonPreview = new global::Gtk.Button (); this.buttonPreview.CanFocus = true; @@ -156,10 +156,10 @@ protected virtual void Build () this.buttonPreview.UseUnderline = true; this.buttonPreview.Label = global::Mono.Unix.Catalog.GetString ("_Preview"); this.AddActionWidget (this.buttonPreview, 0); - global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonPreview])); - w13.Position = 1; - w13.Expand = false; - w13.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonPreview])); + // w13.Position = 1; + // w13.Expand = false; + // w13.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -169,10 +169,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonOk])); - w14.Position = 2; - w14.Expand = false; - w14.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonOk])); + // w14.Position = 2; + // w14.Expand = false; + // w14.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.cs b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.cs index 8a4897cf5be..37c4b93d9fb 100644 --- a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.cs +++ b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.cs @@ -44,10 +44,10 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.Spacing = 6; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Name = "dialog1_VBox"; + // w1.Spacing = 6; + // w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -163,15 +163,15 @@ protected virtual void Build () this.vbox2.Add (this.framePreview); global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.framePreview])); w13.Position = 2; - w1.Add (this.vbox2); - global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - w14.Position = 0; + //w1.Add (this.vbox2); + // global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + // w14.Position = 0; // Internal child MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.ActionArea - global::Gtk.HButtonBox w15 = this.ActionArea; - w15.Name = "dialog1_ActionArea"; - w15.Spacing = 10; - w15.BorderWidth = ((uint)(5)); - w15.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w15 = this.ActionArea; + // w15.Name = "dialog1_ActionArea"; + // w15.Spacing = 10; + // w15.BorderWidth = ((uint)(5)); + // w15.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -181,9 +181,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w16 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w15 [this.buttonCancel])); - w16.Expand = false; - w16.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w16 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w15 [this.buttonCancel])); + // w16.Expand = false; + // w16.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -193,10 +193,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - global::Gtk.ButtonBox.ButtonBoxChild w17 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w15 [this.buttonOk])); - w17.Position = 1; - w17.Expand = false; - w17.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w17 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w15 [this.buttonOk])); + // w17.Position = 1; + // w17.Expand = false; + // w17.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.RectangleMarker.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.RectangleMarker.cs index 67b6ed301fd..b1c817fbf00 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.RectangleMarker.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.RectangleMarker.cs @@ -44,23 +44,23 @@ public RectangleMarker () WidthRequest = 16; } - protected override bool OnExposeEvent (Gdk.EventExpose evnt) - { - using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) { - const int triangleWidth = 8; - const int triangleHeight = 4; + // protected override bool OnExposeEvent (Gdk.EventExpose evnt) + // { + // using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) { + // const int triangleWidth = 8; + // const int triangleHeight = 4; - cr.SetSourceColor (SyntaxHighlightingService.GetColor (DefaultSourceEditorOptions.Instance.GetEditorTheme (), EditorThemeColors.LineNumbers)); - var topPosition = Allocation.Height / 2 - triangleHeight / 2; + // cr.SetSourceColor (SyntaxHighlightingService.GetColor (DefaultSourceEditorOptions.Instance.GetEditorTheme (), EditorThemeColors.LineNumbers)); + // var topPosition = Allocation.Height / 2 - triangleHeight / 2; - cr.MoveTo (Allocation.Width / 2 + triangleWidth / 2, topPosition); - cr.LineTo (Allocation.Width / 2 - triangleWidth / 2, topPosition); - cr.LineTo (Allocation.Width / 2, topPosition + triangleHeight); - cr.LineTo (Allocation.Width / 2 + triangleWidth / 2, topPosition); - cr.Fill (); - } - return true; - } + // cr.MoveTo (Allocation.Width / 2 + triangleWidth / 2, topPosition); + // cr.LineTo (Allocation.Width / 2 - triangleWidth / 2, topPosition); + // cr.LineTo (Allocation.Width / 2, topPosition + triangleHeight); + // cr.LineTo (Allocation.Width / 2 + triangleWidth / 2, topPosition); + // cr.Fill (); + // } + // return true; + // } } } } \ No newline at end of file diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs index 58bcf884e6d..830b82e5c1a 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs @@ -74,9 +74,9 @@ partial class ResultTooltipProvider : TooltipProvider if (results.Count == 0) return null; var sb = StringBuilderCache.Allocate (); - sb.Append (""); + // sb.Append (""); int minOffset = int.MaxValue; int maxOffset = -1; bool floatingWidgetShown = false; @@ -177,41 +177,41 @@ public override void GetRequiredPosition (Ide.Editor.TextEditor editor, Window t const int xPadding = 4; const int windowSize = 36; - protected override Xwt.Point CalculateWindowLocation (Ide.Editor.TextEditor editor, TooltipItem item, Xwt.WindowFrame xwtWindow, int mouseX, int mouseY, Xwt.Point origin) - { - int w; - double xalign; - GetRequiredPosition (editor, xwtWindow, out w, out xalign); - w += 10; - var allocation = GetAllocation (editor); + // protected override Xwt.Point CalculateWindowLocation (Ide.Editor.TextEditor editor, TooltipItem item, Xwt.WindowFrame xwtWindow, int mouseX, int mouseY, Xwt.Point origin) + // { + // int w; + // double xalign; + // GetRequiredPosition (editor, xwtWindow, out w, out xalign); + // w += 10; + // var allocation = GetAllocation (editor); - var info = (TaggedTooltipInformation)item.Item; - var loc = editor.OffsetToLocation (info.Tag.Span.Start); - var p = editor.LocationToPoint (loc); - var view = editor.GetContent (); - int x = (int)(p.X + origin.X + allocation.X + xPadding); - int y = (int)(p.Y + view.TextEditor.GetLineHeight (loc.Line) + origin.Y + allocation.Y + yPadding); + // var info = (TaggedTooltipInformation)item.Item; + // var loc = editor.OffsetToLocation (info.Tag.Span.Start); + // var p = editor.LocationToPoint (loc); + // var view = editor.GetContent (); + // int x = (int)(p.X + origin.X + allocation.X + xPadding); + // int y = (int)(p.Y + view.TextEditor.GetLineHeight (loc.Line) + origin.Y + allocation.Y + yPadding); - Gtk.Widget widget = editor; - var geometry = widget.Screen.GetUsableMonitorGeometry (widget.Screen.GetMonitorAtPoint (x, y)); + // Gtk.Widget widget = editor; + // var geometry = widget.Screen.GetUsableMonitorGeometry (widget.Screen.GetMonitorAtPoint (x, y)); - if (x + w >= geometry.X + geometry.Width) - x = geometry.X + geometry.Width - w; - if (x < geometry.Left) - x = geometry.Left; + // if (x + w >= geometry.X + geometry.Width) + // x = geometry.X + geometry.Width - w; + // if (x < geometry.Left) + // x = geometry.Left; - if (info.Tag?.FloatingWidgetShown == true) { - x += windowSize; - } + // if (info.Tag?.FloatingWidgetShown == true) { + // x += windowSize; + // } - int h = (int)xwtWindow.Size.Height; - if (y + h >= geometry.Y + geometry.Height) - y = geometry.Y + geometry.Height - h; - if (y < geometry.Top) - y = geometry.Top; + // int h = (int)xwtWindow.Size.Height; + // if (y + h >= geometry.Y + geometry.Height) + // y = geometry.Y + geometry.Height - h; + // if (y < geometry.Top) + // y = geometry.Top; - return new Xwt.Point (x, y); - } + // return new Xwt.Point (x, y); + // } public override void ShowTooltipWindow (Ide.Editor.TextEditor editor, Components.Window tipWindow, TooltipItem item, Xwt.ModifierKeys modifierState, int mouseX, int mouseY) { @@ -242,19 +242,19 @@ public override void ShowTooltipWindow (Ide.Editor.TextEditor editor, Components } static FloatingQuickFixIconWidget floatingWidget; - public override bool TryCloseTooltipWindow (Window tipWindow, TooltipCloseReason reason) - { - var window = (LanguageItemWindow)tipWindow; - if (window.Tag is FloatingQuickFixIconWidget iconWidget) { - if (reason != TooltipCloseReason.Force && iconWidget.IsMouseNear ()) { - return false; - } - iconWidget.QueueDestroy (reason == TooltipCloseReason.Force ? 0u : 500); - } else { - window.Destroy (); - } - return true; - } + // public override bool TryCloseTooltipWindow (Window tipWindow, TooltipCloseReason reason) + // { + // var window = (LanguageItemWindow)tipWindow; + // if (window.Tag is FloatingQuickFixIconWidget iconWidget) { + // if (reason != TooltipCloseReason.Force && iconWidget.IsMouseNear ()) { + // return false; + // } + // iconWidget.QueueDestroy (reason == TooltipCloseReason.Force ? 0u : 500); + // } else { + // window.Destroy (); + // } + // return true; + // } #endregion } diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs index 59edc71dc50..131d0a308f1 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs @@ -433,7 +433,7 @@ bool IdleHandler () marker.IsVisible = currentResult.Underline; if (currentResult.InspectionMark != IssueMarker.GrayOut) { - marker.Color = GetColor (editor, currentResult); + //marker.Color = GetColor (editor, currentResult); marker.IsVisible &= currentResult.Level != DiagnosticSeverity.Hidden; } editor.AddMarker (marker); diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameItemDialog.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameItemDialog.cs index 2aee1b82eeb..c03b64cbff4 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameItemDialog.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameItemDialog.cs @@ -189,7 +189,7 @@ void Init (string title, string currenName, Func + + gtk-sharp-3.0 + + + gio-sharp-3.0 + ..\..\..\external\Xamarin.Mac.dll diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs index f6e7e6eafa7..804fd727a7b 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs @@ -214,12 +214,12 @@ void DisposeLayout () } bool isDisposed = false; - protected override void OnDestroyed () - { - isDisposed = true; - DisposeLayout (); - base.OnDestroyed (); - } + // protected override void OnDestroyed () + // { + // isDisposed = true; + // DisposeLayout (); + // base.OnDestroyed (); + // } public void Reset () { @@ -260,99 +260,99 @@ void CreateLayout (Widget container, string text) layout = new Pango.Layout (container.PangoContext); layout.SingleParagraphMode = false; if (diffMode) { - layout.FontDescription = IdeServices.FontService.MonospaceFont; + //layout.FontDescription = IdeServices.FontService.MonospaceFont; layout.SetText (text); } else { layout.SetMarkup (text); } } - protected override void Render (Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - { - if (isDisposed) - return; - try { - if (diffMode) { - int w, maxy; - window.GetSize (out w, out maxy); - - int recty = cell_area.Y; - int recth = cell_area.Height - 1; - if (recty < 0) { - recth += recty + 1; - recty = -1; - } - if (recth > maxy + 2) - recth = maxy + 2; - - window.DrawRectangle (widget.Style.BaseGC (Gtk.StateType.Normal), true, cell_area.X, recty, cell_area.Width - 1, recth); - - Gdk.GC normalGC = widget.Style.TextGC (StateType.Normal); - Gdk.GC removedGC = new Gdk.GC (window); - removedGC.Copy (normalGC); - removedGC.RgbFgColor = new Color (255, 0, 0); - Gdk.GC addedGC = new Gdk.GC (window); - addedGC.Copy (normalGC); - addedGC.RgbFgColor = new Color (0, 0, 255); - Gdk.GC infoGC = new Gdk.GC (window); - infoGC.Copy (normalGC); - infoGC.RgbFgColor = new Color (0xa5, 0x2a, 0x2a); - - int y = cell_area.Y + 2; - - for (int n = 0; n < lines.Length; n++,y += lineHeight) { - if (y + lineHeight < 0) - continue; - if (y > maxy) - break; - string line = lines[n]; - if (line.Length == 0) - continue; - - Gdk.GC gc; - switch (line[0]) { - case '-': - gc = removedGC; - break; - case '+': - gc = addedGC; - break; - case '@': - gc = infoGC; - break; - default: - gc = normalGC; - break; - } - - layout.SetText (line); - window.DrawLayout (gc, cell_area.X + 2, y, layout); - } - window.DrawRectangle (widget.Style.DarkGC (Gtk.StateType.Prelight), false, cell_area.X, recty, cell_area.Width - 1, recth); - removedGC.Dispose (); - addedGC.Dispose (); - infoGC.Dispose (); - } else { - int y = cell_area.Y + (cell_area.Height - height) / 2; - window.DrawLayout (widget.Style.TextGC (GetState (flags)), cell_area.X, y, layout); - } - } catch (Exception e) { - Console.WriteLine (e); - } - } - - public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int c_width, out int c_height) - { - x_offset = y_offset = 0; - c_width = width; - c_height = height; - - if (diffMode) { - // Add some spacing for the margin - c_width += 4; - c_height += 4; - } - } + // protected override void Render (Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) + // { + // if (isDisposed) + // return; + // try { + // if (diffMode) { + // int w, maxy; + // window.GetSize (out w, out maxy); + + // int recty = cell_area.Y; + // int recth = cell_area.Height - 1; + // if (recty < 0) { + // recth += recty + 1; + // recty = -1; + // } + // if (recth > maxy + 2) + // recth = maxy + 2; + + // window.DrawRectangle (widget.Style.BaseGC (Gtk.StateType.Normal), true, cell_area.X, recty, cell_area.Width - 1, recth); + + // Gdk.GC normalGC = widget.Style.TextGC (StateType.Normal); + // Gdk.GC removedGC = new Gdk.GC (window); + // removedGC.Copy (normalGC); + // removedGC.RgbFgColor = new Color (255, 0, 0); + // Gdk.GC addedGC = new Gdk.GC (window); + // addedGC.Copy (normalGC); + // addedGC.RgbFgColor = new Color (0, 0, 255); + // Gdk.GC infoGC = new Gdk.GC (window); + // infoGC.Copy (normalGC); + // infoGC.RgbFgColor = new Color (0xa5, 0x2a, 0x2a); + + // int y = cell_area.Y + 2; + + // for (int n = 0; n < lines.Length; n++,y += lineHeight) { + // if (y + lineHeight < 0) + // continue; + // if (y > maxy) + // break; + // string line = lines[n]; + // if (line.Length == 0) + // continue; + + // Gdk.GC gc; + // switch (line[0]) { + // case '-': + // gc = removedGC; + // break; + // case '+': + // gc = addedGC; + // break; + // case '@': + // gc = infoGC; + // break; + // default: + // gc = normalGC; + // break; + // } + + // layout.SetText (line); + // window.DrawLayout (gc, cell_area.X + 2, y, layout); + // } + // window.DrawRectangle (widget.Style.DarkGC (Gtk.StateType.Prelight), false, cell_area.X, recty, cell_area.Width - 1, recth); + // removedGC.Dispose (); + // addedGC.Dispose (); + // infoGC.Dispose (); + // } else { + // int y = cell_area.Y + (cell_area.Height - height) / 2; + // window.DrawLayout (widget.Style.TextGC (GetState (flags)), cell_area.X, y, layout); + // } + // } catch (Exception e) { + // Console.WriteLine (e); + // } + // } + + // public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int c_width, out int c_height) + // { + // x_offset = y_offset = 0; + // c_width = width; + // c_height = height; + + // if (diffMode) { + // // Add some spacing for the margin + // c_width += 4; + // c_height += 4; + // } + // } StateType GetState (CellRendererState flags) { diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewTooltipWindow.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewTooltipWindow.cs index 145d6ae809a..269e70aa8ca 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewTooltipWindow.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewTooltipWindow.cs @@ -335,20 +335,20 @@ protected override void OnDestroyed () const int verticalTextSpace = 7; const int textBorder = 12; - protected override void OnSizeRequested (ref Gtk.Requisition requisition) - { - base.OnSizeRequested (ref requisition); + // protected override void OnSizeRequested (ref Gtk.Requisition requisition) + // { + // base.OnSizeRequested (ref requisition); - int y = verticalTextBorder * 2 - verticalTextSpace + (Platform.IsWindows ? 10 : 2); - int x = 0; + // int y = verticalTextBorder * 2 - verticalTextSpace + (Platform.IsWindows ? 10 : 2); + // int x = 0; - foreach (var line in diff.LineResults) { - MeasureLine (line, ref x, ref y); - } + // foreach (var line in diff.LineResults) { + // MeasureLine (line, ref x, ref y); + // } - requisition.Height = y; - requisition.Width = x + textBorder * 2; - } + // requisition.Height = y; + // requisition.Width = x + textBorder * 2; + // } void MeasureLine (LineResult lineResult, ref int x, ref int y) { @@ -366,39 +366,39 @@ void MeasureLine (LineResult lineResult, ref int x, ref int y) } } - protected override void OnDrawContent (Gdk.EventExpose evnt, Cairo.Context g) - { - var style = editor.Options.GetEditorTheme (); - g.Rectangle (0, 0, Allocation.Width, Allocation.Height); - - g.SetSourceColor (SyntaxHighlightingService.GetColor (style, EditorThemeColors.Background)); - g.Fill (); - - int y = verticalTextSpace / 2; - - foreach (var lineResult in diff.LineResults) { - switch (lineResult.LineKind) { - case LineKind.Normal: - DrawLine (g, lineResult, ref y); - break; - case LineKind.Removed: - g.Rectangle (0, y, Allocation.Width, lineHeight); - - g.SetSourceColor (diff.RemovedBackground); - g.Fill (); - g.SetSourceColor (diff.RemovedForeground); - DrawLine (g, lineResult, ref y); - break; - case LineKind.Added: - g.Rectangle (0, y, Allocation.Width, lineHeight); - g.SetSourceColor (diff.AddedBackground); - g.Fill (); - g.SetSourceColor (diff.AddedForeground); - DrawLine (g, lineResult, ref y); - break; - } - } - } + // protected override void OnDrawContent (Gdk.EventExpose evnt, Cairo.Context g) + // { + // var style = editor.Options.GetEditorTheme (); + // g.Rectangle (0, 0, Allocation.Width, Allocation.Height); + + // g.SetSourceColor (SyntaxHighlightingService.GetColor (style, EditorThemeColors.Background)); + // g.Fill (); + + // int y = verticalTextSpace / 2; + + // foreach (var lineResult in diff.LineResults) { + // switch (lineResult.LineKind) { + // case LineKind.Normal: + // DrawLine (g, lineResult, ref y); + // break; + // case LineKind.Removed: + // g.Rectangle (0, y, Allocation.Width, lineHeight); + + // g.SetSourceColor (diff.RemovedBackground); + // g.Fill (); + // g.SetSourceColor (diff.RemovedForeground); + // DrawLine (g, lineResult, ref y); + // break; + // case LineKind.Added: + // g.Rectangle (0, y, Allocation.Width, lineHeight); + // g.SetSourceColor (diff.AddedBackground); + // g.Fill (); + // g.SetSourceColor (diff.AddedForeground); + // DrawLine (g, lineResult, ref y); + // break; + // } + // } + // } void DrawLine (Cairo.Context g, LineResult lineResult, ref int y) { diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs index 5b26fa011a2..8adc2997b0e 100644 --- a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs +++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs @@ -958,12 +958,12 @@ public void HidePage (int n) GetNthPage (n).Hide (); } - protected override void OnSwitchPage (NotebookPage page, uint n) - { - base.OnSwitchPage (page, n); - if (!loadedPages.Contains (Page)) - OnPageLoadRequired (); - } + // protected override void OnSwitchPage (NotebookPage page, uint n) + // { + // base.OnSwitchPage (page, n); + // if (!loadedPages.Contains (Page)) + // OnPageLoadRequired (); + // } void OnPageLoadRequired () { @@ -983,7 +983,7 @@ class HeaderLabel: Widget public HeaderLabel () { - WidgetFlags |= WidgetFlags.NoWindow; + //WidgetFlags |= WidgetFlags.NoWindow; layout = new Pango.Layout (this.PangoContext); } @@ -1001,14 +1001,14 @@ public int Padding { set { padding = value; } } - protected override bool OnExposeEvent (Gdk.EventExpose args) - { - using (Gdk.GC gc = new Gdk.GC (GdkWindow)) { - gc.ClipRectangle = Allocation; - GdkWindow.DrawLayout (gc, padding, padding, layout); - } - return true; - } + // protected override bool OnExposeEvent (Gdk.EventExpose args) + // { + // using (Gdk.GC gc = new Gdk.GC (GdkWindow)) { + // gc.ClipRectangle = Allocation; + // GdkWindow.DrawLayout (gc, padding, padding, layout); + // } + // return true; + // } protected override void OnDestroyed () { if (layout != null) { diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestResultsPad.cs b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestResultsPad.cs index 3d5e62e0702..2b20d1ef83f 100644 --- a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestResultsPad.cs +++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestResultsPad.cs @@ -141,7 +141,7 @@ public TestResultsPad () book.Pack1 (sw, true, true); outputView = new MonoDevelop.Ide.Gui.Components.LogView.LogTextView { Name = "testResultOutput" }; - outputView.ModifyFont (IdeServices.FontService.MonospaceFont); + //outputView.ModifyFont (IdeServices.FontService.MonospaceFont); outputView.Editable = false; bold = new TextTag ("bold"); bold.Weight = Pango.Weight.Bold; @@ -536,7 +536,7 @@ protected void OnCopy () if (last == null) return; - Gtk.TreeModel foo; + Gtk.ITreeModel foo; Gtk.TreeIter iter; if (!failuresTreeView.Selection.GetSelected (out foo, out iter)) return; @@ -560,7 +560,7 @@ protected void OnCopy () return; var clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false)); - Gtk.TreeModel foo; + Gtk.ITreeModel foo; Gtk.TreeIter iter; if (!failuresTreeView.Selection.GetSelected (out foo, out iter)) return; @@ -588,7 +588,7 @@ protected void OnUpdateCopy (CommandInfo info) if (test != null) { var last = test.GetLastResult (); - Gtk.TreeModel foo; + Gtk.ITreeModel foo; Gtk.TreeIter iter; if (!failuresTreeView.Selection.GetSelected (out foo, out iter)) { info.Enabled = false; @@ -671,7 +671,7 @@ protected void OnRerunTest () UnitTest GetSelectedTest () { - Gtk.TreeModel foo; + Gtk.ITreeModel foo; Gtk.TreeIter iter; if (!failuresTreeView.Selection.GetSelected (out foo, out iter)) return null; @@ -744,9 +744,9 @@ void ShowTestResult (UnitTest test, UnitTestResult result) int curLine = 1; const int maxLineLength = 255; const int maxLineNumber = 255; - sb.Append (""); + //sb.Append (""); using (var sr = new StringReader (Escape(result.Message))) { while (null != (curLineText = sr.ReadLine ())) { if (curLineText == null) continue; diff --git a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj index 9a663105aa5..8f8a12e78b5 100644 --- a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj +++ b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj @@ -19,6 +19,12 @@ + + gtk-sharp-3.0 + + + gio-sharp-3.0 + diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj index 446294e90ee..1d65e95855a 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj @@ -21,6 +21,9 @@ + + gtk-sharp-3.0 + diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.ConflictResolutionDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.ConflictResolutionDialog.cs index bf7d065ceaa..a45e7c28c9d 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.ConflictResolutionDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.ConflictResolutionDialog.cs @@ -19,9 +19,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Merge Conflict Resolution"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.ConflictResolutionDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Name = "dialog1_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -45,15 +45,15 @@ protected virtual void Build () this.vbox2.Add (this.mergeWidget); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.mergeWidget])); w3.Position = 1; - w1.Add (this.vbox2); - global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - w4.Position = 0; + // w1.Add (this.vbox2); + // global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + // w4.Position = 0; // Internal child MonoDevelop.VersionControl.Git.ConflictResolutionDialog.ActionArea - global::Gtk.HButtonBox w5 = this.ActionArea; - w5.Name = "dialog1_ActionArea"; - w5.Spacing = 10; - w5.BorderWidth = ((uint)(5)); - w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w5 = this.ActionArea; + // w5.Name = "dialog1_ActionArea"; + // w5.Spacing = 10; + // w5.BorderWidth = ((uint)(5)); + // w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -62,9 +62,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = global::Mono.Unix.Catalog.GetString ("Abort Update"); this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel])); - w6.Expand = false; - w6.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel])); + // w6.Expand = false; + // w6.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -73,10 +73,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = global::Mono.Unix.Catalog.GetString ("Skip Patch"); this.AddActionWidget (this.buttonOk, -7); - global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk])); - w7.Position = 1; - w7.Expand = false; - w7.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk])); + // w7.Position = 1; + // w7.Expand = false; + // w7.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button24 = new global::Gtk.Button (); this.button24.CanFocus = true; @@ -84,10 +84,10 @@ protected virtual void Build () this.button24.UseUnderline = true; this.button24.Label = global::Mono.Unix.Catalog.GetString ("Accept Merge"); this.AddActionWidget (this.button24, -5); - global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.button24])); - w8.Position = 2; - w8.Expand = false; - w8.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.button24])); + // w8.Position = 2; + // w8.Expand = false; + // w8.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.CredentialsDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.CredentialsDialog.cs index 3439929afd7..464fefd9582 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.CredentialsDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.CredentialsDialog.cs @@ -22,9 +22,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Git Credentials"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.CredentialsDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Name = "dialog1_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox = new global::Gtk.VBox (); this.vbox.Name = "vbox"; @@ -51,17 +51,17 @@ protected virtual void Build () w3.Position = 1; w3.Expand = false; w3.Fill = false; - w1.Add(this.vbox); - global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1[this.vbox])); - w4.Position = 0; - w4.Expand = false; - w4.Fill = false; + // w1.Add(this.vbox); + // global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1[this.vbox])); + // w4.Position = 0; + // w4.Expand = false; + // w4.Fill = false; // Internal child MonoDevelop.VersionControl.Git.CredentialsDialog.ActionArea - global::Gtk.HButtonBox w5 = this.ActionArea; - w5.Name = "dialog1_ActionArea"; - w5.Spacing = 10; - w5.BorderWidth = ((uint)(5)); - w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w5 = this.ActionArea; + // w5.Name = "dialog1_ActionArea"; + // w5.Spacing = 10; + // w5.BorderWidth = ((uint)(5)); + // w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -71,9 +71,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget(this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5[this.buttonCancel])); - w6.Expand = false; - w6.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5[this.buttonCancel])); + // w6.Expand = false; + // w6.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -83,10 +83,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget(this.buttonOk, -5); - global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5[this.buttonOk])); - w7.Position = 1; - w7.Expand = false; - w7.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5[this.buttonOk])); + // w7.Position = 1; + // w7.Expand = false; + // w7.Fill = false; if ((this.Child != null)) { this.Child.ShowAll(); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditBranchDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditBranchDialog.cs index 9e0b6176ec1..4c8cdc7fb0c 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditBranchDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditBranchDialog.cs @@ -32,9 +32,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Branch Properties"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.EditBranchDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Name = "dialog1_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox5 = new global::Gtk.VBox (); this.vbox5.Name = "vbox5"; @@ -106,17 +106,17 @@ protected virtual void Build () w8.Position = 2; w8.Expand = false; w8.Fill = false; - w1.Add (this.vbox5); - global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5])); - w9.Position = 0; - w9.Expand = false; - w9.Fill = false; + // w1.Add (this.vbox5); + // global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5])); + // w9.Position = 0; + // w9.Expand = false; + // w9.Fill = false; // Internal child MonoDevelop.VersionControl.Git.EditBranchDialog.ActionArea - global::Gtk.HButtonBox w10 = this.ActionArea; - w10.Name = "dialog1_ActionArea"; - w10.Spacing = 10; - w10.BorderWidth = ((uint)(5)); - w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w10 = this.ActionArea; + // w10.Name = "dialog1_ActionArea"; + // w10.Spacing = 10; + // w10.BorderWidth = ((uint)(5)); + // w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -126,9 +126,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.buttonCancel])); - w11.Expand = false; - w11.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.buttonCancel])); + // w11.Expand = false; + // w11.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -138,10 +138,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.buttonOk])); - w12.Position = 1; - w12.Expand = false; - w12.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.buttonOk])); + // w12.Position = 1; + // w12.Expand = false; + // w12.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditRemoteDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditRemoteDialog.cs index d2aaab65f7c..f538e016fdf 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditRemoteDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditRemoteDialog.cs @@ -34,9 +34,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Remote Source"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.EditRemoteDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Name = "dialog1_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox7 = new global::Gtk.VBox (); this.vbox7.Name = "vbox7"; @@ -132,17 +132,17 @@ protected virtual void Build () w9.Position = 1; w9.Expand = false; w9.Fill = false; - w1.Add (this.vbox7); - global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox7])); - w10.Position = 0; - w10.Expand = false; - w10.Fill = false; + // w1.Add (this.vbox7); + // global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox7])); + // w10.Position = 0; + // w10.Expand = false; + // w10.Fill = false; // Internal child MonoDevelop.VersionControl.Git.EditRemoteDialog.ActionArea - global::Gtk.HButtonBox w11 = this.ActionArea; - w11.Name = "dialog1_ActionArea"; - w11.Spacing = 10; - w11.BorderWidth = ((uint)(5)); - w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w11 = this.ActionArea; + // w11.Name = "dialog1_ActionArea"; + // w11.Spacing = 10; + // w11.BorderWidth = ((uint)(5)); + // w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -152,9 +152,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonCancel])); - w12.Expand = false; - w12.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonCancel])); + // w12.Expand = false; + // w12.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -164,10 +164,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonOk])); - w13.Position = 1; - w13.Expand = false; - w13.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonOk])); + // w13.Position = 1; + // w13.Expand = false; + // w13.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs index fa510973f69..bdea64adb45 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs @@ -46,9 +46,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Git Repository Configuration"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.GitConfigurationDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Name = "dialog1_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.notebook1 = new global::Gtk.Notebook (); this.notebook1.CanFocus = true; @@ -327,15 +327,15 @@ protected virtual void Build () this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Remote Sources"); this.notebook1.SetTabLabel (this.vbox4, this.label2); this.label2.ShowAll (); - w1.Add (this.notebook1); - global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(w1 [this.notebook1])); - w30.Position = 0; + //w1.Add (this.notebook1); + // global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(w1 [this.notebook1])); + // w30.Position = 0; // Internal child MonoDevelop.VersionControl.Git.GitConfigurationDialog.ActionArea - global::Gtk.HButtonBox w31 = this.ActionArea; - w31.Name = "dialog1_ActionArea"; - w31.Spacing = 10; - w31.BorderWidth = ((uint)(5)); - w31.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w31 = this.ActionArea; + // w31.Name = "dialog1_ActionArea"; + // w31.Spacing = 10; + // w31.BorderWidth = ((uint)(5)); + // w31.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -345,9 +345,9 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-close"; this.AddActionWidget (this.buttonOk, -7); - global::Gtk.ButtonBox.ButtonBoxChild w32 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w31 [this.buttonOk])); - w32.Expand = false; - w32.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w32 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w31 [this.buttonOk])); + // w32.Expand = false; + // w32.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.MergeDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.MergeDialog.cs index 386241d793c..84a1bdc848a 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.MergeDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.MergeDialog.cs @@ -27,9 +27,9 @@ protected virtual void Build () this.Name = "MonoDevelop.VersionControl.Git.MergeDialog"; this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.MergeDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Name = "dialog1_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -82,15 +82,15 @@ protected virtual void Build () w6.Position = 3; w6.Expand = false; w6.Fill = false; - w1.Add (this.vbox2); - global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - w7.Position = 0; + // w1.Add (this.vbox2); + // global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + // w7.Position = 0; // Internal child MonoDevelop.VersionControl.Git.MergeDialog.ActionArea - global::Gtk.HButtonBox w8 = this.ActionArea; - w8.Name = "dialog1_ActionArea"; - w8.Spacing = 10; - w8.BorderWidth = ((uint)(5)); - w8.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w8 = this.ActionArea; + // w8.Name = "dialog1_ActionArea"; + // w8.Spacing = 10; + // w8.BorderWidth = ((uint)(5)); + // w8.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -100,9 +100,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w9 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w8 [this.buttonCancel])); - w9.Expand = false; - w9.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w9 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w8 [this.buttonCancel])); + // w9.Expand = false; + // w9.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -111,10 +111,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = global::Mono.Unix.Catalog.GetString ("Merge"); this.AddActionWidget (this.buttonOk, -5); - global::Gtk.ButtonBox.ButtonBoxChild w10 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w8 [this.buttonOk])); - w10.Position = 1; - w10.Expand = false; - w10.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w10 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w8 [this.buttonOk])); + // w10.Position = 1; + // w10.Expand = false; + // w10.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.NewStashDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.NewStashDialog.cs index ae5c168daad..c23784b847b 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.NewStashDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.NewStashDialog.cs @@ -18,9 +18,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Stash"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.NewStashDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Name = "dialog1_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.hbox3 = new global::Gtk.HBox (); this.hbox3.Name = "hbox3"; @@ -44,17 +44,17 @@ protected virtual void Build () this.hbox3.Add (this.entryComment); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.entryComment])); w3.Position = 1; - w1.Add (this.hbox3); - global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox3])); - w4.Position = 0; - w4.Expand = false; - w4.Fill = false; + // w1.Add (this.hbox3); + // global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox3])); + // w4.Position = 0; + // w4.Expand = false; + // w4.Fill = false; // Internal child MonoDevelop.VersionControl.Git.NewStashDialog.ActionArea - global::Gtk.HButtonBox w5 = this.ActionArea; - w5.Name = "dialog1_ActionArea"; - w5.Spacing = 10; - w5.BorderWidth = ((uint)(5)); - w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w5 = this.ActionArea; + // w5.Name = "dialog1_ActionArea"; + // w5.Spacing = 10; + // w5.BorderWidth = ((uint)(5)); + // w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -64,9 +64,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel])); - w6.Expand = false; - w6.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel])); + // w6.Expand = false; + // w6.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -76,10 +76,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk])); - w7.Position = 1; - w7.Expand = false; - w7.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk])); + // w7.Position = 1; + // w7.Expand = false; + // w7.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.PushDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.PushDialog.cs index 16eb6988836..f962c573f8b 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.PushDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.PushDialog.cs @@ -22,9 +22,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Push to Repository"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.PushDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Name = "dialog1_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -44,11 +44,11 @@ protected virtual void Build () w2.Expand = false; w2.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.remoteCombo = global::Gtk.ComboBox.NewText (); - this.remoteCombo.Name = "remoteCombo"; - this.hbox1.Add (this.remoteCombo); - global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.remoteCombo])); - w3.Position = 1; + // this.remoteCombo = global::Gtk.ComboBox.NewText (); + // this.remoteCombo.Name = "remoteCombo"; + // this.hbox1.Add (this.remoteCombo); + // global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.remoteCombo])); + // w3.Position = 1; // Container child hbox1.Gtk.Box+BoxChild this.label2 = new global::Gtk.Label (); this.label2.Name = "label2"; @@ -59,9 +59,9 @@ protected virtual void Build () w4.Expand = false; w4.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.branchCombo = global::Gtk.ComboBox.NewText (); - this.branchCombo.Name = "branchCombo"; - this.hbox1.Add (this.branchCombo); + // this.branchCombo = global::Gtk.ComboBox.NewText (); + // this.branchCombo.Name = "branchCombo"; + // this.hbox1.Add (this.branchCombo); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.branchCombo])); w5.Position = 3; this.vbox2.Add (this.hbox1); @@ -77,15 +77,15 @@ protected virtual void Build () this.vbox2.Add (this.changeList); global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.changeList])); w7.Position = 1; - w1.Add (this.vbox2); - global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - w8.Position = 0; + // w1.Add (this.vbox2); + // global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + // w8.Position = 0; // Internal child MonoDevelop.VersionControl.Git.PushDialog.ActionArea - global::Gtk.HButtonBox w9 = this.ActionArea; - w9.Name = "dialog1_ActionArea"; - w9.Spacing = 10; - w9.BorderWidth = ((uint)(5)); - w9.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w9 = this.ActionArea; + // w9.Name = "dialog1_ActionArea"; + // w9.Spacing = 10; + // w9.BorderWidth = ((uint)(5)); + // w9.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -95,9 +95,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w10 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w9 [this.buttonCancel])); - w10.Expand = false; - w10.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w10 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w9 [this.buttonCancel])); + // w10.Expand = false; + // w10.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -106,10 +106,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = global::Mono.Unix.Catalog.GetString ("Push Changes"); this.AddActionWidget (this.buttonOk, -5); - global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w9 [this.buttonOk])); - w11.Position = 1; - w11.Expand = false; - w11.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w9 [this.buttonOk])); + // w11.Position = 1; + // w11.Expand = false; + // w11.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.StashManagerDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.StashManagerDialog.cs index d9ae5803056..5a3c62776c8 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.StashManagerDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.StashManagerDialog.cs @@ -23,9 +23,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Stash Manager"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.StashManagerDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Name = "dialog1_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.hbox2 = new global::Gtk.HBox (); this.hbox2.Name = "hbox2"; @@ -101,19 +101,19 @@ protected virtual void Build () w8.Expand = false; w8.Fill = false; this.hbox2.Add (this.vboxButtons); - global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.vboxButtons])); - w9.Position = 1; - w9.Expand = false; - w9.Fill = false; - w1.Add (this.hbox2); - global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox2])); - w10.Position = 0; + // global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.vboxButtons])); + // w9.Position = 1; + // w9.Expand = false; + // w9.Fill = false; + // w1.Add (this.hbox2); + // global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox2])); + // w10.Position = 0; // Internal child MonoDevelop.VersionControl.Git.StashManagerDialog.ActionArea - global::Gtk.HButtonBox w11 = this.ActionArea; - w11.Name = "dialog1_ActionArea"; - w11.Spacing = 10; - w11.BorderWidth = ((uint)(5)); - w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w11 = this.ActionArea; + // w11.Name = "dialog1_ActionArea"; + // w11.Spacing = 10; + // w11.BorderWidth = ((uint)(5)); + // w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -123,9 +123,9 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-close"; this.AddActionWidget (this.buttonOk, -7); - global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonOk])); - w12.Expand = false; - w12.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonOk])); + // w12.Expand = false; + // w12.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserGitConfigDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserGitConfigDialog.cs index 6bbc421a540..9e8f3c572aa 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserGitConfigDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserGitConfigDialog.cs @@ -33,9 +33,9 @@ protected virtual void Build () this.Name = "MonoDevelop.VersionControl.Git.UserGitConfigDialog"; this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.UserGitConfigDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Name = "dialog1_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -102,17 +102,17 @@ protected virtual void Build () w9.Position = 1; w9.Expand = false; w9.Fill = false; - w1.Add (this.vbox2); - global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - w10.Position = 0; - w10.Expand = false; - w10.Fill = false; + //w1.Add (this.vbox2); + // global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + // w10.Position = 0; + // w10.Expand = false; + // w10.Fill = false; // Internal child MonoDevelop.VersionControl.Git.UserGitConfigDialog.ActionArea - global::Gtk.HButtonBox w11 = this.ActionArea; - w11.Name = "dialog1_ActionArea"; - w11.Spacing = 10; - w11.BorderWidth = ((uint)(5)); - w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w11 = this.ActionArea; + // w11.Name = "dialog1_ActionArea"; + // w11.Spacing = 10; + // w11.BorderWidth = ((uint)(5)); + // w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -122,9 +122,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonCancel])); - w12.Expand = false; - w12.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonCancel])); + // w12.Expand = false; + // w12.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -134,10 +134,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonOk])); - w13.Position = 1; - w13.Expand = false; - w13.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonOk])); + // w13.Position = 1; + // w13.Expand = false; + // w13.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserInfoConflictDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserInfoConflictDialog.cs index 39dfca47f3c..be95842d57e 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserInfoConflictDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserInfoConflictDialog.cs @@ -25,9 +25,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("User Information Conflict"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.UserInfoConflictDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Name = "dialog1_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Name = "dialog1_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -52,7 +52,7 @@ protected virtual void Build () this.radioMD.Active = true; this.radioMD.DrawIndicator = true; this.radioMD.UseUnderline = true; - this.radioMD.Group = new global::GLib.SList (global::System.IntPtr.Zero); + //this.radioMD.Group = new global::GLib.SList (global::System.IntPtr.Zero); this.vbox2.Add (this.radioMD); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.radioMD])); w3.Position = 1; @@ -113,17 +113,17 @@ protected virtual void Build () w10.Position = 5; w10.Expand = false; w10.Fill = false; - w1.Add (this.vbox2); - global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - w11.Position = 0; - w11.Expand = false; - w11.Fill = false; + // w1.Add (this.vbox2); + // global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + // w11.Position = 0; + // w11.Expand = false; + // w11.Fill = false; // Internal child MonoDevelop.VersionControl.Git.UserInfoConflictDialog.ActionArea - global::Gtk.HButtonBox w12 = this.ActionArea; - w12.Name = "dialog1_ActionArea"; - w12.Spacing = 10; - w12.BorderWidth = ((uint)(5)); - w12.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w12 = this.ActionArea; + // w12.Name = "dialog1_ActionArea"; + // w12.Spacing = 10; + // w12.BorderWidth = ((uint)(5)); + // w12.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -133,9 +133,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.buttonCancel])); - w13.Expand = false; - w13.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.buttonCancel])); + // w13.Expand = false; + // w13.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -145,10 +145,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.buttonOk])); - w14.Position = 1; - w14.Expand = false; - w14.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.buttonOk])); + // w14.Position = 1; + // w14.Expand = false; + // w14.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj index ce3af25c5a0..af4267acd81 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj @@ -20,6 +20,9 @@ + + gio-sharp-3.0 + diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/ConflictResolutionDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/ConflictResolutionDialog.cs index 66dba49d2b0..2fa687ce0cb 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/ConflictResolutionDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/ConflictResolutionDialog.cs @@ -35,7 +35,7 @@ partial class ConflictResolutionDialog : Gtk.Dialog public ConflictResolutionDialog () { this.Build (); - HasSeparator = false; + //HasSeparator = false; this.UseNativeContextMenus (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs index 6cebdbc94de..fc4a1ec585b 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs @@ -47,7 +47,7 @@ public GitConfigurationDialog (VersionControlSystem vcs, string repoPath, string { this.Build (); this.repo = new GitRepository (vcs, repoPath, repoUrl, false); - this.HasSeparator = false; + //this.HasSeparator = false; this.UseNativeContextMenus (); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs index 491694ae2ef..cf937330d36 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs @@ -60,19 +60,19 @@ public static void Push (GitRepository repo) if (MessageService.RunCustomDialog (dlg) != (int) Gtk.ResponseType.Ok) return; - string remote = dlg.SelectedRemote; - string branch = dlg.SelectedRemoteBranch ?? repo.GetCurrentBranch (); + //string remote = dlg.SelectedRemote; + //string branch = dlg.SelectedRemoteBranch ?? repo.GetCurrentBranch (); ProgressMonitor monitor = VersionControlService.GetProgressMonitor (GettextCatalog.GetString ("Pushing changes..."), VersionControlOperationType.Push); - Task.Run (async () => { - try { - await repo.PushAsync (monitor, remote, branch); - } catch (Exception ex) { - monitor.ReportError (ex.Message, ex); - } finally { - monitor.Dispose (); - } - }); + // Task.Run (async () => { + // try { + // await repo.PushAsync (monitor, remote, branch); + // } catch (Exception ex) { + // monitor.ReportError (ex.Message, ex); + // } finally { + // monitor.Dispose (); + // } + // }); } finally { dlg.Destroy (); dlg.Dispose (); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/PushDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/PushDialog.cs index 30992c27d65..b84a81cfe86 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/PushDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/PushDialog.cs @@ -42,11 +42,11 @@ public PushDialog (GitRepository repo) { this.Build (); this.repo = repo; - HasSeparator = false; + //HasSeparator = false; this.UseNativeContextMenus (); - changeList.DiffLoader = DiffLoader; + //changeList.DiffLoader = DiffLoader; var token = destroyTokenSource.Token; Task.Run (async () => (await repo.GetRemotesAsync (token), await repo.GetCurrentRemoteAsync (token))).ContinueWith (t => { @@ -55,21 +55,21 @@ public PushDialog (GitRepository repo) var tuple = t.Result; var list = new List (tuple.Item1.Select (r => r.Name)); - foreach (string s in list) - remoteCombo.AppendText (s); + //foreach (string s in list) + //remoteCombo.AppendText (s); remoteCombo.Active = list.IndexOf (t.Result.Item2); }, token, TaskContinuationOptions.NotOnCanceled, Runtime.MainTaskScheduler).Ignore (); UpdateChangeSet (); } - public string SelectedRemote { - get { return remoteCombo.ActiveText; } - } + //public string SelectedRemote { + //get { return remoteCombo.ActiveText; } + //} - public string SelectedRemoteBranch { - get { return branchCombo.ActiveText; } - } + // public string SelectedRemoteBranch { + // get { return branchCombo.ActiveText; } + // } void UpdateRemoteBranches () { @@ -80,14 +80,14 @@ void UpdateRemoteBranches () } branchCombo.Sensitive = true; var token = destroyTokenSource.Token; - repo.GetRemoteBranchesAsync (remoteCombo.ActiveText).ContinueWith (t => { - if (token.IsCancellationRequested) - return; - var list = t.Result; - foreach (string s in list) - branchCombo.AppendText (s); - branchCombo.Active = list.IndexOf (repo.GetCurrentBranch ()); - }, token, TaskContinuationOptions.NotOnCanceled, Runtime.MainTaskScheduler).Ignore (); + //repo.GetRemoteBranchesAsync (remoteCombo.ActiveText).ContinueWith (t => { + // if (token.IsCancellationRequested) + // return; + // var list = t.Result; + //foreach (string s in list) + // branchCombo.AppendText (s); + // branchCombo.Active = list.IndexOf (repo.GetCurrentBranch ()); + //}, token, TaskContinuationOptions.NotOnCanceled, Runtime.MainTaskScheduler).Ignore (); } void UpdateChangeSet () @@ -96,14 +96,14 @@ void UpdateChangeSet () changeList.Clear (); return; } - ChangeSet changeSet = repo.GetPushChangeSet (remoteCombo.ActiveText, branchCombo.ActiveText); - changeList.Load (changeSet); + //ChangeSet changeSet = repo.GetPushChangeSet (remoteCombo.ActiveText, branchCombo.ActiveText); + //changeList.Load (changeSet); } - DiffInfo[] DiffLoader (FilePath path) - { - return repo.GetPushDiff (remoteCombo.ActiveText, branchCombo.ActiveText); - } + // DiffInfo[] DiffLoader (FilePath path) + // { + // return repo.GetPushDiff (remoteCombo.ActiveText, branchCombo.ActiveText); + // } protected virtual void OnRemoteComboChanged (object sender, System.EventArgs e) { diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs index 0757b76d5cc..855ffebca9c 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs @@ -23,10 +23,10 @@ protected virtual void Build () this.Name = "MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog"; this.Title = global::Mono.Unix.Catalog.GetString ("Client Certificate Required"); // Internal child MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Events = ((global::Gdk.EventMask)(256)); - w1.Name = "dialog_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Events = ((global::Gdk.EventMask)(256)); + // w1.Name = "dialog_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -100,18 +100,18 @@ protected virtual void Build () w8.Position = 4; w8.Expand = false; w8.Fill = false; - w1.Add (this.vbox2); - global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - w9.Position = 0; - w9.Expand = false; - w9.Fill = false; + // w1.Add (this.vbox2); + // global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + // w9.Position = 0; + // w9.Expand = false; + // w9.Fill = false; // Internal child MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.ActionArea - global::Gtk.HButtonBox w10 = this.ActionArea; - w10.Events = ((global::Gdk.EventMask)(256)); - w10.Name = "MonoDevelop.VersionControl.Subversion.ClientCertificateDialog_ActionArea"; - w10.Spacing = 10; - w10.BorderWidth = ((uint)(5)); - w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w10 = this.ActionArea; + // w10.Events = ((global::Gdk.EventMask)(256)); + // w10.Name = "MonoDevelop.VersionControl.Subversion.ClientCertificateDialog_ActionArea"; + // w10.Spacing = 10; + // w10.BorderWidth = ((uint)(5)); + // w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child MonoDevelop.VersionControl.Subversion.ClientCertificateDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button34 = new global::Gtk.Button (); this.button34.CanDefault = true; @@ -121,9 +121,9 @@ protected virtual void Build () this.button34.UseUnderline = true; this.button34.Label = "gtk-cancel"; this.AddActionWidget (this.button34, -6); - global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button34])); - w11.Expand = false; - w11.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button34])); + // w11.Expand = false; + // w11.Fill = false; // Container child MonoDevelop.VersionControl.Subversion.ClientCertificateDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button24 = new global::Gtk.Button (); this.button24.CanDefault = true; @@ -133,10 +133,10 @@ protected virtual void Build () this.button24.UseUnderline = true; this.button24.Label = "gtk-ok"; this.AddActionWidget (this.button24, -5); - global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button24])); - w12.Position = 1; - w12.Expand = false; - w12.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button24])); + // w12.Position = 1; + // w12.Expand = false; + // w12.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs index 9f0a4b2c72b..e8301204b86 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs @@ -23,10 +23,10 @@ protected virtual void Build () this.Name = "MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog"; this.Title = global::Mono.Unix.Catalog.GetString ("Password for client certificate"); // Internal child MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Events = ((global::Gdk.EventMask)(256)); - w1.Name = "dialog_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Events = ((global::Gdk.EventMask)(256)); + // w1.Name = "dialog_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -104,18 +104,18 @@ protected virtual void Build () w8.Position = 4; w8.Expand = false; w8.Fill = false; - w1.Add (this.vbox2); - global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - w9.Position = 0; - w9.Expand = false; - w9.Fill = false; + // w1.Add (this.vbox2); + // global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + // w9.Position = 0; + // w9.Expand = false; + // w9.Fill = false; // Internal child MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.ActionArea - global::Gtk.HButtonBox w10 = this.ActionArea; - w10.Events = ((global::Gdk.EventMask)(256)); - w10.Name = "MonoDevelop.VersionControl.Subversion.ClientCertificatePasswordDialog_ActionArea"; - w10.Spacing = 10; - w10.BorderWidth = ((uint)(5)); - w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w10 = this.ActionArea; + // w10.Events = ((global::Gdk.EventMask)(256)); + // w10.Name = "MonoDevelop.VersionControl.Subversion.ClientCertificatePasswordDialog_ActionArea"; + // w10.Spacing = 10; + // w10.BorderWidth = ((uint)(5)); + // w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child MonoDevelop.VersionControl.Subversion.ClientCertificatePasswordDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button23 = new global::Gtk.Button (); this.button23.CanDefault = true; @@ -125,9 +125,9 @@ protected virtual void Build () this.button23.UseUnderline = true; this.button23.Label = "gtk-cancel"; this.AddActionWidget (this.button23, -6); - global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button23])); - w11.Expand = false; - w11.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button23])); + // w11.Expand = false; + // w11.Fill = false; // Container child MonoDevelop.VersionControl.Subversion.ClientCertificatePasswordDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button28 = new global::Gtk.Button (); this.button28.CanDefault = true; @@ -137,10 +137,10 @@ protected virtual void Build () this.button28.UseUnderline = true; this.button28.Label = "gtk-ok"; this.AddActionWidget (this.button28, -5); - global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button28])); - w12.Position = 1; - w12.Expand = false; - w12.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button28])); + // w12.Position = 1; + // w12.Expand = false; + // w12.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs index 91d8390b1be..3ba22b14284 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs @@ -67,10 +67,10 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Repository Certified by an Unknown Authority"); this.Modal = true; // Internal child MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Events = ((global::Gdk.EventMask)(256)); - w1.Name = "dialog_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Events = ((global::Gdk.EventMask)(256)); + // w1.Name = "dialog_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog_VBox.Gtk.Box+BoxChild this.hbox1 = new global::Gtk.HBox (); this.hbox1.Name = "hbox1"; @@ -303,7 +303,7 @@ protected virtual void Build () this.radioAccept.Active = true; this.radioAccept.DrawIndicator = true; this.radioAccept.UseUnderline = true; - this.radioAccept.Group = new global::GLib.SList (global::System.IntPtr.Zero); + //this.radioAccept.Group = new global::GLib.SList (global::System.IntPtr.Zero); this.vbox3.Add (this.radioAccept); global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.radioAccept])); w22.Position = 6; @@ -336,16 +336,16 @@ protected virtual void Build () this.hbox1.Add (this.vbox3); global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox3])); w25.Position = 1; - w1.Add (this.hbox1); - global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox1])); - w26.Position = 0; + // w1.Add (this.hbox1); + // global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox1])); + // w26.Position = 0; // Internal child MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.ActionArea - global::Gtk.HButtonBox w27 = this.ActionArea; - w27.Events = ((global::Gdk.EventMask)(256)); - w27.Name = "MonoDevelop.VersionControl.Subversion.SslServerTrustDialog_ActionArea"; - w27.Spacing = 10; - w27.BorderWidth = ((uint)(5)); - w27.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w27 = this.ActionArea; + // w27.Events = ((global::Gdk.EventMask)(256)); + // w27.Name = "MonoDevelop.VersionControl.Subversion.SslServerTrustDialog_ActionArea"; + // w27.Spacing = 10; + // w27.BorderWidth = ((uint)(5)); + // w27.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child MonoDevelop.VersionControl.Subversion.SslServerTrustDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button98 = new global::Gtk.Button (); this.button98.CanDefault = true; @@ -355,9 +355,9 @@ protected virtual void Build () this.button98.UseUnderline = true; this.button98.Label = "gtk-cancel"; this.AddActionWidget (this.button98, -6); - global::Gtk.ButtonBox.ButtonBoxChild w28 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w27 [this.button98])); - w28.Expand = false; - w28.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w28 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w27 [this.button98])); + // w28.Expand = false; + // w28.Fill = false; // Container child MonoDevelop.VersionControl.Subversion.SslServerTrustDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button104 = new global::Gtk.Button (); this.button104.CanDefault = true; @@ -367,10 +367,10 @@ protected virtual void Build () this.button104.UseUnderline = true; this.button104.Label = "gtk-ok"; this.AddActionWidget (this.button104, -5); - global::Gtk.ButtonBox.ButtonBoxChild w29 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w27 [this.button104])); - w29.Position = 1; - w29.Expand = false; - w29.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w29 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w27 [this.button104])); + // w29.Position = 1; + // w29.Expand = false; + // w29.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs index a0393db3830..a42a4b6d8b1 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs @@ -25,12 +25,12 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Subversion"); this.Modal = true; this.Resizable = false; - this.AllowGrow = false; + //this.AllowGrow = false; // Internal child MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Events = ((global::Gdk.EventMask)(256)); - w1.Name = "dialog_VBox"; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Events = ((global::Gdk.EventMask)(256)); + // w1.Name = "dialog_VBox"; + // w1.BorderWidth = ((uint)(2)); // Container child dialog_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -123,16 +123,16 @@ protected virtual void Build () w9.Position = 3; w9.Expand = false; w9.Fill = false; - w1.Add (this.vbox2); - global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - w10.Position = 0; + // w1.Add (this.vbox2); + // global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + // w10.Position = 0; // Internal child MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.ActionArea - global::Gtk.HButtonBox w11 = this.ActionArea; - w11.Events = ((global::Gdk.EventMask)(256)); - w11.Name = "MonoDevelop.VersionControl.Subversion.UserPasswordDialog_ActionArea"; - w11.Spacing = 10; - w11.BorderWidth = ((uint)(5)); - w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w11 = this.ActionArea; + // w11.Events = ((global::Gdk.EventMask)(256)); + // w11.Name = "MonoDevelop.VersionControl.Subversion.UserPasswordDialog_ActionArea"; + // w11.Spacing = 10; + // w11.BorderWidth = ((uint)(5)); + // w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child MonoDevelop.VersionControl.Subversion.UserPasswordDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button1 = new global::Gtk.Button (); this.button1.CanDefault = true; @@ -142,9 +142,9 @@ protected virtual void Build () this.button1.UseUnderline = true; this.button1.Label = "gtk-cancel"; this.AddActionWidget (this.button1, -6); - global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.button1])); - w12.Expand = false; - w12.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.button1])); + // w12.Expand = false; + // w12.Fill = false; // Container child MonoDevelop.VersionControl.Subversion.UserPasswordDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button7 = new global::Gtk.Button (); this.button7.CanDefault = true; @@ -154,10 +154,10 @@ protected virtual void Build () this.button7.UseUnderline = true; this.button7.Label = "gtk-ok"; this.AddActionWidget (this.button7, -5); - global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.button7])); - w13.Position = 1; - w13.Expand = false; - w13.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.button7])); + // w13.Position = 1; + // w13.Expand = false; + // w13.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj index 4e7abfcd914..a9f66d0495b 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj @@ -46,6 +46,9 @@ + + gio-sharp-3.0 + diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs index d2dd4ec285b..1fdee8c0144 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs @@ -27,11 +27,11 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.VersionControl.Dialogs.CommitDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Events = ((global::Gdk.EventMask)(256)); - w1.Name = "dialog_VBox"; - w1.Spacing = 6; - w1.BorderWidth = ((uint)(2)); + // global::Gtk.VBox w1 = this.VBox; + // w1.Events = ((global::Gdk.EventMask)(256)); + // w1.Name = "dialog_VBox"; + // w1.Spacing = 6; + // w1.BorderWidth = ((uint)(2)); // Container child dialog_VBox.Gtk.Box+BoxChild this.mainBox = new global::Gtk.VBox (); this.mainBox.Name = "mainBox"; @@ -115,16 +115,16 @@ protected virtual void Build () global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.mainBox [this.scrolledwindow2])); w10.PackType = ((global::Gtk.PackType)(1)); w10.Position = 4; - w1.Add (this.mainBox); - global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(w1 [this.mainBox])); - w11.Position = 0; + //w1.Add (this.mainBox); + // global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(w1 [this.mainBox])); + // w11.Position = 0; // Internal child MonoDevelop.VersionControl.Dialogs.CommitDialog.ActionArea - global::Gtk.HButtonBox w12 = this.ActionArea; - w12.Events = ((global::Gdk.EventMask)(256)); - w12.Name = "VersionControlAddIn.CommitDialog_ActionArea"; - w12.Spacing = 6; - w12.BorderWidth = ((uint)(5)); - w12.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w12 = this.ActionArea; + // w12.Events = ((global::Gdk.EventMask)(256)); + // w12.Name = "VersionControlAddIn.CommitDialog_ActionArea"; + // w12.Spacing = 6; + // w12.BorderWidth = ((uint)(5)); + // w12.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child VersionControlAddIn.CommitDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button29 = new global::Gtk.Button (); this.button29.CanDefault = true; @@ -134,9 +134,9 @@ protected virtual void Build () this.button29.UseUnderline = true; this.button29.Label = "gtk-cancel"; this.AddActionWidget (this.button29, -6); - global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.button29])); - w13.Expand = false; - w13.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.button29])); + // w13.Expand = false; + // w13.Fill = false; // Container child VersionControlAddIn.CommitDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCommit = new global::Gtk.Button (); this.buttonCommit.CanDefault = true; @@ -145,10 +145,10 @@ protected virtual void Build () this.buttonCommit.UseUnderline = true; this.buttonCommit.Label = global::Mono.Unix.Catalog.GetString ("C_ommit"); this.AddActionWidget (this.buttonCommit, -5); - global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.buttonCommit])); - w14.Position = 1; - w14.Expand = false; - w14.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.buttonCommit])); + // w14.Position = 1; + // w14.Expand = false; + // w14.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs index 2e1401e8221..da191970aae 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs @@ -25,10 +25,10 @@ protected virtual void Build () this.BorderWidth = ((uint)(6)); this.DefaultWidth = 500; // Internal child MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Events = ((global::Gdk.EventMask)(256)); - w1.Name = "dialog-vbox3"; - w1.Spacing = 6; + // global::Gtk.VBox w1 = this.VBox; + // w1.Events = ((global::Gdk.EventMask)(256)); + // w1.Name = "dialog-vbox3"; + // w1.Spacing = 6; // Container child dialog-vbox3.Gtk.Box+BoxChild this.vbox1 = new global::Gtk.VBox (); this.vbox1.Name = "vbox1"; @@ -73,9 +73,9 @@ protected virtual void Build () w4.XOptions = ((global::Gtk.AttachOptions)(4)); w4.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table1.Gtk.Table+TableChild - this.versionControlType = global::Gtk.ComboBox.NewText (); - this.versionControlType.Name = "versionControlType"; - this.table1.Add (this.versionControlType); + // this.versionControlType = global::Gtk.ComboBox.NewText (); + // this.versionControlType.Name = "versionControlType"; + // this.table1.Add (this.versionControlType); global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.versionControlType])); w5.LeftAttach = ((uint)(1)); w5.RightAttach = ((uint)(2)); @@ -100,16 +100,16 @@ protected virtual void Build () this.vbox1.Add (this.repoEditorContainer); global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.repoEditorContainer])); w8.Position = 2; - w1.Add (this.vbox1); - global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox1])); - w9.Position = 0; + //w1.Add (this.vbox1); + // global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox1])); + // w9.Position = 0; // Internal child MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.ActionArea - global::Gtk.HButtonBox w10 = this.ActionArea; - w10.Events = ((global::Gdk.EventMask)(256)); - w10.Name = "GtkDialog_ActionArea"; - w10.Spacing = 10; - w10.BorderWidth = ((uint)(5)); - w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w10 = this.ActionArea; + // w10.Events = ((global::Gdk.EventMask)(256)); + // w10.Name = "GtkDialog_ActionArea"; + // w10.Spacing = 10; + // w10.BorderWidth = ((uint)(5)); + // w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child GtkDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button10 = new global::Gtk.Button (); this.button10.CanDefault = true; @@ -119,9 +119,9 @@ protected virtual void Build () this.button10.UseUnderline = true; this.button10.Label = "gtk-cancel"; this.AddActionWidget (this.button10, -6); - global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button10])); - w11.Expand = false; - w11.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button10])); + // w11.Expand = false; + // w11.Fill = false; // Container child GtkDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -130,11 +130,11 @@ protected virtual void Build () this.buttonOk.UseStock = true; this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; - w10.Add (this.buttonOk); - global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.buttonOk])); - w12.Position = 1; - w12.Expand = false; - w12.Fill = false; + //w10.Add (this.buttonOk); + // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.buttonOk])); + // w12.Position = 1; + // w12.Expand = false; + // w12.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs index cc34e760aae..797138bd27a 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs @@ -76,10 +76,10 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.VBox - global::Gtk.VBox w1 = this.VBox; - w1.Events = ((global::Gdk.EventMask)(256)); - w1.Name = "dialog_VBox"; - w1.Spacing = 6; + // global::Gtk.VBox w1 = this.VBox; + // w1.Events = ((global::Gdk.EventMask)(256)); + // w1.Name = "dialog_VBox"; + // w1.Spacing = 6; // Container child dialog_VBox.Gtk.Box+BoxChild this.vbox1 = new global::Gtk.VBox (); this.vbox1.Name = "vbox1"; @@ -109,11 +109,11 @@ protected virtual void Build () w2.Expand = false; w2.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.repCombo = global::Gtk.ComboBox.NewText (); - this.repCombo.Name = "repCombo"; - this.hbox1.Add (this.repCombo); - global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.repCombo])); - w3.Position = 1; + // this.repCombo = global::Gtk.ComboBox.NewText (); + // this.repCombo.Name = "repCombo"; + // this.hbox1.Add (this.repCombo); + // global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.repCombo])); + // w3.Position = 1; this.vbox2.Add (this.hbox1); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); w4.Position = 0; @@ -336,22 +336,22 @@ protected virtual void Build () w26.TopAttach = ((uint)(1)); w26.BottomAttach = ((uint)(2)); w26.XOptions = ((global::Gtk.AttachOptions)(4)); - w26.YOptions = ((global::Gtk.AttachOptions)(4)); + //w26.YOptions = ((global::Gtk.AttachOptions)(4)); this.vbox1.Add (this.table1); global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.table1])); w27.Position = 1; w27.Expand = false; w27.Fill = false; - w1.Add (this.vbox1); - global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox1])); - w28.Position = 0; + //w1.Add (this.vbox1); + //global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox1])); + //w28.Position = 0; // Internal child MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.ActionArea - global::Gtk.HButtonBox w29 = this.ActionArea; - w29.Events = ((global::Gdk.EventMask)(256)); - w29.Name = "VersionControlAddIn.SelectRepositoryDialog_ActionArea"; - w29.Spacing = 10; - w29.BorderWidth = ((uint)(5)); - w29.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + // global::Gtk.HButtonBox w29 = this.ActionArea; + // w29.Events = ((global::Gdk.EventMask)(256)); + // w29.Name = "VersionControlAddIn.SelectRepositoryDialog_ActionArea"; + // w29.Spacing = 10; + // w29.BorderWidth = ((uint)(5)); + // w29.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child VersionControlAddIn.SelectRepositoryDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button559 = new global::Gtk.Button (); this.button559.CanDefault = true; @@ -361,9 +361,9 @@ protected virtual void Build () this.button559.UseUnderline = true; this.button559.Label = "gtk-cancel"; this.AddActionWidget (this.button559, -6); - global::Gtk.ButtonBox.ButtonBoxChild w30 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w29 [this.button559])); - w30.Expand = false; - w30.Fill = false; + // global::Gtk.ButtonBox.ButtonBoxChild w30 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w29 [this.button559])); + // w30.Expand = false; + // w30.Fill = false; // Container child VersionControlAddIn.SelectRepositoryDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -372,11 +372,11 @@ protected virtual void Build () this.buttonOk.UseStock = true; this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; - w29.Add (this.buttonOk); - global::Gtk.ButtonBox.ButtonBoxChild w31 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w29 [this.buttonOk])); - w31.Position = 1; - w31.Expand = false; - w31.Fill = false; + //w29.Add (this.buttonOk); + // global::Gtk.ButtonBox.ButtonBoxChild w31 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w29 [this.buttonOk])); + // w31.Position = 1; + // w31.Expand = false; + // w31.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs index d64871f21b6..94846b42031 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs @@ -39,9 +39,9 @@ protected virtual void Build () this.hbox1 = new global::Gtk.HBox (); this.hbox1.Name = "hbox1"; // Container child hbox1.Gtk.Box+BoxChild - this.comboProtocol = global::Gtk.ComboBox.NewText (); - this.comboProtocol.Name = "comboProtocol"; - this.hbox1.Add (this.comboProtocol); + // this.comboProtocol = global::Gtk.ComboBox.NewText (); + // this.comboProtocol.Name = "comboProtocol"; + // this.hbox1.Add (this.comboProtocol); global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.comboProtocol])); w1.Position = 0; w1.Expand = false; diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs index 5f99489b629..7fcf1ad4369 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs @@ -17,7 +17,7 @@ public EditRepositoryDialog (Repository editedRepository) if (repo != null) { versionControlType.Sensitive = false; - versionControlType.AppendText (repo.VersionControlSystem.Name); + //versionControlType.AppendText (repo.VersionControlSystem.Name); versionControlType.Active = 0; editor = repo.VersionControlSystem.CreateRepositoryEditor (repo); @@ -27,7 +27,7 @@ public EditRepositoryDialog (Repository editedRepository) else { foreach (VersionControlSystem vcs in VersionControlService.GetVersionControlSystems ()) { if (vcs.IsInstalled) { - versionControlType.AppendText (vcs.Name); + //versionControlType.AppendText (vcs.Name); systems.Add (vcs); } } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs index 41205d7a776..0262842c92f 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs @@ -42,14 +42,14 @@ public SelectRepositoryDialog (SelectRepositoryMode mode) Modal = true; foreach (VersionControlSystem vcs in VersionControlService.GetVersionControlSystems ()) { if (vcs.IsInstalled) { - repCombo.AppendText (vcs.Name); + //repCombo.AppendText (vcs.Name); systems.Add (vcs); } } repCombo.Active = 0; this.mode = mode; - store = new Gtk.TreeStore (typeof(object), typeof(string), typeof(string), typeof(bool), typeof(string)); + store = new Gtk.TreeStore (typeof(object), typeof(string), typeof(string), typeof(bool), typeof(string)); repoTree.Model = store; TreeViewColumn col = new TreeViewColumn (); col.Title = GettextCatalog.GetString ("Repository"); @@ -57,9 +57,9 @@ public SelectRepositoryDialog (SelectRepositoryMode mode) CellRendererImage crp = new CellRendererImage (); col.PackStart (crp, false); col.PackStart (crt, true); - col.AddAttribute (crp, "stock-id", IconCol); - col.AddAttribute (crt, "text", RepoNameCol); - repoTree.AppendColumn (col); + col.AddAttribute (crp, "stock-id", IconCol); + col.AddAttribute (crt, "text", RepoNameCol); + repoTree.AppendColumn (col); repoTree.AppendColumn (GettextCatalog.GetString ("Type"), new CellRendererText (), "text", VcsName); repoTree.TestExpandRow += new Gtk.TestExpandRowHandler (OnTestExpandRow); LoadRepositories (); @@ -78,8 +78,8 @@ public SelectRepositoryDialog (SelectRepositoryMode mode) boxFolder.Visible = false; } - repoContainer.SetFlag (WidgetFlags.NoWindow); - SetupAccessibility (); + //repoContainer.SetFlag (WidgetFlags.NoWindow); + SetupAccessibility (); } void SetupAccessibility () @@ -115,7 +115,7 @@ public string TargetPath { get { return entryFolder.Text; } set { entryFolder.Text = value; } } - + void UpdateRepoDescription () { if (Repository != null) @@ -164,16 +164,16 @@ protected virtual void OnRepositoryServerEntryChanged (object sender, System.Eve buttonOk.Sensitive = entryFolder.Text.Length > 0; } - public void LoadRepositories () + public void LoadRepositories () { store.Clear (); foreach (Repository r in VersionControlService.GetRepositories ()) { LoadRepositories (r, Gtk.TreeIter.Zero); - } + } } - - public void LoadRepositories (Repository r, Gtk.TreeIter parent) - { + + public void LoadRepositories (Repository r, Gtk.TreeIter parent) + { if (r.VersionControlSystem == null) return; @@ -210,7 +210,7 @@ protected virtual void OnButtonAddClicked(object sender, System.EventArgs e) protected virtual void OnButtonRemoveClicked(object sender, System.EventArgs e) { TreeIter iter; - TreeModel model; + ITreeModel model; if (repoTree.Selection.GetSelected (out model, out iter)) { VersionControlService.RemoveRepository ( (Repository) store.GetValue (iter, RepositoryCol)); @@ -236,7 +236,7 @@ protected virtual void OnButtonEditClicked(object sender, System.EventArgs e) VersionControlService.SaveConfiguration (); TreeIter iter; - TreeModel model; + ITreeModel model; if (repoTree.Selection.GetSelected (out model, out iter)) { // Update values store.SetValue (iter, RepoNameCol, rep.Name); @@ -260,12 +260,12 @@ protected virtual void OnButtonEditClicked(object sender, System.EventArgs e) Repository GetSelectedRepository () { - TreeIter iter; - TreeModel model; - if (repoTree.Selection.GetSelected (out model, out iter)) + TreeIter iter; + ITreeModel model; + if (repoTree.Selection.GetSelected (out model, out iter)) return (Repository) store.GetValue (iter, RepositoryCol); return null; - } + } private void OnTestExpandRow (object sender, Gtk.TestExpandRowArgs args) { @@ -335,8 +335,8 @@ protected virtual void OnRepoTreeCursorChanged(object sender, System.EventArgs e void UpdateControls () { - TreeIter iter; - TreeModel model; + TreeIter iter; + ITreeModel model; if (repoTree.Selection.GetSelected (out model, out iter)) { TreeIter piter; if (!store.IterParent (out piter, iter)) { diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs index fb6affb8efb..dbb939a26ed 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs @@ -150,7 +150,7 @@ public BlameWidget (VersionControlDocumentInfo info) editor = new MonoTextEditor (doc, new SourceEditor.StyledSourceEditorOptions (options)); AddChild (editor); - editor.SetScrollAdjustments (hAdjustment, vAdjustment); + //editor.SetScrollAdjustments (hAdjustment, vAdjustment); overview = new BlameRenderer (this); AddChild (overview); @@ -228,8 +228,8 @@ void AddChild (Gtk.Widget child) protected override void OnAdded (Widget widget) { base.OnAdded (widget); - if (widget == Child) - widget.SetScrollAdjustments (hAdjustment, vAdjustment); + //if (widget == Child) + //widget.SetScrollAdjustments (hAdjustment, vAdjustment); } protected override void OnRemoved (Widget widget) @@ -248,10 +248,10 @@ protected override void OnDestroyed () base.OnDestroyed (); hScrollBar.Destroy (); - hAdjustment.Destroy (); + //hAdjustment.Destroy (); vScrollBar.Destroy (); - vAdjustment.Destroy (); + //vAdjustment.Destroy (); editor.Destroy (); overview.Destroy (); @@ -296,11 +296,11 @@ protected override bool OnScrollEvent (EventScroll evnt) return (dx != 0.0 || dy != 0.0) || base.OnScrollEvent (evnt); } - protected override void OnSizeRequested (ref Gtk.Requisition requisition) - { - base.OnSizeRequested (ref requisition); - children.ForEach (child => child.Child.SizeRequest ()); - } + // protected override void OnSizeRequested (ref Gtk.Requisition requisition) + // { + // base.OnSizeRequested (ref requisition); + // children.ForEach (child => child.Child.SizeRequest ()); + // } void HandleEditorExposeEvent (object o, PaintEventArgs args) { @@ -338,18 +338,18 @@ void HandleEditorExposeEvent (object o, PaintEventArgs args) } } - protected override bool OnExposeEvent (EventExpose evnt) - { - Gdk.GC gc = Style.DarkGC (State); - evnt.Window.DrawLine (gc, Allocation.X, Allocation.Top, Allocation.X, Allocation.Bottom); - evnt.Window.DrawLine (gc, Allocation.Right, Allocation.Top, Allocation.Right, Allocation.Bottom); + // protected override bool OnExposeEvent (EventExpose evnt) + // { + // Gdk.GC gc = Style.DarkGC (State); + // evnt.Window.DrawLine (gc, Allocation.X, Allocation.Top, Allocation.X, Allocation.Bottom); + // evnt.Window.DrawLine (gc, Allocation.Right, Allocation.Top, Allocation.Right, Allocation.Bottom); - evnt.Window.DrawLine (gc, Allocation.Left, Allocation.Y, Allocation.Right, Allocation.Y); - evnt.Window.DrawLine (gc, Allocation.Left, Allocation.Bottom, Allocation.Right, Allocation.Bottom); + // evnt.Window.DrawLine (gc, Allocation.Left, Allocation.Y, Allocation.Right, Allocation.Y); + // evnt.Window.DrawLine (gc, Allocation.Left, Allocation.Bottom, Allocation.Right, Allocation.Bottom); - return base.OnExposeEvent (evnt); - } + // return base.OnExposeEvent (evnt); + // } void JumpOverFoldings (ref int line) { @@ -400,7 +400,7 @@ void OnWidgetChanged (object sender, EventArgs e) public void OptionsChanged () { - layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); + //layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); UpdateWidth (); } @@ -700,138 +700,138 @@ void UpdateWidth () const int margin = 4; - protected override bool OnExposeEvent (Gdk.EventExpose e) - { - using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { - cr.LineWidth = Math.Max (1.0, widget.Editor.Options.Zoom); - - cr.Rectangle (leftSpacer, 0, Allocation.Width, Allocation.Height); - cr.SetSourceColor (Styles.BlameView.AnnotationBackgroundColor.ToCairoColor ()); - cr.Fill (); - - int startLine = widget.Editor.YToLine ((int)widget.Editor.VAdjustment.Value); - double startY = widget.Editor.LineToY (startLine); - while (startLine > 1 && startLine < annotations.Count && annotations[startLine - 1] != null && annotations[startLine] != null && annotations[startLine - 1].Revision == annotations[startLine].Revision) { - startLine--; - startY -= widget.Editor.GetLineHeight (widget.Editor.Document.GetLine (startLine)); - } - double curY = startY - widget.Editor.VAdjustment.Value; - int line = startLine; - while (curY < Allocation.Bottom && line <= widget.Editor.LineCount) { - double curStart = curY; -// widget.JumpOverFoldings (ref line); - int lineStart = line; - int authorWidth = 0, revisionWidth = 0, dateWidth = 0, h = 16; - Annotation ann = line <= annotations.Count ? annotations[line - 1] : null; - if (ann != null) { - do { - widget.JumpOverFoldings (ref line); - line++; - } while (line <= annotations.Count && annotations[line - 1] != null && annotations[line - 1].Revision == ann.Revision); - - double nextY = widget.editor.LineToY (line) - widget.editor.VAdjustment.Value; - if (highlightAnnotation != null && highlightAnnotation.Revision == ann.Revision && curStart <= highlightPositon && highlightPositon < nextY) { - cr.Rectangle (leftSpacer, curStart + cr.LineWidth, Allocation.Width - leftSpacer, nextY - curStart - cr.LineWidth); - cr.SetSourceColor (Styles.BlameView.AnnotationHighlightColor.ToCairoColor ()); - cr.Fill (); - } - - // use a fixed size revision to get a approx. revision width - layout.SetText ("88888888"); - layout.GetPixelSize (out revisionWidth, out h); - layout.SetText (TruncRevision (ann.Text)); - - const int dateRevisionSpacing = 16; - - using (var gc = new Gdk.GC (e.Window)) { - gc.RgbFgColor = Styles.BlameView.AnnotationTextColor.ToGdkColor (); - e.Window.DrawLayout (gc, Allocation.Width - revisionWidth - margin, (int)(curY + (widget.Editor.LineHeight - h) / 2), layout); - - if (ann.HasDate) { - string dateTime = ann.Date.ToShortDateString (); - // use a fixed size date to get a approx. date width - layout.SetText (new DateTime (1999, 10, 10).ToShortDateString ()); - layout.GetPixelSize (out dateWidth, out h); - layout.SetText (dateTime); - - e.Window.DrawLayout (gc, Allocation.Width - revisionWidth - margin - revisionWidth - dateRevisionSpacing, (int)(curY + (widget.Editor.LineHeight - h) / 2), layout); - } - } - - using (var authorLayout = MonoDevelop.Components.PangoUtil.CreateLayout (this)) { - authorLayout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); - authorLayout.SetText (ann.Author); - authorLayout.GetPixelSize (out authorWidth, out h); - - var maxWidth = Allocation.Width - revisionWidth - margin - revisionWidth - dateRevisionSpacing; - /* if (authorWidth > maxWidth) { - int idx = ann.Author.IndexOf ('<'); - if (idx > 0) - authorLayout.SetText (ann.Author.Substring (0, idx) + Environment.NewLine + ann.Author.Substring (idx)); - authorLayout.GetPixelSize (out authorWidth, out h); - }*/ - - cr.Save (); - cr.Rectangle (0, 0, maxWidth, Allocation.Height); - cr.Clip (); - cr.Translate (leftSpacer + margin, (int)(curY + (widget.Editor.LineHeight - h) / 2)); - cr.SetSourceColor (Styles.BlameView.AnnotationTextColor.ToCairoColor ()); - cr.ShowLayout (authorLayout); - cr.ResetClip (); - cr.Restore (); - } - - curY = nextY; - } else { - curY += widget.Editor.GetLineHeight (line); - line++; - widget.JumpOverFoldings (ref line); - } - - if (ann != null && line - lineStart > 1) { - string msg = GetCommitMessage (lineStart, false); - if (!string.IsNullOrEmpty (msg)) { - msg = RevisionHelpers.FormatMessage (msg); - - layout.SetText (msg); - layout.Width = (int)(Allocation.Width * Pango.Scale.PangoScale); - using (var gc = new Gdk.GC (e.Window)) { - gc.RgbFgColor = Styles.BlameView.AnnotationSummaryTextColor.ToGdkColor (); - gc.ClipRectangle = new Rectangle (0, (int)curStart, Allocation.Width, (int)(curY - curStart)); - e.Window.DrawLayout (gc, (int)(leftSpacer + margin), (int)(curStart + h), layout); - } - } - } - - cr.Rectangle (0, curStart, leftSpacer, curY - curStart); - - if (ann != null && !string.IsNullOrEmpty (ann.Author)) { - double a; - - if (ann != null && (maxDate - minDate).TotalHours > 0) { - a = 1 - (ann.Date - minDate).TotalHours / (maxDate - minDate).TotalHours; - } else { - a = 1; - } - var color = Styles.BlameView.AnnotationMarkColor; - color.Light = 0.4 + a / 2; - color.Saturation = 1 - a / 2; - cr.SetSourceColor (color.ToCairoColor ()); - } else { - cr.SetSourceColor ((ann != null ? Styles.BlameView.AnnotationMarkModifiedColor : Styles.BlameView.AnnotationBackgroundColor).ToCairoColor ()); - } - cr.Fill (); - - if (ann != null) { - cr.MoveTo (0, curY + 0.5); - cr.LineTo (Allocation.Width, curY + 0.5); - cr.SetSourceColor (Styles.BlameView.AnnotationSplitterColor.ToCairoColor ()); - cr.Stroke (); - } - } - } - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose e) +// { +// using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { +// cr.LineWidth = Math.Max (1.0, widget.Editor.Options.Zoom); + +// cr.Rectangle (leftSpacer, 0, Allocation.Width, Allocation.Height); +// cr.SetSourceColor (Styles.BlameView.AnnotationBackgroundColor.ToCairoColor ()); +// cr.Fill (); + +// int startLine = widget.Editor.YToLine ((int)widget.Editor.VAdjustment.Value); +// double startY = widget.Editor.LineToY (startLine); +// while (startLine > 1 && startLine < annotations.Count && annotations[startLine - 1] != null && annotations[startLine] != null && annotations[startLine - 1].Revision == annotations[startLine].Revision) { +// startLine--; +// startY -= widget.Editor.GetLineHeight (widget.Editor.Document.GetLine (startLine)); +// } +// double curY = startY - widget.Editor.VAdjustment.Value; +// int line = startLine; +// while (curY < Allocation.Bottom && line <= widget.Editor.LineCount) { +// double curStart = curY; +// // widget.JumpOverFoldings (ref line); +// int lineStart = line; +// int authorWidth = 0, revisionWidth = 0, dateWidth = 0, h = 16; +// Annotation ann = line <= annotations.Count ? annotations[line - 1] : null; +// if (ann != null) { +// do { +// widget.JumpOverFoldings (ref line); +// line++; +// } while (line <= annotations.Count && annotations[line - 1] != null && annotations[line - 1].Revision == ann.Revision); + +// double nextY = widget.editor.LineToY (line) - widget.editor.VAdjustment.Value; +// if (highlightAnnotation != null && highlightAnnotation.Revision == ann.Revision && curStart <= highlightPositon && highlightPositon < nextY) { +// cr.Rectangle (leftSpacer, curStart + cr.LineWidth, Allocation.Width - leftSpacer, nextY - curStart - cr.LineWidth); +// cr.SetSourceColor (Styles.BlameView.AnnotationHighlightColor.ToCairoColor ()); +// cr.Fill (); +// } + +// // use a fixed size revision to get a approx. revision width +// layout.SetText ("88888888"); +// layout.GetPixelSize (out revisionWidth, out h); +// layout.SetText (TruncRevision (ann.Text)); + +// const int dateRevisionSpacing = 16; + +// using (var gc = new Gdk.GC (e.Window)) { +// gc.RgbFgColor = Styles.BlameView.AnnotationTextColor.ToGdkColor (); +// e.Window.DrawLayout (gc, Allocation.Width - revisionWidth - margin, (int)(curY + (widget.Editor.LineHeight - h) / 2), layout); + +// if (ann.HasDate) { +// string dateTime = ann.Date.ToShortDateString (); +// // use a fixed size date to get a approx. date width +// layout.SetText (new DateTime (1999, 10, 10).ToShortDateString ()); +// layout.GetPixelSize (out dateWidth, out h); +// layout.SetText (dateTime); + +// e.Window.DrawLayout (gc, Allocation.Width - revisionWidth - margin - revisionWidth - dateRevisionSpacing, (int)(curY + (widget.Editor.LineHeight - h) / 2), layout); +// } +// } + +// using (var authorLayout = MonoDevelop.Components.PangoUtil.CreateLayout (this)) { +// authorLayout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); +// authorLayout.SetText (ann.Author); +// authorLayout.GetPixelSize (out authorWidth, out h); + +// var maxWidth = Allocation.Width - revisionWidth - margin - revisionWidth - dateRevisionSpacing; +// /* if (authorWidth > maxWidth) { +// int idx = ann.Author.IndexOf ('<'); +// if (idx > 0) +// authorLayout.SetText (ann.Author.Substring (0, idx) + Environment.NewLine + ann.Author.Substring (idx)); +// authorLayout.GetPixelSize (out authorWidth, out h); +// }*/ + +// cr.Save (); +// cr.Rectangle (0, 0, maxWidth, Allocation.Height); +// cr.Clip (); +// cr.Translate (leftSpacer + margin, (int)(curY + (widget.Editor.LineHeight - h) / 2)); +// cr.SetSourceColor (Styles.BlameView.AnnotationTextColor.ToCairoColor ()); +// cr.ShowLayout (authorLayout); +// cr.ResetClip (); +// cr.Restore (); +// } + +// curY = nextY; +// } else { +// curY += widget.Editor.GetLineHeight (line); +// line++; +// widget.JumpOverFoldings (ref line); +// } + +// if (ann != null && line - lineStart > 1) { +// string msg = GetCommitMessage (lineStart, false); +// if (!string.IsNullOrEmpty (msg)) { +// msg = RevisionHelpers.FormatMessage (msg); + +// layout.SetText (msg); +// layout.Width = (int)(Allocation.Width * Pango.Scale.PangoScale); +// using (var gc = new Gdk.GC (e.Window)) { +// gc.RgbFgColor = Styles.BlameView.AnnotationSummaryTextColor.ToGdkColor (); +// gc.ClipRectangle = new Rectangle (0, (int)curStart, Allocation.Width, (int)(curY - curStart)); +// e.Window.DrawLayout (gc, (int)(leftSpacer + margin), (int)(curStart + h), layout); +// } +// } +// } + +// cr.Rectangle (0, curStart, leftSpacer, curY - curStart); + +// if (ann != null && !string.IsNullOrEmpty (ann.Author)) { +// double a; + +// if (ann != null && (maxDate - minDate).TotalHours > 0) { +// a = 1 - (ann.Date - minDate).TotalHours / (maxDate - minDate).TotalHours; +// } else { +// a = 1; +// } +// var color = Styles.BlameView.AnnotationMarkColor; +// color.Light = 0.4 + a / 2; +// color.Saturation = 1 - a / 2; +// cr.SetSourceColor (color.ToCairoColor ()); +// } else { +// cr.SetSourceColor ((ann != null ? Styles.BlameView.AnnotationMarkModifiedColor : Styles.BlameView.AnnotationBackgroundColor).ToCairoColor ()); +// } +// cr.Fill (); + +// if (ann != null) { +// cr.MoveTo (0, curY + 0.5); +// cr.LineTo (Allocation.Width, curY + 0.5); +// cr.SetSourceColor (Styles.BlameView.AnnotationSplitterColor.ToCairoColor ()); +// cr.Stroke (); +// } +// } +// } +// return true; +// } void UpdateAccessiblity () { diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CellRendererDiff.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CellRendererDiff.cs index 026e5498c48..1a4149a567f 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CellRendererDiff.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CellRendererDiff.cs @@ -37,12 +37,12 @@ void DisposeLayout () } bool isDisposed = false; - protected override void OnDestroyed () - { - isDisposed = true; - DisposeLayout (); - base.OnDestroyed (); - } + // protected override void OnDestroyed () + // { + // isDisposed = true; + // DisposeLayout (); + // base.OnDestroyed (); + // } public void Reset () { @@ -92,7 +92,7 @@ Pango.Layout CreateLayout (Widget container, string text) Pango.Layout layout = new Pango.Layout (container.PangoContext); layout.SingleParagraphMode = false; if (diffMode) { - layout.FontDescription = IdeServices.FontService.MonospaceFont; + //layout.FontDescription = IdeServices.FontService.MonospaceFont; layout.SetText (text); } else { layout.SetMarkup (text); @@ -110,148 +110,148 @@ static string ProcessLine (string line) const int leftSpace = 16; public bool DrawLeft { get; set; } - protected override void Render (Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - { - if (isDisposed || layout == null) - return; - if (diffMode) { + // protected override void Render (Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) + // { + // if (isDisposed || layout == null) + // return; + // if (diffMode) { - if (path.Equals (selctedPath)) { - selectedLine = -1; - selctedPath = null; - } + // if (path.Equals (selctedPath)) { + // selectedLine = -1; + // selctedPath = null; + // } - int w, maxy; - window.GetSize (out w, out maxy); - if (DrawLeft) { - cell_area.Width += cell_area.X - leftSpace; - cell_area.X = leftSpace; - } - var treeview = widget as FileTreeView; - var p = treeview != null? treeview.CursorLocation : null; - cell_area.Width -= RightPadding; + // int w, maxy; + // window.GetSize (out w, out maxy); + // if (DrawLeft) { + // cell_area.Width += cell_area.X - leftSpace; + // cell_area.X = leftSpace; + // } + // var treeview = widget as FileTreeView; + // var p = treeview != null? treeview.CursorLocation : null; + // cell_area.Width -= RightPadding; - window.DrawRectangle (widget.Style.BaseGC (Gtk.StateType.Normal), true, cell_area.X, cell_area.Y, cell_area.Width - 1, cell_area.Height); + // window.DrawRectangle (widget.Style.BaseGC (Gtk.StateType.Normal), true, cell_area.X, cell_area.Y, cell_area.Width - 1, cell_area.Height); - Gdk.GC normalGC = widget.Style.TextGC (StateType.Normal); - Gdk.GC removedGC = new Gdk.GC (window); - removedGC.Copy (normalGC); - removedGC.RgbFgColor = Styles.LogView.DiffRemoveBackgroundColor.AddLight (-0.3).ToGdkColor (); - Gdk.GC addedGC = new Gdk.GC (window); - addedGC.Copy (normalGC); - addedGC.RgbFgColor = Styles.LogView.DiffAddBackgroundColor.AddLight (-0.3).ToGdkColor (); - Gdk.GC infoGC = new Gdk.GC (window); - infoGC.Copy (normalGC); - infoGC.RgbFgColor = widget.Style.Text (StateType.Normal).AddLight (0.2); + // Gdk.GC normalGC = widget.Style.TextGC (StateType.Normal); + // Gdk.GC removedGC = new Gdk.GC (window); + // removedGC.Copy (normalGC); + // removedGC.RgbFgColor = Styles.LogView.DiffRemoveBackgroundColor.AddLight (-0.3).ToGdkColor (); + // Gdk.GC addedGC = new Gdk.GC (window); + // addedGC.Copy (normalGC); + // addedGC.RgbFgColor = Styles.LogView.DiffAddBackgroundColor.AddLight (-0.3).ToGdkColor (); + // Gdk.GC infoGC = new Gdk.GC (window); + // infoGC.Copy (normalGC); + // infoGC.RgbFgColor = widget.Style.Text (StateType.Normal).AddLight (0.2); - Cairo.Context ctx = CairoHelper.Create (window); + // Cairo.Context ctx = CairoHelper.Create (window); - // Rendering is done in two steps: - // 1) Get a list of blocks to render - // 2) render the blocks + // // Rendering is done in two steps: + // // 1) Get a list of blocks to render + // // 2) render the blocks - var blocks = CalculateBlocks (maxy, cell_area.Y + 2); + // var blocks = CalculateBlocks (maxy, cell_area.Y + 2); - // Now render the blocks + // // Now render the blocks - // The y position of the highlighted line - int selectedLineRowTop = -1; + // // The y position of the highlighted line + // int selectedLineRowTop = -1; - BlockInfo lastCodeSegmentStart = null; - BlockInfo lastCodeSegmentEnd = null; + // BlockInfo lastCodeSegmentStart = null; + // BlockInfo lastCodeSegmentEnd = null; - foreach (BlockInfo block in blocks) - { - if (block.Type == BlockType.Info) { - // Finished drawing the content of a code segment. Now draw the segment border and label. - if (lastCodeSegmentStart != null) - DrawCodeSegmentBorder (infoGC, ctx, cell_area.X, cell_area.Width, lastCodeSegmentStart, lastCodeSegmentEnd, lines, widget, window); - lastCodeSegmentStart = block; - } + // foreach (BlockInfo block in blocks) + // { + // if (block.Type == BlockType.Info) { + // // Finished drawing the content of a code segment. Now draw the segment border and label. + // if (lastCodeSegmentStart != null) + // DrawCodeSegmentBorder (infoGC, ctx, cell_area.X, cell_area.Width, lastCodeSegmentStart, lastCodeSegmentEnd, lines, widget, window); + // lastCodeSegmentStart = block; + // } - lastCodeSegmentEnd = block; + // lastCodeSegmentEnd = block; - if (block.YEnd < 0) - continue; + // if (block.YEnd < 0) + // continue; - // Draw the block background - DrawBlockBg (ctx, cell_area.X + 1, cell_area.Width - 2, block); + // // Draw the block background + // DrawBlockBg (ctx, cell_area.X + 1, cell_area.Width - 2, block); - // Get all text for the current block - StringBuilder sb = new StringBuilder (); - for (int n=block.FirstLine; n <= block.LastLine; n++) { - string s = ProcessLine (lines [n]); - if (n > block.FirstLine) - sb.Append ('\n'); - if ((block.Type == BlockType.Added || block.Type == BlockType.Removed) && s.Length > 0) { - sb.Append (' '); - sb.Append (s, 1, s.Length - 1); - } else - sb.Append (s); - } + // // Get all text for the current block + // StringBuilder sb = new StringBuilder (); + // for (int n=block.FirstLine; n <= block.LastLine; n++) { + // string s = ProcessLine (lines [n]); + // if (n > block.FirstLine) + // sb.Append ('\n'); + // if ((block.Type == BlockType.Added || block.Type == BlockType.Removed) && s.Length > 0) { + // sb.Append (' '); + // sb.Append (s, 1, s.Length - 1); + // } else + // sb.Append (s); + // } - // Draw a special background for the selected line + // // Draw a special background for the selected line - if (block.Type != BlockType.Info && p.HasValue && p.Value.X >= cell_area.X && p.Value.X <= cell_area.Right && p.Value.Y >= block.YStart && p.Value.Y <= block.YEnd) { - int row = (p.Value.Y - block.YStart) / lineHeight; - double yrow = block.YStart + lineHeight * row; - double xrow = cell_area.X + LeftPaddingBlock; - int wrow = cell_area.Width - 1 - LeftPaddingBlock; - if (block.Type == BlockType.Added) - ctx.SetSourceColor (Styles.LogView.DiffAddBackgroundColor.AddLight (0.1).ToCairoColor ()); - else if (block.Type == BlockType.Removed) - ctx.SetSourceColor (Styles.LogView.DiffRemoveBackgroundColor.AddLight (0.1).ToCairoColor ()); - else { - ctx.SetSourceColor (Styles.LogView.DiffHighlightColor.ToCairoColor ()); - xrow -= LeftPaddingBlock; - wrow += LeftPaddingBlock; - } - ctx.Rectangle (xrow, yrow, wrow, lineHeight); - ctx.Fill (); - selectedLine = block.SourceLineStart + row; - selctedPath = path; - selectedLineRowTop = (int)yrow; - } + // if (block.Type != BlockType.Info && p.HasValue && p.Value.X >= cell_area.X && p.Value.X <= cell_area.Right && p.Value.Y >= block.YStart && p.Value.Y <= block.YEnd) { + // int row = (p.Value.Y - block.YStart) / lineHeight; + // double yrow = block.YStart + lineHeight * row; + // double xrow = cell_area.X + LeftPaddingBlock; + // int wrow = cell_area.Width - 1 - LeftPaddingBlock; + // if (block.Type == BlockType.Added) + // ctx.SetSourceColor (Styles.LogView.DiffAddBackgroundColor.AddLight (0.1).ToCairoColor ()); + // else if (block.Type == BlockType.Removed) + // ctx.SetSourceColor (Styles.LogView.DiffRemoveBackgroundColor.AddLight (0.1).ToCairoColor ()); + // else { + // ctx.SetSourceColor (Styles.LogView.DiffHighlightColor.ToCairoColor ()); + // xrow -= LeftPaddingBlock; + // wrow += LeftPaddingBlock; + // } + // ctx.Rectangle (xrow, yrow, wrow, lineHeight); + // ctx.Fill (); + // selectedLine = block.SourceLineStart + row; + // selctedPath = path; + // selectedLineRowTop = (int)yrow; + // } - // Draw the line text. Ignore header blocks, since they are drawn as labels in DrawCodeSegmentBorder + // // Draw the line text. Ignore header blocks, since they are drawn as labels in DrawCodeSegmentBorder - if (block.Type != BlockType.Info) { - layout.SetMarkup (""); - layout.SetText (sb.ToString ()); - Gdk.GC gc; - switch (block.Type) { - case BlockType.Removed: gc = removedGC; break; - case BlockType.Added: gc = addedGC; break; - case BlockType.Info: gc = infoGC; break; - default: gc = normalGC; break; - } - window.DrawLayout (gc, cell_area.X + 2 + LeftPaddingBlock, block.YStart, layout); - } + // if (block.Type != BlockType.Info) { + // layout.SetMarkup (""); + // layout.SetText (sb.ToString ()); + // Gdk.GC gc; + // switch (block.Type) { + // case BlockType.Removed: gc = removedGC; break; + // case BlockType.Added: gc = addedGC; break; + // case BlockType.Info: gc = infoGC; break; + // default: gc = normalGC; break; + // } + // window.DrawLayout (gc, cell_area.X + 2 + LeftPaddingBlock, block.YStart, layout); + // } - // Finally draw the change symbol at the left margin + // // Finally draw the change symbol at the left margin - DrawChangeSymbol (ctx, widget, cell_area.X + 1, cell_area.Width - 2, block); - } + // DrawChangeSymbol (ctx, widget, cell_area.X + 1, cell_area.Width - 2, block); + // } - // Finish the drawing of the code segment - if (lastCodeSegmentStart != null) - DrawCodeSegmentBorder (infoGC, ctx, cell_area.X, cell_area.Width, lastCodeSegmentStart, lastCodeSegmentEnd, lines, widget, window); + // // Finish the drawing of the code segment + // if (lastCodeSegmentStart != null) + // DrawCodeSegmentBorder (infoGC, ctx, cell_area.X, cell_area.Width, lastCodeSegmentStart, lastCodeSegmentEnd, lines, widget, window); - // Draw the source line number at the current selected line. It must be done at the end because it must - // be drawn over the source code text and segment borders. - if (selectedLineRowTop != -1) - DrawLineBox (normalGC, ctx, ((Gtk.TreeView)widget).VisibleRect.Right - 4, selectedLineRowTop, selectedLine, widget, window); + // // Draw the source line number at the current selected line. It must be done at the end because it must + // // be drawn over the source code text and segment borders. + // if (selectedLineRowTop != -1) + // DrawLineBox (normalGC, ctx, ((Gtk.TreeView)widget).VisibleRect.Right - 4, selectedLineRowTop, selectedLine, widget, window); - ((IDisposable)ctx).Dispose (); - removedGC.Dispose (); - addedGC.Dispose (); - infoGC.Dispose (); - } else { - // Rendering a normal text row - int y = cell_area.Y + (cell_area.Height - height)/2; - window.DrawLayout (widget.Style.TextGC (GetState(widget, flags)), cell_area.X, y, layout); - } - } + // ((IDisposable)ctx).Dispose (); + // removedGC.Dispose (); + // addedGC.Dispose (); + // infoGC.Dispose (); + // } else { + // // Rendering a normal text row + // int y = cell_area.Y + (cell_area.Height - height)/2; + // window.DrawLayout (widget.Style.TextGC (GetState(widget, flags)), cell_area.X, y, layout); + // } + // } List CalculateBlocks (int maxy, int y) { @@ -352,65 +352,65 @@ enum BlockType Unchanged } - void DrawCodeSegmentBorder (Gdk.GC gc, Cairo.Context ctx, double x, int width, BlockInfo firstBlock, BlockInfo lastBlock, string[] lines, Gtk.Widget widget, Gdk.Drawable window) - { - int shadowSize = 2; - int spacing = 4; - int bottomSpacing = (lineHeight - spacing) / 2; + // void DrawCodeSegmentBorder (Gdk.GC gc, Cairo.Context ctx, double x, int width, BlockInfo firstBlock, BlockInfo lastBlock, string[] lines, Gtk.Widget widget, Gdk.Drawable window) + // { + // int shadowSize = 2; + // int spacing = 4; + // int bottomSpacing = (lineHeight - spacing) / 2; - ctx.Rectangle (x + shadowSize + 0.5, firstBlock.YStart + bottomSpacing + spacing - shadowSize + 0.5, width - shadowSize*2, shadowSize); - ctx.SetSourceColor (Styles.LogView.DiffBoxSplitterColor.ToCairoColor ()); - ctx.LineWidth = 1; - ctx.Fill (); + // ctx.Rectangle (x + shadowSize + 0.5, firstBlock.YStart + bottomSpacing + spacing - shadowSize + 0.5, width - shadowSize*2, shadowSize); + // ctx.SetSourceColor (Styles.LogView.DiffBoxSplitterColor.ToCairoColor ()); + // ctx.LineWidth = 1; + // ctx.Fill (); - ctx.Rectangle (x + shadowSize + 0.5, lastBlock.YEnd + bottomSpacing + 0.5, width - shadowSize*2, shadowSize); - ctx.SetSourceColor (Styles.LogView.DiffBoxSplitterColor.ToCairoColor ()); - ctx.Fill (); + // ctx.Rectangle (x + shadowSize + 0.5, lastBlock.YEnd + bottomSpacing + 0.5, width - shadowSize*2, shadowSize); + // ctx.SetSourceColor (Styles.LogView.DiffBoxSplitterColor.ToCairoColor ()); + // ctx.Fill (); - ctx.Rectangle (x + 0.5, firstBlock.YStart + bottomSpacing + spacing + 0.5, width, lastBlock.YEnd - firstBlock.YStart - spacing); - ctx.SetSourceColor (Styles.LogView.DiffBoxBorderColor.ToCairoColor ()); - ctx.Stroke (); + // ctx.Rectangle (x + 0.5, firstBlock.YStart + bottomSpacing + spacing + 0.5, width, lastBlock.YEnd - firstBlock.YStart - spacing); + // ctx.SetSourceColor (Styles.LogView.DiffBoxBorderColor.ToCairoColor ()); + // ctx.Stroke (); - string text = lines[firstBlock.FirstLine].Replace ("@","").Replace ("-",""); - text = "" + text.Replace ("+"," ") + ""; + // string text = lines[firstBlock.FirstLine].Replace ("@","").Replace ("-",""); + // text = "" + text.Replace ("+"," ") + ""; - layout.SetText (""); - layout.SetMarkup (text); - int tw,th; - layout.GetPixelSize (out tw, out th); - th--; + // layout.SetText (""); + // layout.SetMarkup (text); + // int tw,th; + // layout.GetPixelSize (out tw, out th); + // th--; - int dy = (lineHeight - th) / 2; + // int dy = (lineHeight - th) / 2; - ctx.Rectangle (x + 2 + LeftPaddingBlock - 1 + 0.5, firstBlock.YStart + dy - 1 + 0.5, tw + 2, th + 2); - ctx.LineWidth = 1; - ctx.SetSourceColor (widget.Style.Base (StateType.Normal).ToCairoColor ()); - ctx.FillPreserve (); - ctx.SetSourceColor (Styles.LogView.DiffBoxBorderColor.ToCairoColor ()); - ctx.Stroke (); + // ctx.Rectangle (x + 2 + LeftPaddingBlock - 1 + 0.5, firstBlock.YStart + dy - 1 + 0.5, tw + 2, th + 2); + // ctx.LineWidth = 1; + // ctx.SetSourceColor (widget.Style.Base (StateType.Normal).ToCairoColor ()); + // ctx.FillPreserve (); + // ctx.SetSourceColor (Styles.LogView.DiffBoxBorderColor.ToCairoColor ()); + // ctx.Stroke (); - window.DrawLayout (gc, (int)(x + 2 + LeftPaddingBlock), firstBlock.YStart + dy, layout); - } + // window.DrawLayout (gc, (int)(x + 2 + LeftPaddingBlock), firstBlock.YStart + dy, layout); + // } - void DrawLineBox (Gdk.GC gc, Cairo.Context ctx, int right, int top, int line, Gtk.Widget widget, Gdk.Drawable window) - { - layout.SetText (""); - layout.SetMarkup ("" + line.ToString () + ""); - int tw,th; - layout.GetPixelSize (out tw, out th); - th--; + // void DrawLineBox (Gdk.GC gc, Cairo.Context ctx, int right, int top, int line, Gtk.Widget widget, Gdk.Drawable window) + // { + // layout.SetText (""); + // layout.SetMarkup ("" + line.ToString () + ""); + // int tw,th; + // layout.GetPixelSize (out tw, out th); + // th--; - int dy = (lineHeight - th) / 2; + // int dy = (lineHeight - th) / 2; - ctx.Rectangle (right - tw - 2 + 0.5, top + dy - 1 + 0.5, tw + 2, th + 2); - ctx.LineWidth = 1; - ctx.SetSourceColor (widget.Style.Base (Gtk.StateType.Normal).ToCairoColor ()); - ctx.FillPreserve (); - ctx.SetSourceColor (Styles.LogView.DiffBoxBorderColor.ToCairoColor ()); - ctx.Stroke (); + // ctx.Rectangle (right - tw - 2 + 0.5, top + dy - 1 + 0.5, tw + 2, th + 2); + // ctx.LineWidth = 1; + // ctx.SetSourceColor (widget.Style.Base (Gtk.StateType.Normal).ToCairoColor ()); + // ctx.FillPreserve (); + // ctx.SetSourceColor (Styles.LogView.DiffBoxBorderColor.ToCairoColor ()); + // ctx.Stroke (); - window.DrawLayout (gc, right - tw - 1, top + dy, layout); - } + // window.DrawLayout (gc, right - tw - 1, top + dy, layout); + // } void DrawBlockBg (Cairo.Context ctx, double x, int width, BlockInfo block) { @@ -476,18 +476,18 @@ void DrawChangeSymbol (Cairo.Context ctx, Widget widget, double x, int width, Bl } } - public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int c_width, out int c_height) - { - x_offset = y_offset = 0; - c_width = width; - c_height = height; + // public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int c_width, out int c_height) + // { + // x_offset = y_offset = 0; + // c_width = width; + // c_height = height; - if (diffMode) { - // Add some spacing for the margin - c_width += 4; - c_height += 4; - } - } + // if (diffMode) { + // // Add some spacing for the margin + // c_width += 4; + // c_height += 4; + // } + // } static StateType GetState (Gtk.Widget widget, CellRendererState flags) { diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ChangeSetView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ChangeSetView.cs index c3c2b05b5e2..d886c26144a 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ChangeSetView.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ChangeSetView.cs @@ -175,12 +175,12 @@ protected override void OnDestroyed () disposed = true; if (colCommit != null) { - colCommit.Destroy (); + //colCommit.Destroy (); colCommit = null; } if (this.diffRenderer != null) { - this.diffRenderer.Destroy (); + //this.diffRenderer.Destroy (); this.diffRenderer = null; } } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffRendererWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffRendererWidget.cs index 6c3656a8d65..33e0ecbe762 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffRendererWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffRendererWidget.cs @@ -119,12 +119,12 @@ public void InitCell () QueueResize (); } - protected override void OnSizeRequested (ref Requisition requisition) - { - base.OnSizeRequested (ref requisition); - requisition.Width = width; - requisition.Height = height; - } + // protected override void OnSizeRequested (ref Requisition requisition) + // { + // base.OnSizeRequested (ref requisition); + // requisition.Width = width; + // requisition.Height = height; + // } int px, py; protected override bool OnMotionNotifyEvent (EventMotion evnt) @@ -155,162 +155,162 @@ Pango.Layout CreateLayout (string text) { var layout = new Pango.Layout (PangoContext); layout.SingleParagraphMode = false; - layout.FontDescription = IdeServices.FontService.MonospaceFont; + //layout.FontDescription = IdeServices.FontService.MonospaceFont; layout.SetText (text); return layout; } - protected override bool OnExposeEvent (Gdk.EventExpose e) - { - var window = e.Window; - var widget = this; - ClearAccessibleLines (); - using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { - int w, maxy; - window.GetSize (out w, out maxy); - var cell_area = Allocation; -// if (DrawLeft) { -// cell_area.Width += cell_area.X - leftSpace; -// cell_area.X = leftSpace; -// } - - cell_area.Width -= RightPadding; - - window.DrawRectangle (widget.Style.BaseGC (Gtk.StateType.Normal), true, cell_area.X, cell_area.Y, cell_area.Width - 1, cell_area.Height); - if (lines == null) - return true; - Gdk.GC normalGC = widget.Style.TextGC (StateType.Normal); - Gdk.GC removedGC = new Gdk.GC (window); - removedGC.Copy (normalGC); - removedGC.RgbFgColor = Styles.LogView.DiffRemoveBackgroundColor.AddLight (-0.3).ToGdkColor (); - Gdk.GC addedGC = new Gdk.GC (window); - addedGC.Copy (normalGC); - addedGC.RgbFgColor = Styles.LogView.DiffAddBackgroundColor.AddLight (-0.3).ToGdkColor (); - Gdk.GC infoGC = new Gdk.GC (window); - infoGC.Copy (normalGC); - infoGC.RgbFgColor = widget.Style.Text (StateType.Normal).AddLight (0.2); - - Cairo.Context ctx = CairoHelper.Create (window); - - // Rendering is done in two steps: - // 1) Get a list of blocks to render - // 2) render the blocks - - var blocks = CalculateBlocks (maxy, cell_area.Y + 2); - - // Now render the blocks - - // The y position of the highlighted line - int selectedLineRowTop = -1; - - BlockInfo lastCodeSegmentStart = null; - BlockInfo lastCodeSegmentEnd = null; - - foreach (BlockInfo block in blocks) { - if (block.Type == BlockType.Info) { - // Finished drawing the content of a code segment. Now draw the segment border and label. - if (lastCodeSegmentStart != null) - DrawCodeSegmentBorder (infoGC, ctx, cell_area.X, cell_area.Width, lastCodeSegmentStart, lastCodeSegmentEnd, lines, widget, window); - lastCodeSegmentStart = block; - } - - lastCodeSegmentEnd = block; - - if (block.YEnd < 0) - continue; - - // Draw the block background - DrawBlockBg (ctx, cell_area.X + 1, cell_area.Width - 2, block); - - // Get all text for the current block - var sb = new StringBuilder (); - bool replaceFirst = false; - int subLine = 0; - for (int n = block.FirstLine; n <= block.LastLine; n++) { - string s = ProcessLine (lines [n]); - if (n > block.FirstLine) - sb.Append ('\n'); - if ((block.Type == BlockType.Added || block.Type == BlockType.Removed) && s.Length > 0) { - sb.Append (' '); - sb.Append (s, 1, s.Length - 1); - replaceFirst = true; - } else - sb.Append (s); - int idx = 0, curIdx = 0; - while ((idx = s.IndexOf ('\n')) >= 0) { - var y1 = block.YStart + subLine * lineHeight; - if (y1 < cell_area.Bottom && y1 + lineHeight >= e.Area.Y && y1 < e.Area.Bottom) - AddAccessibleLine (cell_area.X + 2 + LeftPaddingBlock, y1, block.Type, block.FirstLine + n + subLine, ref replaceFirst, s.Substring (curIdx, idx)); - subLine++; - curIdx = idx; - } - var y2 = block.YStart + subLine * lineHeight; - if (y2 < cell_area.Bottom && y2 + lineHeight >= e.Area.Y && y2 < e.Area.Bottom) - AddAccessibleLine (cell_area.X + 2 + LeftPaddingBlock, y2, block.Type, block.FirstLine + n + subLine, ref replaceFirst, curIdx > 0 ? s.Substring (curIdx) : s); - subLine++; - } - - // Draw a special background for the selected line - if (px < 0) { - selectedLine = selectedLineRowTop = -1; - } else if (block.Type != BlockType.Info && px >= cell_area.X && py <= cell_area.Right && py >= block.YStart && py <= block.YEnd) { - int row = (py - block.YStart) / lineHeight; - double yrow = block.YStart + lineHeight * row; - double xrow = cell_area.X + LeftPaddingBlock; - int wrow = cell_area.Width - 1 - LeftPaddingBlock; - if (block.Type == BlockType.Added) - ctx.SetSourceColor (Styles.LogView.DiffAddBackgroundColor.AddLight (0.1).ToCairoColor ()); - else if (block.Type == BlockType.Removed) - ctx.SetSourceColor (Styles.LogView.DiffRemoveBackgroundColor.AddLight (0.1).ToCairoColor ()); - else { - ctx.SetSourceColor (Styles.LogView.DiffHighlightColor.ToCairoColor ()); - xrow -= LeftPaddingBlock; - wrow += LeftPaddingBlock; - } - ctx.Rectangle (xrow, yrow, wrow, lineHeight); - ctx.Fill (); - selectedLine = block.SourceLineStart + row; - // selctedPath = path; - selectedLineRowTop = (int)yrow; - } - - // Draw the line text. Ignore header blocks, since they are drawn as labels in DrawCodeSegmentBorder - - if (block.Type != BlockType.Info) { - layout.SetMarkup (""); - layout.SetText (sb.ToString ()); - Gdk.GC gc; - switch (block.Type) { - case BlockType.Removed: gc = removedGC; break; - case BlockType.Added: gc = addedGC; break; - case BlockType.Info: gc = infoGC; break; - default: gc = normalGC; break; - } - window.DrawLayout (gc, cell_area.X + 2 + LeftPaddingBlock, block.YStart, layout); - } - - // Finally draw the change symbol at the left margin - - DrawChangeSymbol (ctx, widget, cell_area.X + 1, cell_area.Width - 2, block); - } - - // Finish the drawing of the code segment - if (lastCodeSegmentStart != null) - DrawCodeSegmentBorder (infoGC, ctx, cell_area.X, cell_area.Width, lastCodeSegmentStart, lastCodeSegmentEnd, lines, widget, window); - - // Draw the source line number at the current selected line. It must be done at the end because it must - // be drawn over the source code text and segment borders. - if (selectedLineRowTop != -1) - DrawLineBox (normalGC, ctx, Allocation.Right - 4, selectedLineRowTop, selectedLine, widget, window); - - ((IDisposable)ctx).Dispose (); - removedGC.Dispose (); - addedGC.Dispose (); - infoGC.Dispose (); - } - Accessible?.SetAccessibleChildren (accessibleLines.Select (l => l.Accessible).ToArray ()); - return true; - } +// protected override bool OnExposeEvent (Gdk.EventExpose e) +// { +// var window = e.Window; +// var widget = this; +// ClearAccessibleLines (); +// using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { +// int w, maxy; +// window.GetSize (out w, out maxy); +// var cell_area = Allocation; +// // if (DrawLeft) { +// // cell_area.Width += cell_area.X - leftSpace; +// // cell_area.X = leftSpace; +// // } + +// cell_area.Width -= RightPadding; + +// window.DrawRectangle (widget.Style.BaseGC (Gtk.StateType.Normal), true, cell_area.X, cell_area.Y, cell_area.Width - 1, cell_area.Height); +// if (lines == null) +// return true; +// Gdk.GC normalGC = widget.Style.TextGC (StateType.Normal); +// Gdk.GC removedGC = new Gdk.GC (window); +// removedGC.Copy (normalGC); +// removedGC.RgbFgColor = Styles.LogView.DiffRemoveBackgroundColor.AddLight (-0.3).ToGdkColor (); +// Gdk.GC addedGC = new Gdk.GC (window); +// addedGC.Copy (normalGC); +// addedGC.RgbFgColor = Styles.LogView.DiffAddBackgroundColor.AddLight (-0.3).ToGdkColor (); +// Gdk.GC infoGC = new Gdk.GC (window); +// infoGC.Copy (normalGC); +// infoGC.RgbFgColor = widget.Style.Text (StateType.Normal).AddLight (0.2); + +// Cairo.Context ctx = CairoHelper.Create (window); + +// // Rendering is done in two steps: +// // 1) Get a list of blocks to render +// // 2) render the blocks + +// var blocks = CalculateBlocks (maxy, cell_area.Y + 2); + +// // Now render the blocks + +// // The y position of the highlighted line +// int selectedLineRowTop = -1; + +// BlockInfo lastCodeSegmentStart = null; +// BlockInfo lastCodeSegmentEnd = null; + +// foreach (BlockInfo block in blocks) { +// if (block.Type == BlockType.Info) { +// // Finished drawing the content of a code segment. Now draw the segment border and label. +// if (lastCodeSegmentStart != null) +// DrawCodeSegmentBorder (infoGC, ctx, cell_area.X, cell_area.Width, lastCodeSegmentStart, lastCodeSegmentEnd, lines, widget, window); +// lastCodeSegmentStart = block; +// } + +// lastCodeSegmentEnd = block; + +// if (block.YEnd < 0) +// continue; + +// // Draw the block background +// DrawBlockBg (ctx, cell_area.X + 1, cell_area.Width - 2, block); + +// // Get all text for the current block +// var sb = new StringBuilder (); +// bool replaceFirst = false; +// int subLine = 0; +// for (int n = block.FirstLine; n <= block.LastLine; n++) { +// string s = ProcessLine (lines [n]); +// if (n > block.FirstLine) +// sb.Append ('\n'); +// if ((block.Type == BlockType.Added || block.Type == BlockType.Removed) && s.Length > 0) { +// sb.Append (' '); +// sb.Append (s, 1, s.Length - 1); +// replaceFirst = true; +// } else +// sb.Append (s); +// int idx = 0, curIdx = 0; +// while ((idx = s.IndexOf ('\n')) >= 0) { +// var y1 = block.YStart + subLine * lineHeight; +// if (y1 < cell_area.Bottom && y1 + lineHeight >= e.Area.Y && y1 < e.Area.Bottom) +// AddAccessibleLine (cell_area.X + 2 + LeftPaddingBlock, y1, block.Type, block.FirstLine + n + subLine, ref replaceFirst, s.Substring (curIdx, idx)); +// subLine++; +// curIdx = idx; +// } +// var y2 = block.YStart + subLine * lineHeight; +// if (y2 < cell_area.Bottom && y2 + lineHeight >= e.Area.Y && y2 < e.Area.Bottom) +// AddAccessibleLine (cell_area.X + 2 + LeftPaddingBlock, y2, block.Type, block.FirstLine + n + subLine, ref replaceFirst, curIdx > 0 ? s.Substring (curIdx) : s); +// subLine++; +// } + +// // Draw a special background for the selected line +// if (px < 0) { +// selectedLine = selectedLineRowTop = -1; +// } else if (block.Type != BlockType.Info && px >= cell_area.X && py <= cell_area.Right && py >= block.YStart && py <= block.YEnd) { +// int row = (py - block.YStart) / lineHeight; +// double yrow = block.YStart + lineHeight * row; +// double xrow = cell_area.X + LeftPaddingBlock; +// int wrow = cell_area.Width - 1 - LeftPaddingBlock; +// if (block.Type == BlockType.Added) +// ctx.SetSourceColor (Styles.LogView.DiffAddBackgroundColor.AddLight (0.1).ToCairoColor ()); +// else if (block.Type == BlockType.Removed) +// ctx.SetSourceColor (Styles.LogView.DiffRemoveBackgroundColor.AddLight (0.1).ToCairoColor ()); +// else { +// ctx.SetSourceColor (Styles.LogView.DiffHighlightColor.ToCairoColor ()); +// xrow -= LeftPaddingBlock; +// wrow += LeftPaddingBlock; +// } +// ctx.Rectangle (xrow, yrow, wrow, lineHeight); +// ctx.Fill (); +// selectedLine = block.SourceLineStart + row; +// // selctedPath = path; +// selectedLineRowTop = (int)yrow; +// } + +// // Draw the line text. Ignore header blocks, since they are drawn as labels in DrawCodeSegmentBorder + +// if (block.Type != BlockType.Info) { +// layout.SetMarkup (""); +// layout.SetText (sb.ToString ()); +// Gdk.GC gc; +// switch (block.Type) { +// case BlockType.Removed: gc = removedGC; break; +// case BlockType.Added: gc = addedGC; break; +// case BlockType.Info: gc = infoGC; break; +// default: gc = normalGC; break; +// } +// window.DrawLayout (gc, cell_area.X + 2 + LeftPaddingBlock, block.YStart, layout); +// } + +// // Finally draw the change symbol at the left margin + +// DrawChangeSymbol (ctx, widget, cell_area.X + 1, cell_area.Width - 2, block); +// } + +// // Finish the drawing of the code segment +// if (lastCodeSegmentStart != null) +// DrawCodeSegmentBorder (infoGC, ctx, cell_area.X, cell_area.Width, lastCodeSegmentStart, lastCodeSegmentEnd, lines, widget, window); + +// // Draw the source line number at the current selected line. It must be done at the end because it must +// // be drawn over the source code text and segment borders. +// if (selectedLineRowTop != -1) +// DrawLineBox (normalGC, ctx, Allocation.Right - 4, selectedLineRowTop, selectedLine, widget, window); + +// ((IDisposable)ctx).Dispose (); +// removedGC.Dispose (); +// addedGC.Dispose (); +// infoGC.Dispose (); +// } +// Accessible?.SetAccessibleChildren (accessibleLines.Select (l => l.Accessible).ToArray ()); +// return true; +// } void AddAccessibleLine (int x, int y, BlockType blockType, int lineNumber, ref bool replaceFirst, string text) { @@ -431,65 +431,65 @@ enum BlockType Unchanged } - void DrawCodeSegmentBorder (Gdk.GC gc, Cairo.Context ctx, double x, int width, BlockInfo firstBlock, BlockInfo lastBlock, string [] lines, Gtk.Widget widget, Gdk.Drawable window) - { - int shadowSize = 2; - int spacing = 4; - int bottomSpacing = (lineHeight - spacing) / 2; - - ctx.Rectangle (x + shadowSize + 0.5, firstBlock.YStart + bottomSpacing + spacing - shadowSize + 0.5, width - shadowSize * 2, shadowSize); - ctx.SetSourceColor (Styles.LogView.DiffBoxSplitterColor.ToCairoColor ()); - ctx.LineWidth = 1; - ctx.Fill (); - - ctx.Rectangle (x + shadowSize + 0.5, lastBlock.YEnd + bottomSpacing + 0.5, width - shadowSize * 2, shadowSize); - ctx.SetSourceColor (Styles.LogView.DiffBoxSplitterColor.ToCairoColor ()); - ctx.Fill (); - - ctx.Rectangle (x + 0.5, firstBlock.YStart + bottomSpacing + spacing + 0.5, width, lastBlock.YEnd - firstBlock.YStart - spacing); - ctx.SetSourceColor (Styles.LogView.DiffBoxBorderColor.ToCairoColor ()); - ctx.Stroke (); - - string text = lines [firstBlock.FirstLine].Replace ("@", "").Replace ("-", ""); - text = "" + text.Replace ("+", " ") + ""; - - layout.SetText (""); - layout.SetMarkup (text); - int tw, th; - layout.GetPixelSize (out tw, out th); - th--; - - int dy = (lineHeight - th) / 2; - - ctx.Rectangle (x + 2 + LeftPaddingBlock - 1 + 0.5, firstBlock.YStart + dy - 1 + 0.5, tw + 2, th + 2); - ctx.LineWidth = 1; - ctx.SetSourceColor (widget.Style.Base (StateType.Normal).ToCairoColor ()); - ctx.FillPreserve (); - ctx.SetSourceColor (Styles.LogView.DiffBoxBorderColor.ToCairoColor ()); - ctx.Stroke (); - - window.DrawLayout (gc, (int)(x + 2 + LeftPaddingBlock), firstBlock.YStart + dy, layout); - } - - void DrawLineBox (Gdk.GC gc, Cairo.Context ctx, int right, int top, int line, Gtk.Widget widget, Gdk.Drawable window) - { - layout.SetText (""); - layout.SetMarkup ("" + line.ToString () + ""); - int tw, th; - layout.GetPixelSize (out tw, out th); - th--; - - int dy = (lineHeight - th) / 2; - - ctx.Rectangle (right - tw - 2 + 0.5, top + dy - 1 + 0.5, tw + 2, th + 2); - ctx.LineWidth = 1; - ctx.SetSourceColor (widget.Style.Base (Gtk.StateType.Normal).ToCairoColor ()); - ctx.FillPreserve (); - ctx.SetSourceColor (Styles.LogView.DiffBoxBorderColor.ToCairoColor ()); - ctx.Stroke (); - - window.DrawLayout (gc, right - tw - 1, top + dy, layout); - } + // void DrawCodeSegmentBorder (Gdk.GC gc, Cairo.Context ctx, double x, int width, BlockInfo firstBlock, BlockInfo lastBlock, string [] lines, Gtk.Widget widget, Gdk.Drawable window) + // { + // int shadowSize = 2; + // int spacing = 4; + // int bottomSpacing = (lineHeight - spacing) / 2; + + // ctx.Rectangle (x + shadowSize + 0.5, firstBlock.YStart + bottomSpacing + spacing - shadowSize + 0.5, width - shadowSize * 2, shadowSize); + // ctx.SetSourceColor (Styles.LogView.DiffBoxSplitterColor.ToCairoColor ()); + // ctx.LineWidth = 1; + // ctx.Fill (); + + // ctx.Rectangle (x + shadowSize + 0.5, lastBlock.YEnd + bottomSpacing + 0.5, width - shadowSize * 2, shadowSize); + // ctx.SetSourceColor (Styles.LogView.DiffBoxSplitterColor.ToCairoColor ()); + // ctx.Fill (); + + // ctx.Rectangle (x + 0.5, firstBlock.YStart + bottomSpacing + spacing + 0.5, width, lastBlock.YEnd - firstBlock.YStart - spacing); + // ctx.SetSourceColor (Styles.LogView.DiffBoxBorderColor.ToCairoColor ()); + // ctx.Stroke (); + + // string text = lines [firstBlock.FirstLine].Replace ("@", "").Replace ("-", ""); + // text = "" + text.Replace ("+", " ") + ""; + + // layout.SetText (""); + // layout.SetMarkup (text); + // int tw, th; + // layout.GetPixelSize (out tw, out th); + // th--; + + // int dy = (lineHeight - th) / 2; + + // ctx.Rectangle (x + 2 + LeftPaddingBlock - 1 + 0.5, firstBlock.YStart + dy - 1 + 0.5, tw + 2, th + 2); + // ctx.LineWidth = 1; + // ctx.SetSourceColor (widget.Style.Base (StateType.Normal).ToCairoColor ()); + // ctx.FillPreserve (); + // ctx.SetSourceColor (Styles.LogView.DiffBoxBorderColor.ToCairoColor ()); + // ctx.Stroke (); + + // window.DrawLayout (gc, (int)(x + 2 + LeftPaddingBlock), firstBlock.YStart + dy, layout); + // } + + // void DrawLineBox (Gdk.GC gc, Cairo.Context ctx, int right, int top, int line, Gtk.Widget widget, Gdk.Drawable window) + // { + // layout.SetText (""); + // layout.SetMarkup ("" + line.ToString () + ""); + // int tw, th; + // layout.GetPixelSize (out tw, out th); + // th--; + + // int dy = (lineHeight - th) / 2; + + // ctx.Rectangle (right - tw - 2 + 0.5, top + dy - 1 + 0.5, tw + 2, th + 2); + // ctx.LineWidth = 1; + // ctx.SetSourceColor (widget.Style.Base (Gtk.StateType.Normal).ToCairoColor ()); + // ctx.FillPreserve (); + // ctx.SetSourceColor (Styles.LogView.DiffBoxBorderColor.ToCairoColor ()); + // ctx.Stroke (); + + // window.DrawLayout (gc, right - tw - 1, top + dy, layout); + // } void DrawBlockBg (Cairo.Context ctx, double x, int width, BlockInfo block) { diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.DiffScrollbar.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.DiffScrollbar.cs index fd3abbd0b05..d9857c3dcbc 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.DiffScrollbar.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.DiffScrollbar.cs @@ -98,60 +98,60 @@ protected override bool OnButtonPressEvent (EventButton evnt) return base.OnButtonPressEvent (evnt); } - protected override bool OnButtonReleaseEvent (EventButton evnt) - { - button &= ~evnt.Button; - return base.OnButtonReleaseEvent (evnt); - } - - protected override bool OnExposeEvent (Gdk.EventExpose e) - { - if (widget.LeftDiff == null) - return true; - var adj = widget.vAdjustment; - - var diff = useLeftDiff ? widget.LeftDiff : widget.RightDiff; - - using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { - cr.LineWidth = 1; - double curY = 0; - - foreach (var hunk in diff) { - double y, count; - if (paintInsert) { - y = hunk.InsertStart / (double)editor.LineCount; - count = hunk.Inserted / (double)editor.LineCount; - } else { - y = hunk.RemoveStart / (double)editor.LineCount; - count = hunk.Removed / (double)editor.LineCount; - } - - double start = y * Allocation.Height; - FillGradient (cr, 0.5 + curY, start - curY); - - curY = start; - double height = Math.Max (cr.LineWidth, count * Allocation.Height); - cr.Rectangle (0.5, 0.5 + curY, Allocation.Width, height); - cr.SetSourceColor (GetColor (hunk, !paintInsert, false, 1.0)); - cr.Fill (); - curY += height; - } - - FillGradient (cr, 0.5 + curY, Allocation.Height - curY); - - int barPadding = 3; - var allocH = Allocation.Height; - var adjUpper = adj.Upper; - var barY = allocH * adj.Value / adjUpper + barPadding; - var barH = allocH * (adj.PageSize / adjUpper) - barPadding - barPadding; - DrawBar (cr, barY, barH); - - cr.Rectangle (0.5, 0.5, Allocation.Width - 1, Allocation.Height - 1); - cr.SetSourceColor ((HslColor)Style.Dark (StateType.Normal)); - cr.Stroke (); - } - return true; - } + // protected override bool OnButtonReleaseEvent (EventButton evnt) + // { + // button &= ~evnt.Button; + // return base.OnButtonReleaseEvent (evnt); + // } + + // protected override bool OnExposeEvent (Gdk.EventExpose e) + // { + // if (widget.LeftDiff == null) + // return true; + // var adj = widget.vAdjustment; + + // var diff = useLeftDiff ? widget.LeftDiff : widget.RightDiff; + + // using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { + // cr.LineWidth = 1; + // double curY = 0; + + // foreach (var hunk in diff) { + // double y, count; + // if (paintInsert) { + // y = hunk.InsertStart / (double)editor.LineCount; + // count = hunk.Inserted / (double)editor.LineCount; + // } else { + // y = hunk.RemoveStart / (double)editor.LineCount; + // count = hunk.Removed / (double)editor.LineCount; + // } + + // double start = y * Allocation.Height; + // FillGradient (cr, 0.5 + curY, start - curY); + + // curY = start; + // double height = Math.Max (cr.LineWidth, count * Allocation.Height); + // cr.Rectangle (0.5, 0.5 + curY, Allocation.Width, height); + // cr.SetSourceColor (GetColor (hunk, !paintInsert, false, 1.0)); + // cr.Fill (); + // curY += height; + // } + + // FillGradient (cr, 0.5 + curY, Allocation.Height - curY); + + // int barPadding = 3; + // var allocH = Allocation.Height; + // var adjUpper = adj.Upper; + // var barY = allocH * adj.Value / adjUpper + barPadding; + // var barH = allocH * (adj.PageSize / adjUpper) - barPadding - barPadding; + // DrawBar (cr, barY, barH); + + // cr.Rectangle (0.5, 0.5, Allocation.Width - 1, Allocation.Height - 1); + // cr.SetSourceColor ((HslColor)Style.Dark (StateType.Normal)); + // cr.Stroke (); + // } + // return true; + // } void FillGradient (Cairo.Context cr, double y, double h) { diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.MiddleArea.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.MiddleArea.cs index aa4b7431c40..826391b6c72 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.MiddleArea.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.MiddleArea.cs @@ -253,120 +253,120 @@ static void DrawCross (Cairo.Context cr, double x, double y) cr.LineTo (x - 2, y + 3); } - protected override bool OnExposeEvent (EventExpose evnt) - { - bool hideButton = widget.MainEditor.Document.IsReadOnly; - using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) { - cr.Rectangle (evnt.Region.Clipbox.X, evnt.Region.Clipbox.Y, evnt.Region.Clipbox.Width, evnt.Region.Clipbox.Height); - cr.Clip (); - int delta = widget.MainEditor.Allocation.Y - Allocation.Y; - if (Diff != null) { - foreach (Hunk hunk in Diff) { - double z1 = delta + fromEditor.LineToY (hunk.RemoveStart) - fromEditor.VAdjustment.Value; - double z2 = delta + fromEditor.LineToY (hunk.RemoveStart + hunk.Removed) - fromEditor.VAdjustment.Value; - if (z1 == z2) - z2 = z1 + 1; - - double y1 = delta + toEditor.LineToY (hunk.InsertStart) - toEditor.VAdjustment.Value; - double y2 = delta + toEditor.LineToY (hunk.InsertStart + hunk.Inserted) - toEditor.VAdjustment.Value; - - if (y1 == y2) - y2 = y1 + 1; - - if (!useLeft) { - var tmp = z1; - z1 = y1; - y1 = tmp; - - tmp = z2; - z2 = y2; - y2 = tmp; - } - - int x1 = 0; - int x2 = Allocation.Width; - - if (!hideButton) { - if (useLeft && hunk.Removed > 0 || !useLeft && hunk.Removed == 0) { - x1 += 16; - } else { - x2 -= 16; - } - } - - if (z1 == z2) - z2 = z1 + 1; - - cr.MoveTo (x1, z1); - - cr.CurveTo (x1 + (x2 - x1) / 4, z1, - x1 + (x2 - x1) * 3 / 4, y1, - x2, y1); - - cr.LineTo (x2, y2); - cr.CurveTo (x1 + (x2 - x1) * 3 / 4, y2, - x1 + (x2 - x1) / 4, z2, - x1, z2); - cr.ClosePath (); - cr.SetSourceColor (GetColor (hunk, this.useLeft, false, 1.0)); - cr.Fill (); - - cr.SetSourceColor (GetColor (hunk, this.useLeft, true, 1.0)); - cr.MoveTo (x1, z1); - cr.CurveTo (x1 + (x2 - x1) / 4, z1, - x1 + (x2 - x1) * 3 / 4, y1, - x2, y1); - cr.Stroke (); - - cr.MoveTo (x2, y2); - cr.CurveTo (x1 + (x2 - x1) * 3 / 4, y2, - x1 + (x2 - x1) / 4, z2, - x1, z2); - cr.Stroke (); - - if (!hideButton) { - bool isButtonSelected = hunk == selectedHunk; - - double x, y, w, h; - bool drawArrow = useLeft ? GetButtonPosition (hunk, y1, y2, z1, z2, out x, out y, out w, out h) : - GetButtonPosition (hunk, z1, z2, y1, y2, out x, out y, out w, out h); - - cr.Rectangle (x, y, w, h); - if (isButtonSelected) { - int mx, my; - GetPointer (out mx, out my); - // mx -= (int)x; - // my -= (int)y; - using (var gradient = new Cairo.RadialGradient (mx, my, h, mx, my, 2)) { - var color = (MonoDevelop.Components.HslColor)Style.Mid (StateType.Normal); - color.L *= 1.05; - gradient.AddColorStop (0, color); - color.L *= 1.07; - gradient.AddColorStop (1, color); - cr.SetSource (gradient); - } - } else { - cr.SetSourceColor ((MonoDevelop.Components.HslColor)Style.Mid (StateType.Normal)); - } - cr.FillPreserve (); - - cr.SetSourceColor ((MonoDevelop.Components.HslColor)Style.Dark (StateType.Normal)); - cr.Stroke (); - cr.LineWidth = 1; - cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.BaseForegroundColor.ToCairoColor ()); - if (drawArrow) { - DrawArrow (cr, x + w / 1.5, y + h / 2); - DrawArrow (cr, x + w / 2.5, y + h / 2); - } else { - DrawCross (cr, x + w / 2, y + (h) / 2); - } - cr.Stroke (); - } - } - } - } - return true; - } + // protected override bool OnExposeEvent (EventExpose evnt) + // { + // bool hideButton = widget.MainEditor.Document.IsReadOnly; + // using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) { + // cr.Rectangle (evnt.Region.Clipbox.X, evnt.Region.Clipbox.Y, evnt.Region.Clipbox.Width, evnt.Region.Clipbox.Height); + // cr.Clip (); + // int delta = widget.MainEditor.Allocation.Y - Allocation.Y; + // if (Diff != null) { + // foreach (Hunk hunk in Diff) { + // double z1 = delta + fromEditor.LineToY (hunk.RemoveStart) - fromEditor.VAdjustment.Value; + // double z2 = delta + fromEditor.LineToY (hunk.RemoveStart + hunk.Removed) - fromEditor.VAdjustment.Value; + // if (z1 == z2) + // z2 = z1 + 1; + + // double y1 = delta + toEditor.LineToY (hunk.InsertStart) - toEditor.VAdjustment.Value; + // double y2 = delta + toEditor.LineToY (hunk.InsertStart + hunk.Inserted) - toEditor.VAdjustment.Value; + + // if (y1 == y2) + // y2 = y1 + 1; + + // if (!useLeft) { + // var tmp = z1; + // z1 = y1; + // y1 = tmp; + + // tmp = z2; + // z2 = y2; + // y2 = tmp; + // } + + // int x1 = 0; + // int x2 = Allocation.Width; + + // if (!hideButton) { + // if (useLeft && hunk.Removed > 0 || !useLeft && hunk.Removed == 0) { + // x1 += 16; + // } else { + // x2 -= 16; + // } + // } + + // if (z1 == z2) + // z2 = z1 + 1; + + // cr.MoveTo (x1, z1); + + // cr.CurveTo (x1 + (x2 - x1) / 4, z1, + // x1 + (x2 - x1) * 3 / 4, y1, + // x2, y1); + + // cr.LineTo (x2, y2); + // cr.CurveTo (x1 + (x2 - x1) * 3 / 4, y2, + // x1 + (x2 - x1) / 4, z2, + // x1, z2); + // cr.ClosePath (); + // cr.SetSourceColor (GetColor (hunk, this.useLeft, false, 1.0)); + // cr.Fill (); + + // cr.SetSourceColor (GetColor (hunk, this.useLeft, true, 1.0)); + // cr.MoveTo (x1, z1); + // cr.CurveTo (x1 + (x2 - x1) / 4, z1, + // x1 + (x2 - x1) * 3 / 4, y1, + // x2, y1); + // cr.Stroke (); + + // cr.MoveTo (x2, y2); + // cr.CurveTo (x1 + (x2 - x1) * 3 / 4, y2, + // x1 + (x2 - x1) / 4, z2, + // x1, z2); + // cr.Stroke (); + + // if (!hideButton) { + // bool isButtonSelected = hunk == selectedHunk; + + // double x, y, w, h; + // bool drawArrow = useLeft ? GetButtonPosition (hunk, y1, y2, z1, z2, out x, out y, out w, out h) : + // GetButtonPosition (hunk, z1, z2, y1, y2, out x, out y, out w, out h); + + // cr.Rectangle (x, y, w, h); + // if (isButtonSelected) { + // int mx, my; + // GetPointer (out mx, out my); + // // mx -= (int)x; + // // my -= (int)y; + // using (var gradient = new Cairo.RadialGradient (mx, my, h, mx, my, 2)) { + // var color = (MonoDevelop.Components.HslColor)Style.Mid (StateType.Normal); + // color.L *= 1.05; + // gradient.AddColorStop (0, color); + // color.L *= 1.07; + // gradient.AddColorStop (1, color); + // cr.SetSource (gradient); + // } + // } else { + // cr.SetSourceColor ((MonoDevelop.Components.HslColor)Style.Mid (StateType.Normal)); + // } + // cr.FillPreserve (); + + // cr.SetSourceColor ((MonoDevelop.Components.HslColor)Style.Dark (StateType.Normal)); + // cr.Stroke (); + // cr.LineWidth = 1; + // cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.BaseForegroundColor.ToCairoColor ()); + // if (drawArrow) { + // DrawArrow (cr, x + w / 1.5, y + h / 2); + // DrawArrow (cr, x + w / 2.5, y + h / 2); + // } else { + // DrawCross (cr, x + w / 2, y + (h) / 2); + // } + // cr.Stroke (); + // } + // } + // } + // } + // return true; + // } internal void Refresh () { diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.cs index 6bc907c6e00..75cb8fd7063 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.cs @@ -168,7 +168,7 @@ protected void Intialize () editor.DoPopupMenu += (e) => ShowPopup (editor, e); editor.Caret.PositionChanged += CaretPositionChanged; editor.FocusInEvent += EditorFocusIn; - editor.SetScrollAdjustments (attachedHAdjustments[i], attachedVAdjustments[i]); + //editor.SetScrollAdjustments (attachedHAdjustments[i], attachedVAdjustments[i]); } if (editors.Length == 2) { @@ -486,12 +486,12 @@ protected override void OnRemoved (Widget widget) protected override void OnDestroyed () { if (vAdjustment != null) { - vAdjustment.Destroy (); - hAdjustment.Destroy (); - foreach (var adj in attachedVAdjustments) - adj.Destroy (); - foreach (var adj in attachedHAdjustments) - adj.Destroy (); + //vAdjustment.Destroy (); + //hAdjustment.Destroy (); + //foreach (var adj in attachedVAdjustments) + //adj.Destroy (); + //foreach (var adj in attachedHAdjustments) + //adj.Destroy (); vAdjustment = null; } @@ -569,11 +569,11 @@ protected override bool OnScrollEvent (EventScroll evnt) return (dx != 0.0 || dy != 0.0) || base.OnScrollEvent (evnt); } - protected override void OnSizeRequested (ref Gtk.Requisition requisition) - { - base.OnSizeRequested (ref requisition); - children.ForEach (child => child.Child.SizeRequest ()); - } + // protected override void OnSizeRequested (ref Gtk.Requisition requisition) + // { + // base.OnSizeRequested (ref requisition); + // children.ForEach (child => child.Child.SizeRequest ()); + // } internal static Cairo.Color GetColor (Hunk hunk, bool removeSide, bool border, double alpha) { diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs index db403375cdc..8cb69892096 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs @@ -87,49 +87,49 @@ public bool LastNode { set; } - public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - { - x_offset = y_offset = 0; - width = 16; - height = cell_area.Height; - } - - protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - { - using (Cairo.Context cr = Gdk.CairoHelper.Create (window)) { - cr.LineWidth = 2.0; - double center_x = cell_area.X + Math.Round ((double) (cell_area.Width / 2d)); - double center_y = cell_area.Y + Math.Round ((double) (cell_area.Height / 2d)); - cr.Arc (center_x, center_y, 5, 0, 2 * Math.PI); - var state = StateType.Normal; - if (!base.Sensitive) - state = StateType.Insensitive; - else if (flags.HasFlag (CellRendererState.Selected)) { - if (widget.HasFocus) - state = StateType.Selected; - else - state = StateType.Active; - } - else if (flags.HasFlag (CellRendererState.Prelit)) - state = StateType.Prelight; - else if (widget.State == StateType.Insensitive) - state = StateType.Insensitive; - - cr.SetSourceColor (widget.Style.Text (state).ToCairoColor ()); - cr.Stroke (); - if (!FirstNode) { - cr.MoveTo (center_x, cell_area.Y - 2); - cr.LineTo (center_x, center_y - 5); - cr.Stroke (); - } - - if (!LastNode) { - cr.MoveTo (center_x, cell_area.Y + cell_area.Height + 2); - cr.LineTo (center_x, center_y + 5); - cr.Stroke (); - } - } - } + // public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + // { + // x_offset = y_offset = 0; + // width = 16; + // height = cell_area.Height; + // } + + // protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) + // { + // using (Cairo.Context cr = Gdk.CairoHelper.Create (window)) { + // cr.LineWidth = 2.0; + // double center_x = cell_area.X + Math.Round ((double) (cell_area.Width / 2d)); + // double center_y = cell_area.Y + Math.Round ((double) (cell_area.Height / 2d)); + // cr.Arc (center_x, center_y, 5, 0, 2 * Math.PI); + // var state = StateType.Normal; + // if (!base.Sensitive) + // state = StateType.Insensitive; + // else if (flags.HasFlag (CellRendererState.Selected)) { + // if (widget.HasFocus) + // state = StateType.Selected; + // else + // state = StateType.Active; + // } + // else if (flags.HasFlag (CellRendererState.Prelit)) + // state = StateType.Prelight; + // else if (widget.State == StateType.Insensitive) + // state = StateType.Insensitive; + + // cr.SetSourceColor (widget.Style.Text (state).ToCairoColor ()); + // cr.Stroke (); + // if (!FirstNode) { + // cr.MoveTo (center_x, cell_area.Y - 2); + // cr.LineTo (center_x, center_y - 5); + // cr.Stroke (); + // } + + // if (!LastNode) { + // cr.MoveTo (center_x, cell_area.Y + cell_area.Height + 2); + // cr.LineTo (center_x, center_y + 5); + // cr.Stroke (); + // } + // } + // } } public LogWidget (VersionControlDocumentInfo info) @@ -226,7 +226,7 @@ public LogWidget (VersionControlDocumentInfo info) colChangedFile.Title = GettextCatalog.GetString ("File"); colChangedFile.PackStart (crp, false); colChangedFile.PackStart (crt, true); - colChangedFile.SetCellDataFunc (crp, HandleNodeCellDataFunc); + //colChangedFile.SetCellDataFunc (crp, HandleNodeCellDataFunc); colChangedFile.AddAttribute (crt, "text", 3); treeviewFiles.AppendColumn (colChangedFile); @@ -289,14 +289,14 @@ public LogWidget (VersionControlDocumentInfo info) Ide.Gui.Styles.Changed += HandleStylesChanged; } - static void HandleNodeCellDataFunc (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) - { - var cri = (CellRendererImage)cell; - var image = tree_model.GetValue (iter, 2) as Xwt.Drawing.Image; - cri.Visible = image != null; - if (image != null) - cri.Image = image; - } + // static void HandleNodeCellDataFunc (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) + // { + // var cri = (CellRendererImage)cell; + // var image = tree_model.GetValue (iter, 2) as Xwt.Drawing.Image; + // cri.Visible = image != null; + // if (image != null) + // cri.Image = image; + // } [GLib.ConnectBeforeAttribute] void LabelRevision_ButtonPressEvent (object o, ButtonPressEventArgs args) @@ -583,7 +583,7 @@ await Runtime.RunInMainThread (delegate { protected override void OnDestroyed () { - IsDestroyed = true; + //IsDestroyed = true; selectionCancellationTokenSource.Cancel (); treeviewFiles.Selection.Changed -= SetDiff; @@ -617,15 +617,15 @@ static void DateFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk var revision = (Revision)model.GetValue (iter, 0); // Grab today's day and the start of tomorrow's day to make Today/Yesterday calculations. var now = DateTime.Now; - var age = new DateTime (now.Year, now.Month, now.Day).AddDays(1) - rev.Time; - if (age.Days >= 0 && age.Days < 1) { // Check whether it's a commit that's less than a day away. Also discard future commits. - day = GettextCatalog.GetString ("Today"); - } else if (age.Days < 2) { // Check whether it's a commit from yesterday. - day = GettextCatalog.GetString ("Yesterday"); - } else { - day = rev.Time.ToShortDateString (); - } - renderer.Text = string.Format ("{0} {1:HH:mm}", day, rev.Time); + // var age = new DateTime (now.Year, now.Month, now.Day).AddDays(1) - rev.Time; + // if (age.Days >= 0 && age.Days < 1) { // Check whether it's a commit that's less than a day away. Also discard future commits. + // day = GettextCatalog.GetString ("Today"); + // } else if (age.Days < 2) { // Check whether it's a commit from yesterday. + // day = GettextCatalog.GetString ("Yesterday"); + // } else { + // day = rev.Time.ToShortDateString (); + // } + //renderer.Text = string.Format ("{0} {1:HH:mm}", day, rev.Time); } static void GraphFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) @@ -777,8 +777,8 @@ void TreeSelectionChanged (object o, EventArgs args) selectionCancellationTokenSource = new CancellationTokenSource (); var token = selectionCancellationTokenSource.Token; Task.Run (async () => await info.Repository.GetRevisionChangesAsync (d, token)).ContinueWith (result => { - if (IsDestroyed) - return; + //if (IsDestroyed) + // return; changedpathstore.Clear (); revertButton.GetNativeWidget ().Sensitive = revertToButton.GetNativeWidget ().Sensitive = true; Gtk.TreeIter selectIter = Gtk.TreeIter.Zero; diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs index 52b9b859a82..0cae408926b 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs @@ -46,7 +46,7 @@ internal class StatusView : BaseView List statuses; bool remoteStatus = false; - class DiffData + class DiffData { public Exception Exception { get; private set; @@ -388,15 +388,15 @@ protected override void OnDispose () { disposed = true; if (colCommit != null) { - colCommit.Destroy (); + //colCommit.Destroy (); colCommit = null; } if (colRemote != null) { - colRemote.Destroy (); + //colRemote.Destroy (); colRemote = null; } if (colFile != null) { - colFile.Destroy (); + //colFile.Destroy (); colFile = null; } if (filelist != null) { @@ -411,11 +411,11 @@ protected override void OnDispose () } if (cellToggle != null) { cellToggle.Toggled -= OnCommitCellToggled; - cellToggle.Destroy (); + //cellToggle.Destroy (); cellToggle = null; } if (this.diffRenderer != null) { - this.diffRenderer.Destroy (); + //this.diffRenderer.Destroy (); this.diffRenderer = null; } VersionControlService.FileStatusChanged -= OnFileStatusChanged; @@ -631,8 +631,9 @@ TreeIter AppendFileInfo (VersionInfo n, bool expanded) TreeIter it = filestore.AppendValues (statusicon, lstatus, GLib.Markup.EscapeText (localpath).Split ('\n'), rstatus, commit, false, n.LocalPath.ToString (), true, hasComment, fileIcon, n.HasLocalChanges, rstatusicon, scolor, n.HasRemoteChange (VersionStatus.Modified)); if (!n.IsDirectory) - filestore.AppendValues (it, statusicon, "", new string[0], "", false, true, n.LocalPath.ToString (), false, false, fileIcon, false, null, null, false); - if (expanded) + filestore.AppendValues (it, statusicon, "", new string[0], "", false, true, n.LocalPath.ToString (), false, false, fileIcon, false, null, null, false); + + if (expanded) filelist.ExpandRow (filestore.GetPath (it), open_all: false); return it; diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj index 44f75e5d313..56e40a7b070 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj @@ -58,6 +58,12 @@ + + gio-sharp-3.0 + + + gtk-sharp-3.0 + ..\..\..\..\build\bin\System.Reflection.Metadata.dll False diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs index 2deaf44c190..b9e83ebadd6 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs @@ -1,8 +1,8 @@ using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using MonoDevelop.Components; +using MonoDevelop.Components; using MonoDevelop.Components.AtkCocoaHelper; using MonoDevelop.Core; @@ -27,8 +27,8 @@ public UrlBasedRepositoryEditor (UrlBasedRepository repo) protocols.AddRange (repo.SupportedNonUrlProtocols); this.repo = repo; - foreach (string p in protocols) - comboProtocol.AppendText (p); + //foreach (string p in protocols) + //comboProtocol.AppendText (p); updating = true; repositoryUrlEntry.Text = repo.Url; @@ -36,7 +36,7 @@ public UrlBasedRepositoryEditor (UrlBasedRepository repo) Fill (); UpdateControls (); updating = false; - SetupAccessibility (); + SetupAccessibility (); } Control IRepositoryEditor.Widget { diff --git a/main/tests/Ide.Tests/MonoDevelop.Ide.Gui/GLibLoggingTests.cs b/main/tests/Ide.Tests/MonoDevelop.Ide.Gui/GLibLoggingTests.cs index e6ef4d91889..9c6c35d86f7 100644 --- a/main/tests/Ide.Tests/MonoDevelop.Ide.Gui/GLibLoggingTests.cs +++ b/main/tests/Ide.Tests/MonoDevelop.Ide.Gui/GLibLoggingTests.cs @@ -48,10 +48,10 @@ public void ValidateCrashIsSentForGLibExceptions () LoggingService.RegisterCrashReporter (crashReporter); - GLib.Log.Write ("Gtk", GLib.LogLevelFlags.Warning, "{0}", "should not be captured"); + //GLib.Log.Write ("Gtk", GLib.LogLevelFlags.Warning, "{0}", "should not be captured"); Assert.IsNull (crashReporter.LastException); - GLib.Log.Write ("Gtk", GLib.LogLevelFlags.Critical, "{0}", "critical should be captured"); + //GLib.Log.Write ("Gtk", GLib.LogLevelFlags.Critical, "{0}", "critical should be captured"); Assert.That (crashReporter.LastException.Message, Contains.Substring ("critical should be captured")); Assert.That (crashReporter.LastException.Source, Is.Not.Null); @@ -85,7 +85,7 @@ public void GLibLoggingHaveFullStacktracesInLog () LoggingService.AddLogger (logger); try { - GLib.Log.Write ("Gtk", glibLevel, "{0}: should be captured", glibLevel); + //GLib.Log.Write ("Gtk", glibLevel, "{0}: should be captured", glibLevel); var (_, message) = logger.LogMessages.Single (x => x.Level == coreLevel); AssertGLibStackTrace (message); } finally { diff --git a/main/tests/Ide.Tests/MonoDevelop.Ide.Tests.csproj b/main/tests/Ide.Tests/MonoDevelop.Ide.Tests.csproj index 9e7ca507cfd..09ab0762822 100644 --- a/main/tests/Ide.Tests/MonoDevelop.Ide.Tests.csproj +++ b/main/tests/Ide.Tests/MonoDevelop.Ide.Tests.csproj @@ -23,6 +23,9 @@ + + gio-sharp-3.0 + diff --git a/start.sh b/start.sh new file mode 100755 index 00000000000..73b14ffea0c --- /dev/null +++ b/start.sh @@ -0,0 +1,2 @@ +export MSBuildEnableWorkloadResolver=false +mono ./main/build/bin/MonoDevelop.exe --no-redirect From f38304190a19e18d0697667ab8e078a34fc94075 Mon Sep 17 00:00:00 2001 From: makiwolf Date: Sat, 30 Dec 2023 20:34:27 +0100 Subject: [PATCH 156/382] fix startup --- .../MonoDevelop.Ide/MonoDevelop.Ide.csproj | 14 +- mono_crash.mem.17067.1.blob | 3338 +++++++++++++++++ 2 files changed, 3347 insertions(+), 5 deletions(-) create mode 100644 mono_crash.mem.17067.1.blob diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj index 6c2a317a0ba..f4ba902a5b2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj @@ -77,7 +77,7 @@ - + @@ -120,10 +120,10 @@ {C3887A93-B2BD-4097-8E2F-3A063EFF32FD} Xwt.Gtk --> - + {91DD5A2D-9FE3-4C3C-9253-876141874DAD} Mono.Addins @@ -156,10 +156,10 @@ {288994D1-C7E1-4740-99AB-A52B572EBA8A} MonoDevelop.GtkExtensions - + {410A7DC9-E7DA-43E6-B592-93E2A344B660} Mono.Addins.GuiGtk3 @@ -170,6 +170,10 @@ {FED3E127-B64A-4E57-8D2A-C8817C5D593A} Xwt.Gtk2 --> + + {FED3E127-B64A-4E57-8D2A-C8817C5D593A} + Xwt.Gtk3 + {FEC19BDA-4904-4005-8C09-68E82E8BEF6A} Mono.Addins.Gui diff --git a/mono_crash.mem.17067.1.blob b/mono_crash.mem.17067.1.blob new file mode 100644 index 00000000000..fdd77f1ea5a --- /dev/null +++ b/mono_crash.mem.17067.1.blob @@ -0,0 +1,3338 @@ +{ + "protocol_version" : "0.0.6", + "configuration" : { + "version" : "(6.12.0.200) (tarball)", + "tlc" : "__thread", + "sigsgev" : "altstack", + "notifications" : "epoll", + "architecture" : "amd64", + "disabled_features" : "none", + "smallconfig" : "disabled", + "bigarrays" : "disabled", + "softdebug" : "enabled", + "interpreter" : "enabled", + "llvm_support" : "610", + "suspend" : "hybrid" + }, + "memory" : { + "minor_gc_time" : "70254239", + "major_gc_time" : "46029374", + "minor_gc_count" : "1144", + "major_gc_count" : "69", + "major_gc_time_concurrent" : "214147554" + }, + "threads" : [ + { + "is_managed" : false, + "offset_free_hash" : "0x0", + "offset_rich_hash" : "0x0", + "crashed" : false, + "native_thread_id" : "0x7fd9d3fff6c0", + "thread_info_addr" : "0x7fd9c4000b70", + "thread_name" : "Thread Pool Wor", + "ctx" : { + "IP" : "0x7fda39094076", + "SP" : "0x7fd9d3ffec60", + "BP" : "(nil)" + }, + "unmanaged_frames" : [ + { + "is_managed" : "false", + "native_address" : "0x55aec8c6fd92", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8e664c9", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8e676d2", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8e70bd7", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8cc44df", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fda39042910", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fda39094076", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fda3909fa0b", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8ec2cc8", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8e7048a", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fda39097ada", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fda3912847c", + "native_offset" : "0x00000" + } + + ] + }, + { + "is_managed" : false, + "offset_free_hash" : "0x0", + "offset_rich_hash" : "0x0", + "crashed" : false, + "native_thread_id" : "0x7fd9f59ff6c0", + "thread_info_addr" : "0x7fd9cc018830", + "thread_name" : "Thread Pool Wor", + "ctx" : { + "IP" : "0x7fda39094076", + "SP" : "0x7fd9f59fec60", + "BP" : "(nil)" + }, + "unmanaged_frames" : [ + { + "is_managed" : "false", + "native_address" : "0x55aec8c6fd92", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8e664c9", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8e676d2", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8e70bd7", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8cc44df", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fda39042910", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fda39094076", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fda3909fa0b", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8ec2cc8", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8e7048a", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fda39097ada", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fda3912847c", + "native_offset" : "0x00000" + } + + ] + }, + { + "is_managed" : true, + "offset_free_hash" : "0x36fc6f37d", + "offset_rich_hash" : "0x36fc6f418", + "crashed" : false, + "native_thread_id" : "0x7fda11bff6c0", + "thread_info_addr" : "0x7fd9f0000b70", + "thread_name" : "Timer-Scheduler", + "ctx" : { + "IP" : "0x7fda39094076", + "SP" : "0x7fda11bfdef0", + "BP" : "(nil)" + }, + "managed_frames" : [ + { + "is_managed" : "false", + "native_address" : "unregistered" + } +, + { + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x00000", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x6001ec3", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00071" + } +, + { + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x6001ec1", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x00000", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x0002a" + } + + ], + "unmanaged_frames" : [ + { + "is_managed" : "false", + "native_address" : "0x55aec8c6fd92", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8e664c9", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8e676d2", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8e70bd7", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8cc44df", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fda39042910", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fda39094076", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fda39096e7a", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8f1e41e", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8e7b60a", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8e7cc7b", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8e7d4a0", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8e6d92a", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x55aec8e022c6", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x00000", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00000" + } + + ] +}, +{ + "is_managed" : true, + "offset_free_hash" : "0x90c392b48", + "offset_rich_hash" : "0x90c392d00", + "crashed" : false, + "native_thread_id" : "0x7fd9e8e486c0", + "thread_info_addr" : "0x7fd9d401ae60", + "thread_name" : "Thread Pool Wor", + "ctx" : { + "IP" : "0x7fda3911a75c", + "SP" : "0x7fd9e8e47360", + "BP" : "0x7fda04bb05e0" + }, + "managed_frames" : [ + { + "is_managed" : "false", + "native_address" : "unregistered" + } +, + { + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x00000", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x600229a", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x0002b" + } +, + { + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x6002394", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x6002397", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x6001ec3", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00071" + } +, + { + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x6001ec1", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x6002400", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00034" + } +, + { + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x6002396", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x0004a" + } +, + { + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x6002395", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x6001fcf", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00074" + } +, + { + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x6001fe4", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x00000", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x0002a" + } + + ], +"unmanaged_frames" : [ +{ + "is_managed" : "false", + "native_address" : "0x55aec8c6fd92", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8e664c9", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8e676d2", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8e70bd7", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8cc44df", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x7fda39042910", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x7fda3911a75c", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8d9794d", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8d95c7f", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8ec7153", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8df1955", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x00000", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00000" + } + +] +}, +{ +"is_managed" : false, +"offset_free_hash" : "0x0", +"offset_rich_hash" : "0x0", +"crashed" : false, +"native_thread_id" : "0x7fda1c3da6c0", +"thread_info_addr" : "0x7fd9f8000b70", +"thread_name" : "Thread Pool Wor", +"ctx" : { + "IP" : "0x7fda39094076", + "SP" : "0x7fda1c3d9c60", + "BP" : "(nil)" +}, +"unmanaged_frames" : [ +{ + "is_managed" : "false", + "native_address" : "0x55aec8c6fd92", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8e664c9", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8e676d2", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8e70bd7", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8cc44df", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x7fda39042910", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x7fda39094076", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x7fda3909fa0b", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8ec2cc8", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8e7048a", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x7fda39097ada", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x7fda3912847c", + "native_offset" : "0x00000" + } + +] +}, +{ +"is_managed" : false, +"offset_free_hash" : "0x0", +"offset_rich_hash" : "0x0", +"crashed" : false, +"native_thread_id" : "0x7fda1c5db6c0", +"thread_info_addr" : "0x7fda04000b70", +"thread_name" : "Thread Pool Wor", +"ctx" : { + "IP" : "0x7fda39094076", + "SP" : "0x7fda1c5dac60", + "BP" : "(nil)" +}, +"unmanaged_frames" : [ +{ + "is_managed" : "false", + "native_address" : "0x55aec8c6fd92", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8e664c9", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8e676d2", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8e70bd7", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8cc44df", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x7fda39042910", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x7fda39094076", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x7fda3909fa0b", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8ec2cc8", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x55aec8e7048a", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x7fda39097ada", + "native_offset" : "0x00000" + } +, +{ + "is_managed" : "false", + "native_address" : "0x7fda3912847c", + "native_offset" : "0x00000" + } + +] +}, +{ +"is_managed" : true, +"offset_free_hash" : "0x4d6e37bfa", +"offset_rich_hash" : "0x4d6e37d09", +"crashed" : false, +"native_thread_id" : "0x7fd9ac1fd6c0", +"thread_info_addr" : "0x7fd9c0003080", +"thread_name" : "Thread Pool Wor", +"ctx" : { + "IP" : "0x7fda39094076", + "SP" : "0x7fd9ac1fbcb0", + "BP" : "(nil)" +}, +"managed_frames" : [ +{ + "is_managed" : "false", + "native_address" : "unregistered" + } +, +{ + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x00000", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00000" + } +, +{ + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x6001ec3", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00071" + } +, +{ + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x6001ec1", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00000" + } +, +{ + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x6001fcf", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00074" + } +, +{ + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x6001fe4", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x00000" + } +, +{ + "is_managed" : "true", + "guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", + "token" : "0x00000", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xa6cb1fcf", + "il_offset" : "0x0002a" + } + +], +"unmanaged_frames" : [ +{ +"is_managed" : "false", +"native_address" : "0x55aec8c6fd92", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e664c9", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e676d2", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e70bd7", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8cc44df", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39042910", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39094076", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39096e7a", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8f1e41e", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e7add8", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e7d44b", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e6d92a", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e022c6", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} + +] +}, +{ +"is_managed" : true, +"offset_free_hash" : "0x9dd098c5c", +"offset_rich_hash" : "0x9dd0990f0", +"crashed" : false, +"native_thread_id" : "0x7fd9e99fe6c0", +"thread_info_addr" : "0x7fd9e001e3f0", +"thread_name" : "GUI Thread", +"ctx" : { +"IP" : "0x7fda3911a75c", +"SP" : "0x7fd9e99fd380", +"BP" : "0x19" +}, +"managed_frames" : [ +{ +"is_managed" : "false", +"native_address" : "unregistered" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x6003e13", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x00012" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x60041b7", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x00027" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x60041b6", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x002d1" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x60043ac", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6002394", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6002397", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001ec3", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00071" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001ec1", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6002400", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00034" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6002396", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x0004a" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001ec3", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00071" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001ec1", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x0002a" +} + +], +"unmanaged_frames" : [ +{ +"is_managed" : "false", +"native_address" : "0x55aec8c6fd92", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e664c9", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e676d2", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e70bd7", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8cc44df", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39042910", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda3911a75c", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda362e5a8f", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda362e4586", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x00000" +} + +] +}, +{ +"is_managed" : true, +"offset_free_hash" : "0x79a3ed8f2", +"offset_rich_hash" : "0x79a3edaea", +"crashed" : false, +"native_thread_id" : "0x7fd9d270f6c0", +"thread_info_addr" : "0x7fd9c0000b70", +"thread_name" : "Roslyn Diagnost", +"ctx" : { +"IP" : "0x7fda39094076", +"SP" : "0x7fd9d270e270", +"BP" : "(nil)" +}, +"managed_frames" : [ +{ +"is_managed" : "false", +"native_address" : "unregistered" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001eee", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x0000e" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001e3f", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x000d9" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x6003b7f", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x00067" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x6003b7e", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x00006" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x6003b79", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x00009" +} +, +{ +"is_managed" : "true", +"guid" : "16798100-89BC-4808-B72F-200DB6927716", +"token" : "0x6000e99", +"native_offset" : "0x0", +"filename" : "Microsoft.CodeAnalysis.Features.dll", +"sizeofimage" : "0x2f6000", +"timestamp" : "0xe0892aa9", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001ec3", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00071" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001ec1", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x0002a" +} + +], +"unmanaged_frames" : [ +{ +"is_managed" : "false", +"native_address" : "0x55aec8c6fd92", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e664c9", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e676d2", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e70bd7", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8cc44df", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39042910", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39094076", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda390969fe", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8f1e478", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e7b60a", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e7cc0a", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8eb6cee", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8dfff4b", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} + +] +}, +{ +"is_managed" : false, +"offset_free_hash" : "0x0", +"offset_rich_hash" : "0x0", +"crashed" : false, +"native_thread_id" : "0x7fda1f6fa6c0", +"thread_info_addr" : "0x7fda0c000f00", +"thread_name" : "Thread Pool Wor", +"ctx" : { +"IP" : "0x7fda39094076", +"SP" : "0x7fda1f6f9c60", +"BP" : "(nil)" +}, +"unmanaged_frames" : [ +{ +"is_managed" : "false", +"native_address" : "0x55aec8c6fd92", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e664c9", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e676d2", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e70bd7", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8cc44df", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39042910", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39094076", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda3909fa0b", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8ec2cc8", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e7048a", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39097ada", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda3912847c", +"native_offset" : "0x00000" +} + +] +}, +{ +"is_managed" : true, +"offset_free_hash" : "0x3add0cede", +"offset_rich_hash" : "0x3add0cfe1", +"crashed" : false, +"native_thread_id" : "0x7fd9f71fe6c0", +"thread_info_addr" : "0x7fda0842ed10", +"thread_name" : "NuGet backgroun", +"ctx" : { +"IP" : "0x7fda39094076", +"SP" : "0x7fd9f71fceb0", +"BP" : "(nil)" +}, +"managed_frames" : [ +{ +"is_managed" : "false", +"native_address" : "unregistered" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "4E39CF92-CDEA-4417-8C92-B105794730C2", +"token" : "0x600056c", +"native_offset" : "0x0", +"filename" : "MonoDevelop.PackageManagement.dll", +"sizeofimage" : "0xc0000", +"timestamp" : "0xb1636e97", +"il_offset" : "0x00068" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001ec3", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00071" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001ec1", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x0002a" +} + +], +"unmanaged_frames" : [ +{ +"is_managed" : "false", +"native_address" : "0x55aec8c6fd92", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e664c9", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e676d2", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e70bd7", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8cc44df", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39042910", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39094076", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda390969fe", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8f1e478", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e7b60a", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e7cc0a", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e7d4a0", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e6d92a", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e022c6", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} + +] +}, +{ +"is_managed" : false, +"offset_free_hash" : "0x0", +"offset_rich_hash" : "0x0", +"crashed" : false, +"native_thread_id" : "0x7fd9ac3fe6c0", +"thread_info_addr" : "0x55aecf470a00", +"thread_name" : "Thread Pool Wor", +"ctx" : { +"IP" : "0x7fda39094076", +"SP" : "0x7fd9ac3fdc60", +"BP" : "(nil)" +}, +"unmanaged_frames" : [ +{ +"is_managed" : "false", +"native_address" : "0x55aec8c6fd92", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e664c9", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e676d2", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e70bd7", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8cc44df", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39042910", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39094076", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda3909fa0b", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8ec2cc8", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e7048a", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39097ada", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda3912847c", +"native_offset" : "0x00000" +} + +] +}, +{ +"is_managed" : false, +"offset_free_hash" : "0x0", +"offset_rich_hash" : "0x0", +"crashed" : false, +"native_thread_id" : "0x7fd9ac9ff6c0", +"thread_info_addr" : "0x7fda24009420", +"thread_name" : "Thread Pool Wor", +"ctx" : { +"IP" : "0x7fda39094076", +"SP" : "0x7fd9ac9fec60", +"BP" : "(nil)" +}, +"unmanaged_frames" : [ +{ +"is_managed" : "false", +"native_address" : "0x55aec8c6fd92", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e664c9", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e676d2", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e70bd7", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8cc44df", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39042910", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39094076", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda3909fa0b", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8ec2cc8", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e7048a", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39097ada", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda3912847c", +"native_offset" : "0x00000" +} + +] +}, +{ +"is_managed" : true, +"offset_free_hash" : "0x79a3ed8f2", +"offset_rich_hash" : "0x79a3edaea", +"crashed" : false, +"native_thread_id" : "0x7fd9d29106c0", +"thread_info_addr" : "0x7fd9bc000b70", +"thread_name" : "Roslyn Diagnost", +"ctx" : { +"IP" : "0x7fda39094076", +"SP" : "0x7fd9d290f270", +"BP" : "(nil)" +}, +"managed_frames" : [ +{ +"is_managed" : "false", +"native_address" : "unregistered" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001eee", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x0000e" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001e3f", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x000d9" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x6003b7f", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x00067" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x6003b7e", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x00006" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x6003b79", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x00009" +} +, +{ +"is_managed" : "true", +"guid" : "16798100-89BC-4808-B72F-200DB6927716", +"token" : "0x6000e99", +"native_offset" : "0x0", +"filename" : "Microsoft.CodeAnalysis.Features.dll", +"sizeofimage" : "0x2f6000", +"timestamp" : "0xe0892aa9", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001ec3", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00071" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001ec1", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x0002a" +} + +], +"unmanaged_frames" : [ +{ +"is_managed" : "false", +"native_address" : "0x55aec8c6fd92", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e664c9", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e676d2", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e70bd7", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8cc44df", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39042910", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39094076", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda390969fe", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8f1e478", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e7b60a", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e7cc0a", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8eb6cee", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8dfff4b", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} + +] +}, +{ +"is_managed" : true, +"offset_free_hash" : "0x9dd098c5c", +"offset_rich_hash" : "0x9dd0990f0", +"crashed" : false, +"native_thread_id" : "0x7fd9ac5ff6c0", +"thread_info_addr" : "0x7fd9d4511290", +"thread_name" : "Thread Pool Wor", +"ctx" : { +"IP" : "0x7fda3911a75c", +"SP" : "0x7fd9ac5fe380", +"BP" : "0x64" +}, +"managed_frames" : [ +{ +"is_managed" : "false", +"native_address" : "unregistered" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x6003e13", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x00012" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x60041b7", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x00027" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x60041b6", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x002d1" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x60043ac", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6002394", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6002397", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001ec3", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00071" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001ec1", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6002400", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00034" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6002396", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x0004a" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001ec3", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00071" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001ec1", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x0002a" +} + +], +"unmanaged_frames" : [ +{ +"is_managed" : "false", +"native_address" : "0x55aec8c6fd92", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e664c9", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e676d2", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e70bd7", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8cc44df", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39042910", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda3911a75c", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda362e5a8f", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda362e4586", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "A8A996A7-8A80-4D88-8710-C9E2575D78C8", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "System.dll", +"sizeofimage" : "0x286000", +"timestamp" : "0xdb2dd36c", +"il_offset" : "0x00000" +} + +] +}, +{ +"is_managed" : false, +"offset_free_hash" : "0x0", +"offset_rich_hash" : "0x0", +"crashed" : false, +"native_thread_id" : "0x7fd9aaffc6c0", +"thread_info_addr" : "0x7fd9fc8f7500", +"thread_name" : "Thread Pool I/O", +"ctx" : { +"IP" : "0x7fda3911a18f", +"SP" : "0x7fd9aaffbc80", +"BP" : "0x55aec8e74500" +}, +"unmanaged_frames" : [ +{ +"is_managed" : "false", +"native_address" : "0x55aec8c6fd92", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e664c9", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e676d2", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e70bd7", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8cc44df", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39042910", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda3911a18f", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e73c99", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e7504b", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e7048a", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39097ada", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda3912847c", +"native_offset" : "0x00000" +} + +] +}, +{ +"is_managed" : false, +"offset_free_hash" : "0x0", +"offset_rich_hash" : "0x0", +"crashed" : false, +"native_thread_id" : "0x7fda355ff6c0", +"thread_info_addr" : "0x7fda30000b70", +"thread_name" : "Finalizer", +"ctx" : { +"IP" : "0x7fda39094076", +"SP" : "0x7fda355fece0", +"BP" : "(nil)" +}, +"unmanaged_frames" : [ +{ +"is_managed" : "false", +"native_address" : "0x55aec8c6fd92", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e664c9", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e676d2", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e70bd7", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8cc44df", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39042910", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39094076", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda3909fc20", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8eb2a88", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e7048a", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39097ada", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda3912847c", +"native_offset" : "0x00000" +} + +] +}, +{ +"is_managed" : false, +"offset_free_hash" : "0x0", +"offset_rich_hash" : "0x0", +"crashed" : false, +"native_thread_id" : "0x7fda1db8b6c0", +"thread_info_addr" : "0x7fd9ccc8b3a0", +"thread_name" : "Thread Pool I/O", +"ctx" : { +"IP" : "0x7fda39094076", +"SP" : "0x7fda1db8ab50", +"BP" : "(nil)" +}, +"unmanaged_frames" : [ +{ +"is_managed" : "false", +"native_address" : "0x55aec8c6fd92", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e664c9", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e676d2", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e70bd7", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8cc44df", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39042910", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39094076", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39096e7a", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8f1e41e", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8f291f9", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8ec3963", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e7048a", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39097ada", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda3912847c", +"native_offset" : "0x00000" +} + +] +}, +{ +"is_managed" : true, +"offset_free_hash" : "0x9bc96e8cc", +"offset_rich_hash" : "0x9bc96f6a7", +"crashed" : true, +"native_thread_id" : "0x7fda396bd2c0", +"thread_info_addr" : "0x55aecaefd630", +"thread_name" : "GUI Thread", +"ctx" : { +"IP" : "0x7fda2ff22c62", +"SP" : "0x7ffc0e74d248", +"BP" : "0x55aecd4fca80" +}, +"managed_frames" : [ +{ +"is_managed" : "false", +"native_address" : "unregistered" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x0000b" +} +, +{ +"is_managed" : "true", +"guid" : "F3A26BAF-F3A6-48FA-B917-0F720FA7506C", +"token" : "0x60047ab", +"native_offset" : "0x0", +"filename" : "gtk-sharp.dll", +"sizeofimage" : "0x1ce000", +"timestamp" : "0x0", +"il_offset" : "0x00030" +} +, +{ +"is_managed" : "true", +"guid" : "F3A26BAF-F3A6-48FA-B917-0F720FA7506C", +"token" : "0x60047aa", +"native_offset" : "0x0", +"filename" : "gtk-sharp.dll", +"sizeofimage" : "0x1ce000", +"timestamp" : "0x0", +"il_offset" : "0x00001" +} +, +{ +"is_managed" : "true", +"guid" : "CDE35789-80E3-46EB-B040-FD6452CE8A19", +"token" : "0x60044c0", +"native_offset" : "0x0", +"filename" : "MonoDevelop.Ide.dll", +"sizeofimage" : "0x71a000", +"timestamp" : "0x9376e667", +"il_offset" : "0x00035" +} +, +{ +"is_managed" : "true", +"guid" : "F3A26BAF-F3A6-48FA-B917-0F720FA7506C", +"token" : "0x60047a9", +"native_offset" : "0x0", +"filename" : "gtk-sharp.dll", +"sizeofimage" : "0x1ce000", +"timestamp" : "0x0", +"il_offset" : "0x0000f" +} +, +{ +"is_managed" : "true", +"guid" : "F3A26BAF-F3A6-48FA-B917-0F720FA7506C", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "gtk-sharp.dll", +"sizeofimage" : "0x1ce000", +"timestamp" : "0x0", +"il_offset" : "0xffffffff" +} +, +{ +"is_managed" : "false", +"native_address" : "unregistered" +} +, +{ +"is_managed" : "true", +"guid" : "F3A26BAF-F3A6-48FA-B917-0F720FA7506C", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "gtk-sharp.dll", +"sizeofimage" : "0x1ce000", +"timestamp" : "0x0", +"il_offset" : "0x00014" +} +, +{ +"is_managed" : "true", +"guid" : "F3A26BAF-F3A6-48FA-B917-0F720FA7506C", +"token" : "0x6000d7a", +"native_offset" : "0x0", +"filename" : "gtk-sharp.dll", +"sizeofimage" : "0x1ce000", +"timestamp" : "0x0", +"il_offset" : "0x00036" +} +, +{ +"is_managed" : "true", +"guid" : "CDE35789-80E3-46EB-B040-FD6452CE8A19", +"token" : "0x6004522", +"native_offset" : "0x0", +"filename" : "MonoDevelop.Ide.dll", +"sizeofimage" : "0x71a000", +"timestamp" : "0x9376e667", +"il_offset" : "0x00001" +} +, +{ +"is_managed" : "true", +"guid" : "F3A26BAF-F3A6-48FA-B917-0F720FA7506C", +"token" : "0x6000d78", +"native_offset" : "0x0", +"filename" : "gtk-sharp.dll", +"sizeofimage" : "0x1ce000", +"timestamp" : "0x0", +"il_offset" : "0x0001e" +} +, +{ +"is_managed" : "true", +"guid" : "F3A26BAF-F3A6-48FA-B917-0F720FA7506C", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "gtk-sharp.dll", +"sizeofimage" : "0x1ce000", +"timestamp" : "0x0", +"il_offset" : "0xffffffff" +} +, +{ +"is_managed" : "false", +"native_address" : "unregistered" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x0000b" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0xffffffff" +} +, +{ +"is_managed" : "false", +"native_address" : "unregistered" +} +, +{ +"is_managed" : "true", +"guid" : "F3A26BAF-F3A6-48FA-B917-0F720FA7506C", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "gtk-sharp.dll", +"sizeofimage" : "0x1ce000", +"timestamp" : "0x0", +"il_offset" : "0x0000b" +} +, +{ +"is_managed" : "true", +"guid" : "F3A26BAF-F3A6-48FA-B917-0F720FA7506C", +"token" : "0x6000d63", +"native_offset" : "0x0", +"filename" : "gtk-sharp.dll", +"sizeofimage" : "0x1ce000", +"timestamp" : "0x0", +"il_offset" : "0x0001d" +} +, +{ +"is_managed" : "true", +"guid" : "CDE35789-80E3-46EB-B040-FD6452CE8A19", +"token" : "0x6001cbe", +"native_offset" : "0x0", +"filename" : "MonoDevelop.Ide.dll", +"sizeofimage" : "0x71a000", +"timestamp" : "0x9376e667", +"il_offset" : "0x000c9" +} +, +{ +"is_managed" : "true", +"guid" : "CDE35789-80E3-46EB-B040-FD6452CE8A19", +"token" : "0x60053bc", +"native_offset" : "0x0", +"filename" : "MonoDevelop.Ide.dll", +"sizeofimage" : "0x71a000", +"timestamp" : "0x9376e667", +"il_offset" : "0x0031f" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6004617", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x0002c" +} +, +{ +"is_managed" : "true", +"guid" : "CDE35789-80E3-46EB-B040-FD6452CE8A19", +"token" : "0x6001ab5", +"native_offset" : "0x0", +"filename" : "MonoDevelop.Ide.dll", +"sizeofimage" : "0x71a000", +"timestamp" : "0x9376e667", +"il_offset" : "0x0001f" +} +, +{ +"is_managed" : "true", +"guid" : "CDE35789-80E3-46EB-B040-FD6452CE8A19", +"token" : "0x6004d4b", +"native_offset" : "0x0", +"filename" : "MonoDevelop.Ide.dll", +"sizeofimage" : "0x71a000", +"timestamp" : "0x9376e667", +"il_offset" : "0x00016" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6004617", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x0002c" +} +, +{ +"is_managed" : "true", +"guid" : "CDE35789-80E3-46EB-B040-FD6452CE8A19", +"token" : "0x6000216", +"native_offset" : "0x0", +"filename" : "MonoDevelop.Ide.dll", +"sizeofimage" : "0x71a000", +"timestamp" : "0x9376e667", +"il_offset" : "0x00018" +} +, +{ +"is_managed" : "true", +"guid" : "CDE35789-80E3-46EB-B040-FD6452CE8A19", +"token" : "0x6001cbd", +"native_offset" : "0x0", +"filename" : "MonoDevelop.Ide.dll", +"sizeofimage" : "0x71a000", +"timestamp" : "0x9376e667", +"il_offset" : "0x0000e" +} +, +{ +"is_managed" : "true", +"guid" : "CDE35789-80E3-46EB-B040-FD6452CE8A19", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "MonoDevelop.Ide.dll", +"sizeofimage" : "0x71a000", +"timestamp" : "0x9376e667", +"il_offset" : "0x0002a" +} +, +{ +"is_managed" : "false", +"native_address" : "unregistered" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x0000c" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x60048c7", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001997", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "4585E411-A46B-451E-AC14-CE4F86025668", +"token" : "0x60003de", +"native_offset" : "0x0", +"filename" : "glib-sharp.dll", +"sizeofimage" : "0x2c000", +"timestamp" : "0x0", +"il_offset" : "0x0003e" +} +, +{ +"is_managed" : "true", +"guid" : "4585E411-A46B-451E-AC14-CE4F86025668", +"token" : "0x600041b", +"native_offset" : "0x0", +"filename" : "glib-sharp.dll", +"sizeofimage" : "0x2c000", +"timestamp" : "0x0", +"il_offset" : "0x00011" +} +, +{ +"is_managed" : "true", +"guid" : "4585E411-A46B-451E-AC14-CE4F86025668", +"token" : "0x600041d", +"native_offset" : "0x0", +"filename" : "glib-sharp.dll", +"sizeofimage" : "0x2c000", +"timestamp" : "0x0", +"il_offset" : "0x0014e" +} +, +{ +"is_managed" : "true", +"guid" : "4585E411-A46B-451E-AC14-CE4F86025668", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "glib-sharp.dll", +"sizeofimage" : "0x2c000", +"timestamp" : "0x0", +"il_offset" : "0xffffffff" +} +, +{ +"is_managed" : "false", +"native_address" : "unregistered" +} +, +{ +"is_managed" : "true", +"guid" : "F3A26BAF-F3A6-48FA-B917-0F720FA7506C", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "gtk-sharp.dll", +"sizeofimage" : "0x1ce000", +"timestamp" : "0x0", +"il_offset" : "0x0000b" +} +, +{ +"is_managed" : "true", +"guid" : "F3A26BAF-F3A6-48FA-B917-0F720FA7506C", +"token" : "0x60003b1", +"native_offset" : "0x0", +"filename" : "gtk-sharp.dll", +"sizeofimage" : "0x1ce000", +"timestamp" : "0x0", +"il_offset" : "0x00001" +} +, +{ +"is_managed" : "true", +"guid" : "CDE35789-80E3-46EB-B040-FD6452CE8A19", +"token" : "0x60003e3", +"native_offset" : "0x0", +"filename" : "MonoDevelop.Ide.dll", +"sizeofimage" : "0x71a000", +"timestamp" : "0x9376e667", +"il_offset" : "0x0054a" +} +, +{ +"is_managed" : "true", +"guid" : "CDE35789-80E3-46EB-B040-FD6452CE8A19", +"token" : "0x60003f5", +"native_offset" : "0x0", +"filename" : "MonoDevelop.Ide.dll", +"sizeofimage" : "0x71a000", +"timestamp" : "0x9376e667", +"il_offset" : "0x000d4" +} +, +{ +"is_managed" : "true", +"guid" : "028A81EF-EB9A-480A-A022-655CDB6D640B", +"token" : "0x6000001", +"native_offset" : "0x0", +"filename" : "MonoDevelop.exe", +"sizeofimage" : "0x18000", +"timestamp" : "0xe8370fa9", +"il_offset" : "0x00001" +} +, +{ +"is_managed" : "true", +"guid" : "028A81EF-EB9A-480A-A022-655CDB6D640B", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "MonoDevelop.exe", +"sizeofimage" : "0x18000", +"timestamp" : "0xe8370fa9", +"il_offset" : "0x0002a" +} + +], +"unmanaged_frames" : [ +{ +"is_managed" : "false", +"native_address" : "0x55aec8c6fd92", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e664c9", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e676d2", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e70d1c", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8cc51c9", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8cc53dd", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8c72087", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8cbeba5", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda2ff22c62", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aecd4fcb70", +"native_offset" : "0x00000" +} + +] +}, +{ +"is_managed" : true, +"offset_free_hash" : "0x90c392b48", +"offset_rich_hash" : "0x90c392d00", +"crashed" : false, +"native_thread_id" : "0x7fda134936c0", +"thread_info_addr" : "0x7fd9fc000b70", +"thread_name" : "Thread Pool Wor", +"ctx" : { +"IP" : "0x7fda3911a75c", +"SP" : "0x7fda13492360", +"BP" : "0x7fda04b6fcf0" +}, +"managed_frames" : [ +{ +"is_managed" : "false", +"native_address" : "unregistered" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x600229a", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x0002b" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6002394", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6002397", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001ec3", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00071" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001ec1", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6002400", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00034" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6002396", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x0004a" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6002395", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001fcf", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00074" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x6001fe4", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x0002a" +} + +], +"unmanaged_frames" : [ +{ +"is_managed" : "false", +"native_address" : "0x55aec8c6fd92", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e664c9", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e676d2", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8e70bd7", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8cc44df", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda39042910", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x7fda3911a75c", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8d9794d", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8d95c7f", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8ec7153", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "false", +"native_address" : "0x55aec8df1955", +"native_offset" : "0x00000" +} +, +{ +"is_managed" : "true", +"guid" : "D636F104-D580-46FD-9B19-5699BCB1A744", +"token" : "0x00000", +"native_offset" : "0x0", +"filename" : "mscorlib.dll", +"sizeofimage" : "0x472000", +"timestamp" : "0xa6cb1fcf", +"il_offset" : "0x00000" +} + +] +} +] +} \ No newline at end of file From 530a73ca8963236fac0a52f043b540a341fa7c7a Mon Sep 17 00:00:00 2001 From: makiwolf Date: Tue, 2 Jan 2024 23:50:02 +0100 Subject: [PATCH 157/382] move references --- .../MonoDevelop.FSharp.fsproj | 6 ------ main/msbuild/ReferencesGtk.props | 6 ++++++ main/src/addins/AspNet/MonoDevelop.AspNet.csproj | 6 ------ main/src/addins/CSharpBinding/CSharpBinding.csproj | 6 ------ main/src/addins/GnomePlatform/GnomePlatform.csproj | 2 +- .../MonoDevelop.ConnectedServices.csproj | 3 --- .../MonoDevelop.Debugger.Soft.csproj | 7 ------- .../MonoDevelop.Debugger/MonoDevelop.Debugger.csproj | 6 ------ .../MonoDevelop.DesignerSupport.csproj | 4 ---- .../MonoDevelop.DotNetCore.csproj | 3 --- .../MonoDevelop.Gettext/MonoDevelop.Gettext.csproj | 4 ---- .../MonoDevelop.HexEditor.csproj | 1 - .../MonoDevelop.Packaging.csproj | 3 --- .../MonoDevelop.Refactoring.csproj | 6 ------ .../MonoDevelop.RegexToolkit.csproj | 3 --- .../MonoDevelop.SourceEditor.csproj | 12 ------------ .../MonoDevelop.UnitTesting.csproj | 6 ------ .../MonoDevelop.WebReferences.csproj | 2 -- main/src/addins/VBNetBinding/VBNetBinding.csproj | 2 +- .../MonoDevelop.VersionControl.Git.Tests.csproj | 3 --- .../MonoDevelop.VersionControl.Git.csproj | 3 --- .../MonoDevelop.VersionControl.Subversion.csproj | 3 --- .../MonoDevelop.VersionControl.csproj | 6 ------ main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj | 6 ------ .../MonoDevelop.TextEditor.Tests.csproj | 3 --- main/src/tools/mdmonitor/mdmonitor.csproj | 6 ------ main/tests/Ide.Tests/MonoDevelop.Ide.Tests.csproj | 3 --- main/tests/IdeUnitTests/IdeUnitTests.csproj | 3 +-- 28 files changed, 9 insertions(+), 115 deletions(-) diff --git a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.fsproj b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.fsproj index cfd95e14e12..fdd8356ac05 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.fsproj +++ b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.fsproj @@ -49,12 +49,6 @@ ..\..\..\build\bin\Xwt.Gtk.dll - - gtk-sharp-3.0 - - - gio-sharp-3.0 - ..\..\..\build\bin\Microsoft.CodeAnalysis.dll False diff --git a/main/msbuild/ReferencesGtk.props b/main/msbuild/ReferencesGtk.props index 7f87d8567b0..37eafa2234d 100644 --- a/main/msbuild/ReferencesGtk.props +++ b/main/msbuild/ReferencesGtk.props @@ -29,6 +29,12 @@ $(ReferencesGtkCopyToOutput) + + + gtk-sharp-3.0 + + + gio-sharp-3.0 diff --git a/main/src/addins/AspNet/MonoDevelop.AspNet.csproj b/main/src/addins/AspNet/MonoDevelop.AspNet.csproj index 483b3003020..21e7bf15219 100644 --- a/main/src/addins/AspNet/MonoDevelop.AspNet.csproj +++ b/main/src/addins/AspNet/MonoDevelop.AspNet.csproj @@ -85,12 +85,6 @@ - - gio-sharp-3.0 - - - gtk-sharp-3.0 - diff --git a/main/src/addins/CSharpBinding/CSharpBinding.csproj b/main/src/addins/CSharpBinding/CSharpBinding.csproj index 4aa05f731d6..9d445c25a9a 100644 --- a/main/src/addins/CSharpBinding/CSharpBinding.csproj +++ b/main/src/addins/CSharpBinding/CSharpBinding.csproj @@ -99,12 +99,6 @@ - - gtk-sharp-3.0 - - - gio-sharp-3.0 - diff --git a/main/src/addins/GnomePlatform/GnomePlatform.csproj b/main/src/addins/GnomePlatform/GnomePlatform.csproj index 2fc9333ab0b..0d187bddba9 100644 --- a/main/src/addins/GnomePlatform/GnomePlatform.csproj +++ b/main/src/addins/GnomePlatform/GnomePlatform.csproj @@ -29,4 +29,4 @@ - + \ No newline at end of file diff --git a/main/src/addins/MonoDevelop.ConnectedServices/MonoDevelop.ConnectedServices.csproj b/main/src/addins/MonoDevelop.ConnectedServices/MonoDevelop.ConnectedServices.csproj index 0259e79c023..408fc35ff6b 100644 --- a/main/src/addins/MonoDevelop.ConnectedServices/MonoDevelop.ConnectedServices.csproj +++ b/main/src/addins/MonoDevelop.ConnectedServices/MonoDevelop.ConnectedServices.csproj @@ -13,9 +13,6 @@ - - gtk-sharp-3.0 - diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj index 6e1ae059a80..c213bbf2cec 100644 --- a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj +++ b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.csproj @@ -12,13 +12,6 @@ - - - gio-sharp-3.0 - - - gtk-sharp-3.0 - diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj index d7c912bf630..b8d81890b6f 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj @@ -25,12 +25,6 @@ - - gio-sharp-3.0 - - - gtk-sharp-3.0 - diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj index 712bfcac5bb..b89174a85de 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj @@ -30,10 +30,6 @@ - - - gio-sharp-3.0 - diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj index db05c9738ac..b1518171d39 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj @@ -17,9 +17,6 @@ - - gtk-sharp-3.0 - diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj index a7c6c7d5fc9..bb7ed178b10 100644 --- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj +++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj @@ -17,10 +17,6 @@ - - - gio-sharp-3.0 - diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj index d6d3d118690..a2ffa3c2ddb 100644 --- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj +++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj @@ -15,7 +15,6 @@ - diff --git a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.csproj b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.csproj index 92b58af1f06..bc0bde87a36 100644 --- a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.csproj +++ b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.csproj @@ -14,9 +14,6 @@ - - gtk-sharp-3.0 - diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj index 21368353948..2b62d424255 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj @@ -20,12 +20,6 @@ - - gtk-sharp-3.0 - - - gio-sharp-3.0 - ..\..\..\external\Xamarin.Mac.dll diff --git a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj index fc8d29c5e69..1078f0c129a 100644 --- a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj +++ b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj @@ -16,9 +16,6 @@ - - gio-sharp-3.0 - diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj index cbc58cb159b..22768ffe641 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj @@ -82,12 +82,6 @@ - - gtk-sharp-3.0 - - - gio-sharp-3.0 - @@ -99,12 +93,6 @@ ..\..\..\external\Xamarin.Mac.dll False - - gtk-sharp-3.0 - - - gio-sharp-3.0 - diff --git a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj index 8f8a12e78b5..9a663105aa5 100644 --- a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj +++ b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj @@ -19,12 +19,6 @@ - - gtk-sharp-3.0 - - - gio-sharp-3.0 - diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj index 11d82b56e9a..83605bad3ec 100644 --- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj +++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj @@ -19,8 +19,6 @@ - - diff --git a/main/src/addins/VBNetBinding/VBNetBinding.csproj b/main/src/addins/VBNetBinding/VBNetBinding.csproj index 3ce864fc2db..29ce33dd4dc 100644 --- a/main/src/addins/VBNetBinding/VBNetBinding.csproj +++ b/main/src/addins/VBNetBinding/VBNetBinding.csproj @@ -72,4 +72,4 @@ - + \ No newline at end of file diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj index 1d65e95855a..446294e90ee 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj @@ -21,9 +21,6 @@ - - gtk-sharp-3.0 - diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj index af4267acd81..ce3af25c5a0 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj @@ -20,9 +20,6 @@ - - gio-sharp-3.0 - diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj index a9f66d0495b..4e7abfcd914 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj @@ -46,9 +46,6 @@ - - gio-sharp-3.0 - diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj index 56e40a7b070..44f75e5d313 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj @@ -58,12 +58,6 @@ - - gio-sharp-3.0 - - - gtk-sharp-3.0 - ..\..\..\..\build\bin\System.Reflection.Metadata.dll False diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj index f4ba902a5b2..fb3fa2a7f9c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj @@ -33,12 +33,6 @@ - - gio-sharp-3.0 - - - gtk-sharp-3.0 - + --> diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj index fb3fa2a7f9c..96d96e45bb1 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj @@ -109,15 +109,6 @@ {92494904-35FA-4DC9-BDE9-3A3E87AC49D3} Xwt - - {91DD5A2D-9FE3-4C3C-9253-876141874DAD} Mono.Addins @@ -128,14 +119,6 @@ Mono.Addins.Setup False - - - {410A7DC9-E7DA-43E6-B592-93E2A344B660} - Mono.Addins.GuiGtk3 - {90C99ADB-7D4B-4EB4-98C2-40BD1B14C7D2} Mono.Debugging @@ -150,23 +133,19 @@ {288994D1-C7E1-4740-99AB-A52B572EBA8A} MonoDevelop.GtkExtensions - + {410A7DC9-E7DA-43E6-B592-93E2A344B660} Mono.Addins.GuiGtk3 - - - {FED3E127-B64A-4E57-8D2A-C8817C5D593A} - Xwt.Gtk3 {FEC19BDA-4904-4005-8C09-68E82E8BEF6A} From 9b071207773b1073b0d66c4dbc2142de0516ada5 Mon Sep 17 00:00:00 2001 From: MakiWolf Date: Sat, 6 Jan 2024 19:33:57 +0100 Subject: [PATCH 165/382] comment out --- .../MonoDevelop.FSharp.Gui.csproj | 6 +- .../ExceptionCaughtDialog.cs | 8 +- .../Toolbox.cs | 8 +- .../CatalogHeadersWidget.cs | 4 +- .../POEditorWidget.cs | 66 +++++------ .../AnalyzeCurrentProjectHandler.cs | 24 ++-- .../RefactoringPreviewDialog.cs | 12 +- .../Mono.TextEditor.PopupWindow/ListWidget.cs | 4 +- .../AnimatedWidget.cs | 2 +- .../Mono.TextEditor/Gui/TextArea.cs | 10 +- .../Mono.TextEditor/Gui/TextViewMargin.cs | 22 ++-- .../QuickTaskOverviewMode.cs | 20 ++-- .../TooltipProviderWrapper.cs | 8 +- .../MonoDevelop.SourceEditor.csproj | 4 +- .../GotoLineNumberWidget.cs | 22 ++-- .../SearchAndReplaceWidget.cs | 8 +- .../SourceEditorPrintOperation.cs | 14 +-- .../SourceEditorWidget.cs | 4 +- .../MonoDevelop.UnitTesting/Gui/TestPad.cs | 8 +- .../EditRemoteDialog.cs | 6 +- .../BlameWidget.cs | 18 +-- .../EditorCompareWidgetBase.DiffScrollbar.cs | 10 +- .../EditorCompareWidgetBase.cs | 34 +++--- .../LogWidget.cs | 28 ++--- .../Mono.TextEditor/TextEditorOptions.cs | 4 +- .../TabStrip.cs | 2 +- .../DockContainer.cs | 4 +- .../DockItemContainer.cs | 22 ++-- .../IExtendedTitleBarDialogBackend.cs | 9 +- .../IExtendedTitleBarWindowBackend.cs | 8 +- .../StatusArea.cs | 2 +- .../PropertyTextEditor.cs | 4 +- .../PropertyGridTable.cs | 2 +- .../GtkColors.cs | 52 ++++----- .../GtkTheme.cs | 24 ++-- .../CellRendererComboBox.cs | 2 +- .../MonoDevelop.Components/ConsoleView.cs | 4 +- .../ContextMenuExtensionsGtk.cs | 2 +- .../DropDownBoxListWindow.cs | 4 +- .../MonoDevelop.Components/GtkWorkarounds.cs | 14 +-- .../MonoDevelop.Components/IdeTheme.cs | 9 +- .../MonoDevelop.Components/MenuButton.cs | 8 +- .../MonoDevelop.Components/MenuButtonEntry.cs | 8 +- .../MonoDevelop.Components/MiniButton.cs | 10 +- .../MonoDevelop.Components/PathBar.cs | 8 +- .../MonoDevelop.Components/RoundedFrame.cs | 2 +- .../MonoDevelop.Components/SearchEntry.cs | 10 +- .../MonoDevelop.Components/TooltipWindow.cs | 12 +- .../BuildOutputWidget.cs | 2 +- .../ListWidget.cs | 2 +- .../FindInFilesDialog.cs | 34 +++--- .../SearchResult.cs | 10 +- .../SearchResultWidget.cs | 6 +- .../ExtensibleTreeView.cs | 14 +-- .../OptionsDialog.cs | 30 ++--- .../MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs | 2 +- .../MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs | 2 +- .../DefaultWorkbench.cs | 2 +- .../GtkDocumentToolbar.cs | 2 +- .../ConfigurationComboBox.cs | 10 +- .../MonoDevelopStatusBar.cs | 4 +- .../MonoDevelop.Ide.Gui/ToolbarComboBox.cs | 2 +- .../AssemblyReferencePanel.cs | 6 +- .../DefaultPolicyOptionsDialog.cs | 46 ++++---- .../GtkNewProjectDialogBackend.UI.cs | 8 +- .../PackageReferencePanel.cs | 6 +- .../SelectReferenceDialog.cs | 2 +- .../AddinsUpdateHandler.cs | 4 +- main/src/core/MonoDevelop.Startup/app.config | 2 +- .../mdmonitor/InstrumentationViewerDialog.cs | 6 +- main/src/tools/mdmonitor/TimeLineView.cs | 104 +++++++++--------- .../src/tools/mdmonitor/TimeStatisticsView.cs | 2 +- 72 files changed, 441 insertions(+), 443 deletions(-) diff --git a/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/MonoDevelop.FSharp.Gui.csproj b/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/MonoDevelop.FSharp.Gui.csproj index 6a75ae8dd07..ff668a3d859 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/MonoDevelop.FSharp.Gui.csproj +++ b/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/MonoDevelop.FSharp.Gui.csproj @@ -19,11 +19,7 @@ - - - - - + diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs index a720a9365ad..a96a5a11a11 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs @@ -243,8 +243,8 @@ Widget CreateExceptionValueTreeView () } else #endif { - exceptionValueTreeView.ModifyBase (StateType.Normal, Styles.ExceptionCaughtDialog.ValueTreeBackgroundColor.ToGdkColor ()); - exceptionValueTreeView.ModifyBase (StateType.Active, Styles.ObjectValueTreeActiveBackgroundColor.ToGdkColor ()); + //exceptionValueTreeView.ModifyBase (StateType.Normal, Styles.ExceptionCaughtDialog.ValueTreeBackgroundColor.ToGdkColor ()); + //exceptionValueTreeView.ModifyBase (StateType.Active, Styles.ObjectValueTreeActiveBackgroundColor.ToGdkColor ()); exceptionValueTreeView.ModifyFont (Pango.FontDescription.FromString (Platform.IsWindows ? "9" : "11")); exceptionValueTreeView.RulesHint = false; exceptionValueTreeView.CanFocus = true; @@ -563,8 +563,8 @@ protected override bool OnMotionNotifyEvent (Gdk.EventMotion evnt) Widget CreateInnerExceptionsTree () { innerExceptionsTreeView = new InnerExceptionsTree (); - innerExceptionsTreeView.ModifyBase (StateType.Normal, Styles.ExceptionCaughtDialog.TreeBackgroundColor.ToGdkColor ()); // background - innerExceptionsTreeView.ModifyBase (StateType.Selected, Styles.ExceptionCaughtDialog.TreeSelectedBackgroundColor.ToGdkColor ()); // selected + //innerExceptionsTreeView.ModifyBase (StateType.Normal, Styles.ExceptionCaughtDialog.TreeBackgroundColor.ToGdkColor ()); // background + //innerExceptionsTreeView.ModifyBase (StateType.Selected, Styles.ExceptionCaughtDialog.TreeSelectedBackgroundColor.ToGdkColor ()); // selected innerExceptionsTreeView.HeadersVisible = false; innerExceptionsStore = new TreeStore (typeof (ExceptionInfo)); diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs index 01e83ee4b05..e8bb11cf165 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs @@ -55,7 +55,7 @@ public class Toolbox : VBox, IPropertyPadProvider, IToolboxConfiguration ToggleButton catToggleButton; ToggleButton compactModeToggleButton; - SearchEntry filterEntry; + Gtk.SearchEntry filterEntry; MonoDevelop.Ide.Gui.PadFontChanger fontChanger; IPadWindow container; Dictionary categoryPriorities = new Dictionary (); @@ -69,8 +69,8 @@ public Toolbox (ToolboxService toolboxService, IPadWindow container) #region Toolbar DockItemToolbar toolbar = container.GetToolbar (DockPositionType.Top); - filterEntry = new SearchEntry(); - filterEntry.Ready = true; + filterEntry = new Gtk.SearchEntry(); + //filterEntry.Ready = true; filterEntry.HasFrame = true; filterEntry.WidthRequest = 150; filterEntry.Changed += new EventHandler (filterTextChanged); @@ -195,7 +195,7 @@ void refilter () foreach (ToolboxWidgetCategory cat in toolboxWidget.Categories) { bool hasVisibleChild = false; foreach (ToolboxWidgetItem child in cat.Items) { - child.IsVisible = ((ItemToolboxNode)child.Tag).Filter (filterEntry.Entry.Text); + //child.IsVisible = ((ItemToolboxNode)child.Tag).Filter (filterEntry.Entry.Text); hasVisibleChild |= child.IsVisible; } cat.IsVisible = hasVisibleChild; diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/CatalogHeadersWidget.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/CatalogHeadersWidget.cs index 35f981a8c93..2235994ec8b 100644 --- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/CatalogHeadersWidget.cs +++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/CatalogHeadersWidget.cs @@ -149,13 +149,13 @@ void OnHeaderChanged (object sender, System.EventArgs e) } Gdk.Color background = wellFormed ? new Gdk.Color (138, 226,52) : new Gdk.Color (204, 0, 0); - entryPluralsForms.ModifyBase (StateType.Normal, background); //from tango palete - 8ae234 green, cc0000 red + //entryPluralsForms.ModifyBase (StateType.Normal, background); //from tango palete - 8ae234 green, cc0000 red if (wellFormed) { headers.SetHeaderNotEmpty ("Plural-Forms", entryPluralsForms.Text); OnPluralDefinitionChanged (); } } else { - entryPluralsForms.ModifyBase (StateType.Normal); + //entryPluralsForms.ModifyBase (StateType.Normal); headers.SetHeaderNotEmpty ("Plural-Forms", entryPluralsForms.Text); OnPluralDefinitionChanged (); } diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs index d4d83ea0d8f..6511ad8ac0e 100644 --- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs +++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs @@ -245,8 +245,8 @@ public POEditorWidget (TranslationProject project) this.scrolledwindowPlural.Child = this.texteditorPlural; this.scrolledwindowOriginal.Child.Show (); this.scrolledwindowPlural.Child.Show (); - scrolledwindowOriginal.Child.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Insensitive)); - scrolledwindowPlural.Child.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Insensitive)); + //scrolledwindowOriginal.Child.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Insensitive)); + //scrolledwindowPlural.Child.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Insensitive)); this.texteditorOriginal.Options = DefaultSourceEditorOptions.PlainEditor; this.texteditorPlural.Options = DefaultSourceEditorOptions.PlainEditor; this.texteditorOriginal.IsReadOnly = true; @@ -276,30 +276,30 @@ void CatalogIconDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk. { CatalogEntry entry = (CatalogEntry)model.GetValue (iter, 0); ((CellRendererImage)cell).Image = ImageService.GetIcon (GetStockForEntry (entry), IconSize.Menu); - cell.CellBackgroundGdk = GetRowColorForEntry (entry); + //cell.CellBackgroundGdk = GetRowColorForEntry (entry); } void FuzzyToggleDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { CatalogEntry entry = (CatalogEntry)model.GetValue (iter, 0); ((CellRendererToggle)cell).Active = entry.IsFuzzy; - cell.CellBackgroundGdk = GetRowColorForEntry (entry); + //cell.CellBackgroundGdk = GetRowColorForEntry (entry); } void OriginalTextDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { CatalogEntry entry = (CatalogEntry)model.GetValue (iter, 0); ((CellRendererText)cell).Text = EscapeForTreeView (entry.String); - cell.CellBackgroundGdk = GetRowColorForEntry (entry); - ((CellRendererText)cell).ForegroundGdk = GetForeColorForEntry (entry); + //cell.CellBackgroundGdk = GetRowColorForEntry (entry); + //((CellRendererText)cell).ForegroundGdk = GetForeColorForEntry (entry); } void TranslationTextDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { CatalogEntry entry = (CatalogEntry)model.GetValue (iter, 0); ((CellRendererText)cell).Text = EscapeForTreeView (entry.GetTranslation (0)); - cell.CellBackgroundGdk = GetRowColorForEntry (entry); - ((CellRendererText)cell).ForegroundGdk = GetForeColorForEntry (entry); + //cell.CellBackgroundGdk = GetRowColorForEntry (entry); + //((CellRendererText)cell).ForegroundGdk = GetForeColorForEntry (entry); } void CheckbuttonWhiteSpacesToggled (object sender, EventArgs e) @@ -493,10 +493,10 @@ void AddTextview (int index) AddChange (this.currentEntry, oldText, escapedText, index); } IdeApp.Workbench.StatusBar.ShowReady (); - window.Child.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Normal)); + //window.Child.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Normal)); } catch (System.Exception e) { IdeApp.Workbench.StatusBar.ShowError (e.Message); - window.Child.ModifyBase (Gtk.StateType.Normal, errorColor); + //window.Child.ModifyBase (Gtk.StateType.Normal, errorColor); } treeviewEntries.QueueDraw (); UpdateProgressBar (); @@ -701,19 +701,19 @@ static string GetStockForEntry (CatalogEntry entry) static string iconValid = "md-done";//"md-translation-valid"; static string iconMissing = "md-warning";//"md-translation-missing"; - Color GetRowColorForEntry (CatalogEntry entry) - { - if (entry.References.Length == 0) - return Styles.POEditor.EntryMissingBackgroundColor; - return entry.IsFuzzy ? Styles.POEditor.EntryFuzzyBackgroundColor : entry.IsTranslated ? Style.Base (StateType.Normal) : Styles.POEditor.EntryUntranslatedBackgroundColor; - } + //Color GetRowColorForEntry (CatalogEntry entry) + //{ + // if (entry.References.Length == 0) + // return Styles.POEditor.EntryMissingBackgroundColor; + //return entry.IsFuzzy ? Styles.POEditor.EntryFuzzyBackgroundColor : entry.IsTranslated ? Style.Base (StateType.Normal) : Styles.POEditor.EntryUntranslatedBackgroundColor; + //} - Color GetForeColorForEntry (CatalogEntry entry) - { - if (entry.References.Length == 0) - return Styles.POEditor.EntryMissingBackgroundColor; - return entry.IsFuzzy ? Style.Black : entry.IsTranslated ? Style.Text (StateType.Normal) : Style.Black; - } + //Color GetForeColorForEntry (CatalogEntry entry) + //{ + // if (entry.References.Length == 0) + // return Styles.POEditor.EntryMissingBackgroundColor; + //return entry.IsFuzzy ? Style.Black : entry.IsTranslated ? Style.Text (StateType.Normal) : Style.Black; + //} static int GetTypeSortIndicator (CatalogEntry entry) { @@ -810,12 +810,12 @@ void UpdateFromCatalog () regex = new System.Text.RegularExpressions.Regex (filter, options); } catch (Exception e) { IdeApp.Workbench.StatusBar.ShowError (e.Message); - this.searchEntryFilter.Entry.ModifyBase (StateType.Normal, errorColor); + //this.searchEntryFilter.Entry.ModifyBase (StateType.Normal, errorColor); this.searchEntryFilter.QueueDraw (); return; } } - this.searchEntryFilter.Entry.ModifyBase (StateType.Normal, Style.Base (StateType.Normal)); + //this.searchEntryFilter.Entry.ModifyBase (StateType.Normal, Style.Base (StateType.Normal)); this.searchEntryFilter.QueueDraw (); int found = 0; @@ -887,15 +887,15 @@ public void SelectEntry (CatalogEntry entry) } } while (store.IterNext (ref iter)); } - store.AppendValues (GetStockForEntry (entry), - entry.IsFuzzy, - EscapeForTreeView (entry.String), - EscapeForTreeView (entry.GetTranslation (0)), - entry, - GetRowColorForEntry (entry), - GetTypeSortIndicator (entry), - GetForeColorForEntry (entry) - ); + // store.AppendValues (GetStockForEntry (entry), + // entry.IsFuzzy, + // EscapeForTreeView (entry.String), + // EscapeForTreeView (entry.GetTranslation (0)), + // entry, + // GetRowColorForEntry (entry), + // GetTypeSortIndicator (entry), + // GetForeColorForEntry (entry) + // ); SelectEntry (entry); } #endregion diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/AnalyzeCurrentProjectHandler.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/AnalyzeCurrentProjectHandler.cs index 06d58b60736..cdd156cb8cd 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/AnalyzeCurrentProjectHandler.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/AnalyzeCurrentProjectHandler.cs @@ -67,7 +67,7 @@ protected override void Run () } internal static async void Execute () - { + { var project = IdeApp.ProjectOperations.CurrentSelectedProject; if (project == null) return; @@ -77,18 +77,18 @@ internal static async void Execute () try { using (var monitor = IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (GettextCatalog.GetString ("Analyzing project"), null, false, true, false, null, true)) { CancellationToken token = monitor.CancellationToken; - var allDiagnostics = await Task.Run (async delegate { - var diagnosticList = new List (); - monitor.BeginTask (GettextCatalog.GetString ("Analyzing {0}", project.Name), 1); - var providers = await AnalyzeWholeSolutionHandler.GetProviders (analysisProject); - diagnosticList.AddRange (await AnalyzeWholeSolutionHandler.GetDiagnostics (analysisProject, providers, token)); - monitor.EndTask (); - return diagnosticList; - }).ConfigureAwait (false); + // var allDiagnostics = await Task.Run (async delegate { + // var diagnosticList = new List (); + // monitor.BeginTask (GettextCatalog.GetString ("Analyzing {0}", project.Name), 1); + // var providers = await AnalyzeWholeSolutionHandler.GetProviders (analysisProject); + // diagnosticList.AddRange (await AnalyzeWholeSolutionHandler.GetDiagnostics (analysisProject, providers, token)); + // monitor.EndTask (); + // return diagnosticList; + // }).ConfigureAwait (false); - await Runtime.RunInMainThread (delegate { - AnalyzeWholeSolutionHandler.Report (monitor, allDiagnostics, project); - }).ConfigureAwait (false); + //await Runtime.RunInMainThread (delegate { + //AnalyzeWholeSolutionHandler.Report (monitor, allDiagnostics, project); + //}).ConfigureAwait (false); } } catch (OperationCanceledException) { } catch (AggregateException ae) { diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs index 804fd727a7b..cd6efdf09d5 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs @@ -113,13 +113,13 @@ void SetLocationTextData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, var loc = doc.OffsetToLocation (replaceChange.Offset); string text = string.Format (GettextCatalog.GetString ("(Line:{0}, Column:{1})"), loc.Line, loc.Column); - if (treeviewPreview.Selection.IterIsSelected (iter)) { + //if (treeviewPreview.Selection.IterIsSelected (iter)) { cellRendererText.Text = text; - } else { - var color = Style.Text (StateType.Insensitive); - var c = string.Format ("#{0:X02}{1:X02}{2:X02}", color.Red / 256, color.Green / 256, color.Blue / 256); - cellRendererText.Markup = "" + text + ""; - } + //} else { + //var color = Style.Text (StateType.Insensitive); + //var c = string.Format ("#{0:X02}{1:X02}{2:X02}", color.Red / 256, color.Green / 256, color.Blue / 256); + //cellRendererText.Markup = "" + text + ""; + //} } void SetDiffCellData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs index 096ed710b01..0a9b646add7 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs @@ -222,7 +222,7 @@ void DrawList (Gdk.EventExpose args) using (var cr = this.CreateXwtContext ()) { //avoid recreating the GC objects that we use multiple times - var textColor = this.Style.Text (StateType.Normal).ToXwtColor (); + //var textColor = this.Style.Text (StateType.Normal).ToXwtColor (); int n = 0; n = (int)(vadj.Value / rowHeight); @@ -341,7 +341,7 @@ protected override void OnRealized () void UpdateStyle () { - this.GdkWindow.Background = this.Style.Base (StateType.Normal); + //this.GdkWindow.Background = this.Style.Base (StateType.Normal); if (layout != null) layout.Dispose (); layout = new Xwt.Drawing.TextLayout (); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs index e8e2aa283b7..a1cdedec1c7 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs @@ -128,7 +128,7 @@ protected override void OnRealized () attributes.EventMask = (int)Gdk.EventMask.ExposureMask; GdkWindow = new Gdk.Window (Parent.GdkWindow, attributes, 0); GdkWindow.UserData = Handle; - GdkWindow.Background = Style.Background (State); + //GdkWindow.Background = Style.Background (State); Style.Attach (GdkWindow); } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs index 6dc57819c8d..422508f098f 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs @@ -127,15 +127,15 @@ protected internal IMMulticontext IMContext { get { return imContext; } } - public MenuItem CreateInputMethodMenuItem (string label) + public Gtk.MenuItem CreateInputMethodMenuItem (string label) { if (GtkWorkarounds.GtkMinorVersion >= 16) { - bool showMenu = (bool) GtkWorkarounds.GetProperty (Settings, "gtk-show-input-method-menu").Val; - if (!showMenu) + //bool showMenu = (bool) GtkWorkarounds.GetProperty (Settings, "gtk-show-input-method-menu").Val; + //if (!showMenu) return null; } - MenuItem imContextMenuItem = new MenuItem (label); - Menu imContextMenu = new Menu (); + Gtk.MenuItem imContextMenuItem = new Gtk.MenuItem (label); + Gtk.Menu imContextMenu = new Gtk.Menu (); imContextMenuItem.Submenu = imContextMenu; IMContext.AppendMenuitems (imContextMenu); return imContextMenuItem; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs index bbbb2ff62d4..ac98e2c5011 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs @@ -646,7 +646,7 @@ protected internal override void OptionsChanged () DisposeLayoutDict (); caretX = caretY = -LineHeight; - base.cursor = GetDefaultTextCursor (); + //base.cursor = GetDefaultTextCursor (); } void DisposeGCs () @@ -2690,11 +2690,11 @@ static int ScanWord (TextDocument doc, int offset, bool forwardDirection) List oldMarkers = new List (); List newMarkers = new List (); - Cursor GetDefaultTextCursor() - { - var baseColor = textEditor.Style.Background(StateType.Normal); - return HslColor.Brightness(baseColor) < 0.5 ? xtermCursorInverted.Value : xtermCursor.Value; - } + //Cursor GetDefaultTextCursor() + //{ + //var baseColor = textEditor.Style.Background(StateType.Normal); + //return HslColor.Brightness(baseColor) < 0.5 ? xtermCursorInverted.Value : xtermCursor.Value; + //} protected internal override void MouseHover (MarginMouseEventArgs args) { @@ -2735,7 +2735,7 @@ protected internal override void MouseHover (MarginMouseEventArgs args) } else { oldMarkers.Clear (); } - base.cursor = hoverResult.HasCursor ? hoverResult.Cursor : GetDefaultTextCursor (); + //base.cursor = hoverResult.HasCursor ? hoverResult.Cursor : GetDefaultTextCursor (); if (textEditor.TooltipMarkup != hoverResult.TooltipMarkup) { textEditor.TooltipMarkup = null; textEditor.TriggerTooltipQuery (); @@ -2755,11 +2755,11 @@ protected internal override void MouseHover (MarginMouseEventArgs args) ShowCodeSegmentPreviewTooltip (TextSegment.Invalid, Gdk.Rectangle.Zero); string link = GetLink != null ? GetLink (args) : null; - if (!String.IsNullOrEmpty (link)) { + //if (!String.IsNullOrEmpty (link)) { base.cursor = textLinkCursor.Value; - } else { - base.cursor = hoverResult.HasCursor ? hoverResult.Cursor : GetDefaultTextCursor (); - } + //} else { + //base.cursor = hoverResult.HasCursor ? hoverResult.Cursor : GetDefaultTextCursor (); + //} return; } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs index 65676c550ea..a7f111f37ce 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs @@ -95,16 +95,16 @@ public static Xwt.Drawing.Image OkImage { protected override void OnStyleSet (Style previous_style) { base.OnStyleSet (previous_style); - if (Core.Platform.IsWindows) { - using (var scrollstyle = Rc.GetStyleByPaths (Settings, null, null, VScrollbar.GType)) { - var scrl = new VScrollbar (null); - scrl.Style = scrollstyle; - win81Slider = scrollstyle.Background (StateType.Normal).ToCairoColor (); - win81SliderPrelight = scrollstyle.Background (StateType.Prelight).ToCairoColor (); - win81ScrollbarWidth = (int)scrl.StyleGetProperty ("slider-width"); - scrl.Destroy (); - } - } + // if (Core.Platform.IsWindows) { + // using (var scrollstyle = Rc.GetStyleByPaths (Settings, null, null, VScrollbar.GType)) { + // var scrl = new VScrollbar (null); + // scrl.Style = scrollstyle; + // win81Slider = scrollstyle.Background (StateType.Normal).ToCairoColor (); + // win81SliderPrelight = scrollstyle.Background (StateType.Prelight).ToCairoColor (); + // win81ScrollbarWidth = (int)scrl.StyleGetProperty ("slider-width"); + // scrl.Destroy (); + // } + // } } readonly int barPadding = MonoDevelop.Core.Platform.IsWindows ? 1 : 3; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs index 2c63dac0a27..3b135932b63 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs @@ -121,10 +121,10 @@ public override Xwt.WindowFrame CreateTooltipWindow (MonoTextEditor editor, int var wrappedEditor = WrapEditor (editor); if (wrappedEditor == null) return null; - var control = provider.CreateTooltipWindow (wrappedEditor, IdeApp.Workbench.ActiveDocument.DocumentContext, item, offset, modifierState.ToXwtValue ()); - if (control == null) + //var control = provider.CreateTooltipWindow (wrappedEditor, IdeApp.Workbench.ActiveDocument.DocumentContext, item, offset, modifierState.ToXwtValue ()); + //if (control == null) return null; - return control; + //return control; } protected override void GetRequiredPosition (MonoTextEditor editor, Xwt.WindowFrame tipWindow, out int requiredWidth, out double xalign) @@ -144,7 +144,7 @@ public override Xwt.WindowFrame ShowTooltipWindow (MonoTextEditor editor, Xwt.Wi if (wrappedEditor == null) { return tipWindow; } - provider.ShowTooltipWindow (wrappedEditor, tipWindow, item, modifierState.ToXwtValue (), mouseX, mouseY); + //provider.ShowTooltipWindow (wrappedEditor, tipWindow, item, modifierState.ToXwtValue (), mouseX, mouseY); return tipWindow; } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj index 22768ffe641..c131da087f0 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj @@ -70,9 +70,9 @@ - + {C3887A93-B2BD-4097-8E2F-3A063EFF32FD} - Xwt.Gtk2 + Xwt.GtkSharp diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/GotoLineNumberWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/GotoLineNumberWidget.cs index 22f261fe250..5f743ea26c1 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/GotoLineNumberWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/GotoLineNumberWidget.cs @@ -177,25 +177,25 @@ void GotoLine () void PreviewLine () { if (String.IsNullOrEmpty (entryLineNumber.Text) || entryLineNumber.Text == "+" || entryLineNumber.Text == "-") { - this.entryLineNumber.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Normal)); - this.entryLineNumber.ModifyText (Gtk.StateType.Normal, Style.Foreground (Gtk.StateType.Normal)); + //this.entryLineNumber.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Normal)); + //this.entryLineNumber.ModifyText (Gtk.StateType.Normal, Style.Foreground (Gtk.StateType.Normal)); RestoreWidgetState (); return; } - try { + //try { int targetLine = TargetLine; - if (targetLine >= textEditor.Document.LineCount || targetLine < 0) { + //if (targetLine >= textEditor.Document.LineCount || targetLine < 0) { targetLine = Math.Max (1, Math.Min (textEditor.Document.LineCount, targetLine)); - } else { - this.entryLineNumber.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Normal)); - this.entryLineNumber.ModifyText (Gtk.StateType.Normal, Style.Foreground (Gtk.StateType.Normal)); - } + // } else { + // this.entryLineNumber.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Normal)); + // this.entryLineNumber.ModifyText (Gtk.StateType.Normal, Style.Foreground (Gtk.StateType.Normal)); + // } textEditor.Caret.Line = targetLine; textEditor.CenterToCaret (); - } catch (System.Exception) { - this.entryLineNumber.ModifyText (Gtk.StateType.Normal, Ide.Gui.Styles.Editor.SearchErrorForegroundColor.ToGdkColor ()); - } + //} catch (System.Exception) { + //this.entryLineNumber.ModifyText (Gtk.StateType.Normal, Ide.Gui.Styles.Editor.SearchErrorForegroundColor.ToGdkColor ()); + //} } public void Focus () diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs index b0d525f583d..3adb7cdc6bd 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs @@ -785,8 +785,8 @@ void UpdateResultInformLabel () } if (string.IsNullOrEmpty (SearchPattern)) { resultInformLabel.Text = ""; - resultInformLabelEventBox.ModifyBg (StateType.Normal, entry.Style.Base (entry.State)); - resultInformLabel.ModifyFg (StateType.Normal, entry.Style.Foreground (StateType.Insensitive)); + //resultInformLabelEventBox.ModifyBg (StateType.Normal, entry.Style.Base (entry.State)); + //resultInformLabel.ModifyFg (StateType.Normal, entry.Style.Foreground (StateType.Insensitive)); return; } @@ -823,8 +823,8 @@ void UpdateResultInformLabel () } else { resultInformLabel.Text = String.Format (GettextCatalog.GetPluralString ("{0} match", "{0} matches", textEditor.TextViewMargin.SearchResultMatchCount), textEditor.TextViewMargin.SearchResultMatchCount); } - resultInformLabelEventBox.ModifyBg (StateType.Normal, entry.Style.Base (entry.State)); - resultInformLabel.ModifyFg (StateType.Normal, entry.Style.Foreground (StateType.Insensitive)); + //resultInformLabelEventBox.ModifyBg (StateType.Normal, entry.Style.Base (entry.State)); + //resultInformLabel.ModifyFg (StateType.Normal, entry.Style.Foreground (StateType.Insensitive)); textEditor.TextViewMargin.MainSearchResult = foundSegment; } } catch (Exception ex) { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs index 6c59c9042b0..3bd829d447a 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs @@ -49,7 +49,7 @@ public SourceEditorPrintOperation (TextEditor editor, FilePath filename) this.filename = filename; this.settings = SourceEditorPrintSettings.Load (); - this.Unit = Unit.Pixel; + //this.Unit = Unit.Pixel; } protected override void OnBeginPrint (PrintContext context) @@ -67,12 +67,12 @@ protected override void OnBeginPrint (PrintContext context) style = SyntaxHighlightingService.GetEditorTheme (settings.EditorTheme); - pageWidth = context.PageSetup.GetPageWidth (Unit.Pixel); - pageHeight = context.PageSetup.GetPageHeight (Unit.Pixel); - double contentHeight = pageHeight - - (headerLines > 0? settings.HeaderPadding : 0) - - (footerLines > 0? settings.FooterPadding : 0); - linesPerPage = (int)(contentHeight / lineHeight) - (headerLines + footerLines); + //pageWidth = context.PageSetup.GetPageWidth (Unit.Pixel); + //pageHeight = context.PageSetup.GetPageHeight (Unit.Pixel); + //double contentHeight = pageHeight + // - (headerLines > 0? settings.HeaderPadding : 0) + // - (footerLines > 0? settings.FooterPadding : 0); + //linesPerPage = (int)(contentHeight / lineHeight) - (headerLines + footerLines); totalPages = (int)Math.Ceiling ((double)editor.LineCount / linesPerPage); NPages = totalPages; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs index 7f2605d013a..6bb5efe35bc 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs @@ -1183,7 +1183,7 @@ void ShowSearchReplaceWidget (bool replace, bool switchFocus = true) KillWidgets (); searchAndReplaceWidgetFrame = new RoundedFrame (); //searchAndReplaceWidgetFrame.SetFillColor (MonoDevelop.Components.CairoExtensions.GdkColorToCairoColor (widget.TextEditor.ColorStyle.Default.BackgroundColor)); - searchAndReplaceWidgetFrame.SetFillColor (CairoExtensions.GdkColorToCairoColor (vbox.Style.Background (StateType.Normal))); + //searchAndReplaceWidgetFrame.SetFillColor (CairoExtensions.GdkColorToCairoColor (vbox.Style.Background (StateType.Normal))); searchAndReplaceWidgetFrame.Child = searchAndReplaceWidget = new SearchAndReplaceWidget (TextEditor, searchAndReplaceWidgetFrame); searchAndReplaceWidget.Destroyed += (sender, e) => RemoveSearchWidget (); @@ -1222,7 +1222,7 @@ public void ShowGotoLineNumberWidget () gotoLineNumberWidgetFrame = new MonoDevelop.Components.RoundedFrame (); //searchAndReplaceWidgetFrame.SetFillColor (MonoDevelop.Components.CairoExtensions.GdkColorToCairoColor (widget.TextEditor.ColorStyle.Default.BackgroundColor)); - gotoLineNumberWidgetFrame.SetFillColor (MonoDevelop.Components.CairoExtensions.GdkColorToCairoColor (vbox.Style.Background (StateType.Normal))); + //gotoLineNumberWidgetFrame.SetFillColor (MonoDevelop.Components.CairoExtensions.GdkColorToCairoColor (vbox.Style.Background (StateType.Normal))); gotoLineNumberWidgetFrame.Child = gotoLineNumberWidget = new GotoLineNumberWidget (textEditor, gotoLineNumberWidgetFrame); gotoLineNumberWidget.Destroyed += (sender, e) => RemoveSearchWidget (); diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs index 8adc2997b0e..ccbde9402bc 100644 --- a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs +++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs @@ -145,10 +145,10 @@ public override void Initialize (NodeBuilder[] builders, TreePadOption[] options header.PackEnd (hb, false, false, 0); header.Add (detailLabel); - Gdk.Color hcol = eb.Style.Background (StateType.Normal); - hcol.Red = (ushort) (((double)hcol.Red) * 0.9); - hcol.Green = (ushort) (((double)hcol.Green) * 0.9); - hcol.Blue = (ushort) (((double)hcol.Blue) * 0.9); + //Gdk.Color hcol = eb.Style.Background (StateType.Normal); + //hcol.Red = (ushort) (((double)hcol.Red) * 0.9); + //hcol.Green = (ushort) (((double)hcol.Green) * 0.9); + //hcol.Blue = (ushort) (((double)hcol.Blue) * 0.9); // eb.ModifyBg (StateType.Normal, hcol); detailsPad.PackStart (eb, false, false, 0); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditRemoteDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditRemoteDialog.cs index 591007a30fc..fe9917e6ab6 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditRemoteDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditRemoteDialog.cs @@ -24,7 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -using System; +using System; using System.Linq; using LibGit2Sharp; using MonoDevelop.Components; @@ -64,8 +64,8 @@ public EditRemoteDialog (GitRepository repository, Remote remote) void SetPushUrlTextStyle (bool disabled) { - entryPushUrl.ModifyText (Gtk.StateType.Normal, entryUrl.Style.Text (disabled ? Gtk.StateType.Insensitive : Gtk.StateType.Normal)); - entryPushUrl.ModifyText (Gtk.StateType.Active, entryUrl.Style.Text (disabled ? Gtk.StateType.Insensitive : Gtk.StateType.Active)); + //entryPushUrl.ModifyText (Gtk.StateType.Normal, entryUrl.Style.Text (disabled ? Gtk.StateType.Insensitive : Gtk.StateType.Normal)); + //entryPushUrl.ModifyText (Gtk.StateType.Active, entryUrl.Style.Text (disabled ? Gtk.StateType.Insensitive : Gtk.StateType.Active)); } public string RemoteName { diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs index dbb939a26ed..5815f5ee88e 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs @@ -260,23 +260,23 @@ protected override void OnDestroyed () protected override void OnSizeAllocated (Rectangle allocation) { base.OnSizeAllocated (allocation); - int vwidth = vScrollBar.Visible ? vScrollBar.Requisition.Width : 0; - int hheight = hScrollBar.Visible ? hScrollBar.Requisition.Height : 0; - Rectangle childRectangle = new Rectangle (allocation.X + 1, allocation.Y + 1, allocation.Width - vwidth - 1, allocation.Height - hheight - 1); + //int vwidth = vScrollBar.Visible ? vScrollBar.Requisition.Width : 0; + //int hheight = hScrollBar.Visible ? hScrollBar.Requisition.Height : 0; + //Rectangle childRectangle = new Rectangle (allocation.X + 1, allocation.Y + 1, allocation.Width - vwidth - 1, allocation.Height - hheight - 1); if (vScrollBar.Visible) { - int right = childRectangle.Right; + //int right = childRectangle.Right; int vChildTopHeight = -1; - int v = hScrollBar.Visible ? hScrollBar.Requisition.Height : 0; - vScrollBar.SizeAllocate (new Rectangle (right, childRectangle.Y + vChildTopHeight, vwidth, Allocation.Height - v - vChildTopHeight - 1)); + //int v = hScrollBar.Visible ? hScrollBar.Requisition.Height : 0; + //vScrollBar.SizeAllocate (new Rectangle (right, childRectangle.Y + vChildTopHeight, vwidth, Allocation.Height - v - vChildTopHeight - 1)); vScrollBar.Value = System.Math.Max (System.Math.Min (vAdjustment.Upper - vAdjustment.PageSize, vScrollBar.Value), vAdjustment.Lower); } int overviewWidth = overview.WidthRequest; - overview.SizeAllocate (new Rectangle (childRectangle.Right - overviewWidth, childRectangle.Top, overviewWidth, childRectangle.Height)); - editor.SizeAllocate (new Rectangle (childRectangle.X, childRectangle.Top, childRectangle.Width - overviewWidth, childRectangle.Height)); + //overview.SizeAllocate (new Rectangle (childRectangle.Right - overviewWidth, childRectangle.Top, overviewWidth, childRectangle.Height)); + //editor.SizeAllocate (new Rectangle (childRectangle.X, childRectangle.Top, childRectangle.Width - overviewWidth, childRectangle.Height)); if (hScrollBar.Visible) { - hScrollBar.SizeAllocate (new Rectangle (childRectangle.X, childRectangle.Y + childRectangle.Height, childRectangle.Width, hheight)); + //hScrollBar.SizeAllocate (new Rectangle (childRectangle.X, childRectangle.Y + childRectangle.Height, childRectangle.Width, hheight)); hScrollBar.Value = System.Math.Max (System.Math.Min (hAdjustment.Upper - hAdjustment.PageSize, hScrollBar.Value), hAdjustment.Lower); } } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.DiffScrollbar.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.DiffScrollbar.cs index d9857c3dcbc..b2a9a696a5d 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.DiffScrollbar.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.DiffScrollbar.cs @@ -159,11 +159,11 @@ void FillGradient (Cairo.Context cr, double y, double h) // FIXME: VV: Remove gradient features using (var grad = new Cairo.LinearGradient (0, y, Allocation.Width, y)) { - var col = (HslColor)Style.Base (StateType.Normal); - col.L *= 0.95; - grad.AddColorStop (0, col); - grad.AddColorStop (0.7, (HslColor)Style.Base (StateType.Normal)); - grad.AddColorStop (1, col); + //var col = (HslColor)Style.Base (StateType.Normal); + //col.L *= 0.95; + //grad.AddColorStop (0, col); + //grad.AddColorStop (0.7, (HslColor)Style.Base (StateType.Normal)); + //grad.AddColorStop (1, col); cr.SetSource (grad); cr.Fill (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.cs index 75cb8fd7063..a78ae55a45f 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.cs @@ -516,36 +516,36 @@ protected override void OnSizeAllocated (Rectangle allocation) bool hScrollBarVisible = hScrollBars[0].Visible; - int hheight = hScrollBarVisible ? hScrollBars[0].Requisition.Height : 0; + //int hheight = hScrollBarVisible ? hScrollBars[0].Requisition.Height : 0; int headerSize = 0; if (headerWidgets != null) headerSize = System.Math.Max (headerWidgets[0].SizeRequest ().Height, 16); - Rectangle childRectangle = new Rectangle (allocation.X + overviewWidth + 1, allocation.Y + headerSize + 1, allocation.Width - vwidth - overviewWidth * 2, allocation.Height - hheight - headerSize - 1); + //Rectangle childRectangle = new Rectangle (allocation.X + overviewWidth + 1, allocation.Y + headerSize + 1, allocation.Width - vwidth - overviewWidth * 2, allocation.Height - hheight - headerSize - 1); - leftDiffScrollBar.SizeAllocate (new Rectangle (allocation.Left, childRectangle.Y, overviewWidth - 1, childRectangle.Height)); - rightDiffScrollBar.SizeAllocate (new Rectangle (allocation.Right - overviewWidth + 1, childRectangle.Y, overviewWidth - 1, childRectangle.Height )); + //leftDiffScrollBar.SizeAllocate (new Rectangle (allocation.Left, childRectangle.Y, overviewWidth - 1, childRectangle.Height)); + //rightDiffScrollBar.SizeAllocate (new Rectangle (allocation.Right - overviewWidth + 1, childRectangle.Y, overviewWidth - 1, childRectangle.Height )); const int middleAreaWidth = 42; - int editorWidth = (childRectangle.Width - middleAreaWidth * (editors.Length - 1)) / editors.Length; + //int editorWidth = (childRectangle.Width - middleAreaWidth * (editors.Length - 1)) / editors.Length; - for (int i = 0; i < editors.Length; i++) { - Rectangle editorRectangle = new Rectangle (childRectangle.X + (editorWidth + middleAreaWidth) * i , childRectangle.Top, editorWidth, childRectangle.Height); - editors[i].SizeAllocate (editorRectangle); + //for (int i = 0; i < editors.Length; i++) { + //Rectangle editorRectangle = new Rectangle (childRectangle.X + (editorWidth + middleAreaWidth) * i , childRectangle.Top, editorWidth, childRectangle.Height); + //editors[i].SizeAllocate (editorRectangle); - if (hScrollBarVisible) { - hScrollBars[i].SizeAllocate (new Rectangle (editorRectangle.X, editorRectangle.Y + editorRectangle.Height, editorRectangle.Width, hheight)); - } + //if (hScrollBarVisible) { + //hScrollBars[i].SizeAllocate (new Rectangle (editorRectangle.X, editorRectangle.Y + editorRectangle.Height, editorRectangle.Width, hheight)); + //} - if (headerWidgets != null) - headerWidgets[i].SizeAllocate (new Rectangle (editorRectangle.X, allocation.Y + 1, editorRectangle.Width, headerSize)); - } + //if (headerWidgets != null) + //headerWidgets[i].SizeAllocate (new Rectangle (editorRectangle.X, allocation.Y + 1, editorRectangle.Width, headerSize)); + //} - for (int i = 0; i < middleAreas.Length; i++) { - middleAreas[i].SizeAllocate (new Rectangle (childRectangle.X + editorWidth * (i + 1) + middleAreaWidth * i, childRectangle.Top, middleAreaWidth + 1, childRectangle.Height)); - } + //for (int i = 0; i < middleAreas.Length; i++) { + //middleAreas[i].SizeAllocate (new Rectangle (childRectangle.X + editorWidth * (i + 1) + middleAreaWidth * i, childRectangle.Top, middleAreaWidth + 1, childRectangle.Height)); + //} base.OnSizeAllocated (allocation); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs index 8cb69892096..0dd4073b2a9 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs @@ -61,7 +61,7 @@ public Revision[] History { TreeView treeviewFiles; TreeStore changedpathstore; DocumentToolButton revertButton, revertToButton, refreshButton; - SearchEntry searchEntry; + Gtk.SearchEntry searchEntry; string currentFilter; VersionControlDocumentInfo info; @@ -158,13 +158,13 @@ public LogWidget (VersionControlDocumentInfo info) refreshButton = new DocumentToolButton (Gtk.Stock.Refresh, GettextCatalog.GetString ("Refresh")); refreshButton.Clicked += new EventHandler (RefreshClicked); - searchEntry = new SearchEntry (); - searchEntry.WidthRequest = 200; - searchEntry.ForceFilterButtonVisible = true; - searchEntry.EmptyMessage = GettextCatalog.GetString ("Search"); - searchEntry.Changed += HandleSearchEntryFilterChanged; - searchEntry.Ready = true; - searchEntry.Show (); + // searchEntry = new SearchEntry (); + // searchEntry.WidthRequest = 200; + // searchEntry.ForceFilterButtonVisible = true; + // searchEntry.EmptyMessage = GettextCatalog.GetString ("Search"); + // searchEntry.Changed += HandleSearchEntryFilterChanged; + // searchEntry.Ready = true; + // searchEntry.Show (); messageRenderer.Ellipsize = Pango.EllipsizeMode.End; TreeViewColumn colRevMessage = new TreeViewColumn (); @@ -368,13 +368,13 @@ void HandleStylesChanged (object sender, EventArgs e) void UpdateStyle () { - var c = Style.Base (StateType.Normal).ToXwtColor (); - c.Light *= 0.8; - commitBox.ModifyBg (StateType.Normal, c.ToGdkColor ()); + //var c = Style.Base (StateType.Normal).ToXwtColor (); + //c.Light *= 0.8; + //commitBox.ModifyBg (StateType.Normal, c.ToGdkColor ()); var tcol = Styles.LogView.CommitDescBackgroundColor.ToGdkColor (); - textviewDetails.ModifyBase (StateType.Normal, tcol); - scrolledwindow1.ModifyBase (StateType.Normal, tcol); + //textviewDetails.ModifyBase (StateType.Normal, tcol); + //scrolledwindow1.ModifyBase (StateType.Normal, tcol); } internal void SetToolbar (DocumentToolbar toolbar) @@ -408,7 +408,7 @@ void HandleSearchEntryFilterChanged (object sender, EventArgs e) filtering = true; GLib.Timeout.Add (100, delegate { filtering = false; - currentFilter = searchEntry.Entry.Text; + //currentFilter = searchEntry.Entry.Text; SetLogSearchFilter (logstore, currentFilter); UpdateHistory (); return false; diff --git a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/TextEditorOptions.cs b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/TextEditorOptions.cs index dc54387340f..4270dfb7416 100644 --- a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/TextEditorOptions.cs +++ b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/TextEditorOptions.cs @@ -445,8 +445,8 @@ public Pango.FontDescription GutterFont { } catch (Exception e) { LoggingService.LogError ("Could not load gutter font: " + GutterFontName, e); } - if (gutterFont == null || String.IsNullOrEmpty (gutterFont.Family)) - gutterFont = Gtk.Widget.DefaultStyle.FontDescription.Copy (); + //if (gutterFont == null || String.IsNullOrEmpty (gutterFont.Family)) + //gutterFont = Gtk.Widget.DefaultStyle.FontDescription.Copy (); if (gutterFont != null) gutterFont.Size = (int)(gutterFont.Size * Zoom); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs index 8e911e2c4d1..65d18540a3e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs @@ -1148,7 +1148,7 @@ void Draw (Context ctx) drawActive?.Invoke (ctx); if (HasFocus) { - Gtk.Style.PaintFocus (Style, ctx, State, /*focusRect,*/ this, "tab", focusRect.X, focusRect.Y, focusRect.Width, focusRect.Height); + //Gtk.Style.PaintFocus (Style, ctx, State, /*focusRect,*/ this, "tab", focusRect.X, focusRect.Y, focusRect.Width, focusRect.Height); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs index db68a4176fa..162a06144bd 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs @@ -402,7 +402,7 @@ protected override void OnRealized () //GdkWindow.SetBackPixmap (null, true); - ModifyBase (StateType.Normal, Styles.DockFrameBackground.ToGdkColor ()); + //ModifyBase (StateType.Normal, Styles.DockFrameBackground.ToGdkColor ()); } protected override void OnUnrealized () @@ -554,7 +554,7 @@ protected override void OnRealized () // For testing purposes. Not being shown while VisibleWindow = false ModifyBg (StateType.Normal, new Gdk.Color (255,0,0)); - ModifyBase (StateType.Normal, new Gdk.Color (255,0,0)); + //ModifyBase (StateType.Normal, new Gdk.Color (255,0,0)); ModifyFg (StateType.Normal, new Gdk.Color (255,0,0)); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs index 53eba561646..df0aef5df52 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs @@ -145,8 +145,8 @@ void UpdateVisualStyle () if (VisualStyle.TabStyle == DockTabStyle.Normal) ModifyBg (StateType.Normal, VisualStyle.PadBackgroundColor.Value.ToGdkColor ()); - else - ModifyBg (StateType.Normal, Style.Background(StateType.Normal)); + //else + //ModifyBg (StateType.Normal, Style.Background(StateType.Normal)); } } @@ -170,13 +170,13 @@ void SetTreeStyle (Gtk.Widget w) void OnTreeRealized (object sender, EventArgs e) { var w = (Gtk.TreeView)sender; - if (VisualStyle.TreeBackgroundColor != null) { - w.ModifyBase (StateType.Normal, VisualStyle.TreeBackgroundColor.Value.ToGdkColor ()); - w.ModifyBase (StateType.Insensitive, VisualStyle.TreeBackgroundColor.Value.ToGdkColor ()); - } else { - w.ModifyBase (StateType.Normal, Parent.Style.Base (StateType.Normal)); - w.ModifyBase (StateType.Insensitive, Parent.Style.Base (StateType.Insensitive)); - } + //if (VisualStyle.TreeBackgroundColor != null) { + //w.ModifyBase (StateType.Normal, VisualStyle.TreeBackgroundColor.Value.ToGdkColor ()); + //w.ModifyBase (StateType.Insensitive, VisualStyle.TreeBackgroundColor.Value.ToGdkColor ()); + //} else { + // w.ModifyBase (StateType.Normal, Parent.Style.Base (StateType.Normal)); + // w.ModifyBase (StateType.Insensitive, Parent.Style.Base (StateType.Insensitive)); + //} } // protected override bool OnExposeEvent (Gdk.EventExpose evnt) @@ -220,8 +220,8 @@ public CustomFrame (int topMargin, int bottomMargin, int leftMargin, int rightMa protected override void OnStyleSet (Style previous_style) { base.OnStyleSet (previous_style); - if (!borderColorSet) - borderColor = Style.Dark (Gtk.StateType.Normal); + //if (!borderColorSet) + //borderColor = Style.Dark (Gtk.StateType.Normal); } public void SetMargins (int topMargin, int bottomMargin, int leftMargin, int rightMargin) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarDialogBackend.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarDialogBackend.cs index 7fdb8a317f5..2b965199268 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarDialogBackend.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarDialogBackend.cs @@ -26,6 +26,7 @@ using System; using Xwt.Backends; using Xwt.GtkBackend; +using Gtk; namespace MonoDevelop.Components.Extensions { @@ -44,18 +45,18 @@ public override void Initialize () toolbar = new HeaderBox (); toolbar.GradientBackground = true; toolbar.SetMargins (0, 1, 0, 0); - MainBox.PackStart (toolbar, false, false, 0); - ((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0; + //MainBox.PackStart (toolbar, false, false, 0); + //((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0; } public void SetHeaderContent (IWidgetBackend backend) { if (toolbar.Child != null) { - WidgetBackend.RemoveChildPlacement (toolbar.Child); + //WidgetBackend.RemoveChildPlacement (toolbar.Child); toolbar.Remove (toolbar.Child); } if (backend != null) { - toolbar.Child = WidgetBackend.GetWidgetWithPlacement (backend); + //toolbar.Child = WidgetBackend.GetWidgetWithPlacement (backend); toolbar.Show (); } else { toolbar.Hide (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarWindowBackend.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarWindowBackend.cs index dda0af1d649..4363496cd2c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarWindowBackend.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarWindowBackend.cs @@ -44,18 +44,18 @@ public override void Initialize () toolbar = new HeaderBox (); toolbar.GradientBackground = true; toolbar.SetMargins (0, 1, 0, 0); - MainBox.PackStart (toolbar, false, false, 0); - ((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0; + //MainBox.PackStart (toolbar, false, false, 0); + //((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0; } public void SetHeaderContent (IWidgetBackend backend) { if (toolbar.Child != null) { - WidgetBackend.RemoveChildPlacement (toolbar.Child); + //WidgetBackend.RemoveChildPlacement (toolbar.Child); toolbar.Remove (toolbar.Child); } if (backend != null) { - toolbar.Child = WidgetBackend.GetWidgetWithPlacement (backend); + //toolbar.Child = WidgetBackend.GetWidgetWithPlacement (backend); toolbar.Show (); } else { toolbar.Hide (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs index 4a2b83ddfea..cc4f1abc9f7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs @@ -387,7 +387,7 @@ void ApplicationNameChanged (object sender, EventArgs e) protected override void OnRealized () { base.OnRealized (); - ModifyText (StateType.Normal, Styles.StatusBarTextColor.ToGdkColor ()); + //ModifyText (StateType.Normal, Styles.StatusBarTextColor.ToGdkColor ()); ModifyFg (StateType.Normal, Styles.StatusBarTextColor.ToGdkColor ()); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/PropertyTextEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/PropertyTextEditor.cs index dd63dc6d61a..694bda8a9eb 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/PropertyTextEditor.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/PropertyTextEditor.cs @@ -99,8 +99,8 @@ public void Initialize (EditSession session) entry.HasFrame = false; entry.Changed += TextChanged; entry.FocusOutEvent += FirePendingChangeEvent; - if (!entry.IsEditable) - entry.ModifyText (StateType.Normal, entry.Style.Text (Gtk.StateType.Insensitive)); + //if (!entry.IsEditable) + //entry.ModifyText (StateType.Normal, entry.Style.Text (Gtk.StateType.Insensitive)); } if (entry != null && ShouldShowDialogButton () && entry.IsEditable) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs index d6fb2b1df4f..93ec59400cf 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs @@ -608,7 +608,7 @@ void Draw (Cairo.Context ctx, List rowList, int dividerX, int x, ref i ctx.Rectangle (0, y, dividerX, h + PropertyTopBottomPadding*2); ctx.Clip (); ctx.MoveTo (x, y + PropertyTopBottomPadding); - ctx.SetSourceColor (Style.Text (state).ToCairoColor ()); + //ctx.SetSourceColor (Style.Text (state).ToCairoColor ()); Pango.CairoHelper.ShowLayout (ctx, layout); ctx.Restore (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkColors.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkColors.cs index b8f578ff10e..1d29e5104b4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkColors.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkColors.cs @@ -114,33 +114,33 @@ public void RefreshColors () for (int s = 0; s < sn; s++,i++) { Gdk.Color color = Gdk.Color.Zero; - if (widget != null && widget.IsRealized) { - switch ((GtkColorClass)c) { - case GtkColorClass.Light: - color = widget.Style.LightColors[s]; - break; - case GtkColorClass.Mid: - color = widget.Style.MidColors[s]; - break; - case GtkColorClass.Dark: - color = widget.Style.DarkColors[s]; - break; - case GtkColorClass.Base: - color = widget.Style.BaseColors[s]; - break; - case GtkColorClass.Text: - color = widget.Style.TextColors[s]; - break; - case GtkColorClass.Background: - color = widget.Style.Backgrounds[s]; - break; - case GtkColorClass.Foreground: - color = widget.Style.Foregrounds[s]; - break; - } - } else { + //if (widget != null && widget.IsRealized) { + // switch ((GtkColorClass)c) { + // case GtkColorClass.Light: + // color = widget.Style.LightColors[s]; + // break; + // case GtkColorClass.Mid: + // color = widget.Style.MidColors[s]; + // break; + // case GtkColorClass.Dark: + // color = widget.Style.DarkColors[s]; + // break; + // case GtkColorClass.Base: + // color = widget.Style.BaseColors[s]; + // break; + // case GtkColorClass.Text: + // color = widget.Style.TextColors[s]; + // break; + // case GtkColorClass.Background: + // color = widget.Style.Backgrounds[s]; + // break; + // case GtkColorClass.Foreground: + // color = widget.Style.Foregrounds[s]; + // break; + // } + //} else { color = new Gdk.Color (0, 0, 0); - } + //} gtk_colors[c * sn + s] = CairoExtensions.GdkColorToCairoColor (color); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs index 12f06cba800..d9e3995cc3d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs @@ -41,20 +41,20 @@ public GtkTheme (Widget widget) : base(widget) { } - public static Cairo.Color GetCairoTextMidColor (Widget widget) - { - Cairo.Color text_color = CairoExtensions.GdkColorToCairoColor (widget.Style.Foreground (StateType.Normal)); - Cairo.Color background_color = CairoExtensions.GdkColorToCairoColor (widget.Style.Background (StateType.Normal)); - return CairoExtensions.AlphaBlend (text_color, background_color, 0.5); - } + //public static Cairo.Color GetCairoTextMidColor (Widget widget) + //{ + //Cairo.Color text_color = CairoExtensions.GdkColorToCairoColor (widget.Style.Foreground (StateType.Normal)); + //Cairo.Color background_color = CairoExtensions.GdkColorToCairoColor (widget.Style.Background (StateType.Normal)); + //return CairoExtensions.AlphaBlend (text_color, background_color, 0.5); + //} - public static Gdk.Color GetGdkTextMidColor (Widget widget) - { - Cairo.Color color = GetCairoTextMidColor (widget); - Gdk.Color gdk_color = new Gdk.Color ((byte)(color.R * 255), (byte)(color.G * 255), (byte)(color.B * 255)); + //public static Gdk.Color GetGdkTextMidColor (Widget widget) + //{ + //Cairo.Color color = GetCairoTextMidColor (widget); + //Gdk.Color gdk_color = new Gdk.Color ((byte)(color.R * 255), (byte)(color.G * 255), (byte)(color.B * 255)); // Gdk.Colormap.System.AllocColor (ref gdk_color, true, true); - return gdk_color; - } + //return gdk_color; + //} protected override void OnColorsRefreshed () { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererComboBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererComboBox.cs index d3442f43f37..3264b037fdf 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererComboBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererComboBox.cs @@ -42,7 +42,7 @@ public CellRendererComboBox () { Mode |= Gtk.CellRendererMode.Editable; Gtk.ComboBoxText dummyEntry = new Gtk.ComboBoxText (); - rowHeight = dummyEntry.SizeRequest ().Height + (2 * dummyEntry.Style?.YThickness ?? 0); + //rowHeight = dummyEntry.SizeRequest ().Height + (2 * dummyEntry.Style?.YThickness ?? 0); Ypad = 0; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ConsoleView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ConsoleView.cs index 7a51a958e72..90e4634894e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ConsoleView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ConsoleView.cs @@ -80,8 +80,8 @@ void TextViewPopulatePopup (object o, PopulatePopupArgs args) item.Show (); sep.Show (); - args.Menu.Add (sep); - args.Menu.Add (item); + //args.Menu.Add (sep); + //args.Menu.Add (item); } void ClearActivated (object sender, EventArgs e) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs index 76b522957a7..5ada2af2291 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs @@ -167,7 +167,7 @@ static Gtk.MenuItem CreateMenuItem (ContextMenuItem item) var img = new ImageView (item.Image); img.ShowAll (); imageItem.Image = img; - Xwt.GtkBackend.GtkWorkarounds.ForceImageOnMenuItem (imageItem); + //Xwt.GtkBackend.GtkWorkarounds.ForceImageOnMenuItem (imageItem); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs index 0758b6b8be4..5548e1d0450 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs @@ -607,8 +607,8 @@ protected override void OnRealized () void UpdateStyle () { - if (IsRealized) - GdkWindow.Background = Style.Base (StateType.Normal); + //if (IsRealized) + // GdkWindow.Background = Style.Base (StateType.Normal); if (layout != null) layout.Dispose (); layout = new Pango.Layout (PangoContext); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs index 1e3a01dcf7b..63162eea3fc 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs @@ -959,7 +959,7 @@ static ForallDelegate CreateForallCallback (IntPtr gtype) typeof(GtkWorkarounds).Module, true); - var invokerType = typeof(Gtk.Container.CallbackInvoker); + //var invokerType = typeof(Gtk.Container.CallbackInvoker); //this was based on compiling a similar method and disassembling it ILGenerator il = dm.GetILGenerator (); @@ -970,7 +970,7 @@ static ForallDelegate CreateForallCallback (IntPtr gtype) var loc_container = il.DeclareLocal (typeof(Gtk.Container)); var loc_obj = il.DeclareLocal (typeof(object)); - var loc_invoker = il.DeclareLocal (invokerType); + //var loc_invoker = il.DeclareLocal (invokerType); var loc_ex = il.DeclareLocal (typeof(Exception)); //check that the type is an exact match @@ -1016,13 +1016,13 @@ static ForallDelegate CreateForallCallback (IntPtr gtype) il.Emit (OpCodes.Ldloca_S, 2); il.Emit (OpCodes.Ldarg_2); il.Emit (OpCodes.Ldarg_3); - il.Emit (OpCodes.Call, invokerType.GetConstructor ( - BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[] { typeof (IntPtr), typeof (IntPtr) }, null)); + //il.Emit (OpCodes.Call, invokerType.GetConstructor ( + // BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[] { typeof (IntPtr), typeof (IntPtr) }, null)); il.Emit (OpCodes.Ldloc, loc_container); il.Emit (OpCodes.Ldarg_1); - il.Emit (OpCodes.Ldloc, loc_invoker); - il.Emit (OpCodes.Box, invokerType); - il.Emit (OpCodes.Ldftn, invokerType.GetMethod ("Invoke")); + //il.Emit (OpCodes.Ldloc, loc_invoker); + //il.Emit (OpCodes.Box, invokerType); + //il.Emit (OpCodes.Ldftn, invokerType.GetMethod ("Invoke")); il.Emit (OpCodes.Newobj, typeof (Gtk.Callback).GetConstructor ( BindingFlags.Instance | BindingFlags.Public, null, new Type[] { typeof (object), typeof (IntPtr) }, null)); var forallMeth = typeof (Gtk.Container).GetMethod ("ForAll", diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs index 87ac9852bab..9a92d236167 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs @@ -30,6 +30,7 @@ using MonoDevelop.Ide; using MonoDevelop.Ide.Gui; using System.Linq; +using Gtk; #if MAC using AppKit; @@ -263,8 +264,8 @@ internal static void UpdateStyles () { if (Platform.IsLinux) { var defaultStyle = Gtk.Rc.GetStyle (IdeApp.Workbench.RootWindow); - var bgColor = defaultStyle.Background (Gtk.StateType.Normal); - UserInterfaceTheme = HslColor.Brightness (bgColor) < 0.5 ? Theme.Dark : Theme.Light; + //var bgColor = defaultStyle.Background (Gtk.StateType.Normal); + //UserInterfaceTheme = HslColor.Brightness (bgColor) < 0.5 ? Theme.Dark : Theme.Light; } if (UserInterfaceTheme == Theme.Dark) @@ -446,7 +447,7 @@ public class ThemedGtkWindowBackend : Xwt.GtkBackend.WindowBackend public override void Initialize () { base.Initialize (); - IdeTheme.ApplyTheme (Window); + //IdeTheme.ApplyTheme (Window); } } @@ -455,7 +456,7 @@ public class ThemedGtkDialogBackend : Xwt.GtkBackend.DialogBackend public override void Initialize () { base.Initialize (); - IdeTheme.ApplyTheme (Window); + //IdeTheme.ApplyTheme (Window); } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButton.cs index 4e773505522..8eaee934e8b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButton.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButton.cs @@ -126,10 +126,10 @@ void PositionFunc (Menu mn, out int x, out int y, out bool push_in) y += rect.Y + rect.Height; //if the menu would be off the bottom of the screen, "drop" it upwards - if (y + mn.Requisition.Height > this.Screen.Height) { - y -= mn.Requisition.Height; - y -= rect.Height; - } + //if (y + mn.Requisition.Height > this.Screen.Height) { + // y -= mn.Requisition.Height; + // y -= rect.Height; + //} //let GTK reposition the button if it still doesn't fit on the screen push_in = true; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButtonEntry.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButtonEntry.cs index 4abb983452d..4a7701786c0 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButtonEntry.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButtonEntry.cs @@ -182,10 +182,10 @@ void PositionFunc (Gtk.Menu mn, out int x, out int y, out bool push_in) y += rect.Y + rect.Height; //if the menu would be off the bottom of the screen, "drop" it upwards - if (y + mn.Requisition.Height > button.Screen.Height) { - y -= mn.Requisition.Height; - y -= rect.Height; - } + //if (y + mn.Requisition.Height > button.Screen.Height) { + // y -= mn.Requisition.Height; + // y -= rect.Height; + //} //let GTK reposition the menu if it still doesn't fit on the screen push_in = true; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MiniButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MiniButton.cs index 91df3fbd5e7..536997de0b9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MiniButton.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MiniButton.cs @@ -134,8 +134,8 @@ protected override bool OnButtonReleaseEvent (Gdk.EventButton evnt) protected override void OnRealized () { base.OnRealized (); - if (!backgroundColorSet) - normalColor = Parent.Style.Background (Gtk.StateType.Normal); + //if (!backgroundColorSet) + //normalColor = Parent.Style.Background (Gtk.StateType.Normal); } protected override bool OnEnterNotifyEvent (Gdk.EventCrossing evnt) @@ -160,9 +160,9 @@ protected override bool OnLeaveNotifyEvent (Gdk.EventCrossing evnt) void SetBg (bool hilight) { - if (hilight) - ModifyBg (StateType.Normal, Style.Base (Gtk.StateType.Normal)); - else + //if (hilight) + // ModifyBg (StateType.Normal, Style.Base (Gtk.StateType.Normal)); + //else ModifyBg (StateType.Normal, normalColor); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs index e086809c32e..3c7d2741e60 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs @@ -713,10 +713,10 @@ void PositionFunc (Menu mn, out int x, out int y, out bool push_in) y += rect.Height; x += GetHoverXPosition (out w); //if the menu would be off the bottom of the screen, "drop" it upwards - if (y + mn.Requisition.Height > this.Screen.Height) { - y -= mn.Requisition.Height; - y -= rect.Height; - } + //if (y + mn.Requisition.Height > this.Screen.Height) { + // y -= mn.Requisition.Height; + // y -= rect.Height; + //} //let GTK reposition the button if it still doesn't fit on the screen push_in = true; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs index 41b5be2dcbd..32527339c8b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs @@ -63,7 +63,7 @@ public RoundedFrame () public void SetFillColor (Cairo.Color color) { - this.ModifyBase (Gtk.StateType.Normal, CairoExtensions.CairoColorToGdkColor (color)); + //this.ModifyBase (Gtk.StateType.Normal, CairoExtensions.CairoColorToGdkColor (color)); this.ModifyBg (Gtk.StateType.Normal, CairoExtensions.CairoColorToGdkColor (color)); fill_color = color; fill_color_set = true; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs index 3da3ba08067..d78de6a0e5c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs @@ -330,11 +330,11 @@ private bool OnChangedTimeout () private void UpdateStyle () { - Gdk.Color color = entry.Style.Base (entry.State); - filter_button.ModifyBg (entry.State, color); - clear_button.ModifyBg (entry.State, color); - if (statusLabelEventBox != null) - statusLabelEventBox.ModifyBg (entry.State, color); + //Gdk.Color color = entry.Style.Base (entry.State); + //filter_button.ModifyBg (entry.State, color); + //clear_button.ModifyBg (entry.State, color); + //if (statusLabelEventBox != null) + //statusLabelEventBox.ModifyBg (entry.State, color); box.BorderWidth = 0; var h = entry.SizeRequest ().Height + entry.Style.Ythickness * 2; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs index 659e0b579d2..3056beb14b3 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs @@ -37,12 +37,12 @@ public abstract class TooltipWindow : Gtk.Window { WindowTransparencyDecorator decorator; - public string LinkColor { - get { - var color = HslColor.GenerateHighlightColors (Style.Background (State), Style.Text (State), 3)[2]; - return color.ToPangoString (); - } - } + //public string LinkColor { + //get { + //var color = HslColor.GenerateHighlightColors (Style.Background (State), Style.Text (State), 3)[2]; + //return color.ToPangoString (); + //} + //} protected TooltipWindow () : base (Gtk.WindowType.Popup) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.BuildOutputView/BuildOutputWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.BuildOutputView/BuildOutputWidget.cs index 94cfcc28991..10cf202bc59 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.BuildOutputView/BuildOutputWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.BuildOutputView/BuildOutputWidget.cs @@ -595,7 +595,7 @@ void Find (BuildOutputNode node) FocusRow (node); resultInformLabel.Text = GettextCatalog.GetString ("{0} of {1}", currentSearch.CurrentAbsoluteMatchIndex, currentSearch.MatchesCount); - resultInformLabel.TextColor = searchEntry.Style.Foreground (Gtk.StateType.Insensitive).ToXwtColor(); + //resultInformLabel.TextColor = searchEntry.Style.Foreground (Gtk.StateType.Insensitive).ToXwtColor(); } else if (string.IsNullOrEmpty (searchEntry.Entry.Text)) { resultInformLabel.Text = string.Empty; IdeApp.Workbench.StatusBar.ShowReady (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs index 945a736b0df..ebd8b23fb45 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs @@ -373,7 +373,7 @@ protected override bool OnButtonReleaseEvent (EventButton e) protected override void OnRealized () { base.OnRealized (); - this.GdkWindow.Background = this.Style.Base (StateType.Normal); + //this.GdkWindow.Background = this.Style.Base (StateType.Normal); } protected override bool OnMotionNotifyEvent (EventMotion e) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs index 735624b734e..4fb49494069 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs @@ -63,7 +63,7 @@ enum SearchScope { CheckButton checkbuttonRecursively; ComboBoxText comboboxentryReplace; ComboBoxText comboboxentryPath; - SearchEntry searchentryFileMask; + Gtk.SearchEntry searchentryFileMask; Button buttonBrowsePaths; Button buttonReplace; Label labelFileMask; @@ -272,9 +272,9 @@ void SetupAccessibilityForPath () void SetupAccessibilityForSearch () { - searchentryFileMask.SetEntryAccessibilityAttributes ("FindInFilesDialog.searchentryFileMask", - labelFileMask.Text, - GettextCatalog.GetString ("Enter the file mask")); + //searchentryFileMask.SetEntryAccessibilityAttributes ("FindInFilesDialog.searchentryFileMask", + // labelFileMask.Text, + // GettextCatalog.GetString ("Enter the file mask")); } static void TableAddRow (Table table, uint row, Widget column1, Widget column2) @@ -499,18 +499,18 @@ void ShowFileMaskUI () }; labelFileMask.Show (); - searchentryFileMask = new MonoDevelop.Components.SearchEntry () { - ForceFilterButtonVisible = false, - IsCheckMenu = true, - ActiveFilterID = 0, - Visible = true, - Ready = true, - }; + //searchentryFileMask = new Gtk.SearchEntry () { + // ForceFilterButtonVisible = false, + // IsCheckMenu = true, + // ActiveFilterID = 0, + // Visible = true, + // Ready = true, + //}; - searchentryFileMask.Query = properties.Get ("MonoDevelop.FindReplaceDialogs.FileMask", ""); + //searchentryFileMask.Query = properties.Get ("MonoDevelop.FindReplaceDialogs.FileMask", ""); - searchentryFileMask.Entry.ActivatesDefault = true; + //searchentryFileMask.Entry.ActivatesDefault = true; searchentryFileMask.Show (); SetupAccessibilityForSearch (); @@ -523,7 +523,7 @@ void HideFileMaskUI () if (labelFileMask == null) return; - properties.Set ("MonoDevelop.FindReplaceDialogs.FileMask", searchentryFileMask.Query); + //properties.Set ("MonoDevelop.FindReplaceDialogs.FileMask", searchentryFileMask.Query); uint row = TableGetRowForItem (tableFindAndReplace, labelFileMask); TableRemoveRow (tableFindAndReplace, row, labelFileMask, searchentryFileMask, true); @@ -684,8 +684,8 @@ void StorePoperties () StoreHistory ("MonoDevelop.FindReplaceDialogs.FindHistory", comboboxentryFind); if (replaceMode) StoreHistory ("MonoDevelop.FindReplaceDialogs.ReplaceHistory", comboboxentryReplace); - if (searchentryFileMask != null) - properties.Set ("MonoDevelop.FindReplaceDialogs.FileMask", searchentryFileMask.Query); + //if (searchentryFileMask != null) + // properties.Set ("MonoDevelop.FindReplaceDialogs.FileMask", searchentryFileMask.Query); // StoreHistory ("MonoDevelop.FindReplaceDialogs.PathHistory", comboboxentryPath); //StoreHistory ("MonoDevelop.FindReplaceDialogs.FileMaskHistory", comboboxentryFileMask); } @@ -798,7 +798,7 @@ Scope GetScope () FilterOptions GetFilterOptions () { return new FilterOptions { - FileMask = searchentryFileMask != null && !string.IsNullOrEmpty (searchentryFileMask.Query) ? searchentryFileMask.Query : "*", + //FileMask = searchentryFileMask != null && !string.IsNullOrEmpty (searchentryFileMask.Query) ? searchentryFileMask.Query : "*", CaseSensitive = checkbuttonCaseSensitive.Active, RegexSearch = checkbuttonRegexSearch.Active, WholeWordsOnly = checkbuttonWholeWordsOnly.Active diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResult.cs index a2c52d7892b..2f8b3996ba1 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResult.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResult.cs @@ -185,13 +185,13 @@ async Task CreateMarkupAsync (SearchResultWidget widget, TextEditor doc, var searchColor = GetBackgroundMarkerColor (widget.HighlightStyle); - var selectedSearchColor = widget.Style.Base (Gtk.StateType.Selected); - selectedSearchColor = searchColor.AddLight (-0.2); + //var selectedSearchColor = widget.Style.Base (Gtk.StateType.Selected); + //selectedSearchColor = searchColor.AddLight (-0.2); double b1 = HslColor.Brightness (searchColor); - double b2 = HslColor.Brightness (SearchResultWidget.AdjustColor (widget.Style.Base (Gtk.StateType.Normal), SyntaxHighlightingService.GetColor (widget.HighlightStyle, EditorThemeColors.Foreground))); + //double b2 = HslColor.Brightness (SearchResultWidget.AdjustColor (widget.Style.Base (Gtk.StateType.Normal), SyntaxHighlightingService.GetColor (widget.HighlightStyle, EditorThemeColors.Foreground))); // selected markup = FormatMarkup (PangoHelper.ColorMarkupBackground (selectedMarkup, (int)startIndex, (int)endIndex, searchColor), trimStart, trimEnd, tabSize); - selectedMarkup = FormatMarkup (PangoHelper.ColorMarkupBackground (selectedMarkup, (int)startIndex, (int)endIndex, selectedSearchColor), trimStart, trimEnd, tabSize); + //selectedMarkup = FormatMarkup (PangoHelper.ColorMarkupBackground (selectedMarkup, (int)startIndex, (int)endIndex, selectedSearchColor), trimStart, trimEnd, tabSize); string newMarkup; using (var markupTimeoutSource = new CancellationTokenSource (150)) { @@ -200,7 +200,7 @@ async Task CreateMarkupAsync (SearchResultWidget widget, TextEditor doc, } try { - double delta = Math.Abs (b1 - b2); + double delta = Math.Abs(b1);// - b2); if (delta < 0.1) { var color1 = SyntaxHighlightingService.GetColor (widget.HighlightStyle, EditorThemeColors.FindHighlight); if (color1.L + 0.5 > 1.0) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs index 284e2707bd6..0d96acef82a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs @@ -344,7 +344,7 @@ internal string AdjustColors (string markup) // This is a workaround for Bug 559804 - Strings in search result pad are near-invisible // On mac it's not possible to get the white background color with the Base or Background // methods. If this bug is fixed or a better work around is found - remove this hack. - Color baseColor = Platform.IsMac ?treeviewSearchResults.Style.Light (treeviewSearchResults.State) : treeviewSearchResults.Style.Base (treeviewSearchResults.State); + //Color baseColor = Platform.IsMac ?treeviewSearchResults.Style.Light (treeviewSearchResults.State) : treeviewSearchResults.Style.Base (treeviewSearchResults.State); while (idx > 0) { idx += "foreground=\"".Length; @@ -358,8 +358,8 @@ internal string AdjustColors (string markup) Color color = Color.Zero; - if (Color.Parse(colorStr, ref color)) - colorStr = ColorToPangoMarkup(AdjustColor(baseColor, color)); + //if (Color.Parse(colorStr, ref color)) + //colorStr = ColorToPangoMarkup(AdjustColor(baseColor, color)); result.Append (colorStr); idx = markup.IndexOf ("foreground=\"", idx, StringComparison.Ordinal); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs index bf1dced8f88..b21ca8752a4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs @@ -189,7 +189,7 @@ void CustomFontPropertyChanged (object sender, EventArgs a) void UpdateFont () { - text_render.CustomFont = IdeApp.Preferences.CustomPadFont ?? tree.Style.FontDescription; + //text_render.CustomFont = IdeApp.Preferences.CustomPadFont ?? tree.Style.FontDescription; tree.ColumnsAutosize (); } @@ -2480,7 +2480,7 @@ void SetupLayout (Gtk.Widget widget, Gtk.CellRendererState flags = 0) if (scaledFont == null) { if (scaledFont != null) scaledFont.Dispose (); - scaledFont = (customFont ?? parent.widget.Style.FontDesc).Copy (); + //scaledFont = (customFont ?? parent.widget.Style.FontDesc).Copy (); scaledFont.Size = (int)(customFont.Size * Zoom); if (layout != null) layout.FontDescription = scaledFont; @@ -2496,11 +2496,11 @@ void SetupLayout (Gtk.Widget widget, Gtk.CellRendererState flags = 0) string newmarkup = TextMarkup; if (DisabledStyle) { Gdk.Color fgColor; - if (Platform.IsMac && flags.HasFlag (Gtk.CellRendererState.Selected)) - fgColor = widget.Style.Text (IdeTheme.UserInterfaceTheme == Theme.Light ? Gtk.StateType.Selected : Gtk.StateType.Normal); - else - fgColor = widget.Style.Text (Gtk.StateType.Insensitive); - newmarkup = "" + TextMarkup + ""; + //if (Platform.IsMac && flags.HasFlag (Gtk.CellRendererState.Selected)) + //fgColor = widget.Style.Text (IdeTheme.UserInterfaceTheme == Theme.Light ? Gtk.StateType.Selected : Gtk.StateType.Normal); + //else + //fgColor = widget.Style.Text (Gtk.StateType.Insensitive); + //newmarkup = "" + TextMarkup + ""; } if (!string.IsNullOrEmpty (SecondaryTextMarkup)) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs index 82e07e703bd..a59fe38a19a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs @@ -123,9 +123,9 @@ public OptionsDialog (MonoDevelop.Components.Window parentWindow, object dataObj fboxTree.Add (sw); mainHBox.PackStart (fboxTree, false, false, 0); - Realized += delegate { - fboxTree.BackgroundColor = tree.Style.Base (Gtk.StateType.Normal); - }; + //Realized += delegate { + // fboxTree.BackgroundColor = tree.Style.Base (Gtk.StateType.Normal); + //}; var vbox = new VBox (); vbox.Accessible.SetShouldIgnore (true); @@ -154,18 +154,18 @@ public OptionsDialog (MonoDevelop.Components.Window parentWindow, object dataObj fboxHeader.Add (headerBox); // fbox.GradientBackround = true; // fbox.BackgroundColor = new Gdk.Color (255, 255, 255); - Realized += delegate { - var c = Style.Background (Gtk.StateType.Normal).ToXwtColor (); - c.Light += 0.09; - fboxHeader.BackgroundColor = c.ToGdkColor (); - }; - StyleSet += delegate { - if (IsRealized) { - var c = Style.Background (Gtk.StateType.Normal).ToXwtColor (); - c.Light += 0.09; - fboxHeader.BackgroundColor = c.ToGdkColor (); - } - }; + //Realized += delegate { + //var c = Style.Background (Gtk.StateType.Normal).ToXwtColor (); + //c.Light += 0.09; + //fboxHeader.BackgroundColor = c.ToGdkColor (); + //}; + //StyleSet += delegate { + //if (IsRealized) { + //var c = Style.Background (Gtk.StateType.Normal).ToXwtColor (); + //c.Light += 0.09; + //fboxHeader.BackgroundColor = c.ToGdkColor (); + //} + //}; vbox.PackStart (fboxHeader, false, false, 0); pageFrame = new HBox (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs index 2bfa1c11022..a2d7ed85648 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs @@ -40,7 +40,7 @@ class SetupApp: IApplication public Task Run (string[] arguments) { Gtk.Application.Init (); - AddinManagerWindow.Run (null); + //AddinManagerWindow.Run (null); return Task.FromResult (0); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs index 1e8950e4e0f..29c0207cc61 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs @@ -240,7 +240,7 @@ protected override void Initialize (IPadWindow window) spacer.Accessible.SetShouldIgnore (true); toolbar.Add (spacer, true); - searchEntry = new SearchEntry (); + searchEntry = new MonoDevelop.Components.SearchEntry (); searchEntry.Accessible.SetLabel (GettextCatalog.GetString ("Search")); searchEntry.Accessible.Name = "ErrorPad.Search"; searchEntry.Accessible.Description = GettextCatalog.GetString ("Search the error data"); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/DefaultWorkbench.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/DefaultWorkbench.cs index a5ef9d63ac5..cb81d4fe856 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/DefaultWorkbench.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/DefaultWorkbench.cs @@ -315,7 +315,7 @@ void CreateMenuBar () topMenu = IdeApp.CommandService.CreateMenuBar (MainMenuPath); var appMenu = IdeApp.CommandService.CreateMenu (AppMenuPath); if (appMenu != null && appMenu.Children.Length > 0) { - var item = new MenuItem (BrandingService.ApplicationName); + var item = new Gtk.MenuItem (BrandingService.ApplicationName); item.Submenu = appMenu; topMenu.Insert (item, 0); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/GtkDocumentToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/GtkDocumentToolbar.cs index b2c0513da69..23a3d96243a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/GtkDocumentToolbar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/GtkDocumentToolbar.cs @@ -115,7 +115,7 @@ void ChangeColor (Gtk.Widget w) w.ModifyFg (StateType.Prelight, textColor); w.ModifyFg (StateType.Active, textColor); } else - w.ModifyText (StateType.Normal, textColor); + //w.ModifyText (StateType.Normal, textColor); w.ModifyFg (StateType.Normal, textColor); }; if (w is Gtk.Container) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ConfigurationComboBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ConfigurationComboBox.cs index 7987710ecde..a350e199d75 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ConfigurationComboBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ConfigurationComboBox.cs @@ -346,11 +346,11 @@ void PositionFunc (Gtk.Menu mn, out int x, out int y, out bool push_in) x += rect.X; y += rect.Y + rect.Height; - //if the menu would be off the bottom of the screen, "drop" it upwards - if (y + mn.Requisition.Height > this.Screen.Height) { - y -= mn.Requisition.Height; - y -= rect.Height; - } + ////if the menu would be off the bottom of the screen, "drop" it upwards + //if (y + mn.Requisition.Height > this.Screen.Height) { + // y -= mn.Requisition.Height; + // y -= rect.Height; + //} if (mn.SizeRequest ().Width < rect.Width) mn.WidthRequest = rect.Width; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs index 30496e5859a..72111749b22 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs @@ -176,8 +176,8 @@ Gdk.Rectangle GetGripRect () rect.Y = Allocation.Y + Allocation.Height - rect.Height; if (Direction == TextDirection.Ltr) rect.X = Allocation.X + Allocation.Width - rect.Width; - else - rect.X = Allocation.X + Style.XThickness; + //else + //rect.X = Allocation.X + Style.XThickness; return rect; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs index 594ff07999b..51587504095 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs @@ -68,7 +68,7 @@ public override void SetToolbarStyle (Gtk.Toolbar toolbar) if (toolbar.IconSize == Gtk.IconSize.Menu || toolbar.IconSize == Gtk.IconSize.SmallToolbar) { //ctx.FontDesc = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); } else { - ctx.FontDesc = Style.FontDescription; + //ctx.FontDesc = Style.FontDescription; } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs index 3b46c5b0ede..8df83595dad 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs @@ -290,8 +290,8 @@ internal static string GetMatchMarkup (Gtk.Widget widget, string text, int[] mat { StringBuilder result = StringBuilderCache.Allocate (); int lastPos = 0; - var color = HslColor.GenerateHighlightColors (widget.Style.Base (StateType.Normal), - widget.Style.Text (StateType.Normal), 3)[2]; + //var color = HslColor.GenerateHighlightColors (widget.Style.Base (StateType.Normal), + // widget.Style.Text (StateType.Normal), 3)[2]; for (int n=0; n < matches.Length; n++) { int pos = matches[n] - startIndex; if (pos < 0 || pos >= text.Length) @@ -299,7 +299,7 @@ internal static string GetMatchMarkup (Gtk.Widget widget, string text, int[] mat if (pos - lastPos > 0) result.Append (GLib.Markup.EscapeText (text.Substring (lastPos, pos - lastPos))); result.Append (""); result.Append (GLib.Markup.EscapeText (text[pos].ToString ())); result.Append (""); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs index cd1e0b1c762..64ccae507a8 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs @@ -43,7 +43,7 @@ namespace MonoDevelop.Ide.Projects public class DefaultPolicyOptionsDialog : OptionsDialog { ComboBoxText policiesCombo; - MenuButton newButton; + Gtk.MenuButton newButton; Button deleteButton; MonoDevelop.Components.MenuButton exportButton; List sets = new List (); @@ -69,7 +69,7 @@ public DefaultPolicyOptionsDialog (MonoDevelop.Components.Window parentWindow) deleteButton = new Button (GettextCatalog.GetString ("Delete Policy")); topBar.PackEnd (deleteButton, false, false, 0); - exportButton = new MenuButton (); + exportButton = new MonoDevelop.Components.MenuButton (); exportButton.Label = GettextCatalog.GetString ("Export"); exportButton.ContextMenuRequested = delegate { ContextMenu menu = new ContextMenu (); @@ -89,28 +89,28 @@ public DefaultPolicyOptionsDialog (MonoDevelop.Components.Window parentWindow) }; topBar.PackEnd (exportButton, false, false, 0); - newButton = new MonoDevelop.Components.MenuButton (); + newButton = new Gtk.MenuButton (); newButton.Label = GettextCatalog.GetString ("Add Policy"); - newButton.ContextMenuRequested = delegate { - ContextMenu menu = new ContextMenu (); - - ContextMenuItem item = new ContextMenuItem (GettextCatalog.GetString ("New policy...")); - item.Clicked += HandleNewButtonClicked; - menu.Items.Add (item); - - item = new ContextMenuItem (GettextCatalog.GetString ("From file...")); - item.Clicked += HandleFromFile; - menu.Items.Add (item); - - item = new ContextMenuItem (GettextCatalog.GetString ("From project or solution...")); - item.Clicked += HandleFromProject; - if (!IdeApp.Workspace.IsOpen) { - item.Sensitive = false; - } - menu.Items.Add (item); - - return menu; - }; + //newButton.ContextMenuRequested = delegate { + // ContextMenu menu = new ContextMenu (); + + // ContextMenuItem item = new ContextMenuItem (GettextCatalog.GetString ("New policy...")); + // item.Clicked += HandleNewButtonClicked; + // menu.Items.Add (item); + + // item = new ContextMenuItem (GettextCatalog.GetString ("From file...")); + // item.Clicked += HandleFromFile; + // menu.Items.Add (item); + + // item = new ContextMenuItem (GettextCatalog.GetString ("From project or solution...")); + // item.Clicked += HandleFromProject; + // if (!IdeApp.Workspace.IsOpen) { + // item.Sensitive = false; + // } + // menu.Items.Add (item); + + // return menu; + //}; topBar.PackEnd (newButton, false, false, 0); Alignment align = new Alignment (0f, 0f, 1f, 1f); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs index 17ebd76e6a9..83019dde529 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs @@ -136,10 +136,10 @@ void Build () topBannerLabel = new Label (); topBannerLabel.Name = "topBannerLabel"; topBannerLabel.Accessible.Name = "topBannerLabel"; - Pango.FontDescription font = topBannerLabel.Style.FontDescription.Copy (); // UNDONE: VV: Use FontService? - font.Size = (int)(font.Size * 2.0); - font.Weight = Pango.Weight.Bold; - topBannerLabel.ModifyFont (font); + //Pango.FontDescription font = topBannerLabel.Style.FontDescription.Copy (); // UNDONE: VV: Use FontService? + //font.Size = (int)(font.Size * 2.0); + //font.Weight = Pango.Weight.Bold; + //topBannerLabel.ModifyFont (font); topBannerLabel.ModifyFg (StateType.Normal, whiteColor); var topLabelHBox = new HBox (); topLabelHBox.Accessible.SetShouldIgnore (true); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/PackageReferencePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/PackageReferencePanel.cs index 01908be400e..21367d25733 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/PackageReferencePanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/PackageReferencePanel.cs @@ -257,8 +257,8 @@ internal static string GetMatchMarkup (Gtk.Widget widget, string text, int[] mat { StringBuilder result = new StringBuilder (); int lastPos = 0; - var color = HslColor.GenerateHighlightColors (widget.Style.Base (StateType.Normal), - widget.Style.Text (StateType.Normal), 3)[2]; + //var color = HslColor.GenerateHighlightColors (widget.Style.Base (StateType.Normal), + // widget.Style.Text (StateType.Normal), 3)[2]; for (int n=0; n < matches.Length; n++) { int pos = matches[n] - startIndex; if (pos < 0 || pos >= text.Length) @@ -266,7 +266,7 @@ internal static string GetMatchMarkup (Gtk.Widget widget, string text, int[] mat if (pos - lastPos > 0) result.Append (GLib.Markup.EscapeText (text.Substring (lastPos, pos - lastPos))); result.Append (""); result.Append (GLib.Markup.EscapeText (text[pos].ToString ())); result.Append (""); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs index 20ed1549eea..a3cc075944e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs @@ -495,7 +495,7 @@ public MonoDevelop.Components.SearchEntry FilterEntry { public CombinedBox () { - filterEntry = new SearchEntry (); + filterEntry = new MonoDevelop.Components.SearchEntry (); filterEntry.WidthRequest = 180; filterEntry.Ready = true; filterEntry.ForceFilterButtonVisible = true; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs index 92730bfbed8..40284be5ae8 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs @@ -99,7 +99,7 @@ void OnUpdateClicked (object s, StatusBarIconClickedEventArgs args) if (args.Button == Xwt.PointerButton.Left) { HideAlert (); //oe OpenAddinManagerWindow (); - AddinManagerWindow.Run (IdeApp.Workbench.RootWindow.Visible ? IdeApp.Workbench.RootWindow : null); + //AddinManagerWindow.Run (IdeApp.Workbench.RootWindow.Visible ? IdeApp.Workbench.RootWindow : null); } } @@ -142,7 +142,7 @@ public async static void ShowManager () } HideAlert (); //oe OpenAddinManagerWindow (); - AddinManagerWindow.Run (IdeApp.Workbench.RootWindow.Visible ? IdeApp.Workbench.RootWindow : null); + //AddinManagerWindow.Run (IdeApp.Workbench.RootWindow.Visible ? IdeApp.Workbench.RootWindow : null); } public static void HideAlert () diff --git a/main/src/core/MonoDevelop.Startup/app.config b/main/src/core/MonoDevelop.Startup/app.config index e28805ea35e..9076f3f886f 100644 --- a/main/src/core/MonoDevelop.Startup/app.config +++ b/main/src/core/MonoDevelop.Startup/app.config @@ -31,7 +31,7 @@ - + diff --git a/main/src/tools/mdmonitor/InstrumentationViewerDialog.cs b/main/src/tools/mdmonitor/InstrumentationViewerDialog.cs index ecf5101a598..cd5ec54b4a9 100644 --- a/main/src/tools/mdmonitor/InstrumentationViewerDialog.cs +++ b/main/src/tools/mdmonitor/InstrumentationViewerDialog.cs @@ -73,9 +73,9 @@ protected override void OnRealized () { base.OnRealized (); - var c = Style.Background (Gtk.StateType.Normal).ToXwtColor (); - c.Light -= 0.1; - headerBox.ModifyBg (Gtk.StateType.Normal, c.ToGdkColor ()); + //var c = Style.Background (Gtk.StateType.Normal).ToXwtColor (); + //c.Light -= 0.1; + //headerBox.ModifyBg (Gtk.StateType.Normal, c.ToGdkColor ()); } diff --git a/main/src/tools/mdmonitor/TimeLineView.cs b/main/src/tools/mdmonitor/TimeLineView.cs index 329e6e10608..8d1c48a7ae1 100644 --- a/main/src/tools/mdmonitor/TimeLineView.cs +++ b/main/src/tools/mdmonitor/TimeLineView.cs @@ -361,52 +361,52 @@ protected override bool OnButtonPressEvent (EventButton evnt) // // DateTime initialTime = mainValue.TimeStamp; // -// Cairo.Context ctx = CairoHelper.Create (GdkWindow); +// Cairo.Context ctx = CairoHelper.Create (GdkWindow); +// +// using (Gdk.GC gc = new Gdk.GC (GdkWindow)) { +// gc.RgbFgColor = Style.White; +// GdkWindow.DrawRectangle (gc, true, 0, 0, Allocation.Width, Allocation.Height); +// +// // Draw full time marker +// +// ctx.NewPath (); +// ctx.Rectangle (markerX, ytop + baseTime + 0.5, MarkerWidth / 2, ((mainValue.Duration.TotalMilliseconds * scale) / 1000)); +// HslColor hsl = Style.Foreground (Gtk.StateType.Normal); +// hsl.L = 0.8; +// ctx.SetSourceColor (hsl); +// ctx.Fill (); +// +// // Draw values +// +// foreach (CounterValueInfo val in data) { +// DrawValue (ctx, gc, initialTime, ytop, lx, tx, ref ty, ref maxx, ref maxy, 0, val); +// } +// +// if (ty > maxy) +// maxy = ty; +// +// int totalms = (int)mainValue.Duration.TotalMilliseconds; +// int marks = (totalms / 1000) + 1; +// +// ctx.LineWidth = 1; +// gc.RgbFgColor = Style.Foreground (Gtk.StateType.Normal); +// +// for (int n = 0; n <= marks; n++) { +// ctx.NewPath (); +// int y = ytop + (int)(n * scale) + baseTime; +// ctx.MoveTo (markerX, y + 0.5); +// ctx.LineTo (markerX + MarkerWidth, y + 0.5); +// ctx.SetSourceColor (Style.Foreground (Gtk.StateType.Normal).ToCairoColor ()); +// ctx.Stroke (); +// +// y += 2; +// layout.SetText (n + "s"); +// GdkWindow.DrawLayout (gc, markerX + 1, y + 2, layout); +// +// int tw, th; +// layout.GetPixelSize (out tw, out th); +// y += th; // -// using (Gdk.GC gc = new Gdk.GC (GdkWindow)) { -// gc.RgbFgColor = Style.White; -// GdkWindow.DrawRectangle (gc, true, 0, 0, Allocation.Width, Allocation.Height); -// -// // Draw full time marker -// -// ctx.NewPath (); -// ctx.Rectangle (markerX, ytop + baseTime + 0.5, MarkerWidth / 2, ((mainValue.Duration.TotalMilliseconds * scale) / 1000)); -// HslColor hsl = Style.Foreground (Gtk.StateType.Normal); -// hsl.L = 0.8; -// ctx.SetSourceColor (hsl); -// ctx.Fill (); -// -// // Draw values -// -// foreach (CounterValueInfo val in data) { -// DrawValue (ctx, gc, initialTime, ytop, lx, tx, ref ty, ref maxx, ref maxy, 0, val); -// } -// -// if (ty > maxy) -// maxy = ty; -// -// int totalms = (int)mainValue.Duration.TotalMilliseconds; -// int marks = (totalms / 1000) + 1; -// -// ctx.LineWidth = 1; -// gc.RgbFgColor = Style.Foreground (Gtk.StateType.Normal); -// -// for (int n = 0; n <= marks; n++) { -// ctx.NewPath (); -// int y = ytop + (int)(n * scale) + baseTime; -// ctx.MoveTo (markerX, y + 0.5); -// ctx.LineTo (markerX + MarkerWidth, y + 0.5); -// ctx.SetSourceColor (Style.Foreground (Gtk.StateType.Normal).ToCairoColor ()); -// ctx.Stroke (); -// -// y += 2; -// layout.SetText (n + "s"); -// GdkWindow.DrawLayout (gc, markerX + 1, y + 2, layout); -// -// int tw, th; -// layout.GetPixelSize (out tw, out th); -// y += th; -// // if (y > maxy) // maxy = y; // } @@ -526,12 +526,12 @@ void DrawExpander (Cairo.Context ctx, double ex, double ey, bool expanded, bool ctx.NewPath (); ctx.LineWidth = 1; ctx.Rectangle (ex, ey, ExpanderSize, ExpanderSize); - if (hilight) - ctx.SetSourceColor (Style.Background (Gtk.StateType.Normal).ToCairoColor ()); - else + //if (hilight) + //ctx.SetSourceColor (Style.Background (Gtk.StateType.Normal).ToCairoColor ()); + //else ctx.SetSourceColor (Style.White.ToCairoColor ()); ctx.FillPreserve (); - ctx.SetSourceColor (Style.Foreground (Gtk.StateType.Normal).ToCairoColor ()); + //ctx.SetSourceColor (Style.Foreground (Gtk.StateType.Normal).ToCairoColor ()); ctx.Stroke (); ctx.NewPath (); ctx.MoveTo (ex + 2, ey + (ExpanderSize/2)); @@ -543,13 +543,13 @@ void DrawExpander (Cairo.Context ctx, double ex, double ey, bool expanded, bool ctx.Stroke (); } - protected override void OnDestroyed () + protected override void OnDestroyed () { if (layout != null) { layout.Dispose (); layout = null; - } - base.OnDestroyed (); + } + base.OnDestroyed (); } } } diff --git a/main/src/tools/mdmonitor/TimeStatisticsView.cs b/main/src/tools/mdmonitor/TimeStatisticsView.cs index 0d5683ef5cc..67b8bb55c1c 100644 --- a/main/src/tools/mdmonitor/TimeStatisticsView.cs +++ b/main/src/tools/mdmonitor/TimeStatisticsView.cs @@ -65,7 +65,7 @@ public TimeStatisticsView (Gtk.Widget parent) typeof(Gdk.Color)); // Color treeView.Model = store; - normalColor = parent.Style.Foreground (StateType.Normal); + //normalColor = parent.Style.Foreground (StateType.Normal); CellRendererText crt = new CellRendererText (); CellRendererPixbuf crp = new CellRendererPixbuf (); From d90e234c88d11a9572f7bec114282635523dfb42 Mon Sep 17 00:00:00 2001 From: makiwolf Date: Sun, 7 Jan 2024 00:13:08 +0100 Subject: [PATCH 166/382] add dll --- main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj index 96d96e45bb1..743af31f032 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj @@ -73,6 +73,10 @@ + + + + From 04dcf83c33a65746b0a8fe3170a435f1a4381c17 Mon Sep 17 00:00:00 2001 From: makiwolf Date: Sun, 7 Jan 2024 01:10:50 +0100 Subject: [PATCH 167/382] add reference --- main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj index 743af31f032..fc8c1bbee5f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj @@ -77,6 +77,9 @@ + + + From 0e8e366f79b47e24a282713943054452093592e8 Mon Sep 17 00:00:00 2001 From: makiwolf Date: Sun, 7 Jan 2024 22:03:25 +0100 Subject: [PATCH 168/382] Mono.Addins.Setup.HttpClientProvider enable it again after changing submodule --- main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs index 9af00c02df1..edb21631192 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs @@ -131,7 +131,7 @@ public static void Initialize (bool updateAddinRegistry) WebRequestHelper.Initialize (); Web.HttpClientProvider.Initialize (); - //Mono.Addins.Setup.HttpClientProvider.SetHttpClientFactory (Web.HttpClientProvider.CreateHttpClient); + Mono.Addins.Setup.HttpClientProvider.SetHttpClientFactory (Web.HttpClientProvider.CreateHttpClient); //have to do this after the addin service and property service have initialized if (UserDataMigrationService.HasSource) { From 8aa9bfe941f196f67733affe8ece9791d91b4cc1 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:47:41 +0100 Subject: [PATCH 169/382] update to own fork --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 67144c66e4b..d6d596badc3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -41,4 +41,4 @@ branch = dotdevelop [submodule "main/external/xwt"] path = main/external/xwt - url = https://github.com/dotdevelop/xwt.git + url = https://github.com/MakiWolf/xwt.git From 517be148049cb0fe14976b31a95bf09ef292c510 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 8 Jan 2024 23:25:37 +0100 Subject: [PATCH 170/382] update xwt with latest changes from master --- main/external/xwt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/external/xwt b/main/external/xwt index b191f50b079..7db9fde8a48 160000 --- a/main/external/xwt +++ b/main/external/xwt @@ -1 +1 @@ -Subproject commit b191f50b079c49df4426302fe84c53baeec6c721 +Subproject commit 7db9fde8a48d9f3211bc4ba202d3cde14d9b794c From e648febaa81066b3c2408d0cd207384074e7da04 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 9 Jan 2024 00:08:54 +0100 Subject: [PATCH 171/382] update xwt --- main/external/xwt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/external/xwt b/main/external/xwt index 7db9fde8a48..5df67c0c04a 160000 --- a/main/external/xwt +++ b/main/external/xwt @@ -1 +1 @@ -Subproject commit 7db9fde8a48d9f3211bc4ba202d3cde14d9b794c +Subproject commit 5df67c0c04a4a0d74ed2864da2f1e3c60e4b8dc7 From 23f97645bb640ab78e551d0e9471fbf8d6597012 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 10 Jan 2024 19:51:28 +0100 Subject: [PATCH 172/382] change to dotdevelop --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index d6d596badc3..67144c66e4b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -41,4 +41,4 @@ branch = dotdevelop [submodule "main/external/xwt"] path = main/external/xwt - url = https://github.com/MakiWolf/xwt.git + url = https://github.com/dotdevelop/xwt.git From b24e007d5cd0d2ba45d0293b3faabfcdcf920782 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 10 Jan 2024 19:55:13 +0100 Subject: [PATCH 173/382] update submodule --- main/external/xwt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/external/xwt b/main/external/xwt index 5df67c0c04a..31b3374bb8b 160000 --- a/main/external/xwt +++ b/main/external/xwt @@ -1 +1 @@ -Subproject commit 5df67c0c04a4a0d74ed2864da2f1e3c60e4b8dc7 +Subproject commit 31b3374bb8b30f03b0444989a35cb2d6872931a9 From 8018a8cf3b98ef7e06c28d5531a647eaa072238a Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 10 Jan 2024 20:34:07 +0100 Subject: [PATCH 174/382] if else statements --- main/msbuild/ReferencesGtk.props | 1 + .../MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs | 4 ++++ main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/main/msbuild/ReferencesGtk.props b/main/msbuild/ReferencesGtk.props index 08a4a084124..8a0f003da35 100644 --- a/main/msbuild/ReferencesGtk.props +++ b/main/msbuild/ReferencesGtk.props @@ -10,6 +10,7 @@ + diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs index a2d7ed85648..af4dcf53bde 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs @@ -29,7 +29,11 @@ using System; using Mono.Addins; using Mono.Addins.Setup; +#if GTK3 using Mono.Addins.GuiGtk3; +#else +using Mono.Addins.Gui; +#endif using MonoDevelop.Core; using System.Threading.Tasks; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs index 7eb9f7fa0e4..48c8f8bbe90 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs @@ -33,7 +33,11 @@ using MonoDevelop.Core; using MonoDevelop.Core.Instrumentation; using Mono.Addins; +#if GTK3 using Mono.Addins.GuiGtk3; +#else +using Mono.Addins.Gui; +#endif using Mono.Addins.Setup; using MonoDevelop.Components.Commands; From 53ade7be4ee61bbf7f93b84cdd001a6429508043 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 11 Jan 2024 23:15:49 +0100 Subject: [PATCH 175/382] fix reference and remove gtk3 from github actions --- .github/workflows/monodevelop.yml | 2 +- main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/monodevelop.yml b/.github/workflows/monodevelop.yml index 47115499a38..1a5f9e818de 100644 --- a/.github/workflows/monodevelop.yml +++ b/.github/workflows/monodevelop.yml @@ -45,7 +45,7 @@ jobs: # Synchronise Mono SSL certs cert-sync /etc/ssl/certs/ca-certificates.crt # Install extra packages required for dotdevelop build - sudo apt-get install -y sed git build-essential intltool nuget fsharp gtk-sharp3 + sudo apt-get install -y sed git build-essential intltool nuget fsharp sudo apt-get install -y software-properties-common sudo apt-get update - name: Verify OS and tools versions diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj index fc8c1bbee5f..8599fbef660 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj @@ -68,7 +68,7 @@ - + From 9320fe7598b9292fc03f54d1e7bae1a4c9024fb1 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 12 Jan 2024 20:43:16 +0100 Subject: [PATCH 176/382] change submodule to fork --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 67144c66e4b..87f810e22f4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,7 +13,7 @@ url = https://github.com/dotdevelop/mdtestharness.git [submodule "main/external/mono-addins"] path = main/external/mono-addins - url = https://github.com/dotdevelop/mono-addins.git + url = https://github.com/easysimplified/mono-addins.git [submodule "main/external/mono-tools"] path = main/external/mono-tools url = https://github.com/dotdevelop/mono-tools.git From a81ae55ece24f91ec2469256d6fe517764e38b79 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 12 Jan 2024 20:45:43 +0100 Subject: [PATCH 177/382] update submodule --- main/external/mono-addins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/external/mono-addins b/main/external/mono-addins index cddcc8052c5..9789d563799 160000 --- a/main/external/mono-addins +++ b/main/external/mono-addins @@ -1 +1 @@ -Subproject commit cddcc8052c57447c9422a85dabbbf2a872b4e415 +Subproject commit 9789d563799b8b5487d9be1102cd868397958331 From e76acc4e855aa6b3a880869c1e9c2f837a9d5213 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 12 Jan 2024 20:54:38 +0100 Subject: [PATCH 178/382] enable again --- .../MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs | 2 +- .../MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs index af4dcf53bde..927ffb5482e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs @@ -44,7 +44,7 @@ class SetupApp: IApplication public Task Run (string[] arguments) { Gtk.Application.Init (); - //AddinManagerWindow.Run (null); + AddinManagerWindow.Run (null); return Task.FromResult (0); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs index 40284be5ae8..61ef6b1c9d4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs @@ -28,7 +28,11 @@ using Mono.Addins.Setup; using Gtk; using MonoDevelop.Core.ProgressMonitoring; +#if GTK3 using Mono.Addins.GuiGtk3; +#else +using Mono.Addins.Gui; +#endif using MonoDevelop.Ide.ProgressMonitoring; using Mono.Addins; using MonoDevelop.Core.Setup; @@ -99,7 +103,7 @@ void OnUpdateClicked (object s, StatusBarIconClickedEventArgs args) if (args.Button == Xwt.PointerButton.Left) { HideAlert (); //oe OpenAddinManagerWindow (); - //AddinManagerWindow.Run (IdeApp.Workbench.RootWindow.Visible ? IdeApp.Workbench.RootWindow : null); + AddinManagerWindow.Run (IdeApp.Workbench.RootWindow.Visible ? IdeApp.Workbench.RootWindow : null); } } @@ -142,7 +146,7 @@ public async static void ShowManager () } HideAlert (); //oe OpenAddinManagerWindow (); - //AddinManagerWindow.Run (IdeApp.Workbench.RootWindow.Visible ? IdeApp.Workbench.RootWindow : null); + AddinManagerWindow.Run (IdeApp.Workbench.RootWindow.Visible ? IdeApp.Workbench.RootWindow : null); } public static void HideAlert () From 0b10a960911db4a9fd1cead25650ac237eade516 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 12 Jan 2024 21:17:05 +0100 Subject: [PATCH 179/382] enable again --- .../IExtendedTitleBarDialogBackend.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarDialogBackend.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarDialogBackend.cs index 2b965199268..7fdb8a317f5 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarDialogBackend.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarDialogBackend.cs @@ -26,7 +26,6 @@ using System; using Xwt.Backends; using Xwt.GtkBackend; -using Gtk; namespace MonoDevelop.Components.Extensions { @@ -45,18 +44,18 @@ public override void Initialize () toolbar = new HeaderBox (); toolbar.GradientBackground = true; toolbar.SetMargins (0, 1, 0, 0); - //MainBox.PackStart (toolbar, false, false, 0); - //((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0; + MainBox.PackStart (toolbar, false, false, 0); + ((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0; } public void SetHeaderContent (IWidgetBackend backend) { if (toolbar.Child != null) { - //WidgetBackend.RemoveChildPlacement (toolbar.Child); + WidgetBackend.RemoveChildPlacement (toolbar.Child); toolbar.Remove (toolbar.Child); } if (backend != null) { - //toolbar.Child = WidgetBackend.GetWidgetWithPlacement (backend); + toolbar.Child = WidgetBackend.GetWidgetWithPlacement (backend); toolbar.Show (); } else { toolbar.Hide (); From 8330c8028ba092743d8a99ef1c3161804c52de37 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 12 Jan 2024 21:27:03 +0100 Subject: [PATCH 180/382] enable again --- .../IExtendedTitleBarWindowBackend.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarWindowBackend.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarWindowBackend.cs index 4363496cd2c..dda0af1d649 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarWindowBackend.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarWindowBackend.cs @@ -44,18 +44,18 @@ public override void Initialize () toolbar = new HeaderBox (); toolbar.GradientBackground = true; toolbar.SetMargins (0, 1, 0, 0); - //MainBox.PackStart (toolbar, false, false, 0); - //((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0; + MainBox.PackStart (toolbar, false, false, 0); + ((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0; } public void SetHeaderContent (IWidgetBackend backend) { if (toolbar.Child != null) { - //WidgetBackend.RemoveChildPlacement (toolbar.Child); + WidgetBackend.RemoveChildPlacement (toolbar.Child); toolbar.Remove (toolbar.Child); } if (backend != null) { - //toolbar.Child = WidgetBackend.GetWidgetWithPlacement (backend); + toolbar.Child = WidgetBackend.GetWidgetWithPlacement (backend); toolbar.Show (); } else { toolbar.Hide (); From 6d9f697e5c12fbe41ccccdee3773f0e2cc896887 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 12 Jan 2024 21:40:23 +0100 Subject: [PATCH 181/382] enable again --- .../MonoDevelop.Components/ContextMenuExtensionsGtk.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs index 5ada2af2291..76b522957a7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs @@ -167,7 +167,7 @@ static Gtk.MenuItem CreateMenuItem (ContextMenuItem item) var img = new ImageView (item.Image); img.ShowAll (); imageItem.Image = img; - //Xwt.GtkBackend.GtkWorkarounds.ForceImageOnMenuItem (imageItem); + Xwt.GtkBackend.GtkWorkarounds.ForceImageOnMenuItem (imageItem); } } From b4589a2ea9edc5a69a9aa325be12b088cb70d483 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 12 Jan 2024 21:56:14 +0100 Subject: [PATCH 182/382] enable again --- .../TooltipProviderWrapper.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs index 3b135932b63..2c63dac0a27 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs @@ -121,10 +121,10 @@ public override Xwt.WindowFrame CreateTooltipWindow (MonoTextEditor editor, int var wrappedEditor = WrapEditor (editor); if (wrappedEditor == null) return null; - //var control = provider.CreateTooltipWindow (wrappedEditor, IdeApp.Workbench.ActiveDocument.DocumentContext, item, offset, modifierState.ToXwtValue ()); - //if (control == null) + var control = provider.CreateTooltipWindow (wrappedEditor, IdeApp.Workbench.ActiveDocument.DocumentContext, item, offset, modifierState.ToXwtValue ()); + if (control == null) return null; - //return control; + return control; } protected override void GetRequiredPosition (MonoTextEditor editor, Xwt.WindowFrame tipWindow, out int requiredWidth, out double xalign) @@ -144,7 +144,7 @@ public override Xwt.WindowFrame ShowTooltipWindow (MonoTextEditor editor, Xwt.Wi if (wrappedEditor == null) { return tipWindow; } - //provider.ShowTooltipWindow (wrappedEditor, tipWindow, item, modifierState.ToXwtValue (), mouseX, mouseY); + provider.ShowTooltipWindow (wrappedEditor, tipWindow, item, modifierState.ToXwtValue (), mouseX, mouseY); return tipWindow; } From 25a0007a7abe51ffd48286e63ada5f6c0afd0c6a Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 12 Jan 2024 22:35:45 +0100 Subject: [PATCH 183/382] enable again --- .../core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs index 32527339c8b..41b5be2dcbd 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs @@ -63,7 +63,7 @@ public RoundedFrame () public void SetFillColor (Cairo.Color color) { - //this.ModifyBase (Gtk.StateType.Normal, CairoExtensions.CairoColorToGdkColor (color)); + this.ModifyBase (Gtk.StateType.Normal, CairoExtensions.CairoColorToGdkColor (color)); this.ModifyBg (Gtk.StateType.Normal, CairoExtensions.CairoColorToGdkColor (color)); fill_color = color; fill_color_set = true; From fc7729a8d0410c193176619bc05f7d0890bf98cf Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 12 Jan 2024 22:52:41 +0100 Subject: [PATCH 184/382] enable again --- .../GtkTheme.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs index d9e3995cc3d..12f06cba800 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs @@ -41,20 +41,20 @@ public GtkTheme (Widget widget) : base(widget) { } - //public static Cairo.Color GetCairoTextMidColor (Widget widget) - //{ - //Cairo.Color text_color = CairoExtensions.GdkColorToCairoColor (widget.Style.Foreground (StateType.Normal)); - //Cairo.Color background_color = CairoExtensions.GdkColorToCairoColor (widget.Style.Background (StateType.Normal)); - //return CairoExtensions.AlphaBlend (text_color, background_color, 0.5); - //} + public static Cairo.Color GetCairoTextMidColor (Widget widget) + { + Cairo.Color text_color = CairoExtensions.GdkColorToCairoColor (widget.Style.Foreground (StateType.Normal)); + Cairo.Color background_color = CairoExtensions.GdkColorToCairoColor (widget.Style.Background (StateType.Normal)); + return CairoExtensions.AlphaBlend (text_color, background_color, 0.5); + } - //public static Gdk.Color GetGdkTextMidColor (Widget widget) - //{ - //Cairo.Color color = GetCairoTextMidColor (widget); - //Gdk.Color gdk_color = new Gdk.Color ((byte)(color.R * 255), (byte)(color.G * 255), (byte)(color.B * 255)); + public static Gdk.Color GetGdkTextMidColor (Widget widget) + { + Cairo.Color color = GetCairoTextMidColor (widget); + Gdk.Color gdk_color = new Gdk.Color ((byte)(color.R * 255), (byte)(color.G * 255), (byte)(color.B * 255)); // Gdk.Colormap.System.AllocColor (ref gdk_color, true, true); - //return gdk_color; - //} + return gdk_color; + } protected override void OnColorsRefreshed () { From 01070ccda6ed1b16f2cd781411a1e97b30b2d568 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 12 Jan 2024 23:05:34 +0100 Subject: [PATCH 185/382] update to System.Threading.Tasks.Task.Run --- .../AnalyzeCurrentProjectHandler.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/AnalyzeCurrentProjectHandler.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/AnalyzeCurrentProjectHandler.cs index cdd156cb8cd..82b8ce6dc14 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/AnalyzeCurrentProjectHandler.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/AnalyzeCurrentProjectHandler.cs @@ -77,18 +77,18 @@ internal static async void Execute () try { using (var monitor = IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (GettextCatalog.GetString ("Analyzing project"), null, false, true, false, null, true)) { CancellationToken token = monitor.CancellationToken; - // var allDiagnostics = await Task.Run (async delegate { - // var diagnosticList = new List (); - // monitor.BeginTask (GettextCatalog.GetString ("Analyzing {0}", project.Name), 1); - // var providers = await AnalyzeWholeSolutionHandler.GetProviders (analysisProject); - // diagnosticList.AddRange (await AnalyzeWholeSolutionHandler.GetDiagnostics (analysisProject, providers, token)); - // monitor.EndTask (); - // return diagnosticList; - // }).ConfigureAwait (false); + var allDiagnostics = await System.Threading.Tasks.Task.Run (async delegate { + var diagnosticList = new List (); + monitor.BeginTask (GettextCatalog.GetString ("Analyzing {0}", project.Name), 1); + var providers = await AnalyzeWholeSolutionHandler.GetProviders (analysisProject); + diagnosticList.AddRange (await AnalyzeWholeSolutionHandler.GetDiagnostics (analysisProject, providers, token)); + monitor.EndTask (); + return diagnosticList; + }).ConfigureAwait (false); - //await Runtime.RunInMainThread (delegate { - //AnalyzeWholeSolutionHandler.Report (monitor, allDiagnostics, project); - //}).ConfigureAwait (false); + await Runtime.RunInMainThread (delegate { + AnalyzeWholeSolutionHandler.Report (monitor, allDiagnostics, project); + }).ConfigureAwait (false); } } catch (OperationCanceledException) { } catch (AggregateException ae) { From 3190164a27712268a8cb6507cc34f7e8575d2cc0 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 12 Jan 2024 23:18:15 +0100 Subject: [PATCH 186/382] enable again --- .../core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs index 9a92d236167..d927c2885fc 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs @@ -30,7 +30,6 @@ using MonoDevelop.Ide; using MonoDevelop.Ide.Gui; using System.Linq; -using Gtk; #if MAC using AppKit; @@ -447,7 +446,7 @@ public class ThemedGtkWindowBackend : Xwt.GtkBackend.WindowBackend public override void Initialize () { base.Initialize (); - //IdeTheme.ApplyTheme (Window); + IdeTheme.ApplyTheme (Window); } } @@ -456,7 +455,7 @@ public class ThemedGtkDialogBackend : Xwt.GtkBackend.DialogBackend public override void Initialize () { base.Initialize (); - //IdeTheme.ApplyTheme (Window); + IdeTheme.ApplyTheme (Window); } } } From 9ac51d85f5edaba2cfff993fbbdd96dd1f8b9d4c Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 12 Jan 2024 23:29:56 +0100 Subject: [PATCH 187/382] enable again --- .../MonoDevelop.Components/DropDownBoxListWindow.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs index 5548e1d0450..0758b6b8be4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs @@ -607,8 +607,8 @@ protected override void OnRealized () void UpdateStyle () { - //if (IsRealized) - // GdkWindow.Background = Style.Base (StateType.Normal); + if (IsRealized) + GdkWindow.Background = Style.Base (StateType.Normal); if (layout != null) layout.Dispose (); layout = new Pango.Layout (PangoContext); From 7b4583105ebf876aa8c865bdfb273b91547c4b0d Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 13 Jan 2024 00:43:04 +0100 Subject: [PATCH 188/382] restore gtkworkarounds --- .../MonoDevelop.Components/GtkWorkarounds.cs | 584 +++++++++--------- .../Shared/GtkWorkarounds.cs | 24 +- 2 files changed, 296 insertions(+), 312 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs index 63162eea3fc..8e8de3984e2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs @@ -28,6 +28,7 @@ using System.Drawing; using System.Runtime.InteropServices; using System.Collections.Generic; +using System.Linq; using System.Reflection; using System.Reflection.Emit; using Gtk; @@ -38,184 +39,75 @@ #if MAC using AppKit; using MonoDevelop.Components.Mac; +using CoreGraphics; #endif #if WIN32 using System.Windows.Input; #endif +#if GTK3 +using TreeModel = Gtk.ITreeModel; +#endif namespace MonoDevelop.Components { - public static class GtkWorkarounds + public static partial class GtkWorkarounds { - const string LIBOBJC ="/usr/lib/libobjc.dylib"; +#if DD_GTK3_CHECK_FOR_REMOVE const string USER32DLL = "User32.dll"; - [DllImport (LIBOBJC, EntryPoint = "sel_registerName")] - static extern IntPtr sel_registerName (string selector); - - [DllImport (LIBOBJC, EntryPoint = "objc_getClass")] - static extern IntPtr objc_getClass (string klass); - - [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")] - static extern IntPtr objc_msgSend_IntPtr (IntPtr klass, IntPtr selector); - - [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")] - static extern void objc_msgSend_void_bool (IntPtr klass, IntPtr selector, bool arg); - - [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")] - static extern bool objc_msgSend_bool (IntPtr klass, IntPtr selector); - - [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")] - static extern int objc_msgSend_NSInt32_NSInt32 (IntPtr klass, IntPtr selector, int arg); - - [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")] - static extern long objc_msgSend_NSInt64_NSInt64 (IntPtr klass, IntPtr selector, long arg); - - [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")] - static extern uint objc_msgSend_NSUInt32 (IntPtr klass, IntPtr selector); - - [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")] - static extern ulong objc_msgSend_NSUInt64 (IntPtr klass, IntPtr selector); - - [DllImport (LIBOBJC, EntryPoint = "objc_msgSend_stret")] - static extern void objc_msgSend_CGRect32 (out CGRect32 rect, IntPtr klass, IntPtr selector); - - [DllImport (LIBOBJC, EntryPoint = "objc_msgSend_stret")] - static extern void objc_msgSend_CGRect64 (out CGRect64 rect, IntPtr klass, IntPtr selector); - - [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")] - static extern void objc_msgSend_NSInt64_NSInt32 (IntPtr klass, IntPtr selector, int arg); - - [DllImport (PangoUtil.LIBQUARTZ)] - static extern IntPtr gdk_quartz_window_get_nswindow (IntPtr window); - - struct CGRect32 - { - public float X, Y, Width, Height; - } - - struct CGRect64 - { - public double X, Y, Width, Height; - - public CGRect64 (CGRect32 rect32) - { - X = rect32.X; - Y = rect32.Y; - Width = rect32.Width; - Height = rect32.Height; - } - } - - static IntPtr cls_NSScreen; - static IntPtr sel_screens, sel_objectEnumerator, sel_nextObject, sel_frame, sel_visibleFrame, - sel_requestUserAttention, sel_setHasShadow, sel_invalidateShadow, sel_terminate; - static IntPtr sharedApp; - static IntPtr cls_NSEvent; - static IntPtr sel_modifierFlags; - - const int NSCriticalRequest = 0; - const int NSInformationalRequest = 10; - static System.Reflection.MethodInfo glibObjectGetProp, glibObjectSetProp; public static int GtkMinorVersion = 12, GtkMicroVersion = 0; - static bool oldMacKeyHacks = false; static GtkWorkarounds () { - if (Platform.IsMac) { - InitMac (); - } - - var flags = System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic; + var flags = System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | BindingFlags.DeclaredOnly; glibObjectSetProp = typeof (GLib.Object).GetMethod ("SetProperty", flags); glibObjectGetProp = typeof (GLib.Object).GetMethod ("GetProperty", flags); - foreach (int i in new [] { 24, 22, 20, 18, 16, 14 }) { - if (Gtk.Global.CheckVersion (2, (uint)i, 0) == null) { + // Gtk2 stopped at 24, most likely to be installed + for (int i = 24; i >= 14; i -= 2) { + if (Global.CheckVersion (2, (uint)i, 0) == null) { GtkMinorVersion = i; break; } } - for (int i = 1; i < 20; i++) { - if (Gtk.Global.CheckVersion (2, (uint)GtkMinorVersion, (uint)i) == null) { + for (int i = 1; i < 99; i++) { + if (Global.CheckVersion (2, (uint)GtkMinorVersion, (uint)i) == null) { GtkMicroVersion = i; } else { break; } } - //opt into the fixes on GTK+ >= 2.24.8 -// if (Platform.IsMac) { -// try { -// gdk_quartz_set_fix_modifiers (true); -// } catch (EntryPointNotFoundException) { -// oldMacKeyHacks = true; -// } -// } + // opt into the fixes on GTK+ >= 2.24.8 + if (Platform.IsMac && GtkMinorVersion >= 24 && GtkMicroVersion >= 8) { + try { + gdk_quartz_set_fix_modifiers (true); + } catch (EntryPointNotFoundException) { + // Do nothing, we removed the code which had backwards compat as we depend on a mono with the fix + } + } keymap.KeysChanged += delegate { mappedKeys.Clear (); }; } - static void InitMac () - { - cls_NSScreen = objc_getClass ("NSScreen"); - cls_NSEvent = objc_getClass ("NSEvent"); - sel_screens = sel_registerName ("screens"); - sel_objectEnumerator = sel_registerName ("objectEnumerator"); - sel_nextObject = sel_registerName ("nextObject"); - sel_visibleFrame = sel_registerName ("visibleFrame"); - sel_frame = sel_registerName ("frame"); - sel_requestUserAttention = sel_registerName ("requestUserAttention:"); - sel_modifierFlags = sel_registerName ("modifierFlags"); - sel_setHasShadow = sel_registerName ("setHasShadow:"); - sel_invalidateShadow = sel_registerName ("invalidateShadow"); - sel_terminate = sel_registerName ("terminate:"); - sharedApp = objc_msgSend_IntPtr (objc_getClass ("NSApplication"), sel_registerName ("sharedApplication")); - } - - static void MacTerminate () - { - objc_msgSend_NSInt64_NSInt32 (sharedApp, sel_terminate, 0); - } - - public static void Terminate () - { - if (Platform.IsMac) - MacTerminate (); - } - +#if MAC static Gdk.Rectangle MacGetUsableMonitorGeometry (Gdk.Screen screen, int monitor) { - IntPtr array = objc_msgSend_IntPtr (cls_NSScreen, sel_screens); - IntPtr iter = objc_msgSend_IntPtr (array, sel_objectEnumerator); - Gdk.Rectangle ygeometry = screen.GetMonitorGeometry (monitor); - Gdk.Rectangle xgeometry = screen.GetMonitorGeometry (0); - IntPtr scrn; - int i = 0; - - while ((scrn = objc_msgSend_IntPtr (iter, sel_nextObject)) != IntPtr.Zero && i < monitor) - i++; - - if (scrn == IntPtr.Zero) + var screens = NSScreen.Screens; + if ((uint)monitor >= screens.Length) return screen.GetMonitorGeometry (monitor); - CGRect64 visible, frame; + var macScreen = screens [monitor]; + CGRect visible = macScreen.VisibleFrame; + CGRect frame = macScreen.Frame; - if (IntPtr.Size == 8) { - objc_msgSend_CGRect64 (out visible, scrn, sel_visibleFrame); - objc_msgSend_CGRect64 (out frame, scrn, sel_frame); - } else { - CGRect32 visible32, frame32; - objc_msgSend_CGRect32 (out visible32, scrn, sel_visibleFrame); - objc_msgSend_CGRect32 (out frame32, scrn, sel_frame); - visible = new CGRect64 (visible32); - frame = new CGRect64 (frame32); - } + Gdk.Rectangle ygeometry = screen.GetMonitorGeometry (monitor); + Gdk.Rectangle xgeometry = screen.GetMonitorGeometry (0); // Note: Frame and VisibleFrame rectangles are relative to monitor 0, but we need absolute // coordinates. @@ -250,13 +142,10 @@ static Gdk.Rectangle MacGetUsableMonitorGeometry (Gdk.Screen screen, int monitor static void MacRequestAttention (bool critical) { - int kind = critical? NSCriticalRequest : NSInformationalRequest; - if (IntPtr.Size == 8) { - objc_msgSend_NSInt64_NSInt64 (sharedApp, sel_requestUserAttention, kind); - } else { - objc_msgSend_NSInt32_NSInt32 (sharedApp, sel_requestUserAttention, kind); - } + NSRequestUserAttentionType kind = critical ? NSRequestUserAttentionType.CriticalRequest : NSRequestUserAttentionType.InformationalRequest; + NSApplication.SharedApplication.RequestUserAttention (kind); } +#endif // Note: we can't reuse RectangleF because the layout is different... [StructLayout (LayoutKind.Sequential)] @@ -328,60 +217,79 @@ static Gdk.Rectangle WindowsGetUsableMonitorGeometry (Gdk.Screen screen, int mon return new Gdk.Rectangle (x, y, width, height); } - +#endif public static Gdk.Rectangle GetUsableMonitorGeometry (this Gdk.Screen screen, int monitor) { - if (Platform.IsWindows) - return WindowsGetUsableMonitorGeometry (screen, monitor); - - if (Platform.IsMac) - return MacGetUsableMonitorGeometry (screen, monitor); - + return Xwt.GtkBackend.GtkWorkarounds.GetUsableMonitorGeometry (screen, monitor); +#if DD_GTK3_CHECK_FOR_REMOVE +#if WIN32 + return WindowsGetUsableMonitorGeometry (screen, monitor); +#elif MAC + return MacGetUsableMonitorGeometry (screen, monitor); +#else return screen.GetMonitorGeometry (monitor); +#endif +#endif } public static int RunDialogWithNotification (Gtk.Dialog dialog) { - if (Platform.IsMac) - MacRequestAttention (dialog.Modal); + return Xwt.GtkBackend.GtkWorkarounds.RunDialogWithNotification (dialog); +#if DD_GTK3_CHECK_FOR_REMOVE +#if MAC + MacRequestAttention (dialog.Modal); +#endif +#endif return dialog.Run (); } public static void PresentWindowWithNotification (this Gtk.Window window) { + Xwt.GtkBackend.GtkWorkarounds.PresentWindowWithNotification (window); +#if DD_GTK3_CHECK_FOR_REMOVE window.Present (); - if (Platform.IsMac) { - var dialog = window as Gtk.Dialog; - MacRequestAttention (dialog == null? false : dialog.Modal); - } +#if MAC + MacRequestAttention (window is Gtk.Dialog && window.Modal); +#endif +#endif } public static GLib.Value GetProperty (this GLib.Object obj, string name) { + return Xwt.GtkBackend.GtkWorkarounds.GetProperty (obj, name); +#if DD_GTK3_CHECK_FOR_REMOVE return (GLib.Value) glibObjectGetProp.Invoke (obj, new object[] { name }); +#endif } public static void SetProperty (this GLib.Object obj, string name, GLib.Value value) { + Xwt.GtkBackend.GtkWorkarounds.SetProperty (obj, name,value); +#if DD_GTK3_CHECK_FOR_REMOVE glibObjectSetProp.Invoke (obj, new object[] { name, value }); +#endif } public static bool TriggersContextMenu (this Gdk.EventButton evt) { + return Xwt.GtkBackend.GtkWorkarounds.TriggersContextMenu (evt); +#if DD_GTK3_CHECK_FOR_REMOVE return evt.Type == Gdk.EventType.ButtonPress && IsContextMenuButton (evt); +#endif } public static bool IsContextMenuButton (this Gdk.EventButton evt) { + return Xwt.GtkBackend.GtkWorkarounds.IsContextMenuButton (evt); +#if DD_GTK3_CHECK_FOR_REMOVE if (evt.Button == 3 && (evt.State & (Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button2Mask)) == 0) return true; if (Platform.IsMac) { - if (!oldMacKeyHacks && - evt.Button == 1 && + if (evt.Button == 1 && (evt.State & Gdk.ModifierType.ControlMask) != 0 && (evt.State & (Gdk.ModifierType.Button2Mask | Gdk.ModifierType.Button3Mask)) == 0) { @@ -390,11 +298,15 @@ public static bool IsContextMenuButton (this Gdk.EventButton evt) } return false; +#endif + } public static Gdk.ModifierType GetCurrentKeyModifiers () { - #if WIN32 + return Xwt.GtkBackend.GtkWorkarounds.GetCurrentKeyModifiers (); +#if DD_GTK3_CHECK_FOR_REMOVE +#if WIN32 Gdk.ModifierType mtype = Gdk.ModifierType.None; ModifierKeys mod = Keyboard.Modifiers; if ((mod & ModifierKeys.Shift) > 0) @@ -406,36 +318,22 @@ public static Gdk.ModifierType GetCurrentKeyModifiers () if ((mod & ModifierKeys.Windows) > 0) mtype |= Gdk.ModifierType.Mod2Mask; // Command key return mtype; - #else - if (Platform.IsMac) { - Gdk.ModifierType mtype = Gdk.ModifierType.None; - ulong mod; - if (IntPtr.Size == 8) { - mod = objc_msgSend_NSUInt64 (cls_NSEvent, sel_modifierFlags); - } else { - mod = objc_msgSend_NSUInt32 (cls_NSEvent, sel_modifierFlags); - } - if ((mod & (1 << 17)) != 0) - mtype |= Gdk.ModifierType.ShiftMask; - if ((mod & (1 << 18)) != 0) - mtype |= Gdk.ModifierType.ControlMask; - if ((mod & (1 << 19)) != 0) - mtype |= Gdk.ModifierType.Mod1Mask; // Alt key - if ((mod & (1 << 20)) != 0) - mtype |= Gdk.ModifierType.Mod2Mask; // Command key - return mtype; - } - else { - Gdk.ModifierType mtype; - Gtk.Global.GetCurrentEventState (out mtype); - return mtype; - } - #endif +#elif MAC + return GtkMacInterop.ConvertModifierMask (NSEvent.CurrentModifierFlags); +#else + Gdk.ModifierType mtype; + Gtk.Global.GetCurrentEventState (out mtype); + return mtype; +#endif +#endif } public static void GetPageScrollPixelDeltas (this Gdk.EventScroll evt, double pageSizeX, double pageSizeY, out double deltaX, out double deltaY) { + Xwt.GtkBackend.GtkWorkarounds.GetPageScrollPixelDeltas (evt, pageSizeX, pageSizeY, out deltaX, out deltaY); + +#if DD_GTK3_CHECK_FOR_REMOVE if (!GetEventScrollDeltas (evt, out deltaX, out deltaY)) { var direction = evt.Direction; deltaX = deltaY = 0; @@ -451,19 +349,27 @@ public static void GetPageScrollPixelDeltas (this Gdk.EventScroll evt, double pa deltaX = -deltaX; } } +#endif } public static void AddValueClamped (this Gtk.Adjustment adj, double value) { + Xwt.GtkBackend.GtkWorkarounds.AddValueClamped (adj, value); +#if DD_GTK3_CHECK_FOR_REMOVE adj.Value = System.Math.Max (adj.Lower, System.Math.Min (adj.Value + value, adj.Upper - adj.PageSize)); +#endif } +#if DD_GTK3_CHECK_FOR_REMOVE [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] extern static bool gdk_event_get_scroll_deltas (IntPtr eventScroll, out double deltaX, out double deltaY); static bool scrollDeltasNotSupported; - +#endif public static bool GetEventScrollDeltas (Gdk.EventScroll evt, out double deltaX, out double deltaY) { + return Xwt.GtkBackend.GtkWorkarounds.GetEventScrollDeltas (evt, out deltaX, out deltaY); +#if DD_GTK3_CHECK_FOR_REMOVE + if (!scrollDeltasNotSupported) { try { return gdk_event_get_scroll_deltas (evt.Handle, out deltaX, out deltaY); @@ -473,10 +379,12 @@ public static bool GetEventScrollDeltas (Gdk.EventScroll evt, out double deltaX, } deltaX = deltaY = 0; return false; +#endif } static void ShowContextMenuInternal (Gtk.Menu menu, Gtk.Widget parent, int ix, int iy, Gdk.Rectangle caret, Gdk.Window window, uint time, uint button) { + Gtk.MenuPositionFunc posFunc = null; if (parent != null) { @@ -560,6 +468,7 @@ public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, Gdk.EventB public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, int ix, int iy, Gdk.Rectangle caret) { + int x, y; var window = parent.GdkWindow; var alloc = parent.Allocation; @@ -577,11 +486,15 @@ public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, int ix, in } ShowContextMenuInternal (menu, parent, x, y, caret, window, Gtk.Global.CurrentEventTime, 0); + } public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, Gdk.EventButton evt) { + Xwt.GtkBackend.GtkWorkarounds.ShowContextMenu (menu, parent, evt); +#if DD_GTK3_CHECK_FOR_REMOVE ShowContextMenu (menu, parent, evt, Gdk.Rectangle.Zero); +#endif } public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, int x, int y) @@ -594,6 +507,7 @@ public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, Gdk.Rectan ShowContextMenu (menu, parent, null, caret); } +#if DD_GTK3_CHECK_FOR_REMOVE struct MappedKeys { public Gdk.Key Key; @@ -611,6 +525,7 @@ struct MappedKeys static Gdk.Keymap keymap = Gdk.Keymap.Default; static Dictionary mappedKeys = new Dictionary (); +#endif /// Map raw GTK key input to work around platform bugs and decompose accelerator keys /// The raw key event @@ -620,6 +535,10 @@ struct MappedKeys public static void MapKeys (Gdk.EventKey evt, out Gdk.Key key, out Gdk.ModifierType state, out KeyboardShortcut[] shortcuts) { + Xwt.GtkBackend.GtkWorkarounds.MapKeys (evt,out key, out state, out var _shortcuts); + shortcuts = _shortcuts.Select (s => new KeyboardShortcut (s.Key, s.Modifier)) + .ToArray (); +#if DD_GTK3_CHECK_FOR_REMOVE //this uniquely identifies the raw key ulong id; unchecked { @@ -638,8 +557,11 @@ public static void MapKeys (Gdk.EventKey evt, out Gdk.Key key, out Gdk.ModifierT if (remapKey) { key = (Gdk.Key)evt.KeyValue; } +#endif } +#if DD_GTK3_CHECK_FOR_REMOVE + static MappedKeys MapKeys (Gdk.EventKey evt) { MappedKeys mapped; @@ -657,7 +579,7 @@ static MappedKeys MapKeys (Gdk.EventKey evt) TranslateKeyboardState (evt, modifier, grp, out keyval, out effectiveGroup, out level, out consumedModifiers); mapped.Key = (Gdk.Key)keyval; - mapped.State = FixMacModifiers (evt.State & ~consumedModifiers, grp); + mapped.State = evt.State & ~consumedModifiers; //decompose the key into accel combinations var accelList = new List (); @@ -671,7 +593,7 @@ static MappedKeys MapKeys (Gdk.EventKey evt) //fully decomposed TranslateKeyboardState (evt, Gdk.ModifierType.None, 0, out keyval, out effectiveGroup, out level, out consumedModifiers); - accelList.Add (new KeyboardShortcut ((Gdk.Key)keyval, FixMacModifiers (modifier, grp) & accelMods)); + accelList.Add (new KeyboardShortcut ((Gdk.Key)keyval, modifier & accelMods)); //with shift composed if ((modifier & Gdk.ModifierType.ShiftMask) != 0) { @@ -685,7 +607,7 @@ static MappedKeys MapKeys (Gdk.EventKey evt) // Prevent consumption of non-Shift modifiers (that we didn't even provide!) consumedModifiers &= Gdk.ModifierType.ShiftMask; - var m = FixMacModifiers ((modifier & ~consumedModifiers), grp) & accelMods; + var m = (modifier & ~consumedModifiers) & accelMods; AddIfNotDuplicate (accelList, new KeyboardShortcut ((Gdk.Key)keyval, m)); } @@ -697,7 +619,7 @@ static MappedKeys MapKeys (Gdk.EventKey evt) // Prevent consumption of Shift modifier (that we didn't even provide!) consumedModifiers &= ~Gdk.ModifierType.ShiftMask; - var m = FixMacModifiers ((modifier & ~consumedModifiers), 0) & accelMods; + var m = (modifier & ~consumedModifiers) & accelMods; AddIfNotDuplicate (accelList, new KeyboardShortcut ((Gdk.Key)keyval, m)); } @@ -705,7 +627,7 @@ static MappedKeys MapKeys (Gdk.EventKey evt) if (grp == 1 && (modifier & Gdk.ModifierType.ShiftMask) != 0) { TranslateKeyboardState (evt, modifier, 1, out keyval, out effectiveGroup, out level, out consumedModifiers); - var m = FixMacModifiers ((modifier & ~consumedModifiers), 0) & accelMods; + var m = (modifier & ~consumedModifiers) & accelMods; AddIfNotDuplicate (accelList, new KeyboardShortcut ((Gdk.Key)keyval, m)); } @@ -717,7 +639,7 @@ static MappedKeys MapKeys (Gdk.EventKey evt) } // Workaround for bug "Bug 688247 - Ctrl+Alt key not work on windows7 with bootcamp on a Mac Book Pro" - // Ctrl+Alt should behave like right alt key - unfortunately TranslateKeyboardState doesn't handle it. + // Ctrl+Alt should behave like right alt key - unfortunately TranslateKeyboardState doesn't handle it. static void TranslateKeyboardState (Gdk.EventKey evt, Gdk.ModifierType state, int group, out uint keyval, out int effective_group, out int level, out Gdk.ModifierType consumed_modifiers) { @@ -729,7 +651,7 @@ static void TranslateKeyboardState (Gdk.EventKey evt, Gdk.ModifierType state, in state = (state & ~ctrlAlt) | Gdk.ModifierType.Mod2Mask; group = 1; } - // Case: Caps lock on + shift + key + // Case: Caps lock on + shift + key // See: Bug 8069 - [UI Refresh] If caps lock is on, holding the shift key prevents typed characters from appearing if (state.HasFlag (Gdk.ModifierType.ShiftMask)) { state &= ~Gdk.ModifierType.ShiftMask; @@ -743,36 +665,7 @@ static void TranslateKeyboardState (Gdk.EventKey evt, Gdk.ModifierType state, in keyval = evt.KeyValue; } } - - static Gdk.ModifierType FixMacModifiers (Gdk.ModifierType mod, byte grp) - { - if (!oldMacKeyHacks) - return mod; - - // Mac GTK+ maps the command key to the Mod1 modifier, which usually means alt/ - // We map this instead to meta, because the Mac GTK+ has mapped the cmd key - // to the meta key (yay inconsistency!). IMO super would have been saner. - if ((mod & Gdk.ModifierType.Mod1Mask) != 0) { - mod ^= Gdk.ModifierType.Mod1Mask; - mod |= Gdk.ModifierType.MetaMask; - } - - //some versions of GTK map opt as mod5, which converts to the virtual super modifier - if ((mod & (Gdk.ModifierType.Mod5Mask | Gdk.ModifierType.SuperMask)) != 0) { - mod ^= (Gdk.ModifierType.Mod5Mask | Gdk.ModifierType.SuperMask); - mod |= Gdk.ModifierType.Mod1Mask; - } - - // When opt modifier is active, we need to decompose this to make the command appear correct for Mac. - // In addition, we can only inspect whether the opt/alt key is pressed by examining - // the key's "group", because the Mac GTK+ treats opt as a group modifier and does - // not expose it as an actual GDK modifier. - if (grp == (byte) 1) { - mod |= Gdk.ModifierType.Mod1Mask; - } - - return mod; - } +#endif public static Gdk.Key[] KeysForMod (Gdk.ModifierType mod) { @@ -784,20 +677,22 @@ public static Gdk.Key[] KeysForMod (Gdk.ModifierType mod) case Gdk.ModifierType.ShiftMask: return new Gdk.Key [] { Gdk.Key.Shift_R, Gdk.Key.Shift_L }; case Gdk.ModifierType.MetaMask: + // Just in case we get both of the modifiers + case Gdk.ModifierType.Mod2Mask | Gdk.ModifierType.MetaMask: return new Gdk.Key [] { Gdk.Key.Meta_R, Gdk.Key.Meta_L }; } return new Gdk.Key [0]; } +#if DD_GTK3_CHECK_FOR_REMOVE + static void AddIfNotDuplicate (List list, T item) where T : IEquatable { - for (int i = 0; i < list.Count; i++) { - if (list[i].Equals (item)) - return; - } - list.Add (item); + if (!list.Contains (item)) + list.Add (item); } + [System.Runtime.InteropServices.DllImport (PangoUtil.LIBGDK, CallingConvention = CallingConvention.Cdecl)] static extern IntPtr gdk_win32_drawable_get_handle (IntPtr drawable); @@ -839,9 +734,13 @@ public Win32Rect (int left, int top, int right, int bottom) [DllImport (USER32DLL)] static extern bool GetWindowRect (IntPtr hwnd, out Win32Rect rect); +#endif public static void SetImCursorLocation (Gtk.IMContext ctx, Gdk.Window clientWindow, Gdk.Rectangle cursor) { + Xwt.GtkBackend.GtkWorkarounds.SetImCursorLocation (ctx, clientWindow, cursor); + +#if DD_GTK3_CHECK_FOR_REMOVE // work around GTK+ Bug 663096 - Windows IME position is wrong when Aero glass is enabled // https://bugzilla.gnome.org/show_bug.cgi?id=663096 if (Platform.IsWindows && System.Environment.OSVersion.Version.Major >= 6) { @@ -859,48 +758,54 @@ public static void SetImCursorLocation (Gtk.IMContext ctx, Gdk.Window clientWind } } ctx.CursorLocation = cursor; +#endif } /// X coordinate of the pixels inside the right edge of the rectangle /// Workaround for inconsistency of Right property between GTK# versions - public static int RightInside (this Gdk.Rectangle rect) - { - return rect.X + rect.Width - 1; - } + public static int RightInside (this Gdk.Rectangle rect) => Xwt.GtkBackend.GtkWorkarounds.RightInside (rect); /// Y coordinate of the pixels inside the bottom edge of the rectangle /// Workaround for inconsistency of Bottom property between GTK# versions# - public static int BottomInside (this Gdk.Rectangle rect) - { - return rect.Y + rect.Height - 1; - } + public static int BottomInside (this Gdk.Rectangle rect)=> Xwt.GtkBackend.GtkWorkarounds.BottomInside (rect); /// /// Shows or hides the shadow of the window rendered by the native toolkit /// public static void ShowNativeShadow (Gtk.Window window, bool show) { - if (Platform.IsMac) { - var ptr = gdk_quartz_window_get_nswindow (window.GdkWindow.Handle); - objc_msgSend_void_bool (ptr, sel_setHasShadow, show); - } + Xwt.GtkBackend.GtkWorkarounds.ShowNativeShadow (window, show); +#if DD_GTK3_CHECK_FOR_REMOVE +#if MAC + var nsWindow = GtkMacInterop.GetNSWindow (window); + if (nsWindow != null) + nsWindow.HasShadow = show; +#endif +#endif } public static void UpdateNativeShadow (Gtk.Window window) { - if (!Platform.IsMac) - return; + Xwt.GtkBackend.GtkWorkarounds.UpdateNativeShadow (window); +#if DD_GTK3_CHECK_FOR_REMOVE +#if MAC + var nsWindow = GtkMacInterop.GetNSWindow (window); + if (nsWindow != null) + nsWindow.InvalidateShadow (); +#endif +#endif - var ptr = gdk_quartz_window_get_nswindow (window.GdkWindow.Handle); - objc_msgSend_IntPtr (ptr, sel_invalidateShadow); } +#if DD_GTK3_CHECK_FOR_REMOVE + [DllImport (PangoUtil.LIBGTKGLUE, CallingConvention = CallingConvention.Cdecl)] static extern void gtksharp_container_leak_fixed_marker (); static HashSet fixedContainerTypes; static Dictionary forallCallbacks; static bool containerLeakFixed; +#endif // Works around BXC #3801 - Managed Container subclasses are incorrectly resurrected, then leak. // It does this by registering an alternative callback for gtksharp_container_override_forall, which @@ -910,14 +815,16 @@ public static void UpdateNativeShadow (Gtk.Window window) // per-instance delegates. public static void FixContainerLeak (Gtk.Container c) { -return; + Xwt.GtkBackend.GtkWorkarounds.FixContainerLeak (c); +#if DD_GTK3_CHECK_FOR_REMOVE if (containerLeakFixed) { return; } FixContainerLeak (c.GetType ()); +#endif } - +#if DD_GTK3_CHECK_FOR_REMOVE static void FixContainerLeak (Type t) { if (containerLeakFixed) { @@ -959,7 +866,7 @@ static ForallDelegate CreateForallCallback (IntPtr gtype) typeof(GtkWorkarounds).Module, true); - //var invokerType = typeof(Gtk.Container.CallbackInvoker); + var invokerType = typeof(Gtk.Container.CallbackInvoker); //this was based on compiling a similar method and disassembling it ILGenerator il = dm.GetILGenerator (); @@ -970,7 +877,7 @@ static ForallDelegate CreateForallCallback (IntPtr gtype) var loc_container = il.DeclareLocal (typeof(Gtk.Container)); var loc_obj = il.DeclareLocal (typeof(object)); - //var loc_invoker = il.DeclareLocal (invokerType); + var loc_invoker = il.DeclareLocal (invokerType); var loc_ex = il.DeclareLocal (typeof(Exception)); //check that the type is an exact match @@ -1016,13 +923,13 @@ static ForallDelegate CreateForallCallback (IntPtr gtype) il.Emit (OpCodes.Ldloca_S, 2); il.Emit (OpCodes.Ldarg_2); il.Emit (OpCodes.Ldarg_3); - //il.Emit (OpCodes.Call, invokerType.GetConstructor ( - // BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[] { typeof (IntPtr), typeof (IntPtr) }, null)); + il.Emit (OpCodes.Call, invokerType.GetConstructor ( + BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[] { typeof (IntPtr), typeof (IntPtr) }, null)); il.Emit (OpCodes.Ldloc, loc_container); il.Emit (OpCodes.Ldarg_1); - //il.Emit (OpCodes.Ldloc, loc_invoker); - //il.Emit (OpCodes.Box, invokerType); - //il.Emit (OpCodes.Ldftn, invokerType.GetMethod ("Invoke")); + il.Emit (OpCodes.Ldloc, loc_invoker); + il.Emit (OpCodes.Box, invokerType); + il.Emit (OpCodes.Ldftn, invokerType.GetMethod ("Invoke")); il.Emit (OpCodes.Newobj, typeof (Gtk.Callback).GetConstructor ( BindingFlags.Instance | BindingFlags.Public, null, new Type[] { typeof (object), typeof (IntPtr) }, null)); var forallMeth = typeof (Gtk.Container).GetMethod ("ForAll", @@ -1050,29 +957,19 @@ static ForallDelegate CreateForallCallback (IntPtr gtype) [DllImport(PangoUtil.LIBGTKGLUE, CallingConvention = CallingConvention.Cdecl)] static extern void gtksharp_container_override_forall (IntPtr gtype, ForallDelegate cb); +#endif - const string urlRegexStr = @"(http|ftp)s?\:\/\/[\w\d\.,;_/\-~%@()+:?&^=#!]*[\w\d/]"; - static readonly Regex UrlRegex = new Regex (urlRegexStr, RegexOptions.Compiled | RegexOptions.ExplicitCapture); - - public static string MarkupLinks (string text) - { - if (GtkMinorVersion < 18) - return text; - return UrlRegex.Replace (text, MatchToUrl); - } - - static string MatchToUrl (System.Text.RegularExpressions.Match m) - { - var s = m.ToString (); - return String.Format ("{1}", s, s.Replace ("_", "__")); - } + public static string MarkupLinks (string text) => Xwt.GtkBackend.GtkWorkarounds.MarkupLinks (text); public static void SetLinkHandler (this Gtk.Label label, Action urlHandler) { + Xwt.GtkBackend.GtkWorkarounds.SetLinkHandler (label,urlHandler); +#if DD_GTK3_CHECK_FOR_REMOVE if (GtkMinorVersion >= 18) new UrlHandlerClosure (urlHandler).ConnectTo (label); +#endif } - +#if DD_GTK3_CHECK_FOR_REMOVE //create closure manually so we can apply ConnectBefore class UrlHandlerClosure { @@ -1092,8 +989,8 @@ void HandleLink (object sender, ActivateLinkEventArgs args) public void ConnectTo (Gtk.Label label) { -// var signal = GLib.Signal.Lookup (label, "activate-link", typeof(ActivateLinkEventArgs)); -// signal.AddDelegate (new EventHandler (HandleLink)); + var signal = GLib.Signal.Lookup (label, "activate-link", typeof(ActivateLinkEventArgs)); + signal.AddDelegate (new EventHandler (HandleLink)); } class ActivateLinkEventArgs : GLib.SignalArgs @@ -1101,7 +998,9 @@ class ActivateLinkEventArgs : GLib.SignalArgs public string Url { get { return (string)base.Args [0]; } } } } +#endif +#if DD_GTK3_CHECK_FOR_REMOVE static bool canSetOverlayScrollbarPolicy = true; [DllImport (PangoUtil.LIBQUARTZ)] @@ -1109,9 +1008,11 @@ class ActivateLinkEventArgs : GLib.SignalArgs [DllImport (PangoUtil.LIBQUARTZ)] static extern void gtk_scrolled_window_get_overlay_policy (IntPtr sw, out Gtk.PolicyType hpolicy, out Gtk.PolicyType vpolicy); - +#endif public static void SetOverlayScrollbarPolicy (Gtk.ScrolledWindow sw, Gtk.PolicyType hpolicy, Gtk.PolicyType vpolicy) { + Xwt.GtkBackend.GtkWorkarounds.SetOverlayScrollbarPolicy (sw, hpolicy, vpolicy); +#if DD_GTK3_CHECK_FOR_REMOVE // we know the .dll isn't there on Windows, so don't even try (avoids a first-chance DllNotFoundException) if (Platform.IsWindows) { canSetOverlayScrollbarPolicy = false; @@ -1128,10 +1029,13 @@ public static void SetOverlayScrollbarPolicy (Gtk.ScrolledWindow sw, Gtk.PolicyT } catch (EntryPointNotFoundException) { } canSetOverlayScrollbarPolicy = false; +#endif } public static void GetOverlayScrollbarPolicy (Gtk.ScrolledWindow sw, out Gtk.PolicyType hpolicy, out Gtk.PolicyType vpolicy) { + Xwt.GtkBackend.GtkWorkarounds.GetOverlayScrollbarPolicy (sw, out hpolicy, out vpolicy); +#if DD_GTK3_CHECK_FOR_REMOVE if (!canSetOverlayScrollbarPolicy) { hpolicy = vpolicy = 0; return; @@ -1144,26 +1048,33 @@ public static void GetOverlayScrollbarPolicy (Gtk.ScrolledWindow sw, out Gtk.Pol } hpolicy = vpolicy = 0; canSetOverlayScrollbarPolicy = false; +#endif } - +#if DD_GTK3_CHECK_FOR_REMOVE [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] static extern bool gtk_tree_view_get_tooltip_context (IntPtr raw, ref int x, ref int y, bool keyboard_tip, out IntPtr model, out IntPtr path, IntPtr iter); - +#endif //the GTK# version of this has 'out' instead of 'ref', preventing passing the x,y values in public static bool GetTooltipContext (this TreeView tree, ref int x, ref int y, bool keyboardTip, - out ITreeModel model, out TreePath path, out Gtk.TreeIter iter) + out TreeModel model, out TreePath path, out Gtk.TreeIter iter) { + return Xwt.GtkBackend.GtkWorkarounds.GetTooltipContext (tree, ref x, ref y, keyboardTip, out model, + out path, out iter); +#if DD_GTK3_CHECK_FOR_REMOVE IntPtr intPtr = Marshal.AllocHGlobal (Marshal.SizeOf (typeof(TreeIter))); IntPtr handle; IntPtr intPtr2; - bool result = gtk_tree_view_get_tooltip_context (tree.Handle, ref x, ref y, keyboardTip, out handle, out intPtr2, intPtr); + bool result = + gtk_tree_view_get_tooltip_context (tree.Handle, ref x, ref y, keyboardTip, out handle, out intPtr2, intPtr); model = TreeModelAdapter.GetObject (handle, false); path = intPtr2 == IntPtr.Zero ? null : ((TreePath)GLib.Opaque.GetOpaque (intPtr2, typeof(TreePath), false)); iter = TreeIter.New (intPtr); Marshal.FreeHGlobal (intPtr); return result; +#endif } +#if DD_GTK3_CHECK_FOR_REMOVE static bool supportsHiResIcons = true; [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] @@ -1186,19 +1097,28 @@ public static bool GetTooltipContext (this TreeView tree, ref int x, ref int y, [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] static extern IntPtr gtk_icon_set_render_icon_scaled (IntPtr handle, IntPtr style, int direction, int state, int size, IntPtr widget, IntPtr intPtr, ref double scale); +#endif public static IntPtr GetData (GLib.Object o, string name) { + return Xwt.GtkBackend.GtkWorkarounds.GetData (o, name); +#if DD_GTK3_CHECK_FOR_REMOVE return g_object_get_data (o.Handle, name); +#endif } public static void SetData (GLib.Object o, string name, IntPtr dataHandle) { + Xwt.GtkBackend.GtkWorkarounds.SetData (o, name, dataHandle); +#if DD_GTK3_CHECK_FOR_REMOVE g_object_set_data (o.Handle, name, dataHandle); +#endif } public static bool SetSourceScale (Gtk.IconSource source, double scale) { + return Xwt.GtkBackend.GtkWorkarounds.SetSourceScale (source, scale); +#if DD_GTK3_CHECK_FOR_REMOVE if (!supportsHiResIcons) return false; @@ -1210,10 +1130,13 @@ public static bool SetSourceScale (Gtk.IconSource source, double scale) } supportsHiResIcons = false; return false; +#endif } public static bool SetSourceScaleWildcarded (Gtk.IconSource source, bool setting) { + return Xwt.GtkBackend.GtkWorkarounds.SetSourceScaleWildcarded (source, setting); +#if DD_GTK3_CHECK_FOR_REMOVE if (!supportsHiResIcons) return false; @@ -1225,10 +1148,13 @@ public static bool SetSourceScaleWildcarded (Gtk.IconSource source, bool setting } supportsHiResIcons = false; return false; +#endif } public static Gdk.Pixbuf Get2xVariant (Gdk.Pixbuf px) { + return Xwt.GtkBackend.GtkWorkarounds.Get2xVariant (px); +#if DD_GTK3_CHECK_FOR_REMOVE if (!supportsHiResIcons) return null; @@ -1243,14 +1169,20 @@ public static Gdk.Pixbuf Get2xVariant (Gdk.Pixbuf px) } supportsHiResIcons = false; return null; +#endif } public static void Set2xVariant (Gdk.Pixbuf px, Gdk.Pixbuf variant2x) { + Xwt.GtkBackend.GtkWorkarounds.Set2xVariant (px, variant2x); +#if DD_GTK3_CHECK_FOR_REMOVE +#endif } public static double GetScaleFactor (Gtk.Widget w) { + return Xwt.GtkBackend.GtkWorkarounds.GetScaleFactor (w); +#if DD_GTK3_CHECK_FOR_REMOVE if (!supportsHiResIcons) return 1; @@ -1261,10 +1193,13 @@ public static double GetScaleFactor (Gtk.Widget w) } supportsHiResIcons = false; return 1; +#endif } public static double GetScaleFactor (this Gdk.Screen screen, int monitor) { + return Xwt.GtkBackend.GtkWorkarounds.GetScaleFactor (screen, monitor); +#if DD_GTK3_CHECK_FOR_REMOVE if (!supportsHiResIcons) return 1; @@ -1275,6 +1210,7 @@ public static double GetScaleFactor (this Gdk.Screen screen, int monitor) } supportsHiResIcons = false; return 1; +#endif } public static double GetScaleFactor () @@ -1284,6 +1220,8 @@ public static double GetScaleFactor () public static Gdk.Pixbuf RenderIcon (this Gtk.IconSet iconset, Gtk.Style style, Gtk.TextDirection direction, Gtk.StateType state, Gtk.IconSize size, Gtk.Widget widget, string detail, double scale) { + return Xwt.GtkBackend.GtkWorkarounds.RenderIcon (iconset,style,direction,state,size,widget,detail,scale); +#if DD_GTK3_CHECK_FOR_REMOVE if (scale == 1d) return iconset.RenderIcon (style, direction, state, size, widget, detail); @@ -1301,25 +1239,28 @@ public static Gdk.Pixbuf RenderIcon (this Gtk.IconSet iconset, Gtk.Style style, } supportsHiResIcons = false; return null; +#endif } +#if DD_GTK3_CHECK_FOR_REMOVE [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] static extern void gtk_object_set_data (IntPtr raw, IntPtr key, IntPtr data); -// public static void SetData (Gtk.Object gtkobject, string key, T data) where T: struct -// { -// IntPtr pkey = GLib.Marshaller.StringToPtrGStrdup (key); -// IntPtr pdata = Marshal.AllocHGlobal(Marshal.SizeOf(data)); -// Marshal.StructureToPtr(data, pdata, false); -// gtk_object_set_data (gtkobject.Handle, pkey, pdata); -// Marshal.FreeHGlobal(pdata); -// GLib.Marshaller.Free (pkey); -// gtkobject.Data [key] = data; -// } + public static void SetData (Gtk.Object gtkobject, string key, T data) where T: struct + { + IntPtr pkey = GLib.Marshaller.StringToPtrGStrdup (key); + IntPtr pdata = Marshal.AllocHGlobal(Marshal.SizeOf(data)); + Marshal.StructureToPtr(data, pdata, false); + gtk_object_set_data (gtkobject.Handle, pkey, pdata); + Marshal.FreeHGlobal(pdata); + GLib.Marshaller.Free (pkey); + gtkobject.Data [key] = data; + } +#endif public static void SetTransparentBgHint (this Widget widget, bool enable) { - //SetData (widget, "transparent-bg-hint", enable); + Xwt.GtkBackend.GtkWorkarounds.SetTransparentBgHint (widget,enable); } public static void SetMarkup (this Gtk.TextView view, string pangoMarkup) @@ -1373,6 +1314,9 @@ public static void InsertMarkup (this Gtk.TextBuffer buffer, TextIter iter, stri public static bool GetTagForAttributes (this Pango.AttrIterator iter, string name, out TextTag tag) { + return Xwt.GtkBackend.GtkWorkarounds.GetTagForAttributes (iter, name, out tag); + +#if DD_GTK3_CHECK_FOR_REMOVE tag = new TextTag (name); bool result = false; Pango.Attribute attr; @@ -1448,13 +1392,18 @@ public static bool GetTagForAttributes (this Pango.AttrIterator iter, string nam } return result; +#endif } - +#if DD_GTK3_CHECK_FOR_REMOVE [DllImport (PangoUtil.LIBPANGO, CallingConvention = CallingConvention.Cdecl)] private static extern IntPtr pango_attr_iterator_get (IntPtr raw, int type); - +#endif public static bool SafeGet (this Pango.AttrIterator iter, Pango.AttrType type, out Pango.Attribute attr) { + attr = Xwt.GtkBackend.GtkWorkarounds.SafeGetCopy (iter, type); + return attr != null; + +#if DD_GTK3_CHECK_FOR_REMOVE attr = null; try { IntPtr raw = pango_attr_iterator_get (iter.Handle, (int)type); @@ -1466,6 +1415,7 @@ public static bool SafeGet (this Pango.AttrIterator iter, Pango.AttrType type, o } catch { return false; } +#endif } public static bool IsChildOf (this Gtk.Widget child, Gtk.Widget widget) @@ -1495,6 +1445,8 @@ static void DisableButtonsInternal (Gtk.Window window) // minimize/maximize buttons. This may be because on Cocoa these are set at window creation and can only // be changed afterwards by directly accessing the window button and disabling it like so. NSWindow nsWindow = GtkMacInterop.GetNSWindow (window); + if (nsWindow == null) + return; nsWindow.StandardWindowButton (NSWindowButton.MiniaturizeButton).Enabled = false; nsWindow.StandardWindowButton (NSWindowButton.ZoomButton).Enabled = false; @@ -1530,28 +1482,60 @@ public static void EmitRemoveSignal(Container container, Widget child) GLib.Signal.Emit(container, "remove", child); #endif } + + internal static bool IsRunFromBundle () + { + bool result = false; +#if MAC + IntPtr mainBundle = GetMainBundle (); + var sel_bundleIdentifier = ObjCRuntime.Selector.GetHandle ("bundleIdentifier"); + + result = Messaging.IntPtr_objc_msgSend (mainBundle, sel_bundleIdentifier) != IntPtr.Zero; + + static IntPtr GetMainBundle () + { + var class_runningApplication = ObjCRuntime.Class.GetHandle ("NSBundle"); + var sel_mainBundle = ObjCRuntime.Selector.GetHandle ("mainBundle"); + + return Messaging.IntPtr_objc_msgSend (class_runningApplication, sel_mainBundle); + } +#endif + return result; + } + +#if MAC + [DllImport ("libgtk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] + static extern IntPtr gtk_get_current_event (); + + public static IntPtr GetCurrentEventHandle () => gtk_get_current_event (); + + [DllImport ("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] + static extern void gdk_event_free (IntPtr raw); + + public static void FreeEvent (IntPtr raw) + { + if (raw != IntPtr.Zero) + gdk_event_free (raw); + } +#endif + + public static int GtkMinorVersion => Xwt.GtkBackend.GtkWorkarounds.GtkMinorVersion; + } - public struct KeyboardShortcut : IEquatable + public readonly struct KeyboardShortcut : IEquatable { public static readonly KeyboardShortcut Empty = new KeyboardShortcut ((Gdk.Key) 0, (Gdk.ModifierType) 0); - Gdk.ModifierType modifier; - Gdk.Key key; - public KeyboardShortcut (Gdk.Key key, Gdk.ModifierType modifier) { - this.modifier = modifier; - this.key = key; + this.Modifier = modifier; + this.Key = key; } - public Gdk.Key Key { - get { return key; } - } + public Gdk.Key Key { get; } - public Gdk.ModifierType Modifier { - get { return modifier; } - } + public Gdk.ModifierType Modifier { get; } public bool IsEmpty { get { return Key == (Gdk.Key) 0; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Shared/GtkWorkarounds.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Shared/GtkWorkarounds.cs index 49f8a0d04e0..0c38af854ff 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Shared/GtkWorkarounds.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Shared/GtkWorkarounds.cs @@ -32,17 +32,17 @@ // Anything that only needs to be in MonoDevelop.Ide should go into the other part. namespace MonoDevelop.Components { -// public static partial class GtkWorkarounds -// { -// public static void Terminate () -// { -// #if MAC -// var app = Mac.Messaging.IntPtr_objc_msgSend ( -// ObjCRuntime.Class.GetHandle ("NSApplication"), -// ObjCRuntime.Selector.GetHandle ("sharedApplication")); + public static partial class GtkWorkarounds + { + public static void Terminate () + { +#if MAC + var app = Mac.Messaging.IntPtr_objc_msgSend ( + ObjCRuntime.Class.GetHandle ("NSApplication"), + ObjCRuntime.Selector.GetHandle ("sharedApplication")); -// Mac.Messaging.void_objc_msgSend_IntPtr (app, ObjCRuntime.Selector.GetHandle ("terminate:"), IntPtr.Zero); -// #endif -// } -// } + Mac.Messaging.void_objc_msgSend_IntPtr (app, ObjCRuntime.Selector.GetHandle ("terminate:"), IntPtr.Zero); +#endif + } + } } From a34f0812c11a0029a9ddee557dbdfdcee08fb215 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 13 Jan 2024 00:53:47 +0100 Subject: [PATCH 189/382] restore --- .../MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs index d927c2885fc..b3624545401 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs @@ -74,13 +74,8 @@ static IdeTheme () internal static void InitializeGtk (string progname, ref string[] args) { - // if (Gtk.Settings.Default != null) - // throw new InvalidOperationException ("Gtk already initialized!"); - - //HACK: we must initilize some Gtk rc before Gtk.Application is initialized on Mac/Windows - // otherwise it will not be loaded correctly and theme switching won't work. - if (!Platform.IsLinux) - UpdateGtkTheme (); + if (Gtk.Settings.Default != null) + throw new InvalidOperationException ("Gtk already initialized!"); IdeStartupTracker.StartupTracker.MarkSection ("PreGtkInitialization"); #if MAC From 89850d68eb5bccdae8a847f13f4290b45283d79a Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 13 Jan 2024 01:05:38 +0100 Subject: [PATCH 190/382] PlatformName --- .../core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs index 2511de75f68..a2565e293fe 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs @@ -153,9 +153,9 @@ internal string DefaultMonospaceFont { // get { return PlatformService.DefaultSansFont; } // } - // public static string PlatformName { - // get { return PlatformService.Name; } - // } + public string PlatformName { + get { return PlatformService.Name; } + } public void ShowUrl (string url) { From f240b7b73c105ab750fd3c3305dc608dba3a1e21 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 13 Jan 2024 01:17:00 +0100 Subject: [PATCH 191/382] restore fontservice --- .../MonoDevelop.Ide.Fonts/FontService.cs | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs index d136b3ea46d..995416eff0a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs @@ -44,25 +44,19 @@ public class FontService: Service Dictionary loadedFonts = new Dictionary (); Properties fontProperties; DesktopService desktopService; - static string defaultMonospaceFontName = String.Empty; - static string defaultSansFontName = String.Empty; - static FontDescription defaultMonospaceFont = new FontDescription (); - static FontDescription defaultSansFont = new FontDescription (); + + string defaultMonospaceFontName = String.Empty; + FontDescription defaultMonospaceFont = new FontDescription (); + void LoadDefaults () { if (defaultMonospaceFont != null) { defaultMonospaceFont.Dispose (); } - if (defaultSansFont != null) { - defaultSansFont.Dispose (); - } - #pragma warning disable 618 defaultMonospaceFontName = desktopService.DefaultMonospaceFont; defaultMonospaceFont = FontDescription.FromString (defaultMonospaceFontName); - //defaultSansFontName = DesktopService.DefaultSansFont; - defaultSansFont = FontDescription.FromString (defaultSansFontName); #pragma warning restore 618 } @@ -93,11 +87,12 @@ protected override async Task OnInitialize (ServiceProvider serviceProvider) LoadDefaults (); } - public static FontDescription MonospaceFont { get { return defaultMonospaceFont; } } - public static FontDescription SansFont { get { return defaultSansFont; } } - public static string MonospaceFontName { get { return defaultMonospaceFontName; } } - public static string SansFontName { get { return defaultSansFontName; } } + public FontDescription MonospaceFont { get { return defaultMonospaceFont; } } + public FontDescription SansFont { get { return Gui.Styles.DefaultFont; } } + + public string MonospaceFontName { get { return defaultMonospaceFontName; } } + public string SansFontName { get { return Gui.Styles.DefaultFontName; } } [Obsolete ("Use MonospaceFont")] public FontDescription DefaultMonospaceFontDescription { From 548c49e47548c229d4d9ca758b7ca676e146568e Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 13 Jan 2024 02:29:15 +0100 Subject: [PATCH 192/382] comment out default font --- main/src/addins/GnomePlatform/GnomePlatform.cs | 18 +++++++++--------- .../gtk-gui/gui.stetic | 1 + 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/main/src/addins/GnomePlatform/GnomePlatform.cs b/main/src/addins/GnomePlatform/GnomePlatform.cs index 96437cdd2f0..6d539fca1ed 100644 --- a/main/src/addins/GnomePlatform/GnomePlatform.cs +++ b/main/src/addins/GnomePlatform/GnomePlatform.cs @@ -89,15 +89,15 @@ public override string DefaultMonospaceFont { } } - public override string DefaultSansFont { - get { - try { - return (string)(Gio.GetGSettingsString ("org.gnome.desktop.interface", "document-font-name")); - } catch (Exception) { - return "Sans 11"; - } - } - } + // public override string DefaultSansFont { + // get { + // try { + // return (string)(Gio.GetGSettingsString ("org.gnome.desktop.interface", "document-font-name")); + // } catch (Exception) { + // return "Sans 11"; + // } + // } + // } public override string Name { get { return "Gnome"; } diff --git a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/gui.stetic b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/gui.stetic index d69a54be5d9..f62463f5c48 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/gui.stetic +++ b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/gui.stetic @@ -6,6 +6,7 @@ + From 7221d9ec26598b286aa289684b7ef0983425c975 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 13 Jan 2024 02:43:46 +0100 Subject: [PATCH 193/382] enable again --- .../MonoDevelopHexEditorStyle.cs | 146 +++++++++--------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/MonoDevelopHexEditorStyle.cs b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/MonoDevelopHexEditorStyle.cs index 3cf74e59fd9..fb5cfd0115a 100644 --- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/MonoDevelopHexEditorStyle.cs +++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/MonoDevelopHexEditorStyle.cs @@ -70,17 +70,17 @@ public void Dispose () IdeApp.Preferences.ColorScheme.Changed -= ColorSchemeChanged; } - // public override Color HexOffset { - // get { - // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.LineNumbers)); - // } - // } - - // public override Color HexOffsetBg { - // get { - // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.LineNumbersBackground)); - // } - // } + public override Color HexOffset { + get { + return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.LineNumbers)); + } + } + + public override Color HexOffsetBg { + get { + return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.LineNumbersBackground)); + } + } /* public override Color HexOffsetHighlighted { get { @@ -88,70 +88,70 @@ public void Dispose () } }*/ - // public override Color HexDigit { - // get { - // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Foreground)); - // } - // } - - // public override Color HexDigitBg { - // get { - // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Background)); - // } - // } - - // public override Color DashedLineFg { - // get { - // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Foreground)); - // } - // } - - // public override Color DashedLineBg { - // get { - // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Background)); - // } - // } - - // public override Color IconBarBg { - // get { - // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.IndicatorMarginSeparator)); - // } - // } - - // public override Color IconBarSeperator { - // get { - // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.IndicatorMarginSeparator)); - // } - // } - - // public override Color BookmarkColor1 { - // get { - // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.MessageBubbleWarningLine)); - // } - // } - - // public override Color BookmarkColor2 { - // get { - // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.MessageBubbleWarningLine2)); - // } - // } + public override Color HexDigit { + get { + return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Foreground)); + } + } + + public override Color HexDigitBg { + get { + return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Background)); + } + } + + public override Color DashedLineFg { + get { + return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Foreground)); + } + } + + public override Color DashedLineBg { + get { + return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Background)); + } + } + + public override Color IconBarBg { + get { + return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.IndicatorMarginSeparator)); + } + } + + public override Color IconBarSeperator { + get { + return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.IndicatorMarginSeparator)); + } + } + + public override Color BookmarkColor1 { + get { + return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.MessageBubbleWarningLine)); + } + } + + public override Color BookmarkColor2 { + get { + return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.MessageBubbleWarningLine2)); + } + } - // public override Color Selection { - // get { - // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Foreground)); - // } - // } + public override Color Selection { + get { + return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Foreground)); + } + } - // public override Color SelectionBg { - // get { - // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Selection)); - // } - // } + public override Color SelectionBg { + get { + return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.Selection)); + } + } - // public override Color HighlightOffset { - // get { - // return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.FindHighlight)); - // } - // } + public override Color HighlightOffset { + get { + return ConvertColor (SyntaxHighlightingService.GetColor (colorStyle, EditorThemeColors.FindHighlight)); + } + } } } From da53b18af6f1d285ed13869ef6de89f53ccb7125 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 13 Jan 2024 21:10:15 +0100 Subject: [PATCH 194/382] set background color --- .../MonoDevelop.Ide.Gui/Styles.cs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs index 075b2159020..fd757c47639 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs @@ -335,33 +335,33 @@ static Styles () TooltipInfoSpacing = 0; else TooltipInfoSpacing = -4; -// LoadStyle (); + LoadStyle (); } internal static void LoadStyle () { Gtk.StyleContext defaultStyle; Gtk.Widget styledWidget; -// if (IdeApp.Workbench == null || IdeApp.Workbench.RootWindow == null) { + if (IdeApp.Workbench == null || IdeApp.Workbench.RootWindow == null) { styledWidget = new Gtk.Label (String.Empty); defaultStyle = styledWidget.StyleContext; -// } else { -// styledWidget = IdeApp.Workbench.RootWindow; -// defaultStyle = Gtk.Rc.GetStyle (styledWidget); -// } + } else { + styledWidget = IdeApp.Workbench.RootWindow; + //defaultStyle = Gtk.Rc.GetStyle (styledWidget); + } -// BackgroundColor = defaultStyle.Background.ToXwtColor (); // must be the bg color from Gtkrc -// BaseBackgroundColor = defaultStyle.Base (Gtk.StateType.Normal).ToXwtColor (); // must be the base color from Gtkrc -// BaseForegroundColor = defaultStyle.Foreground (Gtk.StateType.Normal).ToXwtColor (); // must be the text color from Gtkrc -// BaseSelectionBackgroundColor = defaultStyle.Base (Gtk.StateType.Selected).ToXwtColor (); -// BaseSelectionTextColor = defaultStyle.Text (Gtk.StateType.Selected).ToXwtColor (); + BackgroundColor = Colors.Gray;//defaultStyle.Background.ToXwtColor (); // must be the bg color from Gtkrc + BaseBackgroundColor = Colors.Gray; //defaultStyle.Base (Gtk.StateType.Normal).ToXwtColor (); // must be the base color from Gtkrc + BaseForegroundColor = Colors.Gray;//defaultStyle.Foreground (Gtk.StateType.Normal).ToXwtColor (); // must be the text color from Gtkrc + BaseSelectionBackgroundColor =Colors.Gray;// defaultStyle.Base (Gtk.StateType.Selected).ToXwtColor (); + BaseSelectionTextColor =Colors.Gray;// defaultStyle.Text (Gtk.StateType.Selected).ToXwtColor (); LinkForegroundColor = Colors.Blue;//((Gdk.Color)styledWidget.StyleGetProperty ("link-color")).ToXwtColor (); if (LinkForegroundColor == Colors.Black) // the style returs black when not initialized LinkForegroundColor = Colors.Blue; // set the link color to generic blue until initialization is finished -// DefaultFont = defaultStyle.FontDescription.Copy (); -// DefaultFontName = DefaultFont.ToString (); + //DefaultFont = defaultStyle.FontDescription.Copy (); + //DefaultFontName = DefaultFont.ToString (); if (IdeApp.Preferences == null || IdeApp.Preferences.UserInterfaceTheme == Theme.Light) LoadLightStyle (); From 9070a8d248e2cc548a47f286fcbad96492998978 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 13 Jan 2024 21:35:00 +0100 Subject: [PATCH 195/382] MonoDevelop.Components.SearchEntry --- .../FindInFilesDialog.cs | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs index 4fb49494069..4a7aa52bd26 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs @@ -63,7 +63,7 @@ enum SearchScope { CheckButton checkbuttonRecursively; ComboBoxText comboboxentryReplace; ComboBoxText comboboxentryPath; - Gtk.SearchEntry searchentryFileMask; + MonoDevelop.Components.SearchEntry searchentryFileMask; Button buttonBrowsePaths; Button buttonReplace; Label labelFileMask; @@ -272,9 +272,9 @@ void SetupAccessibilityForPath () void SetupAccessibilityForSearch () { - //searchentryFileMask.SetEntryAccessibilityAttributes ("FindInFilesDialog.searchentryFileMask", - // labelFileMask.Text, - // GettextCatalog.GetString ("Enter the file mask")); + searchentryFileMask.SetEntryAccessibilityAttributes ("FindInFilesDialog.searchentryFileMask", + labelFileMask.Text, + GettextCatalog.GetString ("Enter the file mask")); } static void TableAddRow (Table table, uint row, Widget column1, Widget column2) @@ -499,18 +499,18 @@ void ShowFileMaskUI () }; labelFileMask.Show (); - //searchentryFileMask = new Gtk.SearchEntry () { - // ForceFilterButtonVisible = false, - // IsCheckMenu = true, - // ActiveFilterID = 0, - // Visible = true, - // Ready = true, - //}; + searchentryFileMask = new MonoDevelop.Components.SearchEntry () { + ForceFilterButtonVisible = false, + IsCheckMenu = true, + ActiveFilterID = 0, + Visible = true, + Ready = true, + }; - //searchentryFileMask.Query = properties.Get ("MonoDevelop.FindReplaceDialogs.FileMask", ""); + searchentryFileMask.Query = properties.Get ("MonoDevelop.FindReplaceDialogs.FileMask", ""); - //searchentryFileMask.Entry.ActivatesDefault = true; + searchentryFileMask.Entry.ActivatesDefault = true; searchentryFileMask.Show (); SetupAccessibilityForSearch (); @@ -523,7 +523,7 @@ void HideFileMaskUI () if (labelFileMask == null) return; - //properties.Set ("MonoDevelop.FindReplaceDialogs.FileMask", searchentryFileMask.Query); + properties.Set ("MonoDevelop.FindReplaceDialogs.FileMask", searchentryFileMask.Query); uint row = TableGetRowForItem (tableFindAndReplace, labelFileMask); TableRemoveRow (tableFindAndReplace, row, labelFileMask, searchentryFileMask, true); @@ -684,8 +684,8 @@ void StorePoperties () StoreHistory ("MonoDevelop.FindReplaceDialogs.FindHistory", comboboxentryFind); if (replaceMode) StoreHistory ("MonoDevelop.FindReplaceDialogs.ReplaceHistory", comboboxentryReplace); - //if (searchentryFileMask != null) - // properties.Set ("MonoDevelop.FindReplaceDialogs.FileMask", searchentryFileMask.Query); + if (searchentryFileMask != null) + properties.Set ("MonoDevelop.FindReplaceDialogs.FileMask", searchentryFileMask.Query); // StoreHistory ("MonoDevelop.FindReplaceDialogs.PathHistory", comboboxentryPath); //StoreHistory ("MonoDevelop.FindReplaceDialogs.FileMaskHistory", comboboxentryFileMask); } @@ -798,7 +798,7 @@ Scope GetScope () FilterOptions GetFilterOptions () { return new FilterOptions { - //FileMask = searchentryFileMask != null && !string.IsNullOrEmpty (searchentryFileMask.Query) ? searchentryFileMask.Query : "*", + FileMask = searchentryFileMask != null && !string.IsNullOrEmpty (searchentryFileMask.Query) ? searchentryFileMask.Query : "*", CaseSensitive = checkbuttonCaseSensitive.Active, RegexSearch = checkbuttonRegexSearch.Active, WholeWordsOnly = checkbuttonWholeWordsOnly.Active From 93573485e8f409b57124fb4fec5f3c94e56f6e51 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 13 Jan 2024 21:55:36 +0100 Subject: [PATCH 196/382] new solution dialog --- .../GtkNewProjectDialogBackend.UI.cs | 4 +- .../GtkNewProjectDialogBackend.cs | 129 +++++++++--------- 2 files changed, 66 insertions(+), 67 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs index 83019dde529..1ef2d6b96c1 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs @@ -178,7 +178,7 @@ void Build () templateCategoriesTreeView.Accessible.Description = GettextCatalog.GetString ("Select the project category to see all possible project templates"); templateCategoriesTreeView.BorderWidth = 0; templateCategoriesTreeView.HeadersVisible = false; - //templateCategoriesTreeView.Model = templateCategoriesListStore; + templateCategoriesTreeView.Model = templateCategoriesTreeStore; templateCategoriesTreeView.SearchColumn = -1; // disable the interactive search templateCategoriesTreeView.AppendColumn (CreateTemplateCategoriesTreeViewColumn ()); templateCategoriesScrolledWindow.Add (templateCategoriesTreeView); @@ -203,7 +203,7 @@ void Build () templatesTreeView.Accessible.SetTitle (GettextCatalog.GetString ("Project Templates")); templatesTreeView.Accessible.Description = GettextCatalog.GetString ("Select the project template"); templatesTreeView.HeadersVisible = false; - //templatesTreeView.Model = templatesListStore; + templatesTreeView.Model = templatesTreeStore; templatesTreeView.SearchColumn = -1; // disable the interactive search templatesTreeView.AppendColumn (CreateTemplateListTreeViewColumn ()); templatesScrolledWindow.Add (templatesTreeView); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs index c9ea523635a..511aa7f2ad9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs @@ -78,24 +78,8 @@ public GtkNewProjectDialogBackend () actionHandler.PerformShowMenu += PerformShowMenu; } - void ProjectCreationFailed (object obj, EventArgs args) => ShowProjectCreationAccessibityNotification (true); - void ProjectCreated(object obj, EventArgs args) => ShowProjectCreationAccessibityNotification (false); async void NextButtonClicked (object sender, EventArgs e) => await MoveToNextPage (); - void ShowProjectCreationAccessibityNotification (bool hasError) - { - var projectTemplate = controller.SelectedTemplate; - - string messageText; - - if (hasError) - messageText = GettextCatalog.GetString ("{0} failed to create", projectTemplate.Name); - else - messageText = GettextCatalog.GetString ("{0} successfully created", projectTemplate.Name); - - this.Accessible.MakeAccessibilityAnnouncement (messageText); - } - public void ShowDialog () { MessageService.ShowCustomDialog (this, IdeServices.DesktopService.GetFocusedTopLevelWindow ()); @@ -146,30 +130,35 @@ static void SetLanguageCellData (TreeViewColumn col, CellRenderer renderer, ITre var languageRenderer = (LanguageCellRenderer)renderer; languageRenderer.Template = template; languageRenderer.SelectedLanguage = language ?? template?.Language ?? string.Empty; - } - - void HandlePopup (SolutionTemplate template, uint eventTime) - { - if (popupMenu == null) { - popupMenu = new Xwt.Menu (); - //popupMenu.AttachToWidget (this, null); - } - ClearPopupMenuItems (); - AddLanguageMenuItems (popupMenu, template); - //popupMenu.ModifyBg (StateType.Normal, Styles.NewProjectDialog.TemplateLanguageButtonBackground.ToGdkColor ()); - //popupMenu.ShowAll (); - - MenuPositionFunc posFunc = (Menu m, out int x, out int y, out bool pushIn) => { - Gdk.Rectangle rect = languageCellRenderer.GetLanguageRect (); - Gdk.Rectangle screenRect = GtkUtil.ToScreenCoordinates (templatesTreeView, templatesTreeView.GdkWindow, rect); - x = screenRect.X; - y = screenRect.Bottom; - pushIn = false; - }; - //popupMenu.Popup (null, null, posFunc, 0, eventTime); - } - - [GLib.ConnectBefore] + } + + void HandlePopup(SolutionTemplate template, uint eventTime) + { + var engine = Platform.IsMac ? Xwt.Toolkit.NativeEngine : Xwt.Toolkit.CurrentEngine; + var xwtParent = Xwt.Toolkit.CurrentEngine.WrapWidget(templatesTreeView); + engine.Invoke(() => { + if (popupMenu == null) + { + popupMenu = new Xwt.Menu(); + } + ClearPopupMenuItems(); + AddLanguageMenuItems(popupMenu, template); + Gdk.Rectangle rect = languageCellRenderer.GetLanguageRect(); + + try + { + popupMenu.Popup(xwtParent, rect.X, rect.Bottom); + } + catch + { + // popup at mouse position if the toolkit is not supported + popupMenu.Popup(); + } + + }); + } + + [GLib.ConnectBefore] void TemplatesTreeViewButtonPressed (object o, ButtonPressEventArgs args) { @@ -385,23 +374,32 @@ TemplateCategory GetSelectedTemplateCategory () void ShowTemplatesForCategory (TemplateCategory category) { templateTextRenderer.RenderRecentTemplate = false; - languageCellRenderer.RenderRecentTemplate = false; - // foreach (TemplateCategory subCategory in category.Categories) { - // templatesListStore.AppendValues ( - // MarkupTopLevelCategoryName (subCategory.Name), - // null, - // null); - - // foreach (SolutionTemplate template in subCategory.Templates) { - // if (template.HasProjects || controller.IsNewSolution) { - // templatesListStore.AppendValues ( - // template.Name, - // GetIcon (template.IconId, IconSize.Dnd), - // template); - // } - // } - // } - templatesTreeView.ExpandAll (); + languageCellRenderer.RenderRecentTemplate = false; + foreach (TemplateCategory subCategory in category.Categories) + { + var iter = templatesTreeStore.AppendValues( + subCategory.Name, + null, + null, + subCategory.Name, + null); + + foreach (SolutionTemplate template in subCategory.Templates) + { + if (template.HasProjects || controller.IsNewSolution) + { + string language = GetLanguageForTemplate(template); + templatesTreeStore.AppendValues( + iter, + template.Name, + GetIcon(template.IconId, IconSize.Dnd), + template, + subCategory.Name, + language); + } + } + } + templatesTreeView.ExpandAll (); } string GetLanguageForTemplate (SolutionTemplate template) @@ -512,14 +510,15 @@ void SelectTemplateDefinedbyController () void SelectRecentTemplatesCategory () { - TreeIter iter = TreeIter.Zero; - // recent templates entry is always the first one and has no category assigned to it - //if (templateCategoriesListStore.GetIterFirst (out iter) && templateCategoriesListStore.GetValue (iter, TemplateCategoryColumn) == null) { - // templateCategoriesTreeView.Selection.SelectIter (iter); - //TreePath path = templateCategoriesListStore.GetPath (iter); - //templateCategoriesTreeView.ScrollToCell (path, null, true, 1, 0); - //} - } + TreeIter iter = TreeIter.Zero; + // recent templates entry is always the first one and has no category assigned to it + if (templateCategoriesTreeStore.GetIterFirst(out iter) && templateCategoriesTreeStore.GetValue(iter, TemplateCategoryColumn) == null) + { + templateCategoriesTreeView.Selection.SelectIter(iter); + TreePath path = templateCategoriesTreeStore.GetPath(iter); + templateCategoriesTreeView.ScrollToCell(path, null, true, 1, 0); + } + } void SelectFirstSubTemplateCategory () { From 63444bbbf138fe14e03735b67d91465b91ca25fd Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 13 Jan 2024 22:03:56 +0100 Subject: [PATCH 197/382] policy options dialog --- .../DefaultPolicyOptionsDialog.cs | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs index 64ccae507a8..e80314cf8ba 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs @@ -43,7 +43,7 @@ namespace MonoDevelop.Ide.Projects public class DefaultPolicyOptionsDialog : OptionsDialog { ComboBoxText policiesCombo; - Gtk.MenuButton newButton; + MonoDevelop.Components.MenuButton newButton; Button deleteButton; MonoDevelop.Components.MenuButton exportButton; List sets = new List (); @@ -89,29 +89,30 @@ public DefaultPolicyOptionsDialog (MonoDevelop.Components.Window parentWindow) }; topBar.PackEnd (exportButton, false, false, 0); - newButton = new Gtk.MenuButton (); + newButton = new MonoDevelop.Components.MenuButton (); newButton.Label = GettextCatalog.GetString ("Add Policy"); - //newButton.ContextMenuRequested = delegate { - // ContextMenu menu = new ContextMenu (); - - // ContextMenuItem item = new ContextMenuItem (GettextCatalog.GetString ("New policy...")); - // item.Clicked += HandleNewButtonClicked; - // menu.Items.Add (item); - - // item = new ContextMenuItem (GettextCatalog.GetString ("From file...")); - // item.Clicked += HandleFromFile; - // menu.Items.Add (item); - - // item = new ContextMenuItem (GettextCatalog.GetString ("From project or solution...")); - // item.Clicked += HandleFromProject; - // if (!IdeApp.Workspace.IsOpen) { - // item.Sensitive = false; - // } - // menu.Items.Add (item); - - // return menu; - //}; - topBar.PackEnd (newButton, false, false, 0); + newButton.ContextMenuRequested = delegate { + ContextMenu menu = new ContextMenu(); + + ContextMenuItem item = new ContextMenuItem(GettextCatalog.GetString("New policy...")); + item.Clicked += HandleNewButtonClicked; + menu.Items.Add(item); + + item = new ContextMenuItem(GettextCatalog.GetString("From file...")); + item.Clicked += HandleFromFile; + menu.Items.Add(item); + + item = new ContextMenuItem(GettextCatalog.GetString("From project or solution...")); + item.Clicked += HandleFromProject; + if (!IdeApp.Workspace.IsOpen) + { + item.Sensitive = false; + } + menu.Items.Add(item); + + return menu; + }; + topBar.PackEnd (newButton, false, false, 0); Alignment align = new Alignment (0f, 0f, 1f, 1f); align.LeftPadding = 9; From 3c7ca8ac3f8300c1d5387c2f3e76c84ecc7131aa Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 13 Jan 2024 22:24:30 +0100 Subject: [PATCH 198/382] about dialog --- .../MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs index faba61f6fae..6f19b10dbe1 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs @@ -68,10 +68,14 @@ public CommonAboutDialog () //oe Title = string.Format (GettextCatalog.GetString ("About {0}"), BrandingService.ApplicationName); Title = string.Format (GettextCatalog.GetString ("About {0}"), BrandingService.ApplicationLongName); - TransientFor = IdeApp.Workbench.RootWindow; - this.Resizable = true; -// HasSeparator = false; - BorderWidth = 0; + TransientFor = IdeApp.Workbench.RootWindow; // oe REVERTED from monodevelop-7.8 +#if GTK3 + this.Resizable = false; +#else + AllowGrow = false; + HasSeparator = false; +#endif + BorderWidth = 0; var notebook = new Notebook (); notebook.ShowTabs = false; From 3054f08bdeae6cffeff4978e85437e4d87d5f736 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 13 Jan 2024 22:33:52 +0100 Subject: [PATCH 199/382] update --- .../EventEditor.cs | 25 ++++++++++++------- .../MonoDevelop.Ide.Gui/ToolbarComboBox.cs | 8 +++--- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/EventEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/EventEditor.cs index e14cca2b766..6b4924cbb89 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/EventEditor.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/EventEditor.cs @@ -45,16 +45,23 @@ public class EventEditorCell : PropertyEditorCell IEventBindingService evtBind; protected override void Initialize () - { - IComponent comp = Instance as IComponent; - evtBind = (IEventBindingService) comp.Site.GetService (typeof (IEventBindingService)); - base.Initialize (); - } + { + IComponent comp = Instance as IComponent; + if (comp != null) + { + evtBind = (IEventBindingService)comp.Site.GetService(typeof(IEventBindingService)); + base.Initialize(); + } + } protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state) - { - //get existing method names - ICollection IColl = evtBind.GetCompatibleMethods (evtBind.GetEvent (Property)) ; + { + if (evtBind == null) + { + return null; + } + //get existing method names + ICollection IColl = evtBind.GetCompatibleMethods (evtBind.GetEvent (Property)) ; string[] methods = new string [IColl.Count + 1]; IColl.CopyTo (methods, 1); @@ -131,4 +138,4 @@ void entry_Changed (object sender, EventArgs e) public event EventHandler ValueChanged; } -} +} \ No newline at end of file diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs index 51587504095..2ca91cf1347 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs @@ -66,10 +66,10 @@ public override void SetToolbarStyle (Gtk.Toolbar toolbar) { if (Style != null) { if (toolbar.IconSize == Gtk.IconSize.Menu || toolbar.IconSize == Gtk.IconSize.SmallToolbar) { - //ctx.FontDesc = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); - } else { - //ctx.FontDesc = Style.FontDescription; - } + ctx.FontDesc = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); + } //else { + // ctx.FontDesc = Style.FontDescription; + //} } } } From b5457cd30e2436a52e24c2f47d6ac85e6a9d49ad Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 13 Jan 2024 22:51:55 +0100 Subject: [PATCH 200/382] restore --- .../Gui/CodeSegmentPreviewWindow.cs | 50 ------------------- 1 file changed, 50 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs index f98d97d8492..b4749368bdc 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs @@ -72,59 +72,9 @@ public void SetSegment (ISegment segment, bool removeIndent) protected override void OnDestroyed () { - //layout = layout.Kill (); - //informLayout = informLayout.Kill (); - //fontDescription = fontDescription.Kill (); - //fontInform = fontInform.Kill (); -// if (textGC != null) { -// textGC.Dispose (); -// textBgGC.Dispose (); -// foldGC.Dispose (); -// foldBgGC.Dispose (); -// textGC = textBgGC = foldGC = foldBgGC = null; -// } editor = null; base.OnDestroyed (); } - protected override bool OnKeyPressEvent (EventKey evnt) - { -// Console.WriteLine (evnt.Key); - return base.OnKeyPressEvent (evnt); - } - -// Gdk.GC textGC, foldGC, textBgGC, foldBgGC; - -// protected override bool OnExposeEvent (Gdk.EventExpose ev) -// { -// if (textGC == null) { -// var plainText = SyntaxHighlightingService.GetColor (editor.EditorTheme, EditorThemeColors.Foreground); -// textGC = plainText.CreateGC (ev.Window); -// -// plainText = SyntaxHighlightingService.GetColor (editor.EditorTheme, EditorThemeColors.Background); -// textBgGC = plainText.CreateGC (ev.Window); -// -// var collapsedText = SyntaxHighlightingService.GetColor (editor.EditorTheme, EditorThemeColors.CollapsedText); -// foldGC = collapsedText.CreateGC (ev.Window); -// -// collapsedText = SyntaxHighlightingService.GetColor (editor.EditorTheme, EditorThemeColors.Background); -// foldBgGC = collapsedText.CreateGC (ev.Window); -// } -// -// ev.Window.DrawRectangle (textBgGC, true, ev.Area); -// ev.Window.DrawLayout (textGC, 5, 4, layout); -// ev.Window.DrawRectangle (textBgGC, false, 1, 1, this.Allocation.Width - 3, this.Allocation.Height - 3); -// ev.Window.DrawRectangle (foldGC, false, 0, 0, this.Allocation.Width - 1, this.Allocation.Height - 1); -// -// if (!HideCodeSegmentPreviewInformString) { -// informLayout.SetText (CodeSegmentPreviewInformString); -// int w, h; -// informLayout.GetPixelSize (out w, out h); -// PreviewInformStringHeight = h; -// ev.Window.DrawRectangle (foldBgGC, true, Allocation.Width - w - 3, Allocation.Height - h, w + 2, h - 1); -// ev.Window.DrawLayout (foldGC, Allocation.Width - w - 4, Allocation.Height - h - 3, informLayout); -// } -// return true; -// } } } From 3cbfffcc3c6992eec715087f615a8992e4bb356b Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 13 Jan 2024 23:12:10 +0100 Subject: [PATCH 201/382] update --- ...Outline.OutlineSortingPreferencesDialog.cs | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.cs b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.cs index c4b5ab3728b..1e3fe30a05e 100644 --- a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.cs +++ b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.cs @@ -24,9 +24,13 @@ protected virtual void Build () this.Modal = true; this.DestroyWithParent = true; // Internal child MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Name = "dialog1_VBox"; - // w1.BorderWidth = ((uint)(2)); +#if GTK3 + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; +#else + global::Gtk.VBox w1 = this.VBox; +#endif + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -49,15 +53,19 @@ protected virtual void Build () this.vbox2.Add (this.priorityList); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.priorityList])); w3.Position = 1; - // w1.Add (this.vbox2); - // global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - // w4.Position = 0; + w1.Add (this.vbox2); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + w4.Position = 0; // Internal child MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.ActionArea - // global::Gtk.HButtonBox w5 = this.ActionArea; - // w5.Name = "dialog1_ActionArea"; - // w5.Spacing = 10; - // w5.BorderWidth = ((uint)(5)); - // w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); +#if GTK3 + global::Gtk.HButtonBox w5 = (Gtk.HButtonBox)this.ActionArea; +#else + global::Gtk.HButtonBox w5 = this.ActionArea; +#endif + w5.Name = "dialog1_ActionArea"; + w5.Spacing = 10; + w5.BorderWidth = ((uint)(5)); + w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -67,9 +75,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel])); - // w6.Expand = false; - // w6.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel])); + w6.Expand = false; + w6.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -79,10 +87,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk])); - // w7.Position = 1; - // w7.Expand = false; - // w7.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk])); + w7.Position = 1; + w7.Expand = false; + w7.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } From ee3afbfc893ff753a9b5a627a056ba7fc8330ae6 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sun, 14 Jan 2024 21:37:23 +0100 Subject: [PATCH 202/382] update --- ...ormatting.CSharpFormattingProfileDialog.cs | 56 +++++++++++-------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs index d6dbbebdc7b..e60ad7b016d 100644 --- a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs +++ b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs @@ -68,10 +68,14 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Name = "dialog1_VBox"; - // w1.Spacing = 6; - // w1.BorderWidth = ((uint)(2)); +#if GTK3 + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; +#else + global::Gtk.VBox w1 = this.VBox; +#endif + w1.Name = "dialog1_VBox"; + w1.Spacing = 6; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox5 = new global::Gtk.VBox (); this.vbox5.Name = "vbox5"; @@ -100,9 +104,13 @@ protected virtual void Build () w2.Expand = false; w2.Fill = false; // Container child hbox4.Gtk.Box+BoxChild - // this.comboboxCategories = global::Gtk.ComboBox.NewText (); - // this.comboboxCategories.Name = "comboboxCategories"; - // this.hbox4.Add (this.comboboxCategories); +#if GTK3 + this.comboboxCategories = new global::Gtk.ComboBoxText(); +#else + this.comboboxCategories = global::Gtk.ComboBox.NewText (); +#endif + this.comboboxCategories.Name = "comboboxCategories"; + this.hbox4.Add (this.comboboxCategories); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.comboboxCategories])); w3.Position = 1; this.vbox2.Add (this.hbox4); @@ -242,15 +250,19 @@ protected virtual void Build () this.vbox5.Add (this.hpaned1); global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hpaned1])); w21.Position = 0; - // w1.Add (this.vbox5); - // global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5])); - // w22.Position = 0; + w1.Add (this.vbox5); + global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5])); + w22.Position = 0; // Internal child MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.ActionArea - // global::Gtk.HButtonBox w23 = this.ActionArea; - // w23.Name = "dialog1_ActionArea"; - // w23.Spacing = 10; - // w23.BorderWidth = ((uint)(5)); - // w23.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); +#if GTK3 + global::Gtk.HButtonBox w23 = (Gtk.HButtonBox)this.ActionArea; +#else + global::Gtk.HButtonBox w23 = this.ActionArea; +#endif + w23.Name = "dialog1_ActionArea"; + w23.Spacing = 10; + w23.BorderWidth = ((uint)(5)); + w23.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -260,9 +272,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w24 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w23 [this.buttonCancel])); - // w24.Expand = false; - // w24.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w24 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w23 [this.buttonCancel])); + w24.Expand = false; + w24.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -272,10 +284,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w25 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w23 [this.buttonOk])); - // w25.Position = 1; - // w25.Expand = false; - // w25.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w25 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w23 [this.buttonOk])); + w25.Position = 1; + w25.Expand = false; + w25.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } From 7f16494d015ca6d66c4e40726b8b90d325de3999 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sun, 14 Jan 2024 21:49:17 +0100 Subject: [PATCH 203/382] update --- ...p.Formatting.NewFormattingProfileDialog.cs | 60 +++++++++++-------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.cs b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.cs index c6566a01c8e..f5dea728c9c 100644 --- a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.cs +++ b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.cs @@ -27,10 +27,14 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Name = "dialog1_VBox"; - // w1.Spacing = 6; - // w1.BorderWidth = ((uint)(2)); +#if GTK3 + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; +#else + global::Gtk.VBox w1 = this.VBox; +#endif + w1.Name = "dialog1_VBox"; + w1.Spacing = 6; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox4 = new global::Gtk.VBox (); this.vbox4.Name = "vbox4"; @@ -69,24 +73,32 @@ protected virtual void Build () w4.Expand = false; w4.Fill = false; // Container child vbox4.Gtk.Box+BoxChild - // this.comboboxInitFrom = global::Gtk.ComboBox.NewText (); - // this.comboboxInitFrom.Name = "comboboxInitFrom"; - // this.vbox4.Add (this.comboboxInitFrom); +#if GTK3 + this.comboboxInitFrom = new global::Gtk.ComboBoxText(); +#else + this.comboboxInitFrom = global::Gtk.ComboBox.NewText (); +#endif + this.comboboxInitFrom.Name = "comboboxInitFrom"; + this.vbox4.Add (this.comboboxInitFrom); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.comboboxInitFrom])); w5.Position = 3; w5.Expand = false; w5.Fill = false; - //w1.Add (this.vbox4); - // global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox4])); - // w6.Position = 0; - // w6.Expand = false; - // w6.Fill = false; + w1.Add (this.vbox4); + global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox4])); + w6.Position = 0; + w6.Expand = false; + w6.Fill = false; // Internal child MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.ActionArea - // global::Gtk.HButtonBox w7 = this.ActionArea; - // w7.Name = "dialog1_ActionArea"; - // w7.Spacing = 10; - // w7.BorderWidth = ((uint)(5)); - // w7.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); +#if GTK3 + global::Gtk.HButtonBox w7 = (Gtk.HButtonBox)this.ActionArea; +#else + global::Gtk.HButtonBox w7 = this.ActionArea; +#endif + w7.Name = "dialog1_ActionArea"; + w7.Spacing = 10; + w7.BorderWidth = ((uint)(5)); + w7.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -96,9 +108,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7 [this.buttonCancel])); - // w8.Expand = false; - // w8.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7 [this.buttonCancel])); + w8.Expand = false; + w8.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -108,10 +120,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w9 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7 [this.buttonOk])); - // w9.Position = 1; - // w9.Expand = false; - // w9.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w9 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7 [this.buttonOk])); + w9.Position = 1; + w9.Expand = false; + w9.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } From b318c0d900ffe98a82dfefa6e871a21bfc2ac352 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sun, 14 Jan 2024 22:01:12 +0100 Subject: [PATCH 204/382] update --- ...Sharp.Project.CodeGenerationPanelWidget.cs | 46 +++++++++++-------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Project.CodeGenerationPanelWidget.cs b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Project.CodeGenerationPanelWidget.cs index 96c78cb5970..32e8941e77f 100644 --- a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Project.CodeGenerationPanelWidget.cs +++ b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Project.CodeGenerationPanelWidget.cs @@ -22,11 +22,11 @@ internal partial class CodeGenerationPanelWidget private global::Gtk.HBox hbox1; - private global::Gtk.ComboBox comboPlatforms; + private global::Gtk.ComboBoxText comboPlatforms; private global::Gtk.HBox hbox2; - private global::Gtk.ComboBox comboDebug; + private global::Gtk.ComboBoxText comboDebug; private global::Gtk.HBox hbox4; @@ -142,14 +142,18 @@ protected virtual void Build () this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild - //this.comboPlatforms = global::Gtk.ComboBox.NewText (); - //this.comboPlatforms.AppendText (global::Mono.Unix.Catalog.GetString ("Any CPU")); - //this.comboPlatforms.AppendText (global::Mono.Unix.Catalog.GetString ("x86")); - //this.comboPlatforms.AppendText (global::Mono.Unix.Catalog.GetString ("x64")); - //this.comboPlatforms.AppendText (global::Mono.Unix.Catalog.GetString ("Itanium")); - //this.comboPlatforms.Name = "comboPlatforms"; - //this.comboPlatforms.Active = 0; - //this.hbox1.Add (this.comboPlatforms); +#if GTK3 + this.comboPlatforms = new global::Gtk.ComboBoxText(); +#else + this.comboPlatforms = global::Gtk.ComboBox.NewText (); +#endif + this.comboPlatforms.AppendText (global::Mono.Unix.Catalog.GetString ("Any CPU")); + this.comboPlatforms.AppendText (global::Mono.Unix.Catalog.GetString ("x86")); + this.comboPlatforms.AppendText (global::Mono.Unix.Catalog.GetString ("x64")); + this.comboPlatforms.AppendText (global::Mono.Unix.Catalog.GetString ("Itanium")); + this.comboPlatforms.Name = "comboPlatforms"; + this.comboPlatforms.Active = 0; + this.hbox1.Add (this.comboPlatforms); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.comboPlatforms])); w5.Position = 0; w5.Expand = false; @@ -167,15 +171,19 @@ protected virtual void Build () this.hbox2.Name = "hbox2"; this.hbox2.Spacing = 6; // Container child hbox2.Gtk.Box+BoxChild - //this.comboDebug = global::Gtk.ComboBox.NewText (); - //this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("Full")); - //this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("Symbols only")); - //this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("Portable")); - //this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("Embedded")); - // this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("None")); - // this.comboDebug.Name = "comboDebug"; - // this.comboDebug.Active = 0; - // this.hbox2.Add (this.comboDebug); +#if GTK3 + this.comboDebug = new global::Gtk.ComboBoxText(); +#else + this.comboDebug = global::Gtk.ComboBox.NewText (); +#endif + this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("Full")); + this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("Symbols only")); + this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("Portable")); + this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("Embedded")); + this.comboDebug.AppendText (global::Mono.Unix.Catalog.GetString ("None")); + this.comboDebug.Name = "comboDebug"; + this.comboDebug.Active = 0; + this.hbox2.Add (this.comboDebug); global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.comboDebug])); w7.Position = 0; w7.Expand = false; From 231105a91809d985f8b981038ae5dec96d10c1df Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sun, 14 Jan 2024 23:13:55 +0100 Subject: [PATCH 205/382] update --- .../Mono.TextEditor/Gui/TextArea.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs index 422508f098f..60b3ea56292 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs @@ -2329,10 +2329,10 @@ void UpdateAdjustments () DateTime started = DateTime.Now; #endif Stopwatch timingsWatch = new Stopwatch (); -// protected override bool OnDrawn (Context cr) -// { -// if (this.isDisposed) -// return false; + protected override bool OnDrawn (Context cr) + { + if (this.isDisposed) + return false; // // try { // // ExposeEventInternal (e); @@ -2340,9 +2340,9 @@ void UpdateAdjustments () // // GLib.ExceptionManager.RaiseUnhandledException (ex, false); // // } -// keyPressTimings.EndTimer (true); -// return base.OnDrawn (cr); -// } + keyPressTimings.EndTimer (true); + return base.OnDrawn (cr); + } void ExposeEventInternal (Gdk.EventExpose e) { From 829ba117c91ad614cc8dd1b4d0af3d34279ce399 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sun, 14 Jan 2024 23:26:36 +0100 Subject: [PATCH 206/382] update --- .../MonoDevelop.Components.MainToolbar/MainToolbar.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs index 3d94c9199f4..72fad0d5834 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs @@ -95,9 +95,6 @@ public MonoDevelop.Ide.StatusBar StatusBar { return statusArea; } } - internal static object LastCommandTarget { - get { return lastCommandTarget != null ? lastCommandTarget.Target : null; } - } static bool RuntimeIsSeparator (ITreeModel model, TreeIter iter) { From 7809e49419787200587952623fe65c439fb32ed5 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 15 Jan 2024 00:00:37 +0100 Subject: [PATCH 207/382] update --- .../MonoDevelop.Ide/IdeInstanceConnection.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeInstanceConnection.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeInstanceConnection.cs index c247fcf314b..5a5d0c95e56 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeInstanceConnection.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeInstanceConnection.cs @@ -50,9 +50,9 @@ public IdeInstanceConnection (bool ipcTcp) // macOS has native support for opening files in an open instance // via AppleEvents for applications distributed as bundles, so disable // this support. - // if (Platform.IsMac && Components.GtkWorkarounds.IsRunFromBundle ()) { - // return; - // } + if (Platform.IsMac && Components.GtkWorkarounds.IsRunFromBundle ()) { + return; + } if (ipcTcp) { listen_socket = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP); From 2d40b2800aa6bdbddc9c8c3d96a92c874a6f588e Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 15 Jan 2024 19:40:14 +0100 Subject: [PATCH 208/382] restore to previos version --- .../LinuxSystemInformation.cs | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LinuxSystemInformation.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LinuxSystemInformation.cs index baf5bcd52f3..0b4bc1bc441 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LinuxSystemInformation.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LinuxSystemInformation.cs @@ -35,37 +35,38 @@ class LinuxSystemInformation : UnixSystemInformation { internal override void AppendOperatingSystem (StringBuilder sb) { - string OSName = "", OSVersion = ""; - try { - foreach (var line in File.ReadAllLines ("/etc/os-release")) { - var parsedline = Parse (line); - if (parsedline.Key.Equals ("NAME")) { - OSName = parsedline.Value; - } - if (parsedline.Key.Equals ("VERSION")) { - OSVersion = parsedline.Value; - } - } - } catch { - OSName = "Linux"; - OSVersion = "Unknown"; - } - if (string.IsNullOrWhiteSpace (OSName) || string.IsNullOrWhiteSpace (OSVersion)) { - OSName = "Linux"; - OSVersion = "Unknown"; - } - sb.AppendLine ("\t" + OSName + " " + OSVersion); + // string OSName = "", OSVersion = ""; + // try { + // foreach (var line in File.ReadAllLines ("/etc/os-release")) { + // var parsedline = Parse (line); + // if (parsedline.Key.Equals ("NAME")) { + // OSName = parsedline.Value; + // } + // if (parsedline.Key.Equals ("VERSION")) { + // OSVersion = parsedline.Value; + // } + // } + // } catch { + // OSName = "Linux"; + // OSVersion = "Unknown"; + // } + // if (string.IsNullOrWhiteSpace (OSName) || string.IsNullOrWhiteSpace (OSVersion)) { + // OSName = "Linux"; + // OSVersion = "Unknown"; + // } + // sb.AppendLine ("\t" + OSName + " " + OSVersion); + sb.AppendLine ("\tLinux"); base.AppendOperatingSystem (sb); } - KeyValuePair Parse (string inputstring) - { - string [] parsed = inputstring.Split ('='); - if (parsed.Length != 2) { - return new KeyValuePair (); - } - return new KeyValuePair (parsed [0], parsed [1].Trim ('"')); - } + // KeyValuePair Parse (string inputstring) + // { + // string [] parsed = inputstring.Split ('='); + // if (parsed.Length != 2) { + // return new KeyValuePair (); + // } + // return new KeyValuePair (parsed [0], parsed [1].Trim ('"')); + // } } } From 986650aa7d62357b9380903931bc3a9d8d28f511 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 15 Jan 2024 21:56:27 +0100 Subject: [PATCH 209/382] enable again --- main/src/tools/mdtool/src/mdtool.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/src/tools/mdtool/src/mdtool.cs b/main/src/tools/mdtool/src/mdtool.cs index cd929aa3c58..778a3f5d7ff 100644 --- a/main/src/tools/mdtool/src/mdtool.cs +++ b/main/src/tools/mdtool/src/mdtool.cs @@ -177,9 +177,9 @@ static void Shutdown (bool terminate) { Runtime.Shutdown (); - // if (terminate) { - // MonoDevelop.Components.GtkWorkarounds.Terminate (); - // } + if (terminate) { + MonoDevelop.Components.GtkWorkarounds.Terminate (); + } } static void ShowHelp (bool shortHelp, string exeName) From 5934228c17af80e5060a8e363dcda47e99ce2a01 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 15 Jan 2024 21:58:43 +0100 Subject: [PATCH 210/382] update submodule --- main/external/mono-addins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/external/mono-addins b/main/external/mono-addins index 9789d563799..7e606e7e0ce 160000 --- a/main/external/mono-addins +++ b/main/external/mono-addins @@ -1 +1 @@ -Subproject commit 9789d563799b8b5487d9be1102cd868397958331 +Subproject commit 7e606e7e0cee12d2b17055b8a389f4e79ca70600 From 11278c4309ee74f79d32c33fd86e20613e8b7372 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 15 Jan 2024 22:23:13 +0100 Subject: [PATCH 211/382] enable again --- .../ModeHelpWindow.cs | 262 +++++++++--------- 1 file changed, 131 insertions(+), 131 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs index 93f9a06a3db..bb70872901f 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs @@ -145,84 +145,84 @@ protected override void OnDestroyed () const int xBorder = 4; const int yBorder = 2; -// protected override bool OnDrawn (Context g) -// { -// g.Translate (Allocation.X, Allocation.Y); -// g.LineWidth = 1; -// // Gdk.GC gc = new Gdk.GC (args.Window); -// layout.SetMarkup (TitleText); -// int width, height; -// layout.GetPixelSize (out width, out height); -// width += xBorder * 2; -// FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, true, false, 0.5, 0.5, height + yBorder * 2 + 1.5, width, height + yBorder * 2); -// g.SetSourceColor (Styles.TableLayoutModeTitleBackgroundColor.ToCairoColor ()); -// g.FillPreserve (); -// g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); -// g.Stroke (); - -// g.Save (); -// g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ()); -// g.Translate (xBorder, yBorder); -// g.ShowLayout (layout); -// g.Restore (); - -// FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, 0.5, height * 2 + yBorder * 2 + 0.5, height, Allocation.Width - 1, Allocation.Height - height * 2 - yBorder * 2 - 1); -// g.SetSourceColor (Styles.TableLayoutModeBackgroundColor.ToCairoColor ()); -// g.FillPreserve (); -// g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); -// g.Stroke (); - -// g.MoveTo (xSpacer + 0.5, height * 2 + yBorder * 2); -// g.LineTo (xSpacer + 0.5, Allocation.Height - 1); -// g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); -// g.Stroke (); - -// int y = height + yBorder * 2; - -// for (int i = 0; i < Items.Count; i++) { -// KeyValuePair pair = Items [i]; - -// layout.SetMarkup (pair.Key); -// layout.GetPixelSize (out width, out height); - -// if (i == 0) { -// FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, false, false, 0, y + 0.5, height + 1.5, Allocation.Width, height); -// g.SetSourceColor (Styles.TableLayoutModeCategoryBackgroundColor.ToCairoColor ()); -// g.FillPreserve (); -// g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); -// g.Stroke (); - -// g.MoveTo (xSpacer + 0.5, height + yBorder * 2 + 1); -// g.LineTo (xSpacer + 0.5, height * 2 + yBorder * 2 + 1); -// g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); -// g.Stroke (); -// } - -// // gc.RgbFgColor = (HslColor)(i == 0 ? Styles.TableLayoutModeBackgroundColor : Styles.TableLayoutModeTextColor).ToCairoColor (); -// g.Save (); -// g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ()); -// g.Translate (xBorder, y); -// g.ShowLayout (layout); -// g.Restore (); - -// g.Save (); -// g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ()); -// g.Translate (xSpacer + xBorder, y); -// layout.SetMarkup (pair.Value); -// g.ShowLayout (layout); -// g.Restore (); - -// // draw top line -// if (i > 0) { -// g.MoveTo (1, y + 0.5); -// g.LineTo (Allocation.Width - 1, y + 0.5); -// g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); -// g.Stroke (); -// } -// y += height; -// } -// return base.OnDrawn (g); -// } + protected override bool OnDrawn (Context g) + { + g.Translate (Allocation.X, Allocation.Y); + g.LineWidth = 1; +// Gdk.GC gc = new Gdk.GC (args.Window); + layout.SetMarkup (TitleText); + int width, height; + layout.GetPixelSize (out width, out height); + width += xBorder * 2; + FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, true, false, 0.5, 0.5, height + yBorder * 2 + 1.5, width, height + yBorder * 2); + g.SetSourceColor (Styles.TableLayoutModeTitleBackgroundColor.ToCairoColor ()); + g.FillPreserve (); + g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); + g.Stroke (); + + g.Save (); + g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ()); + g.Translate (xBorder, yBorder); + g.ShowLayout (layout); + g.Restore (); + + FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, 0.5, height * 2 + yBorder * 2 + 0.5, height, Allocation.Width - 1, Allocation.Height - height * 2 - yBorder * 2 - 1); + g.SetSourceColor (Styles.TableLayoutModeBackgroundColor.ToCairoColor ()); + g.FillPreserve (); + g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); + g.Stroke (); + + g.MoveTo (xSpacer + 0.5, height * 2 + yBorder * 2); + g.LineTo (xSpacer + 0.5, Allocation.Height - 1); + g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); + g.Stroke (); + + int y = height + yBorder * 2; + + for (int i = 0; i < Items.Count; i++) { + KeyValuePair pair = Items [i]; + + layout.SetMarkup (pair.Key); + layout.GetPixelSize (out width, out height); + + if (i == 0) { + FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, false, false, 0, y + 0.5, height + 1.5, Allocation.Width, height); + g.SetSourceColor (Styles.TableLayoutModeCategoryBackgroundColor.ToCairoColor ()); + g.FillPreserve (); + g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ()); + g.Stroke (); + + g.MoveTo (xSpacer + 0.5, height + yBorder * 2 + 1); + g.LineTo (xSpacer + 0.5, height * 2 + yBorder * 2 + 1); + g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); + g.Stroke (); + } + +// gc.RgbFgColor = (HslColor)(i == 0 ? Styles.TableLayoutModeBackgroundColor : Styles.TableLayoutModeTextColor).ToCairoColor (); + g.Save (); + g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ()); + g.Translate (xBorder, y); + g.ShowLayout (layout); + g.Restore (); + + g.Save (); + g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ()); + g.Translate (xSpacer + xBorder, y); + layout.SetMarkup (pair.Value); + g.ShowLayout (layout); + g.Restore (); + + // draw top line + if (i > 0) { + g.MoveTo (1, y + 0.5); + g.LineTo (Allocation.Width - 1, y + 0.5); + g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ()); + g.Stroke (); + } + y += height; + } + return base.OnDrawn (g); + } } enum SymbolTokenType { @@ -497,58 +497,58 @@ protected override void OnDestroyed () const int yDescriptionBorder = 8; const int yTitleBorder = 8; - // protected override bool OnDrawn (Context g) - // { - // g.Translate (Allocation.X, Allocation.Y); - // g.LineWidth = 1; - // titleLayout.SetMarkup (TitleText); - // int width, height; - // titleLayout.GetPixelSize (out width, out height); - // var tw = SupportsAlpha ? triangleWidth : 0; - // var th = SupportsAlpha ? triangleHeight : 0; - // width += xDescriptionBorder * 2; - - // if (SupportsAlpha) { - // FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, true, true, tw + 0.5, 0.5, 12, Allocation.Width - 1 - tw, Allocation.Height); - // } else { - // g.Rectangle (0, 0, Allocation.Width, Allocation.Height); - // } - // g.SetSourceColor (Styles.InsertionCursorBackgroundColor.ToCairoColor ()); - // g.FillPreserve (); - // g.SetSourceColor (Styles.InsertionCursorBorderColor.ToCairoColor ()); - // g.Stroke (); - - - // g.MoveTo (tw + xDescriptionBorder, yTitleBorder); - // g.SetSourceColor (Styles.InsertionCursorTitleTextColor.ToCairoColor ()); - // g.ShowLayout (titleLayout); - - // if (SupportsAlpha) { - // g.MoveTo (tw, Allocation.Height / 2 - th / 2); - // g.LineTo (0, Allocation.Height / 2); - // g.LineTo (tw, Allocation.Height / 2 + th / 2); - // g.LineTo (tw + 5, Allocation.Height / 2 + th / 2); - // g.LineTo (tw + 5, Allocation.Height / 2 - th / 2); - // g.ClosePath (); - // g.SetSourceColor (Styles.InsertionCursorBackgroundColor.ToCairoColor ()); - // g.Fill (); - - // g.MoveTo (tw, Allocation.Height / 2 - th / 2); - // g.LineTo (0, Allocation.Height / 2); - // g.LineTo (tw, Allocation.Height / 2 + th / 2); - // g.SetSourceColor (Styles.InsertionCursorBorderColor.ToCairoColor ()); - // g.Stroke (); - // } - - // int y = height + yTitleBorder + yDescriptionBorder; - // int x = tw + xDescriptionBorder; - // g.SetSourceColor (Styles.InsertionCursorTextColor.ToCairoColor ()); - - // foreach (var desc in descTexts) { - // desc.Render (g, x, y + 4); - // y += desc.Height + 8; - // } - // return base.OnDrawn (g); - // } + protected override bool OnDrawn (Context g) + { + g.Translate (Allocation.X, Allocation.Y); + g.LineWidth = 1; + titleLayout.SetMarkup (TitleText); + int width, height; + titleLayout.GetPixelSize (out width, out height); + var tw = SupportsAlpha ? triangleWidth : 0; + var th = SupportsAlpha ? triangleHeight : 0; + width += xDescriptionBorder * 2; + + if (SupportsAlpha) { + FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, true, true, tw + 0.5, 0.5, 12, Allocation.Width - 1 - tw, Allocation.Height); + } else { + g.Rectangle (0, 0, Allocation.Width, Allocation.Height); + } + g.SetSourceColor (Styles.InsertionCursorBackgroundColor.ToCairoColor ()); + g.FillPreserve (); + g.SetSourceColor (Styles.InsertionCursorBorderColor.ToCairoColor ()); + g.Stroke (); + + + g.MoveTo (tw + xDescriptionBorder, yTitleBorder); + g.SetSourceColor (Styles.InsertionCursorTitleTextColor.ToCairoColor ()); + g.ShowLayout (titleLayout); + + if (SupportsAlpha) { + g.MoveTo (tw, Allocation.Height / 2 - th / 2); + g.LineTo (0, Allocation.Height / 2); + g.LineTo (tw, Allocation.Height / 2 + th / 2); + g.LineTo (tw + 5, Allocation.Height / 2 + th / 2); + g.LineTo (tw + 5, Allocation.Height / 2 - th / 2); + g.ClosePath (); + g.SetSourceColor (Styles.InsertionCursorBackgroundColor.ToCairoColor ()); + g.Fill (); + + g.MoveTo (tw, Allocation.Height / 2 - th / 2); + g.LineTo (0, Allocation.Height / 2); + g.LineTo (tw, Allocation.Height / 2 + th / 2); + g.SetSourceColor (Styles.InsertionCursorBorderColor.ToCairoColor ()); + g.Stroke (); + } + + int y = height + yTitleBorder + yDescriptionBorder; + int x = tw + xDescriptionBorder; + g.SetSourceColor (Styles.InsertionCursorTextColor.ToCairoColor ()); + + foreach (var desc in descTexts) { + desc.Render (g, x, y + 4); + y += desc.Height + 8; + } + return base.OnDrawn (g); + } } } From 2f57858ca721ffb7094b304311ea3428a9728365 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 15 Jan 2024 22:53:31 +0100 Subject: [PATCH 212/382] enable again --- .../QuickTaskOverviewMode.cs | 114 ++++++++---------- 1 file changed, 51 insertions(+), 63 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs index a7f111f37ce..85a1cc92986 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs @@ -937,69 +937,57 @@ void DrawSearchResults (Cairo.Context cr, IndicatorDrawingState state, int i) } IndicatorDrawingState currentDrawingState = IndicatorDrawingState.Create (); SurfaceWrapper backgroundSurface, indicatorSurface, swapIndicatorSurface; - // protected override bool OnDrawn (Cairo.Context cr) - // { - // if (TextEditor == null) - // return true; - - // cr.Save (); - // var allocation = Allocation; - // var displayScale = Core.Platform.IsMac ? GtkWorkarounds.GetScaleFactor (this) : 1.0; - // cr.Scale (1 / displayScale, 1 / displayScale); - // if (indicatorSurface != null) { - // cr.SetSourceSurface (indicatorSurface.Surface, 0, 0); - // cr.Paint (); - // } else { - // CachedDraw (cr, - // ref backgroundSurface, - // allocation, - // draw: (c, o) => DrawBackground (c, allocation), forceScale: displayScale); - // } - // if (TextEditor == null) - // return true; - - // cr.Save (); - // var allocation = Allocation; - // var displayScale = Core.Platform.IsMac ? GtkWorkarounds.GetScaleFactor (this) : 1.0; - // cr.Scale (1 / displayScale, 1 / displayScale); - // if (indicatorSurface != null) { - // cr.SetSourceSurface (indicatorSurface.Surface, 0, 0); - // cr.Paint (); - // } else { - // CachedDraw (cr, - // ref backgroundSurface, - // e.Area, - // draw: (c, o) => DrawBackground (c, allocation), forceScale: displayScale); - // } - // if (TextEditor == null) - // return true; - - // DrawCaret (cr); - - // if (QuickTaskStrip.MergeScrollBarAndQuickTasks) - // DrawBar (cr); - - // cr.Restore (); - // if (HasFocus) { - // switch (currentFocus) { - // case FocusWidget.Indicator: - // cr.LineWidth = 1.0; - - // cr.SetSourceColor (Styles.FocusColor.ToCairoColor ()); - // cr.Rectangle (1, 1, Allocation.Width - 2, Allocation.Width - 2); - // cr.SetDash (new double [] { 1, 1 }, 0.5); - // cr.Stroke (); - // break; - - // case FocusWidget.Tasks: - // break; - - // case FocusWidget.Usages: - // break; - // } - // } - // return false; - // } + protected override bool OnDrawn (Cairo.Context cr) + { + if (TextEditor == null) + return true; + + //using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { + + cr.Save (); + var allocation = Allocation; + var displayScale = Core.Platform.IsMac ? GtkWorkarounds.GetScaleFactor (this) : 1.0; + cr.Scale (1 / displayScale, 1 / displayScale); + if (indicatorSurface != null) { + cr.SetSourceSurface (indicatorSurface.Surface, 0, 0); + cr.Paint (); + } else { + CachedDraw (cr, + ref backgroundSurface, + allocation, + draw: (c, o) => DrawBackground (c, allocation), forceScale: displayScale); + } + if (TextEditor == null) + return true; + + DrawCaret (cr, displayScale); + if (QuickTaskStrip.MergeScrollBarAndQuickTasks) + DrawBar (cr); + + cr.Restore (); + + if (HasFocus) { + switch (currentFocus) { + case FocusWidget.Indicator: + cr.LineWidth = 1.0; + + cr.SetSourceColor (Styles.FocusColor.ToCairoColor ()); + cr.Rectangle (1, 1, Allocation.Width - 2, Allocation.Width - 2); + cr.SetDash (new double [] { 1, 1 }, 0.5); + cr.Stroke (); + break; + + case FocusWidget.Tasks: + break; + + case FocusWidget.Usages: + break; + } + } + //} + + return false; + } CancellationTokenSource src; From 6f6e0c0ecda8e15e8a8d1fc831d1aed3fe0176e0 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 15 Jan 2024 23:02:57 +0100 Subject: [PATCH 213/382] enable again --- .../MessageBubbleCache.cs | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs index a61835203cb..41e44a6fae4 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs @@ -161,48 +161,48 @@ protected override bool OnEnterNotifyEvent (Gdk.EventCrossing evnt) return base.OnEnterNotifyEvent (evnt); } - // protected override void OnDrawContent (Gdk.EventExpose evnt, Cairo.Context g) - // { - // g.Rectangle (0, 0, Allocation.Width, Allocation.Height); - // g.SetSourceColor (marker.TooltipColor); - // g.Fill (); + protected override void OnDrawContent (Gdk.EventExpose evnt, Cairo.Context g) + { + g.Rectangle (0, 0, Allocation.Width, Allocation.Height); + g.SetSourceColor (marker.TooltipColor); + g.Fill (); - // using (var drawingLayout = new Pango.Layout (this.PangoContext)) { - // drawingLayout.FontDescription = cache.tooltipFontDescription; + using (var drawingLayout = new Pango.Layout (this.PangoContext)) { + drawingLayout.FontDescription = cache.tooltipFontDescription; - // double y = verticalTextBorder; - // var showBulletedList = marker.Errors.Count > 1; + double y = verticalTextBorder; + var showBulletedList = marker.Errors.Count > 1; - // foreach (var msg in marker.Errors) { - // var icon = msg.IsError ? errorPixbuf : warningPixbuf; - // int w, h; + foreach (var msg in marker.Errors) { + var icon = msg.IsError ? errorPixbuf : warningPixbuf; + int w, h; - // if (!showBulletedList) - // drawingLayout.Width = maxTextWidth; + if (!showBulletedList) + drawingLayout.Width = maxTextWidth; - // drawingLayout.SetText (msg.FullErrorMessage); - // drawingLayout.GetPixelSize (out w, out h); + drawingLayout.SetText (msg.FullErrorMessage); + drawingLayout.GetPixelSize (out w, out h); - // if (showBulletedList) { - // g.Save (); + if (showBulletedList) { + g.Save (); - // g.Translate (textBorder, y + verticalTextSpace / 2 + Math.Max (0, (h - icon.Height) / 2)); - // g.DrawImage (this, icon, 0, 0); - // g.Restore (); - // } + g.Translate (textBorder, y + verticalTextSpace / 2 + Math.Max (0, (h - icon.Height) / 2)); + g.DrawImage (this, icon, 0, 0); + g.Restore (); + } - // g.Save (); + g.Save (); - // g.Translate (showBulletedList ? textBorder + iconTextSpacing + icon.Width: textBorder, y + verticalTextSpace / 2); - // g.SetSourceColor (marker.TagColor2); - // g.ShowLayout (drawingLayout); + g.Translate (showBulletedList ? textBorder + iconTextSpacing + icon.Width: textBorder, y + verticalTextSpace / 2); + g.SetSourceColor (marker.TagColor2); + g.ShowLayout (drawingLayout); - // g.Restore (); + g.Restore (); - // y += h + verticalTextSpace; - // } - // } - // } + y += h + verticalTextSpace; + } + } + } } public void StartHover (MessageBubbleTextMarker marker, double bubbleX, double bubbleY, double bubbleWidth, bool isReduced) From 2aee26c115db8a6b5ad0ce664fa4e0059317ce37 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 15 Jan 2024 23:12:35 +0100 Subject: [PATCH 214/382] enable again --- .../SmartScrolledWindow.cs | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs index d6f1703f63c..9529e452596 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs @@ -252,26 +252,26 @@ protected override void OnGetPreferredHeight (out int minimum_height, out int na children.ForEach (child => child.Child.SizeRequest ()); } - // protected override bool OnDrawn (Context cr) - // { - // if (BorderVisible) { - // cr.LineWidth = 1; + protected override bool OnDrawn (Context cr) + { + if (BorderVisible) { + cr.LineWidth = 1; - // var alloc = Allocation; - // int right = alloc.RightInside (); - // int bottom = alloc.BottomInside (); + var alloc = Allocation; + int right = alloc.RightInside (); + int bottom = alloc.BottomInside (); - // cr.SharpLineX (alloc.X, alloc.Y, alloc.X, bottom); - // cr.SharpLineX (right, alloc.Y, right, bottom); + cr.SharpLineX (alloc.X, alloc.Y, alloc.X, bottom); + cr.SharpLineX (right, alloc.Y, right, bottom); - // cr.SharpLineY (alloc.X, alloc.Y, right, alloc.Y); - // cr.SharpLineY (alloc.X, bottom, right, bottom); + cr.SharpLineY (alloc.X, alloc.Y, right, alloc.Y); + cr.SharpLineY (alloc.X, bottom, right, bottom); - // cr.SetSourceColor ((HslColor)Style.Dark (State)); - // cr.Stroke (); - // } - // return base.OnDrawn (cr); - // } + //cr.SetSourceColor ((HslColor)Style.Dark (State)); + cr.Stroke (); + } + return base.OnDrawn (cr); + } } } From e3328c09edab62dbd8ab997d597f21de518de7ad Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 15 Jan 2024 23:30:18 +0100 Subject: [PATCH 215/382] enable again --- .../MonoDevelop.Ide.Editor/TooltipProvider.cs | 76 ++++++++++--------- 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs index 132537ece42..824070e38c7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs @@ -170,47 +170,53 @@ public virtual void ShowTooltipWindow (TextEditor editor, Window tipWindow, Tool var xwtWindow = (Xwt.WindowFrame)tipWindow; //xwtWindow.Location = CalculateWindowLocation (editor, item, xwtWindow, mouseX, mouseY, origin); - var gtkWindow = Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk).GetNativeWindow (xwtWindow) as Gtk.Window; + var gtkWindow = Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk3).GetNativeWindow (xwtWindow) as Gtk.Window; if (gtkWindow != null) gtkWindow.ShowAll (); else xwtWindow.Show (); } - // protected virtual Xwt.Point CalculateWindowLocation (TextEditor editor, TooltipItem item, Xwt.WindowFrame xwtWindow, int mouseX, int mouseY, Xwt.Point origin) - // { - // int w; - // double xalign; - // GetRequiredPosition (editor, xwtWindow, out w, out xalign); - // w += 10; - - // var allocation = GetAllocation (editor); - // int x = (int)(mouseX + origin.X + allocation.X); - // int y = (int)(mouseY + origin.Y + allocation.Y); - // Gtk.Widget widget = editor; - // var geometry = widget.Screen.GetUsableMonitorGeometry (widget.Screen.GetMonitorAtPoint (x, y)); - - // x -= (int)((double)w * xalign); - // y += 10; - - // if (x + w >= geometry.X + geometry.Width) - // x = geometry.X + geometry.Width - w; - // if (x < geometry.Left) - // x = geometry.Left; - - // int h = (int)xwtWindow.Size.Height; - // if (y + h >= geometry.Y + geometry.Height) - // y = geometry.Y + geometry.Height - h; - // if (y < geometry.Top) - // y = geometry.Top; - - // xwtWindow.Location = new Xwt.Point(x, y); - // var gtkWindow = Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk3).GetNativeWindow (xwtWindow) as Gtk.Window; - // if (gtkWindow != null) - // gtkWindow.ShowAll (); - // else - // xwtWindow.Show (); - // } + protected virtual Xwt.Point CalculateWindowLocation (TextEditor editor, TooltipItem item, Xwt.WindowFrame xwtWindow, int mouseX, int mouseY, Xwt.Point origin) + { + int w; + double xalign; + GetRequiredPosition (editor, xwtWindow, out w, out xalign); + w += 10; + + var allocation = GetAllocation (editor); + int x = (int)(mouseX + origin.X + allocation.X); + int y = (int)(mouseY + origin.Y + allocation.Y); + Gtk.Widget widget = editor; + var geometry = widget.Screen.GetUsableMonitorGeometry (widget.Screen.GetMonitorAtPoint (x, y)); + + x -= (int)((double)w * xalign); + y += 10; + + if (x + w >= geometry.X + geometry.Width) + x = geometry.X + geometry.Width - w; + if (x < geometry.Left) + x = geometry.Left; + + int h = (int)xwtWindow.Size.Height; + if (y + h >= geometry.Y + geometry.Height) + y = geometry.Y + geometry.Height - h; + if (y < geometry.Top) + y = geometry.Top; + + return new Xwt.Point (x, y); + } + + public virtual bool TryCloseTooltipWindow (Window tipWindow, TooltipCloseReason reason) + { + if (tipWindow.nativeWidget is Gtk.Widget gtkWidget) { + gtkWidget.Destroy (); + } else if (tipWindow.nativeWidget is IDisposable disposable) { + disposable.Dispose (); + } + tipWindow.Dispose (); + return true; + } protected bool IsDisposed { get; From ad5e5e7bb032579bb6bf7d98bf921f63382e836e Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 15 Jan 2024 23:36:27 +0100 Subject: [PATCH 216/382] enable again --- .../MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs index 824070e38c7..bba46979fe3 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs @@ -168,7 +168,7 @@ public virtual void ShowTooltipWindow (TextEditor editor, Window tipWindow, Tool var xwtWindow = (Xwt.WindowFrame)tipWindow; - //xwtWindow.Location = CalculateWindowLocation (editor, item, xwtWindow, mouseX, mouseY, origin); + xwtWindow.Location = CalculateWindowLocation (editor, item, xwtWindow, mouseX, mouseY, origin); var gtkWindow = Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk3).GetNativeWindow (xwtWindow) as Gtk.Window; if (gtkWindow != null) From 92033932b2d0e5798d633e4352f7889bc1febb2f Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 16 Jan 2024 00:22:16 +0100 Subject: [PATCH 217/382] update --- .../MonoDevelop.Ide.Gui.Components/TreeBuilder.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeBuilder.cs index c3034a543af..ed9a5c74ae6 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeBuilder.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeBuilder.cs @@ -155,10 +155,6 @@ internal static NodeAttributes GetAttributes (ITreeBuilder tb, NodeBuilder[] cha return ats; } - static int NullSortFunc (Gtk.ITreeModel model, Gtk.TreeIter a, Gtk.TreeIter b) - { - return 0; - } public void AddChildren (IEnumerable dataObjects) { NodeBuilder[] chain = null; From e3a89338b8ed94a47ac0a328d1cd4f2a3201fd57 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 16 Jan 2024 19:27:09 +0100 Subject: [PATCH 218/382] update --- .../MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs index e8bb11cf165..29568a8a992 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs @@ -55,7 +55,7 @@ public class Toolbox : VBox, IPropertyPadProvider, IToolboxConfiguration ToggleButton catToggleButton; ToggleButton compactModeToggleButton; - Gtk.SearchEntry filterEntry; + MonoDevelop.Components.SearchEntry filterEntry; MonoDevelop.Ide.Gui.PadFontChanger fontChanger; IPadWindow container; Dictionary categoryPriorities = new Dictionary (); @@ -69,8 +69,8 @@ public Toolbox (ToolboxService toolboxService, IPadWindow container) #region Toolbar DockItemToolbar toolbar = container.GetToolbar (DockPositionType.Top); - filterEntry = new Gtk.SearchEntry(); - //filterEntry.Ready = true; + filterEntry = new MonoDevelop.Components.SearchEntry(); + filterEntry.Ready = true; filterEntry.HasFrame = true; filterEntry.WidthRequest = 150; filterEntry.Changed += new EventHandler (filterTextChanged); @@ -195,7 +195,7 @@ void refilter () foreach (ToolboxWidgetCategory cat in toolboxWidget.Categories) { bool hasVisibleChild = false; foreach (ToolboxWidgetItem child in cat.Items) { - //child.IsVisible = ((ItemToolboxNode)child.Tag).Filter (filterEntry.Entry.Text); + child.IsVisible = ((ItemToolboxNode)child.Tag).Filter (filterEntry.Entry.Text); hasVisibleChild |= child.IsVisible; } cat.IsVisible = hasVisibleChild; From 1d1a4adaba72c347bf579cd8f2f3f01b1eba14bb Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 16 Jan 2024 22:56:17 +0100 Subject: [PATCH 219/382] update --- .../MonoDevelop.Components.Docking/DockBar.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs index c2f19f5e7f4..08c080d0584 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs @@ -124,8 +124,8 @@ internal DockBarItem AddItem (DockItem item, int size) box.PackStart (it, false, false, 0); it.ShowAll (); UpdateVisibility (); - //it.Shown += OnItemVisibilityChanged; - //it.Hidden += OnItemVisibilityChanged; + it.Shown += OnItemVisibilityShown; + it.Hidden += OnItemVisibilityHidden; return it; } @@ -166,8 +166,8 @@ internal void RemoveItem (DockBarItem it) { DisableHoverActivation (); box.Remove (it); - //it.Shown -= OnItemVisibilityChanged; - //it.Hidden -= OnItemVisibilityChanged; + it.Shown -= OnItemVisibilityShown; + it.Hidden -= OnItemVisibilityHidden; UpdateVisibility (); } From 22a3809eb0436cc924b0039f88cbb3e7b107c6e7 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 16 Jan 2024 23:10:58 +0100 Subject: [PATCH 220/382] update --- .../DockItemContainer.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs index df0aef5df52..bdfb40499d5 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs @@ -170,13 +170,13 @@ void SetTreeStyle (Gtk.Widget w) void OnTreeRealized (object sender, EventArgs e) { var w = (Gtk.TreeView)sender; - //if (VisualStyle.TreeBackgroundColor != null) { - //w.ModifyBase (StateType.Normal, VisualStyle.TreeBackgroundColor.Value.ToGdkColor ()); - //w.ModifyBase (StateType.Insensitive, VisualStyle.TreeBackgroundColor.Value.ToGdkColor ()); - //} else { - // w.ModifyBase (StateType.Normal, Parent.Style.Base (StateType.Normal)); - // w.ModifyBase (StateType.Insensitive, Parent.Style.Base (StateType.Insensitive)); - //} + if (VisualStyle.TreeBackgroundColor != null) { + w.ModifyBase (StateType.Normal, VisualStyle.TreeBackgroundColor.Value.ToGdkColor ()); + w.ModifyBase (StateType.Insensitive, VisualStyle.TreeBackgroundColor.Value.ToGdkColor ()); + } else { + w.ModifyBase (StateType.Normal, Parent.Style.Base (StateType.Normal)); + w.ModifyBase (StateType.Insensitive, Parent.Style.Base (StateType.Insensitive)); + } } // protected override bool OnExposeEvent (Gdk.EventExpose evnt) From ea2026fb8ce5043d99f18480a1ac129121795fb9 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 16 Jan 2024 23:23:58 +0100 Subject: [PATCH 221/382] enable again --- .../MonoDevelop.Ide.BuildOutputView/BuildOutputTreeCellView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.BuildOutputView/BuildOutputTreeCellView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.BuildOutputView/BuildOutputTreeCellView.cs index 3e3371a2b89..6f8cf58af0e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.BuildOutputView/BuildOutputTreeCellView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.BuildOutputView/BuildOutputTreeCellView.cs @@ -405,7 +405,7 @@ static BuildOutputTreeCellView () .WithSize (FontSize); defaultBoldFont = fontName.WithWeight (FontWeight.Bold); defaultFont = fontName.WithWeight (FontWeight.Normal); - //monospaceFont = IdeServices.FontService.MonospaceFont.ToXwtFont ().WithSize (FontSize); + monospaceFont = IdeServices.FontService.MonospaceFont.ToXwtFont ().WithSize (FontSize); } public BuildOutputTreeCellView (IBuildOutputContextProvider context) From 3fd81b3dd2ab3188e617267a800d12d5eca54915 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 16 Jan 2024 23:33:28 +0100 Subject: [PATCH 222/382] update --- .../MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs index 55678391d85..bdd148282eb 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs @@ -78,7 +78,6 @@ public NewFileDialog (Project parentProject, string basePath, SolutionFolder par this.basePath = basePath; BorderWidth = 6; - TransientFor = IdeApp.Workbench.RootWindow; // HasSeparator = false; InitializeComponents (); From 73edcf9313a5860cddc54b09ec94845a95c23e34 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 17 Jan 2024 19:49:46 +0100 Subject: [PATCH 223/382] restore --- .../MonoDevelop.Components/HPanedThin.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs index ac6bcc502c4..202b5638e50 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs @@ -120,23 +120,18 @@ protected CustomPanedHandle (Gtk.Paned parent) // SizeRequest (); // } - // protected virtual void OnParentSizeAllocated (Gtk.SizeAllocatedArgs args) - // { - // } + protected virtual void OnParentSizeAllocated (Gtk.SizeAllocatedArgs args) + { + } // void HandleSizeRequested (object o, Gtk.SizeRequestedArgs args) // { // OnParentSizeRequested (args); -// parent.SizeRequested += delegate { -// SizeRequest (); -// }; - // parent.SizeAllocated += HandleSizeAllocated; - // HandleWidget = null; // } void HandleSizeAllocated (object o, Gtk.SizeAllocatedArgs args) { - //OnParentSizeAllocated (args); + OnParentSizeAllocated (args); } protected override void OnDestroyed () From 20dc638ea035700a7d5bf929fd02bc0d789f02f9 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 17 Jan 2024 19:58:16 +0100 Subject: [PATCH 224/382] enable again --- .../MonoDevelop.Components/HPanedThin.cs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs index 202b5638e50..eebefccbab0 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs @@ -297,19 +297,19 @@ public CustomGtkPanedHandle (Gtk.Paned parent) : base (parent) // SizeRequest (); // } - // protected override void OnParentSizeAllocated (Gtk.SizeAllocatedArgs args) - // { - // if (ParentPaned.Child1 != null && ParentPaned.Child1.Visible && ParentPaned.Child2 != null && ParentPaned.Child2.Visible) { - // Show (); - // int centerSize = Child == null ? GrabAreaSize / 2 : 0; - // if (horizontal) - // SizeAllocate (new Gdk.Rectangle (ParentPaned.Child1.Allocation.X + ParentPaned.Child1.Allocation.Width - centerSize, args.Allocation.Y, GrabAreaSize, args.Allocation.Height)); - // else - // SizeAllocate (new Gdk.Rectangle (args.Allocation.X, ParentPaned.Child1.Allocation.Y + ParentPaned.Child1.Allocation.Height - centerSize, args.Allocation.Width, GrabAreaSize)); - // } else - // Hide (); - // base.OnParentSizeAllocated (args); - // } + protected override void OnParentSizeAllocated (Gtk.SizeAllocatedArgs args) + { + if (ParentPaned.Child1 != null && ParentPaned.Child1.Visible && ParentPaned.Child2 != null && ParentPaned.Child2.Visible) { + Show (); + int centerSize = Child == null ? GrabAreaSize / 2 : 0; + if (horizontal) + SizeAllocate (new Gdk.Rectangle (ParentPaned.Child1.Allocation.X + ParentPaned.Child1.Allocation.Width - centerSize, args.Allocation.Y, GrabAreaSize, args.Allocation.Height)); + else + SizeAllocate (new Gdk.Rectangle (args.Allocation.X, ParentPaned.Child1.Allocation.Y + ParentPaned.Child1.Allocation.Height - centerSize, args.Allocation.Width, GrabAreaSize)); + } else + Hide (); + base.OnParentSizeAllocated (args); + } public override int GrabAreaSize { get { From e683dc6d271dc2d6294cd67d0c4f4240bfbe13bd Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 17 Jan 2024 20:04:52 +0100 Subject: [PATCH 225/382] enable again --- .../MonoDevelop.Components/ImageView.cs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs index 205098a5c1f..916db6e3113 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs @@ -126,19 +126,19 @@ bool IsParentDisabled () return false; } - // protected override bool OnDrawn (Context cr) - // { - // if (image != null) { - // var alloc = Allocation; - // alloc.Inflate (-Xpad, -Ypad); - // var x = Math.Round (alloc.X + (alloc.Width - image.Width) * Xalign); - // var y = Math.Round (alloc.Y + (alloc.Height - image.Height) * Yalign); - // cr.Save (); - // cr.DrawImage (this, IsParentDisabled () ? image.WithAlpha (0.4) : image, x, y); - // cr.Restore (); - // } - // return true; - // } + protected override bool OnDrawn (Context cr) + { + if (image != null) { + var alloc = Allocation; + alloc.Inflate (-Xpad, -Ypad); + var x = Math.Round (alloc.X + (alloc.Width - image.Width) * Xalign); + var y = Math.Round (alloc.Y + (alloc.Height - image.Height) * Yalign); + cr.Save (); + cr.DrawImage (this, IsParentDisabled () ? image.WithAlpha (0.4) : image, x, y); + cr.Restore (); + } + return true; + } } } From 7779c390483825ee15a1320480bbc387cae65056 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 17 Jan 2024 20:28:45 +0100 Subject: [PATCH 226/382] enable again --- .../MonoDevelop.Components/SearchEntry.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs index d78de6a0e5c..3da3ba08067 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs @@ -330,11 +330,11 @@ private bool OnChangedTimeout () private void UpdateStyle () { - //Gdk.Color color = entry.Style.Base (entry.State); - //filter_button.ModifyBg (entry.State, color); - //clear_button.ModifyBg (entry.State, color); - //if (statusLabelEventBox != null) - //statusLabelEventBox.ModifyBg (entry.State, color); + Gdk.Color color = entry.Style.Base (entry.State); + filter_button.ModifyBg (entry.State, color); + clear_button.ModifyBg (entry.State, color); + if (statusLabelEventBox != null) + statusLabelEventBox.ModifyBg (entry.State, color); box.BorderWidth = 0; var h = entry.SizeRequest ().Height + entry.Style.Ythickness * 2; From 77331896895b06d271600af667f0243981ab3f04 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 17 Jan 2024 20:38:14 +0100 Subject: [PATCH 227/382] enable again --- .../core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs index fccf12b8ed0..cf282490687 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs @@ -575,7 +575,7 @@ void CreateLayout () layout.Dispose (); layout = PangoUtil.CreateLayout (parent); - //layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); + layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); layout.SetText (label ?? ""); layout.Alignment = Pango.Alignment.Center; layout.GetPixelSize (out w, out h); @@ -621,10 +621,10 @@ public void Draw (Cairo.Context cr, Cairo.Rectangle rectangle) if (Active) { cr.SetSourceColor (Styles.SubTabBarActiveTextColor.ToCairoColor ()); - //layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11, Pango.Weight.Bold); + layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11, Pango.Weight.Bold); } else { cr.SetSourceColor (Styles.SubTabBarTextColor.ToCairoColor ()); - //layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); + layout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); } // Pango.Layout.Width is in pango units From 62b1662ca162908c8b39c84402e66d0d64464078 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 17 Jan 2024 23:53:18 +0100 Subject: [PATCH 228/382] update --- .../MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs index 0d96acef82a..eec5f8828ac 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs @@ -515,12 +515,6 @@ static void ResultProjectDataFunc (TreeViewColumn column, CellRenderer cell, ITr pathRenderer.Markup = projectNameMarkup; } - static int TranslateIndexToUTF8 (string text, int index) - { - byte[] bytes = Encoding.UTF8.GetBytes (text); - return Encoding.UTF8.GetCharCount (bytes, 0, index); - } - List> markupCache = new List> (); void ResultTextDataFunc (TreeViewColumn column, CellRenderer cell, ITreeModel model, TreeIter iter) { if (TreeIter.Zero.Equals (iter)) From 86d1b581c14654a66ecb8f499444d9336b36c132 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 18 Jan 2024 00:18:50 +0100 Subject: [PATCH 229/382] restore --- .../ExtensibleTreeView.cs | 361 ++++++++++-------- 1 file changed, 193 insertions(+), 168 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs index b21ca8752a4..ca37e999a8c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs @@ -42,6 +42,11 @@ using MonoDevelop.Ide.Extensions; using MonoDevelop.Ide.Gui.Pads; using MonoDevelop.Projects.Extensions; +#if GTK3 +using TreeModel = Gtk.ITreeModel; +#else +using TreeModel = Gtk.TreeModel; +#endif namespace MonoDevelop.Ide.Gui.Components { @@ -303,7 +308,7 @@ bool Checker () } #endif - static void SetIconCellData (Gtk.TreeViewColumn col, Gtk.CellRenderer renderer, Gtk.ITreeModel model, Gtk.TreeIter it) + static void SetIconCellData (Gtk.TreeViewColumn col, Gtk.CellRenderer renderer, TreeModel model, Gtk.TreeIter it) { if (model == null) return; @@ -321,7 +326,7 @@ static void SetIconCellData (Gtk.TreeViewColumn col, Gtk.CellRenderer renderer, cell.OverlayTopRight = info.OverlayTopRight; } - static void SetTextCellData (Gtk.TreeViewColumn col, Gtk.CellRenderer renderer, Gtk.ITreeModel model, Gtk.TreeIter it) + static void SetTextCellData (Gtk.TreeViewColumn col, Gtk.CellRenderer renderer, TreeModel model, Gtk.TreeIter it) { if (model == null) return; @@ -397,7 +402,13 @@ void SetBuilders (NodeBuilder[] buildersArray, TreePadOption[] options) else if (!(nb is NodeBuilderExtension)) throw new InvalidOperationException (string.Format ("Invalid NodeBuilder type: {0}. NodeBuilders must inherit either from TypeNodeBuilder or NodeBuilderExtension", nb.GetType())); } - + if (NodeBuilders != null) { + var builderHash = new HashSet (builders); + foreach (var builder in NodeBuilders) { + if (!builderHash.Contains (builder)) + builder.Dispose (); + } + } NodeBuilders = builders.ToArray (); foreach (NodeBuilder nb in builders) @@ -438,7 +449,7 @@ bool CheckAndDrop (int x, int y, bool drop, Gdk.DragContext ctx, object[] obj) NodeBuilder[] chain = nav.BuilderChain; bool foundHandler = false; -// DragOperation oper = ctx.Action == Gdk.DragAction.Copy ? DragOperation.Copy : DragOperation.Move; + //DragOperation oper = ctx.Action == Gdk.DragAction.Copy ? DragOperation.Copy : DragOperation.Move; DropPosition dropPos; if (pos == Gtk.TreeViewDropPosition.After) dropPos = DropPosition.After; @@ -454,16 +465,16 @@ bool CheckAndDrop (int x, int y, bool drop, Gdk.DragContext ctx, object[] obj) try { NodeCommandHandler handler = nb.CommandHandler; handler.SetCurrentNode (nav); -// if (handler.CanDropMultipleNodes (obj, oper, dropPos)) { -// foundHandler = true; -// if (drop) { -// if (!updatesLocked) { -// LockUpdates (); -// updatesLocked = true; -// } -// handler.OnMultipleNodeDrop (obj, oper, dropPos); -// } -// } + // if (handler.CanDropMultipleNodes (obj, oper, dropPos)) { + // foundHandler = true; + // if (drop) { + // if (!updatesLocked) { + // LockUpdates (); + // updatesLocked = true; + // } + // handler.OnMultipleNodeDrop (obj, oper, dropPos); + // } + // } } catch (Exception ex) { LoggingService.LogError (ex.ToString ()); } @@ -503,7 +514,7 @@ void HandleMotionNotifyEvent (object o, Gtk.MotionNotifyEventArgs args) var rect = text_render.GetStatusIconArea (tree, cellArea); if (cx >= rect.X && cx <= rect.Right) { tree.ConvertBinWindowToWidgetCoords (rect.X, rect.Y, out rect.X, out rect.Y); - ShowStatusMessage (it, rect, info); + ShowStatusMessage (path, rect, info); popupShown = true; } } @@ -514,17 +525,17 @@ void HandleMotionNotifyEvent (object o, Gtk.MotionNotifyEventArgs args) } bool statusMessageVisible; - Gtk.TreeIter statusIconIter; + Gtk.TreePath statusIconPath; TooltipPopoverWindow statusPopover; - void ShowStatusMessage (Gtk.TreeIter it, Gdk.Rectangle rect, NodeInfo info) + void ShowStatusMessage (Gtk.TreePath path, Gdk.Rectangle rect, NodeInfo info) { - if (statusMessageVisible && store.GetPath (it).Equals (store.GetPath (statusIconIter))) + if (statusMessageVisible && path.Equals (statusIconPath)) return; if (statusPopover != null) statusPopover.Destroy (); statusMessageVisible = true; - statusIconIter = it; + statusIconPath = path; statusPopover = TooltipPopoverWindow.Create (); statusPopover.ShowArrow = true; @@ -1262,19 +1273,12 @@ public void PasteToCurrentItem () try { LockUpdates (); - TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); - if (node != null) { - NodeBuilder[] chain = node.NodeBuilderChain; - NodePosition pos = node.CurrentPosition; - foreach (NodeBuilder b in chain) { - NodeCommandHandler handler = b.CommandHandler; - handler.SetCurrentNode (node); - if (handler.CanDropMultipleNodes (copyObjects, currentTransferOperation, DropPosition.Into)) { - node.MoveToPosition (pos); - handler.OnMultipleNodeDrop (copyObjects, currentTransferOperation, DropPosition.Into); - } - node.MoveToPosition (pos); - } + var node = (TreeNodeNavigator) GetSelectedNode (); + + if (!TryHandlePaste(node, copyObjects, currentTransferOperation, false, false)) { + // if the current node can't handle the data, try to paste it into the parent node + if (node.MoveToParent ()) + TryHandlePaste (node, copyObjects, currentTransferOperation, false, true); } if (currentTransferOperation == DragOperation.Move) CancelTransfer (); @@ -1290,24 +1294,33 @@ internal void UpdatePasteToCurrentItem (CommandInfo info) info.Bypass = true; return; } + var node = (TreeNodeNavigator)GetSelectedNode (); + info.Enabled = TryHandlePaste (node, copyObjects, currentTransferOperation, true, false); + // if the current node can't handle the data, see if the parent can + if (!info.Enabled && node.MoveToParent ()) + info.Enabled = TryHandlePaste (node, copyObjects, currentTransferOperation, true, true); + } - if (copyObjects != null) { - TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); - if (node != null) { - NodeBuilder[] chain = node.NodeBuilderChain; - NodePosition pos = node.CurrentPosition; - foreach (NodeBuilder b in chain) { - NodeCommandHandler handler = b.CommandHandler; - handler.SetCurrentNode (node); - if (handler.CanDropMultipleNodes (copyObjects, currentTransferOperation, DropPosition.Into)) { - info.Enabled = true; - return; - } + static bool TryHandlePaste (TreeNodeNavigator node, object[] copyObjects, DragOperation currentTransferOperation, bool simulatePaste, bool parentDrop) + { + if (node == null || copyObjects == null || copyObjects.Length == 0) + return false; + var pos = node.CurrentPosition; + foreach (var b in node.NodeBuilderChain) { + var handler = b.CommandHandler; + handler.SetCurrentNode (node); + if (parentDrop && !handler.CanHandleDropFromChild (copyObjects, currentTransferOperation, DropPosition.Into)) + return false; + if (handler.CanDropMultipleNodes (copyObjects, currentTransferOperation, DropPosition.Into)) { + if (!simulatePaste) { node.MoveToPosition (pos); + handler.OnMultipleNodeDrop (copyObjects, currentTransferOperation, DropPosition.Into); } + return true; } + node.MoveToPosition (pos); } - info.Enabled = false; + return false; } void CancelTransfer () @@ -1388,11 +1401,11 @@ void StartLabelEditInternal() selectionLength = editTextLength - selectionStart; // This will apply the selection as soon as possible GLib.Idle.Add (() => { -// var editable = currentLabelEditable; -// if (editable == null) + //var editable = currentLabelEditable; + //if (editable == null) return false; -// editable.SelectRegion (selectionStart, selectionStart + selectionLength); + //editable.SelectRegion (selectionStart, selectionStart + selectionLength); return false; }); // Ensure we set all our state variables before calling SetCursor @@ -1457,7 +1470,7 @@ void HandleOnEditCancelled (object s, EventArgs args) { editingText = false; text_render.Editable = false; -// currentLabelEditable = null; + //currentLabelEditable = null; TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); if (node == null) @@ -1528,7 +1541,7 @@ public void RestoreTreeState (NodeState state) globalOptions[opt.Id] = val; } globalOptions.Pad = this; - RefreshTree (); + RefreshRoots (); } TypeNodeBuilder GetTypeNodeBuilder (Type type) @@ -1587,7 +1600,7 @@ TypeNodeBuilder GetTypeNodeBuilder (Gtk.TreeIter iter) return null; } - internal int CompareNodes (Gtk.ITreeModel model, Gtk.TreeIter a, Gtk.TreeIter b) + internal int CompareNodes (TreeModel model, Gtk.TreeIter a, Gtk.TreeIter b) { sorting = true; try { @@ -1967,6 +1980,7 @@ CommandEntrySet BuildEntrySet () if (options.Length > 0) { CommandEntrySet opset = new CommandEntrySet (); opset.AddItem (ViewCommands.TreeDisplayOptionList); + opset.AddItem (ProjectCommands.ToggleFileNesting); opset.AddItem (Command.Separator); opset.AddItem (ViewCommands.ResetTreeDisplayOptions); return opset; @@ -1987,6 +2001,7 @@ CommandEntrySet BuildEntrySet () if (!tnav.Clone ().MoveToParent ()) { CommandEntrySet opset = eset.AddItemSet (GettextCatalog.GetString ("Display Options")); opset.AddItem (ViewCommands.TreeDisplayOptionList); + opset.AddItem (ProjectCommands.ToggleFileNesting); opset.AddItem (Command.Separator); opset.AddItem (ViewCommands.ResetTreeDisplayOptions); // opset.AddItem (ViewCommands.CollapseAllTreeNodes); @@ -2054,7 +2069,7 @@ public void CollapseTree () void OnKeyPress (object o, Gtk.KeyPressEventArgs args) { HideStatusMessage (); - + if (args.Event.Key == Gdk.Key.Delete || args.Event.Key == Gdk.Key.KP_Delete) { DeleteCurrentItem (); args.RetVal = true; @@ -2151,27 +2166,25 @@ protected virtual void OnSelectionChanged () SelectionChanged (this, EventArgs.Empty); } + public bool IsDestroyed { get; set; } + void Destroy () { + IsDestroyed = true; IdeApp.Preferences.CustomPadFont.Changed -= CustomFontPropertyChanged; if (pix_render != null) { -// pix_render.Destroy (); + //pix_render.Destroy (); pix_render = null; } if (complete_column != null) { -// complete_column.Destroy (); + //complete_column.Destroy (); complete_column = null; } if (text_render != null) { -// text_render.Destroy (); + //text_render.Destroy (); text_render = null; } - if (store != null) { - Clear (); - store = null; - } - if (builders != null) { foreach (NodeBuilder nb in builders) { try { @@ -2182,6 +2195,12 @@ void Destroy () } builders = null; } + + if (store != null) { + Clear (); + store = null; + } + builderChains.Clear (); } @@ -2190,6 +2209,15 @@ object ICommandRouter.GetNextCommandTarget () return widget.Parent; } + /// + /// Forces the select on release feature to be disabled since the ContextMenuTreeView + /// does not always reset the SelectFunction for the tree. + /// + internal void ClearSelectOnRelease () + { + tree.ClearSelectOnRelease (); + } + internal class PadCheckMenuItem: Gtk.CheckMenuItem { internal string Id; @@ -2212,6 +2240,8 @@ internal TreeBuilderContext (ExtensibleTreeView pad) public ITreeBuilder GetTreeBuilder () { + if (pad.IsDestroyed) + throw new InvalidOperationException ("TreeView is destroyed."); Gtk.TreeIter iter; if (!pad.store.GetIterFirst (out iter)) return pad.CreateBuilder (Gtk.TreeIter.Zero); @@ -2390,7 +2420,6 @@ class CustomCellRendererText: Gtk.CellRendererText ExtensibleTreeView parent; Gdk.Rectangle buttonScreenRect; - Gdk.Rectangle buttonAllocation; string markup; string secondarymarkup; @@ -2480,7 +2509,7 @@ void SetupLayout (Gtk.Widget widget, Gtk.CellRendererState flags = 0) if (scaledFont == null) { if (scaledFont != null) scaledFont.Dispose (); - //scaledFont = (customFont ?? parent.widget.Style.FontDesc).Copy (); + scaledFont = (customFont ?? parent.widget.Style.FontDesc).Copy (); scaledFont.Size = (int)(customFont.Size * Zoom); if (layout != null) layout.FontDescription = scaledFont; @@ -2513,42 +2542,42 @@ void SetupLayout (Gtk.Widget widget, Gtk.CellRendererState flags = 0) layout.SetMarkup (newmarkup); } -// protected override void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags) -// { -// Gtk.StateType st = Gtk.StateType.Normal; -// if ((flags & Gtk.CellRendererState.Prelit) != 0) -// st = Gtk.StateType.Prelight; -// if ((flags & Gtk.CellRendererState.Focused) != 0) -// st = Gtk.StateType.Normal; -// if ((flags & Gtk.CellRendererState.Insensitive) != 0) -// st = Gtk.StateType.Insensitive; -// if ((flags & Gtk.CellRendererState.Selected) != 0) -// st = widget.HasFocus ? Gtk.StateType.Selected : Gtk.StateType.Active; -// -// SetupLayout (widget, flags); -// -// int w, h; -// layout.GetPixelSize (out w, out h); -// -// int tx = cell_area.X + (int)Xpad; -// int ty = cell_area.Y + (cell_area.Height - h) / 2; -// -// bool hasStatusIcon = StatusIcon != CellRendererImage.NullImage && StatusIcon != null; -// -// if (hasStatusIcon) { -// var img = GetResized (StatusIcon, zoom); -// if (st == Gtk.StateType.Selected) -// img = img.WithStyles ("sel"); -// var x = tx + w + StatusIconSpacing; -// using (var ctx = Gdk.CairoHelper.Create (window)) { -// ctx.DrawImage (widget, img, x, cell_area.Y + (cell_area.Height - img.Height) / 2); -// } -// } -// -// window.DrawLayout (widget.Style.TextGC (st), tx, ty, layout); -// -// hasStatusIcon = false; -// } + // protected override void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags) + // { + // Gtk.StateType st = Gtk.StateType.Normal; + // if ((flags & Gtk.CellRendererState.Prelit) != 0) + // st = Gtk.StateType.Prelight; + // if ((flags & Gtk.CellRendererState.Focused) != 0) + // st = Gtk.StateType.Normal; + // if ((flags & Gtk.CellRendererState.Insensitive) != 0) + // st = Gtk.StateType.Insensitive; + // if ((flags & Gtk.CellRendererState.Selected) != 0) + // st = widget.HasFocus ? Gtk.StateType.Selected : Gtk.StateType.Active; + + // SetupLayout (widget, flags); + + // int w, h; + // layout.GetPixelSize (out w, out h); + + // int tx = cell_area.X + (int)Xpad; + // int ty = cell_area.Y + (cell_area.Height - h) / 2; + + // bool hasStatusIcon = StatusIcon != CellRendererImage.NullImage && StatusIcon != null; + + // if (hasStatusIcon) { + // var img = GetResized (StatusIcon, zoom); + // if (st == Gtk.StateType.Selected) + // img = img.WithStyles ("sel"); + // var x = tx + w + StatusIconSpacing; + // using (var ctx = Gdk.CairoHelper.Create (window)) { + // ctx.DrawImage (widget, img, x, cell_area.Y + (cell_area.Height - img.Height) / 2); + // } + // } + + // window.DrawLayout (widget.Style.TextGC (st), tx, ty, layout); + + // hasStatusIcon = false; + // } public Gdk.Rectangle GetStatusIconArea (Gtk.Widget widget, Gdk.Rectangle cell_area) { @@ -2563,20 +2592,20 @@ public Gdk.Rectangle GetStatusIconArea (Gtk.Widget widget, Gdk.Rectangle cell_ar return new Gdk.Rectangle (x, cell_area.Y, (int) iconSize.Width, (int) cell_area.Height); } -// public override void GetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) -// { -// SetupLayout (widget); -// -// x_offset = y_offset = 0; -// -// layout.GetPixelSize (out width, out height); -// width += (int)Xpad * 2; -// -// if (StatusIcon != CellRendererImage.NullImage && StatusIcon != null) { -// var iconSize = GetZoomedIconSize (StatusIcon, zoom); -// width += (int)iconSize.Width + StatusIconSpacing; -// } -// } + // public override void GetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + // { + // SetupLayout (widget); + + // x_offset = y_offset = 0; + + // layout.GetPixelSize (out width, out height); + // width += (int)Xpad * 2; + + // if (StatusIcon != CellRendererImage.NullImage && StatusIcon != null) { + // var iconSize = GetZoomedIconSize (StatusIcon, zoom); + // width += (int)iconSize.Width + StatusIconSpacing; + // } + // } protected override void OnEditingStarted (Gtk.ICellEditable editable, string path) { @@ -2606,18 +2635,14 @@ public bool PointerInButton (int px, int py) public Gdk.Point PointerPosition { get; set; } - public Gdk.Rectangle PopupAllocation { - get { return buttonAllocation; } - } - -// protected override void OnDestroyed () -// { -// base.OnDestroyed (); -// if (scaledFont != null) -// scaledFont.Dispose (); -// if (layout != null) -// layout.Dispose (); -// } + // protected override void OnDestroyed () + // { + // base.OnDestroyed (); + // if (scaledFont != null) + // scaledFont.Dispose (); + // if (layout != null) + // layout.Dispose (); + // } } } @@ -2795,53 +2820,53 @@ Xwt.Drawing.Image GetResized (Xwt.Drawing.Image value) return resized; } -// public override void GetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) -// { -// base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); -// /* if (overlayBottomLeft != null || overlayBottomRight != null) -// height += overlayOverflow; -// if (overlayTopLeft != null || overlayTopRight != null) -// height += overlayOverflow; -// if (overlayBottomRight != null || overlayTopRight != null) -// width += overlayOverflow;*/ -// } + // public override void GetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + // { + // base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); + // /* if (overlayBottomLeft != null || overlayBottomRight != null) + // height += overlayOverflow; + // if (overlayTopLeft != null || overlayTopRight != null) + // height += overlayOverflow; + // if (overlayBottomRight != null || overlayTopRight != null) + // width += overlayOverflow;*/ + // } const int overlayOverflow = 2; -// protected override void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags) -// { -// base.Render (window, widget, background_area, cell_area, expose_area, flags); -// -// if (overlayBottomLeft != null || overlayBottomRight != null || overlayTopLeft != null || overlayTopRight != null) { -// int x, y; -// Xwt.Drawing.Image image; -// GetImageInfo (cell_area, out image, out x, out y); -// -// if (image == null) -// return; -// -// bool selected = (flags & Gtk.CellRendererState.Selected) != 0; -// -// using (var ctx = Gdk.CairoHelper.Create (window)) { -// if (overlayBottomLeft != null && overlayBottomLeft != NullImage) { -// var img = selected ? overlayBottomLeft.WithStyles ("sel") : overlayBottomLeft; -// ctx.DrawImage (widget, img, x - overlayOverflow, y + image.Height - img.Height + overlayOverflow); -// } -// if (overlayBottomRight != null && overlayBottomRight != NullImage) { -// var img = selected ? overlayBottomRight.WithStyles ("sel") : overlayBottomRight; -// ctx.DrawImage (widget, img, x + image.Width - img.Width + overlayOverflow, y + image.Height - img.Height + overlayOverflow); -// } -// if (overlayTopLeft != null && overlayTopLeft != NullImage) { -// var img = selected ? overlayTopLeft.WithStyles ("sel") : overlayTopLeft; -// ctx.DrawImage (widget, img, x - overlayOverflow, y - overlayOverflow); -// } -// if (overlayTopRight != null && overlayTopRight != NullImage) { -// var img = selected ? overlayTopRight.WithStyles ("sel") : overlayTopRight; -// ctx.DrawImage (widget, img, x + image.Width - img.Width + overlayOverflow, y - overlayOverflow); -// } -// } -// } -// } + // protected override void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags) + // { + // base.Render (window, widget, background_area, cell_area, expose_area, flags); + + // if (overlayBottomLeft != null || overlayBottomRight != null || overlayTopLeft != null || overlayTopRight != null) { + // int x, y; + // Xwt.Drawing.Image image; + // GetImageInfo (cell_area, out image, out x, out y); + + // if (image == null) + // return; + + // bool selected = (flags & Gtk.CellRendererState.Selected) != 0; + + // using (var ctx = Gdk.CairoHelper.Create (window)) { + // if (overlayBottomLeft != null && overlayBottomLeft != NullImage) { + // var img = selected ? overlayBottomLeft.WithStyles ("sel") : overlayBottomLeft; + // ctx.DrawImage (widget, img, x - overlayOverflow, y + image.Height - img.Height + overlayOverflow); + // } + // if (overlayBottomRight != null && overlayBottomRight != NullImage) { + // var img = selected ? overlayBottomRight.WithStyles ("sel") : overlayBottomRight; + // ctx.DrawImage (widget, img, x + image.Width - img.Width + overlayOverflow, y + image.Height - img.Height + overlayOverflow); + // } + // if (overlayTopLeft != null && overlayTopLeft != NullImage) { + // var img = selected ? overlayTopLeft.WithStyles ("sel") : overlayTopLeft; + // ctx.DrawImage (widget, img, x - overlayOverflow, y - overlayOverflow); + // } + // if (overlayTopRight != null && overlayTopRight != NullImage) { + // var img = selected ? overlayTopRight.WithStyles ("sel") : overlayTopRight; + // ctx.DrawImage (widget, img, x + image.Width - img.Width + overlayOverflow, y - overlayOverflow); + // } + // } + // } + // } } class NodeHashtable: Dictionary From 9a64b25fa78ffffe201be2f03d93158b8496677d Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 18 Jan 2024 02:11:47 +0100 Subject: [PATCH 230/382] enable again --- .../MonoDevelop.Ide.Gui.Components/TreeNodeNavigator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeNodeNavigator.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeNodeNavigator.cs index 6cf22514a51..c1ee813b8cc 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeNodeNavigator.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeNodeNavigator.cs @@ -108,7 +108,7 @@ public bool Selected { if (value != Selected) { ExpandToNode (); try { - //pad.ClearSelectOnRelease (); + pad.ClearSelectOnRelease (); tree.Selection.SelectIter (currentIter); tree.SetCursor (store.GetPath (currentIter), pad.CompleteColumn, false); } catch (Exception) {} From 188438363568524cbc266fab420c5d79a5b55503 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 18 Jan 2024 02:18:23 +0100 Subject: [PATCH 231/382] restore --- .../DirtyFilesDialog.cs | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs index 59cfe88f284..15dbe55d08b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs @@ -162,14 +162,15 @@ async void SaveAndQuit (object o, EventArgs e) Sensitive = false; List saveTasks = new List (); - // tsFiles.Foreach (delegate (ITreeModel model, TreePath path, TreeIter iter) { - // var window = tsFiles.GetValue (iter, 2) as SdiWorkspaceWindow; - // if (window == null) - // return false; - // if ((bool)tsFiles.GetValue (iter, 1)) - // saveTasks.Add (doc.Save ()); - // return false; - // }); + tsFiles.Foreach (delegate (ITreeModel model, TreePath path, TreeIter iter) { + var doc = tsFiles.GetValue (iter, 2) as Document; + if (doc == null) + return false; + if ((bool)tsFiles.GetValue (iter, 1)) + saveTasks.Add (doc.Save ()); + return false; + }); + try { await Task.WhenAll (saveTasks); @@ -183,13 +184,6 @@ async void SaveAndQuit (object o, EventArgs e) void Quit (object o, EventArgs e) { - //tsFiles.Foreach (delegate (ITreeModel model, TreePath path, TreeIter iter) { - //var window = tsFiles.GetValue (iter, 2) as SdiWorkspaceWindow; - //if (window == null) - // return false; - //window.ViewContent.DiscardChanges (); - //return false; - //}); Respond (Gtk.ResponseType.Ok); Hide (); } From 17f9eba898fafb41bc831e15de520ca9f6ef08a1 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 18 Jan 2024 02:29:18 +0100 Subject: [PATCH 232/382] enable again --- .../FileSelectorDialog.cs | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs index 467e39a1dde..854ceeea2b6 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs @@ -108,25 +108,24 @@ public FileSelectorDialog (string title, Gtk.FileChooserAction action): base (ti closeWorkspaceCheck.Visible = ShowViewerSelector = false; } - // public TextEncoding SelectedEncoding { - // get { - // if (!ShowEncodingSelector) - // return -1; - // else if (encodingMenu.Active < firstEncIndex || encodingMenu.Active == selectOption) - // return -1; - // return TextEncoding.ConversionEncodings [encodingMenu.Active - firstEncIndex].CodePage; - // } - // set { - // for (uint n=0; n < TextEncoding.ConversionEncodings.Length; n++) { - - // if (TextEncoding.ConversionEncodings [n].CodePage == value) { - // encodingMenu.Active = (int)(n + firstEncIndex); - // return; - // } - // } - // encodingMenu.Active = 0; - // } - // } + public TextEncoding SelectedEncoding { + get { + if (!ShowEncodingSelector) + return null; + else if (encodingMenu.Active < firstEncIndex || encodingMenu.Active == selectOption) + return null; + return TextEncoding.ConversionEncodings [encodingMenu.Active - firstEncIndex]; + } + set { + for (uint n=0; n < TextEncoding.ConversionEncodings.Length; n++) { + if (TextEncoding.ConversionEncodings [n] == value) { + encodingMenu.Active = (int)(n + firstEncIndex); + return; + } + } + encodingMenu.Active = 0; + } + } public bool ShowEncodingSelector { get { return encodingLabel.Visible; } From f2c67ef978073a216cffcb62eacc0b828d081daa Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 18 Jan 2024 02:35:43 +0100 Subject: [PATCH 233/382] enable again --- .../MonoDevelop.Ide.Gui.Dialogs/OpenFileDialog.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OpenFileDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OpenFileDialog.cs index 1b4b66678f2..413f32f25a7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OpenFileDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OpenFileDialog.cs @@ -104,7 +104,7 @@ public bool CenterToParent { protected override bool RunDefault () { var win = new FileSelectorDialog (Title, Action.ToGtkAction ()); - //win.SelectedEncoding = TextEncoding.GetEncoding (Encoding); + win.SelectedEncoding = TextEncoding.GetEncoding (Encoding); win.ShowEncodingSelector = ShowEncodingSelector; win.ShowViewerSelector = ShowViewerSelector; bool pathAlreadySet = false; @@ -123,7 +123,7 @@ protected override bool RunDefault () var result = MessageService.RunCustomDialog (win, TransientFor ?? MessageService.RootWindow); if (result == (int)Gtk.ResponseType.Ok) { GetDefaultProperties (win); - //data.Encoding = win.SelectedEncoding?.Encoding; + data.Encoding = win.SelectedEncoding?.Encoding; data.CloseCurrentWorkspace = win.CloseCurrentWorkspace; data.SelectedViewer = win.SelectedViewer; return true; From 2d3434f74dd73c08321f232350755ff0f55880f7 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 18 Jan 2024 02:46:09 +0100 Subject: [PATCH 234/382] enable again --- .../MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs index 46cccfbc0b0..0efd70970c3 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs @@ -60,7 +60,7 @@ public HelpTree () tree_view.AppendColumn ("name_col", tree_view.TextRenderer, "text", 0); tree_view.RowExpanded += new Gtk.RowExpandedHandler (RowExpanded); - tree_view.Selection.Changed += new EventHandler (RowActivated); + tree_view.RowActivated += RowActivated; store = new TreeStore (typeof (string), typeof (Monodoc.Node)); tree_view.Model = store; tree_view.HeadersVisible = false; @@ -123,8 +123,8 @@ void RowActivated (object o, EventArgs e) return; } Monodoc.Node n = (Monodoc.Node)store.GetValue (iter, 1); - - //IdeApp.HelpOperations.ShowHelp (n.PublicUrl); + + IdeServices.HelpOperations.ShowHelp (n.PublicUrl); } } From acd1559365afd4b4047d633d2fcd85b08c75a9f5 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 18 Jan 2024 03:07:47 +0100 Subject: [PATCH 235/382] update --- .../MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs index 1ef2d6b96c1..aec476647bf 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs @@ -146,7 +146,6 @@ void Build () topLabelHBox.Name = "topLabelHBox"; topLabelHBox.PackStart (topBannerLabel, false, false, 20); topLabelEventBox.Add (topLabelHBox); - //ContentArea.PackStart (topBannerTopEdgeLineEventBox, false, false, 0); ContentArea.PackStart (topLabelEventBox, false, false, 0); ContentArea.PackStart (topBannerBottomEdgeLineEventBox, false, false, 0); // Main templates section. @@ -180,6 +179,7 @@ void Build () templateCategoriesTreeView.HeadersVisible = false; templateCategoriesTreeView.Model = templateCategoriesTreeStore; templateCategoriesTreeView.SearchColumn = -1; // disable the interactive search + templateCategoriesTreeView.ShowExpanders = false; templateCategoriesTreeView.AppendColumn (CreateTemplateCategoriesTreeViewColumn ()); templateCategoriesScrolledWindow.Add (templateCategoriesTreeView); templateCategoriesBgBox.Add (templateCategoriesScrolledWindow); @@ -205,6 +205,7 @@ void Build () templatesTreeView.HeadersVisible = false; templatesTreeView.Model = templatesTreeStore; templatesTreeView.SearchColumn = -1; // disable the interactive search + templatesTreeView.ShowExpanders = false; templatesTreeView.AppendColumn (CreateTemplateListTreeViewColumn ()); templatesScrolledWindow.Add (templatesTreeView); templatesBgBox.Add (templatesScrolledWindow); From 3519752137d6e13a1450038f5599af7c88961704 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 18 Jan 2024 11:05:23 +0100 Subject: [PATCH 236/382] update --- main/src/tools/mdmonitor/gtk-gui/generated.cs | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/main/src/tools/mdmonitor/gtk-gui/generated.cs b/main/src/tools/mdmonitor/gtk-gui/generated.cs index 8afacbc5c65..1375870e365 100644 --- a/main/src/tools/mdmonitor/gtk-gui/generated.cs +++ b/main/src/tools/mdmonitor/gtk-gui/generated.cs @@ -70,40 +70,40 @@ private void OnRealized (object sender, System.EventArgs args) internal class IconLoader { - // public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size) - // { - // Gdk.Pixbuf res = widget.RenderIcon (name, size, null); - // if ((res != null)) { - // return res; - // } else { - // int sz; - // int sy; - // global::Gtk.Icon.SizeLookup (size, out sz, out sy); - // try { - // return Gtk.IconTheme.Default.LoadIcon (name, sz, 0); - // } catch (System.Exception) { - // if ((name != "gtk-missing-image")) { - // return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size); - // } else { - //Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz); - //Gdk.GC gc = new Gdk.GC (pmap); - //gc.RgbFgColor = new Gdk.Color (255, 255, 255); - //pmap.DrawRectangle (gc, true, 0, 0, sz, sz); - //gc.RgbFgColor = new Gdk.Color (0, 0, 0); - //pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1)); - //gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round); - //gc.RgbFgColor = new Gdk.Color (255, 0, 0); - //pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - // - (sz / 4)), ((sz - 1) - // - (sz / 4))); - //pmap.DrawLine (gc, ((sz - 1) - // - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - // - (sz / 4))); - //return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz); + public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size) + { + Gdk.Pixbuf res = widget.RenderIcon (name, size, null); + if ((res != null)) { + return res; + } else { + int sz; + int sy; + global::Gtk.Icon.SizeLookup (size, out sz, out sy); + try { + return Gtk.IconTheme.Default.LoadIcon (name, sz, 0); + } catch (System.Exception) { + //if ((name != "gtk-missing-image")) { + return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size); + //} else { + // Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz); + // Gdk.GC gc = new Gdk.GC (pmap); + // gc.RgbFgColor = new Gdk.Color (255, 255, 255); + // pmap.DrawRectangle (gc, true, 0, 0, sz, sz); + // gc.RgbFgColor = new Gdk.Color (0, 0, 0); + // pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1)); + // gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round); + // gc.RgbFgColor = new Gdk.Color (255, 0, 0); + // pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) + // - (sz / 4)), ((sz - 1) + // - (sz / 4))); + // pmap.DrawLine (gc, ((sz - 1) + // - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) + // - (sz / 4))); + // return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz); //} - //} - //} - //} + } + } + } } internal class ActionGroups From 5f241870c101bbed59b671a413c028538fdaea4a Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 18 Jan 2024 20:37:54 +0100 Subject: [PATCH 237/382] update --- ...ntation.Monitor.InstrumentationChartView.cs | 12 ++++++------ ...tion.Monitor.InstrumentationViewerDialog.cs | 18 +++++++++--------- ...strumentation.Monitor.TimeLineViewWindow.cs | 10 +++++----- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationChartView.cs b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationChartView.cs index 3d953e09409..288c1812fa6 100644 --- a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationChartView.cs +++ b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationChartView.cs @@ -81,9 +81,9 @@ protected virtual void Build () this.buttonZoomOut.Relief = ((global::Gtk.ReliefStyle)(2)); this.buttonZoomOut.Label = ""; global::Gtk.Image w3 = new global::Gtk.Image (); - // w3.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-zoom-out", global::Gtk.IconSize.Menu); - // this.buttonZoomOut.Image = w3; - // this.hboxChartBar.Add (this.buttonZoomOut); + w3.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-zoom-out", global::Gtk.IconSize.Menu); + this.buttonZoomOut.Image = w3; + this.hboxChartBar.Add (this.buttonZoomOut); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hboxChartBar [this.buttonZoomOut])); w4.PackType = ((global::Gtk.PackType)(1)); w4.Position = 2; @@ -97,9 +97,9 @@ protected virtual void Build () this.buttonZoomIn.Relief = ((global::Gtk.ReliefStyle)(2)); this.buttonZoomIn.Label = ""; global::Gtk.Image w5 = new global::Gtk.Image (); - // w5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-zoom-in", global::Gtk.IconSize.Menu); - // this.buttonZoomIn.Image = w5; - // this.hboxChartBar.Add (this.buttonZoomIn); + w5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-zoom-in", global::Gtk.IconSize.Menu); + this.buttonZoomIn.Image = w5; + this.hboxChartBar.Add (this.buttonZoomIn); global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hboxChartBar [this.buttonZoomIn])); w6.PackType = ((global::Gtk.PackType)(1)); w6.Position = 3; diff --git a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationViewerDialog.cs b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationViewerDialog.cs index 60ecffec4e6..8f4d1022d38 100644 --- a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationViewerDialog.cs +++ b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationViewerDialog.cs @@ -122,9 +122,9 @@ protected virtual void Build () this.buttonSave.Relief = ((global::Gtk.ReliefStyle)(2)); this.buttonSave.Label = global::Mono.Unix.Catalog.GetString ("Save"); global::Gtk.Image w6 = new global::Gtk.Image (); - // w6.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-save", global::Gtk.IconSize.Button); - // this.buttonSave.Image = w6; - // this.buttonsBox.Add (this.buttonSave); + w6.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-save", global::Gtk.IconSize.Button); + this.buttonSave.Image = w6; + this.buttonsBox.Add (this.buttonSave); global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.buttonsBox [this.buttonSave])); w7.Position = 0; w7.Expand = false; @@ -137,9 +137,9 @@ protected virtual void Build () this.buttonSaveAs.Relief = ((global::Gtk.ReliefStyle)(2)); this.buttonSaveAs.Label = global::Mono.Unix.Catalog.GetString ("Copy"); global::Gtk.Image w8 = new global::Gtk.Image (); - // w8.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-copy", global::Gtk.IconSize.Button); - // this.buttonSaveAs.Image = w8; - // this.buttonsBox.Add (this.buttonSaveAs); + w8.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-copy", global::Gtk.IconSize.Button); + this.buttonSaveAs.Image = w8; + this.buttonsBox.Add (this.buttonSaveAs); global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.buttonsBox [this.buttonSaveAs])); w9.Position = 1; w9.Expand = false; @@ -152,9 +152,9 @@ protected virtual void Build () this.buttonDelete.Relief = ((global::Gtk.ReliefStyle)(2)); this.buttonDelete.Label = global::Mono.Unix.Catalog.GetString ("Delete"); global::Gtk.Image w10 = new global::Gtk.Image (); - //w10.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-delete", global::Gtk.IconSize.Button); - //this.buttonDelete.Image = w10; - //this.buttonsBox.Add (this.buttonDelete); + w10.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-delete", global::Gtk.IconSize.Button); + this.buttonDelete.Image = w10; + this.buttonsBox.Add (this.buttonDelete); global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.buttonsBox [this.buttonDelete])); w11.Position = 2; w11.Expand = false; diff --git a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.TimeLineViewWindow.cs b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.TimeLineViewWindow.cs index 7d4cd285635..42c8abce6ca 100644 --- a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.TimeLineViewWindow.cs +++ b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.TimeLineViewWindow.cs @@ -108,8 +108,8 @@ protected virtual void Build () this.button3.UseUnderline = true; this.button3.Label = ""; global::Gtk.Image w9 = new global::Gtk.Image (); - // w9.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-zoom-100", global::Gtk.IconSize.Menu); - // this.button3.Image = w9; + w9.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-zoom-100", global::Gtk.IconSize.Menu); + this.button3.Image = w9; this.vbox1.Add (this.button3); global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.button3])); w10.Position = 0; @@ -148,9 +148,9 @@ protected virtual void Build () this.buttonResetScale.UseUnderline = true; this.buttonResetScale.Label = ""; global::Gtk.Image w13 = new global::Gtk.Image (); - // w13.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "stock_draw-dimension-line", global::Gtk.IconSize.Menu); - // this.buttonResetScale.Image = w13; - // this.vbox1.Add (this.buttonResetScale); + w13.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "stock_draw-dimension-line", global::Gtk.IconSize.Menu); + this.buttonResetScale.Image = w13; + this.vbox1.Add (this.buttonResetScale); global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.buttonResetScale])); w14.Position = 3; w14.Expand = false; From 91d38ba81ad639573275bcef32835f17d15dbbf2 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 18 Jan 2024 20:47:36 +0100 Subject: [PATCH 238/382] update --- ...Mono.Instrumentation.Monitor.NewProfile.cs | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.NewProfile.cs b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.NewProfile.cs index 7d5a211d831..a376cc9733f 100644 --- a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.NewProfile.cs +++ b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.NewProfile.cs @@ -18,9 +18,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("New View"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child Mono.Instrumentation.Monitor.NewProfile.VBox - //global::Gtk.VBox w1 = this.VBox; - //w1.Name = "dialog1_VBox"; - //w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -47,17 +47,17 @@ protected virtual void Build () w3.Position = 1; w3.Expand = false; w3.Fill = false; - //w1.Add (this.vbox2); - // global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - // w4.Position = 0; - // w4.Expand = false; - // w4.Fill = false; + w1.Add (this.vbox2); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + w4.Position = 0; + w4.Expand = false; + w4.Fill = false; // Internal child Mono.Instrumentation.Monitor.NewProfile.ActionArea - // global::Gtk.HButtonBox w5 = this.ActionArea; - // w5.Name = "dialog1_ActionArea"; - // w5.Spacing = 10; - // w5.BorderWidth = ((uint)(5)); - // w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w5 = (Gtk.HButtonBox)this.ActionArea; + w5.Name = "dialog1_ActionArea"; + w5.Spacing = 10; + w5.BorderWidth = ((uint)(5)); + w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -67,9 +67,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel])); - // w6.Expand = false; - // w6.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel])); + w6.Expand = false; + w6.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -79,10 +79,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk])); - // w7.Position = 1; - // w7.Expand = false; - // w7.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk])); + w7.Position = 1; + w7.Expand = false; + w7.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } From f2bb723db1576f36f18f197242d938df1c05edf4 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 18 Jan 2024 23:30:10 +0100 Subject: [PATCH 239/382] update --- ...evelop.ChangeLogAddIn.AddLogEntryDialog.cs | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs b/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs index 63f17ba95c7..3785f2d189d 100644 --- a/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs +++ b/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs @@ -58,11 +58,11 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Events = ((global::Gdk.EventMask)(256)); - // w1.Name = "dialog_VBox"; - // w1.Spacing = 6; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Events = ((global::Gdk.EventMask)(256)); + w1.Name = "dialog_VBox"; + w1.Spacing = 6; + w1.BorderWidth = ((uint)(2)); // Container child dialog_VBox.Gtk.Box+BoxChild this.vbox1 = new global::Gtk.VBox (); this.vbox1.Name = "vbox1"; @@ -239,16 +239,16 @@ protected virtual void Build () w20.Position = 3; w20.Expand = false; w20.Fill = false; - // w1.Add (this.vbox1); - // global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox1])); - // w21.Position = 0; + w1.Add (this.vbox1); + global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox1])); + w21.Position = 0; // Internal child MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.ActionArea - // global::Gtk.HButtonBox w22 = this.ActionArea; - // w22.Events = ((global::Gdk.EventMask)(256)); - // w22.Name = "ChangeLogAddIn.AddLogEntryDialog_ActionArea"; - // w22.Spacing = 6; - // w22.BorderWidth = ((uint)(5)); - // w22.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w22 = (Gtk.HButtonBox)this.ActionArea; + w22.Events = ((global::Gdk.EventMask)(256)); + w22.Name = "ChangeLogAddIn.AddLogEntryDialog_ActionArea"; + w22.Spacing = 6; + w22.BorderWidth = ((uint)(5)); + w22.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child ChangeLogAddIn.AddLogEntryDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button7 = new global::Gtk.Button (); this.button7.CanDefault = true; @@ -258,9 +258,9 @@ protected virtual void Build () this.button7.UseUnderline = true; this.button7.Label = "gtk-cancel"; this.AddActionWidget (this.button7, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w23 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w22 [this.button7])); - // w23.Expand = false; - // w23.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w23 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w22 [this.button7])); + w23.Expand = false; + w23.Fill = false; // Container child ChangeLogAddIn.AddLogEntryDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button119 = new global::Gtk.Button (); this.button119.CanDefault = true; @@ -270,10 +270,10 @@ protected virtual void Build () this.button119.UseUnderline = true; this.button119.Label = "gtk-ok"; this.AddActionWidget (this.button119, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w24 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w22 [this.button119])); - // w24.Position = 1; - // w24.Expand = false; - // w24.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w24 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w22 [this.button119])); + w24.Position = 1; + w24.Expand = false; + w24.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } From a8980761ac187d541372e33d310436b60d63af81 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 19 Jan 2024 17:47:10 +0100 Subject: [PATCH 240/382] update --- ...CrossPlatformLibraryProjectTemplateWizardPageWidget.cs | 8 ++++---- ...aging.Gui.GtkNuGetPackageMetadataOptionsPanelWidget.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkCrossPlatformLibraryProjectTemplateWizardPageWidget.cs b/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkCrossPlatformLibraryProjectTemplateWizardPageWidget.cs index 3df7c86d521..3cc86ba7bed 100644 --- a/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkCrossPlatformLibraryProjectTemplateWizardPageWidget.cs +++ b/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkCrossPlatformLibraryProjectTemplateWizardPageWidget.cs @@ -259,10 +259,10 @@ protected virtual void Build () this.sharedProjectRadioButton.Active = true; this.sharedProjectRadioButton.DrawIndicator = true; this.sharedProjectRadioButton.UseUnderline = true; - //this.sharedProjectRadioButton.Group = new global::GLib.SList (global::System.IntPtr.Zero); - //this.usePortableClassLibraryHBox.Add (this.sharedProjectRadioButton); - //global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.usePortableClassLibraryHBox [this.sharedProjectRadioButton])); - //w14.Position = 0; + this.sharedProjectRadioButton.Group = new Gtk.RadioButton [0]; + this.usePortableClassLibraryHBox.Add (this.sharedProjectRadioButton); + global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.usePortableClassLibraryHBox [this.sharedProjectRadioButton])); + w14.Position = 0; // Container child usePortableClassLibraryHBox.Gtk.Box+BoxChild this.usePortableLibraryInfoVBox = new global::Gtk.VBox (); this.usePortableLibraryInfoVBox.Name = "usePortableLibraryInfoVBox"; diff --git a/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkNuGetPackageMetadataOptionsPanelWidget.cs b/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkNuGetPackageMetadataOptionsPanelWidget.cs index 09c5e0851f2..c3201e4051a 100644 --- a/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkNuGetPackageMetadataOptionsPanelWidget.cs +++ b/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkNuGetPackageMetadataOptionsPanelWidget.cs @@ -258,7 +258,7 @@ protected virtual void Build() this.packageCopyrightTextBox.CanFocus = true; this.packageCopyrightTextBox.Name = "packageCopyrightTextBox"; this.packageCopyrightTextBox.IsEditable = true; - //this.packageCopyrightTextBox.InvisibleChar = '●'; + this.packageCopyrightTextBox.InvisibleChar = '●'; this.detailsTable.Add(this.packageCopyrightTextBox); global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.detailsTable[this.packageCopyrightTextBox])); w14.TopAttach = ((uint)(1)); @@ -321,9 +321,9 @@ protected virtual void Build() this.packageLanguageHBox.Name = "packageLanguageHBox"; this.packageLanguageHBox.Spacing = 6; // Container child packageLanguageHBox.Gtk.Box+BoxChild - //this.packageLanguageComboBox = global::Gtk.ComboBox.NewText(); - //this.packageLanguageComboBox.Name = "packageLanguageComboBox"; - //this.packageLanguageHBox.Add(this.packageLanguageComboBox); + this.packageLanguageComboBox = new global::Gtk.ComboBoxText(); + this.packageLanguageComboBox.Name = "packageLanguageComboBox"; + this.packageLanguageHBox.Add(this.packageLanguageComboBox); global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.packageLanguageHBox[this.packageLanguageComboBox])); w19.Position = 0; w19.Expand = false; From 39e97b88d8b594033355d9337d70a2b248c843f2 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 19 Jan 2024 17:59:45 +0100 Subject: [PATCH 241/382] update --- .../GtkReferenceAssembliesOptionsPanelWidget.UI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkReferenceAssembliesOptionsPanelWidget.UI.cs b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkReferenceAssembliesOptionsPanelWidget.UI.cs index 5491e5b215e..a67c24501a8 100644 --- a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkReferenceAssembliesOptionsPanelWidget.UI.cs +++ b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkReferenceAssembliesOptionsPanelWidget.UI.cs @@ -80,7 +80,7 @@ void Build () pclProfilesStore = new ListStore (typeof (bool), typeof (string), typeof (string), typeof (object)); pclProfilesTreeView.Model = pclProfilesStore; - //vbox.PackStart (scrolledWindow); + vbox.PackStart (scrolledWindow, false, true, 0); Add (vbox); From 309a76b46fb330102c6d7826643db95ef15babfe Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 19 Jan 2024 18:14:29 +0100 Subject: [PATCH 242/382] update --- ...op.Refactoring.RefactoringPreviewDialog.cs | 36 +++++++------- ...lop.Refactoring.Rename.RenameItemDialog.cs | 48 +++++++++---------- ...g.SignatureChange.SignatureChangeDialog.cs | 38 +++++++-------- 3 files changed, 61 insertions(+), 61 deletions(-) diff --git a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.RefactoringPreviewDialog.cs b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.RefactoringPreviewDialog.cs index 3758a3cec60..cffa949d889 100644 --- a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.RefactoringPreviewDialog.cs +++ b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.RefactoringPreviewDialog.cs @@ -25,9 +25,9 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Refactoring.RefactoringPreviewDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Name = "dialog1_VBox"; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -55,15 +55,15 @@ protected virtual void Build () this.vbox2.Add (this.GtkScrolledWindow); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.GtkScrolledWindow])); w4.Position = 1; - //w1.Add (this.vbox2); - // global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - // w5.Position = 0; + w1.Add (this.vbox2); + global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + w5.Position = 0; // Internal child MonoDevelop.Refactoring.RefactoringPreviewDialog.ActionArea - // global::Gtk.HButtonBox w6 = this.ActionArea; - // w6.Name = "dialog1_ActionArea"; - // w6.Spacing = 10; - // w6.BorderWidth = ((uint)(5)); - // w6.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w6 = (Gtk.HButtonBox)this.ActionArea; + w6.Name = "dialog1_ActionArea"; + w6.Spacing = 10; + w6.BorderWidth = ((uint)(5)); + w6.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -73,9 +73,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w6 [this.buttonCancel])); - // w7.Expand = false; - // w7.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w6 [this.buttonCancel])); + w7.Expand = false; + w7.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -85,10 +85,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w6 [this.buttonOk])); - // w8.Position = 1; - // w8.Expand = false; - // w8.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w6 [this.buttonOk])); + w8.Position = 1; + w8.Expand = false; + w8.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs index 04ea5baac4e..2353c141819 100644 --- a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs +++ b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs @@ -37,9 +37,9 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Refactoring.Rename.RenameItemDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Name = "dialog1_VBox"; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox = new global::Gtk.VBox (); this.vbox.Name = "vbox"; @@ -126,17 +126,17 @@ protected virtual void Build () w9.Position = 3; w9.Expand = false; w9.Fill = false; - //w1.Add (this.vbox); - // global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox])); - // w10.Position = 0; - // w10.Expand = false; - // w10.Fill = false; + w1.Add (this.vbox); + global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox])); + w10.Position = 0; + w10.Expand = false; + w10.Fill = false; // Internal child MonoDevelop.Refactoring.Rename.RenameItemDialog.ActionArea - // global::Gtk.HButtonBox w11 = this.ActionArea; - // w11.Name = "dialog1_ActionArea"; - // w11.Spacing = 10; - // w11.BorderWidth = ((uint)(5)); - // w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w11 = (Gtk.HButtonBox)this.ActionArea; + w11.Name = "dialog1_ActionArea"; + w11.Spacing = 10; + w11.BorderWidth = ((uint)(5)); + w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -146,9 +146,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonCancel])); - // w12.Expand = false; - // w12.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonCancel])); + w12.Expand = false; + w12.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonPreview = new global::Gtk.Button (); this.buttonPreview.CanFocus = true; @@ -156,10 +156,10 @@ protected virtual void Build () this.buttonPreview.UseUnderline = true; this.buttonPreview.Label = global::Mono.Unix.Catalog.GetString ("_Preview"); this.AddActionWidget (this.buttonPreview, 0); - // global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonPreview])); - // w13.Position = 1; - // w13.Expand = false; - // w13.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonPreview])); + w13.Position = 1; + w13.Expand = false; + w13.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -169,10 +169,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonOk])); - // w14.Position = 2; - // w14.Expand = false; - // w14.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonOk])); + w14.Position = 2; + w14.Expand = false; + w14.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.cs b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.cs index 37c4b93d9fb..e2340114422 100644 --- a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.cs +++ b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.cs @@ -44,10 +44,10 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Name = "dialog1_VBox"; - // w1.Spacing = 6; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Name = "dialog1_VBox"; + w1.Spacing = 6; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -163,15 +163,15 @@ protected virtual void Build () this.vbox2.Add (this.framePreview); global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.framePreview])); w13.Position = 2; - //w1.Add (this.vbox2); - // global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - // w14.Position = 0; + w1.Add (this.vbox2); + global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + w14.Position = 0; // Internal child MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.ActionArea - // global::Gtk.HButtonBox w15 = this.ActionArea; - // w15.Name = "dialog1_ActionArea"; - // w15.Spacing = 10; - // w15.BorderWidth = ((uint)(5)); - // w15.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w15 = (Gtk.HButtonBox)this.ActionArea; + w15.Name = "dialog1_ActionArea"; + w15.Spacing = 10; + w15.BorderWidth = ((uint)(5)); + w15.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -181,9 +181,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w16 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w15 [this.buttonCancel])); - // w16.Expand = false; - // w16.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w16 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w15 [this.buttonCancel])); + w16.Expand = false; + w16.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -193,10 +193,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w17 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w15 [this.buttonOk])); - // w17.Position = 1; - // w17.Expand = false; - // w17.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w17 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w15 [this.buttonOk])); + w17.Position = 1; + w17.Expand = false; + w17.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } From 9843f68d2c45121992fad1bf1d7531491ba0d721 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 19 Jan 2024 22:53:19 +0100 Subject: [PATCH 243/382] restore --- .../ExceptionCaughtDialog.cs | 69 ++++--------------- 1 file changed, 12 insertions(+), 57 deletions(-) diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs index a96a5a11a11..36c22f269cb 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs @@ -283,66 +283,21 @@ Widget CreateExceptionValueTreeView () return vbox; } - class ExpanderWithMinSize : Expander - { - public ExpanderWithMinSize (string label) : base (label) - { - } + // static void StackFrameLayout (CellLayout layout, CellRenderer cr, ITreeModel model, TreeIter iter) + // { + // var frame = (ExceptionStackFrame)model.GetValue (iter, (int)ModelColumn.StackFrame); + // var renderer = (StackFrameCellRenderer)cr; - protected override void OnGetPreferredHeight (out int minimum_height, out int natural_height) - { - base.OnGetPreferredHeight (out minimum_height, out natural_height); - minimum_height = natural_height = 28; - } + // renderer.Markup = (string)model.GetValue (iter, (int)ModelColumn.Markup); + // renderer.Frame = frame; - } + // if (frame == null) { + // renderer.IsUserCode = false; + // return; + // } - Expander WrapInExpander (string title, Widget widget) - { - var expander = new ExpanderWithMinSize ($"{GLib.Markup.EscapeText (title)}"); - expander.Name = "exception_dialog_expander"; - Gtk.Rc.ParseString (@"style ""exception-dialog-expander"" -{ - GtkExpander::expander-spacing = 10 -} -widget ""*.exception_dialog_expander"" style ""exception-dialog-expander"" -"); - expander.Child = widget; - expander.Spacing = 0; - expander.Show (); - expander.CanFocus = false; - expander.UseMarkup = true; - expander.Expanded = true; - expander.Activated += Expander_Activated; - expander.ModifyBg (StateType.Prelight, Ide.Gui.Styles.PrimaryBackgroundColor.ToGdkColor ()); - return expander; - } - - void Expander_Activated (object sender, EventArgs e) - { - // if (expanderProperties.Expanded && expanderStacktrace.Expanded) - // paned.PositionSet = false; - // else if (expanderStacktrace.Expanded) - // paned.Position = paned.MaxPosition; - // else - // paned.Position = paned.MinPosition; - } - -// static void StackFrameLayout (CellLayout layout, CellRenderer cr, ITreeModel model, TreeIter iter) -// { -// var frame = (ExceptionStackFrame)model.GetValue (iter, (int)ModelColumn.StackFrame); -// var renderer = (StackFrameCellRenderer)cr; -// -// renderer.Markup = (string)model.GetValue (iter, (int)ModelColumn.Markup); -// renderer.Frame = frame; -// -// if (frame == null) { -// renderer.IsUserCode = false; -// return; -// } -// -// renderer.IsUserCode = (bool)model.GetValue (iter, (int)ModelColumn.IsUserCode); -// } + // renderer.IsUserCode = (bool)model.GetValue (iter, (int)ModelColumn.IsUserCode); + // } Widget CreateStackTraceTreeView () { var store = new ListStore (typeof (ExceptionStackFrame), typeof (string), typeof (bool)); From 04c735244dfa59046750dc049e1a7239558db939 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sun, 21 Jan 2024 21:25:46 +0100 Subject: [PATCH 244/382] update --- ...harp.Project.CompilerOptionsPanelWidget.cs | 50 ++++----- .../CompilerOptionsPanelWidget.cs | 104 +++++++++--------- 2 files changed, 77 insertions(+), 77 deletions(-) diff --git a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget.cs b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget.cs index e4d0b992dc4..fe10ce733f3 100644 --- a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget.cs +++ b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget.cs @@ -18,7 +18,7 @@ partial class CompilerOptionsPanelWidget private global::Gtk.Table table7; - //private global::Gtk.ComboBoxEntry codepageEntry; + private global::Gtk.ComboBoxText codepageEntry; private global::Gtk.HBox hbox57; @@ -34,7 +34,7 @@ partial class CompilerOptionsPanelWidget private global::Gtk.Label label88; - //private global::Gtk.ComboBoxEntry mainClassEntry; + private global::Gtk.ComboBoxText mainClassEntry; private global::Gtk.CheckButton noStdLibCheckButton; @@ -102,16 +102,16 @@ protected virtual void Build () this.table7.RowSpacing = ((uint)(6)); this.table7.ColumnSpacing = ((uint)(6)); // Container child table7.Gtk.Table+TableChild - //this.codepageEntry = global::Gtk.ComboBoxEntry.NewText (); - //this.codepageEntry.Name = "codepageEntry"; - //this.table7.Add (this.codepageEntry); - // global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table7 [this.codepageEntry])); - // w3.TopAttach = ((uint)(3)); - // w3.BottomAttach = ((uint)(4)); - // w3.LeftAttach = ((uint)(1)); - // w3.RightAttach = ((uint)(2)); - // w3.XOptions = ((global::Gtk.AttachOptions)(4)); - // w3.YOptions = ((global::Gtk.AttachOptions)(4)); + this.codepageEntry = new global::Gtk.ComboBoxText (); + this.codepageEntry.Name = "codepageEntry"; + this.table7.Add (this.codepageEntry); + global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table7 [this.codepageEntry])); + w3.TopAttach = ((uint)(3)); + w3.BottomAttach = ((uint)(4)); + w3.LeftAttach = ((uint)(1)); + w3.RightAttach = ((uint)(2)); + w3.XOptions = ((global::Gtk.AttachOptions)(4)); + w3.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table7.Gtk.Table+TableChild this.hbox57 = new global::Gtk.HBox (); this.hbox57.Name = "hbox57"; @@ -185,15 +185,15 @@ protected virtual void Build () w10.XOptions = ((global::Gtk.AttachOptions)(4)); w10.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table7.Gtk.Table+TableChild - //this.mainClassEntry = new global::Gtk.ComboBoxEntry (); - //this.mainClassEntry.Name = "mainClassEntry"; - //this.table7.Add (this.mainClassEntry); - // global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table7 [this.mainClassEntry])); - // w11.TopAttach = ((uint)(1)); - // w11.BottomAttach = ((uint)(2)); - // w11.LeftAttach = ((uint)(1)); - // w11.RightAttach = ((uint)(2)); - // w11.YOptions = ((global::Gtk.AttachOptions)(4)); + this.mainClassEntry = new global::Gtk.ComboBoxText (); + this.mainClassEntry.Name = "mainClassEntry"; + this.table7.Add (this.mainClassEntry); + global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table7 [this.mainClassEntry])); + w11.TopAttach = ((uint)(1)); + w11.BottomAttach = ((uint)(2)); + w11.LeftAttach = ((uint)(1)); + w11.RightAttach = ((uint)(2)); + w11.YOptions = ((global::Gtk.AttachOptions)(4)); this.vbox2.Add (this.table7); global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.table7])); w12.Position = 0; @@ -274,9 +274,9 @@ protected virtual void Build () w19.YOptions = ((global::Gtk.AttachOptions)(4)); w19.XPadding = 6; // Container child table2.Gtk.Table+TableChild - //this.langVerCombo = global::Gtk.ComboBox.NewText (); - //this.langVerCombo.Name = "langVerCombo"; - //this.table2.Add (this.langVerCombo); + this.langVerCombo = new global::Gtk.ComboBoxText (); + this.langVerCombo.Name = "langVerCombo"; + this.table2.Add (this.langVerCombo); global::Gtk.Table.TableChild w20 = ((global::Gtk.Table.TableChild)(this.table2 [this.langVerCombo])); w20.LeftAttach = ((uint)(1)); w20.RightAttach = ((uint)(2)); @@ -312,7 +312,7 @@ protected virtual void Build () if ((this.Child != null)) { this.Child.ShowAll (); } - //this.label88.MnemonicWidget = this.mainClassEntry; + this.label88.MnemonicWidget = this.mainClassEntry; this.Show (); } } diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs index 4d482c10882..c79bc9c0182 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs @@ -69,29 +69,29 @@ public CompilerOptionsPanelWidget (DotNetProject project) if (project.IsLibraryBasedProjectType) { //fixme: should we totally hide these? compileTargetCombo.Sensitive = false; - //mainClassEntry.Sensitive = false; + mainClassEntry.Sensitive = false; } else { classListStore = new ListStore (typeof(string)); - //mainClassEntry.Model = classListStore; + mainClassEntry.Model = classListStore; //mainClassEntry.TextColumn = 0; - //((Entry)mainClassEntry.Child).Text = csproject.MainClass ?? string.Empty; + ((Entry)mainClassEntry.Child).Text = csproject.MainClass ?? string.Empty; UpdateTarget (); } // Load the codepage. If it matches any of the supported encodigs, use the encoding name string foundEncoding = null; - //foreach (TextEncoding e in TextEncoding.SupportedEncodings) { - // if (e.CodePage == -1) - // continue; - // if (e.CodePage == csproject.CodePage) - // foundEncoding = e.Id; - //codepageEntry.AppendText (e.Id); - //} - //if (foundEncoding != null) - // codepageEntry.Entry.Text = foundEncoding; - //else if (csproject.CodePage != 0) - // codepageEntry.Entry.Text = csproject.CodePage.ToString (); + foreach (TextEncoding e in TextEncoding.SupportedEncodings) { + if (e.CodePage == -1) + continue; + if (e.CodePage == csproject.CodePage) + foundEncoding = e.Id; + codepageEntry.AppendText (e.Id); + } + if (foundEncoding != null) + codepageEntry.Entry.Text = foundEncoding; + else if (csproject.CodePage != 0) + codepageEntry.Entry.Text = csproject.CodePage.ToString (); iconEntry.Path = csproject.Win32Icon; iconEntry.DefaultPath = project.BaseDirectory; @@ -155,17 +155,17 @@ void SetupAccessibility () compileTargetCombo.SetCommonAccessibilityAttributes ("CodeGeneration.CompileTarget", label86, GettextCatalog.GetString ("Select the compile target for the code generation")); - //mainClassEntry.SetCommonAccessibilityAttributes ("CodeGeneration.MainClass", label88, - // GettextCatalog.GetString ("Enter the main class for the code generation")); + mainClassEntry.SetCommonAccessibilityAttributes ("CodeGeneration.MainClass", label88, + GettextCatalog.GetString ("Enter the main class for the code generation")); iconEntry.SetEntryAccessibilityAttributes ("CodeGeneration.WinIcon", "", GettextCatalog.GetString ("Enter the file to use as the icon on Windows")); iconEntry.SetAccessibilityLabelRelationship (label3); - //codepageEntry.SetCommonAccessibilityAttributes ("CodeGeneration.CodePage", label1, - // GettextCatalog.GetString ("Select the compiler code page")); + codepageEntry.SetCommonAccessibilityAttributes ("CodeGeneration.CodePage", label1, + GettextCatalog.GetString ("Select the compiler code page")); - //noStdLibCheckButton.SetCommonAccessibilityAttributes ("CodeGeneration.NoStdLib", "", GettextCatalog.GetString ("Whether or not to include a reference to mscorlib.dll")); + noStdLibCheckButton.SetCommonAccessibilityAttributes ("CodeGeneration.NoStdLib", "", GettextCatalog.GetString ("Whether or not to include a reference to mscorlib.dll")); langVerCombo.SetCommonAccessibilityAttributes ("CodeGeneration.LanguageVersion", label2, GettextCatalog.GetString ("Select the version of C# to use")); @@ -176,23 +176,23 @@ void SetupAccessibility () public bool ValidateChanges () { - //if (codepageEntry.Entry.Text.Length > 0) { + if (codepageEntry.Entry.Text.Length > 0) { // Get the codepage. If the user specified an encoding name, find it. int trialCodePage = -1; - // foreach (TextEncoding e in TextEncoding.SupportedEncodings) { - // if (e.Id == codepageEntry.Entry.Text) { - // trialCodePage = e.CodePage; - // break; - // } - // } + foreach (TextEncoding e in TextEncoding.SupportedEncodings) { + if (e.Id == codepageEntry.Entry.Text) { + trialCodePage = e.CodePage; + break; + } + } - // if (trialCodePage == -1) { - // if (!int.TryParse (codepageEntry.Entry.Text, out trialCodePage)) { - // MessageService.ShowError (GettextCatalog.GetString ("Invalid code page number.")); - // return false; - // } - // } - //} + if (trialCodePage == -1) { + if (!int.TryParse (codepageEntry.Entry.Text, out trialCodePage)) { + MessageService.ShowError (GettextCatalog.GetString ("Invalid code page number.")); + return false; + } + } + } return true; } @@ -208,25 +208,25 @@ public void Store (ItemConfigurationCollection configs) isBadVersion = (bool)langVerCombo.Model.GetValue (iter, 2); } - //if (codepageEntry.Entry.Text.Length > 0) { + if (codepageEntry.Entry.Text.Length > 0) { // Get the codepage. If the user specified an encoding name, find it. - //int trialCodePage = -1; - // foreach (TextEncoding e in TextEncoding.SupportedEncodings) { - // if (e.Id == codepageEntry.Entry.Text) { - // trialCodePage = e.CodePage; - // break; - // } - // } + int trialCodePage = -1; + foreach (TextEncoding e in TextEncoding.SupportedEncodings) { + if (e.Id == codepageEntry.Entry.Text) { + trialCodePage = e.CodePage; + break; + } + } - //if (trialCodePage != -1) - // codePage = trialCodePage; - // else { - // if (!int.TryParse (codepageEntry.Entry.Text, out trialCodePage)) { - // return; - // } - // codePage = trialCodePage; - // } - //} else + if (trialCodePage != -1) + codePage = trialCodePage; + else { + if (!int.TryParse (codepageEntry.Entry.Text, out trialCodePage)) { + return; + } + codePage = trialCodePage; + } + } else codePage = 0; project.CompileTarget = compileTargetCombo.CompileTarget; @@ -238,8 +238,8 @@ public void Store (ItemConfigurationCollection configs) if (iconEntry.Sensitive) csproject.Win32Icon = iconEntry.Path; - // if (mainClassEntry.Sensitive) - // csproject.MainClass = mainClassEntry.Entry.Text; + if (mainClassEntry.Sensitive) + csproject.MainClass = mainClassEntry.Entry.Text; foreach (DotNetProjectConfiguration configuration in configs) { CSharpCompilerParameters compilerParameters = (CSharpCompilerParameters) configuration.CompilationParameters; compilerParameters.UnsafeCode = allowUnsafeCodeCheckButton.Active; From e75283d75eca63042bdf160a3a99aca37e30b40e Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sun, 21 Jan 2024 22:34:18 +0100 Subject: [PATCH 245/382] update --- .../Mono.TextEditor/Gui/TextArea.cs | 16 ++++++++-------- .../MonoDevelop.SourceEditor.csproj | 9 +++++++++ .../MonoDevelop.Components/PangoUtil.cs | 4 ++-- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs index 60b3ea56292..3cbf3809841 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs @@ -141,10 +141,10 @@ public Gtk.MenuItem CreateInputMethodMenuItem (string label) return imContextMenuItem; } - [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] + //[DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] static extern void gtk_im_multicontext_set_context_id (IntPtr context, string context_id); - [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] + //[DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] static extern string gtk_im_multicontext_get_context_id (IntPtr context); [GLib.Property ("im-module")] @@ -1091,7 +1091,7 @@ protected override void OnDestroyed () void HeightTree_LineUpdateFrom (object sender, TextEditor.HeightTree.HeightChangedEventArgs e) { - //Console.WriteLine ("redraw from :" + e.Line); + Console.WriteLine ("redraw from :" + e.Line); RedrawFromLine (e.Line); } @@ -1162,7 +1162,7 @@ internal void RedrawPosition (int logicalLine, int logicalColumn) { if (isDisposed) return; -// Console.WriteLine ("Redraw position: logicalLine={0}, logicalColumn={1}", logicalLine, logicalColumn); + Console.WriteLine ("Redraw position: logicalLine={0}, logicalColumn={1}", logicalLine, logicalColumn); RedrawLine (logicalLine, false); } @@ -1181,7 +1181,7 @@ public void RedrawMarginLines (Margin margin, int start, int end) internal void RedrawLines (int start, int end, bool removeLineCache = true) { -// Console.WriteLine ("redraw lines: start={0}, end={1}", start, end); + Console.WriteLine ("redraw lines: start={0}, end={1}", start, end); if (isDisposed) return; if (start < 0) @@ -1200,7 +1200,7 @@ internal void RedrawLines (int start, int end, bool removeLineCache = true) public void RedrawFromLine (int logicalLine) { -// Console.WriteLine ("Redraw from line: logicalLine={0}", logicalLine); + Console.WriteLine ("Redraw from line: logicalLine={0}", logicalLine); if (isDisposed) return; int y = System.Math.Max (0, (int)(-this.textEditorData.VAdjustment.Value + LineToY (logicalLine))); @@ -1372,7 +1372,7 @@ bool HandleMarginKeyCommand (EventKey evnt) // } else if (key == Gdk.Key.ISO_Left_Tab || key == Gdk.Key.Left) { // return FocusNextMargin (DirectionType.TabBackward); // } else { - return false; +// return false; // } return true; @@ -2335,7 +2335,7 @@ protected override bool OnDrawn (Context cr) return false; // // try { -// // ExposeEventInternal (e); + // ExposeEventInternal (cr); // // } catch (Exception ex) { // // GLib.ExceptionManager.RaiseUnhandledException (ex, false); // // } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj index c131da087f0..8ee773cef3a 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj @@ -83,6 +83,15 @@ + + + + + + + + + diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs index b8080570ac3..0a041169aaa 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs @@ -32,10 +32,10 @@ namespace MonoDevelop.Components { public static class PangoUtil { - internal const string LIBGTK = "libgtk-3-0.dll"; + internal const string LIBGTK = "GtkSharp.dll"; internal const string LIBATK = "libatk-1.0-0.dll"; internal const string LIBGLIB = "libglib-2.0-0.dll"; - internal const string LIBGDK = "libgdk-3-0.dll"; + internal const string LIBGDK = "GdkSharp.dll"; internal const string LIBGOBJECT = "libgobject-2.0-0.dll"; internal const string LIBPANGO = "libpango-1.0-0.dll"; internal const string LIBPANGOCAIRO = "libpangocairo-1.0-0.dll"; From fe17732141cda88022145da063a9fa180e1b90f0 Mon Sep 17 00:00:00 2001 From: lytico Date: Mon, 22 Jan 2024 19:19:04 +0100 Subject: [PATCH 246/382] MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs: fix LIBGTK, LIBGDK --- .../MonoDevelop.Components/PangoUtil.cs | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs index 0a041169aaa..f31249f63f2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs @@ -1,21 +1,21 @@ -// +// // PangoUtils.cs -// +// // Author: // Michael Hutchinson -// +// // Copyright (c) 2010 Novell, Inc. (http://www.novell.com) -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -32,16 +32,16 @@ namespace MonoDevelop.Components { public static class PangoUtil { - internal const string LIBGTK = "GtkSharp.dll"; + internal const string LIBGTK = "libgtk-3-0.dll"; internal const string LIBATK = "libatk-1.0-0.dll"; internal const string LIBGLIB = "libglib-2.0-0.dll"; - internal const string LIBGDK = "GdkSharp.dll"; + internal const string LIBGDK = "libgdk-3-0.dll"; internal const string LIBGOBJECT = "libgobject-2.0-0.dll"; internal const string LIBPANGO = "libpango-1.0-0.dll"; internal const string LIBPANGOCAIRO = "libpangocairo-1.0-0.dll"; internal const string LIBQUARTZ = "libgtk-quartz-2.0.dylib"; internal const string LIBGTKGLUE = "libgtksharpglue-3.so"; - + /// /// This doesn't leak Pango layouts, unlike some other ways to create them in GTK# <= 2.12.11 /// @@ -54,65 +54,65 @@ public static Pango.Layout CreateLayout (Widget widget) public static Pango.Layout CreateLayout (Widget widget, string text) { IntPtr textPtr = text == null? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (text); - + var ptr = gtk_widget_create_pango_layout (widget.Handle, textPtr); - + if (textPtr != IntPtr.Zero) GLib.Marshaller.Free (textPtr); - + return GLib.Object.GetObject (ptr, true) as Pango.Layout; } - + public static Pango.Layout CreateLayout (PrintContext context) { var ptr = gtk_print_context_create_pango_layout (context.Handle); return ptr == IntPtr.Zero? null : new Pango.Layout (ptr); } - + [DllImport (LIBGTK, CallingConvention=CallingConvention.Cdecl)] static extern IntPtr gtk_widget_create_pango_layout (IntPtr widget, IntPtr text); - + [DllImport (LIBGTK, CallingConvention=CallingConvention.Cdecl)] static extern IntPtr gtk_print_context_create_pango_layout (IntPtr context); } - + /// /// This creates a Pango list and applies attributes to it with *much* less overhead than the GTK# version. /// class FastPangoAttrList : IDisposable { IntPtr list; - + public FastPangoAttrList () { list = pango_attr_list_new (); } - + public void AddStyleAttribute (Pango.Style style, uint start, uint end) { Add (pango_attr_style_new (style), start, end); } - + public void AddWeightAttribute (Pango.Weight weight, uint start, uint end) { Add (pango_attr_weight_new (weight), start, end); } - + public void AddForegroundAttribute (Gdk.Color color, uint start, uint end) { Add (pango_attr_foreground_new (color.Red, color.Green, color.Blue), start, end); } - + public void AddBackgroundAttribute (Gdk.Color color, uint start, uint end) { Add (pango_attr_background_new (color.Red, color.Green, color.Blue), start, end); } - + public void AddUnderlineAttribute (Pango.Underline underline, uint start, uint end) { Add (pango_attr_underline_new (underline), start, end); } - + void Add (IntPtr attribute, uint start, uint end) { unsafe { @@ -158,37 +158,37 @@ void AddOffsetCopy (IntPtr attr, uint startOffset, uint endOffset) } pango_attr_list_insert (list, copy); } - + [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)] static extern IntPtr pango_attr_style_new (Pango.Style style); - + [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)] static extern IntPtr pango_attr_stretch_new (Pango.Stretch stretch); - + [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)] static extern IntPtr pango_attr_weight_new (Pango.Weight weight); - + [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)] static extern IntPtr pango_attr_foreground_new (ushort red, ushort green, ushort blue); - + [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)] static extern IntPtr pango_attr_background_new (ushort red, ushort green, ushort blue); - + [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)] static extern IntPtr pango_attr_underline_new (Pango.Underline underline); - + [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)] static extern IntPtr pango_attr_list_new (); [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)] static extern void pango_attr_list_unref (IntPtr list); - + [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)] static extern void pango_attr_list_insert (IntPtr list, IntPtr attr); - + [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)] static extern void pango_layout_set_attributes (IntPtr layout, IntPtr attrList); - + [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)] static extern void pango_attr_list_splice (IntPtr attr_list, IntPtr other, Int32 pos, Int32 len); @@ -197,7 +197,7 @@ void AddOffsetCopy (IntPtr attr, uint startOffset, uint endOffset) [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)] static extern IntPtr pango_attr_list_get_iterator (IntPtr list); - + [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)] static extern bool pango_attr_iterator_next (IntPtr iterator); @@ -220,7 +220,7 @@ public void Splice (Pango.AttrList attrs, int pos, int len) { pango_attr_list_splice (list, attrs.Handle, pos, len); } - + public void AssignTo (Pango.Layout layout) { pango_layout_set_attributes (layout.Handle, list); @@ -233,7 +233,7 @@ struct PangoAttribute public uint start_index; public uint end_index; } - + public void Dispose () { if (list != IntPtr.Zero) { @@ -241,14 +241,14 @@ public void Dispose () Destroy (); } } - + //NOTE: the list destroys all its attributes when the ref count reaches zero void Destroy () { pango_attr_list_unref (list); list = IntPtr.Zero; } - + ~FastPangoAttrList () { GLib.Idle.Add (delegate { From 902d3a9b9518c0bb511a562b034d3f9c189c6fce Mon Sep 17 00:00:00 2001 From: lytico Date: Mon, 22 Jan 2024 20:45:07 +0100 Subject: [PATCH 247/382] MonoDevelop.TextEditor.csproj: try reimplement TextArea --- .../Mono.TextEditor/Gui/TextArea.cs | 736 +++++++++--------- .../Mono.TextEditor/Gui/TextViewMargin.cs | 6 +- 2 files changed, 373 insertions(+), 369 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs index 3cbf3809841..3317f078f75 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs @@ -13,10 +13,10 @@ // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: -// +// // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -51,6 +51,7 @@ using MonoDevelop.Ide.Editor; using MonoDevelop.Ide.Editor.Highlighting; using Cairo; +using CairoHelper = Gtk.CairoHelper; namespace Mono.TextEditor { @@ -60,7 +61,7 @@ partial class TextArea : Container, ITextEditorDataProvider TextEditorData textEditorData; TextEditorKeyPressTimings keyPressTimings; - + protected IconMargin iconMargin; protected QuickFixMargin quickFixMargin; protected ActionMargin actionMargin; @@ -73,10 +74,10 @@ partial class TextArea : Container, ITextEditorDataProvider DocumentLine longestLine = null; double longestLineWidth = -1; - + List margins = new List (); int oldRequest = -1; - + bool isDisposed = false; IMMulticontext imContext; Gdk.EventKey lastIMEvent; @@ -86,9 +87,9 @@ partial class TextArea : Container, ITextEditorDataProvider bool sizeHasBeenAllocated; bool imContextNeedsReset; string currentStyleName; - + double mx, my; - + public TextDocument Document { get { return textEditorData.Document; @@ -100,7 +101,7 @@ public bool IsDisposed { return textEditorData.IsDisposed; } } - + /// /// Gets or sets a value indicating whether this converts tabs to spaces. /// It is possible to overwrite the default options value for certain languages (like F#). @@ -116,13 +117,13 @@ public bool TabsToSpaces { textEditorData.TabsToSpaces = value; } } - + public Mono.TextEditor.CaretImpl Caret { get { return textEditorData.Caret; } } - + protected internal IMMulticontext IMContext { get { return imContext; } } @@ -141,12 +142,12 @@ public Gtk.MenuItem CreateInputMethodMenuItem (string label) return imContextMenuItem; } - //[DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] + [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] static extern void gtk_im_multicontext_set_context_id (IntPtr context, string context_id); - //[DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] + [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)] static extern string gtk_im_multicontext_get_context_id (IntPtr context); - + [GLib.Property ("im-module")] public string IMModule { get { @@ -160,7 +161,7 @@ public string IMModule { gtk_im_multicontext_set_context_id (imContext.Handle, value); } } - + internal ITextEditorOptions Options { get { return textEditorData.Options; @@ -175,14 +176,14 @@ internal ITextEditorOptions Options { } } } - - + + public string FileName { get { return Document.FileName; } } - + public string MimeType { get { return Document.MimeType; @@ -202,7 +203,7 @@ void HandleTextEditorDataDocumentMarkerChange (object sender, TextMarkerEvent e) } } } - + void HAdjustmentValueChanged (object sender, EventArgs args) { var alloc = this.Allocation; @@ -210,7 +211,7 @@ void HAdjustmentValueChanged (object sender, EventArgs args) HAdjustmentValueChanged (); } - + protected virtual void HAdjustmentValueChanged () { HideTooltip (); @@ -222,17 +223,17 @@ protected virtual void HAdjustmentValueChanged () textViewMargin.HideCodeSegmentPreviewWindow (); QueueDrawArea ((int)this.textViewMargin.XOffset, 0, this.Allocation.Width - (int)this.textViewMargin.XOffset, this.Allocation.Height); OnHScroll (EventArgs.Empty); -// SetChildrenPositions (Allocation); + SetChildrenPositions (Allocation); } - + void VAdjustmentValueChanged (object sender, EventArgs args) { var alloc = this.Allocation; alloc.X = alloc.Y = 0; VAdjustmentValueChanged (); -// SetChildrenPositions (alloc); + SetChildrenPositions (alloc); } - + protected virtual void VAdjustmentValueChanged () { HideTooltip (); @@ -244,7 +245,7 @@ protected virtual void VAdjustmentValueChanged () } if (IsMouseTrapped) FireMotionEvent (mx + textViewMargin.XOffset, my, lastState); - + double delta = value - this.oldVadjustment; oldVadjustment = value; TextViewMargin.caretY -= delta; @@ -260,13 +261,13 @@ protected virtual void VAdjustmentValueChanged () OnVScroll (EventArgs.Empty); return; } - + if (GdkWindow != null) GdkWindow.Scroll (0, (int)-delta); OnVScroll (EventArgs.Empty); } - + protected virtual void OnVScroll (EventArgs e) { EventHandler handler = this.VScroll; @@ -280,7 +281,7 @@ protected virtual void OnHScroll (EventArgs e) if (handler != null) handler (this, e); } - + public event EventHandler VScroll; public event EventHandler HScroll; @@ -297,12 +298,12 @@ internal void SetTextEditorScrollAdjustments (Adjustment hAdjustement, Adjustmen if (textEditorData == null) return; UnregisterAdjustments (); - + if (hAdjustement == null || vAdjustement == null) return; this.textEditorData.HAdjustment = hAdjustement; this.textEditorData.VAdjustment = vAdjustement; - + this.textEditorData.HAdjustment.ValueChanged += HAdjustmentValueChanged; this.textEditorData.VAdjustment.ValueChanged += VAdjustmentValueChanged; } @@ -345,13 +346,13 @@ internal void Initialize (MonoTextEditor editor, TextDocument doc, ITextEditorOp throw new ArgumentNullException (nameof(doc)); this.editor = editor; textEditorData = new TextEditorData (doc); - textEditorData.RecenterEditor += TextEditorData_RecenterEditor; + textEditorData.RecenterEditor += TextEditorData_RecenterEditor; textEditorData.Document.TextChanged += OnDocumentStateChanged; textEditorData.Document.MarkerAdded += HandleTextEditorDataDocumentMarkerChange; textEditorData.Document.MarkerRemoved += HandleTextEditorDataDocumentMarkerChange; - + textEditorData.CurrentMode = initialMode; - + this.textEditorData.Options = options ?? TextEditorOptions.DefaultOptions; @@ -419,20 +420,20 @@ internal void Initialize (MonoTextEditor editor, TextDocument doc, ITextEditorOp this.textEditorData.SelectionChanged += TextEditorDataSelectionChanged; this.textEditorData.UpdateAdjustmentsRequested += TextEditorDatahandleUpdateAdjustmentsRequested; Document.DocumentUpdated += DocumentUpdatedHandler; - + this.textEditorData.Options.Changed += OptionsChanged; - - + + Gtk.TargetList list = new Gtk.TargetList (); list.AddTextTargets (ClipboardActions.CopyOperation.TextType); Gtk.Drag.DestSet (this, DestDefaults.All, (TargetEntry[])list, DragAction.Move | DragAction.Copy); - + imContext = new IMMulticontext (); imContext.Commit += IMCommit; - + imContext.UsePreedit = true; imContext.PreeditChanged += PreeditStringChanged; - + imContext.RetrieveSurrounding += delegate (object o, RetrieveSurroundingArgs args) { //use a single line of context, whole document would be very expensive //FIXME: UTF16 surrogates handling for caret offset? only matters for astral plane @@ -444,18 +445,18 @@ internal void Initialize (MonoTextEditor editor, TextDocument doc, ITextEditorOp imContext.SetSurrounding (text, Caret.Column); args.RetVal = true; }; - + imContext.SurroundingDeleted += delegate (object o, SurroundingDeletedArgs args) { //FIXME: UTF16 surrogates handling for offset and NChars? only matters for astral plane var line = Document.GetLine (Caret.Line); Document.RemoveText (line.Offset + args.Offset, args.NChars); args.RetVal = true; }; - + // using (Pixmap inv = new Pixmap (null, 1, 1, 1)) { // invisibleCursor = new Cursor (inv, inv, Gdk.Color.Zero, Gdk.Color.Zero, 0, 0); // } - + InitAnimations (); this.Document.HeightChanged += HandleDocumentHeightChanged; this.textEditorData.HeightTree.LineUpdateFrom += HeightTree_LineUpdateFrom; @@ -490,28 +491,28 @@ void TextEditorDatahandleUpdateAdjustmentsRequested (object sender, EventArgs e) { SetAdjustments (); } - - + + internal void ShowListWindow (ListWindow window, DocumentLocation loc) { var p = LocationToPoint (loc); int ox = 0, oy = 0; GdkWindow.GetOrigin (out ox, out oy); - + window.Move (ox + p.X - window.TextOffset , oy + p.Y + (int)LineHeight); window.ShowAll (); } - + internal int preeditOffset = -1, preeditLine, preeditCursorCharIndex; internal string preeditString; internal Pango.AttrList preeditAttrs; internal bool preeditHeightChange; - + internal bool ContainsPreedit (int offset, int length) { if (string.IsNullOrEmpty (preeditString)) return false; - + return offset <= preeditOffset && preeditOffset <= offset + length; } @@ -569,12 +570,12 @@ internal bool UpdatePreeditLineHeight () return false; } - void CaretPositionChanged (object sender, DocumentLocationEventArgs args) + void CaretPositionChanged (object sender, DocumentLocationEventArgs args) { HideTooltip (); textViewMargin.HideCodeSegmentPreviewWindow (); ResetIMContext (); - + if (Caret.AutoScrollToCaret && HasFocus) ScrollToCaret (); @@ -583,16 +584,16 @@ void CaretPositionChanged (object sender, DocumentLocationEventArgs args) // Rectangle rectangle = textViewMargin.GetCaretRectangle (Caret.Mode); RequestResetCaretBlink (); - + textEditorData.CurrentMode.InternalCaretPositionChanged (textEditorData.Parent, textEditorData); - + if (!IsSomethingSelected) { - if (/*Options.HighlightCaretLine && */args.Location.Line != Caret.Line) + if (/*Options.HighlightCaretLine && */args.Location.Line != Caret.Line) RedrawMarginLine (TextViewMargin, args.Location.Line); RedrawMarginLine (TextViewMargin, Caret.Line); } } - + MonoDevelop.Ide.Editor.Selection oldSelection = MonoDevelop.Ide.Editor.Selection.Empty; void TextEditorDataSelectionChanged (object sender, EventArgs args) { @@ -613,7 +614,7 @@ void TextEditorDataSelectionChanged (object sender, EventArgs args) int oldStartLine = !oldSelection.IsEmpty ? oldSelection.Anchor.Line : -1; int oldEndLine = !oldSelection.IsEmpty ? oldSelection.Lead.Line : -1; if (SelectionMode == MonoDevelop.Ide.Editor.SelectionMode.Block) { - this.RedrawMarginLines (this.textViewMargin, + this.RedrawMarginLines (this.textViewMargin, System.Math.Min (System.Math.Min (oldStartLine, oldEndLine), System.Math.Min (startLine, endLine)), System.Math.Max (System.Math.Max (oldStartLine, oldEndLine), System.Math.Max (startLine, endLine))); } else { @@ -650,11 +651,11 @@ void TextEditorDataSelectionChanged (object sender, EventArgs args) } else if (oldSelection.IsEmpty) { from = startLine; to = endLine; - } + } } - + if (from >= 0 && to >= 0) { - this.RedrawMarginLines (this.textViewMargin, + this.RedrawMarginLines (this.textViewMargin, System.Math.Max (0, System.Math.Min (from, to) - 1), System.Math.Max (from, to)); } @@ -673,7 +674,7 @@ internal void CommitPreedit () preeditCursorCharIndex = 0; imContextNeedsReset = true; } - + internal void ResetIMContext () { if (imContextNeedsReset) { @@ -715,7 +716,7 @@ void IMCommit (object sender, Gtk.CommitArgs ca) { CommitString (ca.Str); } - + enum FocusMargin { None, Icon, @@ -922,7 +923,7 @@ protected override void OnRealized () EventMask = (int)(this.Events | Gdk.EventMask.ExposureMask), Mask = this.Events | Gdk.EventMask.ExposureMask, }; - + // WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y | WindowAttributesType.Colormap | WindowAttributesType.Visual; // GdkWindow = new Gdk.Window (ParentWindow, attributes, mask); // GdkWindow.UserData = Raw; @@ -933,7 +934,7 @@ protected override void OnRealized () Caret.PositionChanged += CaretPositionChanged; SetWidgetBgFromStyle (); - } + } protected override void OnUnrealized () { @@ -941,14 +942,14 @@ protected override void OnUnrealized () CancelScheduledHide (); base.OnUnrealized (); } - + void DocumentUpdatedHandler (object sender, EventArgs args) { foreach (DocumentUpdateRequest request in Document.UpdateRequests) { request.Update (textEditorData.Parent); } } - + public event EventHandler EditorOptionsChanged; protected virtual void OptionsChanged (object sender, EventArgs args) @@ -960,17 +961,17 @@ protected virtual void OptionsChanged (object sender, EventArgs args) this.textEditorData.ColorStyle = Options.GetEditorTheme (); SetWidgetBgFromStyle (); } - + iconMargin.IsVisible = Options.ShowIconMargin; gutterMargin.IsVisible = Options.ShowLineNumberMargin; foldMarkerMargin.IsVisible = Options.ShowFoldMargin || Options.EnableQuickDiff; // dashedLineMargin.IsVisible = foldMarkerMargin.IsVisible || gutterMargin.IsVisible; if (!Options.ShowFoldMargin) { - Document.UpdateFoldSegments (new List ()); + Document.UpdateFoldSegments (new List ()); } if (EditorOptionsChanged != null) EditorOptionsChanged (this, args); - + textViewMargin.OptionsChanged (); foreach (Margin margin in this.margins) { if (margin == textViewMargin) @@ -996,7 +997,7 @@ void SetWidgetBgFromStyle () } if (parent != null) { - + parent.ModifyBg (StateType.Normal, SyntaxHighlightingService.GetColor (textEditorData.ColorStyle, EditorThemeColors.Background)); } @@ -1008,7 +1009,7 @@ void SetWidgetBgFromStyle () settingWidgetBg = false; } } - + bool settingWidgetBg = false; protected override void OnStyleSet (Gtk.Style previous_style) { @@ -1047,13 +1048,13 @@ protected override void OnDestroyed () RemoveScrollWindowTimer (); if (invisibleCursor != null) invisibleCursor.Dispose (); - + Caret.PositionChanged -= CaretPositionChanged; - + Document.DocumentUpdated -= DocumentUpdatedHandler; if (textEditorData.Options != null) textEditorData.Options.Changed -= OptionsChanged; - + if (imContext != null){ ResetIMContext (); imContext = imContext.Kill (x => x.Commit -= IMCommit); @@ -1102,18 +1103,18 @@ public void RedrawMargin (Margin margin) return; QueueDrawArea ((int)margin.XOffset, 0, GetMarginWidth (margin), this.Allocation.Height); } - + public void RedrawMarginLine (Margin margin, int logicalLine) { if (isDisposed || !margin.IsVisible) return; - + double y = LineToY (logicalLine) - this.textEditorData.VAdjustment.Value; double h = GetLineHeight (logicalLine); if (y + h > 0) { var mw = (int)GetMarginWidth (margin); - if (mw > 0 && h > 0) + if (mw > 0 && h > 0) QueueDrawArea ((int)margin.XOffset, (int)y, mw, (int)h); } } @@ -1124,7 +1125,7 @@ int GetMarginWidth (Margin margin) return Allocation.Width - (int)margin.XOffset; return (int)margin.Width; } - + internal void RedrawLine (int logicalLine, bool removeLineCache = true) { if (isDisposed || logicalLine > LineCount || logicalLine < DocumentLocation.MinLine) @@ -1139,17 +1140,17 @@ internal void RedrawLine (int logicalLine, bool removeLineCache = true) if (y + h > 0) QueueDrawArea (0, (int)y, this.Allocation.Width, (int)h); } - + public new void QueueDrawArea (int x, int y, int w, int h) { -// if (GdkWindow != null) { -// GdkWindow.InvalidateRect (new Rectangle (x, y, w, h), false); + if (Window != null) { + Window.InvalidateRect (new Gdk.Rectangle (x, y, w, h), false); #if DEBUG_EXPOSE Console.WriteLine ("invalidated {0},{1} {2}x{3}", x, y, w, h); #endif -// } + } } - + public new void QueueDraw () { base.QueueDraw (); @@ -1157,7 +1158,7 @@ internal void RedrawLine (int logicalLine, bool removeLineCache = true) Console.WriteLine ("invalidated entire widget"); #endif } - + internal void RedrawPosition (int logicalLine, int logicalColumn) { if (isDisposed) @@ -1165,7 +1166,7 @@ internal void RedrawPosition (int logicalLine, int logicalColumn) Console.WriteLine ("Redraw position: logicalLine={0}, logicalColumn={1}", logicalLine, logicalColumn); RedrawLine (logicalLine, false); } - + public void RedrawMarginLines (Margin margin, int start, int end) { if (isDisposed) @@ -1178,7 +1179,7 @@ public void RedrawMarginLines (Margin margin, int start, int end) double visualEnd = -this.textEditorData.VAdjustment.Value + LineToY (end) + GetLineHeight (end); QueueDrawArea ((int)margin.XOffset, (int)visualStart, GetMarginWidth (margin), (int)(visualEnd - visualStart)); } - + internal void RedrawLines (int start, int end, bool removeLineCache = true) { Console.WriteLine ("redraw lines: start={0}, end={1}", start, end); @@ -1197,7 +1198,7 @@ internal void RedrawLines (int start, int end, bool removeLineCache = true) double visualEnd = -this.textEditorData.VAdjustment.Value + LineToY (end) + GetLineHeight (end); QueueDrawArea (0, (int)visualStart, this.Allocation.Width, (int)(visualEnd - visualStart)); } - + public void RedrawFromLine (int logicalLine) { Console.WriteLine ("Redraw from line: logicalLine={0}", logicalLine); @@ -1230,19 +1231,19 @@ public void SimulateKeyPress (Gdk.Key key, uint unicodeChar, ModifierType modifi RequestResetCaretBlink (); } - + bool IMFilterKeyPress (Gdk.EventKey evt, Gdk.Key mappedKey, uint mappedChar, Gdk.ModifierType mappedModifiers) { if (lastIMEvent == evt) return false; - + if (evt.Type == EventType.KeyPress) { lastIMEvent = evt; lastIMEventMappedChar = mappedChar; lastIMEventMappedKey = mappedKey; lastIMEventMappedModifier = mappedModifiers; } - + if (imContext.FilterKeypress (evt)) { imContextNeedsReset = true; return true; @@ -1250,9 +1251,9 @@ bool IMFilterKeyPress (Gdk.EventKey evt, Gdk.Key mappedKey, uint mappedChar, Gdk return false; } } - + Gdk.Cursor invisibleCursor; - + internal void HideMouseCursor () { SetCursor (invisibleCursor); @@ -1361,19 +1362,19 @@ bool HandleMarginKeyCommand (EventKey evnt) GtkWorkarounds.MapKeys (evnt, out key, out mod, out accels); -// if (key == Gdk.Key.space) { -// cm.HandleItemCommand (Margin.ItemCommand.ActivateCurrentItem); -// } else if (key == Gdk.Key.Up) { -// cm.HandleItemCommand (Margin.ItemCommand.FocusPreviousItem); -// } else if (key == Gdk.Key.Down) { -// cm.HandleItemCommand (Margin.ItemCommand.FocusNextItem); -// } else if (key == Gdk.Key.Tab || key == Gdk.Key.Right) { -// return FocusNextMargin (Gtk.DirectionType.TabForward); -// } else if (key == Gdk.Key.ISO_Left_Tab || key == Gdk.Key.Left) { -// return FocusNextMargin (DirectionType.TabBackward); -// } else { -// return false; -// } + if (key == Gdk.Key.space) { + cm.HandleItemCommand (Mono.TextEditor.Margin.ItemCommand.ActivateCurrentItem); + } else if (key == Gdk.Key.Up) { + cm.HandleItemCommand (Mono.TextEditor.Margin.ItemCommand.FocusPreviousItem); + } else if (key == Gdk.Key.Down) { + cm.HandleItemCommand (Mono.TextEditor.Margin.ItemCommand.FocusNextItem); + } else if (key == Gdk.Key.Tab || key == Gdk.Key.Right) { + return FocusNextMargin (Gtk.DirectionType.TabForward); + } else if (key == Gdk.Key.ISO_Left_Tab || key == Gdk.Key.Left) { + return FocusNextMargin (DirectionType.TabBackward); + } else { + return false; + } return true; } @@ -1388,7 +1389,7 @@ protected override bool OnKeyReleaseEvent (EventKey evnt) return true; } - + uint mouseButtonPressed = 0; uint lastTime; double pressPositionX, pressPositionY; @@ -1404,7 +1405,7 @@ protected override bool OnButtonPressEvent (Gdk.EventButton e) // If there is anything in the preedit buffer, commit it otherwise text // selection may have the wrong offsets. CommitPreedit (); - + if (lastTime != e.Time) {// filter double clicks if (e.Type == EventType.TwoButtonPress) { @@ -1435,7 +1436,7 @@ protected override bool OnButtonPressEvent (Gdk.EventButton e) } return result; } - + bool DoClickedPopupMenu (Gdk.EventButton e) { double tmOffset = e.X - textViewMargin.XOffset; @@ -1452,7 +1453,7 @@ bool DoClickedPopupMenu (Gdk.EventButton e) } return false; } - + public Action DoPopupMenu { get; set; } protected override bool OnPopupMenu () @@ -1463,7 +1464,7 @@ protected override bool OnPopupMenu () } return base.OnPopupMenu (); } - + public Margin LockedMargin { get; set; @@ -1491,16 +1492,16 @@ Margin GetMarginAtX (double x, out double startingPos) startingPos = -1; return null; } - + protected override bool OnButtonReleaseEvent (EventButton e) { RemoveScrollWindowTimer (); - + //main context menu if (DoPopupMenu != null && e.IsContextMenuButton ()) { return true; } - + double startPos; Margin margin = GetMarginAtX (e.X, out startPos); if (margin != null) @@ -1518,23 +1519,23 @@ public void ResetMouseState () textViewMargin.inDrag = false; textViewMargin.InSelectionDrag = false; } - + bool dragOver = false; ClipboardActions.CopyOperation dragContents = null; DocumentLocation defaultCaretPos, dragCaretPos; MonoDevelop.Ide.Editor.Selection selection = MonoDevelop.Ide.Editor.Selection.Empty; - + public bool IsInDrag { get { return dragOver; } } - + public void CaretToDragCaretPosition () { Caret.Location = defaultCaretPos = dragCaretPos; } - + protected override void OnDragLeave (DragContext context, uint time_) { if (dragOver) { @@ -1546,7 +1547,7 @@ protected override void OnDragLeave (DragContext context, uint time_) } base.OnDragLeave (context, time_); } - + protected override void OnDragDataGet (DragContext context, SelectionData selection_data, uint info, uint time_) { if (this.dragContents != null) { @@ -1592,7 +1593,7 @@ protected override void OnDragDataReceived (DragContext context, int x, int y, S undo.Dispose (); base.OnDragDataReceived (context, x, y, selection_data, info, time_); } - + protected override bool OnDragMotion (DragContext context, int x, int y, uint time) { if (!this.HasFocus) @@ -1600,7 +1601,7 @@ protected override bool OnDragMotion (DragContext context, int x, int y, uint ti if (!dragOver) { defaultCaretPos = Caret.Location; } - + DocumentLocation oldLocation = Caret.Location; dragOver = true; Caret.PreserveSelection = true; @@ -1611,7 +1612,7 @@ protected override bool OnDragMotion (DragContext context, int x, int y, uint ti Caret.Location = defaultCaretPos; } else { Gdk.Drag.Status (context, (context.Actions & DragAction.Move) == DragAction.Move ? DragAction.Move : DragAction.Copy, time); - Caret.Location = dragCaretPos; + Caret.Location = dragCaretPos; } this.RedrawLine (oldLocation.Line, false); if (oldLocation.Line != Caret.Line) @@ -1619,7 +1620,7 @@ protected override bool OnDragMotion (DragContext context, int x, int y, uint ti Caret.PreserveSelection = false; return base.OnDragMotion (context, x, y, time); } - + Margin oldMargin = null; bool overChildWidget; @@ -1707,12 +1708,12 @@ protected override bool OnMotionNotifyEvent (Gdk.EventMotion e) } return base.OnMotionNotifyEvent (e); } - + uint scrollWindowTimer = 0; double scrollWindowTimer_x; double scrollWindowTimer_y; Gdk.ModifierType scrollWindowTimer_mod; - + void UpdateScrollWindowTimer (double x, double y, Gdk.ModifierType mod) { scrollWindowTimer_x = x; @@ -1727,7 +1728,7 @@ void UpdateScrollWindowTimer (double x, double y, Gdk.ModifierType mod) }); } } - + void RemoveScrollWindowTimer () { if (scrollWindowTimer != 0) { @@ -1735,7 +1736,7 @@ void RemoveScrollWindowTimer () scrollWindowTimer = 0; } } - + Gdk.ModifierType lastState = ModifierType.None; void FireMotionEvent (double x, double y, Gdk.ModifierType state) @@ -1788,11 +1789,11 @@ public void BeginDrag (string text, Gtk.Widget source, DragContext context) source.DragDataGet += CustomDragDataGet; source.DragEnd += CustomDragEnd; } - void CustomDragDataGet (object sender, Gtk.DragDataGetArgs args) + void CustomDragDataGet (object sender, Gtk.DragDataGetArgs args) { args.SelectionData.Text = customText; } - void CustomDragEnd (object sender, Gtk.DragEndArgs args) + void CustomDragEnd (object sender, Gtk.DragEndArgs args) { customSource.DragDataGet -= CustomDragDataGet; customSource.DragEnd -= CustomDragEnd; @@ -1801,13 +1802,13 @@ void CustomDragEnd (object sender, Gtk.DragEndArgs args) } #endregion internal bool IsMouseTrapped { get; set; } = false; - + protected override bool OnEnterNotifyEvent (EventCrossing evnt) { IsMouseTrapped = true; return base.OnEnterNotifyEvent (evnt); } - + protected override bool OnLeaveNotifyEvent (Gdk.EventCrossing e) { IsMouseTrapped = false; @@ -1821,13 +1822,13 @@ protected override bool OnLeaveNotifyEvent (Gdk.EventCrossing e) HideTooltip (); } textViewMargin.HideCodeSegmentPreviewWindow (); - + if (GdkWindow != null) SetCursor (null); if (oldMargin != null) oldMargin.MouseLeft (); MouseLeft?.Invoke (this, EventArgs.Empty); - return base.OnLeaveNotifyEvent (e); + return base.OnLeaveNotifyEvent (e); } internal event EventHandler MouseLeft; @@ -1840,7 +1841,7 @@ internal set { this.textEditorData.LineHeight = value; } } - + public TextViewMargin TextViewMargin { get { return textViewMargin; @@ -1864,7 +1865,7 @@ public QuickFixMargin QuickFixMargin { public ActionMargin ActionMargin { get { return actionMargin; } } - + public DocumentLocation LogicalToVisualLocation (DocumentLocation location) { return textEditorData.LogicalToVisualLocation (location); @@ -1874,17 +1875,17 @@ public DocumentLocation LogicalToVisualLocation (int line, int column) { return textEditorData.LogicalToVisualLocation (line, column); } - + public void CenterToCaret () { CenterTo (Caret.Location); } - + public void CenterTo (int offset) { CenterTo (Document.OffsetToLocation (offset)); } - + public void CenterTo (int line, int column) { CenterTo (new DocumentLocation (line, column)); @@ -1959,7 +1960,7 @@ public void ScrollTo (int offset) { ScrollTo (Document.OffsetToLocation (offset)); } - + public void ScrollTo (int line, int column) { ScrollTo (new DocumentLocation (line, column)); @@ -1970,7 +1971,7 @@ public void ScrollTo (int line, int column) // readonly TextEditor editor; // readonly double targetValue; // readonly double initValue; -// +// // public ScrollingActor (Mono.TextEditor.TextEditor editor, double targetValue) // { // this.editor = editor; @@ -2018,7 +2019,7 @@ public void ScrollTo (DocumentLocation p) this.textEditorData.VAdjustment.Value = caretPosition - this.textEditorData.VAdjustment.PageSize + this.LineHeight; } } - + if (this.textEditorData.HAdjustment.Upper < Allocation.Width) { this.textEditorData.HAdjustment.Value = 0; } else { @@ -2037,7 +2038,7 @@ public void ScrollTo (DocumentLocation p) } /// - /// Scrolls the editor as required for making the specified area visible + /// Scrolls the editor as required for making the specified area visible /// public void ScrollTo (Gdk.Rectangle rect) { @@ -2068,7 +2069,7 @@ public void ScrollTo (Gdk.Rectangle rect) inCaretScroll = false; } } - + bool inCaretScroll = false; public void ScrollToCaret () { @@ -2079,10 +2080,10 @@ public void TryToResetHorizontalScrollPosition () { int caretX = (int)ColumnToX (Document.GetLine (Caret.Line), Caret.Column); int textWith = Allocation.Width - (int)textViewMargin.XOffset; - if (caretX < textWith - TextViewMargin.CharWidth) + if (caretX < textWith - TextViewMargin.CharWidth) this.textEditorData.HAdjustment.Value = 0; } - + protected override void OnSizeAllocated (Gdk.Rectangle allocation) { base.OnSizeAllocated (allocation); @@ -2090,7 +2091,7 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) sizeHasBeenAllocated = true; if (Options.WrapLines) textViewMargin.PurgeLayoutCache (); -// SetChildrenPositions (allocation); + SetChildrenPositions (allocation); UpdateMarginRects (allocation); } @@ -2135,7 +2136,7 @@ protected override bool OnScrollEvent (EventScroll evnt) var hasZoomModifier = (evnt.State & modifier) != 0; if (hasZoomModifier && lastScrollTime != 0 && (evnt.Time - lastScrollTime) < 100) hasZoomModifier = false; - + if (hasZoomModifier) { if (evnt.Direction == ScrollDirection.Up) Options.ZoomIn (); @@ -2154,18 +2155,18 @@ protected override bool OnScrollEvent (EventScroll evnt) HAdjustment.Value = System.Math.Min (HAdjustment.Upper - HAdjustment.PageSize, HAdjustment.Value + HAdjustment.StepIncrement * 3); else if (evnt.Direction == ScrollDirection.Up) HAdjustment.Value -= HAdjustment.StepIncrement * 3; - + return true; } } lastScrollTime = evnt.Time; - return base.OnScrollEvent (evnt); + return base.OnScrollEvent (evnt); } - + void SetHAdjustment () { textEditorData.HeightTree.Rebuild (); - + if (textEditorData.HAdjustment == null || Options == null) return; textEditorData.HAdjustment.ValueChanged -= HAdjustmentValueChanged; @@ -2197,19 +2198,19 @@ void SetHAdjustment () } textEditorData.HAdjustment.ValueChanged += HAdjustmentValueChanged; } - + internal void SetAdjustments () { if (textEditorData == null) return; SetAdjustments (Allocation); } - + internal void SetAdjustments (Gdk.Rectangle allocation) { SetHAdjustment (); - + if (this.textEditorData.VAdjustment != null) { double maxY = textEditorData.HeightTree.TotalHeight; // if (maxY > allocation.Height) @@ -2223,8 +2224,8 @@ internal void SetAdjustments (Gdk.Rectangle allocation) VAdjustment.Value = System.Math.Max (0, maxY - allocation.Height); QueueDraw (); } - this.textEditorData.VAdjustment.SetBounds (0, - System.Math.Max (allocation.Height, maxY), + this.textEditorData.VAdjustment.SetBounds (0, + System.Math.Max (allocation.Height, maxY), LineHeight, allocation.Height, allocation.Height); @@ -2232,12 +2233,12 @@ internal void SetAdjustments (Gdk.Rectangle allocation) this.textEditorData.VAdjustment.Value = 0; } } - + public int GetWidth (string text) { return this.textViewMargin.GetWidth (text); } - + void UpdateMarginXOffsets () { double curX = 0; @@ -2248,7 +2249,7 @@ void UpdateMarginXOffsets () curX += margin.Width; } } - + void RenderMargins (Cairo.Context cr, Cairo.Context textViewCr, Cairo.Rectangle cairoRectangle) { this.TextViewMargin.rulerX = Options.RulerColumn * this.TextViewMargin.CharWidth - this.textEditorData.HAdjustment.Value; @@ -2283,7 +2284,7 @@ void RenderMargins (Cairo.Context cr, Cairo.Context textViewCr, Cairo.Rectangle LoggingService.LogError ("Error while drawing margin " + margin, e); } } - // take the line real render width from the text view margin rendering (a line can consist of more than + // take the line real render width from the text view margin rendering (a line can consist of more than // one line and be longer (foldings!) ex. : someLine1[...]someLine2[...]someLine3) double lineWidth = textViewMargin.lastLineRenderWidth + HAdjustment.Value; if (longestLine == null || lineWidth > longestLineWidth) { @@ -2295,7 +2296,7 @@ void RenderMargins (Cairo.Context cr, Cairo.Context textViewCr, Cairo.Rectangle if (curY >= cairoRectangle.Y + cairoRectangle.Height) break; } - + foreach (var margin in this.margins) { if (!margin.IsVisible) continue; @@ -2303,19 +2304,19 @@ void RenderMargins (Cairo.Context cr, Cairo.Context textViewCr, Cairo.Rectangle drawer.Draw (cr, cairoRectangle); } RaiseLayoutChanged (); - if (setLongestLine) + if (setLongestLine) SetHAdjustment (); } - + /* protected override bool OnWidgetEvent (Event evnt) { System.Console.WriteLine(evnt); return base.OnWidgetEvent (evnt); }*/ - + double oldVadjustment = 0; - + void UpdateAdjustments () { int lastVisibleLine = textEditorData.LogicalToVisualLine (Document.LineCount); @@ -2334,32 +2335,31 @@ protected override bool OnDrawn (Context cr) if (this.isDisposed) return false; -// // try { - // ExposeEventInternal (cr); -// // } catch (Exception ex) { -// // GLib.ExceptionManager.RaiseUnhandledException (ex, false); -// // } + try { + ExposeEventInternal (cr); + } catch (Exception ex) { + GLib.ExceptionManager.RaiseUnhandledException (ex, false); + } keyPressTimings.EndTimer (true); return base.OnDrawn (cr); } - - void ExposeEventInternal (Gdk.EventExpose e) + void ExposeEventInternal (Context cr) { UpdateAdjustments (); -// var area = e.Region.Clipbox; -// var cairoArea = new Cairo.Rectangle (area.X, area.Y, area.Width, area.Height); - using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) - using (Cairo.Context textViewCr = Gdk.CairoHelper.Create (e.Window)) { + _ = Gdk.CairoHelper.GetClipRectangle (cr, out var area); + var cairoArea = new Cairo.Rectangle (area.X, area.Y, area.Width, area.Height); + + using (var textViewCr = Gdk.CairoHelper.Create (Window)) { UpdateMarginXOffsets (); - + cr.LineWidth = Options.Zoom; textViewCr.LineWidth = Options.Zoom; timingsWatch.Restart (); - //RenderMargins (cr, textViewCr, cairoArea); + RenderMargins (cr, textViewCr, cairoArea); keyPressTimings.AddMarginDrawingTime (timingsWatch.Elapsed); - + #if DEBUG_EXPOSE Console.WriteLine ("{0} expose {1},{2} {3}x{4}", (long)(DateTime.Now - started).TotalMilliseconds, e.Area.X, e.Area.Y, e.Area.Width, e.Area.Height); @@ -2374,12 +2374,16 @@ void ExposeEventInternal (Gdk.EventExpose e) animation.Drawer.Draw (cr); } keyPressTimings.AddAnimationDrawingTime (timingsWatch.Elapsed); - -// OnPainted (new PaintEventArgs (cr, cairoArea)); + + + OnPainted (new PaintEventArgs (cr, cairoArea)); } -// if (Caret.IsVisible) -// textViewMargin.DrawCaret (e.Window, Allocation); + if (Caret.IsVisible) { + timingsWatch.Restart (); + textViewMargin.DrawCaret (Window, Allocation); + keyPressTimings.AddCaretDrawingTime (timingsWatch.Elapsed); + } } protected virtual void OnPainted (PaintEventArgs e) @@ -2397,13 +2401,13 @@ public string EolMarker { return textEditorData.EolMarker; } } - + internal EditorTheme EditorTheme { get { return this.textEditorData?.ColorStyle; } } - + public EditMode CurrentMode { get { return this.textEditorData.CurrentMode; @@ -2412,13 +2416,13 @@ public EditMode CurrentMode { this.textEditorData.CurrentMode = value; } } - + public bool IsSomethingSelected { get { return this.textEditorData.IsSomethingSelected; } } - + public MonoDevelop.Ide.Editor.Selection MainSelection { get { return textEditorData.MainSelection; @@ -2427,7 +2431,7 @@ public MonoDevelop.Ide.Editor.Selection MainSelection { textEditorData.MainSelection = value; } } - + public MonoDevelop.Ide.Editor.SelectionMode SelectionMode { get { return textEditorData.SelectionMode; @@ -2445,7 +2449,7 @@ public ISegment SelectionRange { this.textEditorData.SelectionRange = value; } } - + public string SelectedText { get { return this.textEditorData.SelectedText; @@ -2454,7 +2458,7 @@ public string SelectedText { this.textEditorData.SelectedText = value; } } - + public int SelectionAnchor { get { return this.textEditorData.SelectionAnchor; @@ -2478,29 +2482,29 @@ public IEnumerable SelectedLines { return this.textEditorData.SelectedLines; } } - + public Adjustment HAdjustment { get { return this.textEditorData.HAdjustment; } } - + public Adjustment VAdjustment { get { return this.textEditorData.VAdjustment; } } - + public int Insert (int offset, string value) { return textEditorData.Insert (offset, value); } - + public void Remove (DocumentRegion region) { textEditorData.Remove (region); } - + public void Remove (ISegment removeSegment) { textEditorData.Remove (removeSegment); @@ -2510,47 +2514,47 @@ public void Remove (int offset, int count) { textEditorData.Remove (offset, count); } - + public int Replace (int offset, int count, string value) { return textEditorData.Replace (offset, count, value); } - + public void ClearSelection () { this.textEditorData.ClearSelection (); } - + public void DeleteSelectedText () { this.textEditorData.DeleteSelectedText (); } - + public void DeleteSelectedText (bool clearSelection) { this.textEditorData.DeleteSelectedText (clearSelection); } - + public void RunEditAction (Action action) { action (this.textEditorData); } - + public void SetSelection (int anchorOffset, int leadOffset) { this.textEditorData.SetSelection (anchorOffset, leadOffset); } - + public void SetSelection (DocumentLocation anchor, DocumentLocation lead) { this.textEditorData.SetSelection (anchor, lead); } - + public void SetSelection (int anchorLine, int anchorColumn, int leadLine, int leadColumn) { this.textEditorData.SetSelection (anchorLine, anchorColumn, leadLine, leadColumn); } - + public void ExtendSelectionTo (DocumentLocation location) { this.textEditorData.ExtendSelectionTo (location); @@ -2563,27 +2567,27 @@ public void SetSelectLines (int from, int to) { this.textEditorData.SetSelectLines (from, to); } - + public void InsertAtCaret (string text) { textEditorData.InsertAtCaret (text); } - + public bool CanEdit (int line) { return textEditorData.CanEdit (line); } - + public string GetLineText (int line) { return textEditorData.GetLineText (line); } - + public string GetLineText (int line, bool includeDelimiter) { return textEditorData.GetLineText (line, includeDelimiter); } - + /// /// Use with care. /// @@ -2594,16 +2598,16 @@ public TextEditorData GetTextEditorData () { return this.textEditorData; } - + public event EventHandler SelectionChanged; protected virtual void OnSelectionChanged (EventArgs args) { CurrentMode.InternalSelectionChanged (editor, textEditorData); - if (SelectionChanged != null) + if (SelectionChanged != null) SelectionChanged (this, args); } #endregion - + #region Document delegation public int Length { get { @@ -2624,12 +2628,12 @@ public string GetTextBetween (int startOffset, int endOffset) { return Document.GetTextBetween (startOffset, endOffset); } - + public string GetTextBetween (DocumentLocation start, DocumentLocation end) { return Document.GetTextBetween (start, end); } - + public string GetTextBetween (int startLine, int startColumn, int endLine, int endColumn) { return Document.GetTextBetween (startLine, startColumn, endLine, endColumn); @@ -2645,7 +2649,7 @@ public string GetTextAt (ISegment segment) { return Document.GetTextAt (segment); } - + public string GetTextAt (DocumentRegion region) { return Document.GetTextAt (region); @@ -2655,29 +2659,29 @@ public char GetCharAt (int offset) { return Document.GetCharAt (offset); } - + public IEnumerable Lines { get { return Document.Lines; } } - + public int LineCount { get { return Document.LineCount; } } - + public int LocationToOffset (int line, int column) { return Document.LocationToOffset (line, column); } - + public int LocationToOffset (DocumentLocation location) { return Document.LocationToOffset (location); } - + public DocumentLocation OffsetToLocation (int offset) { return Document.OffsetToLocation (offset); @@ -2687,37 +2691,37 @@ public string GetLineIndent (int lineNumber) { return Document.GetLineIndent (lineNumber); } - + public string GetLineIndent (DocumentLine segment) { return Document.GetLineIndent (segment); } - + public DocumentLine GetLine (int lineNumber) { return Document.GetLine (lineNumber); } - + public DocumentLine GetLineByOffset (int offset) { return Document.GetLineByOffset (offset); } - + public int OffsetToLineNumber (int offset) { return Document.OffsetToLineNumber (offset); } - + public IDisposable OpenUndoGroup() { return Document.OpenUndoGroup (); } #endregion - + #region Search & Replace - + bool highlightSearchPattern = false; - + public string SearchPattern { get { return this.textEditorData.SearchRequest.SearchPattern; @@ -2728,7 +2732,7 @@ public string SearchPattern { } } } - + public ISearchEngine SearchEngine { get { return this.textEditorData.SearchEngine; @@ -2738,7 +2742,7 @@ public ISearchEngine SearchEngine { this.textEditorData.SearchEngine = value; } } - + public event EventHandler HighlightSearchPatternChanged; public bool HighlightSearchPattern { get { @@ -2754,7 +2758,7 @@ public bool HighlightSearchPattern { } } } - + public bool IsCaseSensitive { get { return this.textEditorData.SearchRequest.CaseSensitive; @@ -2763,61 +2767,61 @@ public bool IsCaseSensitive { this.textEditorData.SearchRequest.CaseSensitive = value; } } - + public bool IsWholeWordOnly { get { return this.textEditorData.SearchRequest.WholeWordOnly; } - + set { this.textEditorData.SearchRequest.WholeWordOnly = value; } } - + public ISegment SearchRegion { get { return this.textEditorData.SearchRequest.SearchRegion; } - + set { this.textEditorData.SearchRequest.SearchRegion = value; } } - + public SearchResult SearchForward (int fromOffset) { return textEditorData.SearchForward (fromOffset); } - + public SearchResult SearchBackward (int fromOffset) { return textEditorData.SearchBackward (fromOffset); } - + class CaretPulseAnimation : IAnimationDrawer { MonoTextEditor editor; - + public double Percent { get; set; } - + public Gdk.Rectangle AnimationBounds { get { double x = editor.TextViewMargin.caretX; double y = editor.TextViewMargin.caretY; double extend = 100 * 5; int width = (int)(editor.TextViewMargin.charWidth + 2 * extend * editor.Options.Zoom / 2); - return new Gdk.Rectangle ((int)(x - extend * editor.Options.Zoom / 2), + return new Gdk.Rectangle ((int)(x - extend * editor.Options.Zoom / 2), (int)(y - extend * editor.Options.Zoom), width, (int)(editor.LineHeight + 2 * extend * editor.Options.Zoom)); } } - + public CaretPulseAnimation (MonoTextEditor editor) { this.editor = editor; } - + public void Draw (Cairo.Context cr) { double x = editor.TextViewMargin.caretX; @@ -2829,10 +2833,10 @@ public void Draw (Cairo.Context cr) double extend = Percent * 5; double width = editor.TextViewMargin.charWidth + 2 * extend * editor.Options.Zoom / 2; - FoldingScreenbackgroundRenderer.DrawRoundRectangle (cr, true, true, - x - extend * editor.Options.Zoom / 2, - y - extend * editor.Options.Zoom, - System.Math.Min (editor.TextViewMargin.charWidth / 2, width), + FoldingScreenbackgroundRenderer.DrawRoundRectangle (cr, true, true, + x - extend * editor.Options.Zoom / 2, + y - extend * editor.Options.Zoom, + System.Math.Min (editor.TextViewMargin.charWidth / 2, width), width, editor.LineHeight + 2 * extend * editor.Options.Zoom); Cairo.Color color = SyntaxHighlightingService.GetColor (editor.EditorTheme, EditorThemeColors.Foreground); @@ -2843,60 +2847,60 @@ public void Draw (Cairo.Context cr) cr.ResetClip (); } } - + public enum PulseKind { In, Out, Bounce } - + internal class RegionPulseAnimation : IAnimationDrawer { MonoTextEditor editor; - + public PulseKind Kind { get; set; } public double Percent { get; set; } - + Gdk.Rectangle region; - + public Gdk.Rectangle AnimationBounds { get { int x = region.X; int y = region.Y; int animationPosition = (int)(100 * 100); int width = (int)(region.Width + 2 * animationPosition * editor.Options.Zoom / 2); - - return new Gdk.Rectangle ((int)(x - animationPosition * editor.Options.Zoom / 2), + + return new Gdk.Rectangle ((int)(x - animationPosition * editor.Options.Zoom / 2), (int)(y - animationPosition * editor.Options.Zoom), width, (int)(region.Height + 2 * animationPosition * editor.Options.Zoom)); } } - + public RegionPulseAnimation (MonoTextEditor editor, Gdk.Point position, Gdk.Size size) : this (editor, new Gdk.Rectangle (position, size)) {} - + public RegionPulseAnimation (MonoTextEditor editor, Gdk.Rectangle region) { if (region.X < 0 || region.Y < 0 || region.Width < 0 || region.Height < 0) throw new ArgumentException ("region is invalid"); - + this.editor = editor; this.region = region; } - + public void Draw (Cairo.Context cr) { int x = region.X; int y = region.Y; int animationPosition = (int)(Percent * 100); - + cr.Rectangle (editor.TextViewMargin.XOffset, 0, editor.Allocation.Width - editor.TextViewMargin.XOffset, editor.Allocation.Height); cr.Clip (); int width = (int)(region.Width + 2 * animationPosition * editor.Options.Zoom / 2); - FoldingScreenbackgroundRenderer.DrawRoundRectangle (cr, true, true, - (int)(x - animationPosition * editor.Options.Zoom / 2), - (int)(y - animationPosition * editor.Options.Zoom), - System.Math.Min (editor.TextViewMargin.charWidth / 2, width), + FoldingScreenbackgroundRenderer.DrawRoundRectangle (cr, true, true, + (int)(x - animationPosition * editor.Options.Zoom / 2), + (int)(y - animationPosition * editor.Options.Zoom), + System.Math.Min (editor.TextViewMargin.charWidth / 2, width), width, (int)(region.Height + 2 * animationPosition * editor.Options.Zoom)); Cairo.Color color = SyntaxHighlightingService.GetColor (editor.EditorTheme, EditorThemeColors.Foreground); @@ -2907,22 +2911,22 @@ public void Draw (Cairo.Context cr) cr.ResetClip (); } } - + Gdk.Rectangle RangeToRectangle (DocumentLocation start, DocumentLocation end) { if (start.Column < 0 || start.Line < 0 || end.Column < 0 || end.Line < 0) return Gdk.Rectangle.Zero; - + var startPt = this.LocationToPoint (start); var endPt = this.LocationToPoint (end); int width = endPt.X - startPt.X; - + if (startPt.Y != endPt.Y || startPt.X < 0 || startPt.Y < 0 || width < 0) return Gdk.Rectangle.Zero; - + return new Gdk.Rectangle (startPt.X, startPt.Y, width, (int)this.LineHeight); } - + /// /// Initiate a pulse at the specified document location /// @@ -2941,7 +2945,7 @@ public void PulseCharacter (DocumentLocation pulseStart) }); } - + public SearchResult FindNext (bool setSelection) { var result = textEditorData.FindNext (setSelection); @@ -2959,23 +2963,23 @@ public void StartCaretPulseAnimation () } SearchHighlightPopupWindow popupWindow = null; - + public void StopSearchResultAnimation () { if (popupWindow == null) return; popupWindow.StopPlaying (); } - + public void AnimateSearchResult (SearchResult result) { if (!IsComposited || !Options.EnableAnimations || result == null) return; - + // Don't animate multi line search results if (OffsetToLineNumber (result.Segment.Offset) != OffsetToLineNumber (result.Segment.EndOffset)) return; - + TextViewMargin.MainSearchResult = result.Segment; if (!TextViewMargin.MainSearchResult.IsInvalid ()) { if (popupWindow != null) { @@ -2990,18 +2994,18 @@ public void AnimateSearchResult (SearchResult result) }; } } - + class SearchHighlightPopupWindow : BounceFadePopupWidget { public SearchResult Result { get; set; } - + public SearchHighlightPopupWindow (MonoTextEditor editor) : base (editor) { } - + public override void Popup () { ExpandWidth = (uint)Editor.LineHeight; @@ -3010,20 +3014,20 @@ public override void Popup () Duration = 150; base.Popup (); } - + protected override void OnAnimationCompleted () { base.OnAnimationCompleted (); Destroy (); } - + protected override void OnDestroyed () { if (layout != null) layout.Dispose (); base.OnDestroyed (); } - + protected override Cairo.Rectangle CalculateInitialBounds () { DocumentLine line = Editor.Document.GetLineByOffset (Result.Offset); @@ -3032,7 +3036,7 @@ protected override Cairo.Rectangle CalculateInitialBounds () var lineLayout = Editor.TextViewMargin.CreateLinePartLayout (line, logicalRulerColumn, line.Offset, line.Length, -1, -1); if (lineLayout == null) return new Cairo.Rectangle (); - + int l, x1, x2; int index = Result.Offset - line.Offset - 1; if (index >= 0) { @@ -3040,7 +3044,7 @@ protected override Cairo.Rectangle CalculateInitialBounds () } else { l = x1 = 0; } - + index = Result.Offset - line.Offset - 1 + Result.Length; if (index >= 0) { lineLayout.IndexToLineX (index, true, out l, out x2); @@ -3052,7 +3056,7 @@ protected override Cairo.Rectangle CalculateInitialBounds () if (lineLayout.IsUncached) { lineLayout.Dispose (); } - + double y = Editor.LineToY (lineNr); double w = (x2 - x1) / Pango.Scale.PangoScale; double x = (x1 / Pango.Scale.PangoScale + Editor.TextViewMargin.XOffset + Editor.TextViewMargin.TextStartPosition); @@ -3098,7 +3102,7 @@ protected override void Draw (Cairo.Context cr, Cairo.Rectangle area) //draw the shadow FoldingScreenbackgroundRenderer.DrawRoundRectangle (cr, true, true, shadowOffset, shadowOffset, corner, width, height); - // TODO: EditorTheme : searchResultMainColor? + // TODO: EditorTheme : searchResultMainColor? var searchResultMainColor = SyntaxHighlightingService.GetColor (Editor.EditorTheme, EditorThemeColors.FindHighlight); var color = TextViewMargin.DimColor (searchResultMainColor, 0.3); color.A = 0.5 * opacity * opacity; @@ -3145,7 +3149,7 @@ static double Lerp (double from, double to, double scale) return from + scale * (to - from); } } - + public SearchResult FindPrevious (bool setSelection) { var result = textEditorData.FindPrevious (setSelection); @@ -3155,23 +3159,23 @@ public SearchResult FindPrevious (bool setSelection) AnimateSearchResult (result); return result; } - + public bool Replace (string withPattern) { return textEditorData.SearchReplace (withPattern, true); } - + public int ReplaceAll (string withPattern) { return textEditorData.SearchReplaceAll (withPattern); } #endregion - + #region Tooltips // Tooltip fields const int TooltipTimeout = 200; TooltipItem tipItem; - + int tipX, tipY, tipOffset; uint tipHideTimeoutId = 0; uint tipShowTimeoutId = 0; @@ -3183,7 +3187,7 @@ public int ReplaceAll (string withPattern) int nextTipX=0; int nextTipY=0; Gdk.ModifierType nextTipModifierState = ModifierType.None; System.DateTime nextTipScheduledTime; // Time at which we want the tooltip to show - + void ShowTooltip (Gdk.ModifierType modifierState, DocumentLocation location) { if (mx < TextViewMargin.TextStartPosition) { @@ -3202,8 +3206,8 @@ void ShowTooltip (Gdk.ModifierType modifierState, DocumentLocation location) HideTooltip (); return; } - - ShowTooltip (modifierState, + + ShowTooltip (modifierState, Document.LocationToOffset (location), (int)mx, (int)my); @@ -3222,7 +3226,7 @@ public void ShowQuickInfo () var p = LocationToPoint (Caret.Location); ShowTooltip (Gdk.ModifierType.None, Caret.Offset, p.X, p.Y, 0); } - + void ShowTooltip (Gdk.ModifierType modifierState, int offset, int xloc, int yloc, uint timeOut = TooltipTimeout) { CancelScheduledShow (); @@ -3237,7 +3241,7 @@ void ShowTooltip (Gdk.ModifierType modifierState, int offset, int xloc, int yloc if (xloc >= wx && xloc < tipX + ww && yloc >= tipY && yloc < tipY + 20 + wh) return; } - if (tipItem != null && !tipItem.IsInvalid () && !tipItem.Contains (offset)) + if (tipItem != null && !tipItem.IsInvalid () && !tipItem.Contains (offset)) HideTooltip (TooltipCloseReason.MouseMove); nextTipX = xloc; nextTipY = yloc; @@ -3248,7 +3252,7 @@ void ShowTooltip (Gdk.ModifierType modifierState, int offset, int xloc, int yloc if (tipShowTimeoutId == 0) tipShowTimeoutId = GLib.Timeout.Add (timeOut, () => { TooltipTimer (); return false; }); } - + async void TooltipTimer () { // This timer can't be reused, so reset the var now @@ -3256,7 +3260,7 @@ async void TooltipTimer () // Cancelled? if (nextTipOffset == -1) return; - + int remainingMs = (int) (nextTipScheduledTime - System.DateTime.Now).TotalMilliseconds; if (remainingMs > 50) { // Still some significant time left. Re-schedule the timer @@ -3268,7 +3272,7 @@ async void TooltipTimer () // Find a provider TooltipProvider provider = null; TooltipItem item = null; - + foreach (TooltipProvider tp in textEditorData.tooltipProviders) { try { item = await tp.GetItem (editor, nextTipOffset, token); @@ -3290,7 +3294,7 @@ async void TooltipTimer () CancelScheduledHide (); return; } - + tipX = nextTipX; tipY = nextTipY; tipOffset = nextTipOffset; @@ -3308,11 +3312,11 @@ async void TooltipTimer () HideTooltip (); if (tw == null) return; - + CancelScheduledShow (); tipWindow = tw; currentTooltipProvider = provider; - + tipShowTimeoutId = 0; } else HideTooltip (); @@ -3324,12 +3328,12 @@ internal void SetTooltip (Xwt.WindowFrame tooltipWindow) HideTooltip (); tipWindow = tooltipWindow; } - + public void HideTooltip (TooltipCloseReason reason = TooltipCloseReason.Force) { CancelScheduledHide (); CancelScheduledShow (); - + if (tipWindow != null) { // if (checkMouseOver && tipWindow.GdkWindow != null) { // // Don't hide the tooltip window if the mouse pointer is inside it. @@ -3347,7 +3351,7 @@ public void HideTooltip (TooltipCloseReason reason = TooltipCloseReason.Force) } } } - + void DelayedHideTooltip (TooltipCloseReason reason) { CancelScheduledHide (); @@ -3357,7 +3361,7 @@ void DelayedHideTooltip (TooltipCloseReason reason) return false; }); } - + void CancelScheduledHide () { CancelScheduledShow (); @@ -3375,7 +3379,7 @@ void CancelScheduledShow () // Don't remove the timeout handler since it may be reused nextTipOffset = -1; } - + void OnDocumentStateChanged (object s, TextChangeEventArgs args) { HideTooltip (); @@ -3392,7 +3396,7 @@ void OnDocumentStateChanged (object s, TextChangeEventArgs args) } } #endregion - + #region Coordinate transformation public DocumentLocation PointToLocation (double xp, double yp, bool endAtEol = false) { @@ -3403,7 +3407,7 @@ public DocumentLocation PointToLocation (Cairo.Point p) { return TextViewMargin.PointToLocation (p); } - + public DocumentLocation PointToLocation (Cairo.PointD p) { return TextViewMargin.PointToLocation (p); @@ -3418,12 +3422,12 @@ public Cairo.Point LocationToPoint (int line, int column) { return TextViewMargin.LocationToPoint (line, column); } - + public Cairo.Point LocationToPoint (int line, int column, bool useAbsoluteCoordinates) { return TextViewMargin.LocationToPoint (line, column, useAbsoluteCoordinates); } - + public Cairo.Point LocationToPoint (DocumentLocation loc, bool useAbsoluteCoordinates) { return TextViewMargin.LocationToPoint (loc, useAbsoluteCoordinates); @@ -3433,7 +3437,7 @@ public double ColumnToX (DocumentLine line, int column) { return TextViewMargin.ColumnToX (line, column); } - + /// /// Calculates the line number at line start (in one visual line could be several logical lines be displayed). /// @@ -3441,33 +3445,33 @@ public int YToLine (double yPos) { return TextViewMargin.YToLine (yPos); } - + public double LineToY (int logicalLine) { return TextViewMargin.LineToY (logicalLine); } - + public double GetLineHeight (DocumentLine line) { return TextViewMargin.GetLineHeight (line); } - + public double GetLineHeight (int logicalLineNumber) { return TextViewMargin.GetLineHeight (logicalLineNumber); } #endregion - + #region Animation Stage animationStage = new Stage (); List actors = new List (); - + protected void InitAnimations () { animationStage.ActorStep += OnAnimationActorStep; animationStage.Iteration += OnAnimationIteration; } - + void DisposeAnimations () { if (animationStage != null) { @@ -3476,7 +3480,7 @@ void DisposeAnimations () animationStage.Iteration -= OnAnimationIteration; animationStage = null; } - + if (actors != null) { foreach (Animation actor in actors) { if (actor is IDisposable) @@ -3486,17 +3490,17 @@ void DisposeAnimations () actors = null; } } - + Animation StartAnimation (IAnimationDrawer drawer) { return StartAnimation (drawer, 300); } - + Animation StartAnimation (IAnimationDrawer drawer, uint duration) { return StartAnimation (drawer, duration, Easing.Linear); } - + Animation StartAnimation (IAnimationDrawer drawer, uint duration, Easing easing) { if (!Options.EnableAnimations) @@ -3506,7 +3510,7 @@ Animation StartAnimation (IAnimationDrawer drawer, uint duration, Easing easing) actors.Add (animation); return animation; } - + bool OnAnimationActorStep (Actor actor) { switch (actor.Target.AnimationState) { @@ -3528,33 +3532,33 @@ bool OnAnimationActorStep (Actor actor) } return true; } - + void RemoveAnimation (Animation animation) { if (animation == null) return; -// Rectangle bounds = animation.Drawer.AnimationBounds; + var bounds = animation.Drawer.AnimationBounds; actors.Remove (animation); if (animation is IDisposable) ((IDisposable)animation).Dispose (); -// QueueDrawArea (bounds.X, bounds.Y, bounds.Width, bounds.Height); + QueueDrawArea (bounds.X, bounds.Y, bounds.Width, bounds.Height); } - + void OnAnimationIteration (object sender, EventArgs args) { foreach (Animation actor in actors) { -// Rectangle bounds = actor.Drawer.AnimationBounds; -// QueueDrawArea (bounds.X, bounds.Y, bounds.Width, bounds.Height); + var bounds = actor.Drawer.AnimationBounds; + QueueDrawArea (bounds.X, bounds.Y, bounds.Width, bounds.Height); } } #endregion - + internal void FireLinkEvent (string link, uint button, ModifierType modifierState) { if (LinkRequest != null) LinkRequest (this, new LinkEventArgs (link, button, modifierState)); } - + public event EventHandler LinkRequest; /// @@ -3565,7 +3569,7 @@ public void InsertMargin (int index, Margin margin) margins.Insert (index, margin); RedrawFromLine (0); } - + /// /// Checks whether the editor has a margin of a given type /// @@ -3573,7 +3577,7 @@ public bool HasMargin (Type marginType) { return margins.Exists((margin) => { return marginType.IsAssignableFrom (margin.GetType ()); }); } - + /// /// Gets the first margin of a given type /// @@ -3588,13 +3592,13 @@ public void RequestResetCaretBlink () requestResetCaretBlink = true; } - class SetCaret + class SetCaret { MonoTextEditor view; int line, column; bool highlightCaretLine; bool centerCaret; - + public SetCaret (MonoTextEditor view, int line, int column, bool highlightCaretLine, bool centerCaret) { this.view = view; @@ -3603,7 +3607,7 @@ public SetCaret (MonoTextEditor view, int line, int column, bool highlightCaretL this.highlightCaretLine = highlightCaretLine; this.centerCaret = centerCaret; } - + public void Run (object sender, EventArgs e) { if (view.IsDisposed) @@ -3632,7 +3636,7 @@ public void SetCaretTo (int line, int column) { SetCaretTo (line, column, true); } - + public void SetCaretTo (int line, int column, bool highlight) { SetCaretTo (line, column, highlight, true); @@ -3644,7 +3648,7 @@ public void SetCaretTo (int line, int column, bool highlight, bool centerCaret) throw new ArgumentException ("line < MinLine"); if (column < DocumentLocation.MinColumn) throw new ArgumentException ("column < MinColumn"); - + if (!sizeHasBeenAllocated) { SetCaret setCaret = new SetCaret (editor, line, column, highlight, centerCaret); SizeAllocated += setCaret.Run; @@ -3664,7 +3668,7 @@ public override GLib.GType ChildType () { return Gtk.Widget.GType; } - + internal List containerChildren = new List (); internal event EventHandler LayoutChanged; @@ -3682,10 +3686,10 @@ public void AddTopLevelWidget (Gtk.Widget widget, int x, int y) var newContainerChildren = new List (containerChildren); newContainerChildren.Add (info); containerChildren = newContainerChildren; -// ResizeChild (Allocation, info); + ResizeChild (Allocation, info); SetAdjustments (); } - + public void MoveTopLevelWidget (Gtk.Widget widget, int x, int y) { foreach (var info in containerChildren.ToArray ()) { @@ -3694,8 +3698,8 @@ public void MoveTopLevelWidget (Gtk.Widget widget, int x, int y) break; info.X = x; info.Y = y; -// if (widget.Visible) -// ResizeChild (Allocation, info); + if (widget.Visible) + ResizeChild (Allocation, info); break; } } @@ -3716,7 +3720,7 @@ public void GetTopLevelWidgetPosition (Gtk.Widget widget, out int x, out int y) } x = y = 0; } - + public void MoveToTop (Gtk.Widget widget) { var editorContainerChild = containerChildren.FirstOrDefault (c => c.Child == widget); @@ -3727,12 +3731,12 @@ public void MoveToTop (Gtk.Widget widget) this.containerChildren = newChilds; widget.GdkWindow.Raise (); } - + protected override void OnAdded (Widget widget) { AddTopLevelWidget (widget, 0, 0); } - + protected override void OnRemoved (Widget widget) { var newContainerChildren = new List (containerChildren); @@ -3746,12 +3750,12 @@ protected override void OnRemoved (Widget widget) } containerChildren = newContainerChildren; } - + protected override void ForAll (bool include_internals, Gtk.Callback callback) { containerChildren.ForEach (child => callback (child.Child)); } - + protected override void OnMapped () { this.IsMapped = true; @@ -3760,37 +3764,37 @@ protected override void OnMapped () containerChildren.ForEach (child => { if (child.Child.Visible) child.Child.Map (); }); GdkWindow.Show (); } - + protected override void OnUnmapped () { this.IsMapped = false; - + // We hide the window first so that the user doesn't see widgets disappearing one by one. GdkWindow.Hide (); - + containerChildren.ForEach (child => child.Child.Unmap ()); } -// void ResizeChild (Rectangle allocation, MonoTextEditor.EditorContainerChild child) -// { -// Requisition req = child.Child.SizeRequest (); -// var childRectangle = new Gdk.Rectangle (child.X, child.Y, req.Width, req.Height); -// if (!child.FixedPosition) { + void ResizeChild (Gdk.Rectangle allocation, MonoTextEditor.EditorContainerChild child) + { + Requisition req = child.Child.SizeRequest (); + var childRectangle = new Gdk.Rectangle (child.X, child.Y, req.Width, req.Height); + if (!child.FixedPosition) { // double zoom = Options.Zoom; -// childRectangle.X = (int)(child.X /* * zoom */- HAdjustment.Value); -// childRectangle.Y = (int)(child.Y /* * zoom */- VAdjustment.Value); -// } -// // childRectangle.X += allocation.X; -// // childRectangle.Y += allocation.Y; -// child.Child.SizeAllocate (childRectangle); -// } - -// void SetChildrenPositions (Rectangle allocation) -// { -// foreach (var child in containerChildren.ToArray ()) { -// ResizeChild (allocation, child); -// } -// } + childRectangle.X = (int)(child.X /* * zoom */- HAdjustment.Value); + childRectangle.Y = (int)(child.Y /* * zoom */- VAdjustment.Value); + } + // childRectangle.X += allocation.X; + // childRectangle.Y += allocation.Y; + child.Child.SizeAllocate (childRectangle); + } + + void SetChildrenPositions (Gdk.Rectangle allocation) + { + foreach (var child in containerChildren.ToArray ()) { + ResizeChild (allocation, child); + } + } #endregion } @@ -3799,7 +3803,7 @@ interface ITextEditorDataProvider { TextEditorData GetTextEditorData (); } - + [Serializable] public sealed class PaintEventArgs : EventArgs { @@ -3807,12 +3811,12 @@ public Cairo.Context Context { get; set; } - + public Cairo.Rectangle Area { get; set; } - + public PaintEventArgs (Cairo.Context context, Cairo.Rectangle area) { this.Context = context; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs index ac98e2c5011..4f318eff6a5 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs @@ -846,8 +846,8 @@ char GetCaretChar () return caretChar; } -// public void DrawCaret (Gdk.Drawable win, Gdk.Rectangle rect) -// { + public void DrawCaret (Gdk.Window win, Gdk.Rectangle rect) + { // if (!this.textEditor.IsInDrag && !(this.caretX >= 0 && (!this.textEditor.IsSomethingSelected || this.textEditor.SelectionRange.Length == 0))) // return; // if (win == null || Settings.Default.CursorBlink && !Caret.IsVisible || !caretBlink) @@ -920,7 +920,7 @@ char GetCaretChar () // break; // } // } -// } + } void GetSelectionOffsets (DocumentLine line, out int selectionStart, out int selectionEnd) { From 8ec8f2a24cc846a21abf258a9d3ce50954e21131 Mon Sep 17 00:00:00 2001 From: lytico Date: Mon, 22 Jan 2024 21:29:21 +0100 Subject: [PATCH 248/382] MonoDevelop.TextEditor.csproj: try reimplement TextArea II --- .../Mono.TextEditor/Gui/FoldMarkerMargin.cs | 42 +++++++++---------- .../Mono.TextEditor/Gui/TextArea.cs | 6 +-- .../MonoDevelop.Components/PangoUtil.cs | 15 ++----- 3 files changed, 27 insertions(+), 36 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/FoldMarkerMargin.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/FoldMarkerMargin.cs index 0acf2b2a3ef..91b14055d9e 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/FoldMarkerMargin.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/FoldMarkerMargin.cs @@ -57,14 +57,14 @@ public override double Width { return marginWidth; } } - + bool isInCodeFocusMode; public bool IsInCodeFocusMode { - get { - return isInCodeFocusMode; + get { + return isInCodeFocusMode; } set { - isInCodeFocusMode = value; + isInCodeFocusMode = value; if (!isInCodeFocusMode) { RemoveBackgroundRenderer (); } else { @@ -73,7 +73,7 @@ public bool IsInCodeFocusMode { } } } - + public FoldMarkerMargin (MonoTextEditor editor) { this.editor = editor; @@ -204,22 +204,22 @@ bool UpdateAccessibilityTimer () void HandleEditorCaretPositionChanged (object sender, DocumentLocationEventArgs e) { - if (!IsInCodeFocusMode) + if (!IsInCodeFocusMode) return; DocumentLine lineSegment = editor.Document.GetLine (editor.Caret.Line); if (lineSegment == null) { RemoveBackgroundRenderer (); return; } - + IEnumerable newFoldings = editor.Document.GetFoldingContaining (lineSegment); if (newFoldings == null) { RemoveBackgroundRenderer (); return; } - + bool areEqual = foldings != null; - + if (areEqual && foldings.Count () != newFoldings.Count ()) areEqual = false; if (areEqual) { @@ -232,13 +232,13 @@ void HandleEditorCaretPositionChanged (object sender, DocumentLocationEventArgs } } } - + if (!areEqual) { foldings = newFoldings; StopTimer (); } } - + internal protected override void MousePressed (MarginMouseEventArgs args) { base.MousePressed (args); @@ -252,7 +252,7 @@ internal protected override void MousePressed (MarginMouseEventArgs args) editor.SetAdjustments (); editor.Caret.MoveCaretBeforeFoldings (); } - + internal protected override void MouseHover (MarginMouseEventArgs args) { base.MouseHover (args); @@ -266,7 +266,7 @@ internal protected override void MouseHover (MarginMouseEventArgs args) lineHover = lineSegment; editor.RedrawMargin (this); } - } + } lineHover = lineSegment; bool found = false; foreach (FoldSegment segment in editor.Document.GetFoldingContaining (lineSegment)) { @@ -315,7 +315,7 @@ bool SetBackgroundRenderer () timerId = 0; return false; } - + void StopTimer () { if (timerId != 0) { @@ -323,7 +323,7 @@ void StopTimer () timerId = 0; } } - + uint timerId; IEnumerable foldings; void RemoveBackgroundRenderer () @@ -334,11 +334,11 @@ void RemoveBackgroundRenderer () editor.QueueDraw (); } } - + internal protected override void MouseLeft () { base.MouseLeft (); - + if (lineHover != null) { lineHover = null; editor.RedrawMargin (this); @@ -346,14 +346,14 @@ internal protected override void MouseLeft () StopTimer (); RemoveBackgroundRenderer (); } - + internal protected override void OptionsChanged () { drawer.OptionsChanged (); marginWidth = editor.LineHeight * 3 / 4; } - + public override void Dispose () { base.Dispose (); @@ -361,7 +361,7 @@ public override void Dispose () animationStage.ActorStep -= AnimationStage_ActorStep; animationStage.Exeunt (); editor.TextArea.MouseHover -= TextArea_MouseHover; - editor.TextArea.MouseLeft -= TextArea_MouseLeft; + editor.TextArea.MouseLeft -= TextArea_MouseLeft; editor.Caret.PositionChanged -= HandleEditorCaretPositionChanged; editor.Caret.PositionChanged -= EditorCarethandlePositionChanged; editor.Document.FoldTreeUpdated -= HandleEditorDocumentFoldTreeUpdated; @@ -382,7 +382,7 @@ public override void Dispose () accessibles.Clear (); } } - + internal protected override void Draw (Cairo.Context cr, Cairo.Rectangle area, DocumentLine line, int lineNumber, double x, double y, double lineHeight) { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs index 3317f078f75..e65a3eb1a35 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs @@ -453,9 +453,9 @@ internal void Initialize (MonoTextEditor editor, TextDocument doc, ITextEditorOp args.RetVal = true; }; -// using (Pixmap inv = new Pixmap (null, 1, 1, 1)) { -// invisibleCursor = new Cursor (inv, inv, Gdk.Color.Zero, Gdk.Color.Zero, 0, 0); -// } + + invisibleCursor = new Cursor (CursorType.BlankCursor); + InitAnimations (); this.Document.HeightChanged += HandleDocumentHeightChanged; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs index f31249f63f2..e512ea08f7b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs @@ -47,26 +47,17 @@ public static class PangoUtil /// public static Pango.Layout CreateLayout (Widget widget) { - var ptr = gtk_widget_create_pango_layout (widget.Handle, IntPtr.Zero); - return GLib.Object.GetObject (ptr, true) as Pango.Layout; + return widget.CreatePangoLayout (default); } public static Pango.Layout CreateLayout (Widget widget, string text) { - IntPtr textPtr = text == null? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (text); - - var ptr = gtk_widget_create_pango_layout (widget.Handle, textPtr); - - if (textPtr != IntPtr.Zero) - GLib.Marshaller.Free (textPtr); - - return GLib.Object.GetObject (ptr, true) as Pango.Layout; + return widget.CreatePangoLayout (text); } public static Pango.Layout CreateLayout (PrintContext context) { - var ptr = gtk_print_context_create_pango_layout (context.Handle); - return ptr == IntPtr.Zero? null : new Pango.Layout (ptr); + return context.CreatePangoLayout (); } [DllImport (LIBGTK, CallingConvention=CallingConvention.Cdecl)] From caa80f4fa28945f4ae98cb16a78e85b43d575740 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 23 Jan 2024 22:49:59 +0100 Subject: [PATCH 249/382] update --- main/src/addins/GnomePlatform/GnomePlatform.cs | 18 +++++++++--------- .../Mono.TextEditor/Gui/TextArea.cs | 6 +++--- .../MonoDevelop.Ide.Fonts/FontService.cs | 12 ++++++++++-- .../MonoDevelop.Ide/DesktopService.cs | 8 ++++---- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/main/src/addins/GnomePlatform/GnomePlatform.cs b/main/src/addins/GnomePlatform/GnomePlatform.cs index 6d539fca1ed..96437cdd2f0 100644 --- a/main/src/addins/GnomePlatform/GnomePlatform.cs +++ b/main/src/addins/GnomePlatform/GnomePlatform.cs @@ -89,15 +89,15 @@ public override string DefaultMonospaceFont { } } - // public override string DefaultSansFont { - // get { - // try { - // return (string)(Gio.GetGSettingsString ("org.gnome.desktop.interface", "document-font-name")); - // } catch (Exception) { - // return "Sans 11"; - // } - // } - // } + public override string DefaultSansFont { + get { + try { + return (string)(Gio.GetGSettingsString ("org.gnome.desktop.interface", "document-font-name")); + } catch (Exception) { + return "Sans 11"; + } + } + } public override string Name { get { return "Gnome"; } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs index e65a3eb1a35..19405d2747d 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs @@ -924,9 +924,9 @@ protected override void OnRealized () Mask = this.Events | Gdk.EventMask.ExposureMask, }; -// WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y | WindowAttributesType.Colormap | WindowAttributesType.Visual; -// GdkWindow = new Gdk.Window (ParentWindow, attributes, mask); -// GdkWindow.UserData = Raw; + WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y /*| WindowAttributesType.Colormap */| WindowAttributesType.Visual; + GdkWindow = new Gdk.Window (ParentWindow, attributes, mask); + GdkWindow.UserData = Raw; // GdkWindow.Background = Style.Background (StateType.Normal); // Style = Style.Attach (GdkWindow); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs index 995416eff0a..266c2a67dc0 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs @@ -46,7 +46,9 @@ public class FontService: Service DesktopService desktopService; string defaultMonospaceFontName = String.Empty; + string defaultSansFontName = String.Empty; FontDescription defaultMonospaceFont = new FontDescription (); + FontDescription defaultSansFont = new FontDescription (); void LoadDefaults () { @@ -54,9 +56,15 @@ void LoadDefaults () defaultMonospaceFont.Dispose (); } + if (defaultSansFont != null) { + defaultSansFont.Dispose (); + } + #pragma warning disable 618 defaultMonospaceFontName = desktopService.DefaultMonospaceFont; defaultMonospaceFont = FontDescription.FromString (defaultMonospaceFontName); + defaultSansFontName = desktopService.DefaultSansFont; + defaultSansFont = FontDescription.FromString (defaultSansFontName); #pragma warning restore 618 } @@ -89,10 +97,10 @@ protected override async Task OnInitialize (ServiceProvider serviceProvider) } public FontDescription MonospaceFont { get { return defaultMonospaceFont; } } - public FontDescription SansFont { get { return Gui.Styles.DefaultFont; } } + public FontDescription SansFont { get { return defaultSansFont; } } public string MonospaceFontName { get { return defaultMonospaceFontName; } } - public string SansFontName { get { return Gui.Styles.DefaultFontName; } } + public string SansFontName { get { return defaultSansFontName; } } [Obsolete ("Use MonospaceFont")] public FontDescription DefaultMonospaceFontDescription { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs index a2565e293fe..8e9dc0a9f16 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs @@ -148,10 +148,10 @@ internal string DefaultMonospaceFont { get { return PlatformService.DefaultMonospaceFont; } } - // [Obsolete ("Use FontService")] - // public static string DefaultSansFont { - // get { return PlatformService.DefaultSansFont; } - // } + [Obsolete ("Use FontService")] + internal string DefaultSansFont { + get { return PlatformService.DefaultSansFont; } + } public string PlatformName { get { return PlatformService.Name; } From fe39d4d649072cc27b8376eb7c1485ffe53c8565 Mon Sep 17 00:00:00 2001 From: lytico Date: Wed, 24 Jan 2024 15:15:38 +0100 Subject: [PATCH 250/382] MonoDevelop.Ide: refactor some Expose -> Draw --- .../MonoDevelop.Components.Docking/DockBar.cs | 75 ++++---- .../DockBarItem.cs | 1 + .../DockContainer.cs | 22 +-- .../DockItemContainer.cs | 160 +++++++++--------- .../DockItemTitleTab.cs | 107 ++++++------ .../TabStrip.cs | 21 +-- 6 files changed, 206 insertions(+), 180 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs index 08c080d0584..6b6e3d668ef 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs @@ -30,6 +30,7 @@ using System; +using Cairo; using Gtk; using MonoDevelop.Ide.Gui; @@ -222,35 +223,51 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) } } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// var alloc = Allocation; -// using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { -// ctx.Rectangle (alloc.X, alloc.Y, alloc.X + alloc.Width, alloc.Y + alloc.Height); -// ctx.SetSourceColor (Styles.DockBarBackground.ToCairoColor ()); -// ctx.Fill (); -// } -// -// if (Child != null) -// PropagateExpose (Child, evnt); -// -// if (ShowBorder) { -// using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { -// ctx.LineWidth = 1; -// -// // Dark separator -// switch (Position) { -// case PositionType.Left:ctx.MoveTo (alloc.X + alloc.Width - 0.5, alloc.Y); ctx.RelLineTo (0, Allocation.Height); break; -// case PositionType.Right: ctx.MoveTo (alloc.X + 0.5, alloc.Y); ctx.RelLineTo (0, Allocation.Height); break; -// case PositionType.Top: ctx.MoveTo (alloc.X, alloc.Y + alloc.Height + 0.5); ctx.RelLineTo (Allocation.Width, 0); break; -// case PositionType.Bottom: ctx.MoveTo (alloc.X, alloc.Y + 0.5); ctx.RelLineTo (Allocation.Width, 0); break; -// } -// ctx.SetSourceColor (Styles.DockSeparatorColor.ToCairoColor ()); -// ctx.Stroke (); -// } -// } -// return true; -// } + protected override bool OnDrawn (Context ctx) + { + var alloc = Allocation; + ctx.Save (); + ctx.Rectangle (alloc.X, alloc.Y, alloc.X + alloc.Width, alloc.Y + alloc.Height); + ctx.SetSourceColor (Styles.DockBarBackground.ToCairoColor ()); + ctx.Fill (); + + if (Child != null) + Child.Draw (ctx); + + ctx.Restore (); + + if (ShowBorder) { + ctx.Save (); + + ctx.LineWidth = 1; + + // Dark separator + switch (Position) { + case PositionType.Left: + ctx.MoveTo (alloc.X + alloc.Width - 0.5, alloc.Y); + ctx.RelLineTo (0, Allocation.Height); + break; + case PositionType.Right: + ctx.MoveTo (alloc.X + 0.5, alloc.Y); + ctx.RelLineTo (0, Allocation.Height); + break; + case PositionType.Top: + ctx.MoveTo (alloc.X, alloc.Y + alloc.Height + 0.5); + ctx.RelLineTo (Allocation.Width, 0); + break; + case PositionType.Bottom: + ctx.MoveTo (alloc.X, alloc.Y + 0.5); + ctx.RelLineTo (Allocation.Width, 0); + break; + } + + ctx.SetSourceColor (Styles.DockSeparatorColor.ToCairoColor ()); + ctx.Stroke (); + ctx.Restore (); + } + + return true; + } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs index 39863fbdb40..d62716b4368 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs @@ -30,6 +30,7 @@ using System; +using Cairo; using Gtk; using MonoDevelop.Ide.Gui; using MonoDevelop.Components; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs index 162a06144bd..793871fce86 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs @@ -32,10 +32,12 @@ using Gtk; using Gdk; using System.Linq; +using Cairo; using MonoDevelop.Components.AtkCocoaHelper; using MonoDevelop.Core; using MonoDevelop.Ide.Gui; using GLib; +using Rectangle = Gdk.Rectangle; namespace MonoDevelop.Components.Docking { @@ -205,16 +207,16 @@ protected override void ForAll (bool include_internals, Gtk.Callback callback) if (s.Parent != null) callback (s.Widget); } - -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// bool res = base.OnExposeEvent (evnt); -// -// if (layout != null) { -// layout.Draw (evnt.Area, null, 0); -// } -// return res; -// } + + protected override bool OnDrawn (Context cr) + { + bool res = base.OnDrawn (cr); + var area = Allocation; + if (layout != null) { + layout.Draw (area, null, 0); + } + return res; + } protected override void OnAdded (Widget widget) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs index bdfb40499d5..71d31010a62 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs @@ -29,6 +29,7 @@ // using System; +using Cairo; using Gtk; using MonoDevelop.Components; @@ -178,17 +179,19 @@ void OnTreeRealized (object sender, EventArgs e) w.ModifyBase (StateType.Insensitive, Parent.Style.Base (StateType.Insensitive)); } } - -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// if (VisualStyle.TabStyle == DockTabStyle.Normal) { -// Gdk.GC gc = new Gdk.GC (GdkWindow); -// gc.RgbFgColor = VisualStyle.PadBackgroundColor.Value.ToGdkColor (); -// evnt.Window.DrawRectangle (gc, true, Allocation); -// gc.Dispose (); -// } -// return base.OnExposeEvent (evnt); -// } + + protected override bool OnDrawn (Context cr) + { + if (VisualStyle.TabStyle == DockTabStyle.Normal) { + var col = VisualStyle.PadBackgroundColor.Value.ToCairoColor (); + cr.Save (); + cr.SetSourceColor (col); + cr.Rectangle (Allocation.ToCairoRect ()); + cr.Restore (); + } + + return base.OnDrawn (cr); + } } class CustomFrame: Bin @@ -301,73 +304,72 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) child.SizeAllocate (allocation); } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// Gdk.Rectangle rect = Allocation; -// -// //Gdk.Rectangle.Right and Bottom are inconsistent -// int right = rect.X + rect.Width, bottom = rect.Y + rect.Height; -// -// var bcolor = backgroundColorSet ? BackgroundColor : Style.Background (Gtk.StateType.Normal); -// using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) { -// -// if (GradientBackround) { -// cr.NewPath (); -// cr.MoveTo (rect.X, rect.Y); -// cr.RelLineTo (rect.Width, 0); -// cr.RelLineTo (0, rect.Height); -// cr.RelLineTo (-rect.Width, 0); -// cr.RelLineTo (0, -rect.Height); -// cr.ClosePath (); -// -// // FIXME: VV: Remove gradient features -// using (Cairo.Gradient pat = new Cairo.LinearGradient (rect.X, rect.Y, rect.X, bottom)) { -// pat.AddColorStop (0, bcolor.ToCairoColor ()); -// Xwt.Drawing.Color gcol = bcolor.ToXwtColor (); -// gcol.Light -= 0.1; -// if (gcol.Light < 0) -// gcol.Light = 0; -// pat.AddColorStop (1, gcol.ToCairoColor ()); -// cr.SetSource (pat); -// cr.Fill (); -// } -// } else { -// if (backgroundColorSet) { -// Gdk.GC gc = new Gdk.GC (GdkWindow); -// gc.RgbFgColor = bcolor; -// evnt.Window.DrawRectangle (gc, true, rect.X, rect.Y, rect.Width, rect.Height); -// gc.Dispose (); -// } -// } -// -// } -// base.OnExposeEvent (evnt); -// -// using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) { -// cr.SetSourceColor (BorderColor.ToCairoColor ()); -// -// double y = rect.Y + topMargin / 2d; -// cr.LineWidth = topMargin; -// cr.Line (rect.X, y, right, y); -// cr.Stroke (); -// -// y = bottom - bottomMargin / 2d; -// cr.LineWidth = bottomMargin; -// cr.Line (rect.X, y, right, y); -// cr.Stroke (); -// -// double x = rect.X + leftMargin / 2d; -// cr.LineWidth = leftMargin; -// cr.Line (x, rect.Y, x, bottom); -// cr.Stroke (); -// -// x = right - rightMargin / 2d; -// cr.LineWidth = rightMargin; -// cr.Line (x, rect.Y, x, bottom); -// cr.Stroke (); -// -// return false; -// } -// } + protected override bool OnDrawn (Context cr) + { + + Gdk.Rectangle rect = Allocation; + + //Gdk.Rectangle.Right and Bottom are inconsistent + int right = rect.X + rect.Width, bottom = rect.Y + rect.Height; + + var bcolor = backgroundColorSet ? BackgroundColor : StyleContext.GetColor (Gtk.StateFlags.Normal).ToGdkColor (); + + if (GradientBackround) { + cr.NewPath (); + cr.MoveTo (rect.X, rect.Y); + cr.RelLineTo (rect.Width, 0); + cr.RelLineTo (0, rect.Height); + cr.RelLineTo (-rect.Width, 0); + cr.RelLineTo (0, -rect.Height); + cr.ClosePath (); + + // FIXME: VV: Remove gradient features + using (Cairo.Gradient pat = new Cairo.LinearGradient (rect.X, rect.Y, rect.X, bottom)) { + pat.AddColorStop (0, bcolor.ToCairoColor ()); + Xwt.Drawing.Color gcol = bcolor.ToXwtColor (); + gcol.Light -= 0.1; + if (gcol.Light < 0) + gcol.Light = 0; + pat.AddColorStop (1, gcol.ToCairoColor ()); + cr.SetSource (pat); + cr.Fill (); + } + } else { + if (backgroundColorSet) { + cr.Save (); + cr.Rectangle (rect.X, rect.Y, rect.Width, rect.Height); + cr.SetSourceColor (bcolor.ToCairoColor ()); + cr.Fill (); + cr.Restore (); + } + } + + base.OnDrawn (cr); + + cr.SetSourceColor (BorderColor.ToCairoColor ()); + + double y = rect.Y + topMargin / 2d; + cr.LineWidth = topMargin; + cr.Line (rect.X, y, right, y); + cr.Stroke (); + + y = bottom - bottomMargin / 2d; + cr.LineWidth = bottomMargin; + cr.Line (rect.X, y, right, y); + cr.Stroke (); + + double x = rect.X + leftMargin / 2d; + cr.LineWidth = leftMargin; + cr.Line (x, rect.Y, x, bottom); + cr.Stroke (); + + x = right - rightMargin / 2d; + cr.LineWidth = rightMargin; + cr.Line (x, rect.Y, x, bottom); + cr.Stroke (); + + return false; + + } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs index 23de71b53d8..a520add8387 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs @@ -30,6 +30,7 @@ using System; using MonoDevelop.Ide.Gui; using System.Linq; +using Cairo; using MonoDevelop.Core; using MonoDevelop.Ide; using MonoDevelop.Components; @@ -739,78 +740,80 @@ protected override void OnSizeAllocated (Gdk.Rectangle rect) } } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// if (VisualStyle.TabStyle == DockTabStyle.Normal) -// DrawAsBrowser (evnt); -// else -// DrawNormal (evnt); -// -// if (HasFocus) { -// var alloc = labelWidget.Allocation; -// Gtk.Style.PaintFocus (Style, GdkWindow, State, alloc, this, "label", -// alloc.X, alloc.Y, alloc.Width, alloc.Height); -// } -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Context cr) + { + if (VisualStyle.TabStyle == DockTabStyle.Normal) + DrawAsBrowser (cr); + else + DrawNormal (cr); + + if (HasFocus) { + var alloc = labelWidget.Allocation; + StyleContext.RenderFocus (cr, alloc.X, alloc.Y, alloc.Width, alloc.Height); + } + + return base.OnDrawn (cr); + } - void DrawAsBrowser (Gdk.EventExpose evnt) + void DrawAsBrowser (Context ctx) { bool first = true; bool last = true; if (Parent is TabStrip.TabStripBox) { - var tsb = (TabStrip.TabStripBox) Parent; + var tsb = (TabStrip.TabStripBox)Parent; var cts = tsb.Children; first = cts[0] == this; last = cts[cts.Length - 1] == this; } - using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { - if (first && last) { - ctx.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); - ctx.SetSourceColor (VisualStyle.PadBackgroundColor.Value.ToCairoColor ()); - ctx.Fill (); - } else { - var image = Active ? dockTabActiveBackImage : dockTabBackImage; - image = image.WithSize (Allocation.Width, Allocation.Height); + ctx.Save (); + if (first && last) { + ctx.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); + ctx.SetSourceColor (VisualStyle.PadBackgroundColor.Value.ToCairoColor ()); + ctx.Fill (); + } else { + var image = Active ? dockTabActiveBackImage : dockTabBackImage; + image = image.WithSize (Allocation.Width, Allocation.Height); - ctx.DrawImage (this, image, Allocation.X, Allocation.Y); - } + ctx.DrawImage (this, image, Allocation.X, Allocation.Y); } + + ctx.Restore (); } - void DrawNormal (Gdk.EventExpose evnt) + void DrawNormal (Context ctx) { - using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { - var x = Allocation.X; - var y = Allocation.Y; + ctx.Save (); + var x = Allocation.X; + var y = Allocation.Y; - ctx.Rectangle (x, y + 1, Allocation.Width, Allocation.Height - 1); - ctx.SetSourceColor (Styles.DockBarBackground.ToCairoColor ()); + ctx.Rectangle (x, y + 1, Allocation.Width, Allocation.Height - 1); + ctx.SetSourceColor (Styles.DockBarBackground.ToCairoColor ()); + ctx.Fill (); + + /* + if (active) { + double offset = Allocation.Height * 0.25; + var rect = new Cairo.Rectangle (x - Allocation.Height + offset, y, Allocation.Height, Allocation.Height); + var cg = new Cairo.RadialGradient (rect.X + rect.Width / 2, rect.Y + rect.Height / 2, 0, rect.X, rect.Y + rect.Height / 2, rect.Height / 2); + cg.AddColorStop (0, Styles.DockTabBarShadowGradientStart); + cg.AddColorStop (1, Styles.DockTabBarShadowGradientEnd); + ctx.Pattern = cg; + ctx.Rectangle (rect); ctx.Fill (); - /* - if (active) { - double offset = Allocation.Height * 0.25; - var rect = new Cairo.Rectangle (x - Allocation.Height + offset, y, Allocation.Height, Allocation.Height); - var cg = new Cairo.RadialGradient (rect.X + rect.Width / 2, rect.Y + rect.Height / 2, 0, rect.X, rect.Y + rect.Height / 2, rect.Height / 2); - cg.AddColorStop (0, Styles.DockTabBarShadowGradientStart); - cg.AddColorStop (1, Styles.DockTabBarShadowGradientEnd); - ctx.Pattern = cg; - ctx.Rectangle (rect); - ctx.Fill (); - - rect = new Cairo.Rectangle (x + Allocation.Width - offset, y, Allocation.Height, Allocation.Height); - cg = new Cairo.RadialGradient (rect.X + rect.Width / 2, rect.Y + rect.Height / 2, 0, rect.X, rect.Y + rect.Height / 2, rect.Height / 2); - cg.AddColorStop (0, Styles.DockTabBarShadowGradientStart); - cg.AddColorStop (1, Styles.DockTabBarShadowGradientEnd); - ctx.Pattern = cg; - ctx.Rectangle (rect); - ctx.Fill (); - } - */ + rect = new Cairo.Rectangle (x + Allocation.Width - offset, y, Allocation.Height, Allocation.Height); + cg = new Cairo.RadialGradient (rect.X + rect.Width / 2, rect.Y + rect.Height / 2, 0, rect.X, rect.Y + rect.Height / 2, rect.Height / 2); + cg.AddColorStop (0, Styles.DockTabBarShadowGradientStart); + cg.AddColorStop (1, Styles.DockTabBarShadowGradientEnd); + ctx.Pattern = cg; + ctx.Rectangle (rect); + ctx.Fill (); } + */ + ctx.Restore (); + } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs index cc4f7f0a9a9..cf083c13da0 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs @@ -33,6 +33,7 @@ using System; using MonoDevelop.Ide.Gui; using System.Linq; +using Cairo; using MonoDevelop.Components.AtkCocoaHelper; using MonoDevelop.Core; using MonoDevelop.Ide; @@ -320,17 +321,17 @@ internal class TabStripBox: HBox public TabStrip TabStrip; static Xwt.Drawing.Image tabbarBackImage = Xwt.Drawing.Image.FromResource ("tabbar-back.9.png"); -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// if (TabStrip.VisualStyle.TabStyle == DockTabStyle.Normal) { -// using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { -// ctx.DrawImage (this, tabbarBackImage.WithSize (Allocation.Width, Allocation.Height), 0, 0); -// } -// } -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Context ctx) + { + if (TabStrip.VisualStyle.TabStyle == DockTabStyle.Normal) { + ctx.DrawImage (this, tabbarBackImage.WithSize (Allocation.Width, Allocation.Height), 0, 0); + + } + + return base.OnDrawn (ctx); + } } - + } } From a609d7883fceece4064f5c51b12d9fc93b05538a Mon Sep 17 00:00:00 2001 From: lytico Date: Wed, 24 Jan 2024 15:18:07 +0100 Subject: [PATCH 251/382] MonoDevelop.Ide: refactor some Expose -> Draw --- .../DockBarItem.cs | 104 +++++++++--------- 1 file changed, 54 insertions(+), 50 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs index d62716b4368..c57bab77f79 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs @@ -104,18 +104,18 @@ protected override void OnGetPreferredWidth (out int min_width, out int natural_ min_width = (int) primary.Width; } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// using (Cairo.Context context = Gdk.CairoHelper.Create (evnt.Window)) { -// if (secondaryOpacity < 1.0f) -// RenderIcon (context, primary, 1.0f - (float)Math.Pow (secondaryOpacity, 3.0f)); -// -// if (secondaryOpacity > 0.0f) -// RenderIcon (context, secondary, secondaryOpacity); -// } -// -// return false; -// } + protected override bool OnDrawn (Context context) + { + + if (secondaryOpacity < 1.0f) + RenderIcon (context, primary, 1.0f - (float)Math.Pow (secondaryOpacity, 3.0f)); + + if (secondaryOpacity > 0.0f) + RenderIcon (context, secondary, secondaryOpacity); + + + return false; + } void RenderIcon (Cairo.Context context, Xwt.Drawing.Image surface, double opacity) { @@ -539,44 +539,48 @@ protected override bool OnButtonReleaseEvent (Gdk.EventButton evnt) return true; } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { -// var alloc = Allocation; -// -// // TODO: VV: Remove preflight gradient features and replace with a flat color -// -// Cairo.LinearGradient lg; -// -// if (bar.Orientation == Orientation.Horizontal) { -// lg = new Cairo.LinearGradient (alloc.X, 0, alloc.X + alloc.Width, 0); -// } else { -// lg = new Cairo.LinearGradient (0, alloc.Y, 0, alloc.Y + alloc.Height); -// } -// -// using (lg) { -// Cairo.Color primaryColor = Styles.DockBarPrelightColor.ToCairoColor (); -// primaryColor.A = hoverProgress; -// -// Cairo.Color transparent = primaryColor; -// transparent.A = 0; -// -// lg.AddColorStop (0.0, transparent); -// lg.AddColorStop (0.35, primaryColor); -// lg.AddColorStop (0.65, primaryColor); -// lg.AddColorStop (1.0, transparent); -// -// context.Rectangle (alloc.ToCairoRect ()); -// context.SetSource (lg); -// } -// context.Fill (); -// } -// -// if (HasFocus) { -// Gtk.Style.PaintFocus (Style, GdkWindow, State, Allocation, this, "button", Allocation.X + 2, Allocation.Y + 2, Allocation.Width - 4, Allocation.Height - 4); -// } -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Context context) + { + context.Save (); + var alloc = Allocation; + + // TODO: VV: Remove preflight gradient features and replace with a flat color + + Cairo.LinearGradient lg; + + if (bar.Orientation == Orientation.Horizontal) { + lg = new Cairo.LinearGradient (alloc.X, 0, alloc.X + alloc.Width, 0); + } else { + lg = new Cairo.LinearGradient (0, alloc.Y, 0, alloc.Y + alloc.Height); + } + + using (lg) { + Cairo.Color primaryColor = Styles.DockBarPrelightColor.ToCairoColor (); + primaryColor.A = hoverProgress; + + Cairo.Color transparent = primaryColor; + transparent.A = 0; + + lg.AddColorStop (0.0, transparent); + lg.AddColorStop (0.35, primaryColor); + lg.AddColorStop (0.65, primaryColor); + lg.AddColorStop (1.0, transparent); + + context.Rectangle (alloc.ToCairoRect ()); + context.SetSource (lg); + } + + context.Fill (); + + if (HasFocus) { + StyleContext.RenderFocus (context, Allocation.X + 2, + Allocation.Y + 2, Allocation.Width - 4, Allocation.Height - 4); + } + + context.Restore (); + + return base.OnDrawn (context); + } protected override bool OnFocusInEvent (Gdk.EventFocus evnt) { From 7cb50552ac9bfd0f40c6a59d0b52c5e0540fdd6c Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 24 Jan 2024 19:13:35 +0100 Subject: [PATCH 252/382] update --- .../StatusArea.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs index cc4f1abc9f7..a8415b46273 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs @@ -327,17 +327,17 @@ public Widget CreateBuildResultsWidget (Orientation orientation) } - // using (var font = IdeServices.FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11)) { - // errors.Visible = ec > 0; - // errors.ModifyFont (font); - // errors.Text = ec.ToString (); - // errorImage.Visible = ec > 0; - - // warnings.Visible = wc > 0; - // warnings.ModifyFont (font); - // warnings.Text = wc.ToString (); - // warningImage.Visible = wc > 0; - // } + using (var font = IdeServices.FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11)) { + errors.Visible = ec > 0; + errors.ModifyFont (font); + errors.Text = ec.ToString (); + errorImage.Visible = ec > 0; + + warnings.Visible = wc > 0; + warnings.ModifyFont (font); + warnings.Text = wc.ToString (); + warningImage.Visible = wc > 0; + } ebox.Visible = ec > 0 || wc > 0; From 23b1c64bb04ad9796cc3a5262c9fb216fa7c5c71 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 24 Jan 2024 20:19:19 +0100 Subject: [PATCH 253/382] update --- .../StatusArea.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs index a8415b46273..cc4f1abc9f7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs @@ -327,17 +327,17 @@ public Widget CreateBuildResultsWidget (Orientation orientation) } - using (var font = IdeServices.FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11)) { - errors.Visible = ec > 0; - errors.ModifyFont (font); - errors.Text = ec.ToString (); - errorImage.Visible = ec > 0; - - warnings.Visible = wc > 0; - warnings.ModifyFont (font); - warnings.Text = wc.ToString (); - warningImage.Visible = wc > 0; - } + // using (var font = IdeServices.FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11)) { + // errors.Visible = ec > 0; + // errors.ModifyFont (font); + // errors.Text = ec.ToString (); + // errorImage.Visible = ec > 0; + + // warnings.Visible = wc > 0; + // warnings.ModifyFont (font); + // warnings.Text = wc.ToString (); + // warningImage.Visible = wc > 0; + // } ebox.Visible = ec > 0 || wc > 0; From dcd1055dbb33170b4f5eda14fb740d61d90e8be1 Mon Sep 17 00:00:00 2001 From: lytico Date: Fri, 26 Jan 2024 02:01:30 +0100 Subject: [PATCH 254/382] MonoDevelop.Ide MonoDevelop.Components.DockNotebook TabStrip: refactor Expose -> Draw --- .../TabStrip.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs index 65d18540a3e..08e2a5e33d8 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs @@ -1148,17 +1148,16 @@ void Draw (Context ctx) drawActive?.Invoke (ctx); if (HasFocus) { - //Gtk.Style.PaintFocus (Style, ctx, State, /*focusRect,*/ this, "tab", focusRect.X, focusRect.Y, focusRect.Width, focusRect.Height); + StyleContext.RenderFocus (ctx, focusRect.X, focusRect.Y, focusRect.Width, focusRect.Height); } } -// protected override bool OnExposeEvent (EventExpose evnt) -// { -// using (var context = CairoHelper.Create (evnt.Window)) { -// Draw (context); -// } -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Context cr) + { + Draw (cr); + + return base.OnDrawn (cr); + } void DrawTab (Context ctx, DockNotebookTab tab, Gdk.Rectangle allocation, Gdk.Rectangle tabBounds, bool highlight, bool active, bool dragging, Pango.Layout la, bool focused) { @@ -1269,7 +1268,7 @@ static void DrawTabBackground (Widget widget, Context ctx, Gdk.Rectangle allocat Pango.Layout CreateSizedLayout (bool active) { var la = new Pango.Layout (PangoContext); - //la.FontDescription = IdeServices.FontService.SansFont.Copy (); + la.FontDescription = IdeServices.FontService.SansFont.Copy (); if (!Core.Platform.IsWindows) la.FontDescription.Weight = Pango.Weight.Bold; la.FontDescription.AbsoluteSize = Pango.Units.FromPixels (VerticalTextSize); From 91ee4676aa5c0f6c7ac26b7a4a572a4976894349 Mon Sep 17 00:00:00 2001 From: lytico Date: Fri, 26 Jan 2024 02:17:08 +0100 Subject: [PATCH 255/382] MonoDevelop.Ide MonoDevelop.Components.DockNotebook PlaceholderWindow.cs: refactor Expose -> Draw --- .../PlaceholderWindow.cs | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs index 9af8d805eb2..63ff6d67724 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs @@ -32,7 +32,9 @@ using MonoDevelop.Ide.Gui; using System; using System.Linq; +using Cairo; using MonoDevelop.Ide.Gui.Shell; +using Rectangle = Gdk.Rectangle; namespace MonoDevelop.Components.DockNotebook { @@ -82,7 +84,7 @@ public PlaceholderWindow (DockNotebookTab tab): base (Gtk.WindowType.Toplevel) titleWindow.FocusOutEvent += delegate { timeout = GLib.Timeout.Add (100, () => { timeout = 0; - titleWindow.Close (); + titleWindow.ClosePlaceholder (); return false; }); }; @@ -236,7 +238,7 @@ protected override bool OnFocusOutEvent (EventFocus evt) { timeout = GLib.Timeout.Add (100, () => { timeout = 0; - titleWindow.Close (); + titleWindow.ClosePlaceholder (); return false; }); @@ -248,18 +250,20 @@ protected override void OnRealized () base.OnRealized (); GdkWindow.Opacity = 0.4; } -// protected override bool OnExposeEvent (EventExpose evnt) -// { -// int w, h; -// GetSize (out w, out h); -// -// using (var ctx = CairoHelper.Create (evnt.Window)) { -// ctx.SetSourceColor (new Cairo.Color (0.17, 0.55, 0.79)); -// ctx.Rectangle (Allocation.ToCairoRect ()); -// ctx.Fill (); -// } -// return true; -// } + + protected override bool OnDrawn (Context ctx) + { + + GetSize (out var w, out int h); + + ctx.Save (); + ctx.SetSourceColor (new Cairo.Color (0.17, 0.55, 0.79)); + ctx.Rectangle (Allocation.ToCairoRect ()); + ctx.Fill (); + ctx.Restore (); + + return true; + } public void Relocate (int x, int y, int w, int h, bool animate) { @@ -437,7 +441,7 @@ public bool ControlPressed { protected override bool OnKeyPressEvent (EventKey evnt) { if (evnt.Key == Gdk.Key.Escape) - Close (); + ClosePlaceholder (); if (evnt.Key == Gdk.Key.Control_L) controlKeyMask |= 1; if (evnt.Key == Gdk.Key.Control_R) @@ -461,17 +465,17 @@ protected override bool OnKeyReleaseEvent (EventKey evnt) protected override bool OnButtonReleaseEvent (EventButton evnt) { - Close (); + ClosePlaceholder (); return base.OnButtonReleaseEvent (evnt); } protected override bool OnLeaveNotifyEvent (EventCrossing evnt) { - Close (); + ClosePlaceholder (); return base.OnLeaveNotifyEvent (evnt); } - public void Close () + public void ClosePlaceholder () { Application.Invoke ((o, args) => { placeholder.Destroy (); From 9b7dbff98a73f5861ee9f4bdc106db5b72c8d4da Mon Sep 17 00:00:00 2001 From: lytico Date: Fri, 26 Jan 2024 03:48:21 +0100 Subject: [PATCH 256/382] Mono.TextEditor: remove some obsolete HelperMethods.cs --- .../Mono.TextEditor/HelperMethods.cs | 66 +++++++++---------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/HelperMethods.cs b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/HelperMethods.cs index d68e02c9696..5c7b50b1471 100644 --- a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/HelperMethods.cs +++ b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/HelperMethods.cs @@ -1,5 +1,5 @@ // HelperMethods.cs -// +// // Cut & paste from PangoCairoHelper. // // Author: @@ -40,21 +40,21 @@ static class HelperMethods { public static T Kill(this T gc) where T : IDisposable { - if (gc != null) + if (gc != null) gc.Dispose (); return default(T); } - + public static T Kill(this T gc, Action action) where T : IDisposable { if (gc != null) { action (gc); gc.Dispose (); } - + return default(T); } - + /* [DllImport(PangoUtil.LIBPANGOCAIRO, CallingConvention=CallingConvention.Cdecl)] static extern void pango_cairo_show_layout (IntPtr cr, IntPtr layout); @@ -64,45 +64,41 @@ public static void ShowLayout (this Cairo.Context cr, Pango.Layout layout) pango_cairo_show_layout (cr == null ? IntPtr.Zero : cr.Handle, layout == null ? IntPtr.Zero : layout.Handle); } */ - [DllImport(PangoUtil.LIBPANGOCAIRO, CallingConvention=CallingConvention.Cdecl)] - static extern IntPtr pango_cairo_create_layout (IntPtr cr); - public static Pango.Layout CreateLayout (this Cairo.Context cr) { - IntPtr raw_ret = pango_cairo_create_layout (cr == null ? IntPtr.Zero : cr.Handle); - return GLib.Object.GetObject (raw_ret, true) as Pango.Layout; + return Pango.CairoHelper.CreateLayout (cr); } - [DllImport(PangoUtil.LIBPANGOCAIRO, CallingConvention=CallingConvention.Cdecl)] - static extern void pango_cairo_layout_path (IntPtr cr, IntPtr layout); + // [DllImport(PangoUtil.LIBPANGOCAIRO, CallingConvention=CallingConvention.Cdecl)] + // static extern void pango_cairo_layout_path (IntPtr cr, IntPtr layout); + // + // public static void LayoutPath (this Cairo.Context cr, Pango.Layout layout) + // { + // pango_cairo_layout_path (cr == null ? IntPtr.Zero : cr.Handle, layout == null ? IntPtr.Zero : layout.Handle); + // } - public static void LayoutPath (this Cairo.Context cr, Pango.Layout layout) - { - pango_cairo_layout_path (cr == null ? IntPtr.Zero : cr.Handle, layout == null ? IntPtr.Zero : layout.Handle); - } + // [DllImport(PangoUtil.LIBPANGOCAIRO, CallingConvention=CallingConvention.Cdecl)] + // static extern void pango_cairo_context_set_resolution (IntPtr pango_context, double dpi); + // + // public static void ContextSetResolution (this Pango.Context context, double dpi) + // { + // pango_cairo_context_set_resolution (context == null ? IntPtr.Zero : context.Handle, dpi); + // } - [DllImport(PangoUtil.LIBPANGOCAIRO, CallingConvention=CallingConvention.Cdecl)] - static extern void pango_cairo_context_set_resolution (IntPtr pango_context, double dpi); - - public static void ContextSetResolution (this Pango.Context context, double dpi) - { - pango_cairo_context_set_resolution (context == null ? IntPtr.Zero : context.Handle, dpi); - } - - [DllImport(PangoUtil.LIBPANGOCAIRO, CallingConvention=CallingConvention.Cdecl)] - static extern IntPtr pango_layout_get_context (IntPtr layout); + // [DllImport(PangoUtil.LIBPANGOCAIRO, CallingConvention=CallingConvention.Cdecl)] + // static extern IntPtr pango_layout_get_context (IntPtr layout); public static string GetColorString (Gdk.Color color) { return string.Format ("#{0:X02}{1:X02}{2:X02}", color.Red / 256, color.Green / 256, color.Blue / 256); } - public static Pango.Context LayoutGetContext (this Pango.Layout layout) - { - IntPtr handle = pango_layout_get_context (layout.Handle); - return handle.Equals (IntPtr.Zero) ? null : GLib.Object.GetObject (handle) as Pango.Context; - } - + // public static Pango.Context LayoutGetContext (this Pango.Layout layout) + // { + // IntPtr handle = pango_layout_get_context (layout.Handle); + // return handle.Equals (IntPtr.Zero) ? null : GLib.Object.GetObject (handle) as Pango.Context; + // } + public static void DrawLine (this Cairo.Context cr, Cairo.Color color, double x1, double y1, double x2, double y2) { cr.SetSourceColor (color); @@ -110,19 +106,19 @@ public static void DrawLine (this Cairo.Context cr, Cairo.Color color, double x1 cr.LineTo (x2, y2); cr.Stroke (); } - + public static void Line (this Cairo.Context cr, double x1, double y1, double x2, double y2) { cr.MoveTo (x1, y1); cr.LineTo (x2, y2); } - + public static void SharpLineX (this Cairo.Context cr, double x1, double y1, double x2, double y2) { cr.MoveTo (x1 + 0.5, y1); cr.LineTo (x2 + 0.5, y2); } - + public static void SharpLineY (this Cairo.Context cr, double x1, double y1, double x2, double y2) { cr.MoveTo (x1, y1 + 0.5); From 84eaa032ffcd5e43970530db9146e2b4cea21f57 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 22 Feb 2024 16:57:26 +0100 Subject: [PATCH 257/382] remove notr used references --- main/msbuild/ReferencesGtk.props | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/main/msbuild/ReferencesGtk.props b/main/msbuild/ReferencesGtk.props index 8a0f003da35..18825291bc2 100644 --- a/main/msbuild/ReferencesGtk.props +++ b/main/msbuild/ReferencesGtk.props @@ -12,34 +12,6 @@ - - - - From 4434cf6e97981a41c610c7bb842e9dd522fa9ec1 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 23 Feb 2024 10:38:42 +0100 Subject: [PATCH 258/382] update welcome page --- .../WelcomePageListButton.cs | 88 +++++++++---------- .../WelcomePageTipOfTheDaySection.cs | 2 +- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs index 0083c9f6ab1..0f66dfe2ccd 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs @@ -29,7 +29,7 @@ using MonoDevelop.Core; using MonoDevelop.Components; using MonoDevelop.Components.AtkCocoaHelper; - +using Cairo; using Gtk; namespace MonoDevelop.Ide.WelcomePage @@ -331,61 +331,61 @@ protected virtual void DrawIcon (Cairo.Context ctx) } } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// using (var ctx = Gdk.CairoHelper.Create (evnt.Window)) { -// if (mouseOver) -// DrawHoverBackground (ctx); + protected override bool OnDrawn (Cairo.Context evnt) + { + using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { + if (mouseOver) + DrawHoverBackground (ctx); // // // Draw the icon -// DrawIcon (ctx); + DrawIcon (ctx); // // // Draw the text // -// int textWidth = Allocation.Width - LeftTextPadding - InternalPadding * 2; + int textWidth = Allocation.Width - LeftTextPadding - InternalPadding * 2; // -// using (var titleLayout = new Pango.Layout (PangoContext)) -// { -// titleLayout.Width = Pango.Units.FromPixels (textWidth); -// titleLayout.Ellipsize = Pango.EllipsizeMode.End; -// titleLayout.SetMarkup (WelcomePageSection.FormatText (TitleFontFace, TitleFontSize, Pango.Weight.Bold, MediumTitleColor, title)); + using (var titleLayout = new Pango.Layout (PangoContext)) + { + titleLayout.Width = Pango.Units.FromPixels (textWidth); + titleLayout.Ellipsize = Pango.EllipsizeMode.End; + titleLayout.SetMarkup (WelcomePageSection.FormatText (TitleFontFace, TitleFontSize, Pango.Weight.Bold, MediumTitleColor, title)); // -// Pango.Layout subtitleLayout = null; + Pango.Layout subtitleLayout = null; // -// if (!string.IsNullOrEmpty (subtitle)) -// { -// subtitleLayout = new Pango.Layout (PangoContext); -// subtitleLayout.Width = Pango.Units.FromPixels (textWidth); -// subtitleLayout.Ellipsize = Pango.EllipsizeMode.Start; -// subtitleLayout.SetMarkup (WelcomePageSection.FormatText (SmallTitleFontFace, SmallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, subtitle)); -// } + if (!string.IsNullOrEmpty (subtitle)) + { + subtitleLayout = new Pango.Layout (PangoContext); + subtitleLayout.Width = Pango.Units.FromPixels (textWidth); + subtitleLayout.Ellipsize = Pango.EllipsizeMode.Start; + subtitleLayout.SetMarkup (WelcomePageSection.FormatText (SmallTitleFontFace, SmallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, subtitle)); + } // -// int height = 0; -// int w, h1, h2; -// titleLayout.GetPixelSize (out w, out h1); -// height += h1; + int height = 0; + int w, h1, h2; + titleLayout.GetPixelSize (out w, out h1); + height += h1; // -// if (subtitleLayout != null) -// { -// height += Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TitleBottomMargin; -// subtitleLayout.GetPixelSize (out w, out h2); -// height += h2; -// } + if (subtitleLayout != null) + { + height += Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TitleBottomMargin; + subtitleLayout.GetPixelSize (out w, out h2); + height += h2; + } // -// int tx = Allocation.X + InternalPadding + LeftTextPadding; -// int ty = Allocation.Y + (Allocation.Height - height) / 2; -// DrawLayout (ctx, titleLayout, TitleFontFace, TitleFontSize, Pango.Weight.Bold, MediumTitleColor, tx, ty); + int tx = Allocation.X + InternalPadding + LeftTextPadding; + int ty = Allocation.Y + (Allocation.Height - height) / 2; + DrawLayout (ctx, titleLayout, TitleFontFace, TitleFontSize, Pango.Weight.Bold, MediumTitleColor, tx, ty); // -// if (subtitleLayout != null) -// { -// ty += h1 + Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TitleBottomMargin; -// DrawLayout (ctx, subtitleLayout, SmallTitleFontFace, SmallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, tx, ty); -// subtitleLayout.Dispose (); -// } -// } -// } -// return true; -// } + if (subtitleLayout != null) + { + ty += h1 + Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TitleBottomMargin; + DrawLayout (ctx, subtitleLayout, SmallTitleFontFace, SmallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, tx, ty); + subtitleLayout.Dispose (); + } + } + } + return true; + } protected override void OnDestroyed () { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageTipOfTheDaySection.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageTipOfTheDaySection.cs index 270455b27ee..91398ef9345 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageTipOfTheDaySection.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageTipOfTheDaySection.cs @@ -65,7 +65,7 @@ public WelcomePageTipOfTheDaySection (): base (GettextCatalog.GetString ("Did yo label.Xalign = 0; label.Wrap = true; label.WidthRequest = 200; - //label.ModifyFont (IdeServices.FontService.SansFont.CopyModified (Gui.Styles.FontScale11)); + label.ModifyFont (IdeServices.FontService.SansFont.CopyModified (Gui.Styles.FontScale11)); label.SetPadding (0, 10); label.Text = currentTip != -1 ? tips[currentTip] : ""; From f13cd120bc65914ea2728916fc24c4b711ab11b6 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 23 Feb 2024 15:43:12 +0100 Subject: [PATCH 259/382] update --- .../WelcomePageFirstRun.cs | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs index b2f58f04a43..9c8bf7eeeb0 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs @@ -288,32 +288,32 @@ Gdk.Size TextSize { } } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { -// context.Translate (Allocation.X, Allocation.Y); -// Gdk.Rectangle main = new Gdk.Rectangle (0, 0, Allocation.Width, Allocation.Height); -// context.CachedDraw (ref backgroundSurface, main, -// opacity: (float)BackgroundOpacity, -// draw: (ctx, opacity) => RenderBackground (ctx, main)); -// -// context.CachedDraw (ref titleSurface, RenderTitlePosition, TitleSize, new { Surface = backgroundSurface }, (float) TitleOpacity, (ctx, alpha) => { -// ctx.SetSourceSurface (backgroundSurface.Surface, -TitlePosition.X, -TitlePosition.Y); -// ctx.Rectangle (0, 0, TitleSize.Width, TitleSize.Height); -// ctx.Fill (); -// RenderTitle (ctx, new Gdk.Point (), alpha); -// }); -// context.CachedDraw (ref textSurface, RenderTextPosition, TextSize, new { Surface = backgroundSurface } , (float) TextOpacity, (ctx, alpha) => { -// ctx.SetSourceSurface (backgroundSurface.Surface, -TextPosition.X, -TextPosition.Y); -// ctx.Rectangle (0, 0, TextSize.Width, TextSize.Height); -// ctx.Fill (); -// RenderText (ctx, new Gdk.Point (), alpha); -// }); -// context.CachedDraw (ref buttonSurface, ButtonPosistion, ButtonSize, new { Hovered = ButtonHovered }, (float)ButtonOpacity, (ctx, alpha) => RenderButton (ctx, new Gdk.Point (), alpha, ButtonHovered)); -// RenderPreview (context, RenderIconPosition, IconOpacity); -// } -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + using (var context = Gdk.CairoHelper.Create (GdkWindow)) { + context.Translate (Allocation.X, Allocation.Y); + Gdk.Rectangle main = new Gdk.Rectangle (0, 0, Allocation.Width, Allocation.Height); + context.CachedDraw (ref backgroundSurface, main, + opacity: (float)BackgroundOpacity, + draw: (ctx, opacity) => RenderBackground (ctx, main)); + + context.CachedDraw (ref titleSurface, RenderTitlePosition, TitleSize, new { Surface = backgroundSurface }, (float) TitleOpacity, (ctx, alpha) => { + ctx.SetSourceSurface (backgroundSurface.Surface, -TitlePosition.X, -TitlePosition.Y); + ctx.Rectangle (0, 0, TitleSize.Width, TitleSize.Height); + ctx.Fill (); + RenderTitle (ctx, new Gdk.Point (), alpha); + }); + context.CachedDraw (ref textSurface, RenderTextPosition, TextSize, new { Surface = backgroundSurface } , (float) TextOpacity, (ctx, alpha) => { + ctx.SetSourceSurface (backgroundSurface.Surface, -TextPosition.X, -TextPosition.Y); + ctx.Rectangle (0, 0, TextSize.Width, TextSize.Height); + ctx.Fill (); + RenderText (ctx, new Gdk.Point (), alpha); + }); + context.CachedDraw (ref buttonSurface, ButtonPosistion, ButtonSize, new { Hovered = ButtonHovered }, (float)ButtonOpacity, (ctx, alpha) => RenderButton (ctx, new Gdk.Point (), alpha, ButtonHovered)); + RenderPreview (context, RenderIconPosition, IconOpacity); + } + return base.OnDrawn (evnt); + } protected override bool OnButtonReleaseEvent (Gdk.EventButton evnt) { From 0610950734a9c2619cf25ed175460f2961482448 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 23 Feb 2024 16:28:28 +0100 Subject: [PATCH 260/382] enable again --- .../MainToolbar.cs | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs index 72fad0d5834..fc65a634724 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs @@ -102,34 +102,34 @@ static bool RuntimeIsSeparator (ITreeModel model, TreeIter iter) return runtime == null || runtime.IsSeparator; } -// void RuntimeRenderCell (CellLayout layout, CellRenderer cell, ITreeModel model, TreeIter iter) -// { -// var runtime = (IRuntimeModel)model.GetValue (iter, 0); -// var renderer = (CellRendererText) cell; -// -// if (runtime == null || runtime.IsSeparator) { -// renderer.Xpad = (uint)0; -// return; -// } -// -// using (var mutableModel = runtime.GetMutableModel ()) { -// renderer.Visible = mutableModel.Visible; -// renderer.Sensitive = mutableModel.Enabled; -// renderer.Xpad = (uint)(runtime.IsIndented ? 18 : 3); -// -// if (!runtimeCombo.PopupShown) { -// // no need to ident text when the combo dropdown is not showing -// if (Platform.IsWindows) -// renderer.Xpad = 3; -// renderer.Text = mutableModel.FullDisplayString; -// renderer.Attributes = normalAttributes; -// } else { -// renderer.Text = mutableModel.DisplayString; -// renderer.Attributes = runtime.Notable ? boldAttributes : normalAttributes; -// } -// -// } -// } + void RuntimeRenderCell (/*CellLayout layout,*/ CellRenderer cell, ITreeModel model, TreeIter iter) + { + var runtime = (IRuntimeModel)model.GetValue (iter, 0); + var renderer = (CellRendererText) cell; + + if (runtime == null || runtime.IsSeparator) { + renderer.Xpad = (uint)0; + return; + } + + using (var mutableModel = runtime.GetMutableModel ()) { + renderer.Visible = mutableModel.Visible; + renderer.Sensitive = mutableModel.Enabled; + renderer.Xpad = (uint)(runtime.IsIndented ? 18 : 3); + + if (!runtimeCombo.PopupShown) { + // no need to ident text when the combo dropdown is not showing + if (Platform.IsWindows) + renderer.Xpad = 3; + renderer.Text = mutableModel.FullDisplayString; + renderer.Attributes = normalAttributes; + } else { + renderer.Text = mutableModel.DisplayString; + renderer.Attributes = runtime.Notable ? boldAttributes : normalAttributes; + } + + } + } TreeIter lastSelection = TreeIter.Zero; public MainToolbar () From 84025818a0a5d0b5d956498fe75791027070b387 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 23 Feb 2024 18:20:39 +0100 Subject: [PATCH 261/382] update --- .../MainToolbar.cs | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs index fc65a634724..2f7987a636b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs @@ -378,38 +378,38 @@ public void AddWidget (Gtk.Widget widget) contentBox.PackStart (widget, false, false, 0); } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { -// context.Rectangle ( -// evnt.Area.X, -// evnt.Area.Y, -// evnt.Area.Width, -// evnt.Area.Height -// ); -// context.Clip (); -// context.LineWidth = 1; -// if (Background != null && Background.Width > 0) { -// for (int x=0; x < Allocation.Width; x += Background.Width) { -// Background.Show (context, x, -TitleBarHeight); -// } -// } else { -// context.Rectangle (0, 0, Allocation.Width, Allocation.Height); -// using (var lg = new LinearGradient (0, 0, 0, Allocation.Height)) { -// lg.AddColorStop (0, Style.Light (StateType.Normal).ToCairoColor ()); -// lg.AddColorStop (1, Style.Mid (StateType.Normal).ToCairoColor ()); -// context.SetSource (lg); -// } -// context.Fill (); -// -// } -// context.MoveTo (0, Allocation.Height - 0.5); -// context.RelLineTo (Allocation.Width, 0); -// context.SetSourceColor (Styles.ToolbarBottomBorderColor.ToCairoColor ()); -// context.Stroke (); -// } -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + using (var context = Gdk.CairoHelper.Create (GdkWindow)) { + //context.Rectangle ( + // evnt.Area.X, + // evnt.Area.Y, + // evnt.Area.Width, + // evnt.Area.Height + //); + context.Clip (); + context.LineWidth = 1; + if (Background != null && Background.Width > 0) { + for (int x=0; x < Allocation.Width; x += Background.Width) { + Background.Show (context, x, -TitleBarHeight); + } + } else { + context.Rectangle (0, 0, Allocation.Width, Allocation.Height); + using (var lg = new LinearGradient (0, 0, 0, Allocation.Height)) { + //lg.AddColorStop (0, Style.Light (StateType.Normal).ToCairoColor ()); + //lg.AddColorStop (1, Style.Mid (StateType.Normal).ToCairoColor ()); + context.SetSource (lg); + } + context.Fill (); + + } + context.MoveTo (0, Allocation.Height - 0.5); + context.RelLineTo (Allocation.Width, 0); + context.SetSourceColor (Styles.ToolbarBottomBorderColor.ToCairoColor ()); + context.Stroke (); + } + return base.OnDrawn (evnt); + } void HandleStartButtonClicked (object sender, EventArgs e) { From 8afd4080cb445d9abbc47375847c0ac942e7d5aa Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 23 Feb 2024 18:29:00 +0100 Subject: [PATCH 262/382] update --- .../ButtonBar.cs | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ButtonBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ButtonBar.cs index 0b4c702ff30..27756a03269 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ButtonBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ButtonBar.cs @@ -186,36 +186,36 @@ protected override void OnGetPreferredWidth (out int min_width, out int natural_ min_width = VisibleButtons.Sum (b => b.Visible ? (!b.IsSeparator ? (int)btnNormalOriginal[0].Width : SeparatorSpacing) : 0); } -// protected override bool OnExposeEvent (EventExpose evnt) -// { -// ScaleImages (Allocation.Height); -// -// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { -// double x = Allocation.X, y = Allocation.Y; -// for (int i = 0; i < VisibleButtons.Length; i++) { -// bool nextIsSeparator = (i < VisibleButtons.Length - 1 && VisibleButtons[i + 1].IsSeparator) || i == VisibleButtons.Length - 1; -// bool lastWasSeparator = (i > 0 && VisibleButtons[i - 1].IsSeparator) || i == 0; -// IButtonBarButton button = VisibleButtons [i]; -// if (button.IsSeparator) { -// if (!lastWasSeparator) -// x += SeparatorSpacing; -// continue; -// } -// Xwt.Drawing.Image[] images = State == StateType.Selected && pushedButton == button ? btnPressed : btnNormal; -// Xwt.Drawing.Image img = images [lastWasSeparator ? 0 : nextIsSeparator ? 2 : 1]; -// context.DrawImage (this, img, x, y); -// -// allocations [button] = new Gdk.Rectangle ((int)x, (int)y, (int)img.Width, (int)img.Height); -// -// var icon = ImageService.GetIcon (button.Image, IconSize.Menu); -// if (!Sensitive || !button.Enabled) -// icon = icon.WithAlpha (0.4); -// context.DrawImage (this, icon, Math.Truncate (x + (img.Width - icon.Width) / 2), Math.Truncate (y + (img.Height - icon.Height) / 2)); -// x += img.Width; -// } -// } -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + ScaleImages (Allocation.Height); + + using (var context = Gdk.CairoHelper.Create (GdkWindow)) { + double x = Allocation.X, y = Allocation.Y; + for (int i = 0; i < VisibleButtons.Length; i++) { + bool nextIsSeparator = (i < VisibleButtons.Length - 1 && VisibleButtons[i + 1].IsSeparator) || i == VisibleButtons.Length - 1; + bool lastWasSeparator = (i > 0 && VisibleButtons[i - 1].IsSeparator) || i == 0; + IButtonBarButton button = VisibleButtons [i]; + if (button.IsSeparator) { + if (!lastWasSeparator) + x += SeparatorSpacing; + continue; + } + Xwt.Drawing.Image[] images = State == StateType.Selected && pushedButton == button ? btnPressed : btnNormal; + Xwt.Drawing.Image img = images [lastWasSeparator ? 0 : nextIsSeparator ? 2 : 1]; + context.DrawImage (this, img, x, y); + + allocations [button] = new Gdk.Rectangle ((int)x, (int)y, (int)img.Width, (int)img.Height); + + var icon = ImageService.GetIcon (button.Image, IconSize.Menu); + if (!Sensitive || !button.Enabled) + icon = icon.WithAlpha (0.4); + context.DrawImage (this, icon, Math.Truncate (x + (img.Width - icon.Width) / 2), Math.Truncate (y + (img.Height - icon.Height) / 2)); + x += img.Width; + } + } + return base.OnDrawn (evnt); + } Xwt.Drawing.Image ExpandImageVertically (Xwt.Drawing.Image img, int newHeight) { From 46baa48ef771ed45a8ab62fb294c8791aba06066 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 23 Feb 2024 18:42:48 +0100 Subject: [PATCH 263/382] update --- .../StatusArea.cs | 82 +++++++++---------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs index cc4f1abc9f7..97be31668af 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs @@ -327,17 +327,17 @@ public Widget CreateBuildResultsWidget (Orientation orientation) } - // using (var font = IdeServices.FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11)) { - // errors.Visible = ec > 0; - // errors.ModifyFont (font); - // errors.Text = ec.ToString (); - // errorImage.Visible = ec > 0; - - // warnings.Visible = wc > 0; - // warnings.ModifyFont (font); - // warnings.Text = wc.ToString (); - // warningImage.Visible = wc > 0; - // } + using (var font = IdeServices.FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11)) { + errors.Visible = ec > 0; + errors.ModifyFont (font); + errors.Text = ec.ToString (); + errorImage.Visible = ec > 0; + + warnings.Visible = wc > 0; + warnings.ModifyFont (font); + warnings.Text = wc.ToString (); + warningImage.Visible = wc > 0; + } ebox.Visible = ec > 0 || wc > 0; @@ -397,18 +397,18 @@ protected override void OnGetPreferredHeight (out int min_height, out int natura base.OnGetPreferredHeight (out min_height, out natural_height); } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { -// renderArg.Allocation = Allocation; -// renderArg.ChildAllocation = messageBox.Allocation; -// renderArg.MousePosition = tracker.MousePosition; -// renderArg.Pango = PangoContext; -// -// theme.Render (context, renderArg, this); -// } -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + using (var context = Gdk.CairoHelper.Create (GdkWindow)) { + renderArg.Allocation = Allocation; + renderArg.ChildAllocation = messageBox.Allocation; + renderArg.MousePosition = tracker.MousePosition; + renderArg.Pango = PangoContext; + + theme.Render (context, renderArg, this); + } + return base.OnDrawn (evnt); + } #region StatusBar implementation @@ -899,24 +899,24 @@ public void SetCancellationTokenSource (CancellationTokenSource source) class StatusAreaSeparator: HBox { -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// using (var ctx = Gdk.CairoHelper.Create (this.GdkWindow)) { -// var alloc = Allocation; -// //alloc.Inflate (0, -2); -// ctx.Rectangle (alloc.X, alloc.Y, 1, alloc.Height); -// -// // FIXME: VV: Remove gradient features -// using (Cairo.LinearGradient gr = new LinearGradient (alloc.X, alloc.Y, alloc.X, alloc.Y + alloc.Height)) { -// gr.AddColorStop (0, new Cairo.Color (0, 0, 0, 0)); -// gr.AddColorStop (0.5, new Cairo.Color (0, 0, 0, 0.2)); -// gr.AddColorStop (1, new Cairo.Color (0, 0, 0, 0)); -// ctx.SetSource (gr); -// ctx.Fill (); -// } -// } -// return true; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + using (var ctx = Gdk.CairoHelper.Create (this.GdkWindow)) { + var alloc = Allocation; + //alloc.Inflate (0, -2); + ctx.Rectangle (alloc.X, alloc.Y, 1, alloc.Height); + + // FIXME: VV: Remove gradient features + using (Cairo.LinearGradient gr = new LinearGradient (alloc.X, alloc.Y, alloc.X, alloc.Y + alloc.Height)) { + gr.AddColorStop (0, new Cairo.Color (0, 0, 0, 0)); + gr.AddColorStop (0.5, new Cairo.Color (0, 0, 0, 0.2)); + gr.AddColorStop (1, new Cairo.Color (0, 0, 0, 0)); + ctx.SetSource (gr); + ctx.Fill (); + } + } + return true; + } protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { From 8312d4459909cd4300a6866b88842914d47ef34c Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 23 Feb 2024 18:50:03 +0100 Subject: [PATCH 264/382] update --- .../StyledProgressBar.cs | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StyledProgressBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StyledProgressBar.cs index 20af136d6c2..35ece860938 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StyledProgressBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StyledProgressBar.cs @@ -60,24 +60,24 @@ public StyledProgressBar () const int height = 14; -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// if (!showProgress) -// return base.OnExposeEvent (evnt); -// using (var ctx = Gdk.CairoHelper.Create (evnt.Window)) { -// ctx.LineWidth = 1; -// ctx.MoveTo (Allocation.X + 0.5, Allocation.Y + 0.5); -// ctx.RelLineTo (Allocation.Width, 0); -// ctx.SetSourceRGB (0.8, 0.8, 0.8); -// ctx.Stroke (); -// -// ctx.MoveTo (Allocation.X + 0.5, Allocation.Y + 0.5); -// ctx.RelLineTo ((double)Allocation.Width * fraction, 0); -// ctx.SetSourceRGB (0.1, 0.1, 0.1); -// ctx.Stroke (); -// } -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + if (!showProgress) + return base.OnDrawn (evnt); + using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { + ctx.LineWidth = 1; + ctx.MoveTo (Allocation.X + 0.5, Allocation.Y + 0.5); + ctx.RelLineTo (Allocation.Width, 0); + ctx.SetSourceRGB (0.8, 0.8, 0.8); + ctx.Stroke (); + + ctx.MoveTo (Allocation.X + 0.5, Allocation.Y + 0.5); + ctx.RelLineTo ((double)Allocation.Width * fraction, 0); + ctx.SetSourceRGB (0.1, 0.1, 0.1); + ctx.Stroke (); + } + return base.OnDrawn (evnt); + } } } From 482d512a5ad2a56b6f8222bdacabcfe593262e6c Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 23 Feb 2024 18:58:04 +0100 Subject: [PATCH 265/382] update --- .../RoundButton.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/RoundButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/RoundButton.cs index c8711867de2..6bf5499dfb3 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/RoundButton.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/RoundButton.cs @@ -148,15 +148,15 @@ public OperationIcon Icon { } } -// protected override bool OnExposeEvent (EventExpose evnt) -// { -// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { -// DrawBackground (context, Allocation, 15, State); -// var icon = GetIcon(); -// context.DrawImage (this, icon, Allocation.X + Math.Max (0, (Allocation.Width - icon.Width) / 2), Allocation.Y + Math.Max (0, (Allocation.Height - icon.Height) / 2)); -// } -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + using (var context = Gdk.CairoHelper.Create (GdkWindow)) { + DrawBackground (context, Allocation, 15, State); + var icon = GetIcon(); + context.DrawImage (this, icon, Allocation.X + Math.Max (0, (Allocation.Width - icon.Width) / 2), Allocation.Y + Math.Max (0, (Allocation.Height - icon.Height) / 2)); + } + return base.OnDrawn (evnt); + } void DrawBackground (Cairo.Context context, Gdk.Rectangle region, int radius, StateType state) { From 71fcd3dbc0c50a048b86fa6b09eadd7ad8b2eb87 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 23 Feb 2024 23:07:57 +0100 Subject: [PATCH 266/382] update --- .../MonoDevelop.Ide.Gui/DocumentSwitcher.cs | 213 +++++++++--------- 1 file changed, 107 insertions(+), 106 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs index 874f5609bc2..3482cf7cd5b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs @@ -32,6 +32,7 @@ using System.Linq; using Gdk; using Gtk; +using Cairo; using MonoDevelop.Ide.Gui; using MonoDevelop.Core; using MonoDevelop.Components; @@ -161,102 +162,102 @@ static string Ellipsize (string str, int maxLength) } const int upperGradientHeight = 16; -// protected override bool OnExposeEvent (Gdk.EventExpose e) -// { -// -// using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { -// double xPos = padding, yPos = padding; -// var layout = PangoUtil.CreateLayout (this); -// int w, h; -// layout.SetText (new string ('X', maxLength)); -// layout.GetPixelSize (out w, out h); -// -// foreach (Category cat in categories) { -// yPos = padding; -// cr.MoveTo (xPos, yPos); -// layout.SetMarkup ("" + cat.Title + ""); -// cr.SetSourceColor (Style.Text (StateType.Normal).ToCairoColor ()); -// cr.ShowLayout (layout); -// -// if (cat.Items.Count == 0) -// continue; -// -// layout.SetMarkup (""); -// int w2, h2; -// layout.GetPixelSize (out w2, out h2); -// yPos += h2; -// yPos += headerDistance; -// var startY = yPos; -// int curItem = 0; -// int row = 0; -// var iconHeight = Math.Max (h, cat.Items [0].Icon.Height + 2) + itemPadding * 2; -// if (cat.FirstVisibleItem > 0) { -// Gtk.Style.PaintArrow (Style, e.Window, State, ShadowType.None, -// new Rectangle ((int)xPos, (int)yPos, w, h), -// this, -// "", -// ArrowType.Up, -// true, -// (int)xPos, -// (int)yPos, -// w, -// h); -// yPos += iconHeight; -// curItem++; -// } -// -// for (int i = cat.FirstVisibleItem; i < cat.Items.Count; i++) { -// var item = cat.Items [i]; -// -// if (curItem + 1 >= maxItems && row + 1 >= maxRows && i + 1 < cat.Items.Count) { -// Gtk.Style.PaintArrow (Style, e.Window, State, ShadowType.None, -// new Rectangle ((int)xPos, (int)yPos, w, h), -// this, -// "", -// ArrowType.Down, -// true, -// (int)xPos, -// (int)yPos, -// w, -// h); -// break; -// } -// -// if (item == ActiveItem) { -// int itemWidth = w + (int)item.Icon.Width + 2 + itemPadding * 2; -// cr.Rectangle (xPos, yPos, itemWidth, iconHeight); -// cr.LineWidth = 1; -// cr.SetSourceColor (Style.Base (StateType.Selected).ToCairoColor ()); -// cr.Fill (); -// } else if (item == hoverItem) { -// int itemWidth = w + (int)item.Icon.Width + 2 + itemPadding * 2; -// cr.Rectangle (xPos + 0.5, yPos + 0.5, itemWidth - 1, iconHeight); -// cr.LineWidth = 1; -// cr.SetSourceColor (Style.Base (StateType.Selected).ToCairoColor ()); -// cr.Stroke (); -// } -// cr.SetSourceColor (Style.Text (item == ActiveItem? StateType.Selected : StateType.Normal).ToCairoColor ()); -// cr.MoveTo (xPos + item.Icon.Width + 2 + itemPadding, yPos + (iconHeight - h) / 2); -// layout.SetText (Ellipsize (item.ListTitle ?? item.Title, maxLength)); -// cr.ShowLayout (layout); -// cr.DrawImage (this, item == ActiveItem ? item.Icon.WithStyles ("sel") : item.Icon, (int)xPos + itemPadding, -// (int)(yPos + (iconHeight - item.Icon.Height) / 2)); -// yPos += iconHeight; -// if (++curItem >= maxItems) { -// curItem = 0; -// yPos = startY; -// xPos += w + cat.Items [0].Icon.Width + 2 + padding + itemPadding * 2; -// row++; -// } -// } -// -// -// xPos += w + cat.Items [0].Icon.Width + 2 + padding + itemPadding * 2; -// } -// layout.Dispose (); -// } -// return true; -// } + protected override bool OnDrawn (Cairo.Context e) + { + + using (Cairo.Context cr = Gdk.CairoHelper.Create (GdkWindow)) { + double xPos = padding, yPos = padding; + var layout = PangoUtil.CreateLayout (this); + int w, h; + layout.SetText (new string ('X', maxLength)); + layout.GetPixelSize (out w, out h); + + foreach (Category cat in categories) { + yPos = padding; + cr.MoveTo (xPos, yPos); + layout.SetMarkup ("" + cat.Title + ""); + //cr.SetSourceColor (Style.Text (StateType.Normal).ToCairoColor ()); + cr.ShowLayout (layout); + + if (cat.Items.Count == 0) + continue; + + layout.SetMarkup (""); + int w2, h2; + layout.GetPixelSize (out w2, out h2); + yPos += h2; + yPos += headerDistance; + var startY = yPos; + int curItem = 0; + int row = 0; + var iconHeight = Math.Max (h, cat.Items [0].Icon.Height + 2) + itemPadding * 2; + // if (cat.FirstVisibleItem > 0) { + // Gtk.Style.PaintArrow (Style, e.GdkWindow, State, ShadowType.None, + // new Gdk.Rectangle ((int)xPos, (int)yPos, w, h), + // this, + // "", + // ArrowType.Up, + // true, + // (int)xPos, + // (int)yPos, + // w, + // h); + // yPos += iconHeight; + // curItem++; + // } + + for (int i = cat.FirstVisibleItem; i < cat.Items.Count; i++) { + var item = cat.Items [i]; + + // if (curItem + 1 >= maxItems && row + 1 >= maxRows && i + 1 < cat.Items.Count) { + // Gtk.Style.PaintArrow (Style, e.GdkWindow, State, ShadowType.None, + // new Gdk.Rectangle ((int)xPos, (int)yPos, w, h), + // this, + // "", + // ArrowType.Down, + // true, + // (int)xPos, + // (int)yPos, + // w, + // h); + // break; + // } + + if (item == ActiveItem) { + int itemWidth = w + (int)item.Icon.Width + 2 + itemPadding * 2; + cr.Rectangle (xPos, yPos, itemWidth, iconHeight); + cr.LineWidth = 1; + cr.SetSourceColor (Style.Base (StateType.Selected).ToCairoColor ()); + cr.Fill (); + } else if (item == hoverItem) { + int itemWidth = w + (int)item.Icon.Width + 2 + itemPadding * 2; + cr.Rectangle (xPos + 0.5, yPos + 0.5, itemWidth - 1, iconHeight); + cr.LineWidth = 1; + cr.SetSourceColor (Style.Base (StateType.Selected).ToCairoColor ()); + cr.Stroke (); + } + //cr.SetSourceColor (Style.Text (item == ActiveItem? StateType.Selected : StateType.Normal).ToCairoColor ()); + cr.MoveTo (xPos + item.Icon.Width + 2 + itemPadding, yPos + (iconHeight - h) / 2); + layout.SetText (Ellipsize (item.ListTitle ?? item.Title, maxLength)); + cr.ShowLayout (layout); + cr.DrawImage (this, item == ActiveItem ? item.Icon.WithStyles ("sel") : item.Icon, (int)xPos + itemPadding, + (int)(yPos + (iconHeight - item.Icon.Height) / 2)); + yPos += iconHeight; + if (++curItem >= maxItems) { + curItem = 0; + yPos = startY; + xPos += w + cat.Items [0].Icon.Width + 2 + padding + itemPadding * 2; + row++; + } + } + + + xPos += w + cat.Items [0].Icon.Width + 2 + padding + itemPadding * 2; + } + layout.Dispose (); + } + return true; + } protected override bool OnKeyPressEvent (EventKey evnt) { @@ -804,15 +805,15 @@ protected override void OnDestroyed () IdeApp.CommandService.IsEnabled = true; } -// protected override bool OnExposeEvent (EventExpose evnt) -// { -// base.OnExposeEvent (evnt); -// -// int winWidth, winHeight; -// this.GetSize (out winWidth, out winHeight); -// -// this.GdkWindow.DrawRectangle (this.Style.ForegroundGC (StateType.Insensitive), false, 0, 0, winWidth - 1, winHeight - 1); -// return false; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + base.OnDrawn (evnt); + + int winWidth, winHeight; + this.GetSize (out winWidth, out winHeight); + + //this.GdkWindow.DrawRectangle (this.Style.ForegroundGC (StateType.Insensitive), false, 0, 0, winWidth - 1, winHeight - 1); + return false; + } } } From 258db2a984bf2c20afb61f5314c5d7e970c3aa0d Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 23 Feb 2024 23:17:54 +0100 Subject: [PATCH 267/382] update --- .../MonoDevelopStatusBar.cs | 72 ++++--------------- 1 file changed, 15 insertions(+), 57 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs index 72111749b22..e0f014ffa27 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs @@ -28,6 +28,7 @@ using System; using Gtk; +using Cairo; using MonoDevelop.Ide.Gui; using MonoDevelop.Components.Docking; using MonoDevelop.Components; @@ -64,50 +65,7 @@ internal MonoDevelopStatusBar () hb.Add (mainBox); hb.ShowAll (); PackStart (hb, true, true, 0); - - // Feedback button - - //if (FeedbackService.Enabled) { - //CustomFrame fr = new CustomFrame (0, 0, 1, 0); - //fr.Accessible.Role = Atk.Role.Filler; - //var px = Xwt.Drawing.Image.FromResource ("feedback-16.png"); - //HBox b = new HBox (false, 3); - //b.Accessible.Role = Atk.Role.Filler; - - //var im = new Xwt.ImageView (px).ToGtkWidget (); - //im.Accessible.Role = Atk.Role.Filler; - //b.PackStart (im, false, true, 0); - //var label = new Gtk.Label (GettextCatalog.GetString ("Feedback")); - //label.Accessible.Role = Atk.Role.Filler; - //b.PackStart (label, false, true, 0); - //Gtk.Alignment al = new Gtk.Alignment (0f, 0f, 1f, 1f); - //al.Accessible.Role = Atk.Role.Filler; - //al.RightPadding = 5; - //al.LeftPadding = 3; - //al.Add (b); - //feedbackButton = new MiniButton (al); - //feedbackButton.Accessible.SetLabel (GettextCatalog.GetString ("Feedback")); - //feedbackButton.Accessible.Description = GettextCatalog.GetString ("Click to send feedback to the development team"); - - //feedbackButton.BackroundColor = new Gdk.Color (200, 200, 255); - //fr.Add (feedbackButton); - //mainBox.PackStart (fr, false, false, 0); - //feedbackButton.Clicked += HandleFeedbackButtonClicked; - //feedbackButton.ButtonPressEvent += HandleFeedbackButtonButtonPressEvent; - //; - //feedbackButton.ClickOnRelease = true; - // FeedbackService.FeedbackPositionGetter = delegate { - // int x, y; - // if (feedbackButton.GdkWindow != null) { - // feedbackButton.GdkWindow.GetOrigin (out x, out y); - // x += feedbackButton.Allocation.Width; - // y -= 6; - // } else { - // x = y = -1; - // } - // return new Gdk.Point (x, y); - // }; - //} + // Dock area CustomFrame dfr = new CustomFrame (0, 0, 1, 0); @@ -181,18 +139,18 @@ Gdk.Rectangle GetGripRect () return rect; } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// bool ret = base.OnExposeEvent (evnt); -// if (HasResizeGrip) { -// Gdk.Rectangle rect = GetGripRect (); -// int w = rect.Width - Style.Xthickness; -// int h = Allocation.Height - Style.YThickness; -// if (h < 18 - Style.YThickness) h = 18 - Style.YThickness; -// Gdk.WindowEdge edge = Direction == TextDirection.Ltr ? Gdk.WindowEdge.SouthEast : Gdk.WindowEdge.SouthWest; -// Gtk.Style.PaintResizeGrip (Style, GdkWindow, State, evnt.Area, this, "statusbar", edge, rect.X, rect.Y, w, h); -// } -// return ret; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + bool ret = base.OnDrawn (evnt); + if (HasResizeGrip) { + Gdk.Rectangle rect = GetGripRect (); + int w = rect.Width - Style.Xthickness; + //int h = Allocation.Height - Style.YThickness; + //if (h < 18 - Style.YThickness) h = 18 - Style.YThickness; + Gdk.WindowEdge edge = Direction == TextDirection.Ltr ? Gdk.WindowEdge.SouthEast : Gdk.WindowEdge.SouthWest; + //Gtk.Style.PaintResizeGrip (Style, GdkWindow, State, evnt.Area, this, "statusbar", edge, rect.X, rect.Y, w, h); + } + return ret; + } } } From 392008532c79f120d1b49fb2175cc2894df6233e Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 23 Feb 2024 23:33:47 +0100 Subject: [PATCH 268/382] update --- .../GtkDocumentToolbar.cs | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/GtkDocumentToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/GtkDocumentToolbar.cs index 23a3d96243a..01c3839433b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/GtkDocumentToolbar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/GtkDocumentToolbar.cs @@ -26,6 +26,7 @@ using System; using System.Linq; using Gtk; +using Cairo; using MonoDevelop.Components; using MonoDevelop.Components.AtkCocoaHelper; @@ -158,21 +159,21 @@ public ToolbarBox (float xa, float ya, float sx, float sy) : base (xa, ya, sx, s { } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { -// ctx.Rectangle (0, 0, Allocation.Width, Allocation.Height); -// ctx.SetSourceColor (Styles.BreadcrumbBackgroundColor.ToCairoColor ()); -// ctx.Fill (); -// -// ctx.MoveTo (0.5, Allocation.Height - 0.5); -// ctx.RelLineTo (Allocation.Width, 0); -// ctx.SetSourceColor (Styles.BreadcrumbBottomBorderColor.ToCairoColor ()); -// ctx.LineWidth = 1; -// ctx.Stroke (); -// } -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { + ctx.Rectangle (0, 0, Allocation.Width, Allocation.Height); + ctx.SetSourceColor (Styles.BreadcrumbBackgroundColor.ToCairoColor ()); + ctx.Fill (); + + ctx.MoveTo (0.5, Allocation.Height - 0.5); + ctx.RelLineTo (Allocation.Width, 0); + ctx.SetSourceColor (Styles.BreadcrumbBottomBorderColor.ToCairoColor ()); + ctx.LineWidth = 1; + ctx.Stroke (); + } + return base.OnDrawn (evnt); + } } } From 98bb5395a642d9a03303852906d8e468c1207c48 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 24 Feb 2024 02:28:32 +0100 Subject: [PATCH 269/382] update --- .../CollectionEditor.cs | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs index ede44aba41c..7a33a2d1a08 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs @@ -322,38 +322,6 @@ void EndTransaction (object obj, DesignerTransaction tran, object oldValue, obje tran.Cancel (); } - //This and EndTransaction are from Mono internal class System.ComponentModel.ReflectionPropertyDescriptor - // Lluis Sanchez Gual (lluis@ximian.com), (C) Novell, Inc, MIT X11 license - // DesignerTransaction CreateTransaction (object obj) - // { - // IComponent com = obj as IComponent; - // if (com == null || com.Site == null) return null; - - // IDesignerHost dh = (IDesignerHost) com.Site.GetService (typeof(IDesignerHost)); - // if (dh == null) return null; - - // DesignerTransaction tran = dh.CreateTransaction (); - // IComponentChangeService ccs = (IComponentChangeService) com.Site.GetService (typeof(IComponentChangeService)); - // if (ccs != null) - // ccs.OnComponentChanging (com, Property); - // return tran; - // } - - // void EndTransaction (object obj, DesignerTransaction tran, object oldValue, object newValue, bool commit) - // { - // if (tran == null) return; - - // if (commit) { - // IComponent com = obj as IComponent; - // IComponentChangeService ccs = (IComponentChangeService) com.Site.GetService (typeof(IComponentChangeService)); - // if (ccs != null) - // ccs.OnComponentChanged (com, Property, oldValue, newValue); - // tran.Commit (); - // } - // else - // tran.Cancel (); - // } - static void UpdateIndices (ListStore itemStore) { TreeIter iter; From 11a0b9f0a17d51a8517e39aed82cfd1f8da940e6 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 24 Feb 2024 02:51:33 +0100 Subject: [PATCH 270/382] update --- .../MonoDevelop.SourceEditor/HoverCloseButton.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs index ae698937395..bfc97c7ba61 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs @@ -26,6 +26,7 @@ using System; using Gtk; using Gdk; +using Cairo; namespace MonoDevelop.SourceEditor { @@ -84,13 +85,13 @@ protected virtual void OnClicked (EventArgs e) handler (this, e); } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// using (var cr = CairoHelper.Create (evnt.Window)) { -// DrawCloseButton (cr, new Gdk.Point (Allocation.X + Allocation.Width / 2, Allocation.Y + Allocation.Height / 2), hovered, 1.0, 0); -// } -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + using (var cr = Gdk.CairoHelper.Create (GdkWindow)) { + DrawCloseButton (cr, new Gdk.Point (Allocation.X + Allocation.Width / 2, Allocation.Y + Allocation.Height / 2), hovered, 1.0, 0); + } + return base.OnDrawn (evnt); + } static void DrawCloseButton (Cairo.Context context, Gdk.Point center, bool hovered, double opacity, double animationProgress) { From 4829a49708facca1c9a1cc22149442fd2cec3a14 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 24 Feb 2024 18:29:26 +0100 Subject: [PATCH 271/382] update --- .../MonoDevelop.Components/HeaderBox.cs | 153 +++++++++--------- 1 file changed, 77 insertions(+), 76 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs index e997c169879..a96825214c5 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs @@ -25,6 +25,7 @@ // THE SOFTWARE. using System; using Gtk; +using Cairo; namespace MonoDevelop.Components { @@ -164,82 +165,82 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) child.SizeAllocate (allocation); } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// Gdk.Rectangle rect; -// -// if (GradientBackground) { -// rect = new Gdk.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); -// var gcol = Style.Background (Gtk.StateType.Normal).ToXwtColor (); -// -// using (Cairo.Context cr = Gdk.CairoHelper.Create (GdkWindow)) { -// cr.NewPath (); -// cr.MoveTo (rect.X, rect.Y); -// cr.RelLineTo (rect.Width, 0); -// cr.RelLineTo (0, rect.Height); -// cr.RelLineTo (-rect.Width, 0); -// cr.RelLineTo (0, -rect.Height); -// cr.ClosePath (); -// -// // FIXME: VV: Remove gradient features -// using (Cairo.Gradient pat = new Cairo.LinearGradient (rect.X, rect.Y, rect.X, rect.Bottom)) { -// pat.AddColorStop (0, gcol.ToCairoColor ()); -// gcol.Light -= 0.1; -// if (gcol.Light < 0) -// gcol.Light = 0; -// pat.AddColorStop (1, gcol.ToCairoColor ()); -// cr.SetSource (pat); -// cr.FillPreserve (); -// } -// } -// } else if (BackgroundColor != null) { -// using (Cairo.Context cr = Gdk.CairoHelper.Create (GdkWindow)) { -// cr.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); -// cr.SetSourceColor (BackgroundColor.Value.ToCairoColor ()); -// cr.Fill (); -// } -// } else if (useChildBackgroundColor && Child != null) { -// using (Cairo.Context cr = Gdk.CairoHelper.Create (GdkWindow)) { -// cr.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); -// cr.SetSourceColor (Child.Style.Base (StateType.Normal).ToCairoColor ()); -// cr.Fill (); -// } -// } -// -// bool res = base.OnExposeEvent (evnt); -// -// var borderColor = new Gdk.GC (GdkWindow); -// borderColor.RgbFgColor = BorderColor != null ? BorderColor.Value : Style.Dark (Gtk.StateType.Normal); -// -// rect = Allocation; -// for (int n=0; n Date: Sat, 24 Feb 2024 18:40:08 +0100 Subject: [PATCH 272/382] update --- .../MonoDevelop.Components/PathBar.cs | 312 +++++++++--------- 1 file changed, 156 insertions(+), 156 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs index 3c7d2741e60..12a8d194edb 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs @@ -26,7 +26,7 @@ using System; using System.Linq; - +using Cairo; using Gtk; using Gdk; using MonoDevelop.Ide; @@ -340,161 +340,161 @@ void SetAccessibilityFrame (PathEntry entry, int x, int width) entry.Accessible.FrameInParent = rect; } -// protected override bool OnExposeEvent (EventExpose evnt) -// { -// Gdk.Rectangle focusRect = new Gdk.Rectangle (0, 0, 0, 0); -// -// using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { -// int index = 0; -// ctx.Rectangle (0, 0, Allocation.Width, Allocation.Height); -// ctx.SetSourceColor (Styles.BreadcrumbBackgroundColor.ToCairoColor ()); -// ctx.Fill (); -// -// if (widths == null) -// return true; -// -// // Calculate the total required with, and the reduction to be applied in case it doesn't fit the available space -// -// bool widthReduced; -// var currentWidths = GetCurrentWidths (out widthReduced); -// -// // Render the paths -// -// int textTopPadding = topPadding + (height - textHeight) / 2; -// int xpos = leftPadding, ypos = topPadding; -// -// for (int i = 0; i < leftPath.Length; i++, index++) { -// bool last = i == leftPath.Length - 1; -// -// // Reduce the item size when required -// int itemWidth = currentWidths [i]; -// int x = xpos; -// xpos += itemWidth; -// -// SetAccessibilityFrame (leftPath [i], x, itemWidth); -// -// if (hoverIndex >= 0 && hoverIndex < Path.Length && leftPath [i] == Path [hoverIndex] && (menuVisible || pressed || hovering)) -// DrawButtonBorder (ctx, x - padding, itemWidth + padding + padding); -// -// if (index == focusedPathIndex) { -// focusRect = new Gdk.Rectangle (x - padding, 0, itemWidth + (padding * 2) ,0); -// } -// int textOffset = 0; -// if (leftPath [i].DarkIcon != null) { -// int iy = (height - (int)leftPath [i].DarkIcon.Height) / 2 + topPadding; -// ctx.DrawImage (this, leftPath [i].DarkIcon, x, iy); -// textOffset += (int) leftPath [i].DarkIcon.Width + iconSpacing; -// } -// -// layout.Attributes = (i == activeIndex) ? boldAtts : null; -// layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11); -// layout.SetMarkup (GetFirstLineFromMarkup (leftPath [i].Markup)); -// -// ctx.Save (); -// -// // If size is being reduced, ellipsize it -// bool showText = true; -// if (widthReduced) { -// int w = itemWidth - textOffset; -// if (w > 0) { -// ctx.Rectangle (x + textOffset, textTopPadding, w, height); -// ctx.Clip (); -// } else -// showText = false; -// } else -// layout.Width = -1; -// -// if (showText) { -// // Text -// ctx.SetSourceColor (Styles.BreadcrumbTextColor.ToCairoColor ()); -// ctx.MoveTo (x + textOffset, textTopPadding); -// Pango.CairoHelper.ShowLayout (ctx, layout); -// } -// ctx.Restore (); -// -// if (!last) { -// xpos += arrowLeftPadding; -// if (leftPath [i].IsPathEnd) { -// Style.PaintVline (Style, GdkWindow, State, evnt.Area, this, "", ypos, ypos + height, xpos - arrowSize / 2); -// } else { -// int arrowH = Math.Min (height, arrowSize); -// int arrowY = ypos + (height - arrowH) / 2; -// DrawPathSeparator (ctx, xpos, arrowY, arrowH); -// } -// xpos += arrowSize + arrowRightPadding; -// } -// } -// -// int xposRight = Allocation.Width - rightPadding; -// for (int i = 0; i < rightPath.Length; i++, index++) { -// // bool last = i == rightPath.Length - 1; -// -// // Reduce the item size when required -// int itemWidth = currentWidths [i + leftPath.Length]; -// xposRight -= itemWidth; -// xposRight -= arrowSize; -// -// int x = xposRight; -// -// SetAccessibilityFrame (rightPath [i], x, itemWidth); -// -// if (hoverIndex >= 0 && hoverIndex < Path.Length && rightPath [i] == Path [hoverIndex] && (menuVisible || pressed || hovering)) -// DrawButtonBorder (ctx, x - padding, itemWidth + padding + padding); -// -// if (index == focusedPathIndex) { -// focusRect = new Gdk.Rectangle (x - padding, 0, itemWidth + (padding * 2), 0); -// } -// -// int textOffset = 0; -// if (rightPath [i].DarkIcon != null) { -// ctx.DrawImage (this, rightPath [i].DarkIcon, x, ypos); -// textOffset += (int) rightPath [i].DarkIcon.Width + padding; -// } -// -// layout.Attributes = (i == activeIndex) ? boldAtts : null; -// layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11); -// layout.SetMarkup (GetFirstLineFromMarkup (rightPath [i].Markup)); -// -// ctx.Save (); -// -// // If size is being reduced, ellipsize it -// bool showText = true; -// if (widthReduced) { -// int w = itemWidth - textOffset; -// if (w > 0) { -// ctx.Rectangle (x + textOffset, textTopPadding, w, height); -// ctx.Clip (); -// } else -// showText = false; -// } else -// layout.Width = -1; -// -// if (showText) { -// // Text -// ctx.SetSourceColor (Styles.BreadcrumbTextColor.ToCairoColor ()); -// ctx.MoveTo (x + textOffset, textTopPadding); -// Pango.CairoHelper.ShowLayout (ctx, layout); -// } -// -// ctx.Restore (); -// } -// -// if (DrawBottomBorder) { -// ctx.MoveTo (0, Allocation.Height - 0.5); -// ctx.RelLineTo (Allocation.Width, 0); -// ctx.SetSourceColor (Styles.BreadcrumbBottomBorderColor.ToCairoColor ()); -// ctx.LineWidth = 1; -// ctx.Stroke (); -// } -// if (HasFocus) { -// int focusY = topPadding - buttonPadding; -// int focusHeight = Allocation.Height - topPadding - bottomPadding + buttonPadding * 2; -// -// Gtk.Style.PaintFocus (Style, GdkWindow, State, Allocation, this, "label", focusRect.X, focusY, focusRect.Width, focusHeight); -// } -// } -// return true; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + Gdk.Rectangle focusRect = new Gdk.Rectangle (0, 0, 0, 0); + + using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { + int index = 0; + ctx.Rectangle (0, 0, Allocation.Width, Allocation.Height); + ctx.SetSourceColor (Styles.BreadcrumbBackgroundColor.ToCairoColor ()); + ctx.Fill (); + + if (widths == null) + return true; + + // Calculate the total required with, and the reduction to be applied in case it doesn't fit the available space + + bool widthReduced; + var currentWidths = GetCurrentWidths (out widthReduced); + + // Render the paths + + int textTopPadding = topPadding + (height - textHeight) / 2; + int xpos = leftPadding, ypos = topPadding; + + for (int i = 0; i < leftPath.Length; i++, index++) { + bool last = i == leftPath.Length - 1; + + // Reduce the item size when required + int itemWidth = currentWidths [i]; + int x = xpos; + xpos += itemWidth; + + SetAccessibilityFrame (leftPath [i], x, itemWidth); + + if (hoverIndex >= 0 && hoverIndex < Path.Length && leftPath [i] == Path [hoverIndex] && (menuVisible || pressed || hovering)) + DrawButtonBorder (ctx, x - padding, itemWidth + padding + padding); + + if (index == focusedPathIndex) { + focusRect = new Gdk.Rectangle (x - padding, 0, itemWidth + (padding * 2) ,0); + } + int textOffset = 0; + if (leftPath [i].DarkIcon != null) { + int iy = (height - (int)leftPath [i].DarkIcon.Height) / 2 + topPadding; + ctx.DrawImage (this, leftPath [i].DarkIcon, x, iy); + textOffset += (int) leftPath [i].DarkIcon.Width + iconSpacing; + } + + layout.Attributes = (i == activeIndex) ? boldAtts : null; + //layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11); + layout.SetMarkup (GetFirstLineFromMarkup (leftPath [i].Markup)); + + ctx.Save (); + + // If size is being reduced, ellipsize it + bool showText = true; + if (widthReduced) { + int w = itemWidth - textOffset; + if (w > 0) { + ctx.Rectangle (x + textOffset, textTopPadding, w, height); + ctx.Clip (); + } else + showText = false; + } else + layout.Width = -1; + + if (showText) { + // Text + ctx.SetSourceColor (Styles.BreadcrumbTextColor.ToCairoColor ()); + ctx.MoveTo (x + textOffset, textTopPadding); + Pango.CairoHelper.ShowLayout (ctx, layout); + } + ctx.Restore (); + + if (!last) { + xpos += arrowLeftPadding; + if (leftPath [i].IsPathEnd) { + //Style.PaintVline (Style, GdkWindow, State, evnt.Area, this, "", ypos, ypos + height, xpos - arrowSize / 2); + } else { + int arrowH = Math.Min (height, arrowSize); + int arrowY = ypos + (height - arrowH) / 2; + DrawPathSeparator (ctx, xpos, arrowY, arrowH); + } + xpos += arrowSize + arrowRightPadding; + } + } + + int xposRight = Allocation.Width - rightPadding; + for (int i = 0; i < rightPath.Length; i++, index++) { + // bool last = i == rightPath.Length - 1; + + // Reduce the item size when required + int itemWidth = currentWidths [i + leftPath.Length]; + xposRight -= itemWidth; + xposRight -= arrowSize; + + int x = xposRight; + + SetAccessibilityFrame (rightPath [i], x, itemWidth); + + if (hoverIndex >= 0 && hoverIndex < Path.Length && rightPath [i] == Path [hoverIndex] && (menuVisible || pressed || hovering)) + DrawButtonBorder (ctx, x - padding, itemWidth + padding + padding); + + if (index == focusedPathIndex) { + focusRect = new Gdk.Rectangle (x - padding, 0, itemWidth + (padding * 2), 0); + } + + int textOffset = 0; + if (rightPath [i].DarkIcon != null) { + ctx.DrawImage (this, rightPath [i].DarkIcon, x, ypos); + textOffset += (int) rightPath [i].DarkIcon.Width + padding; + } + + layout.Attributes = (i == activeIndex) ? boldAtts : null; + //layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11); + layout.SetMarkup (GetFirstLineFromMarkup (rightPath [i].Markup)); + + ctx.Save (); + + // If size is being reduced, ellipsize it + bool showText = true; + if (widthReduced) { + int w = itemWidth - textOffset; + if (w > 0) { + ctx.Rectangle (x + textOffset, textTopPadding, w, height); + ctx.Clip (); + } else + showText = false; + } else + layout.Width = -1; + + if (showText) { + // Text + ctx.SetSourceColor (Styles.BreadcrumbTextColor.ToCairoColor ()); + ctx.MoveTo (x + textOffset, textTopPadding); + Pango.CairoHelper.ShowLayout (ctx, layout); + } + + ctx.Restore (); + } + + if (DrawBottomBorder) { + ctx.MoveTo (0, Allocation.Height - 0.5); + ctx.RelLineTo (Allocation.Width, 0); + ctx.SetSourceColor (Styles.BreadcrumbBottomBorderColor.ToCairoColor ()); + ctx.LineWidth = 1; + ctx.Stroke (); + } + if (HasFocus) { + int focusY = topPadding - buttonPadding; + int focusHeight = Allocation.Height - topPadding - bottomPadding + buttonPadding * 2; + + //Gtk.Style.PaintFocus (Style, GdkWindow, State, Allocation, this, "label", focusRect.X, focusY, focusRect.Width, focusHeight); + } + } + return true; + } void DrawPathSeparator (Cairo.Context ctx, double x, double y, double size) { From 501188c78884c22094efe6cafdc0ccc2a72ceaf7 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 24 Feb 2024 18:47:04 +0100 Subject: [PATCH 273/382] update --- .../MonoDevelop.Components/Tabstrip.cs | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs index cf282490687..7cb86534c4e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs @@ -313,32 +313,32 @@ protected override void OnGetPreferredHeight (out int min_height, out int natura min_height = natural_height = (int)Math.Ceiling (tabSizes.Max (p => p.Y)); } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// using (var cr = Gdk.CairoHelper.Create (evnt.Window)) { -// cr.Rectangle (0, 0, Allocation.Width, Allocation.Height); -// cr.SetSourceColor (Styles.SubTabBarBackgroundColor.ToCairoColor ()); -// cr.Fill (); -// -// Tab active = null; -// for (int i = tabs.Count; i --> 0;) { -// if (i == ActiveTab) { -// active = tabs [i]; -// continue; -// } -// var tab = tabs[i]; -// var bounds = GetBounds (tab); -// tab.HoverPosition = tab == hoverTab ? new Cairo.PointD (mx - bounds.X, my) : new Cairo.PointD (-1, -1); -// tab.Draw (cr, bounds); -// } -// -// if (active != null) { -// active.Draw (cr, GetBounds (active)); -// } -// } -// -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + using (var cr = Gdk.CairoHelper.Create (GdkWindow)) { + cr.Rectangle (0, 0, Allocation.Width, Allocation.Height); + cr.SetSourceColor (Styles.SubTabBarBackgroundColor.ToCairoColor ()); + cr.Fill (); + + Tab active = null; + for (int i = tabs.Count; i --> 0;) { + if (i == ActiveTab) { + active = tabs [i]; + continue; + } + var tab = tabs[i]; + var bounds = GetBounds (tab); + tab.HoverPosition = tab == hoverTab ? new Cairo.PointD (mx - bounds.X, my) : new Cairo.PointD (-1, -1); + tab.Draw (cr, bounds); + } + + if (active != null) { + active.Draw (cr, GetBounds (active)); + } + } + + return base.OnDrawn (evnt); + } int focusedTab = -1; From d52053c56a26b97017883366ef02df93d30c7cfe Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sun, 25 Feb 2024 00:39:23 +0100 Subject: [PATCH 274/382] update --- .../CompactScrolledWindow.cs | 129 +++++++++--------- 1 file changed, 65 insertions(+), 64 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs index e4f968d9a6f..08fb62d0d25 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs @@ -25,6 +25,7 @@ // THE SOFTWARE. using System; +using Cairo; namespace MonoDevelop.Components { @@ -115,70 +116,70 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) } } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// var ret = base.OnExposeEvent (evnt); -// if (!showBorderLine) -// return ret; -// -// bool hasHScroll = HScrollbar.Visible; -// bool hasVScroll = VScrollbar.Visible; -// -// //this is the rectangle that defines where we will draw the border lines -// //note that Allocation was set by the base, but we altered it during allocation, so take that into account -// var rect = Allocation; -// var borderWidth = (int) BorderWidth; -// rect.X += borderWidth - 1; -// rect.Y += borderWidth - 1; -// rect.Width -= borderWidth + borderWidth - 2; -// rect.Height -= borderWidth + borderWidth - 2; -// -// //if there will be scrollbars, bring the end of the lines to the middle of the scrollbar so it looks nice -// if (hasHScroll) { -// rect.Height -= HScrollbar.Allocation.Height / 2; -// } -// -// if (hasVScroll) { -// rect.Width -= VScrollbar.Allocation.Width / 2; -// } -// -// double lineWidth = 1; -// var halfLineWidth = lineWidth / 2.0; -// -// //draw the border lines -// using (var cr = Gdk.CairoHelper.Create (evnt.Window)) { -// Gdk.CairoHelper.Region (cr, evnt.Region); -// cr.Clip (); -// -// cr.SetSourceColor (Style.Dark (Gtk.StateType.Normal).ToCairoColor ()); -// cr.LineWidth = lineWidth; -// cr.Translate (rect.X, rect.Y); -// -// //top -// cr.MoveTo (0, halfLineWidth); -// cr.LineTo (rect.Width, halfLineWidth); -// -// //bottom. redundant if there's a horizontal scrollbar. -// if (!hasHScroll) { -// cr.MoveTo (0, rect.Height - halfLineWidth); -// cr.LineTo (rect.Width, rect.Height - halfLineWidth); -// } -// -// //left -// cr.MoveTo (halfLineWidth, 0); -// cr.LineTo (halfLineWidth, rect.Height); -// -// //right. redundant if there's a vertical scrollbar. -// if (!hasVScroll) { -// cr.MoveTo (rect.Width - halfLineWidth, 0); -// cr.LineTo (rect.Width - halfLineWidth, rect.Height); -// } -// -// cr.Stroke (); -// } -// -// return ret; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + var ret = base.OnDrawn (evnt); + if (!showBorderLine) + return ret; + + bool hasHScroll = HScrollbar.Visible; + bool hasVScroll = VScrollbar.Visible; + + //this is the rectangle that defines where we will draw the border lines + //note that Allocation was set by the base, but we altered it during allocation, so take that into account + var rect = Allocation; + var borderWidth = (int) BorderWidth; + rect.X += borderWidth - 1; + rect.Y += borderWidth - 1; + rect.Width -= borderWidth + borderWidth - 2; + rect.Height -= borderWidth + borderWidth - 2; + + //if there will be scrollbars, bring the end of the lines to the middle of the scrollbar so it looks nice + if (hasHScroll) { + rect.Height -= HScrollbar.Allocation.Height / 2; + } + + if (hasVScroll) { + rect.Width -= VScrollbar.Allocation.Width / 2; + } + + double lineWidth = 1; + var halfLineWidth = lineWidth / 2.0; + + //draw the border lines + using (var cr = Gdk.CairoHelper.Create (GdkWindow)) { + //Gdk.CairoHelper.Region (cr, evnt.Region); + cr.Clip (); + + //cr.SetSourceColor (Style.Dark (Gtk.StateType.Normal).ToCairoColor ()); + cr.LineWidth = lineWidth; + cr.Translate (rect.X, rect.Y); + + //top + cr.MoveTo (0, halfLineWidth); + cr.LineTo (rect.Width, halfLineWidth); + + //bottom. redundant if there's a horizontal scrollbar. + if (!hasHScroll) { + cr.MoveTo (0, rect.Height - halfLineWidth); + cr.LineTo (rect.Width, rect.Height - halfLineWidth); + } + + //left + cr.MoveTo (halfLineWidth, 0); + cr.LineTo (halfLineWidth, rect.Height); + + //right. redundant if there's a vertical scrollbar. + if (!hasVScroll) { + cr.MoveTo (rect.Width - halfLineWidth, 0); + cr.LineTo (rect.Width - halfLineWidth, rect.Height); + } + + cr.Stroke (); + } + + return ret; + } } } From 8eff6b2d7d2dc2d05ab100a9c8ec3a731e1226a1 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 29 Feb 2024 19:36:16 +0100 Subject: [PATCH 275/382] update --- .../MonoDevelop.Components/SearchEntry.cs | 141 +++++++++--------- 1 file changed, 71 insertions(+), 70 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs index 3da3ba08067..0f6e0a3061e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs @@ -29,6 +29,7 @@ using System; using Gtk; +using Cairo; using MonoDevelop.Core; using MonoDevelop.Ide.Fonts; using MonoDevelop.Ide.Gui; @@ -431,11 +432,11 @@ protected override bool OnKeyPressEvent (Gdk.EventKey evnt) return base.OnKeyPressEvent (evnt); } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// var alloc = new Gdk.Rectangle (alignment.Allocation.X, box.Allocation.Y, alignment.Allocation.Width, box.Allocation.Height); -// -// if (hasFrame && (!roundedShape || (roundedShape && !customRoundedShapeDrawing))) { + protected override bool OnDrawn (Cairo.Context evnt) + { + var alloc = new Gdk.Rectangle (alignment.Allocation.X, box.Allocation.Y, alignment.Allocation.Width, box.Allocation.Height); + + if (hasFrame && (!roundedShape || (roundedShape && !customRoundedShapeDrawing))) { // if (Platform.IsLinux) // Style.PaintFlatBox (Style, GdkWindow, entry.State, ShadowType.None, // evnt.Area, this, "entry_bg", alloc.X + 2, alloc.Y + 2, alloc.Width - 4, alloc.Height - 4); @@ -447,34 +448,34 @@ protected override bool OnKeyPressEvent (Gdk.EventKey evnt) ctx.Color = new Cairo.Color (1,0,0); ctx.Stroke (); }*/ -// } -// else if (!roundedShape) { -// using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { -// CairoExtensions.RoundedRectangle (ctx, alloc.X + 0.5, alloc.Y + 0.5, alloc.Width - 1, alloc.Height - 1, 4); -// ctx.SetSourceColor (entry.Style.Base (Gtk.StateType.Normal).ToCairoColor ()); -// ctx.Fill (); -// } -// } -// else { -// using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { -// RoundBorder (ctx, alloc.X + 0.5, alloc.Y + 0.5, alloc.Width - 1, alloc.Height - 1); -// ctx.SetSourceColor (entry.Style.Base (Gtk.StateType.Normal).ToCairoColor ()); -// ctx.Fill (); -// } -// } -// + } + else if (!roundedShape) { + using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { + CairoExtensions.RoundedRectangle (ctx, alloc.X + 0.5, alloc.Y + 0.5, alloc.Width - 1, alloc.Height - 1, 4); + ctx.SetSourceColor (entry.Style.Base (Gtk.StateType.Normal).ToCairoColor ()); + ctx.Fill (); + } + } + else { + using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { + RoundBorder (ctx, alloc.X + 0.5, alloc.Y + 0.5, alloc.Width - 1, alloc.Height - 1); + ctx.SetSourceColor (entry.Style.Base (Gtk.StateType.Normal).ToCairoColor ()); + ctx.Fill (); + } + } + // PropagateExpose (Child, evnt); -// -// if (hasFrame && roundedShape && customRoundedShapeDrawing) { -// using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { -// RoundBorder (ctx, alloc.X + 0.5, alloc.Y + 0.5, alloc.Width - 1, alloc.Height - 1); -// ctx.SetSourceColor (Styles.WidgetBorderColor.ToCairoColor ()); -// ctx.LineWidth = 1; -// ctx.Stroke (); -// } -// } -// return true; -// } + + if (hasFrame && roundedShape && customRoundedShapeDrawing) { + using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { + RoundBorder (ctx, alloc.X + 0.5, alloc.Y + 0.5, alloc.Width - 1, alloc.Height - 1); + ctx.SetSourceColor (Styles.WidgetBorderColor.ToCairoColor ()); + ctx.LineWidth = 1; + ctx.Stroke (); + } + } + return true; + } static void RoundBorder (Cairo.Context ctx, double x, double y, double w, double h) { @@ -695,7 +696,7 @@ private class FramelessEntry : Entry { private SearchEntry parent; private Pango.Layout layout; -// private Gdk.GC text_gc; +// private Gdk.gc text_gc; public FramelessEntry (SearchEntry parent) : base() { @@ -762,43 +763,43 @@ public static Gdk.Color ColorBlend (Gdk.Color a, Gdk.Color b) // Gdk.Colormap.System.AllocColor (ref color, true, true); return color; } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// // The Entry's GdkWindow is the top level window onto which -// // the frame is drawn; the actual text entry is drawn into a -// // separate window, so we can ensure that for themes that don't -// // respect HasFrame, we never ever allow the base frame drawing -// // to happen -// if (evnt.Window == GdkWindow) { -// return true; -// } -// -// bool ret = base.OnExposeEvent (evnt); -// -// if (text_gc == null) { -// text_gc = new Gdk.GC (evnt.Window); -// text_gc.Copy (Style.TextGC (StateType.Normal)); -// Gdk.Color color_a = parent.Style.Base (StateType.Normal); -// Gdk.Color color_b = parent.Style.Text (StateType.Normal); -// text_gc.RgbFgColor = ColorBlend (color_a, color_b); -// } -// -// if (Text.Length > 0 || HasFocus || parent.EmptyMessage == null) { -// return ret; -// } -// -// if (layout == null) { -// layout = new Pango.Layout (PangoContext); -// layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11); -// } -// -// int width, height; -// layout.SetMarkup (parent.EmptyMessage); -// layout.GetPixelSize (out width, out height); -// evnt.Window.DrawLayout (text_gc, 2, (SizeRequest ().Height - height) / 2, layout); -// -// return ret; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + // The Entry's GdkWindow is the top level window onto which + // the frame is drawn; the actual text entry is drawn into a + // separate window, so we can ensure that for themes that don't + // respect HasFrame, we never ever allow the base frame drawing + // to happen + //if (event.GdkWindow) { + // return true; + //} + + bool ret = base.OnDrawn (evnt); + + // if (text_gc == null) { + // text_gc = new Gdk.GC (evnt.GdkWindow); + // text_gc.Copy (Style.TextGC (StateType.Normal)); + // Gdk.Color color_a = parent.Style.Base (StateType.Normal); + // Gdk.Color color_b = parent.Style.Text (StateType.Normal); + // text_gc.RgbFgColor = ColorBlend (color_a, color_b); + // } + + if (Text.Length > 0 || HasFocus || parent.EmptyMessage == null) { + return ret; + } + + if (layout == null) { + layout = new Pango.Layout (PangoContext); + //layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11); + } + + int width, height; + layout.SetMarkup (parent.EmptyMessage); + layout.GetPixelSize (out width, out height); + //evnt.Window.DrawLayout (text_gc, 2, (SizeRequest ().Height - height) / 2, layout); + + return ret; + } } } } From 67c6c636bebf4a77f50b4d24abb3807f81026e11 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 29 Feb 2024 20:00:47 +0100 Subject: [PATCH 276/382] update --- .../MonoDevelop.Components/SectionList.cs | 170 +++++++++--------- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs index cf0da4b9d4c..0dfa3bf5fcc 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs @@ -295,91 +295,91 @@ static Cairo.Color Convert (Gdk.Color color) } //FIXME: respect damage regions not just the whole areas, and skip more work when possible -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// if (sections.Count == 0) -// return false; -// -// var alloc = Allocation; -// -// int bw = (int) BorderWidth; -// double halfLineWidth = borderLineWidth / 2.0; -// int bw2 = bw * 2; -// int w = alloc.Width - bw2; -// int h = alloc.Height - bw2; -// -// using (var cr = CairoHelper.Create (evnt.Window)) { -// CairoHelper.Region (cr, evnt.Region); -// cr.Clip (); -// -// cr.Translate (alloc.X + bw, alloc.Y + bw); -// -// var borderCol = Convert (Style.Dark (StateType.Normal)); -// cr.SetSourceColor (borderCol); -// cr.Rectangle (halfLineWidth, halfLineWidth, w - borderLineWidth, h - borderLineWidth); -// cr.LineWidth = borderLineWidth; -// cr.Stroke (); -// -// cr.Translate (borderLineWidth, borderLineWidth); -// w = w - (2 * borderLineWidth); -// -// using (LinearGradient unselectedGrad = new LinearGradient (0, 0, 0, headerHeight), -// hoverGrad = new LinearGradient (0, 0, 0, headerHeight), -// selectedGrad = new LinearGradient (0, 0, 0, headerHeight) -// ) -// { -// var unselectedCol = Convert (Style.Mid (StateType.Normal)); -// var unselectedTextCol = Convert (Style.Text (StateType.Normal)); -// unselectedCol.A = 0.6; -// unselectedGrad.AddColorStop (0, unselectedCol); -// unselectedCol.A = 1; -// unselectedGrad.AddColorStop (1, unselectedCol); -// -// var hoverCol = Convert (Style.Mid (StateType.Prelight)); -// var hoverTextCol = Convert (Style.Text (StateType.Prelight)); -// hoverCol.A = 0.6; -// hoverGrad.AddColorStop (0, unselectedCol); -// hoverCol.A = 1; -// hoverGrad.AddColorStop (1, unselectedCol); -// -// var selectedCol = Convert (Style.Mid (StateType.Normal)); -// var selectedTextCol = Convert (Style.Text (StateType.Normal)); -// selectedCol.A = 0.6; -// selectedGrad.AddColorStop (0, selectedCol); -// selectedCol.A = 1; -// selectedGrad.AddColorStop (1, selectedCol); -// -// for (int i = 0; i < sections.Count; i++) { -// var section = sections[i]; -// bool isActive = activeIndex == i; -// bool isHover = hoverIndex == i; -// -// cr.Rectangle (0, 0, w, headerHeight); -// cr.SetSource (isActive? selectedGrad : (isHover? hoverGrad : unselectedGrad)); -// cr.Fill (); -// -// cr.SetSourceColor (isActive? selectedTextCol : (isHover? hoverTextCol : unselectedTextCol)); -// layout.SetText (section.Title); -// layout.Ellipsize = Pango.EllipsizeMode.End; -// layout.Width = (int) ((w - headerPadding - headerPadding) * Pango.Scale.PangoScale); -// cr.MoveTo (headerPadding, headerPadding); -// Pango.CairoHelper.ShowLayout (cr, layout); -// -// cr.MoveTo (-halfLineWidth, i > activeIndex? -halfLineWidth : headerHeight + halfLineWidth); -// cr.RelLineTo (w + borderLineWidth, 0.0); -// cr.SetSourceColor (borderCol); -// cr.Stroke (); -// -// cr.Translate (0, headerHeight + borderLineWidth); -// if (isActive) -// cr.Translate (0, section.Child.Allocation.Height + borderLineWidth); -// } -// } -// } -// -// PropagateExpose (sections[activeIndex].Child, evnt); -// return true;// base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + if (sections.Count == 0) + return false; + + var alloc = Allocation; + + int bw = (int) BorderWidth; + double halfLineWidth = borderLineWidth / 2.0; + int bw2 = bw * 2; + int w = alloc.Width - bw2; + int h = alloc.Height - bw2; + + using (var cr = Gdk.CairoHelper.Create (GdkWindow)) { + //Gdk.CairoHelper.Region (cr, evnt.Region); + cr.Clip (); + + cr.Translate (alloc.X + bw, alloc.Y + bw); + + var borderCol = Convert (Style.Dark (StateType.Normal)); + cr.SetSourceColor (borderCol); + cr.Rectangle (halfLineWidth, halfLineWidth, w - borderLineWidth, h - borderLineWidth); + cr.LineWidth = borderLineWidth; + cr.Stroke (); + + cr.Translate (borderLineWidth, borderLineWidth); + w = w - (2 * borderLineWidth); + + using (LinearGradient unselectedGrad = new LinearGradient (0, 0, 0, headerHeight), + hoverGrad = new LinearGradient (0, 0, 0, headerHeight), + selectedGrad = new LinearGradient (0, 0, 0, headerHeight) + ) + { + //var unselectedCol = Convert (Style.Mid (StateType.Normal)); + //var unselectedTextCol = Convert (Style.Text (StateType.Normal)); + //unselectedCol.A = 0.6; + //unselectedGrad.AddColorStop (0, unselectedCol); + //unselectedCol.A = 1; + //unselectedGrad.AddColorStop (1, unselectedCol); + + //var hoverCol = Convert (Style.Mid (StateType.Prelight)); + //var hoverTextCol = Convert (Style.Text (StateType.Prelight)); + //hoverCol.A = 0.6; + //hoverGrad.AddColorStop (0, unselectedCol); + //hoverCol.A = 1; + //hoverGrad.AddColorStop (1, unselectedCol); + + //var selectedCol = Convert (Style.Mid (StateType.Normal)); + //var selectedTextCol = Convert (Style.Text (StateType.Normal)); + //selectedCol.A = 0.6; + //selectedGrad.AddColorStop (0, selectedCol); + //selectedCol.A = 1; + //selectedGrad.AddColorStop (1, selectedCol); + + for (int i = 0; i < sections.Count; i++) { + var section = sections[i]; + bool isActive = activeIndex == i; + bool isHover = hoverIndex == i; + + cr.Rectangle (0, 0, w, headerHeight); + //cr.SetSource (isActive? selectedGrad : (isHover? hoverGrad : unselectedGrad)); + cr.Fill (); + + //cr.SetSourceColor (isActive? selectedTextCol : (isHover? hoverTextCol : unselectedTextCol)); + layout.SetText (section.Title); + layout.Ellipsize = Pango.EllipsizeMode.End; + layout.Width = (int) ((w - headerPadding - headerPadding) * Pango.Scale.PangoScale); + cr.MoveTo (headerPadding, headerPadding); + Pango.CairoHelper.ShowLayout (cr, layout); + + cr.MoveTo (-halfLineWidth, i > activeIndex? -halfLineWidth : headerHeight + halfLineWidth); + cr.RelLineTo (w + borderLineWidth, 0.0); + cr.SetSourceColor (borderCol); + cr.Stroke (); + + cr.Translate (0, headerHeight + borderLineWidth); + if (isActive) + cr.Translate (0, section.Child.Allocation.Height + borderLineWidth); + } + } + } + + //PropagateExpose (sections[activeIndex].Child, evnt); + return true;// base.OnExposeEvent (evnt); + } protected override void ForAll (bool include_internals, Callback callback) { From 8bb43750248c2157fa43fc66e94aeee8ba268e43 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 29 Feb 2024 20:09:37 +0100 Subject: [PATCH 277/382] update --- .../core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs index 7cb86534c4e..f9149d172cf 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs @@ -327,12 +327,14 @@ protected override bool OnDrawn (Cairo.Context evnt) continue; } var tab = tabs[i]; + if (!tab.Visible) + continue; var bounds = GetBounds (tab); tab.HoverPosition = tab == hoverTab ? new Cairo.PointD (mx - bounds.X, my) : new Cairo.PointD (-1, -1); tab.Draw (cr, bounds); } - if (active != null) { + if (active != null && active.Visible) { active.Draw (cr, GetBounds (active)); } } From 36ffea3d87a7044709bba52194cf354eb2f1a09a Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 29 Feb 2024 20:21:12 +0100 Subject: [PATCH 278/382] update --- .../MonoDevelop.Components/VPanedThin.cs | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/VPanedThin.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/VPanedThin.cs index 56a6a4dfe31..68c6ef6e275 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/VPanedThin.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/VPanedThin.cs @@ -25,6 +25,7 @@ // THE SOFTWARE. using System; using MonoDevelop.Ide.Gui; +using Cairo; namespace MonoDevelop.Components { @@ -58,20 +59,20 @@ protected override void ForAll (bool include_internals, Gtk.Callback callback) callback (handle); } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// base.OnExposeEvent (evnt); -// -// if (Child1 != null && Child1.Visible && Child2 != null && Child2.Visible) { -// var gc = new Gdk.GC (evnt.Window); -// gc.RgbFgColor = Styles.ThinSplitterColor.ToGdkColor (); -// var y = Child1.Allocation.Y + Child1.Allocation.Height; -// evnt.Window.DrawLine (gc, Allocation.X, y, Allocation.X + Allocation.Width, y); -// gc.Dispose (); -// } -// -// return true; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + base.OnDrawn (evnt); + + if (Child1 != null && Child1.Visible && Child2 != null && Child2.Visible) { + //var gc = new Gdk.GC (evnt.Window); + //gc.RgbFgColor = Styles.ThinSplitterColor.ToGdkColor (); + var y = Child1.Allocation.Y + Child1.Allocation.Height; + //evnt.Window.DrawLine (gc, Allocation.X, y, Allocation.X + Allocation.Width, y); + //gc.Dispose (); + } + + return true; + } } } From c7abb008316d9d7a4b88c871a6aec6255c069ca1 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 29 Feb 2024 20:36:47 +0100 Subject: [PATCH 279/382] update --- .../MonoDevelop.Components/PopoverWindow.cs | 105 +++++++++--------- 1 file changed, 53 insertions(+), 52 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindow.cs index 6aaac22339e..d55dc9a816d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindow.cs @@ -25,6 +25,7 @@ // THE SOFTWARE. using System; using Gtk; +using Cairo; using MonoDevelop.Ide; using MonoDevelop.Ide.Gui; using Gdk; @@ -40,7 +41,7 @@ public class PopoverWindow : Gtk.Window, IAnimatable Gtk.Alignment alignment; Gdk.Rectangle currentCaret; - Gdk.Point targetWindowOrigin = new Point (-1, -1); + Gdk.Point targetWindowOrigin = new Gdk.Point (-1, -1); Gtk.Widget parent; Xwt.Widget xwtParent; bool eventProvided; @@ -133,9 +134,9 @@ public void ShowPopup (Gtk.Widget widget, Gdk.Rectangle caret, PopupPosition pos public void ShowPopup (Xwt.Rectangle onScreenArea, PopupPosition position) { this.parent = IdeApp.Workbench.RootWindow; - this.currentCaret = new Rectangle ((int)onScreenArea.X, (int)onScreenArea.Y, (int)onScreenArea.Width, (int)onScreenArea.Height); + this.currentCaret = new Gdk.Rectangle ((int)onScreenArea.X, (int)onScreenArea.Y, (int)onScreenArea.Width, (int)onScreenArea.Height); Theme.TargetPosition = position; - targetWindowOrigin = new Point ((int)onScreenArea.X, (int)onScreenArea.Y); + targetWindowOrigin = new Gdk.Point ((int)onScreenArea.X, (int)onScreenArea.Y); RepositionWindow (); } @@ -145,7 +146,7 @@ internal void ShowPopup (Xwt.Widget widget, Xwt.Rectangle caret, PopupPosition p this.currentCaret = new Gdk.Rectangle ((int)caret.X, (int)caret.Y, (int)caret.Width, (int)caret.Height); Theme.TargetPosition = position; var pos = GtkUtil.GetSceenBounds (widget); - targetWindowOrigin = new Point ((int)pos.X, (int)pos.Y); + targetWindowOrigin = new Gdk.Point ((int)pos.X, (int)pos.Y); RepositionWindow (); } @@ -164,7 +165,7 @@ void ShowPopup (Gtk.Widget parent, Gdk.EventButton evt, Gdk.Rectangle caret, Pop if (targetWindow != null) { int x, y; targetWindow.GetOrigin (out x, out y); - targetWindowOrigin = new Point (x, y); + targetWindowOrigin = new Gdk.Point (x, y); } RepositionWindow (); } @@ -433,48 +434,48 @@ protected override void OnScreenChanged (Gdk.Screen previous_screen) CheckScreenColormap (); } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// bool retVal; -// bool changed; -// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { -// context.Save (); -// if (SupportsAlpha) { -// context.Operator = Cairo.Operator.Source; -// context.SetSourceRGBA (1, 1, 1, 0); -// } else { -// context.Operator = Cairo.Operator.Over; -// context.SetSourceRGB (1, 1, 1); -// } -// context.Paint (); -// context.Restore (); -// -// OnDrawContent (evnt, context); // Draw content first so we can easily clip it -// retVal = base.OnExposeEvent (evnt); -// -// changed = Theme.SetBorderPath (context, BorderAllocation, position); -// context.Operator = Cairo.Operator.DestIn; -// context.SetSourceRGBA (1, 1, 1, 1); -// context.Fill (); -// context.Operator = Cairo.Operator.Over; -// -// // protect against overriden methods which leave in a bad state -// context.Save (); -// if (Theme.DrawPager) { -// Theme.RenderPager (context, -// PangoContext, -// BorderAllocation); -// } -// -// Theme.RenderShadow (context, BorderAllocation, position); -// context.Restore (); -// } -// -// if (changed) -// GtkWorkarounds.UpdateNativeShadow (this); -// -// return retVal; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + bool retVal; + bool changed; + using (var context = Gdk.CairoHelper.Create (GdkWindow)) { + context.Save (); + if (SupportsAlpha) { + context.Operator = Cairo.Operator.Source; + context.SetSourceRGBA (1, 1, 1, 0); + } else { + context.Operator = Cairo.Operator.Over; + context.SetSourceRGB (1, 1, 1); + } + context.Paint (); + context.Restore (); + + //OnDrawContent (evnt, context); // Draw content first so we can easily clip it + retVal = base.OnDrawn (evnt); + + changed = Theme.SetBorderPath (context, BorderAllocation, position); + context.Operator = Cairo.Operator.DestIn; + context.SetSourceRGBA (1, 1, 1, 1); + context.Fill (); + context.Operator = Cairo.Operator.Over; + + // protect against overriden methods which leave in a bad state + context.Save (); + if (Theme.DrawPager) { + Theme.RenderPager (context, + PangoContext, + BorderAllocation); + } + + Theme.RenderShadow (context, BorderAllocation, position); + context.Restore (); + } + + if (changed) + GtkWorkarounds.UpdateNativeShadow (this); + + return retVal; + } protected virtual void OnDrawContent (Gdk.EventExpose evnt, Cairo.Context context) { @@ -505,7 +506,7 @@ void OnRedrawNeeded (object sender, EventArgs args) QueueDraw (); } - protected override void OnSizeAllocated (Rectangle allocation) + protected override void OnSizeAllocated (Gdk.Rectangle allocation) { if (!this.AnimationIsRunning ("Resize")) paintSize = new Gdk.Size (allocation.Width, allocation.Height); @@ -513,7 +514,7 @@ protected override void OnSizeAllocated (Rectangle allocation) base.OnSizeAllocated (allocation); } - protected Rectangle ChildAllocation { + protected Gdk.Rectangle ChildAllocation { get { var rect = BorderAllocation; rect.Inflate (-Theme.Padding - 1, -Theme.Padding - 1); @@ -521,7 +522,7 @@ protected Rectangle ChildAllocation { } } - Rectangle BorderAllocation { + Gdk.Rectangle BorderAllocation { get { var rect = new Gdk.Rectangle (Allocation.X, Allocation.Y, paintSize.Width, paintSize.Height); if (ShowArrow) { @@ -581,9 +582,9 @@ protected override bool OnButtonReleaseEvent (EventButton evnt) return base.OnButtonPressEvent (evnt); var retval = false; - if (retval = Theme.HitTestPagerLeftArrow (PangoContext, BorderAllocation, new Point ((int)evnt.X, (int)evnt.Y))) + if (retval = Theme.HitTestPagerLeftArrow (PangoContext, BorderAllocation, new Gdk.Point ((int)evnt.X, (int)evnt.Y))) OnPagerLeftClicked (); - else if (retval = Theme.HitTestPagerRightArrow (PangoContext, BorderAllocation, new Point ((int)evnt.X, (int)evnt.Y))) + else if (retval = Theme.HitTestPagerRightArrow (PangoContext, BorderAllocation, new Gdk.Point ((int)evnt.X, (int)evnt.Y))) OnPagerRightClicked (); return retval; From 908feb8d8a3a9fdc535aebbca9c65ff160aebbcc Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 29 Feb 2024 20:45:03 +0100 Subject: [PATCH 280/382] update --- .../MonoDevelop.Components/HPanedThin.cs | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs index eebefccbab0..e503010c4fb 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs @@ -26,6 +26,7 @@ using MonoDevelop.Ide.Gui; using System.Collections.Generic; using System; +using Cairo; #if MAC using AppKit; @@ -81,20 +82,20 @@ protected override void ForAll (bool include_internals, Gtk.Callback callback) callback (handle); } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// base.OnExposeEvent (evnt); -// -// if (Child1 != null && Child1.Visible && Child2 != null && Child2.Visible) { -// var gc = new Gdk.GC (evnt.Window); -// gc.RgbFgColor = Styles.ThinSplitterColor.ToGdkColor (); -// var x = Child1.Allocation.X + Child1.Allocation.Width; -// evnt.Window.DrawLine (gc, x, Allocation.Y, x, Allocation.Y + Allocation.Height); -// gc.Dispose (); -// } -// -// return true; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + base.OnDrawn (evnt); + + if (Child1 != null && Child1.Visible && Child2 != null && Child2.Visible) { + //var gc = new Gdk.GC (evnt.Window); + //gc.RgbFgColor = Styles.ThinSplitterColor.ToGdkColor (); + var x = Child1.Allocation.X + Child1.Allocation.Width; + //evnt.Window.DrawLine (gc, x, Allocation.Y, x, Allocation.Y + Allocation.Height); + //gc.Dispose (); + } + + return true; + } } abstract class CustomPanedHandle : Gtk.EventBox From d97c5e598be60697e3c610f513ac9425ab4ad39c Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 29 Feb 2024 21:05:13 +0100 Subject: [PATCH 281/382] update --- .../MonoDevelop.Components/GtkUtil.cs | 115 +++++++++--------- 1 file changed, 58 insertions(+), 57 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs index d2f73ccc920..93ca7c98fca 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs @@ -29,6 +29,7 @@ using System.Linq; using System.Collections.Generic; using Gtk; +using Cairo; using System.Runtime.InteropServices; using Mono.Addins; using MonoDevelop.Core; @@ -971,66 +972,66 @@ public CellTooltipWindow (TreeView tree, TreeViewColumn col, TreePath path) col.CellSetCellData (tree.Model, iter, false, false); int x = 0; int th = 0; -// CellRenderer[] renderers = col.CellRenderers; -// foreach (CellRenderer cr in renderers) { -// int sp, wi, he, xo, yo; -// col.CellGetPosition (cr, out sp, out wi); -// Gdk.Rectangle crect = new Gdk.Rectangle (x, rect.Y, wi, rect.Height); -// cr.GetSize (tree, ref crect, out xo, out yo, out wi, out he); -// if (cr != renderers [renderers.Length - 1]) -// x += crect.Width + col.Spacing + 1; -// else -// x += wi + 1; -// if (he > th) th = he; -// } + // CellRenderer[] renderers = col.CellRenderers; + // foreach (CellRenderer cr in renderers) { + // int sp, wi, he, xo, yo; + // col.CellGetPosition (cr, out sp, out wi); + // Gdk.Rectangle crect = new Gdk.Rectangle (x, rect.Y, wi, rect.Height); + // cr.GetSize (tree, ref crect, out xo, out yo, out wi, out he); + // if (cr != renderers [renderers.Length - 1]) + // x += crect.Width + col.Spacing + 1; + // else + // x += wi + 1; + // if (he > th) th = he; + // } SetSizeRequest (x, th + 2); } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// base.OnExposeEvent (evnt); -// -// Gdk.Rectangle expose = Allocation; -// Gdk.Color save = Gdk.Color.Zero; -// bool hasFgColor = false; -// int x = 1; -// -// // Make sure that the row has not been removed inbetween. -// // If the model is a TreeStore, it can do the validation for us, otherwise we need to validate the path. -// if ((treeStore != null && treeStore.IterIsValid (iter) == false) || !tree.Model.GetIter (out iter, path)) { -// GtkUtil.HideTooltip (tree); -// return true; -// } -// col.CellSetCellData (tree.Model, iter, false, false); -// -// foreach (CellRenderer cr in col.CellRenderers) { -// if (!cr.Visible) -// continue; -// -// if (cr is CellRendererText) { -// hasFgColor = ((CellRendererText)cr).GetCellForegroundSet (); -// save = ((CellRendererText)cr).ForegroundGdk; -// ((CellRendererText)cr).ForegroundGdk = Style.Foreground (State); -// } -// -// int sp, wi, he, xo, yo; -// col.CellGetPosition (cr, out sp, out wi); -// Gdk.Rectangle bgrect = new Gdk.Rectangle (x, expose.Y, wi, expose.Height - 2); -// cr.GetSize (tree, ref bgrect, out xo, out yo, out wi, out he); -// int leftMargin = (int) ((bgrect.Width - wi) * cr.Xalign); -// int topMargin = (int) ((bgrect.Height - he) * cr.Yalign); -// Gdk.Rectangle cellrect = new Gdk.Rectangle (bgrect.X + leftMargin, bgrect.Y + topMargin + 1, wi, he); -// cr.Render (this.GdkWindow, this, bgrect, cellrect, expose, CellRendererState.Focused); -// x += bgrect.Width + col.Spacing + 1; -// -// if (cr is CellRendererText) { -// ((CellRendererText)cr).ForegroundGdk = save; -// ((CellRendererText)cr).SetCellForegroundSet (hasFgColor); -// } -// } -// -// return true; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + base.OnDrawn (evnt); + + Gdk.Rectangle expose = Allocation; + Gdk.Color save = Gdk.Color.Zero; + bool hasFgColor = false; + int x = 1; + + // Make sure that the row has not been removed inbetween. + // If the model is a TreeStore, it can do the validation for us, otherwise we need to validate the path. + if ((treeStore != null && treeStore.IterIsValid (iter) == false) || !tree.Model.GetIter (out iter, path)) { + GtkUtil.HideTooltip (tree); + return true; + } + col.CellSetCellData (tree.Model, iter, false, false); + + // foreach (CellRenderer cr in col.CellRenderers) { + // if (!cr.Visible) + // continue; + + // if (cr is CellRendererText) { + // hasFgColor = ((CellRendererText)cr).GetCellForegroundSet (); + // save = ((CellRendererText)cr).ForegroundGdk; + // ((CellRendererText)cr).ForegroundGdk = Style.Foreground (State); + // } + + // int sp, wi, he, xo, yo; + // col.CellGetPosition (cr, out sp, out wi); + // Gdk.Rectangle bgrect = new Gdk.Rectangle (x, expose.Y, wi, expose.Height - 2); + // cr.GetSize (tree, ref bgrect, out xo, out yo, out wi, out he); + // int leftMargin = (int) ((bgrect.Width - wi) * cr.Xalign); + // int topMargin = (int) ((bgrect.Height - he) * cr.Yalign); + // Gdk.Rectangle cellrect = new Gdk.Rectangle (bgrect.X + leftMargin, bgrect.Y + topMargin + 1, wi, he); + // cr.Render (this.GdkWindow, this, bgrect, cellrect, expose, CellRendererState.Focused); + // x += bgrect.Width + col.Spacing + 1; + + // if (cr is CellRendererText) { + // ((CellRendererText)cr).ForegroundGdk = save; + // ((CellRendererText)cr).SetCellForegroundSet (hasFgColor); + // } + // } + + return true; + } protected override bool OnButtonPressEvent (Gdk.EventButton evnt) { From 7f6506adcf27108147d15377898894291603ebd6 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 29 Feb 2024 22:12:43 +0100 Subject: [PATCH 282/382] restore --- .../CellRendererImage.cs | 54 +++++++++++++------ 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs index d85f95b959b..900ddacab2d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs @@ -130,23 +130,43 @@ public virtual Image ImageExpanderClosed { bool? ignoreSelection; -// protected override void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags) -// { -// var img = GetImage (); -// if (img == null) -// return; -// -// if ((flags & Gtk.CellRendererState.Selected) != 0) -// img = img.WithStyles ("sel"); -// if (!img.HasFixedSize) -// img = img.WithSize (Gtk.IconSize.Menu); -// -// using (var ctx = Gdk.CairoHelper.Create (window)) { -// var x = cell_area.X + cell_area.Width / 2 - (int)(img.Width / 2); -// var y = cell_area.Y + cell_area.Height / 2 - (int)(img.Height / 2); -// ctx.DrawImage (widget, img, x, y); -// } -// } + // protected override void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags) + // { + // // In light theme: + // // On the Mac, the default unfocused selection background is lighter, so the icon should be black + // // but our `sel` icons are white. + // // + // // Except in the solution treeview, because the Mac's default unfocused selection background is too light for the + // // custom treeview background + // if (!ignoreSelection.HasValue) { + // if (Platform.IsMac) { + // if (IdeTheme.UserInterfaceTheme == Theme.Light) { + // var baseColor = widget.Style.Base (widget.State).ToXwtColor (); + // ignoreSelection = baseColor.Brightness == 1; + // } else { + // ignoreSelection = false; + // } + // } else { + // ignoreSelection = false; + // } + // } + + // var img = GetImage (); + // if (img == null) + // return; + + // var shouldIgnoreSelection = ignoreSelection.GetValueOrDefault () && !widget.HasFocus; + // if (!shouldIgnoreSelection && ((flags & Gtk.CellRendererState.Selected) != 0)) + // img = img.WithStyles ("sel"); + // if (!img.HasFixedSize) + // img = img.WithSize (Gtk.IconSize.Menu); + + // using (var ctx = Gdk.CairoHelper.Create (window)) { + // var x = cell_area.X + cell_area.Width / 2 - (int)(img.Width / 2); + // var y = cell_area.Y + cell_area.Height / 2 - (int)(img.Height / 2); + // ctx.DrawImage (widget, img, x, y); + // } + // } protected void GetImageInfo (Gdk.Rectangle cell_area, out Image img, out int x, out int y) { From 20b2937a0cdae1423e60359b75ced0314569754f Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 29 Feb 2024 22:23:39 +0100 Subject: [PATCH 283/382] update --- .../MonoDevelop.Ide/MonoDevelop.Components/InfoBar.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/InfoBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/InfoBar.cs index e9b0329104c..74662c2c8cf 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/InfoBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/InfoBar.cs @@ -26,6 +26,7 @@ using System; using Gtk; +using Cairo; namespace MonoDevelop.Components { @@ -137,12 +138,12 @@ public void SetMessageLabel (string markup) } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { + protected override bool OnDrawn (Cairo.Context evnt) + { // Style.PaintFlatBox (Style, evnt.Window, StateType.Normal, ShadowType.Out, evnt.Area, this, "tooltip", // Allocation.X + 1, Allocation.Y + 1, Allocation.Width - 2, Allocation.Height - 2); -// return base.OnExposeEvent (evnt); -// } + return base.OnDrawn (evnt); + } protected override void OnSizeAllocated (Gdk.Rectangle allocation) { From 176c2dc65a2417223ef9e3f862d17c329f655a41 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 29 Feb 2024 22:48:21 +0100 Subject: [PATCH 284/382] update --- .../MonoDevelop.Components/TooltipWindow.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs index 3056beb14b3..990d8d41d7d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs @@ -30,6 +30,7 @@ using MonoDevelop.Ide; using Gtk; using Gdk; +using Cairo; namespace MonoDevelop.Components { @@ -76,15 +77,15 @@ public bool EnableTransparencyControl { } } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// int winWidth, winHeight; -// this.GetSize (out winWidth, out winHeight); -// Gtk.Style.PaintFlatBox (Style, this.GdkWindow, StateType.Normal, ShadowType.Out, evnt.Area, this, "tooltip", 0, 0, winWidth, winHeight); -// foreach (var child in this.Children) -// this.PropagateExpose (child, evnt); -// return false; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + int winWidth, winHeight; + this.GetSize (out winWidth, out winHeight); + //Gtk.Style.PaintFlatBox (Style, this.GdkWindow, StateType.Normal, ShadowType.Out, evnt.Area, this, "tooltip", 0, 0, winWidth, winHeight); + //foreach (var child in this.Children) + // this.PropagateExpose (child, evnt); + return false; + } protected override void OnDestroyed () { From 18103fc53c99ed5f7f39c651dce2b53fa3af147e Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 29 Feb 2024 23:14:29 +0100 Subject: [PATCH 285/382] update --- .../Mono.TextEditor/Gui/CodePreviewWindow.cs | 21 ++++++++++--------- .../SourceEditorWidget.cs | 11 +++++----- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodePreviewWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodePreviewWindow.cs index f518e6712d8..98be1e7770d 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodePreviewWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodePreviewWindow.cs @@ -23,6 +23,7 @@ using System; using Gdk; +using Cairo; using MonoDevelop.Components; using MonoDevelop.Ide.Editor; using MonoDevelop.Ide.Editor.Highlighting; @@ -167,16 +168,16 @@ protected override void OnDestroyed () base.OnDestroyed (); } - // protected override bool OnExposeEvent (EventExpose evnt) - // { - // using (var cr = CairoHelper.Create (GdkWindow)) { - // CairoHelper.Region (cr, evnt.Region); - // cr.Clip (); - // cr.Translate (Allocation.X, Allocation.Y); - // Draw (cr); - // } - // return true; - // } + protected override bool OnDrawn (Cairo.Context evnt) + { + using (var cr = Gdk.CairoHelper.Create (GdkWindow)) { + //CairoHelper.Region (cr, evnt.Region); + cr.Clip (); + cr.Translate (Allocation.X, Allocation.Y); + Draw (cr); + } + return true; + } void Draw (Cairo.Context cr) { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs index 6bb5efe35bc..fa43717099a 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs @@ -28,6 +28,7 @@ using System.Text; using System.Collections.Generic; using Gtk; +using Cairo; using Mono.TextEditor; //using Mono.TextEditor.AtkCocoaHelper; using MonoDevelop.Ide.Gui.Content; @@ -195,11 +196,11 @@ static bool HasAnyFocusedChild (Widget widget) class Border : Gtk.DrawingArea { -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// evnt.Window.DrawRectangle (this.Style.DarkGC (State), true, evnt.Area); -// return true; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + //evnt.Window.DrawRectangle (this.Style.DarkGC (State), true, evnt.Area); + return true; + } } From 35fccdb571eacbad0e40fda23c85811f15240b62 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 1 Mar 2024 00:09:48 +0100 Subject: [PATCH 286/382] update --- .../MonoDevelop.Components/DropDownBox.cs | 131 +++++++++--------- 1 file changed, 66 insertions(+), 65 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs index 992b1129860..bc6e9bceabc 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs @@ -27,6 +27,7 @@ using System; using System.ComponentModel; using Gtk; +using Cairo; using MonoDevelop.Ide; @@ -291,71 +292,71 @@ protected override bool OnMotionNotifyEvent (Gdk.EventMotion e) return base.OnMotionNotifyEvent (e); } -// protected override bool OnExposeEvent (Gdk.EventExpose args) -// { -// Gdk.Drawable win = args.Window; -// -// int width, height; -// layout.GetPixelSize (out width, out height); -// -// int arrowHeight = height / 2; -// int arrowWidth = arrowHeight + 1; -// int arrowXPos = this.Allocation.X + this.Allocation.Width - arrowWidth; -// if (DrawButtonShape) { -// arrowXPos -= 4; -// } else if (DrawRightBorder) { -// arrowXPos -= 2; -// } -// -// //HACK: don't ever draw insensitive, only active/prelight/normal, because insensitive generally looks really ugly -// //this *might* cause some theme issues with the state of the text/arrows rendering on top of it -// var state = window != null? StateType.Active -// : State == StateType.Insensitive? StateType.Normal : State; -// -// //HACK: paint the button background as if it were bigger, but it stays clipped to the real area, -// // so we get the content but not the border. This might break with crazy themes. -// //FIXME: we can't use the style's actual internal padding because GTK# hasn't wrapped GtkBorder AFAICT -// // (default-border, inner-border, default-outside-border, etc - see http://git.gnome.org/browse/gtk+/tree/gtk/gtkbutton.c) -// const int padding = 4; -// if (DrawButtonShape){ -// Style.PaintBox (Style, args.Window, state, ShadowType.None, args.Area, this, "button", -// Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); -// -// } else { -// Style.PaintBox (Style, args.Window, state, ShadowType.None, args.Area, this, "button", -// Allocation.X - padding, Allocation.Y - padding, Allocation.Width + padding * 2, Allocation.Height + padding * 2); -// } -// -// int xPos = Allocation.Left; -// if (Pixbuf != null) { -// using (var ctx = Gdk.CairoHelper.Create (win)) -// ctx.DrawImage (this, Pixbuf, xPos + pixbufSpacing, Allocation.Y + (Allocation.Height - Pixbuf.Height) / 2); -// xPos += (int)Pixbuf.Width + pixbufSpacing * 2; -// } -// if (DrawButtonShape) -// xPos += 4; -// -// //constrain the text area so it doesn't get rendered under the arrows -// var textArea = new Gdk.Rectangle (xPos, Allocation.Y + ySpacing, arrowXPos - xPos - 2, Allocation.Height - ySpacing); -// -// if (FixedWidth > 0) { -// layout.Ellipsize = Pango.EllipsizeMode.End; -// layout.Width = Allocation.Width - textArea.X; -// } -// -// Style.PaintLayout (Style, win, state, true, textArea, this, "", textArea.X, textArea.Y + Math.Max (0, (textArea.Height - height) / 2), layout); -// -// state = Sensitive ? StateType.Normal : StateType.Insensitive; -// Gtk.Style.PaintArrow (this.Style, win, state, ShadowType.None, args.Area, this, "", ArrowType.Up, true, arrowXPos, Allocation.Y + (Allocation.Height) / 2 - arrowHeight, arrowWidth, arrowHeight); -// Gtk.Style.PaintArrow (this.Style, win, state, ShadowType.None, args.Area, this, "", ArrowType.Down, true, arrowXPos, Allocation.Y + (Allocation.Height) / 2, arrowWidth, arrowHeight); -// if (!DrawButtonShape) { -// if (DrawRightBorder) -// win.DrawLine (this.Style.DarkGC (StateType.Normal), Allocation.X + Allocation.Width - 1, Allocation.Y, Allocation.X + Allocation.Width - 1, Allocation.Y + Allocation.Height); -// if (DrawLeftBorder) -// win.DrawLine (this.Style.DarkGC (StateType.Normal), Allocation.X, Allocation.Y, Allocation.X, Allocation.Y + Allocation.Height); -// } -// return false; -// } + protected override bool OnDrawn (Cairo.Context args) + { + //Gdk.Drawable win = args.window; + + int width, height; + layout.GetPixelSize (out width, out height); + + int arrowHeight = height / 2; + int arrowWidth = arrowHeight + 1; + int arrowXPos = this.Allocation.X + this.Allocation.Width - arrowWidth; + if (DrawButtonShape) { + arrowXPos -= 4; + } else if (DrawRightBorder) { + arrowXPos -= 2; + } + + //HACK: don't ever draw insensitive, only active/prelight/normal, because insensitive generally looks really ugly + //this *might* cause some theme issues with the state of the text/arrows rendering on top of it + var state = window != null? StateType.Active + : State == StateType.Insensitive? StateType.Normal : State; + + //HACK: paint the button background as if it were bigger, but it stays clipped to the real area, + // so we get the content but not the border. This might break with crazy themes. + //FIXME: we can't use the style's actual internal padding because GTK# hasn't wrapped GtkBorder AFAICT + // (default-border, inner-border, default-outside-border, etc - see http://git.gnome.org/browse/gtk+/tree/gtk/gtkbutton.c) + const int padding = 4; + //if (DrawButtonShape){ + // Style.PaintBox (Style, args.Window, state, ShadowType.None, args.Area, this, "button", + // Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); + + //} else { + // Style.PaintBox (Style, args.Window, state, ShadowType.None, args.Area, this, "button", + // Allocation.X - padding, Allocation.Y - padding, Allocation.Width + padding * 2, Allocation.Height + padding * 2); + //} + + int xPos = Allocation.Left; + if (Pixbuf != null) { + using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) + ctx.DrawImage (this, Pixbuf, xPos + pixbufSpacing, Allocation.Y + (Allocation.Height - Pixbuf.Height) / 2); + xPos += (int)Pixbuf.Width + pixbufSpacing * 2; + } + if (DrawButtonShape) + xPos += 4; + + //constrain the text area so it doesn't get rendered under the arrows + var textArea = new Gdk.Rectangle (xPos, Allocation.Y + ySpacing, arrowXPos - xPos - 2, Allocation.Height - ySpacing); + + if (FixedWidth > 0) { + layout.Ellipsize = Pango.EllipsizeMode.End; + layout.Width = Allocation.Width - textArea.X; + } + + //Style.PaintLayout (Style, win, state, true, textArea, this, "", textArea.X, textArea.Y + Math.Max (0, (textArea.Height - height) / 2), layout); + + state = Sensitive ? StateType.Normal : StateType.Insensitive; + //Gtk.Style.PaintArrow (this.Style, win, state, ShadowType.None, args.Area, this, "", ArrowType.Up, true, arrowXPos, Allocation.Y + (Allocation.Height) / 2 - arrowHeight, arrowWidth, arrowHeight); + //Gtk.Style.PaintArrow (this.Style, win, state, ShadowType.None, args.Area, this, "", ArrowType.Down, true, arrowXPos, Allocation.Y + (Allocation.Height) / 2, arrowWidth, arrowHeight); + //if (!DrawButtonShape) { + // if (DrawRightBorder) + // win.DrawLine (this.Style.DarkGC (StateType.Normal), Allocation.X + Allocation.Width - 1, Allocation.Y, Allocation.X + Allocation.Width - 1, Allocation.Y + Allocation.Height); + // if (DrawLeftBorder) + // win.DrawLine (this.Style.DarkGC (StateType.Normal), Allocation.X, Allocation.Y, Allocation.X, Allocation.Y + Allocation.Height); + //} + return false; + } public EventHandler ItemSet; } From 5963e502769272ab5e75a0db8c00e3ac109603a2 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 1 Mar 2024 11:56:03 +0100 Subject: [PATCH 287/382] update --- .../DropDownBoxListWindow.cs | 13 +-- .../MonoDevelop.Components/ExtendedLabel.cs | 84 +++++++++---------- 2 files changed, 49 insertions(+), 48 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs index 0758b6b8be4..14b8f28ec18 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs @@ -27,6 +27,7 @@ using System; using MonoDevelop.Ide; using Gtk; +using Cairo; using System.Text; using MonoDevelop.Components.AtkCocoaHelper; using MonoDevelop.Ide.Fonts; @@ -452,12 +453,12 @@ protected override bool OnScrollEvent (Gdk.EventScroll evnt) return base.OnScrollEvent (evnt); } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// base.OnExposeEvent (evnt); -// DrawList (); -// return false; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + base.OnDrawn (evnt); + DrawList (); + return false; + } void DrawList () { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ExtendedLabel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ExtendedLabel.cs index 82784ccf009..056555f7b62 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ExtendedLabel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ExtendedLabel.cs @@ -39,48 +39,48 @@ public ExtendedLabel (string text): base (text) { } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// Pango.Layout la = new Pango.Layout (PangoContext); -// int w, h; -// if (UseMarkup) -// la.SetMarkup (Text); -// else -// la.SetText (Text); -// -// la.GetPixelSize (out w, out h); -// -// int tx = Allocation.X + (int) Xpad + (int) ((float)(Allocation.Width - (int)(Xpad*2) - w) * Xalign); -// int ty = Allocation.Y + (int) Ypad + (int) ((float)(Allocation.Height - (int)(Ypad*2) - h) * Yalign); -// -// using (var ctx = CairoHelper.Create (evnt.Window)) { -// ctx.SetSourceColor (Style.Text (State).ToCairoColor ()); -// ctx.MoveTo (tx, ty); -// -// // In order to get the same result as in MonoDevelop.Components.DockNotebook.TabStrip.DrawTab() -// // (document tabs) we need to draw using a LinearGradient (because of issues below), -// // but we don't want to mask the actual text here, like in the doc tabs. -// // Therefore we use a LinearGradient and mask only the last vertical pixel line -// // of the label with 0.99 alpha, which forces Cairo to render the whole layout -// // in the desired way. -// -// // Semi-transparent gradient disables sub-pixel rendering of the label (reverting to grayscale antialiasing). -// // As Mac sub-pixel font rendering looks stronger than grayscale rendering, the label used in pad tabs -// // looked different. We need to simulate same gradient treatment as we have in document tabs. -// -// using (var lg = new LinearGradient (tx + w - 1, 0, tx + w, 0)) { -// var color = Style.Text (State).ToCairoColor (); -// lg.AddColorStop (0, color); -// color.A = 0.99; -// lg.AddColorStop (1, color); -// ctx.SetSource (lg); -// Pango.CairoHelper.ShowLayout (ctx, la); -// } -// } -// -// la.Dispose (); -// return true; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + Pango.Layout la = new Pango.Layout (PangoContext); + int w, h; + if (UseMarkup) + la.SetMarkup (Text); + else + la.SetText (Text); + + la.GetPixelSize (out w, out h); + + int tx = Allocation.X + (int) Xpad + (int) ((float)(Allocation.Width - (int)(Xpad*2) - w) * Xalign); + int ty = Allocation.Y + (int) Ypad + (int) ((float)(Allocation.Height - (int)(Ypad*2) - h) * Yalign); + + using (var ctx = CairoHelper.Create (GdkWindow)) { + //ctx.SetSourceColor (Style.Text (State).ToCairoColor ()); + ctx.MoveTo (tx, ty); + + // In order to get the same result as in MonoDevelop.Components.DockNotebook.TabStrip.DrawTab() + // (document tabs) we need to draw using a LinearGradient (because of issues below), + // but we don't want to mask the actual text here, like in the doc tabs. + // Therefore we use a LinearGradient and mask only the last vertical pixel line + // of the label with 0.99 alpha, which forces Cairo to render the whole layout + // in the desired way. + + // Semi-transparent gradient disables sub-pixel rendering of the label (reverting to grayscale antialiasing). + // As Mac sub-pixel font rendering looks stronger than grayscale rendering, the label used in pad tabs + // looked different. We need to simulate same gradient treatment as we have in document tabs. + + using (var lg = new LinearGradient (tx + w - 1, 0, tx + w, 0)) { + //var color = Style.Text (State).ToCairoColor (); + //lg.AddColorStop (0, color); + //color.A = 0.99; + //lg.AddColorStop (1, color); + ctx.SetSource (lg); + Pango.CairoHelper.ShowLayout (ctx, la); + } + } + + la.Dispose (); + return true; + } } } From 9088f2d1c3d41a28a0a3d0c5d2d48e1a640b2621 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 1 Mar 2024 12:06:32 +0100 Subject: [PATCH 288/382] update --- .../FixedWidthWrapLabel.cs | 25 ++++++++++--------- .../HoverImageButton.cs | 23 +++++++++-------- .../MonoDevelop.Components/ImageButton.cs | 19 +++++++------- 3 files changed, 35 insertions(+), 32 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FixedWidthWrapLabel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FixedWidthWrapLabel.cs index 52394c79657..a8b98d7aee6 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FixedWidthWrapLabel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FixedWidthWrapLabel.cs @@ -31,6 +31,7 @@ using System; using Gtk; +using Cairo; namespace MonoDevelop.Components { @@ -173,18 +174,18 @@ protected override void OnGetPreferredHeight (out int min_height, out int natura // } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// UpdateLayout (); -// if (evnt.Window != GdkWindow) { -// return base.OnExposeEvent (evnt); -// } -// -// Gtk.Style.PaintLayout (Style, GdkWindow, State, false, evnt.Area, -// this, null, Allocation.X, Allocation.Y, layout); -// -// return true; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + UpdateLayout (); + //if (evnt.Window != GdkWindow) { + // return base.OnExposeEvent (evnt); + //} + + //Gtk.Style.PaintLayout (Style, GdkWindow, State, false, evnt.Area, + // this, null, Allocation.X, Allocation.Y, layout); + + return true; + } public string Markup { get { return text; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HoverImageButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HoverImageButton.cs index fc782f8a216..e4fd8f5631e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HoverImageButton.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HoverImageButton.cs @@ -28,6 +28,7 @@ using System; using Gtk; +using Cairo; using MonoDevelop.Ide; using MonoDevelop.Components.AtkCocoaHelper; @@ -165,17 +166,17 @@ protected override bool OnButtonReleaseEvent(Gdk.EventButton evnt) return base.OnButtonReleaseEvent(evnt); } -// protected override bool OnExposeEvent(Gdk.EventExpose evnt) -// { -// base.OnExposeEvent(evnt); -// -// if(HasFocus && draw_focus) { -// Style.PaintFocus(Style, GdkWindow, StateType.Normal, evnt.Area, this, "button", -// 0, 0, Allocation.Width, Allocation.Height); -// } -// -// return true; -// } + protected override bool OnDrawn(Cairo.Context evnt) + { + base.OnDrawn(evnt); + + //if(HasFocus && draw_focus) { + // Style.PaintFocus(Style, GdkWindow, StateType.Normal, evnt.Area, this, "button", + // 0, 0, Allocation.Width, Allocation.Height); + //} + + return true; + } private void UpdateImage() { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageButton.cs index f02a34f4a0a..43073a8409a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageButton.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageButton.cs @@ -25,6 +25,7 @@ // THE SOFTWARE. using System; using Gdk; +using Cairo; using MonoDevelop.Components.AtkCocoaHelper; using MonoDevelop.Ide; @@ -99,15 +100,15 @@ void LoadImage () } } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// if (HasFocus && image != null) { -// Gtk.Style.PaintFocus (Style, GdkWindow, State, Allocation, this, "button", -// Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); -// } -// -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + //if (HasFocus && image != null) { + // Gtk.Style.PaintFocus (Style, GdkWindow, State, Allocation, this, "button", + // Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); + //} + + return base.OnDrawn (evnt); + } protected override bool OnEnterNotifyEvent (Gdk.EventCrossing evnt) { From 5ece0501e5321e0bc2fe6e87dd7727636da7e13b Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 1 Mar 2024 12:22:17 +0100 Subject: [PATCH 289/382] update --- .../MonoDevelop.Components/PopoverWidget.cs | 63 ++++++++++--------- .../MonoDevelop.Components/RoundedFrame.cs | 26 ++++---- 2 files changed, 45 insertions(+), 44 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWidget.cs index 54d2e19a9cc..d6b84cb9e48 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWidget.cs @@ -27,6 +27,7 @@ using System; using Gtk; using Gdk; +using Cairo; using Xwt.Motion; namespace MonoDevelop.Components @@ -161,34 +162,34 @@ void MaybeReanimate () AnimatedResize (); //Desired size changed mid animation } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// if ((position & PopupPosition.Top) != 0 || (position & PopupPosition.Bottom) != 0) -// theme.ArrowOffset = Allocation.Width / 2; -// else -// theme.ArrowOffset = Allocation.Height / 2; -// -// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { -// context.Save (); -// Theme.SetBorderPath (context, BorderAllocation, position); -// context.Clip (); -// OnDrawContent (evnt, context); // Draw content first so we can easily clip it -// context.Restore (); -// -// -// // protect against overriden methods which leave in a bad state -// context.Save (); -// if (Theme.DrawPager) { -// Theme.RenderPager (context, -// PangoContext, -// BorderAllocation); -// } -// -// Theme.RenderShadow (context, BorderAllocation, position); -// context.Restore (); -// } -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + if ((position & PopupPosition.Top) != 0 || (position & PopupPosition.Bottom) != 0) + theme.ArrowOffset = Allocation.Width / 2; + else + theme.ArrowOffset = Allocation.Height / 2; + + using (var context = Gdk.CairoHelper.Create (GdkWindow)) { + context.Save (); + Theme.SetBorderPath (context, BorderAllocation, position); + context.Clip (); + //OnDrawContent (evnt, context); // Draw content first so we can easily clip it + context.Restore (); + + + // protect against overriden methods which leave in a bad state + context.Save (); + if (Theme.DrawPager) { + Theme.RenderPager (context, + PangoContext, + BorderAllocation); + } + + Theme.RenderShadow (context, BorderAllocation, position); + context.Restore (); + } + return base.OnDrawn (evnt); + } protected virtual void OnDrawContent (Gdk.EventExpose evnt, Cairo.Context context) { @@ -219,7 +220,7 @@ void OnRedrawNeeded (object sender, EventArgs args) QueueDraw (); } - protected override void OnSizeAllocated (Rectangle allocation) + protected override void OnSizeAllocated (Gdk.Rectangle allocation) { if (!this.AnimationIsRunning ("Resize")) paintSize = new Gdk.Size (allocation.Width, allocation.Height); @@ -227,7 +228,7 @@ protected override void OnSizeAllocated (Rectangle allocation) base.OnSizeAllocated (allocation); } - protected Rectangle ChildAllocation { + protected Gdk.Rectangle ChildAllocation { get { var rect = BorderAllocation; rect.Inflate (-Theme.Padding - 1, -Theme.Padding - 1); @@ -235,7 +236,7 @@ protected Rectangle ChildAllocation { } } - Rectangle BorderAllocation { + Gdk.Rectangle BorderAllocation { get { var rect = new Gdk.Rectangle (Allocation.X, Allocation.Y, paintSize.Width, paintSize.Height); if (ShowArrow) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs index 41b5be2dcbd..4ca1662a2af 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs @@ -154,19 +154,19 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) // // its child not being scrollable. // } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// if (!IsDrawable) { -// return false; -// } -// -// using (Context cr = Gdk.CairoHelper.Create (evnt.Window)) { -// DrawFrame (cr, evnt.Area); -// if (child != null) -// PropagateExpose (child, evnt); -// return false; -// } -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + if (!IsDrawable) { + return false; + } + + using (Context cr = Gdk.CairoHelper.Create (GdkWindow)) { + //DrawFrame (cr, evnt.Area); + //if (child != null) + // PropagateExpose (child, evnt); + return false; + } + } private void DrawFrame (Cairo.Context cr, Gdk.Rectangle clip) { From 86d228aef7645af5db615ae708dc63e9d87c9661 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 1 Mar 2024 14:49:32 +0100 Subject: [PATCH 290/382] update --- .../PlaceholderWindow.cs | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs index a337f672ed7..8486dd261ca 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs @@ -31,6 +31,7 @@ using System; using Gdk; using Gtk; +using Cairo; namespace MonoDevelop.Components.Docking { @@ -101,22 +102,22 @@ void CreateShape (int width, int height) // } } - protected override void OnSizeAllocated (Rectangle allocation) + protected override void OnSizeAllocated (Gdk.Rectangle allocation) { base.OnSizeAllocated (allocation); CreateShape (allocation.Width, allocation.Height); } -// protected override bool OnExposeEvent (Gdk.EventExpose args) -// { -// //base.OnExposeEvent (args); -// int w, h; -// this.GetSize (out w, out h); -// this.GdkWindow.DrawRectangle (redgc, false, 0, 0, w-1, h-1); -// this.GdkWindow.DrawRectangle (redgc, false, 1, 1, w-3, h-3); -// return true; -// } + protected override bool OnDrawn (Cairo.Context args) + { + //base.OnExposeEvent (args); + int w, h; + this.GetSize (out w, out h); + //this.GdkWindow.DrawRectangle (redgc, false, 0, 0, w-1, h-1); + //this.GdkWindow.DrawRectangle (redgc, false, 1, 1, w-3, h-3); + return true; + } public void Relocate (int x, int y, int w, int h, bool animate) { From 8f3d7b427430c40bdd8e7653dc9b6767009b3b2d Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 1 Mar 2024 15:04:59 +0100 Subject: [PATCH 291/382] update --- .../ListWidget.cs | 405 +++++++++--------- 1 file changed, 203 insertions(+), 202 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs index ebd8b23fb45..682b255f3cd 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs @@ -29,6 +29,7 @@ using System.Linq; using Gdk; using Gtk; +using Cairo; using Pango; using MonoDevelop.Components; using MonoDevelop.Ide.Fonts; @@ -394,208 +395,208 @@ string NoSuggestionsMsg { get { return MonoDevelop.Core.GettextCatalog.GetString ("No suggestions"); } } -// protected override bool OnExposeEvent (Gdk.EventExpose args) -// { -// using (var context = Gdk.CairoHelper.Create (args.Window)) { -// var scalef = GtkWorkarounds.GetScaleFactor (this); -// context.LineWidth = 1; -// var alloc = Allocation; -// int width = alloc.Width; -// int height = alloc.Height; -// context.Rectangle (args.Area.X, args.Area.Y, args.Area.Width, args.Area.Height); -// var backgroundColor = Styles.CodeCompletion.BackgroundColor.ToCairoColor (); -// var textColor = Styles.CodeCompletion.TextColor.ToCairoColor (); -// var categoryColor = Styles.CodeCompletion.CategoryColor.ToCairoColor (); -// context.SetSourceColor (backgroundColor); -// context.Fill (); -// int xpos = iconTextSpacing; -// int yPos = (int)-vadj.Value; -// //when there are no matches, display a message to indicate that the completion list is still handling input -// if (filteredItems.Count == 0) { -// context.Rectangle (0, yPos, width, height - yPos); -// context.SetSourceColor (backgroundColor); -// context.Stroke (); -// noMatchLayout.SetText (DataProvider.ItemCount == 0 ? NoSuggestionsMsg : NoMatchesMsg); -// int lWidth, lHeight; -// noMatchLayout.GetPixelSize (out lWidth, out lHeight); -// context.SetSourceColor (textColor); -// context.MoveTo ((width - lWidth) / 2, yPos + (height - lHeight - yPos) / 2 - lHeight / 2); -// Pango.CairoHelper.ShowLayout (context, noMatchLayout); -// return false; -// } -// -// Iterate (true, ref yPos, delegate (CategorizedCompletionItems category, int ypos) { -// if (ypos >= height) -// return; -// if (ypos < -rowHeight) -// return; -// -// // window.DrawRectangle (this.Style.BackgroundGC (StateType.Insensitive), true, 0, yPos, width, rowHeight); -// int x = 2; -// if (category.CompletionCategory != null && !string.IsNullOrEmpty (category.CompletionCategory.Icon)) { -// var icon = ImageService.GetIcon (category.CompletionCategory.Icon, IconSize.Menu); -// context.DrawImage (this, icon, 0, ypos); -// x = (int)icon.Width + 4; -// } -// context.Rectangle (0, ypos, Allocation.Width, rowHeight); -// context.SetSourceColor (backgroundColor); -// context.Fill (); -// -// -// // layout.SetMarkup ("" + (category.CompletionCategory != null ? category.CompletionCategory.DisplayText : "Uncategorized") + ""); -// // window.DrawLayout (textGCInsensitive, x - 1, ypos + 1 + (rowHeight - py) / 2, layout); -// // layout.SetMarkup ("" + (category.CompletionCategory != null ? category.CompletionCategory.DisplayText : "Uncategorized") + ""); -// categoryLayout.SetMarkup ((category.CompletionCategory != null ? category.CompletionCategory.DisplayText : "Uncategorized")); -// int px, py; -// categoryLayout.GetPixelSize (out px, out py); -// context.MoveTo (x, ypos + (rowHeight - py) / 2); -// context.SetSourceColor (categoryColor); -// Pango.CairoHelper.ShowLayout (context, categoryLayout); -// }, delegate (CategorizedCompletionItems curCategory, int item, int itemidx, int ypos) { -// if (ypos >= height) -// return false; -// if (ypos < -rowHeight) -// return true; -// const int categoryModeItemIndenting = 0; -// if (InCategoryMode && curCategory != null && curCategory.CompletionCategory != null) { -// xpos = iconTextSpacing + categoryModeItemIndenting; -// } else { -// xpos = iconTextSpacing; -// } -// bool drawIconAsSelected = SelectionEnabled && item == SelectedItemIndex; -// string markup = DataProvider.HasMarkup (item) ? (DataProvider.GetMarkup (item) ?? "<null>") : GLib.Markup.EscapeText (DataProvider.GetText (item) ?? ""); -// string description = DataProvider.GetDescription (item, drawIconAsSelected); -// -// if (string.IsNullOrEmpty (description)) { -// layout.SetMarkup (markup); -// } else { -// layout.SetMarkup (markup + " " + description); -// } -// -// string text = DataProvider.GetText (item); -// -// if (!string.IsNullOrEmpty (text)) { -// int [] matchIndices = DataProvider.GetHighlightedTextIndices(item); -// if (matchIndices != null) { -// Pango.AttrList attrList = layout.Attributes ?? new Pango.AttrList (); -// for (int newSelection = 0; newSelection < matchIndices.Length; newSelection++) { -// int idx = matchIndices [newSelection]; -// var bold = new AttrWeight (Weight.Bold); -// -// bold.StartIndex = (uint)idx; -// bold.EndIndex = (uint)(idx + 1); -// attrList.Insert (bold); -// -// if (item != SelectedItemIndex) { -// var highlightColor = (item == SelectedItemIndex) ? Styles.CodeCompletion.SelectionHighlightColor : Styles.CodeCompletion.HighlightColor; -// var fg = new AttrForeground ((ushort)(highlightColor.Red * ushort.MaxValue), (ushort)(highlightColor.Green * ushort.MaxValue), (ushort)(highlightColor.Blue * ushort.MaxValue)); -// fg.StartIndex = (uint)idx; -// fg.EndIndex = (uint)(idx + 1); -// attrList.Insert (fg); -// } -// } -// layout.Attributes = attrList; -// } -// } -// -// Xwt.Drawing.Image icon = DataProvider.GetIcon (item); -// int iconHeight, iconWidth; -// if (icon != null) { -// if (drawIconAsSelected) -// icon = icon.WithStyles ("sel"); -// iconWidth = (int)icon.Width; -// iconHeight = (int)icon.Height; -// } else if (!Gtk.Icon.SizeLookup (IconSize.Menu, out iconWidth, out iconHeight)) { -// iconHeight = iconWidth = 24; -// } -// -// int wi, he, typos, iypos; -// layout.GetPixelSize (out wi, out he); -// -// -// typos = he < rowHeight ? ypos + (int)Math.Ceiling ((rowHeight - he) / 2.0) : ypos; -// if (scalef <= 1.0) -// typos -= 1; // 1px up on non HiDPI -// iypos = iconHeight < rowHeight ? ypos + (rowHeight - iconHeight) / 2 : ypos; -// if (item == SelectedItemIndex) { -// var barStyle = SelectionEnabled ? Styles.CodeCompletion.SelectionBackgroundColor : Styles.CodeCompletion.SelectionBackgroundInactiveColor; -// context.SetSourceColor (barStyle.ToCairoColor ()); -// -// if (SelectionEnabled) { -// context.Rectangle (0, ypos, Allocation.Width, rowHeight); -// context.Fill (); -// } else { -// context.LineWidth++; -// context.Rectangle (0.5, ypos + 0.5, Allocation.Width - 1, rowHeight - 1); -// context.Stroke (); -// context.LineWidth--; -// } -// } -// -// if (icon != null) { -// context.DrawImage (this, icon, xpos, iypos); -// xpos += iconTextSpacing; -// } -// context.SetSourceColor ((drawIconAsSelected ? Styles.CodeCompletion.SelectionTextColor : Styles.CodeCompletion.TextColor).ToCairoColor ()); -// var textXPos = xpos + iconWidth + 2; -// context.MoveTo (textXPos, typos); -// layout.Width = (int)((Allocation.Width - textXPos) * Pango.Scale.PangoScale); -// layout.Ellipsize = EllipsizeMode.End; -// Pango.CairoHelper.ShowLayout (context, layout); -// int textW, textH; -// layout.GetPixelSize (out textW, out textH); -// layout.Width = -1; -// layout.Ellipsize = EllipsizeMode.None; -// -// layout.SetMarkup (""); -// if (layout.Attributes != null) { -// layout.Attributes.Dispose (); -// layout.Attributes = null; -// } -// -// string rightText = DataProvider.GetRightSideDescription (item, drawIconAsSelected); -// if (!string.IsNullOrEmpty (rightText)) { -// layout.SetMarkup (rightText); -// -// int w, h; -// layout.GetPixelSize (out w, out h); -// const int leftpadding = 8; -// const int rightpadding = 3; -// w += rightpadding; -// w = Math.Min (w, Allocation.Width - textXPos - textW - leftpadding); -// wi += w; -// typos = h < rowHeight ? ypos + (rowHeight - h) / 2 : ypos; -// if (scalef <= 1.0) -// typos -= 1; // 1px up on non HiDPI -// context.MoveTo (Allocation.Width - w, typos); -// layout.Width = (int)(w * Pango.Scale.PangoScale); -// layout.Ellipsize = EllipsizeMode.End; -// -// Pango.CairoHelper.ShowLayout (context, layout); -// layout.Width = -1; -// layout.Ellipsize = EllipsizeMode.None; -// -// } -// -// if (Math.Min (maxListWidth, wi + xpos + iconWidth + 2) > listWidth) { -// WidthRequest = listWidth = Math.Min (maxListWidth, wi + xpos + iconWidth + 2 + iconTextSpacing); -// win.ResetSizes (); -// } else { -// //workaround for the vscrollbar display - the calculated width needs to be the width ofthe render region. -// if (Allocation.Width < listWidth) { -// if (listWidth - Allocation.Width < 30) { -// WidthRequest = listWidth + listWidth - Allocation.Width; -// win.ResetSizes (); -// } -// } -// } -// -// return true; -// }); -// -// return false; -// } -// } + protected override bool OnDrawn (Cairo.Context args) + { + using (var context = Gdk.CairoHelper.Create (GdkWindow)) { + var scalef = GtkWorkarounds.GetScaleFactor (this); + context.LineWidth = 1; + var alloc = Allocation; + int width = alloc.Width; + int height = alloc.Height; + //context.Rectangle (args.Area.X, args.Area.Y, args.Area.Width, args.Area.Height); + var backgroundColor = Styles.CodeCompletion.BackgroundColor.ToCairoColor (); + var textColor = Styles.CodeCompletion.TextColor.ToCairoColor (); + var categoryColor = Styles.CodeCompletion.CategoryColor.ToCairoColor (); + context.SetSourceColor (backgroundColor); + context.Fill (); + int xpos = iconTextSpacing; + int yPos = (int)-vadj.Value; + //when there are no matches, display a message to indicate that the completion list is still handling input + if (filteredItems.Count == 0) { + context.Rectangle (0, yPos, width, height - yPos); + context.SetSourceColor (backgroundColor); + context.Stroke (); + noMatchLayout.SetText (DataProvider.ItemCount == 0 ? NoSuggestionsMsg : NoMatchesMsg); + int lWidth, lHeight; + noMatchLayout.GetPixelSize (out lWidth, out lHeight); + context.SetSourceColor (textColor); + context.MoveTo ((width - lWidth) / 2, yPos + (height - lHeight - yPos) / 2 - lHeight / 2); + Pango.CairoHelper.ShowLayout (context, noMatchLayout); + return false; + } + + Iterate (true, ref yPos, delegate (CategorizedCompletionItems category, int ypos) { + if (ypos >= height) + return; + if (ypos < -rowHeight) + return; + + // window.DrawRectangle (this.Style.BackgroundGC (StateType.Insensitive), true, 0, yPos, width, rowHeight); + int x = 2; + if (category.CompletionCategory != null && !string.IsNullOrEmpty (category.CompletionCategory.Icon)) { + var icon = ImageService.GetIcon (category.CompletionCategory.Icon, IconSize.Menu); + context.DrawImage (this, icon, 0, ypos); + x = (int)icon.Width + 4; + } + context.Rectangle (0, ypos, Allocation.Width, rowHeight); + context.SetSourceColor (backgroundColor); + context.Fill (); + + + // layout.SetMarkup ("" + (category.CompletionCategory != null ? category.CompletionCategory.DisplayText : "Uncategorized") + ""); + // window.DrawLayout (textGCInsensitive, x - 1, ypos + 1 + (rowHeight - py) / 2, layout); + // layout.SetMarkup ("" + (category.CompletionCategory != null ? category.CompletionCategory.DisplayText : "Uncategorized") + ""); + categoryLayout.SetMarkup ((category.CompletionCategory != null ? category.CompletionCategory.DisplayText : "Uncategorized")); + int px, py; + categoryLayout.GetPixelSize (out px, out py); + context.MoveTo (x, ypos + (rowHeight - py) / 2); + context.SetSourceColor (categoryColor); + Pango.CairoHelper.ShowLayout (context, categoryLayout); + }, delegate (CategorizedCompletionItems curCategory, int item, int itemidx, int ypos) { + if (ypos >= height) + return false; + if (ypos < -rowHeight) + return true; + const int categoryModeItemIndenting = 0; + if (InCategoryMode && curCategory != null && curCategory.CompletionCategory != null) { + xpos = iconTextSpacing + categoryModeItemIndenting; + } else { + xpos = iconTextSpacing; + } + bool drawIconAsSelected = SelectionEnabled && item == SelectedItemIndex; + string markup = DataProvider.HasMarkup (item) ? (DataProvider.GetMarkup (item) ?? "<null>") : GLib.Markup.EscapeText (DataProvider.GetText (item) ?? ""); + string description = DataProvider.GetDescription (item, drawIconAsSelected); + + if (string.IsNullOrEmpty (description)) { + layout.SetMarkup (markup); + } else { + layout.SetMarkup (markup + " " + description); + } + + string text = DataProvider.GetText (item); + + if (!string.IsNullOrEmpty (text)) { + int [] matchIndices = DataProvider.GetHighlightedTextIndices(item); + if (matchIndices != null) { + Pango.AttrList attrList = layout.Attributes ?? new Pango.AttrList (); + for (int newSelection = 0; newSelection < matchIndices.Length; newSelection++) { + int idx = matchIndices [newSelection]; + var bold = new AttrWeight (Weight.Bold); + + bold.StartIndex = (uint)idx; + bold.EndIndex = (uint)(idx + 1); + attrList.Insert (bold); + + if (item != SelectedItemIndex) { + var highlightColor = (item == SelectedItemIndex) ? Styles.CodeCompletion.SelectionHighlightColor : Styles.CodeCompletion.HighlightColor; + var fg = new AttrForeground ((ushort)(highlightColor.Red * ushort.MaxValue), (ushort)(highlightColor.Green * ushort.MaxValue), (ushort)(highlightColor.Blue * ushort.MaxValue)); + fg.StartIndex = (uint)idx; + fg.EndIndex = (uint)(idx + 1); + attrList.Insert (fg); + } + } + layout.Attributes = attrList; + } + } + + Xwt.Drawing.Image icon = DataProvider.GetIcon (item); + int iconHeight, iconWidth; + if (icon != null) { + if (drawIconAsSelected) + icon = icon.WithStyles ("sel"); + iconWidth = (int)icon.Width; + iconHeight = (int)icon.Height; + } else if (!Gtk.Icon.SizeLookup (IconSize.Menu, out iconWidth, out iconHeight)) { + iconHeight = iconWidth = 24; + } + + int wi, he, typos, iypos; + layout.GetPixelSize (out wi, out he); + + + typos = he < rowHeight ? ypos + (int)Math.Ceiling ((rowHeight - he) / 2.0) : ypos; + if (scalef <= 1.0) + typos -= 1; // 1px up on non HiDPI + iypos = iconHeight < rowHeight ? ypos + (rowHeight - iconHeight) / 2 : ypos; + if (item == SelectedItemIndex) { + var barStyle = SelectionEnabled ? Styles.CodeCompletion.SelectionBackgroundColor : Styles.CodeCompletion.SelectionBackgroundInactiveColor; + context.SetSourceColor (barStyle.ToCairoColor ()); + + if (SelectionEnabled) { + context.Rectangle (0, ypos, Allocation.Width, rowHeight); + context.Fill (); + } else { + context.LineWidth++; + context.Rectangle (0.5, ypos + 0.5, Allocation.Width - 1, rowHeight - 1); + context.Stroke (); + context.LineWidth--; + } + } + + if (icon != null) { + context.DrawImage (this, icon, xpos, iypos); + xpos += iconTextSpacing; + } + context.SetSourceColor ((drawIconAsSelected ? Styles.CodeCompletion.SelectionTextColor : Styles.CodeCompletion.TextColor).ToCairoColor ()); + var textXPos = xpos + iconWidth + 2; + context.MoveTo (textXPos, typos); + layout.Width = (int)((Allocation.Width - textXPos) * Pango.Scale.PangoScale); + layout.Ellipsize = EllipsizeMode.End; + Pango.CairoHelper.ShowLayout (context, layout); + int textW, textH; + layout.GetPixelSize (out textW, out textH); + layout.Width = -1; + layout.Ellipsize = EllipsizeMode.None; + + layout.SetMarkup (""); + if (layout.Attributes != null) { + layout.Attributes.Dispose (); + layout.Attributes = null; + } + + string rightText = DataProvider.GetRightSideDescription (item, drawIconAsSelected); + if (!string.IsNullOrEmpty (rightText)) { + layout.SetMarkup (rightText); + + int w, h; + layout.GetPixelSize (out w, out h); + const int leftpadding = 8; + const int rightpadding = 3; + w += rightpadding; + w = Math.Min (w, Allocation.Width - textXPos - textW - leftpadding); + wi += w; + typos = h < rowHeight ? ypos + (rowHeight - h) / 2 : ypos; + if (scalef <= 1.0) + typos -= 1; // 1px up on non HiDPI + context.MoveTo (Allocation.Width - w, typos); + layout.Width = (int)(w * Pango.Scale.PangoScale); + layout.Ellipsize = EllipsizeMode.End; + + Pango.CairoHelper.ShowLayout (context, layout); + layout.Width = -1; + layout.Ellipsize = EllipsizeMode.None; + + } + + if (Math.Min (maxListWidth, wi + xpos + iconWidth + 2) > listWidth) { + WidthRequest = listWidth = Math.Min (maxListWidth, wi + xpos + iconWidth + 2 + iconTextSpacing); + win.ResetSizes (); + } else { + //workaround for the vscrollbar display - the calculated width needs to be the width ofthe render region. + if (Allocation.Width < listWidth) { + if (listWidth - Allocation.Width < 30) { + WidthRequest = listWidth + listWidth - Allocation.Width; + win.ResetSizes (); + } + } + } + + return true; + }); + + return false; + } + } public int TextOffset { get { From f9c5910681738a165022997963c920d1dc5a3a10 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 1 Mar 2024 15:24:57 +0100 Subject: [PATCH 292/382] update --- .../PropertyEditorCell.cs | 57 ++++++++++--------- .../PropertyGridTable.cs | 36 ++++++------ 2 files changed, 47 insertions(+), 46 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs index d06ede4f604..889571dd3da 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs @@ -30,6 +30,7 @@ using System.ComponentModel; using Gdk; using Gtk; +using Cairo; using MonoDevelop.Ide.Fonts; using MonoDevelop.Core; using MonoDevelop.Ide; @@ -79,7 +80,7 @@ internal void Initialize (Widget container, EditorManager editorManager, ITypeDe Initialize (); } - public EditSession StartEditing (Rectangle cellArea, StateType state) + public EditSession StartEditing (Gdk.Rectangle cellArea, StateType state) { IPropertyEditor ed = CreateEditor (cellArea, state); if (ed == null) @@ -141,20 +142,20 @@ public virtual void GetSize (int availableWidth, out int width, out int height) layout.GetPixelSize (out width, out height); } -// public virtual void Render (Drawable window, Cairo.Context ctx, Rectangle bounds, StateType state) -// { -// int w, h; -// layout.GetPixelSize (out w, out h); -// int dy = (bounds.Height - h) / 2; -// -// ctx.Save (); -// ctx.SetSourceColor (container.Style.Text (state).ToCairoColor ()); -// ctx.MoveTo (bounds.X, dy + bounds.Y); -// Pango.CairoHelper.ShowLayout (ctx, layout); -// ctx.Restore (); -// } - - protected virtual IPropertyEditor CreateEditor (Rectangle cellArea, StateType state) + // public virtual void Render (Drawable window, Cairo.Context ctx, Rectangle bounds, StateType state) + // { + // int w, h; + // layout.GetPixelSize (out w, out h); + // int dy = (bounds.Height - h) / 2; + + // ctx.Save (); + // ctx.SetSourceColor (container.Style.Text (state).ToCairoColor ()); + // ctx.MoveTo (bounds.X, dy + bounds.Y); + // Pango.CairoHelper.ShowLayout (ctx, layout); + // ctx.Restore (); + // } + + protected virtual IPropertyEditor CreateEditor (Gdk.Rectangle cellArea, StateType state) { if (DialogueEdit && (!Property.IsReadOnly || EditsReadOnlyObject)) { return new PropertyDialogueEditor (this, context); @@ -344,19 +345,19 @@ public CellRendererWidget (PropertyEditorCell cell, ITypeDescriptorContext conte this.ModifyBg (StateType.Normal, this.Style.White); } -// protected override bool OnExposeEvent (EventExpose evnt) -// { -// bool res = base.OnExposeEvent (evnt); -// cell.Initialize (this, em, context); -// -// Rectangle rect = Allocation; -// rect.Inflate (-3, 0);// Add some margin -// -// using (Cairo.Context ctx = CairoHelper.Create (GdkWindow)) { -// cell.Render (GdkWindow, ctx, rect, StateType.Normal); -// } -// return res; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + bool res = base.OnDrawn (evnt); + cell.Initialize (this, em, context); + + Gdk.Rectangle rect = Allocation; + rect.Inflate (-3, 0);// Add some margin + + //using (Cairo.Context ctx = Gdk.CairoHelper.Create (GdkWindow)) { + // cell.Render (GdkWindow, ctx, rect, StateType.Normal); + //} + return res; + } } class PropertyDialogueEditor: HBox, IPropertyEditor diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs index 93ec59400cf..82e29adc805 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs @@ -534,24 +534,24 @@ void MeasureHeight (IEnumerable rowList, ref int y) layout.Dispose (); } -// protected override bool OnExposeEvent (EventExpose evnt) -// { -// using (Cairo.Context ctx = CairoHelper.Create (evnt.Window)) { -// int dx = (int)((double)Allocation.Width * dividerPosition); -// ctx.LineWidth = 1; -// ctx.Rectangle (0, 0, Allocation.Width, Allocation.Height); -// ctx.SetSourceColor (Styles.PropertyPadLabelBackgroundColor.ToCairoColor ()); -// ctx.Fill (); -// ctx.MoveTo (dx + 0.5, 0); -// ctx.RelLineTo (0, Allocation.Height); -// ctx.SetSourceColor (Styles.PropertyPadDividerColor.ToCairoColor ()); -// ctx.Stroke (); -// -// int y = 0; -// Draw (ctx, rows, dx, PropertyLeftPadding, ref y); -// } -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + using (Cairo.Context ctx = Gdk.CairoHelper.Create (GdkWindow)) { + int dx = (int)((double)Allocation.Width * dividerPosition); + ctx.LineWidth = 1; + ctx.Rectangle (0, 0, Allocation.Width, Allocation.Height); + ctx.SetSourceColor (Styles.PropertyPadLabelBackgroundColor.ToCairoColor ()); + ctx.Fill (); + ctx.MoveTo (dx + 0.5, 0); + ctx.RelLineTo (0, Allocation.Height); + ctx.SetSourceColor (Styles.PropertyPadDividerColor.ToCairoColor ()); + ctx.Stroke (); + + int y = 0; + Draw (ctx, rows, dx, PropertyLeftPadding, ref y); + } + return base.OnDrawn (evnt); + } void Draw (Cairo.Context ctx, List rowList, int dividerX, int x, ref int y) { From f884476b6925c93489cfc216a1f9d286a3843e3a Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 1 Mar 2024 15:48:54 +0100 Subject: [PATCH 293/382] update --- .../TooltipProviderWrapper.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs index 2c63dac0a27..d85d6d2db1d 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs @@ -157,10 +157,10 @@ public void Dispose () lastItem = null; } - // public override bool TryCloseTooltipWindow (Xwt.WindowFrame tipWindow, Ide.Editor.TooltipCloseReason reason) - // { - // return provider.TryCloseTooltipWindow (tipWindow, reason); - // } + public override bool TryCloseTooltipWindow (Xwt.WindowFrame tipWindow, Ide.Editor.TooltipCloseReason reason) + { + return provider.TryCloseTooltipWindow (tipWindow, reason); + } #endregion } } \ No newline at end of file From f05b8480ad2e3f22e9b55aea3278d3519d069269 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 1 Mar 2024 17:19:15 +0100 Subject: [PATCH 294/382] update --- .../Mono.TextEditor.PopupWindow/ListWindow.cs | 19 ++++++------ .../AnimatedWidget.cs | 23 +++++++------- .../BounceFadePopupWindow.cs | 30 +++++++++---------- 3 files changed, 37 insertions(+), 35 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWindow.cs index d5375bdfdef..bff1535264d 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWindow.cs @@ -27,6 +27,7 @@ using Gtk; using Gdk; +using Cairo; using Pango; using System; using System.Text; @@ -368,15 +369,15 @@ protected virtual void OnSelectionChanged () { } -// protected override bool OnExposeEvent (Gdk.EventExpose args) -// { -// base.OnExposeEvent (args); -// -// int winWidth, winHeight; -// this.GetSize (out winWidth, out winHeight); -// this.GdkWindow.DrawRectangle (this.Style.ForegroundGC (StateType.Insensitive), false, 0, 0, winWidth-1, winHeight-1); -// return false; -// } + protected override bool OnDrawn (Cairo.Context args) + { + base.OnDrawn (args); + + int winWidth, winHeight; + this.GetSize (out winWidth, out winHeight); + //this.GdkWindow.DrawRectangle (this.Style.ForegroundGC (StateType.Insensitive), false, 0, 0, winWidth-1, winHeight-1); + return false; + } public int TextOffset { get { return list.TextOffset + (int) this.BorderWidth; } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs index a1cdedec1c7..ca7c5cb7626 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using Gdk; +using Cairo; using Gtk; using MonoDevelop.Components; using MonoDevelop.Core; @@ -62,7 +63,7 @@ internal class AnimatedWidget : Container private readonly bool horizontal; private double percent; - private Rectangle widget_alloc; + private Gdk.Rectangle widget_alloc; // private Pixmap canvas; public AnimatedWidget (Widget widget, uint duration, Easing easing, Blocking blocking, bool horizontal) @@ -162,7 +163,7 @@ protected override void OnGetPreferredHeight (out int minimum_height, out int na minimum_height = natural_height = Height; } - protected override void OnSizeAllocated (Rectangle allocation) + protected override void OnSizeAllocated (Gdk.Rectangle allocation) { base.OnSizeAllocated (allocation); if (Widget != null) { @@ -186,15 +187,15 @@ protected override void OnSizeAllocated (Rectangle allocation) } } -// protected override bool OnExposeEvent (EventExpose evnt) -// { -// if (canvas != null) { -// GdkWindow.DrawDrawable (Style.BackgroundGC (State), canvas, 0, 0, widget_alloc.X, widget_alloc.Y, widget_alloc.Width, widget_alloc.Height); -// return true; -// } -// -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + //if (canvas != null) { + //GdkWindow.DrawDrawable (Style.BackgroundGC (State), canvas, 0, 0, widget_alloc.X, widget_alloc.Y, widget_alloc.Width, widget_alloc.Height); + // return true; + //} + + return base.OnDrawn (evnt); + } protected override void ForAll (bool include_internals, Callback callback) { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs index 0fd55e2cbc5..5873275cd85 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs @@ -338,21 +338,21 @@ protected virtual bool OnAnimationActorStep (Actor actor) return true; } - // protected override bool OnDrawn (Context cr) - // { - // try { - // var alloc = Allocation; - // cr.Translate (alloc.X, alloc.Y); - // cr.Translate (xExpandedOffset * (1 - scale), yExpandedOffset * (1 - scale)); - // var scaleX = (alloc.Width / userspaceArea.Width - 1) * scale + 1; - // var scaleY = (alloc.Height / userspaceArea.Height - 1) * scale + 1; - // cr.Scale (scaleX, scaleY); - // Draw (cr, userspaceArea); - // } catch (Exception e) { - // LoggingService.LogError ("Exception in animation:", e); - // } - // return true; - // } + protected override bool OnDrawn (Context cr) + { + try { + var alloc = Allocation; + cr.Translate (alloc.X, alloc.Y); + cr.Translate (xExpandedOffset * (1 - scale), yExpandedOffset * (1 - scale)); + var scaleX = (alloc.Width / userspaceArea.Width - 1) * scale + 1; + var scaleY = (alloc.Height / userspaceArea.Height - 1) * scale + 1; + cr.Scale (scaleX, scaleY); + Draw (cr, userspaceArea); + } catch (Exception e) { + LoggingService.LogError ("Exception in animation:", e); + } + return true; + } protected abstract void Draw (Cairo.Context context, Cairo.Rectangle area); From f3d6bce3f0fcaaabbd5f967e6ce8ae69dadf5870 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 1 Mar 2024 17:39:45 +0100 Subject: [PATCH 295/382] update --- .../QuickTaskMiniMapMode.cs | 87 ++++++++++--------- .../OverlayMessageWindow.cs | 37 ++++---- 2 files changed, 63 insertions(+), 61 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskMiniMapMode.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskMiniMapMode.cs index f16748d7e71..794535bf06f 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskMiniMapMode.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskMiniMapMode.cs @@ -28,6 +28,7 @@ using Gtk; using Mono.TextEditor; using Gdk; +using Cairo; using MonoDevelop.Core; using MonoDevelop.Components; using MonoDevelop.Core.Text; @@ -178,7 +179,7 @@ protected override void OnDestroyed () DestroyBgBuffer (); } - protected override void OnSizeAllocated (Rectangle allocation) + protected override void OnSizeAllocated (Gdk.Rectangle allocation) { base.OnSizeAllocated (allocation); if (allocation.Width > 1 && (allocation.Width != curWidth || allocation.Height != curHeight)) @@ -321,48 +322,48 @@ int GetBufferYOffset () // return Math.Max (0, (int)(h * (vadjustment.Value) / (vadjustment.Upper - vadjustment.Lower - vadjustment.PageSize))); } -// protected override bool OnExposeEvent (Gdk.EventExpose e) -// { -// if (TextEditor == null) -// return true; -// using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { -// cr.LineWidth = 1; -// if (backgroundPixbuf != null) { -// e.Window.DrawDrawable (Style.BlackGC, backgroundPixbuf, 0, GetBufferYOffset (), 0, 0, Allocation.Width, Allocation.Height); -// } else { -// cr.Rectangle (0, 0, Allocation.Width, Allocation.Height); -// if (TextEditor.EditorTheme != null) -// cr.SetSourceColor (SyntaxHighlightingService.GetColor (TextEditor.EditorTheme, EditorThemeColors.Background)); -// cr.Fill (); -// } -// /* -// cr.Color = (HslColor)Style.Dark (State); -// cr.MoveTo (-0.5, 0.5); -// cr.LineTo (Allocation.Width, 0.5); -// cr.MoveTo (-0.5, Allocation.Height - 0.5); -// cr.LineTo (Allocation.Width, Allocation.Height - 0.5); -// cr.Stroke ();*/ -// -// if (backgroundPixbuf != null) { -// int y = GetBufferYOffset (); -// -// int startLine = TextEditor.YToLine (vadjustment.Value); -// double dy = TextEditor.LogicalToVisualLocation (startLine, 1).Line * lineHeight; -// -// cr.Rectangle (0, -// dy - y, -// Allocation.Width, -// lineHeight * vadjustment.PageSize / TextEditor.LineHeight); -// var c = (Cairo.Color)(HslColor)Style.Dark (State); -// c.A = 0.2; -// cr.SetSourceColor (c); -// cr.Fill (); -// } -// DrawLeftBorder (cr); -// } -// -// return true; -// } + protected override bool OnDrawn (Cairo.Context e) + { + if (TextEditor == null) + return true; + using (Cairo.Context cr = Gdk.CairoHelper.Create (GdkWindow)) { + cr.LineWidth = 1; + // if (backgroundPixbuf != null) { + // e.Window.DrawDrawable (Style.BlackGC, backgroundPixbuf, 0, GetBufferYOffset (), 0, 0, Allocation.Width, Allocation.Height); + // } else { + // cr.Rectangle (0, 0, Allocation.Width, Allocation.Height); + // if (TextEditor.EditorTheme != null) + // cr.SetSourceColor (SyntaxHighlightingService.GetColor (TextEditor.EditorTheme, EditorThemeColors.Background)); + // cr.Fill (); + // } + /* + cr.Color = (HslColor)Style.Dark (State); + cr.MoveTo (-0.5, 0.5); + cr.LineTo (Allocation.Width, 0.5); + cr.MoveTo (-0.5, Allocation.Height - 0.5); + cr.LineTo (Allocation.Width, Allocation.Height - 0.5); + cr.Stroke ();*/ + + // if (backgroundPixbuf != null) { + // int y = GetBufferYOffset (); + + // int startLine = TextEditor.YToLine (vadjustment.Value); + // double dy = TextEditor.LogicalToVisualLocation (startLine, 1).Line * lineHeight; + + // cr.Rectangle (0, + // dy - y, + // Allocation.Width, + // lineHeight * vadjustment.PageSize / TextEditor.LineHeight); + // var c = (Cairo.Color)(HslColor)Style.Dark (State); + // c.A = 0.2; + // cr.SetSourceColor (c); + // cr.Fill (); + // } + DrawLeftBorder (cr); + } + + return true; + } } } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs index 81c20a8f3f0..c861459c3a6 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs @@ -28,6 +28,7 @@ using Gtk; using MonoDevelop.Components; using Gdk; +using Cairo; using MonoDevelop.Ide.Editor.Highlighting; namespace MonoDevelop.SourceEditor @@ -100,24 +101,24 @@ void AdjustPositionInEditor (Gdk.Rectangle alloc) textEditor.MoveTopLevelWidget (this, (textEditor.Allocation.Width - alloc.Width) / 2, textEditor.Allocation.Height - alloc.Height - 8); } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// using (var cr = CairoHelper.Create (evnt.Window)) { -// cr.LineWidth = 1; -// cr.Rectangle (0, 0, Allocation.Width, Allocation.Height); -// -// cr.SetSourceColor (SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.NotificationTextBackground)); -// cr.Fill (); -// cr.RoundedRectangle (0, 0, Allocation.Width, Allocation.Height, 3); -// cr.SetSourceColor (SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.NotificationTextBackground)); -// cr.FillPreserve (); -// -// cr.SetSourceColor (SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.NotificationBorder)); -// cr.Stroke(); -// } -// -// return base.OnExposeEvent (evnt); -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + using (var cr = Gdk.CairoHelper.Create (GdkWindow)) { + cr.LineWidth = 1; + cr.Rectangle (0, 0, Allocation.Width, Allocation.Height); + + cr.SetSourceColor (SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.NotificationTextBackground)); + cr.Fill (); + cr.RoundedRectangle (0, 0, Allocation.Width, Allocation.Height, 3); + cr.SetSourceColor (SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.NotificationTextBackground)); + cr.FillPreserve (); + + cr.SetSourceColor (SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.NotificationBorder)); + cr.Stroke(); + } + + return base.OnDrawn (evnt); + } } } From 2222277020c959ee09255afb2203e2845f3774c5 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 1 Mar 2024 18:25:25 +0100 Subject: [PATCH 296/382] update --- .../Mono.TextEditor.PopupWindow/ListWidget.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs index 0a9b646add7..188cf01f55b 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs @@ -190,12 +190,12 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) base.OnSizeAllocated (allocation); } -// protected override bool OnExposeEvent (Gdk.EventExpose args) -// { -// base.OnExposeEvent (args); -// DrawList (args); -// return true; -// } + protected override bool OnDrawn (Cairo.Context args) + { + base.OnDrawn (args); + //DrawList (args); + return true; + } public int TextOffset { get { @@ -208,9 +208,9 @@ public int TextOffset { } //FIXME: we could use the expose event's clipbox to make the drawing more efficient - void DrawList (Gdk.EventExpose args) + void DrawList (Cairo.Context args) { - var window = args.Window; + var window = GdkWindow; int winWidth, winHeight; // window.GetSize (out winWidth, out winHeight); From ad7e08375e35c6e16499ac55ac54ee54f521c78e Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 1 Mar 2024 20:22:43 +0100 Subject: [PATCH 297/382] update --- .../KeyBindingsPanel.cs | 227 +++++++----------- 1 file changed, 82 insertions(+), 145 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs index 20918f481af..1d35b739813 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs @@ -955,151 +955,88 @@ bool GetCellPosition (int mx, int my, out int cellx, out int celly, out TreeIter return false; } -// protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) -// { -// if (string.IsNullOrEmpty (Text)) -// return; -// -// using (var cr = Gdk.CairoHelper.Create (window)) { -// using (var layout = new Pango.Layout (widget.PangoContext)) { -// var xpad = (int)Xpad; -// int w, h; -// Cairo.Color bgColor, fgColor; -// foreach (var key in Text.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { -// -// HashSet bindingConflicts; -// if (keyBindingsPanel.conflicts.TryGetValue (key, out bindingConflicts) && bindingConflicts.Contains (Command)) { -// bgColor = Styles.KeyBindingsPanel.KeyConflictBackgroundColor.ToCairoColor (); -// fgColor = Styles.KeyBindingsPanel.KeyConflictForegroundColor.ToCairoColor (); -// } else if (keyBindingsPanel.duplicates.ContainsKey (key)) { -// bgColor = Styles.KeyBindingsPanel.KeyDuplicateBackgroundColor.ToCairoColor (); -// fgColor = Styles.KeyBindingsPanel.KeyDuplicateForegroundColor.ToCairoColor (); -// } else { -// bgColor = Styles.KeyBindingsPanel.KeyBackgroundColor.ToCairoColor (); -// fgColor = Styles.KeyBindingsPanel.KeyForegroundColor.ToCairoColor (); -// } -// -// layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); -// layout.FontDescription = KeySymbolFont; -// layout.GetPixelSize (out w, out h); -// -// int buttonWidth = w + (2 * KeyHPadding); -// int buttonHeight = h + (2 * KeyVPadding); -// int x = cell_area.X + xpad; -// double y = cell_area.Y + ((cell_area.Height / 2) - (buttonHeight / 2)); -// -// cr.RoundedRectangle (x, y, buttonWidth, buttonHeight, KeyBgRadius); -// cr.LineWidth = 1; -// cr.SetSourceColor (bgColor); -// cr.FillPreserve (); -// cr.SetSourceColor (bgColor); -// cr.Stroke (); -// -// cr.SetSourceColor (fgColor); -// cr.MoveTo (x + KeyHPadding, y + KeyVPadding); -// cr.ShowLayout (layout); -// xpad += buttonWidth + Spacing; -// } -// } -// } -// } - -// public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) -// { -// base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); -// x_offset = y_offset = 0; -// if (string.IsNullOrEmpty (Text)) { -// width = 0; -// height = 0; -// return; -// } -// -// using (var layout = new Pango.Layout (widget.PangoContext)) { -// height = 0; -// width = (int)Xpad; -// int w, h, buttonWidth; -// foreach (var key in Text.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { -// layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); -// layout.FontDescription = KeySymbolFont; -// layout.GetPixelSize (out w, out h); -// if (height == 0) -// height = h + (KeyVPadding * 2) + 1; -// -// buttonWidth = w + (2 * KeyHPadding); -// width += buttonWidth + Spacing; -// } -// } -// } - - // HashSet bindingConflicts; - // if (keyBindingsPanel.conflicts.TryGetValue (key, out bindingConflicts) && bindingConflicts.Contains (Command)) { - // bgColor = Styles.KeyBindingsPanel.KeyConflictBackgroundColor.ToCairoColor (); - // fgColor = Styles.KeyBindingsPanel.KeyConflictForegroundColor.ToCairoColor (); - // } else if (keyBindingsPanel.duplicates.ContainsKey (key)) { - // bgColor = Styles.KeyBindingsPanel.KeyDuplicateBackgroundColor.ToCairoColor (); - // fgColor = Styles.KeyBindingsPanel.KeyDuplicateForegroundColor.ToCairoColor (); - // } else { - // bgColor = Styles.KeyBindingsPanel.KeyBackgroundColor.ToCairoColor (); - // fgColor = Styles.KeyBindingsPanel.KeyForegroundColor.ToCairoColor (); - // } - - // layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); - // layout.FontDescription = KeySymbolFont; - // layout.GetPixelSize (out w, out h); - - // int buttonWidth = w + (2 * KeyHPadding); - // int buttonHeight = h + (2 * KeyVPadding); - // int x = cell_area.X + xpad; - // double y = cell_area.Y + ((cell_area.Height / 2) - (buttonHeight / 2)); - - // cr.RoundedRectangle (x, y, buttonWidth, buttonHeight, KeyBgRadius); - // cr.LineWidth = 1; - // cr.SetSourceColor (bgColor); - // cr.FillPreserve (); - // cr.SetSourceColor (bgColor); - // cr.Stroke (); - - // cr.SetSourceColor (fgColor); - // cr.MoveTo (x + KeyHPadding, y + KeyVPadding); - // cr.ShowLayout (layout); - // xpad += buttonWidth + Spacing; - // } - // } - // } - // } - - // public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - // { - // base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - // x_offset = y_offset = 0; - // if (string.IsNullOrEmpty (Text)) { - // width = 0; - // height = 0; - // return; - // } - - // using (var layout = new Pango.Layout (widget.PangoContext)) { - // height = 0; - // width = (int)Xpad; - // int w, h, buttonWidth; - // foreach (var key in Text.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { - // layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); - // layout.FontDescription = KeySymbolFont; - // layout.GetPixelSize (out w, out h); - // if (height == 0) - // height = h + (KeyVPadding * 2) + 1; - - // buttonWidth = w + (2 * KeyHPadding); - // width += buttonWidth + Spacing; - // } - // } - // } -// protected override void OnDestroyed() -// { -// keyBindingsPanel = null; -// HideConflictTooltip (); -// base.OnDestroyed(); -// } + // protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) + // { + // if (string.IsNullOrEmpty (Text)) + // return; + + // using (var cr = Gdk.CairoHelper.Create (window)) { + // using (var layout = new Pango.Layout (widget.PangoContext)) { + // var xpad = (int)Xpad; + // int w, h; + // Cairo.Color bgColor, fgColor; + // foreach (var key in Text.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { + + // HashSet bindingConflicts; + // if (keyBindingsPanel.conflicts.TryGetValue (key, out bindingConflicts) && bindingConflicts.Contains (Command)) { + // bgColor = Styles.KeyBindingsPanel.KeyConflictBackgroundColor.ToCairoColor (); + // fgColor = Styles.KeyBindingsPanel.KeyConflictForegroundColor.ToCairoColor (); + // } else if (keyBindingsPanel.duplicates.ContainsKey (key)) { + // bgColor = Styles.KeyBindingsPanel.KeyDuplicateBackgroundColor.ToCairoColor (); + // fgColor = Styles.KeyBindingsPanel.KeyDuplicateForegroundColor.ToCairoColor (); + // } else { + // bgColor = Styles.KeyBindingsPanel.KeyBackgroundColor.ToCairoColor (); + // fgColor = Styles.KeyBindingsPanel.KeyForegroundColor.ToCairoColor (); + // } + + // layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); + // layout.FontDescription = KeySymbolFont; + // layout.GetPixelSize (out w, out h); + + // int buttonWidth = w + (2 * KeyHPadding); + // int buttonHeight = h + (2 * KeyVPadding); + // int x = cell_area.X + xpad; + // double y = cell_area.Y + ((cell_area.Height / 2) - (buttonHeight / 2)); + + // cr.RoundedRectangle (x, y, buttonWidth, buttonHeight, KeyBgRadius); + // cr.LineWidth = 1; + // cr.SetSourceColor (bgColor); + // cr.FillPreserve (); + // cr.SetSourceColor (bgColor); + // cr.Stroke (); + + // cr.SetSourceColor (fgColor); + // cr.MoveTo (x + KeyHPadding, y + KeyVPadding); + // cr.ShowLayout (layout); + // xpad += buttonWidth + Spacing; + // } + // } + // } + // } + + // public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + // { + // base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); + // x_offset = y_offset = 0; + // if (string.IsNullOrEmpty (Text)) { + // width = 0; + // height = 0; + // return; + // } + + // using (var layout = new Pango.Layout (widget.PangoContext)) { + // height = 0; + // width = (int)Xpad; + // int w, h, buttonWidth; + // foreach (var key in Text.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { + // layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); + // layout.FontDescription = KeySymbolFont; + // layout.GetPixelSize (out w, out h); + // if (height == 0) + // height = h + (KeyVPadding * 2) + 1; + + // buttonWidth = w + (2 * KeyHPadding); + // width += buttonWidth + Spacing; + // } + // } + // } + + // protected override void OnDestroyed() + // { + // keyBindingsPanel = null; + // HideConflictTooltip (); + // base.OnDestroyed(); + // } } } } From 8358fb568938fe6a8e6a60e100576f5d2faacb30 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 1 Mar 2024 20:34:37 +0100 Subject: [PATCH 298/382] update --- .../ApplyPolicyDialog.cs | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs index 9836047f60d..7251d1fe971 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs @@ -24,6 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; +using Cairo; using MonoDevelop.Projects.Policies; using System.Linq; using MonoDevelop.Ide; @@ -212,29 +213,29 @@ public PoliciesListSummaryTree () : base (new Gtk.ListStore (typeof (string))) this.AppendColumn ("", new Gtk.CellRendererText (), "text", 0); } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// if (HasPolicies) { -// return base.OnExposeEvent (evnt); -// } -// -// var win = evnt.Window; -// win.Clear (); -// if (string.IsNullOrEmpty (message)) { -// return true; -// } -// -// using (var layout = PangoUtil.CreateLayout (this)) { -// layout.SetMarkup ("" + GLib.Markup.EscapeText (message) + ""); -// int w, h; -// layout.GetPixelSize (out w, out h); -// var a = Allocation; -// var x = (a.Width - w) / 2; -// var y = (a.Height - h ) / 2; -// win.DrawLayout (Style.TextGC (Gtk.StateType.Normal), x, y, layout); -// } -// return true; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + if (HasPolicies) { + return base.OnDrawn (evnt); + } + + var win = GdkWindow; + //win.Clear (); + if (string.IsNullOrEmpty (message)) { + return true; + } + + using (var layout = PangoUtil.CreateLayout (this)) { + layout.SetMarkup ("" + GLib.Markup.EscapeText (message) + ""); + int w, h; + layout.GetPixelSize (out w, out h); + var a = Allocation; + var x = (a.Width - w) / 2; + var y = (a.Height - h ) / 2; + //win.DrawLayout (Style.TextGC (Gtk.StateType.Normal), x, y, layout); + } + return true; + } public bool HasPolicies { get; private set; } From 0641088762ffc0fe9148e42b63f480aedfca4228 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 1 Mar 2024 20:53:33 +0100 Subject: [PATCH 299/382] update --- .../WelcomePageSection.cs | 67 ++++++++++--------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs index e21a0c544b3..437cd7a7974 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs @@ -24,6 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; +using Cairo; using Gtk; using System.Xml.Linq; using MonoDevelop.Core; @@ -110,39 +111,39 @@ public void SetContent (Gtk.Widget w) root.Add (box); } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// using (var ctx = Gdk.CairoHelper.Create (evnt.Window)) { -// ctx.LineWidth = 1; -// var rect = new Gdk.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); -// -// var shadowColor = CairoExtensions.ParseColor (Styles.WelcomeScreen.Pad.ShadowColor); -// int inset = 2; -// var ss = Styles.WelcomeScreen.Pad.ShadowSize; -// var r = new Cairo.Rectangle (rect.X + ss + 0.5, rect.Y + ss + 0.5, rect.Width - ss * 2 - 1, rect.Height - ss * 2 - 1); -// var sr = new Cairo.Rectangle (r.X + inset, r.Y + inset + Styles.WelcomeScreen.Pad.ShadowVerticalOffset, r.Width - inset * 2, r.Height - inset * 2); -// int size = Styles.WelcomeScreen.Pad.ShadowSize; -// double alpha = 0.2; -// double alphaDec = 0.2 / (double)size; -// for (int n=0; n Date: Fri, 1 Mar 2024 22:11:29 +0100 Subject: [PATCH 300/382] update --- .../core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs | 2 +- .../MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs index 0f6e0a3061e..af06c47066e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs @@ -464,7 +464,7 @@ protected override bool OnDrawn (Cairo.Context evnt) } } -// PropagateExpose (Child, evnt); + Child.Draw (evnt); if (hasFrame && roundedShape && customRoundedShapeDrawing) { using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs index 990d8d41d7d..28744aa5add 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs @@ -84,6 +84,7 @@ protected override bool OnDrawn (Cairo.Context evnt) //Gtk.Style.PaintFlatBox (Style, this.GdkWindow, StateType.Normal, ShadowType.Out, evnt.Area, this, "tooltip", 0, 0, winWidth, winHeight); //foreach (var child in this.Children) // this.PropagateExpose (child, evnt); + Child.Draw (evnt); return false; } From 1693ffb856502216154f43bc3353b1ffbf7396ac Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 1 Mar 2024 22:13:29 +0100 Subject: [PATCH 301/382] update --- .../MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs index 28744aa5add..b3711807e8f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs @@ -84,7 +84,7 @@ protected override bool OnDrawn (Cairo.Context evnt) //Gtk.Style.PaintFlatBox (Style, this.GdkWindow, StateType.Normal, ShadowType.Out, evnt.Area, this, "tooltip", 0, 0, winWidth, winHeight); //foreach (var child in this.Children) // this.PropagateExpose (child, evnt); - Child.Draw (evnt); + //Child.Draw (evnt); return false; } From 2e0374cfc61442aa7cc8b513162402818644b6c3 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 1 Mar 2024 22:29:12 +0100 Subject: [PATCH 302/382] update --- .../WelcomePageWidget.cs | 66 ++++++++++--------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageWidget.cs index 1cc6cc00905..592bf9d6be4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageWidget.cs @@ -35,6 +35,7 @@ using System.Linq; using Gdk; using Gtk; +using Cairo; using Mono.Addins; using MonoDevelop.Core; using MonoDevelop.Components; @@ -184,38 +185,39 @@ void DrawBackground (Cairo.Context context, Gdk.Rectangle area) context.RenderTiled (this, Owner.BackgroundImage, Allocation, Allocation, 1); } -// protected override bool OnExposeEvent (EventExpose evnt) -// { -// using (var context = CairoHelper.Create (evnt.Window)) { -// context.SetSourceRGB (backgroundColor.Red, backgroundColor.Green, backgroundColor.Blue); -// context.Operator = Cairo.Operator.Source; -// context.Paint (); -// context.Operator = Cairo.Operator.Over; -// DrawBackground (context, evnt.Area); -// -// if (Owner.LogoImage != null) { -// var lRect = new Rectangle (Allocation.X, Allocation.Y, (int)Owner.LogoImage.Width, (int)Owner.LogoImage.Height); -// if (evnt.Region.RectIn (lRect) != OverlapType.Out) -// context.DrawImage (this, Owner.LogoImage, Allocation.X, Allocation.Y); -// -// var bgRect = new Rectangle (Allocation.X + (int)Owner.LogoImage.Width, Allocation.Y, Allocation.Width - (int)Owner.LogoImage.Width, (int)Owner.TopBorderImage.Height); -// if (evnt.Region.RectIn (bgRect) != OverlapType.Out) -// for (int x = bgRect.X; x < bgRect.Right; x += (int)Owner.TopBorderImage.Width) -// context.DrawImage (this, Owner.TopBorderImage.WithSize (Owner.TopBorderImage.Width, bgRect.Height), x, Allocation.Y); -// } -// } -// -// foreach (Widget widget in Children) -// PropagateExpose (widget, evnt); -// -// if (OverdrawOpacity > 0) { -// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { -// DrawOverdraw (context, OverdrawOpacity); -// } -// } -// -// return true; -// } + protected override bool OnDrawn (Cairo.Context evnt) + { + using (var context = Gdk.CairoHelper.Create (GdkWindow)) { + context.SetSourceRGB (backgroundColor.Red, backgroundColor.Green, backgroundColor.Blue); + context.Operator = Cairo.Operator.Source; + context.Paint (); + context.Operator = Cairo.Operator.Over; + //DrawBackground (context, evnt.Area); + + if (Owner.LogoImage != null) { + var lRect = new Gdk.Rectangle (Allocation.X, Allocation.Y, (int)Owner.LogoImage.Width, (int)Owner.LogoImage.Height); + //if (evnt.Region.RectIn (lRect) != OverlapType.Out) + // context.DrawImage (this, Owner.LogoImage, Allocation.X, Allocation.Y); + + var bgRect = new Gdk.Rectangle (Allocation.X + (int)Owner.LogoImage.Width, Allocation.Y, Allocation.Width - (int)Owner.LogoImage.Width, (int)Owner.TopBorderImage.Height); + //if (evnt.Region.RectIn (bgRect) != OverlapType.Out) + // for (int x = bgRect.X; x < bgRect.Right; x += (int)Owner.TopBorderImage.Width) + // context.DrawImage (this, Owner.TopBorderImage.WithSize (Owner.TopBorderImage.Width, bgRect.Height), x, Allocation.Y); + } + } + + foreach (Widget widget in Children) + //PropagateExpose (widget, evnt); + Child.Draw (evnt); + + if (OverdrawOpacity > 0) { + using (var context = Gdk.CairoHelper.Create (GdkWindow)) { + DrawOverdraw (context, OverdrawOpacity); + } + } + + return true; + } protected override void OnDestroyed () { From d16ec2d3cadf60c2e4071bfd2e5d2549d736447b Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 2 Mar 2024 11:52:18 +0100 Subject: [PATCH 303/382] update --- .../ObjectValue/Gtk/GtkObjectValueTreeView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Gtk/GtkObjectValueTreeView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Gtk/GtkObjectValueTreeView.cs index 72598c442bd..f84bc8bbdca 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Gtk/GtkObjectValueTreeView.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/Gtk/GtkObjectValueTreeView.cs @@ -528,7 +528,7 @@ void IObjectValueTreeView.Appended (ObjectValueNode node) /// /// Notifies the treeview that the specified nodes have been added to the root node's children - /// + /// /// The nodes that were appended. void IObjectValueTreeView.Appended (IList nodes) { From 38e63e2c4a3b4f9521d78b14a1c807f2f6d3b1ef Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 2 Mar 2024 11:55:40 +0100 Subject: [PATCH 304/382] restore --- .../ExceptionCaughtDialog.cs | 53 ++++++++----------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs index 36c22f269cb..8fb062f94ca 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs @@ -764,38 +764,27 @@ class CellRendererInnerException : CellRenderer // } // } -// protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) -// { -// using (var cr = Gdk.CairoHelper.Create (window)) { -// cr.Rectangle (background_area.X, background_area.Y, background_area.Width, background_area.Height); -// -// using (var layout = new Pango.Layout (widget.PangoContext)) { -// layout.FontDescription = font; -// -// if ((flags & CellRendererState.Selected) != 0) { -// cr.SetSourceRGB (Styles.ExceptionCaughtDialog.TreeSelectedBackgroundColor.Red, -// Styles.ExceptionCaughtDialog.TreeSelectedBackgroundColor.Green, -// Styles.ExceptionCaughtDialog.TreeSelectedBackgroundColor.Blue); // selected -// cr.Fill (); -// cr.SetSourceRGB (Styles.ExceptionCaughtDialog.TreeSelectedTextColor.Red, -// Styles.ExceptionCaughtDialog.TreeSelectedTextColor.Green, -// Styles.ExceptionCaughtDialog.TreeSelectedTextColor.Blue); -// } else { -// cr.SetSourceRGB (Styles.ExceptionCaughtDialog.TreeBackgroundColor.Red, -// Styles.ExceptionCaughtDialog.TreeBackgroundColor.Green, -// Styles.ExceptionCaughtDialog.TreeBackgroundColor.Blue); // background -// cr.Fill (); -// cr.SetSourceRGB (Styles.ExceptionCaughtDialog.TreeTextColor.Red, -// Styles.ExceptionCaughtDialog.TreeTextColor.Green, -// Styles.ExceptionCaughtDialog.TreeTextColor.Blue); -// } -// -// layout.SetMarkup (Text); -// cr.Translate (cell_area.X + 10, cell_area.Y + 1); -// cr.ShowLayout (layout); -// } -// } -// } + // protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) + // { + // using (var cr = Gdk.CairoHelper.Create (window)) { + // cr.Rectangle (background_area.X, background_area.Y, background_area.Width, background_area.Height); + + // using (var layout = new Pango.Layout (widget.PangoContext)) { + // layout.FontDescription = font; + + // var selected = (flags & CellRendererState.Selected) != 0; + // var backgroundColor = selected ? Styles.ExceptionCaughtDialog.TreeSelectedBackgroundColor : Styles.ExceptionCaughtDialog.TreeBackgroundColor; + // var textColor = selected ? Styles.ExceptionCaughtDialog.TreeSelectedTextColor : Styles.ExceptionCaughtDialog.TreeTextColor; + // cr.SetSourceColor (backgroundColor.ToCairoColor ()); + // cr.Fill (); + // cr.SetSourceColor (textColor.ToCairoColor()); + + // layout.SetMarkup (Text); + // cr.Translate (cell_area.X + 10, cell_area.Y + 1); + // cr.ShowLayout (layout); + // } + // } + // } } protected override bool OnKeyPressEvent (Gdk.EventKey evnt) From 6f87aefc47b44874ef3a43ac2ae7cf357698088b Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 2 Mar 2024 12:10:15 +0100 Subject: [PATCH 305/382] update --- .../ToolboxWidget.cs | 853 +++++++++--------- 1 file changed, 403 insertions(+), 450 deletions(-) diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs index b9638bdc9b0..7b520095f99 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs @@ -59,7 +59,7 @@ public bool IsListMode { set { listMode = value; this.QueueResize (); -// this.ScrollToSelectedItem (); + this.ScrollToSelectedItem (); } } @@ -80,7 +80,7 @@ public bool ShowCategories { set { showCategories = value; this.QueueResize (); -// this.ScrollToSelectedItem (); + this.ScrollToSelectedItem (); } } @@ -146,7 +146,7 @@ public ToolboxWidget () handCursor = new Cursor (CursorType.Hand1); var actionHandler = new ActionDelegate (this); -// actionHandler.PerformShowMenu += PerformShowMenu; + actionHandler.PerformShowMenu += PerformShowMenu; } protected override void OnStyleSet (Gtk.Style previous_style) @@ -179,7 +179,7 @@ protected override void OnStyleSet (Gtk.Style previous_style) protected override void OnDestroyed () { -// HideTooltipWindow (); + HideTooltipWindow (); if (this.layout != null) { this.layout.Dispose (); this.layout = null; @@ -205,413 +205,372 @@ static Cairo.Color Convert (Gdk.Color color) const int ItemIconTextItemSpacing = 4; const int IconModePadding = 2; -// protected override bool OnExposeEvent (Gdk.EventExpose e) -// { -// Cairo.Context cr = Gdk.CairoHelper.Create (e.Window); -// -// Gdk.Rectangle area = e.Area; -// -// if (this.categories.Count == 0 || !string.IsNullOrEmpty (CustomMessage)) { -// Pango.Layout messageLayout = new Pango.Layout (this.PangoContext); -// messageLayout.Alignment = Pango.Alignment.Center; -// messageLayout.Width = (int)(Allocation.Width * 2 / 3 * Pango.Scale.PangoScale); -// if (!string.IsNullOrEmpty (CustomMessage)) -// messageLayout.SetText (CustomMessage); -// else -// messageLayout.SetText (MonoDevelop.Core.GettextCatalog.GetString ("There are no tools available for the current document.")); -// cr.MoveTo (Allocation.Width * 1 / 6, 12); -// cr.SetSourceColor (Style.Text (StateType.Normal).ToCairoColor ()); -// Pango.CairoHelper.ShowLayout (cr, messageLayout); -// messageLayout.Dispose (); -// ((IDisposable)cr).Dispose (); -// return true; -// } -// -// var backColor = Style.Base (StateType.Normal).ToCairoColor (); -// cr.SetSourceColor (backColor); -// cr.Rectangle (area.X, area.Y, area.Width, area.Height); -// cr.Fill (); -// -// int xpos = (this.hAdjustement != null ? (int)this.hAdjustement.Value : 0); -// int vadjustment = (this.vAdjustement != null ? (int)this.vAdjustement.Value : 0); -// int ypos = -vadjustment; -// Category lastCategory = null; -// int lastCategoryYpos = 0; -// -// cr.LineWidth = 1; -// -// Iterate (ref xpos, ref ypos, delegate (Category category, Gdk.Size itemDimension) { -// ProcessExpandAnimation (cr, lastCategory, lastCategoryYpos, backColor, area, ref ypos); -// -// if (!area.IntersectsWith (new Gdk.Rectangle (new Gdk.Point (xpos, ypos), itemDimension))) -// return true; -// cr.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); -// cr.SetSourceColor (Ide.Gui.Styles.PadCategoryBackgroundColor.ToCairoColor ()); -// cr.Fill (); -// -// if (lastCategory == null || lastCategory.IsExpanded || lastCategory.AnimatingExpand) { -// cr.MoveTo (xpos, ypos + 0.5); -// cr.LineTo (itemDimension.Width, ypos + 0.5); -// } -// cr.MoveTo (0, ypos + itemDimension.Height - 0.5); -// cr.LineTo (xpos + Allocation.Width, ypos + itemDimension.Height - 0.5); -// cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryBorderColor.ToCairoColor ()); -// cr.Stroke (); -// -// headerLayout.SetMarkup (category.Text); -// int width, height; -// cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryLabelColor.ToCairoColor ()); -// layout.GetPixelSize (out width, out height); -// cr.MoveTo (xpos + CategoryLeftPadding, ypos + (double)(Math.Round ((double)(itemDimension.Height - height) / 2))); -// Pango.CairoHelper.ShowLayout (cr, headerLayout); -// -// var img = category.IsExpanded ? discloseUp : discloseDown; -// cr.DrawImage (this, img, Allocation.Width - img.Width - CategoryRightPadding, ypos + Math.Round ((itemDimension.Height - img.Height) / 2)); -// -// lastCategory = category; -// lastCategoryYpos = ypos + itemDimension.Height; -// -// return true; -// }, delegate (Category curCategory, Item item, Gdk.Size itemDimension) { -// if (!area.IntersectsWith (new Gdk.Rectangle (new Gdk.Point (xpos, ypos), itemDimension))) -// return true; -// -// var icon = item.Icon; -// if (!icon.HasFixedSize) { -// var maxIconSize = Math.Min (itemDimension.Width, itemDimension.Height); -// var fittingIconSize = maxIconSize > 32 ? Xwt.IconSize.Large : maxIconSize > 16 ? Xwt.IconSize.Medium : Xwt.IconSize.Small; -// icon = item.Icon.WithSize (fittingIconSize); -// } -// if (item == SelectedItem) { -// icon = icon.WithStyles ("sel"); -// cr.SetSourceColor (Style.Base (StateType.Selected).ToCairoColor ()); -// cr.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); -// cr.Fill (); -// } -// if (listMode || !curCategory.CanIconizeItems) { -// cr.DrawImage (this, icon, xpos + ItemLeftPadding, ypos + Math.Round ((itemDimension.Height - icon.Height) / 2)); -// layout.SetMarkup (item.Text); -// int width, height; -// layout.GetPixelSize (out width, out height); -// cr.SetSourceColor (Style.Text (item != this.SelectedItem ? StateType.Normal : StateType.Selected).ToCairoColor ()); -// cr.MoveTo (xpos + ItemLeftPadding + IconSize.Width + ItemIconTextItemSpacing, ypos + (double)(Math.Round ((double)(itemDimension.Height - height) / 2))); -// Pango.CairoHelper.ShowLayout (cr, layout); -// } else { -// cr.DrawImage (this, icon, xpos + Math.Round ((itemDimension.Width - icon.Width) / 2), ypos + Math.Round ((itemDimension.Height - icon.Height) / 2)); -// } -// -// if (item == mouseOverItem) { -// cr.SetSourceColor (Style.Dark (StateType.Prelight).ToCairoColor ()); -// cr.Rectangle (xpos + 0.5, ypos + 0.5, itemDimension.Width - 1, itemDimension.Height - 1); -// cr.Stroke (); -// } -// -// return true; -// }); -// -// ProcessExpandAnimation (cr, lastCategory, lastCategoryYpos, backColor, area, ref ypos); -// -// if (lastCategory != null && lastCategory.AnimatingExpand) { -// // Closing line when animating the last group of the toolbox -// cr.MoveTo (area.X, ypos + 0.5); -// cr.RelLineTo (area.Width, 0); -// cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryBorderColor.ToCairoColor ()); -// cr.Stroke (); -// } -// -// ((IDisposable)cr).Dispose (); -// return true; -// } + // protected override bool OnExposeEvent (Gdk.EventExpose e) + // { + // Cairo.Context cr = Gdk.CairoHelper.Create (e.Window); + + // Gdk.Rectangle area = e.Area; + + // if (this.categories.Count == 0 || !string.IsNullOrEmpty (CustomMessage)) { + // Pango.Layout messageLayout = new Pango.Layout (this.PangoContext); + // messageLayout.Alignment = Pango.Alignment.Center; + // messageLayout.Width = (int)(Allocation.Width * 2 / 3 * Pango.Scale.PangoScale); + // if (!string.IsNullOrEmpty (CustomMessage)) + // messageLayout.SetText (CustomMessage); + // else + // messageLayout.SetText (MonoDevelop.Core.GettextCatalog.GetString ("There are no tools available for the current document.")); + // cr.MoveTo (Allocation.Width * 1 / 6, 12); + // cr.SetSourceColor (Style.Text (StateType.Normal).ToCairoColor ()); + // Pango.CairoHelper.ShowLayout (cr, messageLayout); + // messageLayout.Dispose (); + // ((IDisposable)cr).Dispose (); + // return true; + // } + + // var backColor = Style.Base (StateType.Normal).ToCairoColor (); + // cr.SetSourceColor (backColor); + // cr.Rectangle (area.X, area.Y, area.Width, area.Height); + // cr.Fill (); + + // int xpos = (this.hAdjustement != null ? (int)this.hAdjustement.Value : 0); + // int vadjustment = (this.vAdjustement != null ? (int)this.vAdjustement.Value : 0); + // int ypos = -vadjustment; + // ToolboxWidgetCategory lastCategory = null; + // int lastCategoryYpos = 0; + // cr.LineWidth = 1; + + // Iterate (ref xpos, ref ypos, (category, itemDimension) => { + // ProcessExpandAnimation (cr, lastCategory, lastCategoryYpos, backColor, area, ref ypos); + + // if (!area.IntersectsWith (new Gdk.Rectangle (new Gdk.Point (xpos, ypos), itemDimension))) + // return true; + // cr.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); + // cr.SetSourceColor (Ide.Gui.Styles.PadCategoryBackgroundColor.ToCairoColor ()); + // cr.Fill (); + + // if (lastCategory == null || lastCategory.IsExpanded || lastCategory.AnimatingExpand) { + // cr.MoveTo (xpos, ypos + 0.5); + // cr.LineTo (itemDimension.Width, ypos + 0.5); + // } + // cr.MoveTo (0, ypos + itemDimension.Height - 0.5); + // cr.LineTo (xpos + Allocation.Width, ypos + itemDimension.Height - 0.5); + // cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryBorderColor.ToCairoColor ()); + // cr.Stroke (); + + // headerLayout.SetMarkup (category.Text); + // int width, height; + // cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryLabelColor.ToCairoColor ()); + // headerLayout.GetPixelSize (out width, out height); + // cr.MoveTo (xpos + CategoryLeftPadding, ypos + (double)(Math.Round ((double)(itemDimension.Height - height) / 2))); + // Pango.CairoHelper.ShowLayout (cr, headerLayout); + + // var img = category.IsExpanded ? discloseUp : discloseDown; + // cr.DrawImage (this, img, Allocation.Width - img.Width - CategoryRightPadding, ypos + Math.Round ((itemDimension.Height - img.Height) / 2)); + + // lastCategory = category; + // lastCategoryYpos = ypos + itemDimension.Height; + + // return true; + // }, (curCategory, item, itemDimension) => { + // if (!area.IntersectsWith (new Gdk.Rectangle (new Gdk.Point (xpos, ypos), itemDimension))) + // return true; + + // var icon = item.Icon; + // if (!icon.HasFixedSize) { + // var maxIconSize = Math.Min (itemDimension.Width, itemDimension.Height); + // var fittingIconSize = maxIconSize > 32 ? Xwt.IconSize.Large : maxIconSize > 16 ? Xwt.IconSize.Medium : Xwt.IconSize.Small; + // icon = item.Icon.WithSize (fittingIconSize); + // } + // if (item == SelectedItem) { + // icon = icon.WithStyles ("sel"); + // cr.SetSourceColor (Style.Base (StateType.Selected).ToCairoColor ()); + // cr.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); + // cr.Fill (); + // } + // if (listMode || !curCategory.CanIconizeItems) { + // cr.DrawImage (this, icon, xpos + ItemLeftPadding, ypos + Math.Round ((itemDimension.Height - icon.Height) / 2)); + // layout.SetMarkup (item.Text); + // layout.Width = (int)((itemDimension.Width - ItemIconTextItemSpacing - iconSize.Width - ItemLeftPadding * 2) * Pango.Scale.PangoScale); + // layout.GetPixelSize (out var width, out var height); + // cr.SetSourceColor (Style.Text (item != SelectedItem ? StateType.Normal : StateType.Selected).ToCairoColor ()); + // cr.MoveTo (xpos + ItemLeftPadding + iconSize.Width + ItemIconTextItemSpacing, ypos + Math.Round ((double)(itemDimension.Height - height) / 2)); + // Pango.CairoHelper.ShowLayout (cr, layout); + // } else { + // cr.DrawImage (this, icon, xpos + Math.Round ((itemDimension.Width - icon.Width) / 2), ypos + Math.Round ((itemDimension.Height - icon.Height) / 2)); + // } + + // if (item == mouseOverItem) { + // cr.SetSourceColor (Style.Dark (StateType.Prelight).ToCairoColor ()); + // cr.Rectangle (xpos + 0.5, ypos + 0.5, itemDimension.Width - 1, itemDimension.Height - 1); + // cr.Stroke (); + // } + + // return true; + // }); + + // ProcessExpandAnimation (cr, lastCategory, lastCategoryYpos, backColor, area, ref ypos); + + // if (lastCategory != null && lastCategory.AnimatingExpand) { + // // Closing line when animating the last group of the toolbox + // cr.MoveTo (area.X, ypos + 0.5); + // cr.RelLineTo (area.Width, 0); + // cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryBorderColor.ToCairoColor ()); + // cr.Stroke (); + // } + + // ((IDisposable)cr).Dispose (); + // return true; + // } void ProcessExpandAnimation (Cairo.Context cr, ToolboxWidgetCategory lastCategory, int lastCategoryYpos, Cairo.Color backColor, Gdk.Rectangle area, ref int ypos) { - //if (lastCategory != null && lastCategory.AnimatingExpand) { - //int newypos = lastCategory.IsExpanded ? lastCategoryYpos + lastCategory.AnimationHeight : ypos + lastCategory.AnimationHeight; - //if (newypos < lastCategoryYpos) { - // newypos = lastCategoryYpos; -// StopExpandAnimation (lastCategory); - //} - //if (newypos > ypos) { - // newypos = ypos; -// StopExpandAnimation (lastCategory); - //} + if (lastCategory != null && lastCategory.AnimatingExpand) { + int newypos; + if (lastCategory.IsExpanded) { + newypos = lastCategoryYpos + (int)(lastCategory.AnimationPosition * (ypos - lastCategoryYpos)); + } else { + newypos = ypos - (int)(lastCategory.AnimationPosition * (ypos - lastCategoryYpos)); + } // Clear the area where the category will be drawn since it will be // drawn over the items being hidden/shown - //cr.SetSourceColor (backColor); - //cr.Rectangle (area.X, newypos, area.Width, ypos - lastCategoryYpos); - //cr.Fill (); - //ypos = newypos; - //} - } - -// protected override bool OnKeyPressEvent (Gdk.EventKey evnt) -// { -// Item nextItem; -// -// // Handle keyboard toolip popup -// if ((evnt.Key == Gdk.Key.F1 && (evnt.State & Gdk.ModifierType.ControlMask) == Gdk.ModifierType.ControlMask)) { -// if (this.SelectedItem != null) { -// int vadjustment = (this.vAdjustement != null ? (int)this.vAdjustement.Value : 0); -// Gdk.Rectangle rect = GetItemExtends (SelectedItem); -// ShowTooltip (SelectedItem, 0,rect.X, rect.Bottom - vadjustment ); -// } -// return true; -// } -// -// switch (evnt.Key) { -// case Gdk.Key.KP_Enter: -// case Gdk.Key.Return: -// if (this.SelectedItem != null) -// this.OnActivateSelectedItem (EventArgs.Empty); -// return true; -// case Gdk.Key.KP_Up: -// case Gdk.Key.Up: -// if (this.listMode || this.SelectedItem is Category) { -// this.SelectedItem = GetPrevItem (this.SelectedItem); -// } else { -// nextItem = GetItemAbove (this.SelectedItem); -// this.SelectedItem = nextItem != this.SelectedItem ? nextItem : GetCategory (this.SelectedItem); -// } -// this.QueueDraw (); -// return true; -// case Gdk.Key.KP_Down: -// case Gdk.Key.Down: -// if (this.listMode || this.SelectedItem is Category) { -// this.SelectedItem = GetNextItem (this.SelectedItem); -// } else { -// nextItem = GetItemBelow (this.SelectedItem); -// if (nextItem == this.SelectedItem) { -// Category category = GetCategory (this.SelectedItem); -// nextItem = GetNextCategory (category); -// if (nextItem == category) -// nextItem = this.SelectedItem; -// } -// this.SelectedItem = nextItem; -// } -// this.QueueDraw (); -// return true; -// -// case Gdk.Key.KP_Left: -// case Gdk.Key.Left: -// if (this.SelectedItem is Category) { -// SetCategoryExpanded ((Category)this.SelectedItem, false); -// } else { -// if (this.listMode) { -// this.SelectedItem = GetCategory (this.SelectedItem); -// } else { -// this.SelectedItem = GetItemLeft (this.SelectedItem); -// } -// } -// this.QueueDraw (); -// return true; -// -// case Gdk.Key.KP_Right: -// case Gdk.Key.Right: -// if (this.SelectedItem is Category) { -// Category selectedCategory = ((Category)this.SelectedItem); -// if (selectedCategory.IsExpanded) { -// if (selectedCategory.ItemCount > 0) -// this.SelectedItem = selectedCategory.Items[0]; -// } else { -// SetCategoryExpanded (selectedCategory, true); -// } -// } else { -// if (this.listMode) { -// // nothing -// } else { -// this.SelectedItem = GetItemRight (this.SelectedItem); -// } -// } -// this.QueueDraw (); -// return true; -// -// } -// return false; -// } - -// protected override void OnUnrealized () -// { -// HideTooltipWindow (); -// base.OnUnrealized (); -// } - -// protected override bool OnLeaveNotifyEvent (Gdk.EventCrossing evnt) -// { -// if (evnt.Mode == CrossingMode.Normal) { -// HideTooltipWindow (); -// ClearMouseOverItem (); -// } -// GdkWindow.Cursor = null; -// return base.OnLeaveNotifyEvent (evnt); -// } - -// protected override bool OnScrollEvent (Gdk.EventScroll evnt) -// { -// HideTooltipWindow (); -// ClearMouseOverItem (); -// return base.OnScrollEvent (evnt); -// } - -// public Action DoPopupMenu { get; set; } - -// protected override bool OnButtonPressEvent (Gdk.EventButton e) -// { -// this.GrabFocus (); -// HideTooltipWindow (); -// if (this.mouseOverItem is Category) { -// if (!e.TriggersContextMenu () && e.Button == 1 && e.Type == EventType.ButtonPress) { -// Category mouseOverCateogry = (Category)this.mouseOverItem; -// SetCategoryExpanded (mouseOverCateogry, !mouseOverCateogry.IsExpanded); -// return true; -// } -// this.SelectedItem = mouseOverItem; -// this.QueueResize (); -// } else { -// this.SelectedItem = mouseOverItem; -// this.QueueDraw (); -// } -// if (e.TriggersContextMenu ()) { -// if (DoPopupMenu != null) { -// DoPopupMenu (e); -// return true; -// } -// } else if (e.Type == EventType.TwoButtonPress && this.SelectedItem != null) { -// this.OnActivateSelectedItem (EventArgs.Empty); -// return true; -// } -// return base.OnButtonPressEvent (e); -// } - -// void PerformShowMenu (object sender, EventArgs args) -// { -// DoPopupMenu?.Invoke (null); -// } + cr.SetSourceColor (backColor); + cr.Rectangle (area.X, newypos, area.Width, ypos - lastCategoryYpos); + cr.Fill (); + ypos = newypos; + } + } + + protected override bool OnKeyPressEvent (Gdk.EventKey evnt) + { + ToolboxWidgetItem nextItem; + + // Handle keyboard toolip popup + if ((evnt.Key == Gdk.Key.F1 && (evnt.State & Gdk.ModifierType.ControlMask) == Gdk.ModifierType.ControlMask)) { + if (this.SelectedItem != null) { + int vadjustment = (this.vAdjustement != null ? (int)this.vAdjustement.Value : 0); + Gdk.Rectangle rect = GetItemExtends (SelectedItem); + ShowTooltip (SelectedItem, 0, rect.X, rect.Bottom - vadjustment); + } + return true; + } + + switch (evnt.Key) { + case Gdk.Key.KP_Enter: + case Gdk.Key.Return: + if (this.SelectedItem != null) + this.OnActivateSelectedItem (EventArgs.Empty); + return true; + case Gdk.Key.KP_Up: + case Gdk.Key.Up: + if (this.listMode || this.SelectedItem is ToolboxWidgetCategory) { + this.SelectedItem = GetPrevItem (this.SelectedItem); + } else { + nextItem = GetItemAbove (this.SelectedItem); + this.SelectedItem = nextItem != this.SelectedItem ? nextItem : GetCategory (this.SelectedItem); + } + this.QueueDraw (); + return true; + case Gdk.Key.KP_Down: + case Gdk.Key.Down: + if (this.listMode || this.SelectedItem is ToolboxWidgetCategory) { + this.SelectedItem = GetNextItem (this.SelectedItem); + } else { + nextItem = GetItemBelow (this.SelectedItem); + if (nextItem == this.SelectedItem) { + ToolboxWidgetCategory category = GetCategory (this.SelectedItem); + nextItem = GetNextCategory (category); + if (nextItem == category) + nextItem = this.SelectedItem; + } + this.SelectedItem = nextItem; + } + this.QueueDraw (); + return true; + + case Gdk.Key.KP_Left: + case Gdk.Key.Left: + if (this.SelectedItem is ToolboxWidgetCategory) { + SetCategoryExpanded ((ToolboxWidgetCategory)this.SelectedItem, false); + } else { + if (this.listMode) { + this.SelectedItem = GetCategory (this.SelectedItem); + } else { + this.SelectedItem = GetItemLeft (this.SelectedItem); + } + } + this.QueueDraw (); + return true; + + case Gdk.Key.KP_Right: + case Gdk.Key.Right: + if (this.SelectedItem is ToolboxWidgetCategory selectedCategory) { + if (selectedCategory.IsExpanded) { + if (selectedCategory.ItemCount > 0) + this.SelectedItem = selectedCategory.Items [0]; + } else { + SetCategoryExpanded (selectedCategory, true); + } + } else { + if (this.listMode) { + // nothing + } else { + this.SelectedItem = GetItemRight (this.SelectedItem); + } + } + this.QueueDraw (); + return true; + + } + return false; + } + + protected override void OnUnrealized () + { + HideTooltipWindow (); + base.OnUnrealized (); + } + + protected override bool OnLeaveNotifyEvent (Gdk.EventCrossing evnt) + { + if (evnt.Mode == CrossingMode.Normal) { + HideTooltipWindow (); + ClearMouseOverItem (); + } + GdkWindow.Cursor = null; + return base.OnLeaveNotifyEvent (evnt); + } + + protected override bool OnScrollEvent (Gdk.EventScroll evnt) + { + HideTooltipWindow (); + ClearMouseOverItem (); + return base.OnScrollEvent (evnt); + } + + public Action DoPopupMenu { get; set; } + + protected override bool OnButtonPressEvent (Gdk.EventButton e) + { + this.GrabFocus (); + HideTooltipWindow (); + if (this.mouseOverItem is ToolboxWidgetCategory) { + if (!e.TriggersContextMenu () && e.Button == 1 && e.Type == EventType.ButtonPress) { + ToolboxWidgetCategory mouseOverCateogry = (ToolboxWidgetCategory)this.mouseOverItem; + SetCategoryExpanded (mouseOverCateogry, !mouseOverCateogry.IsExpanded); + return true; + } + this.SelectedItem = mouseOverItem; + this.QueueResize (); + } else { + this.SelectedItem = mouseOverItem; + this.QueueDraw (); + } + if (e.TriggersContextMenu ()) { + if (DoPopupMenu != null) { + DoPopupMenu (e); + return true; + } + } else if (e.Type == EventType.TwoButtonPress && this.SelectedItem != null) { + this.OnActivateSelectedItem (EventArgs.Empty); + return true; + } + return base.OnButtonPressEvent (e); + } + + void PerformShowMenu (object sender, EventArgs args) + { + DoPopupMenu?.Invoke (null); + } void SetCategoryExpanded (ToolboxWidgetCategory cat, bool expanded) { if (cat.IsExpanded == expanded) return; cat.IsExpanded = expanded; -// if (cat.IsExpanded) -// StartExpandAnimation (cat); -// else -// StartCollapseAnimation (cat); + StartExpandAnimation (cat); } Xwt.Motion.Tweener tweener; - // void StartExpandAnimation (ToolboxWidgetCategory cat) - // { - // if (tweener != null) { - // tweener.Stop (); - - // if (cat.AnimatingExpand) - // GLib.Source.Remove (cat.AnimationHandle); - - // cat.AnimationHeight = 0; - //cat.AnimatingExpand = true; -// cat.AnimationHandle = GLib.Timeout.Add (animationTimeSpan, delegate { -// cat.AnimationHeight += animationStepSize; -// QueueResize (); -// return true; -// }); - // } - - // void StartCollapseAnimation (Category cat) - // { - // if (cat.AnimatingExpand) - // GLib.Source.Remove (cat.AnimationHandle); - - // cat.AnimationHeight = 0; - // cat.AnimatingExpand = true; -// cat.AnimationHandle = GLib.Timeout.Add (animationTimeSpan, delegate { -// cat.AnimationHeight -= animationStepSize; -// QueueResize (); -// return true; -// }); - // } - - // void StopExpandAnimation (Category cat) - // { - // if (cat.AnimatingExpand) { - // cat.AnimatingExpand = false; - // GLib.Source.Remove (cat.AnimationHandle); - // } + void StartExpandAnimation (ToolboxWidgetCategory cat) + { + if (tweener != null) { + tweener.Stop (); + } - // cat.AnimatingExpand = true; - // cat.AnimationPosition = 0.0f; - - // tweener = new Xwt.Motion.Tweener (animationDurationMs, 10) { Easing = Xwt.Motion.Easing.SinOut }; - // tweener.ValueUpdated += (sender, e) => { - // cat.AnimationPosition = tweener.Value; - // QueueDraw (); - // }; - // tweener.Finished += (sender, e) => { - // cat.AnimatingExpand = false; - // QueueDraw (); - // }; - // tweener.Start (); - // QueueDraw (); - // } + cat.AnimatingExpand = true; + cat.AnimationPosition = 0.0f; + + tweener = new Xwt.Motion.Tweener (animationDurationMs, 10) { Easing = Xwt.Motion.Easing.SinOut }; + tweener.ValueUpdated += (sender, e) => { + cat.AnimationPosition = tweener.Value; + QueueDraw (); + }; + tweener.Finished += (sender, e) => { + cat.AnimatingExpand = false; + QueueDraw (); + }; + tweener.Start (); + QueueDraw (); + } + + protected override bool OnPopupMenu () + { + if (DoPopupMenu != null) { + DoPopupMenu (null); + return true; + } + return base.OnPopupMenu (); + } + + protected override bool OnMotionNotifyEvent (Gdk.EventMotion e) + { + int xpos = 0; + int ypos = 0; + HideTooltipWindow (); + var oldItem = mouseOverItem; + mouseOverItem = null; + Gdk.Rectangle newItemExtents = Gdk.Rectangle.Zero; + this.mouseX = (int)e.X + (int)(this.hAdjustement != null ? this.hAdjustement.Value : 0); + this.mouseY = (int)e.Y + (int)(this.vAdjustement != null ? this.vAdjustement.Value : 0); + Iterate (ref xpos, ref ypos, (category, itemDimension) => { + if (xpos <= mouseX && mouseX <= xpos + itemDimension.Width && + ypos <= mouseY && mouseY <= ypos + itemDimension.Height) { + mouseOverItem = category; + GdkWindow.Cursor = handCursor; + if (!e.State.HasFlag (ModifierType.Button1Mask)) + ShowTooltip (mouseOverItem, TipTimer, (int)e.X + 2, (int)e.Y + 16); + newItemExtents = new Gdk.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); + return false; + } + return true; + }, (curCategory, item, itemDimension) => { + if (xpos <= mouseX && mouseX <= xpos + itemDimension.Width && + ypos <= mouseY && mouseY <= ypos + itemDimension.Height) { + mouseOverItem = item; + GdkWindow.Cursor = null; + if (!e.State.HasFlag (ModifierType.Button1Mask)) + ShowTooltip (mouseOverItem, TipTimer, (int)e.X + 2, (int)e.Y + 16); + newItemExtents = new Gdk.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); + return false; + } + return true; + }); + + if (mouseOverItem == null) + GdkWindow.Cursor = null; + + if (oldItem != mouseOverItem) { + this.QueueDraw (); + var oldItemExtents = GetItemExtends (oldItem); + QueueDrawArea (oldItemExtents.X, oldItemExtents.Y, oldItemExtents.Width, oldItemExtents.Height); + QueueDrawArea (newItemExtents.X, newItemExtents.Y, newItemExtents.Width, newItemExtents.Height); + } + + return base.OnMotionNotifyEvent (e); + } - // protected override bool OnPopupMenu () - //{ - // if (DoPopupMenu != null) { - // DoPopupMenu (null); - // return true; - // } - // return base.OnPopupMenu (); - // return false; - //} - -// protected override bool OnMotionNotifyEvent (Gdk.EventMotion e) -// { -// int xpos = 0; -// int ypos = 0; -// HideTooltipWindow (); -// var oldItem = mouseOverItem; -// mouseOverItem = null; -// Gdk.Rectangle newItemExtents = Gdk.Rectangle.Zero; -// this.mouseX = (int)e.X + (int)(this.hAdjustement != null ? this.hAdjustement.Value : 0); -// this.mouseY = (int)e.Y + (int)(this.vAdjustement != null ? this.vAdjustement.Value : 0); -// Iterate (ref xpos, ref ypos, delegate (Category category, Gdk.Size itemDimension) { -// if (xpos <= mouseX && mouseX <= xpos + itemDimension.Width && -// ypos <= mouseY && mouseY <= ypos + itemDimension.Height) { -// mouseOverItem = category; -// GdkWindow.Cursor = handCursor; -// if (!e.State.HasFlag (ModifierType.Button1Mask)) -// ShowTooltip (mouseOverItem, TipTimer, (int)e.X + 2, (int)e.Y + 16); -// newItemExtents = new Gdk.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); -// return false; -// } -// return true; -// }, delegate (Category curCategory, Item item, Gdk.Size itemDimension) { -// if (xpos <= mouseX && mouseX <= xpos + itemDimension.Width && -// ypos <= mouseY && mouseY <= ypos + itemDimension.Height) { -// mouseOverItem = item; -// GdkWindow.Cursor = null; -// if (!e.State.HasFlag (ModifierType.Button1Mask)) -// ShowTooltip (mouseOverItem, TipTimer, (int)e.X + 2, (int)e.Y + 16); -// newItemExtents = new Gdk.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); -// return false; -// } -// return true; -// }); -// -// if (mouseOverItem == null) -// GdkWindow.Cursor = null; -// -// if (oldItem != mouseOverItem) { -// this.QueueDraw (); -// var oldItemExtents = GetItemExtends (oldItem); -// QueueDrawArea (oldItemExtents.X, oldItemExtents.Y, oldItemExtents.Width, oldItemExtents.Height); -// QueueDrawArea (newItemExtents.X, newItemExtents.Y, newItemExtents.Width, newItemExtents.Height); -// } -// -// return base.OnMotionNotifyEvent (e); -// } - #region Item selection logic ToolboxWidgetItem selectedItem = null; ToolboxWidgetItem mouseOverItem = null; @@ -828,22 +787,18 @@ public void ScrollToSelectedItem () if (this.vAdjustement.Value + this.Allocation.Height < rect.Bottom) this.vAdjustement.Value = rect.Bottom - this.Allocation.Height; } - -// protected override void OnSetScrollAdjustments (Adjustment hAdjustement, Adjustment vAdjustement) -// { -// this.hAdjustement = hAdjustement; -// if (this.hAdjustement != null) { -// this.hAdjustement.ValueChanged += delegate { -// this.QueueDraw (); -// }; -// } -// this.vAdjustement = vAdjustement; -// if (this.vAdjustement != null) { -// this.vAdjustement.ValueChanged += delegate { -// this.QueueDraw (); -// }; -// } -// } + + // protected override void OnSetScrollAdjustments (Adjustment hAdjustement, Adjustment vAdjustement) + // { + // this.hAdjustement = hAdjustement; + // if (this.hAdjustement != null) { + // this.hAdjustement.ValueChanged += (sender, e) => this.QueueDraw (); + // } + // this.vAdjustement = vAdjustement; + // if (this.vAdjustement != null) { + // this.vAdjustement.ValueChanged += (sender, e) => this.QueueDraw (); + // } + // } #endregion #region Item & Category iteration @@ -917,47 +872,45 @@ void Iterate (ref int xpos, ref int ypos, Func vAdjustement.Upper) + // vAdjustement.Value = vAdjustement.Upper - vAdjustement.PageSize; + // if (vAdjustement.Value < 0) + // vAdjustement.Value = 0; + // } + // } + + protected override void OnSizeAllocated (Gdk.Rectangle allocation) + { + base.OnSizeAllocated (allocation); + if (!realSizeRequest) { + realSizeRequest = true; + QueueResize (); + } else + realSizeRequest = false; + } -// protected override void OnSizeRequested (ref Requisition req) -// { -// if (!realSizeRequest) { -// // Request a minimal width, to size recalculation infinite loops with -// // small widths, due to the vscrollbar being shown and hidden. -// req.Width = 50; -// req.Height = 0; -// return; -// } -// int xpos = 0; -// int ypos = 0; -// Iterate (ref xpos, ref ypos, null, null); -// req.Width = 50; -// req.Height = ypos; -// if (this.vAdjustement != null) { -// this.vAdjustement.SetBounds (0, -// ypos, -// 20, -// Allocation.Height, -// Allocation.Height); -// if (ypos < Allocation.Height) -// this.vAdjustement.Value = 0; -// if (vAdjustement.Value + vAdjustement.PageSize > vAdjustement.Upper) -// vAdjustement.Value = vAdjustement.Upper - vAdjustement.PageSize; -// if (vAdjustement.Value < 0) -// vAdjustement.Value = 0; -// } -// } - -// protected override void OnSizeAllocated (Gdk.Rectangle allocation) -// { -// base.OnSizeAllocated (allocation); -// if (!realSizeRequest) { -// realSizeRequest = true; -// QueueResize (); -// } -// else -// realSizeRequest = false; -// } - #endregion #region Tooltips @@ -1225,4 +1178,4 @@ public Item (Xwt.Drawing.Image icon, string text, string tooltip) : this (icon, public virtual int CompareTo (Item other) => other == null ? -1 : other.inner.CompareTo (other.inner); } -} +} \ No newline at end of file From 95bb6f9f5dd132a771ddebbb26e0e1fc9d19f47f Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 2 Mar 2024 12:23:23 +0100 Subject: [PATCH 306/382] update --- .../Mono.TextEditor/Gui/CodePreviewWindow.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodePreviewWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodePreviewWindow.cs index 98be1e7770d..6c8a61e1a0b 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodePreviewWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/CodePreviewWindow.cs @@ -74,9 +74,9 @@ public CodePreviewWindow ( } layout.Ellipsize = Pango.EllipsizeMode.End; - // var geometry = Screen.GetUsableMonitorGeometry (Screen.GetMonitorAtWindow (ParentWindow)); - // maxWidth = geometry.Width * 2 / 5; - // maxHeight = geometry.Height * 2 / 5; + var geometry = Screen.GetUsableMonitorGeometry (Screen.GetMonitorAtWindow (ParentWindow)); + maxWidth = geometry.Width * 2 / 5; + maxHeight = geometry.Height * 2 / 5; layout.SetText ("n"); layout.GetPixelSize (out int _, out int lineHeight); From 9ce86c7a117fec4c0ed3205a210b26af3264dccd Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 2 Mar 2024 12:36:11 +0100 Subject: [PATCH 307/382] update --- .../MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs index 19405d2747d..8766e1eedfc 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs @@ -133,7 +133,7 @@ public Gtk.MenuItem CreateInputMethodMenuItem (string label) if (GtkWorkarounds.GtkMinorVersion >= 16) { //bool showMenu = (bool) GtkWorkarounds.GetProperty (Settings, "gtk-show-input-method-menu").Val; //if (!showMenu) - return null; + // return null; } Gtk.MenuItem imContextMenuItem = new Gtk.MenuItem (label); Gtk.Menu imContextMenu = new Gtk.Menu (); From e7588f1eace08a566a63cec3b335f85d9e2b2ac9 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 2 Mar 2024 18:49:18 +0100 Subject: [PATCH 308/382] update --- .../DotNetCoreRuntimeOptionsPanelWidget.Gui.cs | 6 +++--- .../DotNetCoreRuntimeOptionsPanelWidget.cs | 12 ++++++------ .../DotNetCoreTestBase.cs | 11 +++++------ 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/DotNetCoreRuntimeOptionsPanelWidget.Gui.cs b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/DotNetCoreRuntimeOptionsPanelWidget.Gui.cs index 1c7b46496fc..fc20bef041e 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/DotNetCoreRuntimeOptionsPanelWidget.Gui.cs +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/DotNetCoreRuntimeOptionsPanelWidget.Gui.cs @@ -34,7 +34,7 @@ partial class DotNetCoreRuntimeOptionsPanelWidget : Bin VBox mainVBox; HBox mainHBox; Label targetFrameworkLabel; - ComboBox runtimeVersionCombo; + ComboBoxText runtimeVersionCombo; void Build () { @@ -56,8 +56,8 @@ void Build () targetFrameworkLabel.LabelProp = GettextCatalog.GetString ("Target _framework:"); targetFrameworkLabel.UseUnderline = true; mainHBox.PackStart (targetFrameworkLabel, false, true, 0); - - //runtimeVersionCombo = ComboBox.NewText (); + + runtimeVersionCombo = new global::Gtk.ComboBoxText(); runtimeVersionCombo.Name = "runtimeVersionCombo"; mainHBox.PackStart (runtimeVersionCombo, false, false, 0); mainVBox.PackStart (mainHBox, false, false, 0); diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/DotNetCoreRuntimeOptionsPanelWidget.cs b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/DotNetCoreRuntimeOptionsPanelWidget.cs index 5ad02cbeb92..c5cf91c091b 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/DotNetCoreRuntimeOptionsPanelWidget.cs +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/DotNetCoreRuntimeOptionsPanelWidget.cs @@ -50,7 +50,7 @@ public DotNetCoreRuntimeOptionsPanelWidget (DotNetProject project) } if (project.HasMultipleTargetFrameworks) { - //runtimeVersionCombo.AppendText (GettextCatalog.GetString ("(Multiple Frameworks)")); + runtimeVersionCombo.AppendText (GettextCatalog.GetString ("(Multiple Frameworks)")); runtimeVersionCombo.Active = 0; Sensitive = false; } else { @@ -76,11 +76,11 @@ public DotNetCoreRuntimeOptionsPanelWidget (DotNetProject project) for (int i = 0; i < knownFrameworks.Count; i++) { var fx = knownFrameworks[i]; - //if (installedFrameworks.Any (f => f.Id == fx.Id)) { - //runtimeVersionCombo.AppendText (fx.GetDisplayName ()); - //} else { - //runtimeVersionCombo.AppendText (GettextCatalog.GetString ("{0} (Not installed)", fx.GetDisplayName ())); - //} + if (installedFrameworks.Any (f => f.Id == fx.Id)) { + runtimeVersionCombo.AppendText (fx.GetDisplayName ()); + } else { + runtimeVersionCombo.AppendText (GettextCatalog.GetString ("{0} (Not installed)", fx.GetDisplayName ())); + } if (project.TargetFramework.Id == fx.Id) { runtimeVersionCombo.Active = i; diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreTestBase.cs b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreTestBase.cs index 82ea595776a..abf43ce44f2 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreTestBase.cs +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreTestBase.cs @@ -36,12 +36,11 @@ namespace MonoDevelop.DotNetCore.Tests [RequireService (typeof (TypeSystemService))] class DotNetCoreTestBase : TestBase { - //protected override Task InternalSetup (string rootDir) - //{ - //base.InternalSetup (rootDir); - //Xwt.Application.Initialize (Xwt.ToolkitType.Gtk3); - //DesktopService.Initialize (); - //} + protected override Task InternalSetup (string rootDir) + { + Xwt.Application.Initialize (Xwt.ToolkitType.Gtk3); + return base.InternalSetup (rootDir); + } /// /// Clear all other package sources and just use the main NuGet package source when From 4468b261e1b81482bc1a5671ce3029173dcf896b Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 2 Mar 2024 19:03:04 +0100 Subject: [PATCH 309/382] update --- ...kNuGetPackageMetadataOptionsPanelWidget.cs | 2 +- ...kNuGetPackageMetadataOptionsPanelWidget.cs | 26 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkNuGetPackageMetadataOptionsPanelWidget.cs b/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkNuGetPackageMetadataOptionsPanelWidget.cs index c3201e4051a..ab9a95b0581 100644 --- a/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkNuGetPackageMetadataOptionsPanelWidget.cs +++ b/main/src/addins/MonoDevelop.Packaging/Gui/MonoDevelop.Packaging.Gui.GtkNuGetPackageMetadataOptionsPanelWidget.cs @@ -48,7 +48,7 @@ public partial class GtkNuGetPackageMetadataOptionsPanelWidget private global::Gtk.HBox packageLanguageHBox; - private global::Gtk.ComboBox packageLanguageComboBox; + private global::Gtk.ComboBoxText packageLanguageComboBox; private global::Gtk.Label packageLanguageLabel; diff --git a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkNuGetPackageMetadataOptionsPanelWidget.cs b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkNuGetPackageMetadataOptionsPanelWidget.cs index 8a0b3d504dc..8e2ab47e58b 100644 --- a/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkNuGetPackageMetadataOptionsPanelWidget.cs +++ b/main/src/addins/MonoDevelop.Packaging/MonoDevelop.Packaging.Gui/GtkNuGetPackageMetadataOptionsPanelWidget.cs @@ -234,7 +234,7 @@ void UpdateMetadata () metadata.Copyright = packageCopyrightTextBox.Text; metadata.DevelopmentDependency = packageDevelopmentDependencyCheckBox.Active; metadata.IconUrl = packageIconUrlTextBox.Text; - //metadata.Language = GetSelectedLanguage (); + metadata.Language = GetSelectedLanguage (); metadata.LicenseUrl = packageLicenseUrlTextBox.Text; metadata.Owners = packageOwnersTextBox.Text; metadata.ProjectUrl = packageProjectUrlTextBox.Text; @@ -245,21 +245,21 @@ void UpdateMetadata () metadata.Title = packageTitleTextBox.Text; } - // string GetSelectedLanguage () - // { - // if (packageLanguageComboBox.Active == 0) { - // // 'None' selected. - // return string.Empty; - // } + string GetSelectedLanguage () + { + if (packageLanguageComboBox.Active == 0) { + // 'None' selected. + return string.Empty; + } - // int languageIndex = packageLanguageComboBox.Active - 1; - // if (languageIndex < languages.Count) { - // return languages [languageIndex].Name; - // } + int languageIndex = packageLanguageComboBox.Active - 1; + if (languageIndex < languages.Count) { + return languages [languageIndex].Name; + } // No match for language so just return the combo box text. - //return packageLanguageComboBox.ActiveText; - //} + return packageLanguageComboBox.ActiveText; + } void PopulateLanguages () { From c74895b9cbd1371f8ddf3e2743829d13e7897f60 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 2 Mar 2024 20:24:27 +0100 Subject: [PATCH 310/382] update --- ...lop.VersionControl.Dialogs.CommitDialog.cs | 42 +++++++------- ...ionControl.Dialogs.EditRepositoryDialog.cs | 50 ++++++++--------- ...nControl.Dialogs.SelectRepositoryDialog.cs | 56 +++++++++---------- ...VersionControl.UrlBasedRepositoryEditor.cs | 8 +-- 4 files changed, 78 insertions(+), 78 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs index 1fdee8c0144..eeac2698aff 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs @@ -27,11 +27,11 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.VersionControl.Dialogs.CommitDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Events = ((global::Gdk.EventMask)(256)); - // w1.Name = "dialog_VBox"; - // w1.Spacing = 6; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Events = ((global::Gdk.EventMask)(256)); + w1.Name = "dialog_VBox"; + w1.Spacing = 6; + w1.BorderWidth = ((uint)(2)); // Container child dialog_VBox.Gtk.Box+BoxChild this.mainBox = new global::Gtk.VBox (); this.mainBox.Name = "mainBox"; @@ -115,16 +115,16 @@ protected virtual void Build () global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.mainBox [this.scrolledwindow2])); w10.PackType = ((global::Gtk.PackType)(1)); w10.Position = 4; - //w1.Add (this.mainBox); - // global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(w1 [this.mainBox])); - // w11.Position = 0; + w1.Add (this.mainBox); + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(w1 [this.mainBox])); + w11.Position = 0; // Internal child MonoDevelop.VersionControl.Dialogs.CommitDialog.ActionArea - // global::Gtk.HButtonBox w12 = this.ActionArea; - // w12.Events = ((global::Gdk.EventMask)(256)); - // w12.Name = "VersionControlAddIn.CommitDialog_ActionArea"; - // w12.Spacing = 6; - // w12.BorderWidth = ((uint)(5)); - // w12.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w12 = (Gtk.HButtonBox)this.ActionArea; + w12.Events = ((global::Gdk.EventMask)(256)); + w12.Name = "VersionControlAddIn.CommitDialog_ActionArea"; + w12.Spacing = 6; + w12.BorderWidth = ((uint)(5)); + w12.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child VersionControlAddIn.CommitDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button29 = new global::Gtk.Button (); this.button29.CanDefault = true; @@ -134,9 +134,9 @@ protected virtual void Build () this.button29.UseUnderline = true; this.button29.Label = "gtk-cancel"; this.AddActionWidget (this.button29, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.button29])); - // w13.Expand = false; - // w13.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.button29])); + w13.Expand = false; + w13.Fill = false; // Container child VersionControlAddIn.CommitDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCommit = new global::Gtk.Button (); this.buttonCommit.CanDefault = true; @@ -145,10 +145,10 @@ protected virtual void Build () this.buttonCommit.UseUnderline = true; this.buttonCommit.Label = global::Mono.Unix.Catalog.GetString ("C_ommit"); this.AddActionWidget (this.buttonCommit, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.buttonCommit])); - // w14.Position = 1; - // w14.Expand = false; - // w14.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.buttonCommit])); + w14.Position = 1; + w14.Expand = false; + w14.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs index da191970aae..f7cb921fabf 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs @@ -9,7 +9,7 @@ internal partial class EditRepositoryDialog private global::Gtk.Entry entryName; private global::Gtk.Label label11; private global::Gtk.Label label8; - private global::Gtk.ComboBox versionControlType; + private global::Gtk.ComboBoxText versionControlType; private global::Gtk.HSeparator hseparator2; private global::Gtk.EventBox repoEditorContainer; private global::Gtk.Button button10; @@ -25,10 +25,10 @@ protected virtual void Build () this.BorderWidth = ((uint)(6)); this.DefaultWidth = 500; // Internal child MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Events = ((global::Gdk.EventMask)(256)); - // w1.Name = "dialog-vbox3"; - // w1.Spacing = 6; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Events = ((global::Gdk.EventMask)(256)); + w1.Name = "dialog-vbox3"; + w1.Spacing = 6; // Container child dialog-vbox3.Gtk.Box+BoxChild this.vbox1 = new global::Gtk.VBox (); this.vbox1.Name = "vbox1"; @@ -73,9 +73,9 @@ protected virtual void Build () w4.XOptions = ((global::Gtk.AttachOptions)(4)); w4.YOptions = ((global::Gtk.AttachOptions)(0)); // Container child table1.Gtk.Table+TableChild - // this.versionControlType = global::Gtk.ComboBox.NewText (); - // this.versionControlType.Name = "versionControlType"; - // this.table1.Add (this.versionControlType); + this.versionControlType = new global::Gtk.ComboBoxText (); + this.versionControlType.Name = "versionControlType"; + this.table1.Add (this.versionControlType); global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.versionControlType])); w5.LeftAttach = ((uint)(1)); w5.RightAttach = ((uint)(2)); @@ -100,16 +100,16 @@ protected virtual void Build () this.vbox1.Add (this.repoEditorContainer); global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.repoEditorContainer])); w8.Position = 2; - //w1.Add (this.vbox1); - // global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox1])); - // w9.Position = 0; + w1.Add (this.vbox1); + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox1])); + w9.Position = 0; // Internal child MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.ActionArea - // global::Gtk.HButtonBox w10 = this.ActionArea; - // w10.Events = ((global::Gdk.EventMask)(256)); - // w10.Name = "GtkDialog_ActionArea"; - // w10.Spacing = 10; - // w10.BorderWidth = ((uint)(5)); - // w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w10 = (Gtk.HButtonBox)this.ActionArea; + w10.Events = ((global::Gdk.EventMask)(256)); + w10.Name = "GtkDialog_ActionArea"; + w10.Spacing = 10; + w10.BorderWidth = ((uint)(5)); + w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child GtkDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button10 = new global::Gtk.Button (); this.button10.CanDefault = true; @@ -119,9 +119,9 @@ protected virtual void Build () this.button10.UseUnderline = true; this.button10.Label = "gtk-cancel"; this.AddActionWidget (this.button10, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button10])); - // w11.Expand = false; - // w11.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button10])); + w11.Expand = false; + w11.Fill = false; // Container child GtkDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -130,11 +130,11 @@ protected virtual void Build () this.buttonOk.UseStock = true; this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; - //w10.Add (this.buttonOk); - // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.buttonOk])); - // w12.Position = 1; - // w12.Expand = false; - // w12.Fill = false; + w10.Add (this.buttonOk); + global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.buttonOk])); + w12.Position = 1; + w12.Expand = false; + w12.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs index 797138bd27a..847e9b5ac8d 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs @@ -14,7 +14,7 @@ internal partial class SelectRepositoryDialog private global::Gtk.Label label3; - private global::Gtk.ComboBox repCombo; + private global::Gtk.ComboBoxText repCombo; private global::Gtk.HSeparator hseparator1; @@ -76,10 +76,10 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Events = ((global::Gdk.EventMask)(256)); - // w1.Name = "dialog_VBox"; - // w1.Spacing = 6; + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Events = ((global::Gdk.EventMask)(256)); + w1.Name = "dialog_VBox"; + w1.Spacing = 6; // Container child dialog_VBox.Gtk.Box+BoxChild this.vbox1 = new global::Gtk.VBox (); this.vbox1.Name = "vbox1"; @@ -109,11 +109,11 @@ protected virtual void Build () w2.Expand = false; w2.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - // this.repCombo = global::Gtk.ComboBox.NewText (); - // this.repCombo.Name = "repCombo"; - // this.hbox1.Add (this.repCombo); - // global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.repCombo])); - // w3.Position = 1; + this.repCombo = new global::Gtk.ComboBoxText (); + this.repCombo.Name = "repCombo"; + this.hbox1.Add (this.repCombo); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.repCombo])); + w3.Position = 1; this.vbox2.Add (this.hbox1); global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); w4.Position = 0; @@ -336,22 +336,22 @@ protected virtual void Build () w26.TopAttach = ((uint)(1)); w26.BottomAttach = ((uint)(2)); w26.XOptions = ((global::Gtk.AttachOptions)(4)); - //w26.YOptions = ((global::Gtk.AttachOptions)(4)); + w26.YOptions = ((global::Gtk.AttachOptions)(4)); this.vbox1.Add (this.table1); global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.table1])); w27.Position = 1; w27.Expand = false; w27.Fill = false; - //w1.Add (this.vbox1); - //global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox1])); - //w28.Position = 0; + w1.Add (this.vbox1); + global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox1])); + w28.Position = 0; // Internal child MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.ActionArea - // global::Gtk.HButtonBox w29 = this.ActionArea; - // w29.Events = ((global::Gdk.EventMask)(256)); - // w29.Name = "VersionControlAddIn.SelectRepositoryDialog_ActionArea"; - // w29.Spacing = 10; - // w29.BorderWidth = ((uint)(5)); - // w29.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w29 = (Gtk.HButtonBox)this.ActionArea; + w29.Events = ((global::Gdk.EventMask)(256)); + w29.Name = "VersionControlAddIn.SelectRepositoryDialog_ActionArea"; + w29.Spacing = 10; + w29.BorderWidth = ((uint)(5)); + w29.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child VersionControlAddIn.SelectRepositoryDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button559 = new global::Gtk.Button (); this.button559.CanDefault = true; @@ -361,9 +361,9 @@ protected virtual void Build () this.button559.UseUnderline = true; this.button559.Label = "gtk-cancel"; this.AddActionWidget (this.button559, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w30 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w29 [this.button559])); - // w30.Expand = false; - // w30.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w30 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w29 [this.button559])); + w30.Expand = false; + w30.Fill = false; // Container child VersionControlAddIn.SelectRepositoryDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -372,11 +372,11 @@ protected virtual void Build () this.buttonOk.UseStock = true; this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; - //w29.Add (this.buttonOk); - // global::Gtk.ButtonBox.ButtonBoxChild w31 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w29 [this.buttonOk])); - // w31.Position = 1; - // w31.Expand = false; - // w31.Fill = false; + w29.Add (this.buttonOk); + global::Gtk.ButtonBox.ButtonBoxChild w31 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w29 [this.buttonOk])); + w31.Position = 1; + w31.Expand = false; + w31.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs index 94846b42031..52f743f2804 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs @@ -6,7 +6,7 @@ public partial class UrlBasedRepositoryEditor { private global::Gtk.Table table1; private global::Gtk.HBox hbox1; - private global::Gtk.ComboBox comboProtocol; + private global::Gtk.ComboBoxText comboProtocol; private global::Gtk.HBox hbox2; private global::Gtk.SpinButton repositoryPortSpin; private global::Gtk.HSeparator hseparator2; @@ -39,9 +39,9 @@ protected virtual void Build () this.hbox1 = new global::Gtk.HBox (); this.hbox1.Name = "hbox1"; // Container child hbox1.Gtk.Box+BoxChild - // this.comboProtocol = global::Gtk.ComboBox.NewText (); - // this.comboProtocol.Name = "comboProtocol"; - // this.hbox1.Add (this.comboProtocol); + this.comboProtocol = new global::Gtk.ComboBoxText (); + this.comboProtocol.Name = "comboProtocol"; + this.hbox1.Add (this.comboProtocol); global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.comboProtocol])); w1.Position = 0; w1.Expand = false; From e9da4c2412d1282934e9c5e9231f9211f00ff466 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 2 Mar 2024 20:32:45 +0100 Subject: [PATCH 311/382] update --- .../MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs index 7251d1fe971..62d6385d3a5 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs @@ -222,6 +222,8 @@ protected override bool OnDrawn (Cairo.Context evnt) var win = GdkWindow; //win.Clear (); if (string.IsNullOrEmpty (message)) { + if (ShowEmptyItem) + return base.OnDrawn (evnt); return true; } From 96ebc8e33573b15c05eabbaa7cbedd899af7b977 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 5 Mar 2024 01:56:18 +0100 Subject: [PATCH 312/382] update --- ...ionControl.Git.ConflictResolutionDialog.cs | 44 +++++++++---------- ...op.VersionControl.Git.CredentialsDialog.cs | 40 ++++++++--------- ...lop.VersionControl.Git.EditBranchDialog.cs | 40 ++++++++--------- ...lop.VersionControl.Git.EditRemoteDialog.cs | 40 ++++++++--------- ...rsionControl.Git.GitConfigurationDialog.cs | 28 ++++++------ 5 files changed, 96 insertions(+), 96 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.ConflictResolutionDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.ConflictResolutionDialog.cs index a45e7c28c9d..dfab6e27f6f 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.ConflictResolutionDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.ConflictResolutionDialog.cs @@ -19,9 +19,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Merge Conflict Resolution"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.ConflictResolutionDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Name = "dialog1_VBox"; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -45,15 +45,15 @@ protected virtual void Build () this.vbox2.Add (this.mergeWidget); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.mergeWidget])); w3.Position = 1; - // w1.Add (this.vbox2); - // global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - // w4.Position = 0; + w1.Add (this.vbox2); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + w4.Position = 0; // Internal child MonoDevelop.VersionControl.Git.ConflictResolutionDialog.ActionArea - // global::Gtk.HButtonBox w5 = this.ActionArea; - // w5.Name = "dialog1_ActionArea"; - // w5.Spacing = 10; - // w5.BorderWidth = ((uint)(5)); - // w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w5 = (Gtk.HButtonBox)this.ActionArea; + w5.Name = "dialog1_ActionArea"; + w5.Spacing = 10; + w5.BorderWidth = ((uint)(5)); + w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -62,9 +62,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = global::Mono.Unix.Catalog.GetString ("Abort Update"); this.AddActionWidget (this.buttonCancel, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel])); - // w6.Expand = false; - // w6.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel])); + w6.Expand = false; + w6.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -73,10 +73,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = global::Mono.Unix.Catalog.GetString ("Skip Patch"); this.AddActionWidget (this.buttonOk, -7); - // global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk])); - // w7.Position = 1; - // w7.Expand = false; - // w7.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk])); + w7.Position = 1; + w7.Expand = false; + w7.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button24 = new global::Gtk.Button (); this.button24.CanFocus = true; @@ -84,10 +84,10 @@ protected virtual void Build () this.button24.UseUnderline = true; this.button24.Label = global::Mono.Unix.Catalog.GetString ("Accept Merge"); this.AddActionWidget (this.button24, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.button24])); - // w8.Position = 2; - // w8.Expand = false; - // w8.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.button24])); + w8.Position = 2; + w8.Expand = false; + w8.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.CredentialsDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.CredentialsDialog.cs index 464fefd9582..2046aae8ae6 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.CredentialsDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.CredentialsDialog.cs @@ -22,9 +22,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Git Credentials"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.CredentialsDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Name = "dialog1_VBox"; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox = new global::Gtk.VBox (); this.vbox.Name = "vbox"; @@ -51,17 +51,17 @@ protected virtual void Build () w3.Position = 1; w3.Expand = false; w3.Fill = false; - // w1.Add(this.vbox); - // global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1[this.vbox])); - // w4.Position = 0; - // w4.Expand = false; - // w4.Fill = false; + w1.Add(this.vbox); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1[this.vbox])); + w4.Position = 0; + w4.Expand = false; + w4.Fill = false; // Internal child MonoDevelop.VersionControl.Git.CredentialsDialog.ActionArea - // global::Gtk.HButtonBox w5 = this.ActionArea; - // w5.Name = "dialog1_ActionArea"; - // w5.Spacing = 10; - // w5.BorderWidth = ((uint)(5)); - // w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w5 = (Gtk.HButtonBox)this.ActionArea; + w5.Name = "dialog1_ActionArea"; + w5.Spacing = 10; + w5.BorderWidth = ((uint)(5)); + w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -71,9 +71,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget(this.buttonCancel, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5[this.buttonCancel])); - // w6.Expand = false; - // w6.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5[this.buttonCancel])); + w6.Expand = false; + w6.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -83,10 +83,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget(this.buttonOk, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5[this.buttonOk])); - // w7.Position = 1; - // w7.Expand = false; - // w7.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5[this.buttonOk])); + w7.Position = 1; + w7.Expand = false; + w7.Fill = false; if ((this.Child != null)) { this.Child.ShowAll(); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditBranchDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditBranchDialog.cs index 4c8cdc7fb0c..685176dd193 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditBranchDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditBranchDialog.cs @@ -32,9 +32,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Branch Properties"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.EditBranchDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Name = "dialog1_VBox"; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox5 = new global::Gtk.VBox (); this.vbox5.Name = "vbox5"; @@ -106,17 +106,17 @@ protected virtual void Build () w8.Position = 2; w8.Expand = false; w8.Fill = false; - // w1.Add (this.vbox5); - // global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5])); - // w9.Position = 0; - // w9.Expand = false; - // w9.Fill = false; + w1.Add (this.vbox5); + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5])); + w9.Position = 0; + w9.Expand = false; + w9.Fill = false; // Internal child MonoDevelop.VersionControl.Git.EditBranchDialog.ActionArea - // global::Gtk.HButtonBox w10 = this.ActionArea; - // w10.Name = "dialog1_ActionArea"; - // w10.Spacing = 10; - // w10.BorderWidth = ((uint)(5)); - // w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w10 = (Gtk.HButtonBox)this.ActionArea; + w10.Name = "dialog1_ActionArea"; + w10.Spacing = 10; + w10.BorderWidth = ((uint)(5)); + w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -126,9 +126,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.buttonCancel])); - // w11.Expand = false; - // w11.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.buttonCancel])); + w11.Expand = false; + w11.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -138,10 +138,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.buttonOk])); - // w12.Position = 1; - // w12.Expand = false; - // w12.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.buttonOk])); + w12.Position = 1; + w12.Expand = false; + w12.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditRemoteDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditRemoteDialog.cs index f538e016fdf..35136ef03ed 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditRemoteDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditRemoteDialog.cs @@ -34,9 +34,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Remote Source"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.EditRemoteDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Name = "dialog1_VBox"; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox7 = new global::Gtk.VBox (); this.vbox7.Name = "vbox7"; @@ -132,17 +132,17 @@ protected virtual void Build () w9.Position = 1; w9.Expand = false; w9.Fill = false; - // w1.Add (this.vbox7); - // global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox7])); - // w10.Position = 0; - // w10.Expand = false; - // w10.Fill = false; + w1.Add (this.vbox7); + global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox7])); + w10.Position = 0; + w10.Expand = false; + w10.Fill = false; // Internal child MonoDevelop.VersionControl.Git.EditRemoteDialog.ActionArea - // global::Gtk.HButtonBox w11 = this.ActionArea; - // w11.Name = "dialog1_ActionArea"; - // w11.Spacing = 10; - // w11.BorderWidth = ((uint)(5)); - // w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w11 = (Gtk.HButtonBox)this.ActionArea; + w11.Name = "dialog1_ActionArea"; + w11.Spacing = 10; + w11.BorderWidth = ((uint)(5)); + w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -152,9 +152,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonCancel])); - // w12.Expand = false; - // w12.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonCancel])); + w12.Expand = false; + w12.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -164,10 +164,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonOk])); - // w13.Position = 1; - // w13.Expand = false; - // w13.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonOk])); + w13.Position = 1; + w13.Expand = false; + w13.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs index bdea64adb45..62826d36538 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs @@ -46,9 +46,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Git Repository Configuration"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.GitConfigurationDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Name = "dialog1_VBox"; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.notebook1 = new global::Gtk.Notebook (); this.notebook1.CanFocus = true; @@ -327,15 +327,15 @@ protected virtual void Build () this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Remote Sources"); this.notebook1.SetTabLabel (this.vbox4, this.label2); this.label2.ShowAll (); - //w1.Add (this.notebook1); - // global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(w1 [this.notebook1])); - // w30.Position = 0; + w1.Add (this.notebook1); + global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(w1 [this.notebook1])); + w30.Position = 0; // Internal child MonoDevelop.VersionControl.Git.GitConfigurationDialog.ActionArea - // global::Gtk.HButtonBox w31 = this.ActionArea; - // w31.Name = "dialog1_ActionArea"; - // w31.Spacing = 10; - // w31.BorderWidth = ((uint)(5)); - // w31.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w31 = (Gtk.HButtonBox)this.ActionArea; + w31.Name = "dialog1_ActionArea"; + w31.Spacing = 10; + w31.BorderWidth = ((uint)(5)); + w31.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -345,9 +345,9 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-close"; this.AddActionWidget (this.buttonOk, -7); - // global::Gtk.ButtonBox.ButtonBoxChild w32 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w31 [this.buttonOk])); - // w32.Expand = false; - // w32.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w32 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w31 [this.buttonOk])); + w32.Expand = false; + w32.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } From f6c72b11bd59b418ed4f34be6c8f2bc696a389e7 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 5 Mar 2024 12:03:01 +0100 Subject: [PATCH 313/382] update --- ...oDevelop.VersionControl.Git.MergeDialog.cs | 36 ++++++------ ...velop.VersionControl.Git.NewStashDialog.cs | 40 ++++++------- ...noDevelop.VersionControl.Git.PushDialog.cs | 56 +++++++++---------- 3 files changed, 66 insertions(+), 66 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.MergeDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.MergeDialog.cs index 84a1bdc848a..712299b5940 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.MergeDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.MergeDialog.cs @@ -27,9 +27,9 @@ protected virtual void Build () this.Name = "MonoDevelop.VersionControl.Git.MergeDialog"; this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.MergeDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Name = "dialog1_VBox"; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -82,15 +82,15 @@ protected virtual void Build () w6.Position = 3; w6.Expand = false; w6.Fill = false; - // w1.Add (this.vbox2); - // global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - // w7.Position = 0; + w1.Add (this.vbox2); + global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + w7.Position = 0; // Internal child MonoDevelop.VersionControl.Git.MergeDialog.ActionArea - // global::Gtk.HButtonBox w8 = this.ActionArea; - // w8.Name = "dialog1_ActionArea"; - // w8.Spacing = 10; - // w8.BorderWidth = ((uint)(5)); - // w8.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w8 = (Gtk.HButtonBox)this.ActionArea; + w8.Name = "dialog1_ActionArea"; + w8.Spacing = 10; + w8.BorderWidth = ((uint)(5)); + w8.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -100,9 +100,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w9 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w8 [this.buttonCancel])); - // w9.Expand = false; - // w9.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w9 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w8 [this.buttonCancel])); + w9.Expand = false; + w9.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -111,10 +111,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = global::Mono.Unix.Catalog.GetString ("Merge"); this.AddActionWidget (this.buttonOk, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w10 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w8 [this.buttonOk])); - // w10.Position = 1; - // w10.Expand = false; - // w10.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w10 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w8 [this.buttonOk])); + w10.Position = 1; + w10.Expand = false; + w10.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.NewStashDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.NewStashDialog.cs index c23784b847b..428c2c0a960 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.NewStashDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.NewStashDialog.cs @@ -18,9 +18,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Stash"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.NewStashDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Name = "dialog1_VBox"; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.hbox3 = new global::Gtk.HBox (); this.hbox3.Name = "hbox3"; @@ -44,17 +44,17 @@ protected virtual void Build () this.hbox3.Add (this.entryComment); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.entryComment])); w3.Position = 1; - // w1.Add (this.hbox3); - // global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox3])); - // w4.Position = 0; - // w4.Expand = false; - // w4.Fill = false; + w1.Add (this.hbox3); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox3])); + w4.Position = 0; + w4.Expand = false; + w4.Fill = false; // Internal child MonoDevelop.VersionControl.Git.NewStashDialog.ActionArea - // global::Gtk.HButtonBox w5 = this.ActionArea; - // w5.Name = "dialog1_ActionArea"; - // w5.Spacing = 10; - // w5.BorderWidth = ((uint)(5)); - // w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w5 = (Gtk.HButtonBox)this.ActionArea; + w5.Name = "dialog1_ActionArea"; + w5.Spacing = 10; + w5.BorderWidth = ((uint)(5)); + w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -64,9 +64,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel])); - // w6.Expand = false; - // w6.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel])); + w6.Expand = false; + w6.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -76,10 +76,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk])); - // w7.Position = 1; - // w7.Expand = false; - // w7.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk])); + w7.Position = 1; + w7.Expand = false; + w7.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.PushDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.PushDialog.cs index f962c573f8b..ed711ae82ff 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.PushDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.PushDialog.cs @@ -7,9 +7,9 @@ internal partial class PushDialog private global::Gtk.VBox vbox2; private global::Gtk.HBox hbox1; private global::Gtk.Label label1; - private global::Gtk.ComboBox remoteCombo; + private global::Gtk.ComboBoxText remoteCombo; private global::Gtk.Label label2; - private global::Gtk.ComboBox branchCombo; + private global::Gtk.ComboBoxText branchCombo; private global::MonoDevelop.VersionControl.Views.ChangeSetView changeList; private global::Gtk.Button buttonCancel; private global::Gtk.Button buttonOk; @@ -22,9 +22,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Push to Repository"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.PushDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Name = "dialog1_VBox"; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -44,11 +44,11 @@ protected virtual void Build () w2.Expand = false; w2.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - // this.remoteCombo = global::Gtk.ComboBox.NewText (); - // this.remoteCombo.Name = "remoteCombo"; - // this.hbox1.Add (this.remoteCombo); - // global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.remoteCombo])); - // w3.Position = 1; + this.remoteCombo = new global::Gtk.ComboBoxText (); + this.remoteCombo.Name = "remoteCombo"; + this.hbox1.Add (this.remoteCombo); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.remoteCombo])); + w3.Position = 1; // Container child hbox1.Gtk.Box+BoxChild this.label2 = new global::Gtk.Label (); this.label2.Name = "label2"; @@ -59,9 +59,9 @@ protected virtual void Build () w4.Expand = false; w4.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - // this.branchCombo = global::Gtk.ComboBox.NewText (); - // this.branchCombo.Name = "branchCombo"; - // this.hbox1.Add (this.branchCombo); + this.branchCombo = new global::Gtk.ComboBoxText (); + this.branchCombo.Name = "branchCombo"; + this.hbox1.Add (this.branchCombo); global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.branchCombo])); w5.Position = 3; this.vbox2.Add (this.hbox1); @@ -77,15 +77,15 @@ protected virtual void Build () this.vbox2.Add (this.changeList); global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.changeList])); w7.Position = 1; - // w1.Add (this.vbox2); - // global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - // w8.Position = 0; + w1.Add (this.vbox2); + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + w8.Position = 0; // Internal child MonoDevelop.VersionControl.Git.PushDialog.ActionArea - // global::Gtk.HButtonBox w9 = this.ActionArea; - // w9.Name = "dialog1_ActionArea"; - // w9.Spacing = 10; - // w9.BorderWidth = ((uint)(5)); - // w9.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w9 = (Gtk.HButtonBox)this.ActionArea; + w9.Name = "dialog1_ActionArea"; + w9.Spacing = 10; + w9.BorderWidth = ((uint)(5)); + w9.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -95,9 +95,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w10 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w9 [this.buttonCancel])); - // w10.Expand = false; - // w10.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w10 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w9 [this.buttonCancel])); + w10.Expand = false; + w10.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -106,10 +106,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = global::Mono.Unix.Catalog.GetString ("Push Changes"); this.AddActionWidget (this.buttonOk, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w9 [this.buttonOk])); - // w11.Position = 1; - // w11.Expand = false; - // w11.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w9 [this.buttonOk])); + w11.Position = 1; + w11.Expand = false; + w11.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } From 01b3d1f57c4a1b66c0a44bcc4f2c197daaed3d6c Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 5 Mar 2024 12:58:59 +0100 Subject: [PATCH 314/382] update --- ...p.VersionControl.Git.StashManagerDialog.cs | 36 +++++++-------- ....VersionControl.Git.UserGitConfigDialog.cs | 40 ++++++++--------- ...rsionControl.Git.UserInfoConflictDialog.cs | 40 ++++++++--------- ....Subversion.Gui.ClientCertificateDialog.cs | 44 +++++++++---------- ...ion.Gui.ClientCertificatePasswordDialog.cs | 44 +++++++++---------- ...rol.Subversion.Gui.SslServerTrustDialog.cs | 40 ++++++++--------- ...ntrol.Subversion.Gui.UserPasswordDialog.cs | 40 ++++++++--------- 7 files changed, 142 insertions(+), 142 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.StashManagerDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.StashManagerDialog.cs index 5a3c62776c8..94cfd41189b 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.StashManagerDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.StashManagerDialog.cs @@ -23,9 +23,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Stash Manager"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.StashManagerDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Name = "dialog1_VBox"; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.hbox2 = new global::Gtk.HBox (); this.hbox2.Name = "hbox2"; @@ -101,19 +101,19 @@ protected virtual void Build () w8.Expand = false; w8.Fill = false; this.hbox2.Add (this.vboxButtons); - // global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.vboxButtons])); - // w9.Position = 1; - // w9.Expand = false; - // w9.Fill = false; - // w1.Add (this.hbox2); - // global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox2])); - // w10.Position = 0; + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.vboxButtons])); + w9.Position = 1; + w9.Expand = false; + w9.Fill = false; + w1.Add (this.hbox2); + global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox2])); + w10.Position = 0; // Internal child MonoDevelop.VersionControl.Git.StashManagerDialog.ActionArea - // global::Gtk.HButtonBox w11 = this.ActionArea; - // w11.Name = "dialog1_ActionArea"; - // w11.Spacing = 10; - // w11.BorderWidth = ((uint)(5)); - // w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w11 = (Gtk.HButtonBox)this.ActionArea; + w11.Name = "dialog1_ActionArea"; + w11.Spacing = 10; + w11.BorderWidth = ((uint)(5)); + w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -123,9 +123,9 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-close"; this.AddActionWidget (this.buttonOk, -7); - // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonOk])); - // w12.Expand = false; - // w12.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonOk])); + w12.Expand = false; + w12.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserGitConfigDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserGitConfigDialog.cs index 9e8f3c572aa..0e26500e2df 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserGitConfigDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserGitConfigDialog.cs @@ -33,9 +33,9 @@ protected virtual void Build () this.Name = "MonoDevelop.VersionControl.Git.UserGitConfigDialog"; this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.UserGitConfigDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Name = "dialog1_VBox"; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -102,17 +102,17 @@ protected virtual void Build () w9.Position = 1; w9.Expand = false; w9.Fill = false; - //w1.Add (this.vbox2); - // global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - // w10.Position = 0; - // w10.Expand = false; - // w10.Fill = false; + w1.Add (this.vbox2); + global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + w10.Position = 0; + w10.Expand = false; + w10.Fill = false; // Internal child MonoDevelop.VersionControl.Git.UserGitConfigDialog.ActionArea - // global::Gtk.HButtonBox w11 = this.ActionArea; - // w11.Name = "dialog1_ActionArea"; - // w11.Spacing = 10; - // w11.BorderWidth = ((uint)(5)); - // w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w11 = (Gtk.HButtonBox)this.ActionArea; + w11.Name = "dialog1_ActionArea"; + w11.Spacing = 10; + w11.BorderWidth = ((uint)(5)); + w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -122,9 +122,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonCancel])); - // w12.Expand = false; - // w12.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonCancel])); + w12.Expand = false; + w12.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -134,10 +134,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonOk])); - // w13.Position = 1; - // w13.Expand = false; - // w13.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.buttonOk])); + w13.Position = 1; + w13.Expand = false; + w13.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserInfoConflictDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserInfoConflictDialog.cs index be95842d57e..4a9a0251247 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserInfoConflictDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserInfoConflictDialog.cs @@ -25,9 +25,9 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("User Information Conflict"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.UserInfoConflictDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Name = "dialog1_VBox"; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Name = "dialog1_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -113,17 +113,17 @@ protected virtual void Build () w10.Position = 5; w10.Expand = false; w10.Fill = false; - // w1.Add (this.vbox2); - // global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - // w11.Position = 0; - // w11.Expand = false; - // w11.Fill = false; + w1.Add (this.vbox2); + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + w11.Position = 0; + w11.Expand = false; + w11.Fill = false; // Internal child MonoDevelop.VersionControl.Git.UserInfoConflictDialog.ActionArea - // global::Gtk.HButtonBox w12 = this.ActionArea; - // w12.Name = "dialog1_ActionArea"; - // w12.Spacing = 10; - // w12.BorderWidth = ((uint)(5)); - // w12.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w12 = (Gtk.HButtonBox)this.ActionArea; + w12.Name = "dialog1_ActionArea"; + w12.Spacing = 10; + w12.BorderWidth = ((uint)(5)); + w12.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonCancel = new global::Gtk.Button (); this.buttonCancel.CanDefault = true; @@ -133,9 +133,9 @@ protected virtual void Build () this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.AddActionWidget (this.buttonCancel, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.buttonCancel])); - // w13.Expand = false; - // w13.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.buttonCancel])); + w13.Expand = false; + w13.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.buttonOk = new global::Gtk.Button (); this.buttonOk.CanDefault = true; @@ -145,10 +145,10 @@ protected virtual void Build () this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.AddActionWidget (this.buttonOk, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.buttonOk])); - // w14.Position = 1; - // w14.Expand = false; - // w14.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.buttonOk])); + w14.Position = 1; + w14.Expand = false; + w14.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs index 855ffebca9c..d0e64732fb5 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs @@ -23,10 +23,10 @@ protected virtual void Build () this.Name = "MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog"; this.Title = global::Mono.Unix.Catalog.GetString ("Client Certificate Required"); // Internal child MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Events = ((global::Gdk.EventMask)(256)); - // w1.Name = "dialog_VBox"; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Events = ((global::Gdk.EventMask)(256)); + w1.Name = "dialog_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -100,18 +100,18 @@ protected virtual void Build () w8.Position = 4; w8.Expand = false; w8.Fill = false; - // w1.Add (this.vbox2); - // global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - // w9.Position = 0; - // w9.Expand = false; - // w9.Fill = false; + w1.Add (this.vbox2); + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + w9.Position = 0; + w9.Expand = false; + w9.Fill = false; // Internal child MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.ActionArea - // global::Gtk.HButtonBox w10 = this.ActionArea; - // w10.Events = ((global::Gdk.EventMask)(256)); - // w10.Name = "MonoDevelop.VersionControl.Subversion.ClientCertificateDialog_ActionArea"; - // w10.Spacing = 10; - // w10.BorderWidth = ((uint)(5)); - // w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w10 = (Gtk.HButtonBox)this.ActionArea; + w10.Events = ((global::Gdk.EventMask)(256)); + w10.Name = "MonoDevelop.VersionControl.Subversion.ClientCertificateDialog_ActionArea"; + w10.Spacing = 10; + w10.BorderWidth = ((uint)(5)); + w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child MonoDevelop.VersionControl.Subversion.ClientCertificateDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button34 = new global::Gtk.Button (); this.button34.CanDefault = true; @@ -121,9 +121,9 @@ protected virtual void Build () this.button34.UseUnderline = true; this.button34.Label = "gtk-cancel"; this.AddActionWidget (this.button34, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button34])); - // w11.Expand = false; - // w11.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button34])); + w11.Expand = false; + w11.Fill = false; // Container child MonoDevelop.VersionControl.Subversion.ClientCertificateDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button24 = new global::Gtk.Button (); this.button24.CanDefault = true; @@ -133,10 +133,10 @@ protected virtual void Build () this.button24.UseUnderline = true; this.button24.Label = "gtk-ok"; this.AddActionWidget (this.button24, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button24])); - // w12.Position = 1; - // w12.Expand = false; - // w12.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button24])); + w12.Position = 1; + w12.Expand = false; + w12.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs index e8301204b86..19410b8df16 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs @@ -23,10 +23,10 @@ protected virtual void Build () this.Name = "MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog"; this.Title = global::Mono.Unix.Catalog.GetString ("Password for client certificate"); // Internal child MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Events = ((global::Gdk.EventMask)(256)); - // w1.Name = "dialog_VBox"; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Events = ((global::Gdk.EventMask)(256)); + w1.Name = "dialog_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -104,18 +104,18 @@ protected virtual void Build () w8.Position = 4; w8.Expand = false; w8.Fill = false; - // w1.Add (this.vbox2); - // global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - // w9.Position = 0; - // w9.Expand = false; - // w9.Fill = false; + w1.Add (this.vbox2); + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + w9.Position = 0; + w9.Expand = false; + w9.Fill = false; // Internal child MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.ActionArea - // global::Gtk.HButtonBox w10 = this.ActionArea; - // w10.Events = ((global::Gdk.EventMask)(256)); - // w10.Name = "MonoDevelop.VersionControl.Subversion.ClientCertificatePasswordDialog_ActionArea"; - // w10.Spacing = 10; - // w10.BorderWidth = ((uint)(5)); - // w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w10 = (Gtk.HButtonBox)this.ActionArea; + w10.Events = ((global::Gdk.EventMask)(256)); + w10.Name = "MonoDevelop.VersionControl.Subversion.ClientCertificatePasswordDialog_ActionArea"; + w10.Spacing = 10; + w10.BorderWidth = ((uint)(5)); + w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child MonoDevelop.VersionControl.Subversion.ClientCertificatePasswordDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button23 = new global::Gtk.Button (); this.button23.CanDefault = true; @@ -125,9 +125,9 @@ protected virtual void Build () this.button23.UseUnderline = true; this.button23.Label = "gtk-cancel"; this.AddActionWidget (this.button23, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button23])); - // w11.Expand = false; - // w11.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button23])); + w11.Expand = false; + w11.Fill = false; // Container child MonoDevelop.VersionControl.Subversion.ClientCertificatePasswordDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button28 = new global::Gtk.Button (); this.button28.CanDefault = true; @@ -137,10 +137,10 @@ protected virtual void Build () this.button28.UseUnderline = true; this.button28.Label = "gtk-ok"; this.AddActionWidget (this.button28, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button28])); - // w12.Position = 1; - // w12.Expand = false; - // w12.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.button28])); + w12.Position = 1; + w12.Expand = false; + w12.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs index 3ba22b14284..08b7d1ddaab 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs @@ -67,10 +67,10 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Repository Certified by an Unknown Authority"); this.Modal = true; // Internal child MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Events = ((global::Gdk.EventMask)(256)); - // w1.Name = "dialog_VBox"; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Events = ((global::Gdk.EventMask)(256)); + w1.Name = "dialog_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog_VBox.Gtk.Box+BoxChild this.hbox1 = new global::Gtk.HBox (); this.hbox1.Name = "hbox1"; @@ -336,16 +336,16 @@ protected virtual void Build () this.hbox1.Add (this.vbox3); global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox3])); w25.Position = 1; - // w1.Add (this.hbox1); - // global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox1])); - // w26.Position = 0; + w1.Add (this.hbox1); + global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox1])); + w26.Position = 0; // Internal child MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.ActionArea - // global::Gtk.HButtonBox w27 = this.ActionArea; - // w27.Events = ((global::Gdk.EventMask)(256)); - // w27.Name = "MonoDevelop.VersionControl.Subversion.SslServerTrustDialog_ActionArea"; - // w27.Spacing = 10; - // w27.BorderWidth = ((uint)(5)); - // w27.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w27 = (Gtk.HButtonBox)this.ActionArea; + w27.Events = ((global::Gdk.EventMask)(256)); + w27.Name = "MonoDevelop.VersionControl.Subversion.SslServerTrustDialog_ActionArea"; + w27.Spacing = 10; + w27.BorderWidth = ((uint)(5)); + w27.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child MonoDevelop.VersionControl.Subversion.SslServerTrustDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button98 = new global::Gtk.Button (); this.button98.CanDefault = true; @@ -355,9 +355,9 @@ protected virtual void Build () this.button98.UseUnderline = true; this.button98.Label = "gtk-cancel"; this.AddActionWidget (this.button98, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w28 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w27 [this.button98])); - // w28.Expand = false; - // w28.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w28 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w27 [this.button98])); + w28.Expand = false; + w28.Fill = false; // Container child MonoDevelop.VersionControl.Subversion.SslServerTrustDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button104 = new global::Gtk.Button (); this.button104.CanDefault = true; @@ -367,10 +367,10 @@ protected virtual void Build () this.button104.UseUnderline = true; this.button104.Label = "gtk-ok"; this.AddActionWidget (this.button104, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w29 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w27 [this.button104])); - // w29.Position = 1; - // w29.Expand = false; - // w29.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w29 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w27 [this.button104])); + w29.Position = 1; + w29.Expand = false; + w29.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs index a42a4b6d8b1..53e3e48c5f5 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs @@ -27,10 +27,10 @@ protected virtual void Build () this.Resizable = false; //this.AllowGrow = false; // Internal child MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.VBox - // global::Gtk.VBox w1 = this.VBox; - // w1.Events = ((global::Gdk.EventMask)(256)); - // w1.Name = "dialog_VBox"; - // w1.BorderWidth = ((uint)(2)); + global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + w1.Events = ((global::Gdk.EventMask)(256)); + w1.Name = "dialog_VBox"; + w1.BorderWidth = ((uint)(2)); // Container child dialog_VBox.Gtk.Box+BoxChild this.vbox2 = new global::Gtk.VBox (); this.vbox2.Name = "vbox2"; @@ -123,16 +123,16 @@ protected virtual void Build () w9.Position = 3; w9.Expand = false; w9.Fill = false; - // w1.Add (this.vbox2); - // global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); - // w10.Position = 0; + w1.Add (this.vbox2); + global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + w10.Position = 0; // Internal child MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.ActionArea - // global::Gtk.HButtonBox w11 = this.ActionArea; - // w11.Events = ((global::Gdk.EventMask)(256)); - // w11.Name = "MonoDevelop.VersionControl.Subversion.UserPasswordDialog_ActionArea"; - // w11.Spacing = 10; - // w11.BorderWidth = ((uint)(5)); - // w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w11 = (Gtk.HButtonBox)this.ActionArea; + w11.Events = ((global::Gdk.EventMask)(256)); + w11.Name = "MonoDevelop.VersionControl.Subversion.UserPasswordDialog_ActionArea"; + w11.Spacing = 10; + w11.BorderWidth = ((uint)(5)); + w11.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child MonoDevelop.VersionControl.Subversion.UserPasswordDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button1 = new global::Gtk.Button (); this.button1.CanDefault = true; @@ -142,9 +142,9 @@ protected virtual void Build () this.button1.UseUnderline = true; this.button1.Label = "gtk-cancel"; this.AddActionWidget (this.button1, -6); - // global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.button1])); - // w12.Expand = false; - // w12.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.button1])); + w12.Expand = false; + w12.Fill = false; // Container child MonoDevelop.VersionControl.Subversion.UserPasswordDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild this.button7 = new global::Gtk.Button (); this.button7.CanDefault = true; @@ -154,10 +154,10 @@ protected virtual void Build () this.button7.UseUnderline = true; this.button7.Label = "gtk-ok"; this.AddActionWidget (this.button7, -5); - // global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.button7])); - // w13.Position = 1; - // w13.Expand = false; - // w13.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w11 [this.button7])); + w13.Position = 1; + w13.Expand = false; + w13.Fill = false; if ((this.Child != null)) { this.Child.ShowAll (); } From c824848b8f5efc22794abab02c9cc15c400e380b Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 5 Mar 2024 13:06:21 +0100 Subject: [PATCH 315/382] update --- .../EditRepositoryDialog.cs | 4 ++-- .../SelectRepositoryDialog.cs | 2 +- .../MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs index 7fcf1ad4369..5f99489b629 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs @@ -17,7 +17,7 @@ public EditRepositoryDialog (Repository editedRepository) if (repo != null) { versionControlType.Sensitive = false; - //versionControlType.AppendText (repo.VersionControlSystem.Name); + versionControlType.AppendText (repo.VersionControlSystem.Name); versionControlType.Active = 0; editor = repo.VersionControlSystem.CreateRepositoryEditor (repo); @@ -27,7 +27,7 @@ public EditRepositoryDialog (Repository editedRepository) else { foreach (VersionControlSystem vcs in VersionControlService.GetVersionControlSystems ()) { if (vcs.IsInstalled) { - //versionControlType.AppendText (vcs.Name); + versionControlType.AppendText (vcs.Name); systems.Add (vcs); } } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs index 0262842c92f..39931152e46 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs @@ -42,7 +42,7 @@ public SelectRepositoryDialog (SelectRepositoryMode mode) Modal = true; foreach (VersionControlSystem vcs in VersionControlService.GetVersionControlSystems ()) { if (vcs.IsInstalled) { - //repCombo.AppendText (vcs.Name); + repCombo.AppendText (vcs.Name); systems.Add (vcs); } } diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs index b9e83ebadd6..7ad2d6a80ff 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs @@ -27,8 +27,8 @@ public UrlBasedRepositoryEditor (UrlBasedRepository repo) protocols.AddRange (repo.SupportedNonUrlProtocols); this.repo = repo; - //foreach (string p in protocols) - //comboProtocol.AppendText (p); + foreach (string p in protocols) + comboProtocol.AppendText (p); updating = true; repositoryUrlEntry.Text = repo.Url; From 5e447efac4bab6baf33c1a1d982ac04088918582 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 5 Mar 2024 16:27:13 +0100 Subject: [PATCH 316/382] update --- ...op.CSharp.Formatting.CSharpFormattingProfileDialog.cs | 2 +- .../GenerateCodeWindow.cs | 9 +++++---- .../CSharpFormattingProfileDialog.cs | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs index e60ad7b016d..c40013d81eb 100644 --- a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs +++ b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs @@ -14,7 +14,7 @@ internal partial class CSharpFormattingProfileDialog private global::Gtk.Label label12; - private global::Gtk.ComboBox comboboxCategories; + private global::Gtk.ComboBoxText comboboxCategories; private global::Gtk.Notebook notebookCategories; diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs index 6bff31a6dfe..f693bdfe346 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs @@ -33,6 +33,7 @@ using MonoDevelop.Ide; using MonoDevelop.Ide.Editor; using System.Threading; +using Cairo; namespace MonoDevelop.CodeGeneration { @@ -207,8 +208,8 @@ public BorderBox () : base (false, 8) BorderWidth = 3; } - // protected override bool OnExposeEvent (Gdk.EventExpose evnt) - // { + protected override bool OnDrawn (Cairo.Context evnt) + { // Style.PaintFlatBox (Style, // evnt.Window, // StateType.Normal, @@ -221,8 +222,8 @@ public BorderBox () : base (false, 8) // Allocation.Width - 2, // Allocation.Height - 2); - // return base.OnExposeEvent (evnt); - // } + return base.OnDrawn (evnt); + } } /* protected override bool OnExposeEvent (Gdk.EventExpose evnt) diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs index c28d52f7feb..793ec3ca397 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs @@ -123,10 +123,10 @@ public CSharpFormattingProfileDialog (CSharpFormattingPolicy profile) UpdateExample (model, iter); }; notebookCategories.ShowTabs = false; - //comboboxCategories.AppendText (GettextCatalog.GetString ("Indentation")); - //comboboxCategories.AppendText (GettextCatalog.GetString ("New Lines")); - //comboboxCategories.AppendText (GettextCatalog.GetString ("Spacing")); - //comboboxCategories.AppendText (GettextCatalog.GetString ("Wrapping")); + comboboxCategories.AppendText (GettextCatalog.GetString ("Indentation")); + comboboxCategories.AppendText (GettextCatalog.GetString ("New Lines")); + comboboxCategories.AppendText (GettextCatalog.GetString ("Spacing")); + comboboxCategories.AppendText (GettextCatalog.GetString ("Wrapping")); comboboxCategories.Changed += delegate { texteditor.Text = ""; notebookCategories.Page = comboboxCategories.Active; From c87b8119571828cd7d2eae262781b6e452af9323 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 5 Mar 2024 16:34:06 +0100 Subject: [PATCH 317/382] update --- .../MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs b/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs index b9aaf694fd8..40675d77c47 100644 --- a/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs +++ b/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs @@ -47,8 +47,8 @@ protected virtual void Build () this.noneRadioButton.Active = true; this.noneRadioButton.DrawIndicator = true; this.noneRadioButton.UseUnderline = true; - // this.noneRadioButton.Group = new global::GLib.SList (global::System.IntPtr.Zero); - // this.noneRadioButton.Remove (this.noneRadioButton.Child); + this.noneRadioButton.Group = new Gtk.RadioButton [0]; + this.noneRadioButton.Remove (this.noneRadioButton.Child); // Container child noneRadioButton.Gtk.Container+ContainerChild this.label3 = new global::Gtk.Label (); this.label3.Name = "label3"; From 64b5c38bbf694e6dc5e9b821e95f268f2142f9e4 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 5 Mar 2024 16:46:14 +0100 Subject: [PATCH 318/382] update --- .../AssemblyBrowserWidget.cs | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs index 4a081b9d872..685eea30563 100644 --- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs +++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs @@ -69,9 +69,9 @@ enum SearchMemberState { [System.ComponentModel.ToolboxItem(true)] partial class AssemblyBrowserWidget : Gtk.Bin { - Gtk.ComboBox comboboxVisibilty; + Gtk.ComboBoxText comboboxVisibilty; MonoDevelop.Components.SearchEntry searchentry1; - Gtk.ComboBox languageCombobox; + Gtk.ComboBoxText languageCombobox; public AssemblyBrowserTreeView? TreeView { get; @@ -112,16 +112,16 @@ public AssemblyBrowserWidget () { this.Build (); - //comboboxVisibilty = ComboBox.NewText (); - //comboboxVisibilty.InsertText (0, GettextCatalog.GetString ("Only public members")); - //comboboxVisibilty.InsertText (1, GettextCatalog.GetString ("All members")); - //comboboxVisibilty.Active = Math.Min (1, Math.Max (0, PropertyService.Get ("AssemblyBrowser.MemberSelection", 0))); - //comboboxVisibilty.Changed += delegate { - // if (TreeView != null) - // TreeView.PublicApiOnly = comboboxVisibilty.Active == 0; - // PropertyService.Set ("AssemblyBrowser.MemberSelection", comboboxVisibilty.Active); - // GenerateOutput (); - //}; + comboboxVisibilty = new Gtk.ComboBoxText (); + comboboxVisibilty.InsertText (0, GettextCatalog.GetString ("Only public members")); + comboboxVisibilty.InsertText (1, GettextCatalog.GetString ("All members")); + comboboxVisibilty.Active = Math.Min (1, Math.Max (0, PropertyService.Get ("AssemblyBrowser.MemberSelection", 0))); + comboboxVisibilty.Changed += delegate { + if (TreeView != null) + TreeView.PublicApiOnly = comboboxVisibilty.Active == 0; + PropertyService.Set ("AssemblyBrowser.MemberSelection", comboboxVisibilty.Active); + GenerateOutput (); + }; searchentry1 = new MonoDevelop.Components.SearchEntry (); searchentry1.Ready = true; @@ -171,12 +171,12 @@ public AssemblyBrowserWidget () }; - //languageCombobox = Gtk.ComboBox.NewText (); - //languageCombobox.AppendText (GettextCatalog.GetString ("Summary")); - //languageCombobox.AppendText (GettextCatalog.GetString ("IL")); - //languageCombobox.AppendText (GettextCatalog.GetString ("C#")); - //languageCombobox.Active = Math.Min (2, Math.Max (0, PropertyService.Get ("AssemblyBrowser.Language", 0))); - //languageCombobox.Changed += LanguageComboboxhandleChanged; + languageCombobox = new Gtk.ComboBoxText (); + languageCombobox.AppendText (GettextCatalog.GetString ("Summary")); + languageCombobox.AppendText (GettextCatalog.GetString ("IL")); + languageCombobox.AppendText (GettextCatalog.GetString ("C#")); + languageCombobox.Active = Math.Min (2, Math.Max (0, PropertyService.Get ("AssemblyBrowser.Language", 0))); + languageCombobox.Changed += LanguageComboboxhandleChanged; #pragma warning disable 618 TreeView = new AssemblyBrowserTreeView (new NodeBuilder[] { new ErrorNodeBuilder (), From 359ded5731305973a4777e7c752b3d924a610b8c Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 5 Mar 2024 16:53:11 +0100 Subject: [PATCH 319/382] update --- .../ExceptionCaughtDialog.cs | 85 +++++++++++-------- 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs index 8fb062f94ca..7966d116a49 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs @@ -860,43 +860,56 @@ string GetFileMarkup (bool selected, string foregroundColor) return $"{markup}"; } -// public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) -// { -// using (var layout = new Pango.Layout (Context)) { -// Pango.Rectangle ink, logical; -// layout.FontDescription = font; -// layout.SetMarkup (GetMethodMarkup (false)); -// layout.GetPixelExtents (out ink, out logical); -// -// height = logical.Height; -// width = 0; -// x_offset = 0; -// y_offset = 0; -// } -// } + // public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + // { + // using (var layout = new Pango.Layout (Context)) { + // Pango.Rectangle ink, logical; + // layout.FontDescription = font; -// protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) -// { -// using (var cr = Gdk.CairoHelper.Create (window)) { -// Pango.Rectangle ink, logical; -// using (var layout = new Pango.Layout (Context)) { -// layout.FontDescription = font; -// layout.SetMarkup (GetFileMarkup ((flags & CellRendererState.Selected) != 0)); -// layout.GetPixelExtents (out ink, out logical); -// var width = widget.Allocation.Width; -// cr.Translate (width - logical.Width - 10, cell_area.Y); -// cr.ShowLayout (layout); -// -// cr.IdentityMatrix (); -// -// layout.SetMarkup (GetMethodMarkup ((flags & CellRendererState.Selected) != 0)); -// layout.Width = (int)((width - logical.Width - 35) * Pango.Scale.PangoScale); -// layout.Ellipsize = Pango.EllipsizeMode.Middle; -// cr.Translate (cell_area.X + 10, cell_area.Y); -// cr.ShowLayout (layout); -// } -// } -// } + // var selected = false; + // var foregroundColor = Styles.GetStackFrameForegroundHexColor (selected, IsUserCode); + + // layout.SetMarkup (GetMethodMarkup (selected, foregroundColor)); + // layout.GetPixelExtents (out ink, out logical); + + // height = logical.Height; + // width = 0; + // x_offset = 0; + // y_offset = 0; + // } + // } + + // protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) + // { + // using (var cr = Gdk.CairoHelper.Create (window)) { + + // cr.Rectangle (background_area.ToCairoRect ()); + + // Pango.Rectangle ink, logical; + // using (var layout = new Pango.Layout (Context)) { + // layout.FontDescription = font; + + // var selected = (flags & CellRendererState.Selected) != 0; + // var backgroundColor = selected ? Styles.ExceptionCaughtDialog.TreeSelectedBackgroundColor : Styles.ExceptionCaughtDialog.TreeBackgroundColor; + // cr.SetSourceColor (backgroundColor.ToCairoColor ()); + // cr.Fill (); + // var foregroundColor = Styles.GetStackFrameForegroundHexColor (selected, IsUserCode); + // layout.SetMarkup (GetFileMarkup (selected, foregroundColor)); + // layout.GetPixelExtents (out ink, out logical); + // var width = widget.Allocation.Width; + // cr.Translate (width - logical.Width - 10, cell_area.Y); + // cr.ShowLayout (layout); + + // cr.IdentityMatrix (); + + // layout.SetMarkup (GetMethodMarkup (selected, foregroundColor)); + // layout.Width = (int)((width - logical.Width - 35) * Pango.Scale.PangoScale); + // layout.Ellipsize = Pango.EllipsizeMode.Middle; + // cr.Translate (cell_area.X + 10, cell_area.Y); + // cr.ShowLayout (layout); + // } + // } + // } } class ExceptionCaughtMessage : IDisposable From 5efded67cc644127efefa8944af015c90ffdb9ed Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 5 Mar 2024 18:49:25 +0100 Subject: [PATCH 320/382] update --- .../GitService.cs | 22 ++++----- .../PushDialog.cs | 46 +++++++++---------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs index cf937330d36..c20e8b8447a 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs @@ -60,19 +60,19 @@ public static void Push (GitRepository repo) if (MessageService.RunCustomDialog (dlg) != (int) Gtk.ResponseType.Ok) return; - //string remote = dlg.SelectedRemote; - //string branch = dlg.SelectedRemoteBranch ?? repo.GetCurrentBranch (); + string remote = dlg.SelectedRemote; + string branch = dlg.SelectedRemoteBranch ?? repo.GetCurrentBranch (); ProgressMonitor monitor = VersionControlService.GetProgressMonitor (GettextCatalog.GetString ("Pushing changes..."), VersionControlOperationType.Push); - // Task.Run (async () => { - // try { - // await repo.PushAsync (monitor, remote, branch); - // } catch (Exception ex) { - // monitor.ReportError (ex.Message, ex); - // } finally { - // monitor.Dispose (); - // } - // }); + Task.Run (async () => { + try { + await repo.PushAsync (monitor, remote, branch); + } catch (Exception ex) { + monitor.ReportError (ex.Message, ex); + } finally { + monitor.Dispose (); + } + }); } finally { dlg.Destroy (); dlg.Dispose (); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/PushDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/PushDialog.cs index b84a81cfe86..e3319595dd0 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/PushDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/PushDialog.cs @@ -46,7 +46,7 @@ public PushDialog (GitRepository repo) this.UseNativeContextMenus (); - //changeList.DiffLoader = DiffLoader; + changeList.DiffLoader = DiffLoader; var token = destroyTokenSource.Token; Task.Run (async () => (await repo.GetRemotesAsync (token), await repo.GetCurrentRemoteAsync (token))).ContinueWith (t => { @@ -55,21 +55,21 @@ public PushDialog (GitRepository repo) var tuple = t.Result; var list = new List (tuple.Item1.Select (r => r.Name)); - //foreach (string s in list) - //remoteCombo.AppendText (s); + foreach (string s in list) + remoteCombo.AppendText (s); remoteCombo.Active = list.IndexOf (t.Result.Item2); }, token, TaskContinuationOptions.NotOnCanceled, Runtime.MainTaskScheduler).Ignore (); UpdateChangeSet (); } - //public string SelectedRemote { - //get { return remoteCombo.ActiveText; } - //} + public string SelectedRemote { + get { return remoteCombo.ActiveText; } + } - // public string SelectedRemoteBranch { - // get { return branchCombo.ActiveText; } - // } + public string SelectedRemoteBranch { + get { return branchCombo.ActiveText; } + } void UpdateRemoteBranches () { @@ -80,14 +80,14 @@ void UpdateRemoteBranches () } branchCombo.Sensitive = true; var token = destroyTokenSource.Token; - //repo.GetRemoteBranchesAsync (remoteCombo.ActiveText).ContinueWith (t => { - // if (token.IsCancellationRequested) - // return; - // var list = t.Result; - //foreach (string s in list) - // branchCombo.AppendText (s); - // branchCombo.Active = list.IndexOf (repo.GetCurrentBranch ()); - //}, token, TaskContinuationOptions.NotOnCanceled, Runtime.MainTaskScheduler).Ignore (); + repo.GetRemoteBranchesAsync (remoteCombo.ActiveText).ContinueWith (t => { + if (token.IsCancellationRequested) + return; + var list = t.Result; + foreach (string s in list) + branchCombo.AppendText (s); + branchCombo.Active = list.IndexOf (repo.GetCurrentBranch ()); + }, token, TaskContinuationOptions.NotOnCanceled, Runtime.MainTaskScheduler).Ignore (); } void UpdateChangeSet () @@ -96,14 +96,14 @@ void UpdateChangeSet () changeList.Clear (); return; } - //ChangeSet changeSet = repo.GetPushChangeSet (remoteCombo.ActiveText, branchCombo.ActiveText); - //changeList.Load (changeSet); + ChangeSet changeSet = repo.GetPushChangeSet (remoteCombo.ActiveText, branchCombo.ActiveText); + changeList.Load (changeSet); } - // DiffInfo[] DiffLoader (FilePath path) - // { - // return repo.GetPushDiff (remoteCombo.ActiveText, branchCombo.ActiveText); - // } + DiffInfo[] DiffLoader (FilePath path) + { + return repo.GetPushDiff (remoteCombo.ActiveText, branchCombo.ActiveText); + } protected virtual void OnRemoteComboChanged (object sender, System.EventArgs e) { From 1ac3e29fc406708d4a245326ae9429c2113d0662 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 5 Mar 2024 18:58:15 +0100 Subject: [PATCH 321/382] update --- .../LinuxSystemInformation.cs | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LinuxSystemInformation.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LinuxSystemInformation.cs index 0b4bc1bc441..616e3d42e55 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LinuxSystemInformation.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LinuxSystemInformation.cs @@ -35,38 +35,38 @@ class LinuxSystemInformation : UnixSystemInformation { internal override void AppendOperatingSystem (StringBuilder sb) { - // string OSName = "", OSVersion = ""; - // try { - // foreach (var line in File.ReadAllLines ("/etc/os-release")) { - // var parsedline = Parse (line); - // if (parsedline.Key.Equals ("NAME")) { - // OSName = parsedline.Value; - // } - // if (parsedline.Key.Equals ("VERSION")) { - // OSVersion = parsedline.Value; - // } - // } - // } catch { - // OSName = "Linux"; - // OSVersion = "Unknown"; - // } - // if (string.IsNullOrWhiteSpace (OSName) || string.IsNullOrWhiteSpace (OSVersion)) { - // OSName = "Linux"; - // OSVersion = "Unknown"; - // } - // sb.AppendLine ("\t" + OSName + " " + OSVersion); - sb.AppendLine ("\tLinux"); + string OSName = "", OSVersion = ""; + try { + foreach (var line in File.ReadAllLines ("/etc/os-release")) { + var parsedline = Parse (line); + if (parsedline.Key.Equals ("NAME")) { + OSName = parsedline.Value; + } + if (parsedline.Key.Equals ("VERSION")) { + OSVersion = parsedline.Value; + } + } + } catch { + OSName = "Linux"; + OSVersion = "Unknown"; + } + if (string.IsNullOrWhiteSpace (OSName) || string.IsNullOrWhiteSpace (OSVersion)) { + OSName = "Linux"; + OSVersion = "Unknown"; + } + sb.AppendLine ("\t" + OSName + " " + OSVersion); + //sb.AppendLine ("\tLinux"); base.AppendOperatingSystem (sb); } - // KeyValuePair Parse (string inputstring) - // { - // string [] parsed = inputstring.Split ('='); - // if (parsed.Length != 2) { - // return new KeyValuePair (); - // } - // return new KeyValuePair (parsed [0], parsed [1].Trim ('"')); - // } + KeyValuePair Parse (string inputstring) + { + string [] parsed = inputstring.Split ('='); + if (parsed.Length != 2) { + return new KeyValuePair (); + } + return new KeyValuePair (parsed [0], parsed [1].Trim ('"')); + } } } From 000b366e1d3771442d31517fd97eb0d36de9b4ca Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 5 Mar 2024 19:05:55 +0100 Subject: [PATCH 322/382] update --- ...evelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs index 0a9e69de397..052b356d22a 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs @@ -15,7 +15,7 @@ partial class BuildPanelWidget private global::Gtk.CheckButton skipBuildingUnmodifiedProjectsCheckbox; - private global::Gtk.ComboBox verbosityCombo; + private global::Gtk.ComboBoxText verbosityCombo; private global::Gtk.Label buildAndRunOptionsLabel; @@ -97,12 +97,12 @@ protected virtual void Build() label.LabelProp = global::Mono.Unix.Catalog.GetString("Log _verbosity:"); label.UseUnderline = true; logContainer.PackStart (label, false, false, 6); - //this.verbosityCombo = global::Gtk.ComboBox.NewText (); - //this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Quiet")); - //this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Minimal")); - //this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Normal")); - //this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Detailed")); - //this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Diagnostic")); + this.verbosityCombo = new global::Gtk.ComboBoxText(); + this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Quiet")); + this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Minimal")); + this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Normal")); + this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Detailed")); + this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Diagnostic")); this.verbosityCombo.Name = "verbosityCombo"; this.verbosityCombo.Active = 2; logContainer.PackStart (this.verbosityCombo, false, false, 6); From 7e1df1625e8f60866a95b1d18ed07fe744f6d1f9 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 6 Mar 2024 12:19:55 +0100 Subject: [PATCH 323/382] update --- .../MonoDevelop.Components.MainToolbar/MainToolbar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs index 2f7987a636b..1b1ac352d91 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs @@ -134,7 +134,7 @@ void RuntimeRenderCell (/*CellLayout layout,*/ CellRenderer cell, ITreeModel mod TreeIter lastSelection = TreeIter.Zero; public MainToolbar () { -// WidgetFlags |= Gtk.WidgetFlags.AppPaintable; + this.AppPaintable = true; AddWidget (button); AddSpace (8); From 78f3d639707a891ad20383d279ae978c90b96564 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 21 Mar 2024 20:27:54 +0100 Subject: [PATCH 324/382] update --- .../LogWidget.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs index 0dd4073b2a9..ca4de0705f3 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs @@ -61,7 +61,7 @@ public Revision[] History { TreeView treeviewFiles; TreeStore changedpathstore; DocumentToolButton revertButton, revertToButton, refreshButton; - Gtk.SearchEntry searchEntry; + MonoDevelop.Components.SearchEntry searchEntry; string currentFilter; VersionControlDocumentInfo info; @@ -158,13 +158,13 @@ public LogWidget (VersionControlDocumentInfo info) refreshButton = new DocumentToolButton (Gtk.Stock.Refresh, GettextCatalog.GetString ("Refresh")); refreshButton.Clicked += new EventHandler (RefreshClicked); - // searchEntry = new SearchEntry (); - // searchEntry.WidthRequest = 200; - // searchEntry.ForceFilterButtonVisible = true; - // searchEntry.EmptyMessage = GettextCatalog.GetString ("Search"); - // searchEntry.Changed += HandleSearchEntryFilterChanged; - // searchEntry.Ready = true; - // searchEntry.Show (); + searchEntry = new MonoDevelop.Components.SearchEntry (); + searchEntry.WidthRequest = 200; + searchEntry.ForceFilterButtonVisible = true; + searchEntry.EmptyMessage = GettextCatalog.GetString ("Search"); + searchEntry.Changed += HandleSearchEntryFilterChanged; + searchEntry.Ready = true; + searchEntry.Show (); messageRenderer.Ellipsize = Pango.EllipsizeMode.End; TreeViewColumn colRevMessage = new TreeViewColumn (); @@ -408,7 +408,7 @@ void HandleSearchEntryFilterChanged (object sender, EventArgs e) filtering = true; GLib.Timeout.Add (100, delegate { filtering = false; - //currentFilter = searchEntry.Entry.Text; + currentFilter = searchEntry.Entry.Text; SetLogSearchFilter (logstore, currentFilter); UpdateHistory (); return false; From d8141ede766260207f8deb6065e4e4f5fffadc88 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 21 Mar 2024 20:38:00 +0100 Subject: [PATCH 325/382] update --- .../LogWidget.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs index ca4de0705f3..27097c1b448 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs @@ -611,22 +611,20 @@ protected override void OnDestroyed () base.OnDestroyed (); } + bool IsDestroyed { get; set; } + static void DateFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { var renderer = (CellRendererText)cell; var revision = (Revision)model.GetValue (iter, 0); // Grab today's day and the start of tomorrow's day to make Today/Yesterday calculations. var now = DateTime.Now; - // var age = new DateTime (now.Year, now.Month, now.Day).AddDays(1) - rev.Time; - // if (age.Days >= 0 && age.Days < 1) { // Check whether it's a commit that's less than a day away. Also discard future commits. - // day = GettextCatalog.GetString ("Today"); - // } else if (age.Days < 2) { // Check whether it's a commit from yesterday. - // day = GettextCatalog.GetString ("Yesterday"); - // } else { - // day = rev.Time.ToShortDateString (); - // } - //renderer.Text = string.Format ("{0} {1:HH:mm}", day, rev.Time); - } + var age = new DateTime (now.Year, now.Month, now.Day).AddDays (1) - revision.Time; + + renderer.Text = age.Days >= 2 ? + revision.Time.ToShortDateString () : + revision.Time.Humanize (utcDate: false, dateToCompareAgainst: now); + } static void GraphFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) { From a885cb4bb6675ce6c59480a486d9401f49d06f63 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 21 Mar 2024 20:46:14 +0100 Subject: [PATCH 326/382] update --- .../MonoDevelop.VersionControl.Views/LogWidget.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs index 27097c1b448..8da3775d13f 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs @@ -583,7 +583,7 @@ await Runtime.RunInMainThread (delegate { protected override void OnDestroyed () { - //IsDestroyed = true; + IsDestroyed = true; selectionCancellationTokenSource.Cancel (); treeviewFiles.Selection.Changed -= SetDiff; @@ -775,8 +775,8 @@ void TreeSelectionChanged (object o, EventArgs args) selectionCancellationTokenSource = new CancellationTokenSource (); var token = selectionCancellationTokenSource.Token; Task.Run (async () => await info.Repository.GetRevisionChangesAsync (d, token)).ContinueWith (result => { - //if (IsDestroyed) - // return; + if (IsDestroyed) + return; changedpathstore.Clear (); revertButton.GetNativeWidget ().Sensitive = revertToButton.GetNativeWidget ().Sensitive = true; Gtk.TreeIter selectIter = Gtk.TreeIter.Zero; From 2898e50126d96bae610e116050f511c6c720eaf2 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 21 Mar 2024 21:17:04 +0100 Subject: [PATCH 327/382] update --- main/src/addins/AspNet/Commands/AddControllerDialog.cs | 6 +++--- main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/main/src/addins/AspNet/Commands/AddControllerDialog.cs b/main/src/addins/AspNet/Commands/AddControllerDialog.cs index 734777879df..e34a715d7dd 100644 --- a/main/src/addins/AspNet/Commands/AddControllerDialog.cs +++ b/main/src/addins/AspNet/Commands/AddControllerDialog.cs @@ -41,7 +41,7 @@ class AddControllerDialog : Dialog Button buttonCancel; Button buttonOk; Entry nameEntry; - ComboBox templateCombo; + ComboBoxText templateCombo; public string ControllerName { get { @@ -70,7 +70,7 @@ public AddControllerDialog (DotNetProject project) int templateIndex = 0; foreach (string file in loadedTemplateList) { string name = System.IO.Path.GetFileNameWithoutExtension (file); - //templateCombo.AppendText (name); + templateCombo.AppendText (name); if (!foundEmptyTemplate) { if (name == "Empty") { templateCombo.Active = templateIndex; @@ -101,7 +101,7 @@ void Build () AddActionWidget (buttonOk, ResponseType.Ok); nameEntry = new Entry (); - //templateCombo = ComboBox.NewText (); + templateCombo = new Gtk.ComboBoxText (); var nameLabel = new Label { TextWithMnemonic = GettextCatalog.GetString ("_Name:"), diff --git a/main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs b/main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs index 979b74d1413..cb9912e332b 100644 --- a/main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs +++ b/main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs @@ -38,10 +38,10 @@ class XspOptionsPanelWidget : VBox Entry ipAddress = new Entry { WidthChars = 39 }; // sized for IPv6 SpinButton portNumber = new SpinButton (0, Int16.MaxValue, 1) { WidthChars = 5} ; CheckButton verboseCheck = new CheckButton (); - //readonly ComboBox sslMode = ComboBox.NewText (); - //readonly ComboBox sslProtocol = ComboBox.NewText (); - //readonly ComboBox keyType = ComboBox.NewText (); - //readonly ComboBox passwordOptions = ComboBox.NewText (); + readonly ComboBoxText sslMode = new Gtk.ComboBoxText (); + readonly ComboBoxText sslProtocol = new Gtk.ComboBoxText (); + readonly ComboBoxText keyType = new Gtk.ComboBoxText (); + readonly ComboBoxText passwordOptions = new Gtk.ComboBoxText (); readonly FileEntry keyLocation = new FileEntry (); readonly FileEntry certLocation = new FileEntry (); readonly Entry passwordEntry = new Entry { InvisibleChar = '●' }; From 1a0fbdb146414433812d18f25a785c497f4bb95f Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 21 Mar 2024 22:19:13 +0100 Subject: [PATCH 328/382] update --- .../AspNet/Execution/XspOptionsPanelWidget.cs | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs b/main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs index cb9912e332b..33c46d9ba0d 100644 --- a/main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs +++ b/main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs @@ -53,43 +53,43 @@ public XspOptionsPanelWidget (AspNetAppProjectFlavor project) XspParameters xPar = project.XspParameters; //index should be equivalent to XspSslMode enum - //((ListStore) sslMode.Model).Clear (); - //sslMode.AppendText (GettextCatalog.GetString ("None")); - //sslMode.AppendText (GettextCatalog.GetString ("Enabled")); - //sslMode.AppendText (GettextCatalog.GetString ("Accept Client Certificates")); - //sslMode.AppendText (GettextCatalog.GetString ("Require Client Certificates")); + ((ListStore) sslMode.Model).Clear (); + sslMode.AppendText (GettextCatalog.GetString ("None")); + sslMode.AppendText (GettextCatalog.GetString ("Enabled")); + sslMode.AppendText (GettextCatalog.GetString ("Accept Client Certificates")); + sslMode.AppendText (GettextCatalog.GetString ("Require Client Certificates")); //index should be equivalent to XspSslProtocol enum - //((ListStore) sslProtocol.Model).Clear (); - //sslProtocol.AppendText (GettextCatalog.GetString ("Default")); + ((ListStore) sslProtocol.Model).Clear (); + sslProtocol.AppendText (GettextCatalog.GetString ("Default")); #pragma warning disable MD0005 - //sslProtocol.AppendText ("TLS"); - //sslProtocol.AppendText ("SSL 2"); - //sslProtocol.AppendText ("SSL 3"); + sslProtocol.AppendText ("TLS"); + sslProtocol.AppendText ("SSL 2"); + sslProtocol.AppendText ("SSL 3"); #pragma warning restore MD0005 - //((ListStore) keyType.Model).Clear (); - //keyType.AppendText (GettextCatalog.GetString ("None")); + ((ListStore) keyType.Model).Clear (); + keyType.AppendText (GettextCatalog.GetString ("None")); #pragma warning disable MD0005 - //keyType.AppendText ("Pkcs12"); - //keyType.AppendText ("PVK"); + keyType.AppendText ("Pkcs12"); + keyType.AppendText ("PVK"); #pragma warning restore MD0005 - //((ListStore) passwordOptions.Model).Clear (); - //passwordOptions.AppendText (GettextCatalog.GetString ("None")); - //passwordOptions.AppendText (GettextCatalog.GetString ("Ask")); - //passwordOptions.AppendText (GettextCatalog.GetString ("Store (insecure)")); + ((ListStore) passwordOptions.Model).Clear (); + passwordOptions.AppendText (GettextCatalog.GetString ("None")); + passwordOptions.AppendText (GettextCatalog.GetString ("Ask")); + passwordOptions.AppendText (GettextCatalog.GetString ("Store (insecure)")); //load all options ipAddress.Text = xPar.Address; portNumber.Value = xPar.Port; verboseCheck.Active = xPar.Verbose; - //sslMode.Active = (int) xPar.SslMode; - //sslProtocol.Active = (int) xPar.SslProtocol; - //keyType.Active = (int) xPar.KeyType; + sslMode.Active = (int) xPar.SslMode; + sslProtocol.Active = (int) xPar.SslProtocol; + keyType.Active = (int) xPar.KeyType; keyLocation.Path = xPar.PrivateKeyFile; certLocation.Path = xPar.CertificateFile; - //passwordOptions.Active = (int) xPar.PasswordOptions; + passwordOptions.Active = (int) xPar.PasswordOptions; passwordEntry.Text = xPar.PrivateKeyPassword; } From 880b574f648246c8345360f9a56e5e8487576881 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 21 Mar 2024 22:29:29 +0100 Subject: [PATCH 329/382] update --- .../addins/AspNet/Commands/AddViewDialog.cs | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/main/src/addins/AspNet/Commands/AddViewDialog.cs b/main/src/addins/AspNet/Commands/AddViewDialog.cs index 806b2008514..3b2bcab8ba3 100644 --- a/main/src/addins/AspNet/Commands/AddViewDialog.cs +++ b/main/src/addins/AspNet/Commands/AddViewDialog.cs @@ -57,8 +57,8 @@ class AddViewDialog : Dialog Button buttonCancel, buttonOk, masterButton; Label placeholderLabel; - ComboBox viewEngineCombo, templateCombo; - //ComboBoxEntry placeholderCombo, dataClassCombo; + ComboBoxText viewEngineCombo, templateCombo; + ComboBoxText placeholderCombo, dataClassCombo; Entry nameEntry; Entry masterEntry; CheckButton partialCheck, stronglyTypedCheck, masterCheck; @@ -76,7 +76,7 @@ public AddViewDialog (DotNetProject project) var viewEngines = GetProperViewEngines (); loadedTemplateList = new Dictionary> (); foreach (var engine in viewEngines) { - //viewEngineCombo.AppendText (engine); + viewEngineCombo.AppendText (engine); loadedTemplateList[engine] = aspFlavor.GetCodeTemplates ("AddView", engine); } @@ -88,7 +88,7 @@ public AddViewDialog (DotNetProject project) if (project.Files.GetFile (siteMaster) != null) masterEntry.Text = "~/Views/Shared/Site.master"; - //placeholderCombo.Model = primaryPlaceholderStore; + placeholderCombo.Model = primaryPlaceholderStore; UpdateTypePanelSensitivity (null, null); UpdateMasterPanelSensitivity (null, null); @@ -112,8 +112,8 @@ void Build () //var table = new Table (3, 2, false) { ColumnSpacing = 6, RowSpacing = 6 }; nameEntry = new Entry { WidthRequest = 350 }; - //viewEngineCombo = ComboBox.NewText (); - //templateCombo = ComboBox.NewText (); + viewEngineCombo = new Gtk.ComboBoxText (); + templateCombo = new Gtk.ComboBoxText (); var nameLabel = new Label (GettextCatalog.GetString ("_Name")) { MnemonicWidget = nameEntry, @@ -155,14 +155,14 @@ void Build () stronglyTypedCheck = new CheckButton (GettextCatalog.GetString ("_Strongly typed")) { UseUnderline = true }; masterCheck = new CheckButton (GettextCatalog.GetString ("Has _master page or layout")) { UseUnderline = true }; - //dataClassCombo = ComboBoxEntry.NewText (); + dataClassCombo = new Gtk.ComboBoxText (); masterEntry = new Entry { WidthRequest = 250 }; - //placeholderCombo = ComboBoxEntry.NewText (); + placeholderCombo = new Gtk.ComboBoxText (); masterButton = new Button ("..."); //optionsVBox.PackStart (partialCheck); //optionsVBox.PackStart (stronglyTypedCheck); - //typePanel = WithLabelAndLeftPadding (dataClassCombo, GettextCatalog.GetString ("_Data class:"), true, 24); + typePanel = WithLabelAndLeftPadding (dataClassCombo, GettextCatalog.GetString ("_Data class:"), true, 24); //optionsVBox.PackStart (typePanel); //optionsVBox.PackStart (masterCheck); @@ -173,18 +173,18 @@ void Build () UseUnderline = true }; - // placeholderLabel = new Label (GettextCatalog.GetString ("P_rimary placeholder:")) { - // MnemonicWidget = placeholderCombo, - // Xalign = 0, - // UseUnderline = true - // }; + placeholderLabel = new Label (GettextCatalog.GetString ("P_rimary placeholder:")) { + MnemonicWidget = placeholderCombo, + Xalign = 0, + UseUnderline = true + }; var masterTable = new Table (2, 3, false) { RowSpacing = 6, ColumnSpacing = 6 }; masterTable.Attach (masterLabel, 0, 1, 0, 1, fill, 0, 0, 0); masterTable.Attach (masterEntry, 1, 3, 0, 1, expandFill, 0, 0, 0); masterTable.Attach (placeholderLabel, 0, 1, 1, 2, expandFill, 0, 0, 0); - //masterTable.Attach (placeholderCombo, 1, 2, 1, 2, fill, 0, 0, 0); + masterTable.Attach (placeholderCombo, 1, 2, 1, 2, fill, 0, 0, 0); masterTable.Attach (masterButton, 2, 3, 1, 2, fill, 0, 0, 0); masterPanel = new Alignment (0.5f, 0.5f, 1f, 1f) { LeftPadding = 24, Child = masterTable }; @@ -199,11 +199,11 @@ void Build () nameEntry.Changed += Validate; partialCheck.Toggled += UpdateMasterPanelSensitivity; stronglyTypedCheck.Toggled += UpdateTypePanelSensitivity; - //dataClassCombo.Changed += DataClassChanged; + dataClassCombo.Changed += DataClassChanged; masterCheck.Toggled += UpdateMasterPanelSensitivity; masterEntry.Changed += MasterChanged; masterButton.Clicked += ShowMasterSelectionDialog; - //placeholderCombo.Changed += Validate; + placeholderCombo.Changed += Validate; } @@ -257,9 +257,9 @@ void InitializeTemplateStore (IDictionary> tempList) void UpdateTemplateList () { - // templateCombo.Model = templateStore[ActiveViewEngine]; - // oldEngine = ActiveViewEngine; - // templateCombo.Active = 0; + templateCombo.Model = templateStore[ActiveViewEngine]; + oldEngine = ActiveViewEngine; + templateCombo.Active = 0; } protected virtual void Validate (object sender, EventArgs e) @@ -277,7 +277,7 @@ protected void UpdateMasterPanelSensitivity (object sender, EventArgs e) bool canHaveMaster = !IsPartialView; masterCheck.Sensitive = canHaveMaster; masterPanel.Sensitive = canHaveMaster && HasMaster; - //placeholderLabel.Sensitive = placeholderCombo.Sensitive = masterPanel.Sensitive && ActiveViewEngine != "Razor"; + placeholderLabel.Sensitive = placeholderCombo.Sensitive = masterPanel.Sensitive && ActiveViewEngine != "Razor"; MasterChanged (null, null); Validate (); } @@ -408,17 +408,17 @@ protected virtual void DataClassChanged (object sender, EventArgs e) #region Public properties - // public Type ViewDataType { - // get { - // return dataClassCombo.Active >= 0 ? (Type)classDataProvider.TypesList[dataClassCombo.Active] : System.Type.GetType(dataClassCombo.ActiveText, false); - // } - // } - - // public string ViewDataTypeString { - // get { - // return dataClassCombo.ActiveText; - // } - // } + public Type ViewDataType { + get { + return dataClassCombo.Active >= 0 ? (Type)classDataProvider.TypesList[dataClassCombo.Active] : System.Type.GetType(dataClassCombo.ActiveText, false); + } + } + + public string ViewDataTypeString { + get { + return dataClassCombo.ActiveText; + } + } public string MasterFile { get { @@ -432,21 +432,21 @@ public bool HasMaster { } } - // public string PrimaryPlaceHolder { - // get { - // return placeholderCombo.ActiveText; - // } - // } + public string PrimaryPlaceHolder { + get { + return placeholderCombo.ActiveText; + } + } public List ContentPlaceHolders { get; private set; } - // public string TemplateFile { - // get { - // return loadedTemplateList[ActiveViewEngine][templateCombo.Active]; - // } - // } + public string TemplateFile { + get { + return loadedTemplateList[ActiveViewEngine][templateCombo.Active]; + } + } public string ViewName { get { @@ -465,9 +465,9 @@ public bool IsStronglyTyped { get { return stronglyTypedCheck.Active; } } - // public string ActiveViewEngine { - // get { return viewEngineCombo.ActiveText; } - // } + public string ActiveViewEngine { + get { return viewEngineCombo.ActiveText; } + } #endregion From 00551ffbbee92726e93b17f79c6e35320ff7e288 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 22 Mar 2024 10:20:00 +0100 Subject: [PATCH 330/382] update --- .../ToolboxWidget.cs | 229 +++++++++--------- 1 file changed, 115 insertions(+), 114 deletions(-) diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs index 7b520095f99..d53d767f841 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using Gtk; +using Cairo; using Pango; using Gdk; using MonoDevelop.Ide; @@ -205,122 +206,122 @@ static Cairo.Color Convert (Gdk.Color color) const int ItemIconTextItemSpacing = 4; const int IconModePadding = 2; - // protected override bool OnExposeEvent (Gdk.EventExpose e) - // { - // Cairo.Context cr = Gdk.CairoHelper.Create (e.Window); - - // Gdk.Rectangle area = e.Area; - - // if (this.categories.Count == 0 || !string.IsNullOrEmpty (CustomMessage)) { - // Pango.Layout messageLayout = new Pango.Layout (this.PangoContext); - // messageLayout.Alignment = Pango.Alignment.Center; - // messageLayout.Width = (int)(Allocation.Width * 2 / 3 * Pango.Scale.PangoScale); - // if (!string.IsNullOrEmpty (CustomMessage)) - // messageLayout.SetText (CustomMessage); - // else - // messageLayout.SetText (MonoDevelop.Core.GettextCatalog.GetString ("There are no tools available for the current document.")); - // cr.MoveTo (Allocation.Width * 1 / 6, 12); - // cr.SetSourceColor (Style.Text (StateType.Normal).ToCairoColor ()); - // Pango.CairoHelper.ShowLayout (cr, messageLayout); - // messageLayout.Dispose (); - // ((IDisposable)cr).Dispose (); - // return true; - // } + protected override bool OnDrawn (Cairo.Context e) + { + Cairo.Context cr = Gdk.CairoHelper.Create (GdkWindow); + + //Gdk.Rectangle area = e.Area; + + if (this.categories.Count == 0 || !string.IsNullOrEmpty (CustomMessage)) { + Pango.Layout messageLayout = new Pango.Layout (this.PangoContext); + messageLayout.Alignment = Pango.Alignment.Center; + messageLayout.Width = (int)(Allocation.Width * 2 / 3 * Pango.Scale.PangoScale); + if (!string.IsNullOrEmpty (CustomMessage)) + messageLayout.SetText (CustomMessage); + else + messageLayout.SetText (MonoDevelop.Core.GettextCatalog.GetString ("There are no tools available for the current document.")); + cr.MoveTo (Allocation.Width * 1 / 6, 12); + //cr.SetSourceColor (Style.Text (StateType.Normal).ToCairoColor ()); + Pango.CairoHelper.ShowLayout (cr, messageLayout); + messageLayout.Dispose (); + ((IDisposable)cr).Dispose (); + return true; + } - // var backColor = Style.Base (StateType.Normal).ToCairoColor (); - // cr.SetSourceColor (backColor); - // cr.Rectangle (area.X, area.Y, area.Width, area.Height); - // cr.Fill (); - - // int xpos = (this.hAdjustement != null ? (int)this.hAdjustement.Value : 0); - // int vadjustment = (this.vAdjustement != null ? (int)this.vAdjustement.Value : 0); - // int ypos = -vadjustment; - // ToolboxWidgetCategory lastCategory = null; - // int lastCategoryYpos = 0; - // cr.LineWidth = 1; - - // Iterate (ref xpos, ref ypos, (category, itemDimension) => { - // ProcessExpandAnimation (cr, lastCategory, lastCategoryYpos, backColor, area, ref ypos); - - // if (!area.IntersectsWith (new Gdk.Rectangle (new Gdk.Point (xpos, ypos), itemDimension))) - // return true; - // cr.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); - // cr.SetSourceColor (Ide.Gui.Styles.PadCategoryBackgroundColor.ToCairoColor ()); - // cr.Fill (); - - // if (lastCategory == null || lastCategory.IsExpanded || lastCategory.AnimatingExpand) { - // cr.MoveTo (xpos, ypos + 0.5); - // cr.LineTo (itemDimension.Width, ypos + 0.5); - // } - // cr.MoveTo (0, ypos + itemDimension.Height - 0.5); - // cr.LineTo (xpos + Allocation.Width, ypos + itemDimension.Height - 0.5); - // cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryBorderColor.ToCairoColor ()); - // cr.Stroke (); - - // headerLayout.SetMarkup (category.Text); - // int width, height; - // cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryLabelColor.ToCairoColor ()); - // headerLayout.GetPixelSize (out width, out height); - // cr.MoveTo (xpos + CategoryLeftPadding, ypos + (double)(Math.Round ((double)(itemDimension.Height - height) / 2))); - // Pango.CairoHelper.ShowLayout (cr, headerLayout); - - // var img = category.IsExpanded ? discloseUp : discloseDown; - // cr.DrawImage (this, img, Allocation.Width - img.Width - CategoryRightPadding, ypos + Math.Round ((itemDimension.Height - img.Height) / 2)); - - // lastCategory = category; - // lastCategoryYpos = ypos + itemDimension.Height; - - // return true; - // }, (curCategory, item, itemDimension) => { - // if (!area.IntersectsWith (new Gdk.Rectangle (new Gdk.Point (xpos, ypos), itemDimension))) - // return true; - - // var icon = item.Icon; - // if (!icon.HasFixedSize) { - // var maxIconSize = Math.Min (itemDimension.Width, itemDimension.Height); - // var fittingIconSize = maxIconSize > 32 ? Xwt.IconSize.Large : maxIconSize > 16 ? Xwt.IconSize.Medium : Xwt.IconSize.Small; - // icon = item.Icon.WithSize (fittingIconSize); - // } - // if (item == SelectedItem) { - // icon = icon.WithStyles ("sel"); - // cr.SetSourceColor (Style.Base (StateType.Selected).ToCairoColor ()); - // cr.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); - // cr.Fill (); - // } - // if (listMode || !curCategory.CanIconizeItems) { - // cr.DrawImage (this, icon, xpos + ItemLeftPadding, ypos + Math.Round ((itemDimension.Height - icon.Height) / 2)); - // layout.SetMarkup (item.Text); - // layout.Width = (int)((itemDimension.Width - ItemIconTextItemSpacing - iconSize.Width - ItemLeftPadding * 2) * Pango.Scale.PangoScale); - // layout.GetPixelSize (out var width, out var height); - // cr.SetSourceColor (Style.Text (item != SelectedItem ? StateType.Normal : StateType.Selected).ToCairoColor ()); - // cr.MoveTo (xpos + ItemLeftPadding + iconSize.Width + ItemIconTextItemSpacing, ypos + Math.Round ((double)(itemDimension.Height - height) / 2)); - // Pango.CairoHelper.ShowLayout (cr, layout); - // } else { - // cr.DrawImage (this, icon, xpos + Math.Round ((itemDimension.Width - icon.Width) / 2), ypos + Math.Round ((itemDimension.Height - icon.Height) / 2)); - // } - - // if (item == mouseOverItem) { - // cr.SetSourceColor (Style.Dark (StateType.Prelight).ToCairoColor ()); - // cr.Rectangle (xpos + 0.5, ypos + 0.5, itemDimension.Width - 1, itemDimension.Height - 1); - // cr.Stroke (); - // } - - // return true; - // }); - - // ProcessExpandAnimation (cr, lastCategory, lastCategoryYpos, backColor, area, ref ypos); - - // if (lastCategory != null && lastCategory.AnimatingExpand) { - // // Closing line when animating the last group of the toolbox - // cr.MoveTo (area.X, ypos + 0.5); - // cr.RelLineTo (area.Width, 0); - // cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryBorderColor.ToCairoColor ()); - // cr.Stroke (); - // } + //var backColor = Style.Base (StateType.Normal).ToCairoColor (); + //cr.SetSourceColor (backColor); + //cr.Rectangle (area.X, area.Y, area.Width, area.Height); + cr.Fill (); - // ((IDisposable)cr).Dispose (); - // return true; - // } + int xpos = (this.hAdjustement != null ? (int)this.hAdjustement.Value : 0); + int vadjustment = (this.vAdjustement != null ? (int)this.vAdjustement.Value : 0); + int ypos = -vadjustment; + ToolboxWidgetCategory lastCategory = null; + int lastCategoryYpos = 0; + cr.LineWidth = 1; + + Iterate (ref xpos, ref ypos, (category, itemDimension) => { + //ProcessExpandAnimation (cr, lastCategory, lastCategoryYpos, backColor, area, ref ypos); + + //if (!area.IntersectsWith (new Gdk.Rectangle (new Gdk.Point (xpos, ypos), itemDimension))) + // return true; + cr.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); + cr.SetSourceColor (Ide.Gui.Styles.PadCategoryBackgroundColor.ToCairoColor ()); + cr.Fill (); + + if (lastCategory == null || lastCategory.IsExpanded || lastCategory.AnimatingExpand) { + cr.MoveTo (xpos, ypos + 0.5); + cr.LineTo (itemDimension.Width, ypos + 0.5); + } + cr.MoveTo (0, ypos + itemDimension.Height - 0.5); + cr.LineTo (xpos + Allocation.Width, ypos + itemDimension.Height - 0.5); + cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryBorderColor.ToCairoColor ()); + cr.Stroke (); + + headerLayout.SetMarkup (category.Text); + int width, height; + cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryLabelColor.ToCairoColor ()); + headerLayout.GetPixelSize (out width, out height); + cr.MoveTo (xpos + CategoryLeftPadding, ypos + (double)(Math.Round ((double)(itemDimension.Height - height) / 2))); + Pango.CairoHelper.ShowLayout (cr, headerLayout); + + var img = category.IsExpanded ? discloseUp : discloseDown; + cr.DrawImage (this, img, Allocation.Width - img.Width - CategoryRightPadding, ypos + Math.Round ((itemDimension.Height - img.Height) / 2)); + + lastCategory = category; + lastCategoryYpos = ypos + itemDimension.Height; + + return true; + }, (curCategory, item, itemDimension) => { + //if (!area.IntersectsWith (new Gdk.Rectangle (new Gdk.Point (xpos, ypos), itemDimension))) + // return true; + + var icon = item.Icon; + if (!icon.HasFixedSize) { + var maxIconSize = Math.Min (itemDimension.Width, itemDimension.Height); + var fittingIconSize = maxIconSize > 32 ? Xwt.IconSize.Large : maxIconSize > 16 ? Xwt.IconSize.Medium : Xwt.IconSize.Small; + icon = item.Icon.WithSize (fittingIconSize); + } + if (item == SelectedItem) { + icon = icon.WithStyles ("sel"); + //cr.SetSourceColor (Style.Base (StateType.Selected).ToCairoColor ()); + cr.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height); + cr.Fill (); + } + if (listMode || !curCategory.CanIconizeItems) { + cr.DrawImage (this, icon, xpos + ItemLeftPadding, ypos + Math.Round ((itemDimension.Height - icon.Height) / 2)); + layout.SetMarkup (item.Text); + layout.Width = (int)((itemDimension.Width - ItemIconTextItemSpacing - iconSize.Width - ItemLeftPadding * 2) * Pango.Scale.PangoScale); + layout.GetPixelSize (out var width, out var height); + //cr.SetSourceColor (Style.Text (item != SelectedItem ? StateType.Normal : StateType.Selected).ToCairoColor ()); + cr.MoveTo (xpos + ItemLeftPadding + iconSize.Width + ItemIconTextItemSpacing, ypos + Math.Round ((double)(itemDimension.Height - height) / 2)); + Pango.CairoHelper.ShowLayout (cr, layout); + } else { + cr.DrawImage (this, icon, xpos + Math.Round ((itemDimension.Width - icon.Width) / 2), ypos + Math.Round ((itemDimension.Height - icon.Height) / 2)); + } + + if (item == mouseOverItem) { + //cr.SetSourceColor (Style.Dark (StateType.Prelight).ToCairoColor ()); + cr.Rectangle (xpos + 0.5, ypos + 0.5, itemDimension.Width - 1, itemDimension.Height - 1); + cr.Stroke (); + } + + return true; + }); + + //ProcessExpandAnimation (cr, lastCategory, lastCategoryYpos, backColor, area, ref ypos); + + if (lastCategory != null && lastCategory.AnimatingExpand) { + // Closing line when animating the last group of the toolbox + //cr.MoveTo (area.X, ypos + 0.5); + //cr.RelLineTo (area.Width, 0); + cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryBorderColor.ToCairoColor ()); + cr.Stroke (); + } + + ((IDisposable)cr).Dispose (); + return true; + } void ProcessExpandAnimation (Cairo.Context cr, ToolboxWidgetCategory lastCategory, int lastCategoryYpos, Cairo.Color backColor, Gdk.Rectangle area, ref int ypos) { From a7d01b505da73361717978f69fb75862ffff322f Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 22 Mar 2024 10:26:44 +0100 Subject: [PATCH 331/382] update --- .../MonoDevelop.DesignerSupport/DocumentOutlinePad.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs index d5b69f5603a..f38a93d46db 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs @@ -28,6 +28,7 @@ using System; using Gtk; +using Cairo; using MonoDevelop.Components.Docking; using MonoDevelop.Core; @@ -207,16 +208,16 @@ void UpdateLayout () layout.SetText (text); } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { + protected override bool OnDrawn (Cairo.Context evnt) + { // if (evnt.Window != GdkWindow || layout == null) { // return base.OnExposeEvent (evnt); // } // layout.Width = (int)(Allocation.Width * 2 / 3 * Pango.Scale.PangoScale); // Gtk.Style.PaintLayout (Style, GdkWindow, State, false, evnt.Area, // this, null, Allocation.Width * 1 / 6 + Allocation.X , 12 + Allocation.Y, layout); -// return true; -// } + return true; + } protected override void OnStyleSet (Gtk.Style previous_style) { From 1bd5aa35bb6bab40501a2872dc0acb2eed5f7350 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 22 Mar 2024 10:34:37 +0100 Subject: [PATCH 332/382] update --- ...tNetCoreProjectTemplateWizardPageWidget.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/GtkDotNetCoreProjectTemplateWizardPageWidget.cs b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/GtkDotNetCoreProjectTemplateWizardPageWidget.cs index fa46fbd3b92..6955f8a1658 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/GtkDotNetCoreProjectTemplateWizardPageWidget.cs +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Gui/GtkDotNetCoreProjectTemplateWizardPageWidget.cs @@ -50,11 +50,11 @@ partial class GtkDotNetCoreProjectTemplateWizardPageWidget : Gtk.Bin EventBox configurationTableEventBox; Table configurationTable; - ComboBox targetFrameworkComboBox; + ComboBoxText targetFrameworkComboBox; Label targetFrameworkInformationLabel; Label targetFrameworkLabel; - ComboBox authenticationComboBox; + ComboBoxText authenticationComboBox; Label authenticationInformationLabel; Label authenticationLabel; @@ -99,9 +99,9 @@ public GtkDotNetCoreProjectTemplateWizardPageWidget (DotNetCoreProjectTemplateWi void PopulateTargetFrameworks () { - // foreach (TargetFramework framework in wizardPage.TargetFrameworks) { - // targetFrameworkComboBox.AppendText (framework.GetDisplayName ()); - // } + foreach (TargetFramework framework in wizardPage.TargetFrameworks) { + targetFrameworkComboBox.AppendText (framework.GetDisplayName ()); + } targetFrameworkComboBox.Active = wizardPage.SelectedTargetFrameworkIndex; } @@ -113,9 +113,9 @@ void TargetFrameworkComboBoxChanged (object sender, EventArgs e) void PopulateAuthentications () { - // foreach (var authentication in wizardPage.SupportedAuthentications) { - // authenticationComboBox.AppendText (authentication.Description); - // } + foreach (var authentication in wizardPage.SupportedAuthentications) { + authenticationComboBox.AppendText (authentication.Description); + } authenticationComboBox.Active = wizardPage.SelectedAuthenticationIndex; authenticationInformationLabel.LabelProp = wizardPage.SupportedAuthentications [wizardPage.SelectedAuthenticationIndex].Information; @@ -204,7 +204,7 @@ protected virtual void Build () void AddFrameworkSelection() { - //targetFrameworkComboBox = ComboBox.NewText (); + targetFrameworkComboBox = new global::Gtk.ComboBoxText(); targetFrameworkComboBox.WidthRequest = 350; targetFrameworkComboBox.Name = "targetFrameworkComboBox"; configurationTable.Attach (targetFrameworkComboBox, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0); @@ -232,7 +232,7 @@ void AddFrameworkSelection() void AddAuthenticationSelection(uint primaryRow) { - //authenticationComboBox = ComboBox.NewText (); + authenticationComboBox = new global::Gtk.ComboBoxText(); authenticationComboBox.WidthRequest = 350; authenticationComboBox.Name = "authenticationComboBox"; configurationTable.Attach (authenticationComboBox, 1, 2, primaryRow, primaryRow + 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0); From 0d7b09473bc028e6194b477e31ce0e7b6379f639 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 22 Mar 2024 23:02:59 +0100 Subject: [PATCH 333/382] update --- .../BasicChart.cs | 261 +++++++++--------- 1 file changed, 131 insertions(+), 130 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs index 9c6aaec9097..5ec81843456 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs @@ -30,6 +30,7 @@ using System.Collections; using Gtk; using Gdk; +using Cairo; using MonoDevelop.Ide.Fonts; using MonoDevelop.Ide; @@ -450,144 +451,144 @@ double GetMinTickStep (AxisDimension ad) return (((double) minTickStep) * (GetEnd (ad) - GetStart (ad))) / (double) GetAreaSize (ad); } -// protected override bool OnExposeEvent (Gdk.EventExpose args) -// { -// Gdk.Window win = GdkWindow; -// int rwidth, rheight; -// -// Cairo.Context ctx = CairoHelper.Create (win); -// -// win.GetSize (out rwidth, out rheight); -// -// if (autoStartY || autoEndY) { -// double nstartY = double.MaxValue; -// double nendY = double.MinValue; -// GetValueRange (AxisDimension.Y, out nstartY, out nendY); -// -// if (!autoStartY) nstartY = startY; -// if (!autoEndY) nendY = endY; -// if (nendY < nstartY) nendY = nstartY; -// -// if (nstartY != startY || nendY != endY) { -// yrangeChanged = true; -// startY = nstartY; -// endY = nendY; -// } -// } -// -// if (autoStartX || autoEndX) { -// double nstartX = double.MaxValue; -// double nendX = double.MinValue; -// GetValueRange (AxisDimension.X, out nstartX, out nendX); -// -// if (!autoStartX) nstartX = startX; -// if (!autoEndX) nendX = endX; -// if (nendX < nstartX) nendX = nstartX; -// -// if (nstartX != startX || nendX != endX) { -// xrangeChanged = true; -// startX = nstartX; -// endX = nendX; -// } -// } -// -// if (yrangeChanged) { -// FixOrigins (); -// int right = rwidth - 2 - AreaBorderWidth; -// left = AreaBorderWidth; -// left += MeasureAxisSize (AxisPosition.Left) + 1; -// right -= MeasureAxisSize (AxisPosition.Right) + 1; -// yrangeChanged = false; -// width = right - left + 1; -// if (width <= 0) width = 1; -// } -// -// if (xrangeChanged) { -// FixOrigins (); -// int bottom = rheight - 2 - AreaBorderWidth; -// top = AreaBorderWidth; -// bottom -= MeasureAxisSize (AxisPosition.Bottom); -// top += MeasureAxisSize (AxisPosition.Top); -// -// // Make room for cursor handles -// foreach (ChartCursor cursor in cursors) { -// if (cursor.Dimension == AxisDimension.X && top - AreaBorderWidth < cursor.HandleSize) -// top = cursor.HandleSize + AreaBorderWidth; -// } -// -// xrangeChanged = false; -// height = bottom - top + 1; -// if (height <= 0) height = 1; -// } -// -// if (AutoScaleMargin != 0 && height > 0) { -// double margin = (double)AutoScaleMargin * (endY - startY) / (double) height; -// if (autoStartY) startY -= margin; -// if (autoEndY) endY += margin; -// } -// -//// Console.WriteLine ("L:" + left + " T:" + top + " W:" + width + " H:" + height); -// -// // Draw the background -// -// if (backgroundDisplay == BackgroundDisplay.Gradient) { -// ctx.Rectangle (left - 1, top - 1, width + 2, height + 2); -// -// // FIXME: VV: Remove gradient features -// using (var pat = new Cairo.LinearGradient (left - 1, top - 1, left - 1, height + 2)) { -// pat.AddColorStop (0, backroundColor); -// Cairo.Color endc = new Cairo.Color (1,1,1); -// pat.AddColorStop (1, endc); -// ctx.SetSource (pat); -// ctx.Fill (); -// } -// } else { -// ctx.Rectangle (left - 1, top - 1, width + 2, height + 2); -// ctx.SetSourceColor (backroundColor); -// ctx.Fill (); -// } -//// win.DrawRectangle (Style.WhiteGC, true, left - 1, top - 1, width + 2, height + 2); + protected override bool OnDrawn (Cairo.Context args) + { + Gdk.Window win = GdkWindow; + int rwidth, rheight; + + Cairo.Context ctx = Gdk.CairoHelper.Create (GdkWindow); + + //win.GetSize (out rwidth, out rheight); + + if (autoStartY || autoEndY) { + double nstartY = double.MaxValue; + double nendY = double.MinValue; + GetValueRange (AxisDimension.Y, out nstartY, out nendY); + + if (!autoStartY) nstartY = startY; + if (!autoEndY) nendY = endY; + if (nendY < nstartY) nendY = nstartY; + + if (nstartY != startY || nendY != endY) { + yrangeChanged = true; + startY = nstartY; + endY = nendY; + } + } + + if (autoStartX || autoEndX) { + double nstartX = double.MaxValue; + double nendX = double.MinValue; + GetValueRange (AxisDimension.X, out nstartX, out nendX); + + if (!autoStartX) nstartX = startX; + if (!autoEndX) nendX = endX; + if (nendX < nstartX) nendX = nstartX; + + if (nstartX != startX || nendX != endX) { + xrangeChanged = true; + startX = nstartX; + endX = nendX; + } + } + + if (yrangeChanged) { + FixOrigins (); + //int right = rwidth - 2 - AreaBorderWidth; + left = AreaBorderWidth; + left += MeasureAxisSize (AxisPosition.Left) + 1; + //right -= MeasureAxisSize (AxisPosition.Right) + 1; + yrangeChanged = false; + //width = right - left + 1; + if (width <= 0) width = 1; + } + + if (xrangeChanged) { + FixOrigins (); + //int bottom = rheight - 2 - AreaBorderWidth; + top = AreaBorderWidth; + //bottom -= MeasureAxisSize (AxisPosition.Bottom); + top += MeasureAxisSize (AxisPosition.Top); + + // Make room for cursor handles + foreach (ChartCursor cursor in cursors) { + if (cursor.Dimension == AxisDimension.X && top - AreaBorderWidth < cursor.HandleSize) + top = cursor.HandleSize + AreaBorderWidth; + } + + xrangeChanged = false; + //height = bottom - top + 1; + if (height <= 0) height = 1; + } + + if (AutoScaleMargin != 0 && height > 0) { + double margin = (double)AutoScaleMargin * (endY - startY) / (double) height; + if (autoStartY) startY -= margin; + if (autoEndY) endY += margin; + } + +// Console.WriteLine ("L:" + left + " T:" + top + " W:" + width + " H:" + height); + + // Draw the background + + if (backgroundDisplay == BackgroundDisplay.Gradient) { + ctx.Rectangle (left - 1, top - 1, width + 2, height + 2); + + // FIXME: VV: Remove gradient features + using (var pat = new Cairo.LinearGradient (left - 1, top - 1, left - 1, height + 2)) { + pat.AddColorStop (0, backroundColor); + Cairo.Color endc = new Cairo.Color (1,1,1); + pat.AddColorStop (1, endc); + ctx.SetSource (pat); + ctx.Fill (); + } + } else { + ctx.Rectangle (left - 1, top - 1, width + 2, height + 2); + ctx.SetSourceColor (backroundColor); + ctx.Fill (); + } +// win.DrawRectangle (Style.WhiteGC, true, left - 1, top - 1, width + 2, height + 2); // win.DrawRectangle (Style.BlackGC, false, left - AreaBorderWidth, top - AreaBorderWidth, width + AreaBorderWidth*2, height + AreaBorderWidth*2); -// -// // Draw selected area -// -// if (enableSelection) { -// int sx, sy, ex, ey; -// GetPoint (selectionStart.Value, selectionStart.Value, out sx, out sy); -// GetPoint (selectionEnd.Value, selectionEnd.Value, out ex, out ey); -// if (sx > ex) { -// int tmp = sx; sx = ex; ex = tmp; -// } + + // Draw selected area + + if (enableSelection) { + int sx, sy, ex, ey; + GetPoint (selectionStart.Value, selectionStart.Value, out sx, out sy); + GetPoint (selectionEnd.Value, selectionEnd.Value, out ex, out ey); + if (sx > ex) { + int tmp = sx; sx = ex; ex = tmp; + } // using (Gdk.GC sgc = new Gdk.GC (GdkWindow)) { // sgc.RgbFgColor = new Color (225, 225, 225); // win.DrawRectangle (sgc, true, sx, top, ex - sx, height + 1); // } -// } -// -// // Draw axes -// + } + + // Draw axes + // Gdk.GC gc = Style.BlackGC; -// + // foreach (Axis ax in axis) // DrawAxis (win, gc, ax); -// -// // Draw values -// foreach (Serie serie in series) -// if (serie.Visible) -// DrawSerie (ctx, serie); -// -// // Draw cursors -// foreach (ChartCursor cursor in cursors) -// DrawCursor (cursor); -// -// // Draw cursor labels -// foreach (ChartCursor cursor in cursors) -// if (cursor.ShowValueLabel) -// DrawCursorLabel (cursor); -// -// ((IDisposable)ctx).Dispose (); -// return true; -// } + + // Draw values + foreach (Serie serie in series) + if (serie.Visible) + DrawSerie (ctx, serie); + + // Draw cursors + foreach (ChartCursor cursor in cursors) + DrawCursor (cursor); + + // Draw cursor labels + foreach (ChartCursor cursor in cursors) + if (cursor.ShowValueLabel) + DrawCursorLabel (cursor); + + ((IDisposable)ctx).Dispose (); + return true; + } void GetValueRange (AxisDimension ad, out double min, out double max) { From fbe6a660fb1264ffe7d0ca4a134c657aab7bf8b5 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 23 Mar 2024 10:33:53 +0100 Subject: [PATCH 334/382] update --- .../MonoDevelop.Ide/MonoDevelop.Components/ImageButton.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageButton.cs index 43073a8409a..da673ef208c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageButton.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageButton.cs @@ -102,10 +102,9 @@ void LoadImage () protected override bool OnDrawn (Cairo.Context evnt) { - //if (HasFocus && image != null) { - // Gtk.Style.PaintFocus (Style, GdkWindow, State, Allocation, this, "button", - // Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); - //} + if (HasFocus && image != null) { + StyleContext.RenderFocus (evnt, Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height); + } return base.OnDrawn (evnt); } From ff193a19e0ca465ab6c89eef0ee916ba5c8bcd49 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 23 Mar 2024 10:44:42 +0100 Subject: [PATCH 335/382] update --- main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs index 12a8d194edb..265af3373bf 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs @@ -490,7 +490,7 @@ protected override bool OnDrawn (Cairo.Context evnt) int focusY = topPadding - buttonPadding; int focusHeight = Allocation.Height - topPadding - bottomPadding + buttonPadding * 2; - //Gtk.Style.PaintFocus (Style, GdkWindow, State, Allocation, this, "label", focusRect.X, focusY, focusRect.Width, focusHeight); + StyleContext.RenderFocus (evnt, focusRect.X, focusY, focusRect.Width, focusHeight); } } return true; From 7c32c03fdd6b86cc21338f2fd8f8f164f17a5a4c Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 25 Mar 2024 20:13:29 +0100 Subject: [PATCH 336/382] update --- .../CommandMenuBar.cs | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs index d69476fa79b..75e0185a8e2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs @@ -27,6 +27,7 @@ // using Gtk; +using Cairo; namespace MonoDevelop.Components.Commands { @@ -43,16 +44,17 @@ internal CommandManager CommandManager { get { return manager; } } -// protected override bool OnExposeEvent (Gdk.EventExpose evnt) -// { -// using (var context = Gdk.CairoHelper.Create (evnt.Window)) { + protected override bool OnDrawn (Cairo.Context evnt) + { +// using (var context = Gdk.CairoHelper.Create (GdkWindow)) { // context.SetSourceColor (Style.Light (StateType.Normal).ToCairoColor ()); -// context.Paint (); + evnt.Paint (); // } -// -// foreach (Gtk.Widget child in Children) -// (this as Gtk.Container).PropagateExpose (child, evnt); -// return false; -// } + + foreach (Gtk.Widget child in Children) + child.Draw (evnt); + + return false; + } } } From 4032cabe807e8e4374540cba418e0411353a2eeb Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 25 Mar 2024 22:23:34 +0100 Subject: [PATCH 337/382] update --- .../MonoDevelop.Components.Commands/CommandMenuBar.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs index 75e0185a8e2..31b88512155 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs @@ -44,15 +44,15 @@ internal CommandManager CommandManager { get { return manager; } } - protected override bool OnDrawn (Cairo.Context evnt) + protected override bool OnDrawn (Cairo.Context cr) { // using (var context = Gdk.CairoHelper.Create (GdkWindow)) { // context.SetSourceColor (Style.Light (StateType.Normal).ToCairoColor ()); - evnt.Paint (); + cr.Paint (); // } foreach (Gtk.Widget child in Children) - child.Draw (evnt); + (this as Gtk.Container).PropagateDraw (child, cr); return false; } From 427c29e47e2c7bd06c3721a6b9f4452e2460f136 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 26 Mar 2024 20:08:21 +0100 Subject: [PATCH 338/382] update --- .../BlameWidget.cs | 269 +++++++++--------- 1 file changed, 135 insertions(+), 134 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs index 5815f5ee88e..0d10525ee59 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs @@ -28,6 +28,7 @@ using System.Linq; using Gtk; using Gdk; +using Cairo; using System.Collections.Generic; using Mono.TextEditor; using MonoDevelop.Ide; @@ -257,7 +258,7 @@ protected override void OnDestroyed () overview.Destroy (); } - protected override void OnSizeAllocated (Rectangle allocation) + protected override void OnSizeAllocated (Gdk.Rectangle allocation) { base.OnSizeAllocated (allocation); //int vwidth = vScrollBar.Visible ? vScrollBar.Requisition.Width : 0; @@ -562,7 +563,7 @@ protected void OnUpdateShowPreviousBlame (CommandInfo cinfo) cinfo.Enabled = history.Count > 0; } - protected override void OnSizeAllocated (Rectangle allocation) + protected override void OnSizeAllocated (Gdk.Rectangle allocation) { base.OnSizeAllocated (allocation); UpdateAccessiblity (); @@ -700,138 +701,138 @@ void UpdateWidth () const int margin = 4; -// protected override bool OnExposeEvent (Gdk.EventExpose e) -// { -// using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { -// cr.LineWidth = Math.Max (1.0, widget.Editor.Options.Zoom); - -// cr.Rectangle (leftSpacer, 0, Allocation.Width, Allocation.Height); -// cr.SetSourceColor (Styles.BlameView.AnnotationBackgroundColor.ToCairoColor ()); -// cr.Fill (); - -// int startLine = widget.Editor.YToLine ((int)widget.Editor.VAdjustment.Value); -// double startY = widget.Editor.LineToY (startLine); -// while (startLine > 1 && startLine < annotations.Count && annotations[startLine - 1] != null && annotations[startLine] != null && annotations[startLine - 1].Revision == annotations[startLine].Revision) { -// startLine--; -// startY -= widget.Editor.GetLineHeight (widget.Editor.Document.GetLine (startLine)); -// } -// double curY = startY - widget.Editor.VAdjustment.Value; -// int line = startLine; -// while (curY < Allocation.Bottom && line <= widget.Editor.LineCount) { -// double curStart = curY; -// // widget.JumpOverFoldings (ref line); -// int lineStart = line; -// int authorWidth = 0, revisionWidth = 0, dateWidth = 0, h = 16; -// Annotation ann = line <= annotations.Count ? annotations[line - 1] : null; -// if (ann != null) { -// do { -// widget.JumpOverFoldings (ref line); -// line++; -// } while (line <= annotations.Count && annotations[line - 1] != null && annotations[line - 1].Revision == ann.Revision); - -// double nextY = widget.editor.LineToY (line) - widget.editor.VAdjustment.Value; -// if (highlightAnnotation != null && highlightAnnotation.Revision == ann.Revision && curStart <= highlightPositon && highlightPositon < nextY) { -// cr.Rectangle (leftSpacer, curStart + cr.LineWidth, Allocation.Width - leftSpacer, nextY - curStart - cr.LineWidth); -// cr.SetSourceColor (Styles.BlameView.AnnotationHighlightColor.ToCairoColor ()); -// cr.Fill (); -// } - -// // use a fixed size revision to get a approx. revision width -// layout.SetText ("88888888"); -// layout.GetPixelSize (out revisionWidth, out h); -// layout.SetText (TruncRevision (ann.Text)); - -// const int dateRevisionSpacing = 16; - -// using (var gc = new Gdk.GC (e.Window)) { -// gc.RgbFgColor = Styles.BlameView.AnnotationTextColor.ToGdkColor (); -// e.Window.DrawLayout (gc, Allocation.Width - revisionWidth - margin, (int)(curY + (widget.Editor.LineHeight - h) / 2), layout); - -// if (ann.HasDate) { -// string dateTime = ann.Date.ToShortDateString (); -// // use a fixed size date to get a approx. date width -// layout.SetText (new DateTime (1999, 10, 10).ToShortDateString ()); -// layout.GetPixelSize (out dateWidth, out h); -// layout.SetText (dateTime); - -// e.Window.DrawLayout (gc, Allocation.Width - revisionWidth - margin - revisionWidth - dateRevisionSpacing, (int)(curY + (widget.Editor.LineHeight - h) / 2), layout); -// } -// } - -// using (var authorLayout = MonoDevelop.Components.PangoUtil.CreateLayout (this)) { -// authorLayout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); -// authorLayout.SetText (ann.Author); -// authorLayout.GetPixelSize (out authorWidth, out h); - -// var maxWidth = Allocation.Width - revisionWidth - margin - revisionWidth - dateRevisionSpacing; -// /* if (authorWidth > maxWidth) { -// int idx = ann.Author.IndexOf ('<'); -// if (idx > 0) -// authorLayout.SetText (ann.Author.Substring (0, idx) + Environment.NewLine + ann.Author.Substring (idx)); -// authorLayout.GetPixelSize (out authorWidth, out h); -// }*/ - -// cr.Save (); -// cr.Rectangle (0, 0, maxWidth, Allocation.Height); -// cr.Clip (); -// cr.Translate (leftSpacer + margin, (int)(curY + (widget.Editor.LineHeight - h) / 2)); -// cr.SetSourceColor (Styles.BlameView.AnnotationTextColor.ToCairoColor ()); -// cr.ShowLayout (authorLayout); -// cr.ResetClip (); -// cr.Restore (); -// } - -// curY = nextY; -// } else { -// curY += widget.Editor.GetLineHeight (line); -// line++; -// widget.JumpOverFoldings (ref line); -// } - -// if (ann != null && line - lineStart > 1) { -// string msg = GetCommitMessage (lineStart, false); -// if (!string.IsNullOrEmpty (msg)) { -// msg = RevisionHelpers.FormatMessage (msg); - -// layout.SetText (msg); -// layout.Width = (int)(Allocation.Width * Pango.Scale.PangoScale); -// using (var gc = new Gdk.GC (e.Window)) { -// gc.RgbFgColor = Styles.BlameView.AnnotationSummaryTextColor.ToGdkColor (); -// gc.ClipRectangle = new Rectangle (0, (int)curStart, Allocation.Width, (int)(curY - curStart)); -// e.Window.DrawLayout (gc, (int)(leftSpacer + margin), (int)(curStart + h), layout); -// } -// } -// } - -// cr.Rectangle (0, curStart, leftSpacer, curY - curStart); - -// if (ann != null && !string.IsNullOrEmpty (ann.Author)) { -// double a; - -// if (ann != null && (maxDate - minDate).TotalHours > 0) { -// a = 1 - (ann.Date - minDate).TotalHours / (maxDate - minDate).TotalHours; -// } else { -// a = 1; -// } -// var color = Styles.BlameView.AnnotationMarkColor; -// color.Light = 0.4 + a / 2; -// color.Saturation = 1 - a / 2; -// cr.SetSourceColor (color.ToCairoColor ()); -// } else { -// cr.SetSourceColor ((ann != null ? Styles.BlameView.AnnotationMarkModifiedColor : Styles.BlameView.AnnotationBackgroundColor).ToCairoColor ()); -// } -// cr.Fill (); - -// if (ann != null) { -// cr.MoveTo (0, curY + 0.5); -// cr.LineTo (Allocation.Width, curY + 0.5); -// cr.SetSourceColor (Styles.BlameView.AnnotationSplitterColor.ToCairoColor ()); -// cr.Stroke (); -// } -// } -// } -// return true; -// } + protected override bool OnDrawn (Cairo.Context cr) + { + //using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { + cr.LineWidth = Math.Max (1.0, widget.Editor.Options.Zoom); + + cr.Rectangle (leftSpacer, 0, Allocation.Width, Allocation.Height); + //cr.SetSourceColor (Styles.BlameView.AnnotationBackgroundColor.ToCairoColor ()); + cr.Fill (); + + int startLine = widget.Editor.YToLine ((int)widget.Editor.VAdjustment.Value); + double startY = widget.Editor.LineToY (startLine); + while (startLine > 1 && startLine < annotations.Count && annotations[startLine - 1] != null && annotations[startLine] != null && annotations[startLine - 1].Revision == annotations[startLine].Revision) { + startLine--; + startY -= widget.Editor.GetLineHeight (widget.Editor.Document.GetLine (startLine)); + } + double curY = startY - widget.Editor.VAdjustment.Value; + int line = startLine; + while (curY < Allocation.Bottom && line <= widget.Editor.LineCount) { + double curStart = curY; +// widget.JumpOverFoldings (ref line); + int lineStart = line; + int authorWidth = 0, revisionWidth = 0, dateWidth = 0, h = 16; + Annotation ann = line <= annotations.Count ? annotations[line - 1] : null; + if (ann != null) { + do { + widget.JumpOverFoldings (ref line); + line++; + } while (line <= annotations.Count && annotations[line - 1] != null && annotations[line - 1].Revision == ann.Revision); + + double nextY = widget.editor.LineToY (line) - widget.editor.VAdjustment.Value; + if (highlightAnnotation != null && highlightAnnotation.Revision == ann.Revision && curStart <= highlightPositon && highlightPositon < nextY) { + cr.Rectangle (leftSpacer, curStart + cr.LineWidth, Allocation.Width - leftSpacer, nextY - curStart - cr.LineWidth); + cr.SetSourceColor (Styles.BlameView.AnnotationHighlightColor.ToCairoColor ()); + cr.Fill (); + } + + // use a fixed size revision to get a approx. revision width + layout.SetText ("88888888"); + layout.GetPixelSize (out revisionWidth, out h); + layout.SetText (TruncRevision (ann.Text)); + + const int dateRevisionSpacing = 16; + + // using (var gc = new Gdk.GC (e.Window)) { + // gc.RgbFgColor = Styles.BlameView.AnnotationTextColor.ToGdkColor (); + // e.Window.DrawLayout (gc, Allocation.Width - revisionWidth - margin, (int)(curY + (widget.Editor.LineHeight - h) / 2), layout); + + // if (ann.HasDate) { + // string dateTime = ann.Date.ToShortDateString (); + // // use a fixed size date to get a approx. date width + // layout.SetText (new DateTime (1999, 10, 10).ToShortDateString ()); + // layout.GetPixelSize (out dateWidth, out h); + // layout.SetText (dateTime); + + // e.Window.DrawLayout (gc, Allocation.Width - revisionWidth - margin - revisionWidth - dateRevisionSpacing, (int)(curY + (widget.Editor.LineHeight - h) / 2), layout); + // } + // } + + using (var authorLayout = MonoDevelop.Components.PangoUtil.CreateLayout (this)) { + authorLayout.FontDescription = IdeServices.FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11); + authorLayout.SetText (ann.Author); + authorLayout.GetPixelSize (out authorWidth, out h); + + var maxWidth = Allocation.Width - revisionWidth - margin - revisionWidth - dateRevisionSpacing; + /* if (authorWidth > maxWidth) { + int idx = ann.Author.IndexOf ('<'); + if (idx > 0) + authorLayout.SetText (ann.Author.Substring (0, idx) + Environment.NewLine + ann.Author.Substring (idx)); + authorLayout.GetPixelSize (out authorWidth, out h); + }*/ + + cr.Save (); + cr.Rectangle (0, 0, maxWidth, Allocation.Height); + cr.Clip (); + cr.Translate (leftSpacer + margin, (int)(curY + (widget.Editor.LineHeight - h) / 2)); + cr.SetSourceColor (Styles.BlameView.AnnotationTextColor.ToCairoColor ()); + cr.ShowLayout (authorLayout); + cr.ResetClip (); + cr.Restore (); + } + + curY = nextY; + } else { + curY += widget.Editor.GetLineHeight (line); + line++; + widget.JumpOverFoldings (ref line); + } + + if (ann != null && line - lineStart > 1) { + string msg = GetCommitMessage (lineStart, false); + if (!string.IsNullOrEmpty (msg)) { + msg = RevisionHelpers.FormatMessage (msg); + + layout.SetText (msg); + layout.Width = (int)(Allocation.Width * Pango.Scale.PangoScale); + // using (var gc = new Gdk.GC (e.Window)) { + // gc.RgbFgColor = Styles.BlameView.AnnotationSummaryTextColor.ToGdkColor (); + // gc.ClipRectangle = new Rectangle (0, (int)curStart, Allocation.Width, (int)(curY - curStart)); + // e.Window.DrawLayout (gc, (int)(leftSpacer + margin), (int)(curStart + h), layout); + // } + } + } + + cr.Rectangle (0, curStart, leftSpacer, curY - curStart); + + if (ann != null && !string.IsNullOrEmpty (ann.Author)) { + double a; + + if (ann != null && (maxDate - minDate).TotalHours > 0) { + a = 1 - (ann.Date - minDate).TotalHours / (maxDate - minDate).TotalHours; + } else { + a = 1; + } + var color = Styles.BlameView.AnnotationMarkColor; + color.Light = 0.4 + a / 2; + color.Saturation = 1 - a / 2; + cr.SetSourceColor (color.ToCairoColor ()); + } else { + cr.SetSourceColor ((ann != null ? Styles.BlameView.AnnotationMarkModifiedColor : Styles.BlameView.AnnotationBackgroundColor).ToCairoColor ()); + } + cr.Fill (); + + if (ann != null) { + cr.MoveTo (0, curY + 0.5); + cr.LineTo (Allocation.Width, curY + 0.5); + cr.SetSourceColor (Styles.BlameView.AnnotationSplitterColor.ToCairoColor ()); + cr.Stroke (); + } + } + //} + return true; + } void UpdateAccessiblity () { From 07626b6364aefc196372f530ec8b2627d441bc11 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 27 Mar 2024 00:21:17 +0100 Subject: [PATCH 339/382] update --- .../core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs index 0dfa3bf5fcc..9261df9182c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs @@ -377,7 +377,7 @@ protected override bool OnDrawn (Cairo.Context evnt) } } - //PropagateExpose (sections[activeIndex].Child, evnt); + PropagateDraw (sections[activeIndex].Child, evnt); return true;// base.OnExposeEvent (evnt); } From 1d5d18de915f98dfbe14d56bda2ae157cd09f441 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 27 Mar 2024 00:34:36 +0100 Subject: [PATCH 340/382] update --- .../MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs index b3711807e8f..8c0f5f6f7b4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs @@ -82,9 +82,8 @@ protected override bool OnDrawn (Cairo.Context evnt) int winWidth, winHeight; this.GetSize (out winWidth, out winHeight); //Gtk.Style.PaintFlatBox (Style, this.GdkWindow, StateType.Normal, ShadowType.Out, evnt.Area, this, "tooltip", 0, 0, winWidth, winHeight); - //foreach (var child in this.Children) - // this.PropagateExpose (child, evnt); - //Child.Draw (evnt); + foreach (var child in this.Children) + this.PropagateDraw (child, evnt); return false; } From 5e2323d5182b2e33fd49a835e1329a7a8ecce7f4 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 27 Mar 2024 00:50:50 +0100 Subject: [PATCH 341/382] update --- .../MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs index 4ca1662a2af..ca02a146c10 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs @@ -162,8 +162,8 @@ protected override bool OnDrawn (Cairo.Context evnt) using (Context cr = Gdk.CairoHelper.Create (GdkWindow)) { //DrawFrame (cr, evnt.Area); - //if (child != null) - // PropagateExpose (child, evnt); + if (child != null) + PropagateDraw (child, evnt); return false; } } From d69cdc3ef01220e34b6c9eed034e7dd7eb620051 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 27 Mar 2024 21:15:37 +0100 Subject: [PATCH 342/382] update --- .../EditorCompareWidgetBase.MiddleArea.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.MiddleArea.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.MiddleArea.cs index 826391b6c72..9e1ea521a55 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.MiddleArea.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.MiddleArea.cs @@ -29,6 +29,7 @@ using System.Linq; using Gtk; using Gdk; +using Cairo; using System.Collections.Generic; using Mono.TextEditor; using Mono.TextEditor.Utils; @@ -170,9 +171,9 @@ void PerformRevert (Hunk hunk) } } - ButtonAccessible GetNearestButton (Rectangle selectedBounds) + ButtonAccessible GetNearestButton (Gdk.Rectangle selectedBounds) { - static int GetDelta (Rectangle rect1, Rectangle rect2) + static int GetDelta (Gdk.Rectangle rect1, Gdk.Rectangle rect2) { int d1 = Math.Abs (rect1.Top - rect2.Bottom); int d2 = Math.Abs (rect1.Bottom - rect2.Top); @@ -253,8 +254,8 @@ static void DrawCross (Cairo.Context cr, double x, double y) cr.LineTo (x - 2, y + 3); } - // protected override bool OnExposeEvent (EventExpose evnt) - // { + protected override bool OnDrawn (Cairo.Context evnt) + { // bool hideButton = widget.MainEditor.Document.IsReadOnly; // using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) { // cr.Rectangle (evnt.Region.Clipbox.X, evnt.Region.Clipbox.Y, evnt.Region.Clipbox.Width, evnt.Region.Clipbox.Height); @@ -365,8 +366,8 @@ static void DrawCross (Cairo.Context cr, double x, double y) // } // } // } - // return true; - // } + return true; + } internal void Refresh () { @@ -470,7 +471,7 @@ class ButtonAccessible : IDisposable public AccessibilityElementProxy Accessible { get; private set; } public bool Visible { get; internal set; } - public Rectangle Bounds { get; private set; } + public Gdk.Rectangle Bounds { get; private set; } public ButtonAccessible (MiddleArea widget, Hunk hunk) { @@ -494,11 +495,11 @@ public ButtonAccessible (MiddleArea widget, Hunk hunk) public void SetBounds (int x, int y, int w, int h) { - Accessible.FrameInGtkParent = Bounds = new Rectangle (x, y, w, h); + Accessible.FrameInGtkParent = Bounds = new Gdk.Rectangle (x, y, w, h); var cocoaY = widget.Allocation.Height - y - h; - Accessible.FrameInParent = new Rectangle (x, cocoaY, w, h); + Accessible.FrameInParent = new Gdk.Rectangle (x, cocoaY, w, h); } void PerformPress (object sender, EventArgs e) From 374f10f0ff15daf32ce2ea3f9caef33734eb3d43 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 27 Mar 2024 22:22:38 +0100 Subject: [PATCH 343/382] update --- .../DiffRendererWidget.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffRendererWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffRendererWidget.cs index 33e0ecbe762..79ee62826f0 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffRendererWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffRendererWidget.cs @@ -28,6 +28,7 @@ using System.Collections.Generic; using Gtk; using Gdk; +using Cairo; using MonoDevelop.Ide; using MonoDevelop.Components; using System.Text; @@ -160,8 +161,8 @@ Pango.Layout CreateLayout (string text) return layout; } -// protected override bool OnExposeEvent (Gdk.EventExpose e) -// { + protected override bool OnDrawn (Cairo.Context e) + { // var window = e.Window; // var widget = this; // ClearAccessibleLines (); @@ -309,8 +310,8 @@ Pango.Layout CreateLayout (string text) // infoGC.Dispose (); // } // Accessible?.SetAccessibleChildren (accessibleLines.Select (l => l.Accessible).ToArray ()); -// return true; -// } + return true; + } void AddAccessibleLine (int x, int y, BlockType blockType, int lineNumber, ref bool replaceFirst, string text) { @@ -626,9 +627,9 @@ public DiffLineAccessible (DiffRendererWidget widget, int x, int y, BlockType bl public void SetBounds (int x, int y, int w, int h) { - Accessible.FrameInGtkParent = new Rectangle (x, y, w, h); + Accessible.FrameInGtkParent = new Gdk.Rectangle (x, y, w, h); var cocoaY = widget.Allocation.Height - y - h; - Accessible.FrameInParent = new Rectangle (x, cocoaY, w, h); + Accessible.FrameInParent = new Gdk.Rectangle (x, cocoaY, w, h); } void PerformPress (object sender, EventArgs e) From b877320dc74f99a903452ab024c15bdce954bb93 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 27 Mar 2024 23:29:38 +0100 Subject: [PATCH 344/382] update --- .../EditorCompareWidgetBase.DiffScrollbar.cs | 97 ++++++++++--------- 1 file changed, 49 insertions(+), 48 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.DiffScrollbar.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.DiffScrollbar.cs index b2a9a696a5d..a4986748bad 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.DiffScrollbar.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.DiffScrollbar.cs @@ -29,6 +29,7 @@ using System; using Gtk; using Gdk; +using Cairo; using Mono.TextEditor; using Mono.TextEditor.Utils; using MonoDevelop.Components; @@ -104,54 +105,54 @@ protected override bool OnButtonPressEvent (EventButton evnt) // return base.OnButtonReleaseEvent (evnt); // } - // protected override bool OnExposeEvent (Gdk.EventExpose e) - // { - // if (widget.LeftDiff == null) - // return true; - // var adj = widget.vAdjustment; - - // var diff = useLeftDiff ? widget.LeftDiff : widget.RightDiff; - - // using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { - // cr.LineWidth = 1; - // double curY = 0; - - // foreach (var hunk in diff) { - // double y, count; - // if (paintInsert) { - // y = hunk.InsertStart / (double)editor.LineCount; - // count = hunk.Inserted / (double)editor.LineCount; - // } else { - // y = hunk.RemoveStart / (double)editor.LineCount; - // count = hunk.Removed / (double)editor.LineCount; - // } - - // double start = y * Allocation.Height; - // FillGradient (cr, 0.5 + curY, start - curY); - - // curY = start; - // double height = Math.Max (cr.LineWidth, count * Allocation.Height); - // cr.Rectangle (0.5, 0.5 + curY, Allocation.Width, height); - // cr.SetSourceColor (GetColor (hunk, !paintInsert, false, 1.0)); - // cr.Fill (); - // curY += height; - // } - - // FillGradient (cr, 0.5 + curY, Allocation.Height - curY); - - // int barPadding = 3; - // var allocH = Allocation.Height; - // var adjUpper = adj.Upper; - // var barY = allocH * adj.Value / adjUpper + barPadding; - // var barH = allocH * (adj.PageSize / adjUpper) - barPadding - barPadding; - // DrawBar (cr, barY, barH); - - // cr.Rectangle (0.5, 0.5, Allocation.Width - 1, Allocation.Height - 1); - // cr.SetSourceColor ((HslColor)Style.Dark (StateType.Normal)); - // cr.Stroke (); - // } - // return true; - // } + protected override bool OnDrawn (Cairo.Context cr) + { + if (widget.LeftDiff == null) + return true; + var adj = widget.vAdjustment; + + var diff = useLeftDiff ? widget.LeftDiff : widget.RightDiff; + + //using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) { + cr.LineWidth = 1; + double curY = 0; + + foreach (var hunk in diff) { + double y, count; + if (paintInsert) { + y = hunk.InsertStart / (double)editor.LineCount; + count = hunk.Inserted / (double)editor.LineCount; + } else { + y = hunk.RemoveStart / (double)editor.LineCount; + count = hunk.Removed / (double)editor.LineCount; + } + + double start = y * Allocation.Height; + FillGradient (cr, 0.5 + curY, start - curY); + + curY = start; + double height = Math.Max (cr.LineWidth, count * Allocation.Height); + cr.Rectangle (0.5, 0.5 + curY, Allocation.Width, height); + cr.SetSourceColor (GetColor (hunk, !paintInsert, false, 1.0)); + cr.Fill (); + curY += height; + } + + FillGradient (cr, 0.5 + curY, Allocation.Height - curY); + + int barPadding = 3; + var allocH = Allocation.Height; + var adjUpper = adj.Upper; + var barY = allocH * adj.Value / adjUpper + barPadding; + var barH = allocH * (adj.PageSize / adjUpper) - barPadding - barPadding; + DrawBar (cr, barY, barH); + + cr.Rectangle (0.5, 0.5, Allocation.Width - 1, Allocation.Height - 1); + //cr.SetSourceColor ((HslColor)Style.Dark (StateType.Normal)); + cr.Stroke (); + //} + return true; + } void FillGradient (Cairo.Context cr, double y, double h) { From c93811f2ab6735523fa0a93bcd3c8c54d9c0c56c Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 27 Mar 2024 23:45:13 +0100 Subject: [PATCH 345/382] update --- .../EditorCompareWidgetBase.MiddleArea.cs | 222 +++++++++--------- 1 file changed, 111 insertions(+), 111 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.MiddleArea.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.MiddleArea.cs index 9e1ea521a55..0b7ff1c8f37 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.MiddleArea.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.MiddleArea.cs @@ -254,118 +254,118 @@ static void DrawCross (Cairo.Context cr, double x, double y) cr.LineTo (x - 2, y + 3); } - protected override bool OnDrawn (Cairo.Context evnt) + protected override bool OnDrawn (Cairo.Context cr) { - // bool hideButton = widget.MainEditor.Document.IsReadOnly; - // using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) { - // cr.Rectangle (evnt.Region.Clipbox.X, evnt.Region.Clipbox.Y, evnt.Region.Clipbox.Width, evnt.Region.Clipbox.Height); - // cr.Clip (); - // int delta = widget.MainEditor.Allocation.Y - Allocation.Y; - // if (Diff != null) { - // foreach (Hunk hunk in Diff) { - // double z1 = delta + fromEditor.LineToY (hunk.RemoveStart) - fromEditor.VAdjustment.Value; - // double z2 = delta + fromEditor.LineToY (hunk.RemoveStart + hunk.Removed) - fromEditor.VAdjustment.Value; - // if (z1 == z2) - // z2 = z1 + 1; - - // double y1 = delta + toEditor.LineToY (hunk.InsertStart) - toEditor.VAdjustment.Value; - // double y2 = delta + toEditor.LineToY (hunk.InsertStart + hunk.Inserted) - toEditor.VAdjustment.Value; - - // if (y1 == y2) - // y2 = y1 + 1; - - // if (!useLeft) { - // var tmp = z1; - // z1 = y1; - // y1 = tmp; - - // tmp = z2; - // z2 = y2; - // y2 = tmp; - // } - - // int x1 = 0; - // int x2 = Allocation.Width; - - // if (!hideButton) { - // if (useLeft && hunk.Removed > 0 || !useLeft && hunk.Removed == 0) { - // x1 += 16; - // } else { - // x2 -= 16; - // } - // } - - // if (z1 == z2) - // z2 = z1 + 1; - - // cr.MoveTo (x1, z1); - - // cr.CurveTo (x1 + (x2 - x1) / 4, z1, - // x1 + (x2 - x1) * 3 / 4, y1, - // x2, y1); - - // cr.LineTo (x2, y2); - // cr.CurveTo (x1 + (x2 - x1) * 3 / 4, y2, - // x1 + (x2 - x1) / 4, z2, - // x1, z2); - // cr.ClosePath (); - // cr.SetSourceColor (GetColor (hunk, this.useLeft, false, 1.0)); - // cr.Fill (); - - // cr.SetSourceColor (GetColor (hunk, this.useLeft, true, 1.0)); - // cr.MoveTo (x1, z1); - // cr.CurveTo (x1 + (x2 - x1) / 4, z1, - // x1 + (x2 - x1) * 3 / 4, y1, - // x2, y1); - // cr.Stroke (); - - // cr.MoveTo (x2, y2); - // cr.CurveTo (x1 + (x2 - x1) * 3 / 4, y2, - // x1 + (x2 - x1) / 4, z2, - // x1, z2); - // cr.Stroke (); - - // if (!hideButton) { - // bool isButtonSelected = hunk == selectedHunk; - - // double x, y, w, h; - // bool drawArrow = useLeft ? GetButtonPosition (hunk, y1, y2, z1, z2, out x, out y, out w, out h) : - // GetButtonPosition (hunk, z1, z2, y1, y2, out x, out y, out w, out h); - - // cr.Rectangle (x, y, w, h); - // if (isButtonSelected) { - // int mx, my; - // GetPointer (out mx, out my); - // // mx -= (int)x; - // // my -= (int)y; - // using (var gradient = new Cairo.RadialGradient (mx, my, h, mx, my, 2)) { - // var color = (MonoDevelop.Components.HslColor)Style.Mid (StateType.Normal); - // color.L *= 1.05; - // gradient.AddColorStop (0, color); - // color.L *= 1.07; - // gradient.AddColorStop (1, color); - // cr.SetSource (gradient); - // } - // } else { - // cr.SetSourceColor ((MonoDevelop.Components.HslColor)Style.Mid (StateType.Normal)); - // } - // cr.FillPreserve (); - - // cr.SetSourceColor ((MonoDevelop.Components.HslColor)Style.Dark (StateType.Normal)); - // cr.Stroke (); - // cr.LineWidth = 1; - // cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.BaseForegroundColor.ToCairoColor ()); - // if (drawArrow) { - // DrawArrow (cr, x + w / 1.5, y + h / 2); - // DrawArrow (cr, x + w / 2.5, y + h / 2); - // } else { - // DrawCross (cr, x + w / 2, y + (h) / 2); - // } - // cr.Stroke (); - // } - // } - // } - // } + bool hideButton = widget.MainEditor.Document.IsReadOnly; + //using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) { + //cr.Rectangle (evnt.Region.Clipbox.X, evnt.Region.Clipbox.Y, evnt.Region.Clipbox.Width, evnt.Region.Clipbox.Height); + cr.Clip (); + int delta = widget.MainEditor.Allocation.Y - Allocation.Y; + if (Diff != null) { + foreach (Hunk hunk in Diff) { + double z1 = delta + fromEditor.LineToY (hunk.RemoveStart) - fromEditor.VAdjustment.Value; + double z2 = delta + fromEditor.LineToY (hunk.RemoveStart + hunk.Removed) - fromEditor.VAdjustment.Value; + if (z1 == z2) + z2 = z1 + 1; + + double y1 = delta + toEditor.LineToY (hunk.InsertStart) - toEditor.VAdjustment.Value; + double y2 = delta + toEditor.LineToY (hunk.InsertStart + hunk.Inserted) - toEditor.VAdjustment.Value; + + if (y1 == y2) + y2 = y1 + 1; + + if (!useLeft) { + var tmp = z1; + z1 = y1; + y1 = tmp; + + tmp = z2; + z2 = y2; + y2 = tmp; + } + + int x1 = 0; + int x2 = Allocation.Width; + + if (!hideButton) { + if (useLeft && hunk.Removed > 0 || !useLeft && hunk.Removed == 0) { + x1 += 16; + } else { + x2 -= 16; + } + } + + if (z1 == z2) + z2 = z1 + 1; + + cr.MoveTo (x1, z1); + + cr.CurveTo (x1 + (x2 - x1) / 4, z1, + x1 + (x2 - x1) * 3 / 4, y1, + x2, y1); + + cr.LineTo (x2, y2); + cr.CurveTo (x1 + (x2 - x1) * 3 / 4, y2, + x1 + (x2 - x1) / 4, z2, + x1, z2); + cr.ClosePath (); + cr.SetSourceColor (GetColor (hunk, this.useLeft, false, 1.0)); + cr.Fill (); + + cr.SetSourceColor (GetColor (hunk, this.useLeft, true, 1.0)); + cr.MoveTo (x1, z1); + cr.CurveTo (x1 + (x2 - x1) / 4, z1, + x1 + (x2 - x1) * 3 / 4, y1, + x2, y1); + cr.Stroke (); + + cr.MoveTo (x2, y2); + cr.CurveTo (x1 + (x2 - x1) * 3 / 4, y2, + x1 + (x2 - x1) / 4, z2, + x1, z2); + cr.Stroke (); + + if (!hideButton) { + bool isButtonSelected = hunk == selectedHunk; + + double x, y, w, h; + bool drawArrow = useLeft ? GetButtonPosition (hunk, y1, y2, z1, z2, out x, out y, out w, out h) : + GetButtonPosition (hunk, z1, z2, y1, y2, out x, out y, out w, out h); + + cr.Rectangle (x, y, w, h); + if (isButtonSelected) { + int mx, my; + GetPointer (out mx, out my); + // mx -= (int)x; + // my -= (int)y; + using (var gradient = new Cairo.RadialGradient (mx, my, h, mx, my, 2)) { + //var color = (MonoDevelop.Components.HslColor)Style.Mid (StateType.Normal); + //color.L *= 1.05; + //gradient.AddColorStop (0, color); + //color.L *= 1.07; + //gradient.AddColorStop (1, color); + cr.SetSource (gradient); + } + } else { + //cr.SetSourceColor ((MonoDevelop.Components.HslColor)Style.Mid (StateType.Normal)); + } + cr.FillPreserve (); + + //cr.SetSourceColor ((MonoDevelop.Components.HslColor)Style.Dark (StateType.Normal)); + cr.Stroke (); + cr.LineWidth = 1; + //cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.BaseForegroundColor.ToCairoColor ()); + if (drawArrow) { + DrawArrow (cr, x + w / 1.5, y + h / 2); + DrawArrow (cr, x + w / 2.5, y + h / 2); + } else { + DrawCross (cr, x + w / 2, y + (h) / 2); + } + cr.Stroke (); + } + } + } + //} return true; } From 71a65449914588b7c486c69af0289cdc475be175 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 29 Mar 2024 17:00:05 +0100 Subject: [PATCH 346/382] update --- .../BlameWidget.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs index 0d10525ee59..00b705e3c1f 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs @@ -339,18 +339,18 @@ void HandleEditorExposeEvent (object o, PaintEventArgs args) } } - // protected override bool OnExposeEvent (EventExpose evnt) - // { - // Gdk.GC gc = Style.DarkGC (State); - // evnt.Window.DrawLine (gc, Allocation.X, Allocation.Top, Allocation.X, Allocation.Bottom); - // evnt.Window.DrawLine (gc, Allocation.Right, Allocation.Top, Allocation.Right, Allocation.Bottom); + protected override bool OnDrawn (Cairo.Context evnt) + { + //Gdk.GC gc = Style.DarkGC (State); + //evnt.Window.DrawLine (gc, Allocation.X, Allocation.Top, Allocation.X, Allocation.Bottom); + //evnt.Window.DrawLine (gc, Allocation.Right, Allocation.Top, Allocation.Right, Allocation.Bottom); - // evnt.Window.DrawLine (gc, Allocation.Left, Allocation.Y, Allocation.Right, Allocation.Y); - // evnt.Window.DrawLine (gc, Allocation.Left, Allocation.Bottom, Allocation.Right, Allocation.Bottom); + //evnt.Window.DrawLine (gc, Allocation.Left, Allocation.Y, Allocation.Right, Allocation.Y); + //evnt.Window.DrawLine (gc, Allocation.Left, Allocation.Bottom, Allocation.Right, Allocation.Bottom); - // return base.OnExposeEvent (evnt); - // } + return base.OnDrawn (evnt); + } void JumpOverFoldings (ref int line) { From f0664a27dce36c501960c1dfbff4384818f66e82 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Fri, 29 Mar 2024 22:48:34 +0100 Subject: [PATCH 347/382] update --- .../MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs index 29568a8a992..6553ea35118 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs @@ -133,7 +133,7 @@ public Toolbox (ToolboxService toolboxService, IPadWindow container) fontChanger = new MonoDevelop.Ide.Gui.PadFontChanger (toolboxWidget, toolboxWidget.SetCustomFont, toolboxWidget.QueueResize); - //this.toolboxWidget.DoPopupMenu = ShowPopup; + this.toolboxWidget.DoPopupMenu = ShowPopup; scrolledWindow = new MonoDevelop.Components.CompactScrolledWindow (); base.PackEnd (scrolledWindow, true, true, 0); base.FocusChain = new Gtk.Widget [] { scrolledWindow }; From 943485d53acc6a229822ba2979095c1f983d6225 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 6 Apr 2024 18:11:43 +0200 Subject: [PATCH 348/382] update --- .../AssemblyBrowserWidget.cs | 96 +++++++++---------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs index 685eea30563..5e60b84057f 100644 --- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs +++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs @@ -518,60 +518,60 @@ void CreateColumns () } } - // void RenderDeclaringTypeOrNamespace (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) - // { - // var ct = (Gtk.CellRendererText)cell; - // var entity = tree_model.GetValue (iter, 0) as IEntity; - // if (entity != null) { - // if (entity.DeclaringType != null) { - // ct.Text = entity.DeclaringType.FullName; - // return; - // } - // if (entity is ITypeDefinition type) { - // ct.Text = type.Namespace; - // } else { - // ct.Text = entity.DeclaringType?.Namespace ?? ""; - // } - // } - // } + void RenderDeclaringTypeOrNamespace (TreeViewColumn tree_column, CellRenderer cell, ITreeModel tree_model, TreeIter iter) + { + var ct = (Gtk.CellRendererText)cell; + var entity = tree_model.GetValue (iter, 0) as IEntity; + if (entity != null) { + if (entity.DeclaringType != null) { + ct.Text = entity.DeclaringType.FullName; + return; + } + if (entity is ITypeDefinition type) { + ct.Text = type.Namespace; + } else { + ct.Text = entity.DeclaringType?.Namespace ?? ""; + } + } + } - // void RenderText (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) - // { - // var ct = (Gtk.CellRendererText)cell; - // var entity = tree_model.GetValue (iter, 0) as INamedElement; - // if (entity != null) - // ct.Text = entity.Name; - // } + void RenderText (TreeViewColumn tree_column, CellRenderer cell, ITreeModel tree_model, TreeIter iter) + { + var ct = (Gtk.CellRendererText)cell; + var entity = tree_model.GetValue (iter, 0) as INamedElement; + if (entity != null) + ct.Text = entity.Name; + } - // void RenderImage (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) - // { - // var ct = (CellRendererImage)cell; - // var entity = tree_model.GetValue (iter, 0) as IEntity; - // if (entity is IEvent evt) { - // ct.Image = ImageService.GetIcon (EventDefinitionNodeBuilder.GetStockIcon (evt), Gtk.IconSize.Menu); - // return; - // } + void RenderImage (TreeViewColumn tree_column, CellRenderer cell, ITreeModel tree_model, TreeIter iter) + { + var ct = (CellRendererImage)cell; + var entity = tree_model.GetValue (iter, 0) as IEntity; + if (entity is IEvent evt) { + ct.Image = ImageService.GetIcon (EventDefinitionNodeBuilder.GetStockIcon (evt), Gtk.IconSize.Menu); + return; + } - // if (entity is IField field) { - // ct.Image = ImageService.GetIcon (FieldDefinitionNodeBuilder.GetStockIcon (field), Gtk.IconSize.Menu); - // return; - // } + if (entity is IField field) { + ct.Image = ImageService.GetIcon (FieldDefinitionNodeBuilder.GetStockIcon (field), Gtk.IconSize.Menu); + return; + } - // if (entity is IMethod method) { - // ct.Image = ImageService.GetIcon (MethodDefinitionNodeBuilder.GetStockIcon (method), Gtk.IconSize.Menu); - // return; - // } + if (entity is IMethod method) { + ct.Image = ImageService.GetIcon (MethodDefinitionNodeBuilder.GetStockIcon (method), Gtk.IconSize.Menu); + return; + } - // if (entity is IProperty property) { - // ct.Image = ImageService.GetIcon (PropertyDefinitionNodeBuilder.GetStockIcon (property), Gtk.IconSize.Menu); - // return; - // } + if (entity is IProperty property) { + ct.Image = ImageService.GetIcon (PropertyDefinitionNodeBuilder.GetStockIcon (property), Gtk.IconSize.Menu); + return; + } - // if (entity is ITypeDefinition type) { - // ct.Image = ImageService.GetIcon (TypeDefinitionNodeBuilder.GetStockIcon (type), Gtk.IconSize.Menu); - // return; - // } - // } + if (entity is ITypeDefinition type) { + ct.Image = ImageService.GetIcon (TypeDefinitionNodeBuilder.GetStockIcon (type), Gtk.IconSize.Menu); + return; + } + } CancellationTokenSource searchTokenSource = new CancellationTokenSource (); From 4445e9a38485b80f572d5e03c4ff00cfda1ea221 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 6 Apr 2024 18:28:57 +0200 Subject: [PATCH 349/382] update --- .../AssemblyBrowserWidget.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs index 5e60b84057f..06801a8b506 100644 --- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs +++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs @@ -455,15 +455,15 @@ void CreateColumns () crt = new Gtk.CellRendererText (); col.PackStart (crp, false); col.PackStart (crt, true); - //col.SetCellDataFunc (crp, RenderImage); - //col.SetCellDataFunc (crt, RenderText); + col.SetCellDataFunc (crp, RenderImage); + col.SetCellDataFunc (crt, RenderText); col.SortColumnId = 1; searchTreeview.AppendColumn (col); col.Resizable = true; col = searchTreeview.AppendColumn (GettextCatalog.GetString ("Declaring Type"), crt = new Gtk.CellRendererText ()); col.FixedWidth = 300; col.Sizing = TreeViewColumnSizing.Fixed; - //col.SetCellDataFunc (crt, RenderDeclaringTypeOrNamespace); + col.SetCellDataFunc (crt, RenderDeclaringTypeOrNamespace); col.SortColumnId = 2; col.Resizable = true; searchTreeview.Model = resultListStore; @@ -475,8 +475,8 @@ void CreateColumns () crt = new Gtk.CellRendererText (); col.PackStart (crp, false); col.PackStart (crt, true); - //col.SetCellDataFunc (crp, RenderImage); - //col.SetCellDataFunc (crt, RenderText); + col.SetCellDataFunc (crp, RenderImage); + col.SetCellDataFunc (crt, RenderText); col.SortColumnId = 1; searchTreeview.AppendColumn (col); @@ -484,7 +484,7 @@ void CreateColumns () col.Sizing = TreeViewColumnSizing.Fixed; col.Resizable = true; col = searchTreeview.AppendColumn (GettextCatalog.GetString ("Parent"), crt = new Gtk.CellRendererText ()); - //col.SetCellDataFunc (crt, RenderDeclaringTypeOrNamespace); + col.SetCellDataFunc (crt, RenderDeclaringTypeOrNamespace); col.SortColumnId = 2; col.FixedWidth = 300; @@ -499,8 +499,8 @@ void CreateColumns () crt = new Gtk.CellRendererText (); col.PackStart (crp, false); col.PackStart (crt, true); - //col.SetCellDataFunc (crp, RenderImage); - //col.SetCellDataFunc (crt, RenderText); + col.SetCellDataFunc (crp, RenderImage); + col.SetCellDataFunc (crt, RenderText); col.SortColumnId = 1; searchTreeview.AppendColumn (col); col.FixedWidth = 400; @@ -508,7 +508,7 @@ void CreateColumns () col.Resizable = true; col = searchTreeview.AppendColumn (GettextCatalog.GetString ("Namespace"), crt = new Gtk.CellRendererText ()); - //col.SetCellDataFunc (crt, RenderDeclaringTypeOrNamespace); + col.SetCellDataFunc (crt, RenderDeclaringTypeOrNamespace); col.SortColumnId = 2; col.FixedWidth = 300; col.Sizing = TreeViewColumnSizing.Fixed; From 75b9d12063c908ea039cf13f9f2cc700efcce8ad Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 6 Apr 2024 18:51:11 +0200 Subject: [PATCH 350/382] update --- .../LogWidget.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs index 8da3775d13f..485d6687803 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs @@ -226,7 +226,7 @@ public LogWidget (VersionControlDocumentInfo info) colChangedFile.Title = GettextCatalog.GetString ("File"); colChangedFile.PackStart (crp, false); colChangedFile.PackStart (crt, true); - //colChangedFile.SetCellDataFunc (crp, HandleNodeCellDataFunc); + colChangedFile.SetCellDataFunc (crp, HandleNodeCellDataFunc); colChangedFile.AddAttribute (crt, "text", 3); treeviewFiles.AppendColumn (colChangedFile); @@ -289,14 +289,14 @@ public LogWidget (VersionControlDocumentInfo info) Ide.Gui.Styles.Changed += HandleStylesChanged; } - // static void HandleNodeCellDataFunc (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) - // { - // var cri = (CellRendererImage)cell; - // var image = tree_model.GetValue (iter, 2) as Xwt.Drawing.Image; - // cri.Visible = image != null; - // if (image != null) - // cri.Image = image; - // } + static void HandleNodeCellDataFunc (TreeViewColumn tree_column, CellRenderer cell, ITreeModel tree_model, TreeIter iter) + { + var cri = (CellRendererImage)cell; + var image = tree_model.GetValue (iter, 2) as Xwt.Drawing.Image; + cri.Visible = image != null; + if (image != null) + cri.Image = image; + } [GLib.ConnectBeforeAttribute] void LabelRevision_ButtonPressEvent (object o, ButtonPressEventArgs args) From 74dfcb0bb0d734d8958b970cc75af040a127fe52 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 6 Apr 2024 19:32:59 +0200 Subject: [PATCH 351/382] update --- .../MonoDevelop.UnitTesting/Gui/TestPad.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs index ccbde9402bc..72c50c74b0c 100644 --- a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs +++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs @@ -30,6 +30,7 @@ using System.Collections; using Gtk; using Gdk; +using Cairo; using MonoDevelop.Core; using MonoDevelop.Core.Execution; @@ -1001,14 +1002,14 @@ public int Padding { set { padding = value; } } - // protected override bool OnExposeEvent (Gdk.EventExpose args) - // { - // using (Gdk.GC gc = new Gdk.GC (GdkWindow)) { - // gc.ClipRectangle = Allocation; - // GdkWindow.DrawLayout (gc, padding, padding, layout); - // } - // return true; - // } + protected override bool OnDrawn (Cairo.Context args) + { + //using (Gdk.GC gc = new Gdk.GC (GdkWindow)) { + // gc.ClipRectangle = Allocation; + // GdkWindow.DrawLayout (gc, padding, padding, layout); + //} + return true; + } protected override void OnDestroyed () { if (layout != null) { From 8654051b37fc256130d181d0ea61142df97e77e0 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 6 Apr 2024 19:46:53 +0200 Subject: [PATCH 352/382] update --- .../ResultTooltipProvider.RectangleMarker.cs | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.RectangleMarker.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.RectangleMarker.cs index b1c817fbf00..2ca5bda1302 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.RectangleMarker.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.RectangleMarker.cs @@ -30,6 +30,7 @@ using MonoDevelop.Components; #endif +using Cairo; using MonoDevelop.Ide.Editor; using MonoDevelop.Ide.Editor.Highlighting; @@ -44,23 +45,23 @@ public RectangleMarker () WidthRequest = 16; } - // protected override bool OnExposeEvent (Gdk.EventExpose evnt) - // { - // using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) { - // const int triangleWidth = 8; - // const int triangleHeight = 4; + protected override bool OnDrawn (Cairo.Context evnt) + { + using (Cairo.Context cr = Gdk.CairoHelper.Create (GdkWindow)) { + const int triangleWidth = 8; + const int triangleHeight = 4; - // cr.SetSourceColor (SyntaxHighlightingService.GetColor (DefaultSourceEditorOptions.Instance.GetEditorTheme (), EditorThemeColors.LineNumbers)); - // var topPosition = Allocation.Height / 2 - triangleHeight / 2; + cr.SetSourceColor (SyntaxHighlightingService.GetColor (DefaultSourceEditorOptions.Instance.GetEditorTheme (), EditorThemeColors.LineNumbers)); + var topPosition = Allocation.Height / 2 - triangleHeight / 2; - // cr.MoveTo (Allocation.Width / 2 + triangleWidth / 2, topPosition); - // cr.LineTo (Allocation.Width / 2 - triangleWidth / 2, topPosition); - // cr.LineTo (Allocation.Width / 2, topPosition + triangleHeight); - // cr.LineTo (Allocation.Width / 2 + triangleWidth / 2, topPosition); - // cr.Fill (); - // } - // return true; - // } + cr.MoveTo (Allocation.Width / 2 + triangleWidth / 2, topPosition); + cr.LineTo (Allocation.Width / 2 - triangleWidth / 2, topPosition); + cr.LineTo (Allocation.Width / 2, topPosition + triangleHeight); + cr.LineTo (Allocation.Width / 2 + triangleWidth / 2, topPosition); + cr.Fill (); + } + return true; + } } } } \ No newline at end of file From c2136f68ccaf035c27dbf9fb51c6f790119b99bf Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 6 Apr 2024 20:57:41 +0200 Subject: [PATCH 353/382] update --- .../DocumentationPanel.cs | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DocumentationPanel.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DocumentationPanel.cs index dbf84f2fbdd..671471fd578 100644 --- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DocumentationPanel.cs +++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DocumentationPanel.cs @@ -27,6 +27,7 @@ using System; using Gtk; using Gdk; +using Cairo; using MonoDevelop.Core; namespace MonoDevelop.AssemblyBrowser @@ -58,25 +59,25 @@ protected override void OnDestroyed () base.OnDestroyed (); } - // protected override bool OnExposeEvent (EventExpose evnt) - // { - // Gdk.Window win = evnt.Window; - // win.DrawRectangle (Style.BaseGC (string.IsNullOrEmpty (Markup) ? StateType.Insensitive : StateType.Normal), true, evnt.Area); - // int x = 0; - // int y = 0; - // if (string.IsNullOrEmpty (Markup)) { - // layout.SetMarkup (GettextCatalog.GetString ("No documentation available.")); - // int width, height; - // layout.GetPixelSize (out width, out height); - // x = (Allocation.Width - width) / 2; - // y = (Allocation.Height - height) / 2; - // } else { - // layout.SetMarkup (Markup); - // } - // layout.Width = Allocation.Width * (int)Pango.Scale.PangoScale; - // win.DrawLayout (Style.TextGC (StateType.Normal), x, y, layout); - // return true; - // } + protected override bool OnDrawn (Cairo.Context evnt) + { + //Gdk.Window win = evnt.Window; + // win.DrawRectangle (Style.BaseGC (string.IsNullOrEmpty (Markup) ? StateType.Insensitive : StateType.Normal), true, evnt.Area); + // int x = 0; + // int y = 0; + // if (string.IsNullOrEmpty (Markup)) { + // layout.SetMarkup (GettextCatalog.GetString ("No documentation available.")); + // int width, height; + // layout.GetPixelSize (out width, out height); + // x = (Allocation.Width - width) / 2; + // y = (Allocation.Height - height) / 2; + // } else { + // layout.SetMarkup (Markup); + // } + // layout.Width = Allocation.Width * (int)Pango.Scale.PangoScale; + // win.DrawLayout (Style.TextGC (StateType.Normal), x, y, layout); + return true; + } public void CalculateSize () { From 1c10fb9fba874081abc69d7fbaacf853eef5af69 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 6 Apr 2024 22:00:42 +0200 Subject: [PATCH 354/382] update --- .../ToolboxWidget.cs | 71 +++++++++++-------- 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs index d53d767f841..a0816d63d31 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs @@ -873,34 +873,49 @@ void Iterate (ref int xpos, ref int ypos, Func vAdjustement.Upper) - // vAdjustement.Value = vAdjustement.Upper - vAdjustement.PageSize; - // if (vAdjustement.Value < 0) - // vAdjustement.Value = 0; - // } - // } + + protected override void OnGetPreferredWidth (out int minimum_width, out int natural_width) + { + base.OnGetPreferredWidth (out minimum_width, out natural_width); + if (!realSizeRequest) { + // Request a minimal width, to size recalculation infinite loops with + // small widths, due to the vscrollbar being shown and hidden. + minimum_width = 50; + //minimum_height = 0; + return; + } + minimum_width = 50; + } + + protected override void OnGetPreferredHeight (out int minimum_height, out int natural_height) + { + base.OnGetPreferredHeight (out minimum_height, out natural_height); + if (!realSizeRequest) { + // Request a minimal width, to size recalculation infinite loops with + // small widths, due to the vscrollbar being shown and hidden. + //minimum_width = 50; + minimum_height = 0; + return; + } + int xpos = 0; + int ypos = 0; + Iterate (ref xpos, ref ypos, null, null); + //minimum_width = 50; + minimum_height = ypos; + if (this.vAdjustement != null) { + this.vAdjustement.SetBounds (0, + ypos, + 20, + minimum_height, + minimum_height); + if (ypos < minimum_height) + this.vAdjustement.Value = 0; + if (vAdjustement.Value + vAdjustement.PageSize > vAdjustement.Upper) + vAdjustement.Value = vAdjustement.Upper - vAdjustement.PageSize; + if (vAdjustement.Value < 0) + vAdjustement.Value = 0; + } + } protected override void OnSizeAllocated (Gdk.Rectangle allocation) { From 28d895f49cddd321b1f55b7b08eed24a937b95d7 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sun, 7 Apr 2024 22:50:03 +0200 Subject: [PATCH 355/382] update --- .../MonoDevelop.Components/HoverImageButton.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HoverImageButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HoverImageButton.cs index e4fd8f5631e..eb5dd7934a9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HoverImageButton.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HoverImageButton.cs @@ -170,10 +170,9 @@ protected override bool OnDrawn(Cairo.Context evnt) { base.OnDrawn(evnt); - //if(HasFocus && draw_focus) { - // Style.PaintFocus(Style, GdkWindow, StateType.Normal, evnt.Area, this, "button", - // 0, 0, Allocation.Width, Allocation.Height); - //} + if(HasFocus && draw_focus) { + StyleContext.RenderFocus (evnt, 0, 0, Allocation.Width, Allocation.Height); + } return true; } From 6d28d100be8536ef83825a22371d60e60a9ae3b9 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sun, 7 Apr 2024 23:18:32 +0200 Subject: [PATCH 356/382] update --- .../MultiConfigItemOptionsPanel.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs index 5f0a9d27373..c5397c4ca1e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs @@ -115,7 +115,8 @@ Control IOptionsPanel.CreatePanelWidget () configCombo.PackStart (cell, true); configCombo.AddAttribute (cell, "text", 0); combosBox.PackStart (configCombo, false, false, 0); - combosBox.PackStart (new Gtk.Label (GettextCatalog.GetString ("Platform:")), false, false, 0); + var platformLabel = new Gtk.Label (GettextCatalog.GetString ("Platform:")); + combosBox.PackStart (platformLabel, false, false, 0); platformCombo = new Gtk.ComboBoxText (); platformCombo.Name = "panelWidgetPlatformCombo"; combosBox.PackStart (platformCombo, false, false, 0); @@ -127,10 +128,10 @@ Control IOptionsPanel.CreatePanelWidget () configurationLabel, GettextCatalog.GetString ("Select a configuration")); - //platformCombo.SetCommonAccessibilityAttributes ( - //platformCombo.Name, - //platformLabel, - //GettextCatalog.GetString ("Select a platform")); + platformCombo.SetCommonAccessibilityAttributes ( + platformCombo.Name, + platformLabel, + GettextCatalog.GetString ("Select a platform")); cbox.Hidden += OnPageHidden; cbox.Shown += OnPageShown; From 50b05da33f27fba64eb63c8324ee03e4e5bb4c32 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 8 Apr 2024 11:08:36 +0200 Subject: [PATCH 357/382] update --- .../LanguageCellRenderer.cs | 85 ++++++++++++------- 1 file changed, 53 insertions(+), 32 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs index 796e8316c00..d12e6fa1ade 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs @@ -99,20 +99,42 @@ public Rectangle GetLanguageRect () return languageRect; } -// public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) -// { -// base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); -// -// int languageRectangleWidth = textWidth + languageLeftHandPadding; -// if (TemplateHasMultipleLanguages ()) { -// languageRectangleWidth += languageRightHandPadding + dropdownTriangleWidth + dropdownTriangleRightHandPadding; -// } else { -// languageRectangleWidth += languageLeftHandPadding; -// languageRectangleWidth = Math.Max (languageRectangleWidth, minLanguageRectWidth); -// } -// -// width = languageRectangleWidth; -// } + // public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + // { + // base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); + + // textWidth = GetTextWidth (widget); + // int languageRectangleWidth = textWidth + languageLeftHandPadding; + // if (TemplateHasMultipleLanguages ()) { + // languageRectangleWidth += languageRightHandPadding + dropdownTriangleWidth + dropdownTriangleRightHandPadding; + // } else { + // languageRectangleWidth += languageRightHandPadding; + // languageRectangleWidth = Math.Max (languageRectangleWidth, minLanguageRectWidth); + // } + + // width = languageRectangleWidth + rightHandCellPadding; + // } + + int GetTextWidth (Widget widget) + { + if (Template == null) { + return 0; + } + + using (var layout = new Pango.Layout (widget.PangoContext)) { + int width = 0; + foreach (string language in Template.AvailableLanguages) { + SetMarkup (layout, language); + + int currentHeight = 0; + int currentWidth = 0; + layout.GetPixelSize (out currentWidth, out currentHeight); + + width = Math.Max (currentWidth, width); + } + return width; + } + } // protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) // { @@ -170,24 +192,23 @@ void DrawTriangle (Cairo.Context ctx, int x, int y) ctx.Fill (); } -// Rectangle GetLanguageButtonRectangle (Drawable window, Widget widget, Rectangle cell_area, int textHeight, int textWidth) -// { -// int languageRectangleHeight = cell_area.Height - 8; -// int languageRectangleWidth = textWidth + languageLeftHandPadding; -// if (TemplateHasMultipleLanguages ()) { -// languageRectangleWidth += languageRightHandPadding + dropdownTriangleWidth + dropdownTriangleRightHandPadding; -// } else { -// languageRectangleWidth += languageLeftHandPadding; -// languageRectangleWidth = Math.Max (languageRectangleWidth, minLanguageRectWidth); -// } -// -// var dy = (cell_area.Height - languageRectangleHeight) / 2 - 1; -// var y = cell_area.Y + dy; -// //var x = widget.Allocation.Width - languageRectangleWidth - (int)Xpad; -// var x = cell_area.X; -// -// return new Rectangle (x, y, languageRectangleWidth, languageRectangleHeight); -// } + Rectangle GetLanguageButtonRectangle (/*Drawable window, */Widget widget, Rectangle cell_area, int textHeight, int textWidth) + { + int languageRectangleHeight = cell_area.Height - 8; + int languageRectangleWidth = textWidth + languageLeftHandPadding; + if (TemplateHasMultipleLanguages ()) { + languageRectangleWidth += languageRightHandPadding + dropdownTriangleWidth + dropdownTriangleRightHandPadding; + } else { + languageRectangleWidth += languageRightHandPadding; + languageRectangleWidth = Math.Max (languageRectangleWidth, minLanguageRectWidth); + } + + var dy = (cell_area.Height - languageRectangleHeight) / 2 - 1; + var y = cell_area.Y + dy; + var x = cell_area.X + cell_area.Width - languageRectangleWidth - rightHandCellPadding; + + return new Rectangle (x, y, languageRectangleWidth, languageRectangleHeight); + } internal bool IsLanguageButtonPressed (EventButton button) { From 61d04a627a0900be5f15153dd94d9813bbb0671c Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Mon, 8 Apr 2024 19:44:47 +0200 Subject: [PATCH 358/382] update --- .../Gui/ResultTooltipProvider.cs | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs index 830b82e5c1a..b2571000747 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs @@ -177,41 +177,41 @@ public override void GetRequiredPosition (Ide.Editor.TextEditor editor, Window t const int xPadding = 4; const int windowSize = 36; - // protected override Xwt.Point CalculateWindowLocation (Ide.Editor.TextEditor editor, TooltipItem item, Xwt.WindowFrame xwtWindow, int mouseX, int mouseY, Xwt.Point origin) - // { - // int w; - // double xalign; - // GetRequiredPosition (editor, xwtWindow, out w, out xalign); - // w += 10; - // var allocation = GetAllocation (editor); + protected override Xwt.Point CalculateWindowLocation (Ide.Editor.TextEditor editor, TooltipItem item, Xwt.WindowFrame xwtWindow, int mouseX, int mouseY, Xwt.Point origin) + { + int w; + double xalign; + GetRequiredPosition (editor, xwtWindow, out w, out xalign); + w += 10; + var allocation = GetAllocation (editor); - // var info = (TaggedTooltipInformation)item.Item; - // var loc = editor.OffsetToLocation (info.Tag.Span.Start); - // var p = editor.LocationToPoint (loc); - // var view = editor.GetContent (); - // int x = (int)(p.X + origin.X + allocation.X + xPadding); - // int y = (int)(p.Y + view.TextEditor.GetLineHeight (loc.Line) + origin.Y + allocation.Y + yPadding); + var info = (TaggedTooltipInformation)item.Item; + var loc = editor.OffsetToLocation (info.Tag.Span.Start); + var p = editor.LocationToPoint (loc); + var view = editor.GetContent (); + int x = (int)(p.X + origin.X + allocation.X + xPadding); + int y = (int)(p.Y + view.TextEditor.GetLineHeight (loc.Line) + origin.Y + allocation.Y + yPadding); - // Gtk.Widget widget = editor; - // var geometry = widget.Screen.GetUsableMonitorGeometry (widget.Screen.GetMonitorAtPoint (x, y)); + Gtk.Widget widget = editor; + var geometry = widget.Screen.GetUsableMonitorGeometry (widget.Screen.GetMonitorAtPoint (x, y)); - // if (x + w >= geometry.X + geometry.Width) - // x = geometry.X + geometry.Width - w; - // if (x < geometry.Left) - // x = geometry.Left; + if (x + w >= geometry.X + geometry.Width) + x = geometry.X + geometry.Width - w; + if (x < geometry.Left) + x = geometry.Left; - // if (info.Tag?.FloatingWidgetShown == true) { - // x += windowSize; - // } + if (info.Tag?.FloatingWidgetShown == true) { + x += windowSize; + } - // int h = (int)xwtWindow.Size.Height; - // if (y + h >= geometry.Y + geometry.Height) - // y = geometry.Y + geometry.Height - h; - // if (y < geometry.Top) - // y = geometry.Top; + int h = (int)xwtWindow.Size.Height; + if (y + h >= geometry.Y + geometry.Height) + y = geometry.Y + geometry.Height - h; + if (y < geometry.Top) + y = geometry.Top; - // return new Xwt.Point (x, y); - // } + return new Xwt.Point (x, y); + } public override void ShowTooltipWindow (Ide.Editor.TextEditor editor, Components.Window tipWindow, TooltipItem item, Xwt.ModifierKeys modifierState, int mouseX, int mouseY) { @@ -242,19 +242,19 @@ public override void ShowTooltipWindow (Ide.Editor.TextEditor editor, Components } static FloatingQuickFixIconWidget floatingWidget; - // public override bool TryCloseTooltipWindow (Window tipWindow, TooltipCloseReason reason) - // { - // var window = (LanguageItemWindow)tipWindow; - // if (window.Tag is FloatingQuickFixIconWidget iconWidget) { - // if (reason != TooltipCloseReason.Force && iconWidget.IsMouseNear ()) { - // return false; - // } - // iconWidget.QueueDestroy (reason == TooltipCloseReason.Force ? 0u : 500); - // } else { - // window.Destroy (); - // } - // return true; - // } + public override bool TryCloseTooltipWindow (Window tipWindow, TooltipCloseReason reason) + { + var window = (LanguageItemWindow)tipWindow; + if (window.Tag is FloatingQuickFixIconWidget iconWidget) { + if (reason != TooltipCloseReason.Force && iconWidget.IsMouseNear ()) { + return false; + } + iconWidget.QueueDestroy (reason == TooltipCloseReason.Force ? 0u : 500); + } else { + window.Destroy (); + } + return true; + } #endregion } From c87d14d0351132d47d2cb459103c331456cdaddf Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 9 Apr 2024 12:54:49 +0200 Subject: [PATCH 359/382] update --- .../MonoDevelop.Ide.Projects/LanguageCellRenderer.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs index d12e6fa1ade..1ea9b54018a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs @@ -27,6 +27,7 @@ using System.Linq; using Gdk; using Gtk; +using Cairo; using MonoDevelop.Components; using MonoDevelop.Ide.Gui; using MonoDevelop.Ide.Templates; @@ -35,7 +36,7 @@ namespace MonoDevelop.Ide.Projects { class LanguageCellRenderer : CellRendererText { - Rectangle languageRect; + Gdk.Rectangle languageRect; int dropdownTriangleWidth = 8; int dropdownTriangleHeight = 5; const int dropdownTriangleRightHandPadding = 8; @@ -94,7 +95,7 @@ public LanguageCellRenderer () languageRightHandPadding + 10; } - public Rectangle GetLanguageRect () + public Gdk.Rectangle GetLanguageRect () { return languageRect; } @@ -192,7 +193,7 @@ void DrawTriangle (Cairo.Context ctx, int x, int y) ctx.Fill (); } - Rectangle GetLanguageButtonRectangle (/*Drawable window, */Widget widget, Rectangle cell_area, int textHeight, int textWidth) + Gdk.Rectangle GetLanguageButtonRectangle (/*Drawable window, */Widget widget, Gdk.Rectangle cell_area, int textHeight, int textWidth) { int languageRectangleHeight = cell_area.Height - 8; int languageRectangleWidth = textWidth + languageLeftHandPadding; @@ -207,7 +208,7 @@ Rectangle GetLanguageButtonRectangle (/*Drawable window, */Widget widget, Rectan var y = cell_area.Y + dy; var x = cell_area.X + cell_area.Width - languageRectangleWidth - rightHandCellPadding; - return new Rectangle (x, y, languageRectangleWidth, languageRectangleHeight); + return new Gdk.Rectangle (x, y, languageRectangleWidth, languageRectangleHeight); } internal bool IsLanguageButtonPressed (EventButton button) From 90d2cbef906a8dea4b728ae11521db283be13b8a Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 9 Apr 2024 13:40:11 +0200 Subject: [PATCH 360/382] update --- .../MonoDevelop.Ide.WelcomePage/WelcomePageWidget.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageWidget.cs index 592bf9d6be4..0ee1052dd6f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageWidget.cs @@ -197,12 +197,12 @@ protected override bool OnDrawn (Cairo.Context evnt) if (Owner.LogoImage != null) { var lRect = new Gdk.Rectangle (Allocation.X, Allocation.Y, (int)Owner.LogoImage.Width, (int)Owner.LogoImage.Height); //if (evnt.Region.RectIn (lRect) != OverlapType.Out) - // context.DrawImage (this, Owner.LogoImage, Allocation.X, Allocation.Y); + context.DrawImage (this, Owner.LogoImage, Allocation.X, Allocation.Y); var bgRect = new Gdk.Rectangle (Allocation.X + (int)Owner.LogoImage.Width, Allocation.Y, Allocation.Width - (int)Owner.LogoImage.Width, (int)Owner.TopBorderImage.Height); //if (evnt.Region.RectIn (bgRect) != OverlapType.Out) - // for (int x = bgRect.X; x < bgRect.Right; x += (int)Owner.TopBorderImage.Width) - // context.DrawImage (this, Owner.TopBorderImage.WithSize (Owner.TopBorderImage.Width, bgRect.Height), x, Allocation.Y); + for (int x = bgRect.X; x < bgRect.Right; x += (int)Owner.TopBorderImage.Width) + context.DrawImage (this, Owner.TopBorderImage.WithSize (Owner.TopBorderImage.Width, bgRect.Height), x, Allocation.Y); } } From 898d1282f5a8042130f47f13108f2a0eadad0bfb Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 9 Apr 2024 19:58:58 +0200 Subject: [PATCH 361/382] update --- .../Mono.TextEditor/Gui/TextViewMargin.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs index 4f318eff6a5..48aa848f017 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs @@ -37,6 +37,7 @@ using Gdk; using Gtk; +using Cairo; using System.Timers; using System.Diagnostics; using MonoDevelop.Components; @@ -178,7 +179,7 @@ string GetContents () return Margin.Document.Text; } - Rectangle GetFrameForRange (AtkCocoa.Range range) + Gdk.Rectangle GetFrameForRange (AtkCocoa.Range range) { //ISyntaxHighlighting mode = Margin.Document.SyntaxMode != null && Margin.textEditor.Options.EnableSyntaxHighlighting ? Margin.Document.SyntaxMode : new SyntaxHighlighting(Margin.Document); @@ -203,7 +204,7 @@ Rectangle GetFrameForRange (AtkCocoa.Range range) rectangleHeight = yEnd - y; // FIXME: Need to take scroll offset into consideration - return new Rectangle ((int)((xPos / Pango.Scale.PangoScale) + Margin.XOffset), (int)y, (int)rectangleWidth, (int)rectangleHeight); + return new Gdk.Rectangle ((int)((xPos / Pango.Scale.PangoScale) + Margin.XOffset), (int)y, (int)rectangleWidth, (int)rectangleHeight); } int GetLineForIndex (int index) @@ -817,7 +818,7 @@ void SetVisibleCaretPosition (double x, double y, double nonPreeditX, double non GtkWorkarounds.SetImCursorLocation ( textEditor.IMContext, textEditor.GdkWindow, - new Rectangle ((int)nonPreeditX, (int)nonPreeditY, 0, (int)(LineHeight - 1))); + new Gdk.Rectangle ((int)nonPreeditX, (int)nonPreeditY, 0, (int)(LineHeight - 1))); } public static Gdk.Rectangle EmptyRectangle = new Gdk.Rectangle (0, 0, 0, 0); @@ -2271,14 +2272,14 @@ void DrawEolMarker (Cairo.Context cr, DocumentLine line, bool selected, double x cr.Restore (); } - static internal ulong GetPixel (Color color) + static internal ulong GetPixel (Gdk.Color color) { return (((ulong)color.Red) << 32) | (((ulong)color.Green) << 16) | ((ulong)color.Blue); } static internal ulong GetPixel (HslColor color) { - return GetPixel ((Color)color); + return GetPixel ((Gdk.Color)color); } static internal ulong GetPixel (Cairo.Color color) @@ -2573,7 +2574,7 @@ internal void OpenCodeSegmentEditor () uint codeSegmentTooltipTimeoutId = 0; - internal void ShowCodeSegmentPreviewTooltip (ISegment segment, Rectangle hintRectangle, uint timeout = 650) + internal void ShowCodeSegmentPreviewTooltip (ISegment segment, Gdk.Rectangle hintRectangle, uint timeout = 650) { if (previewWindow != null && previewWindow.Segment.Equals (segment)) return; @@ -2963,8 +2964,8 @@ public void DrawRectangleWithRuler (Cairo.Context cr, double x, Cairo.Rectangle var pixelWidth = width / Pango.Scale.PangoScale + foldXMargin * 2; - var foldingRectangle = new Rectangle ((int)xPos, y, (int)pixelWidth, (int)LineHeight - 1); - yield return new KeyValuePair (foldingRectangle, folding); + var foldingRectangle = new Gdk.Rectangle ((int)xPos, y, (int)pixelWidth, (int)LineHeight - 1); + yield return new KeyValuePair (foldingRectangle, folding); xPos += pixelWidth; if (folding.GetEndLine (textEditor.Document) != line) { line = folding.GetEndLine (textEditor.Document); From 6ce89292eef38d02f7bd6bd83e9cad3c7bcfa50d Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 9 Apr 2024 20:11:37 +0200 Subject: [PATCH 362/382] update --- .../Mono.TextEditor/Gui/TextViewMargin.cs | 134 +++++++++--------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs index 48aa848f017..1fb326762b0 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs @@ -849,78 +849,78 @@ char GetCaretChar () public void DrawCaret (Gdk.Window win, Gdk.Rectangle rect) { -// if (!this.textEditor.IsInDrag && !(this.caretX >= 0 && (!this.textEditor.IsSomethingSelected || this.textEditor.SelectionRange.Length == 0))) -// return; -// if (win == null || Settings.Default.CursorBlink && !Caret.IsVisible || !caretBlink) -// return; -// using (Cairo.Context cr = Gdk.CairoHelper.Create (win)) { -// cr.Rectangle (XOffset, 0, textEditor.Allocation.Width - XOffset, textEditor.Allocation.Height); -// cr.Clip (); -// cr.LineWidth = System.Math.Max (1, System.Math.Floor (textEditor.Options.Zoom)); -// cr.Antialias = Cairo.Antialias.None; -// var curRect = new Gdk.Rectangle ((int)caretX, (int)caretY, (int)this.charWidth, (int)LineHeight - 1); -// if (curRect != caretRectangle) { -// caretRectangle = curRect; + if (!this.textEditor.IsInDrag && !(this.caretX >= 0 && (!this.textEditor.IsSomethingSelected || this.textEditor.SelectionRange.Length == 0))) + return; + if (win == null || Settings.Default.CursorBlink && !Caret.IsVisible || !caretBlink) + return; + using (Cairo.Context cr = Gdk.CairoHelper.Create (win)) { + cr.Rectangle (XOffset, 0, textEditor.Allocation.Width - XOffset, textEditor.Allocation.Height); + cr.Clip (); + cr.LineWidth = System.Math.Max (1, System.Math.Floor (textEditor.Options.Zoom)); + cr.Antialias = Cairo.Antialias.None; + var curRect = new Gdk.Rectangle ((int)caretX, (int)caretY, (int)this.charWidth, (int)LineHeight - 1); + if (curRect != caretRectangle) { + caretRectangle = curRect; // textEditor.TextArea.QueueDrawArea (caretRectangle.X - (int)textEditor.Options.Zoom, // (int)(caretRectangle.Y + (-textEditor.VAdjustment.Value + caretVAdjustmentValue)), // caretRectangle.Width + (int)textEditor.Options.Zoom, // caretRectangle.Height + 1); -// caretVAdjustmentValue = textEditor.VAdjustment.Value; -// } -// -// var fgColor = SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.Foreground); + caretVAdjustmentValue = textEditor.VAdjustment.Value; + } + + var fgColor = SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.Foreground); // var bgColor = textEditor.ColorStyle.Default.CairoBackgroundColor; -// var line = Document.GetLine (Caret.Line); -// if (line != null) { -// foreach (var marker in Document.GetMarkers (line)) { -// var style = marker as StyleTextLineMarker; -// if (style == null) -// continue; -// // if (style.IncludedStyles.HasFlag (StyleTextLineMarker.StyleFlag.BackgroundColor)) -// // bgColor = style.BackgroundColor; -// if (style.IncludedStyles.HasFlag (StyleTextLineMarker.StyleFlag.Color)) -// fgColor = style.Color; -// } -// } -// /* -// var foreground = ((HslColor)fgColor).ToPixel (); -// var background = ((HslColor)color).ToPixel (); -// var caretColor = (foreground ^ background) & 0xFFFFFF; -// color = HslColor.FromPixel (caretColor);*/ -// var color = fgColor; -// -// switch (Caret.Mode) { -// case CaretMode.Insert: -// cr.DrawLine (color, -// caretRectangle.X + 0.5, -// caretRectangle.Y + 0.5, -// caretRectangle.X + 0.5, -// caretRectangle.Y + caretRectangle.Height); -// break; -// case CaretMode.Block: -// cr.SetSourceColor (color); -// cr.Rectangle (caretRectangle.X + 0.5, caretRectangle.Y + 0.5, caretRectangle.Width, caretRectangle.Height); -// cr.Fill (); -// char caretChar = GetCaretChar (); -// if (!char.IsWhiteSpace (caretChar) && caretChar != '\0') { -// using (var layout = textEditor.LayoutCache.RequestLayout ()) { -// layout.FontDescription = textEditor.Options.Font; -// layout.SetText (caretChar.ToString ()); -// cr.MoveTo (caretRectangle.X, caretRectangle.Y); -// cr.SetSourceColor (SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.Background)); -// cr.ShowLayout (layout); -// } -// } -// break; -// case CaretMode.Underscore: -// cr.DrawLine (color, -// caretRectangle.X + 0.5, -// caretRectangle.Y + caretRectangle.Height + 0.5, -// caretRectangle.X + caretRectangle.Width, -// caretRectangle.Y + caretRectangle.Height + 0.5); -// break; -// } -// } + var line = Document.GetLine (Caret.Line); + if (line != null) { + foreach (var marker in Document.GetMarkers (line)) { + var style = marker as StyleTextLineMarker; + if (style == null) + continue; + // if (style.IncludedStyles.HasFlag (StyleTextLineMarker.StyleFlag.BackgroundColor)) + // bgColor = style.BackgroundColor; + if (style.IncludedStyles.HasFlag (StyleTextLineMarker.StyleFlag.Color)) + fgColor = style.Color; + } + } + /* + var foreground = ((HslColor)fgColor).ToPixel (); + var background = ((HslColor)color).ToPixel (); + var caretColor = (foreground ^ background) & 0xFFFFFF; + color = HslColor.FromPixel (caretColor);*/ + var color = fgColor; + + switch (Caret.Mode) { + case CaretMode.Insert: + cr.DrawLine (color, + caretRectangle.X + 0.5, + caretRectangle.Y + 0.5, + caretRectangle.X + 0.5, + caretRectangle.Y + caretRectangle.Height); + break; + case CaretMode.Block: + cr.SetSourceColor (color); + cr.Rectangle (caretRectangle.X + 0.5, caretRectangle.Y + 0.5, caretRectangle.Width, caretRectangle.Height); + cr.Fill (); + char caretChar = GetCaretChar (); + if (!char.IsWhiteSpace (caretChar) && caretChar != '\0') { + using (var layout = textEditor.LayoutCache.RequestLayout ()) { + layout.FontDescription = textEditor.Options.Font; + layout.SetText (caretChar.ToString ()); + cr.MoveTo (caretRectangle.X, caretRectangle.Y); + cr.SetSourceColor (SyntaxHighlightingService.GetColor (textEditor.EditorTheme, EditorThemeColors.Background)); + cr.ShowLayout (layout); + } + } + break; + case CaretMode.Underscore: + cr.DrawLine (color, + caretRectangle.X + 0.5, + caretRectangle.Y + caretRectangle.Height + 0.5, + caretRectangle.X + caretRectangle.Width, + caretRectangle.Y + caretRectangle.Height + 0.5); + break; + } + } } void GetSelectionOffsets (DocumentLine line, out int selectionStart, out int selectionEnd) From 206cee905dc109bf01ac8499d447820a10b8ef4c Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Tue, 9 Apr 2024 22:56:20 +0200 Subject: [PATCH 363/382] update --- .../BounceFadePopupWindow.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs index 5873275cd85..41d30bba364 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs @@ -88,7 +88,7 @@ public BounceFadePopupWindow (MonoTextEditor editor) : base (Gtk.WindowType.Popu int x, y; protected int width, height; double vValue, hValue; -// protected Rectangle bounds; + protected Gdk.Rectangle bounds; public virtual void Popup () { @@ -97,13 +97,13 @@ public virtual void Popup () return; } editor.GdkWindow.GetOrigin (out x, out y); -// bounds = CalculateInitialBounds (); -// x = x + bounds.X - (int)(ExpandWidth / 2); -// y = y + bounds.Y - (int)(ExpandHeight / 2); + bounds = CalculateInitialBounds (); + x = x + bounds.X - (int)(ExpandWidth / 2); + y = y + bounds.Y - (int)(ExpandHeight / 2); Move (x, y); -// width = System.Math.Max (1, bounds.Width + (int)ExpandWidth); -// height = System.Math.Max (1, bounds.Height + (int)ExpandHeight); + width = System.Math.Max (1, bounds.Width + (int)ExpandWidth); + height = System.Math.Max (1, bounds.Height + (int)ExpandHeight); Resize (width, height); @@ -216,7 +216,7 @@ internal virtual void StopPlaying () } } -// protected abstract Rectangle CalculateInitialBounds (); + protected abstract Gdk.Rectangle CalculateInitialBounds (); From e9894cbf481d5efb443bea62aa4d8f8df8cd97a4 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 10 Apr 2024 00:58:52 +0200 Subject: [PATCH 364/382] update --- .../SmartScrolledWindow.cs | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs index 9529e452596..b6456d85623 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/SmartScrolledWindow.cs @@ -185,34 +185,34 @@ protected override void OnRemoved (Widget widget) } base.OnRemoved (widget); } -// protected override void OnSizeAllocated (Rectangle allocation) -// { -// base.OnSizeAllocated (allocation); -// -// int margin = BorderVisible ? 1 : 0; -// int vwidth = vScrollBar.Visible ? vScrollBar.Requisition.Width : 0; -// int hheight = hScrollBar.Visible ? hScrollBar.Requisition.Height : 0; -// var childRectangle = new Rectangle (allocation.X + margin, allocation.Y + margin, allocation.Width - vwidth - margin*2, allocation.Height - hheight - margin*2); -// -// if (Child != null) -// Child.SizeAllocate (childRectangle); -// if (vScrollBar.Visible) { -// int vChildTopHeight = -1; -// foreach (var child in children.Where (child => child.ChildPosition == ChildPosition.Top)) { -// child.Child.SizeAllocate (new Rectangle (childRectangle.RightInside (), childRectangle.Y + vChildTopHeight, allocation.Width - vwidth, child.Child.Requisition.Height)); -// vChildTopHeight += child.Child.Requisition.Height; -// } -// int v = vScrollBar is Scrollbar && hScrollBar.Visible ? hScrollBar.Requisition.Height : 0; -// vScrollBar.SizeAllocate (new Rectangle (childRectangle.X + childRectangle.Width + margin, childRectangle.Y + vChildTopHeight, vwidth, Allocation.Height - v - vChildTopHeight - margin)); -// vAdjustment.Value = System.Math.Max (System.Math.Min (vAdjustment.Upper - vAdjustment.PageSize, vAdjustment.Value), vAdjustment.Lower); -// } -// -// if (hScrollBar.Visible) { -// int v = vScrollBar.Visible ? vScrollBar.Requisition.Width : 0; -// hScrollBar.SizeAllocate (new Rectangle (allocation.X, childRectangle.Y + childRectangle.Height + margin, allocation.Width - v, hheight)); -// hScrollBar.Value = System.Math.Max (System.Math.Min (hAdjustment.Upper - hAdjustment.PageSize, hScrollBar.Value), hAdjustment.Lower); -// } -// } + protected override void OnSizeAllocated (Gdk.Rectangle allocation) + { + base.OnSizeAllocated (allocation); + + int margin = BorderVisible ? 1 : 0; + int vwidth = vScrollBar.Visible ? vScrollBar.ChildRequisition.Width : 0; + int hheight = hScrollBar.Visible ? hScrollBar.ChildRequisition.Height : 0; + var childRectangle = new Gdk.Rectangle (allocation.X + margin, allocation.Y + margin, allocation.Width - vwidth - margin*2, allocation.Height - hheight - margin*2); + + if (Child != null) + Child.SizeAllocate (childRectangle); + if (vScrollBar.Visible) { + int vChildTopHeight = -1; + foreach (var child in children.Where (child => child.ChildPosition == ChildPosition.Top)) { + child.Child.SizeAllocate (new Gdk.Rectangle (childRectangle.RightInside (), childRectangle.Y + vChildTopHeight, allocation.Width - vwidth, child.Child.ChildRequisition.Height)); + vChildTopHeight += child.Child.ChildRequisition.Height; + } + int v = vScrollBar is Scrollbar && hScrollBar.Visible ? hScrollBar.ChildRequisition.Height : 0; + vScrollBar.SizeAllocate (new Gdk.Rectangle (childRectangle.X + childRectangle.Width + margin, childRectangle.Y + vChildTopHeight, vwidth, Allocation.Height - v - vChildTopHeight - margin)); + vAdjustment.Value = System.Math.Max (System.Math.Min (vAdjustment.Upper - vAdjustment.PageSize, vAdjustment.Value), vAdjustment.Lower); + } + + if (hScrollBar.Visible) { + int v = vScrollBar.Visible ? vScrollBar.ChildRequisition.Width : 0; + hScrollBar.SizeAllocate (new Gdk.Rectangle (allocation.X, childRectangle.Y + childRectangle.Height + margin, allocation.Width - v, hheight)); + hScrollBar.Value = System.Math.Max (System.Math.Min (hAdjustment.Upper - hAdjustment.PageSize, hScrollBar.Value), hAdjustment.Lower); + } + } static double Clamp (double min, double val, double max) { From 0c0d6dd72596d57e1faaa9d0f0a36061d7a95c76 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 10 Apr 2024 18:49:07 +0200 Subject: [PATCH 365/382] update --- .../BlameWidget.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs index 00b705e3c1f..ab224907ae1 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs @@ -261,23 +261,23 @@ protected override void OnDestroyed () protected override void OnSizeAllocated (Gdk.Rectangle allocation) { base.OnSizeAllocated (allocation); - //int vwidth = vScrollBar.Visible ? vScrollBar.Requisition.Width : 0; - //int hheight = hScrollBar.Visible ? hScrollBar.Requisition.Height : 0; - //Rectangle childRectangle = new Rectangle (allocation.X + 1, allocation.Y + 1, allocation.Width - vwidth - 1, allocation.Height - hheight - 1); + int vwidth = vScrollBar.Visible ? vScrollBar.ChildRequisition.Width : 0; + int hheight = hScrollBar.Visible ? hScrollBar.ChildRequisition.Height : 0; + Gdk.Rectangle childRectangle = new Gdk.Rectangle (allocation.X + 1, allocation.Y + 1, allocation.Width - vwidth - 1, allocation.Height - hheight - 1); if (vScrollBar.Visible) { - //int right = childRectangle.Right; + int right = childRectangle.Right; int vChildTopHeight = -1; - //int v = hScrollBar.Visible ? hScrollBar.Requisition.Height : 0; - //vScrollBar.SizeAllocate (new Rectangle (right, childRectangle.Y + vChildTopHeight, vwidth, Allocation.Height - v - vChildTopHeight - 1)); + int v = hScrollBar.Visible ? hScrollBar.ChildRequisition.Height : 0; + vScrollBar.SizeAllocate (new Gdk.Rectangle (right, childRectangle.Y + vChildTopHeight, vwidth, Allocation.Height - v - vChildTopHeight - 1)); vScrollBar.Value = System.Math.Max (System.Math.Min (vAdjustment.Upper - vAdjustment.PageSize, vScrollBar.Value), vAdjustment.Lower); } int overviewWidth = overview.WidthRequest; - //overview.SizeAllocate (new Rectangle (childRectangle.Right - overviewWidth, childRectangle.Top, overviewWidth, childRectangle.Height)); - //editor.SizeAllocate (new Rectangle (childRectangle.X, childRectangle.Top, childRectangle.Width - overviewWidth, childRectangle.Height)); + overview.SizeAllocate (new Gdk.Rectangle (childRectangle.Right - overviewWidth, childRectangle.Top, overviewWidth, childRectangle.Height)); + editor.SizeAllocate (new Gdk.Rectangle (childRectangle.X, childRectangle.Top, childRectangle.Width - overviewWidth, childRectangle.Height)); if (hScrollBar.Visible) { - //hScrollBar.SizeAllocate (new Rectangle (childRectangle.X, childRectangle.Y + childRectangle.Height, childRectangle.Width, hheight)); + hScrollBar.SizeAllocate (new Gdk.Rectangle (childRectangle.X, childRectangle.Y + childRectangle.Height, childRectangle.Width, hheight)); hScrollBar.Value = System.Math.Max (System.Math.Min (hAdjustment.Upper - hAdjustment.PageSize, hScrollBar.Value), hAdjustment.Lower); } } From 87a70b81529b3a1b8e047bdd45748ca67d31786f Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Wed, 10 Apr 2024 18:58:56 +0200 Subject: [PATCH 366/382] update --- .../BlameWidget.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs index ab224907ae1..834ce52641a 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs @@ -297,11 +297,19 @@ protected override bool OnScrollEvent (EventScroll evnt) return (dx != 0.0 || dy != 0.0) || base.OnScrollEvent (evnt); } - // protected override void OnSizeRequested (ref Gtk.Requisition requisition) - // { - // base.OnSizeRequested (ref requisition); - // children.ForEach (child => child.Child.SizeRequest ()); - // } + protected override void OnGetPreferredWidth (out int minimum_width, out int natural_width) + { + base.OnGetPreferredWidth (out minimum_width, out natural_width); + + children.ForEach (child => child.Child.SizeRequest ()); + } + + protected override void OnGetPreferredHeight (out int minimum_height, out int natural_height) + { + base.OnGetPreferredHeight (out minimum_height, out natural_height); + + children.ForEach (child => child.Child.SizeRequest ()); + } void HandleEditorExposeEvent (object o, PaintEventArgs args) { From 3051659efa92107a2536a7faa9fff23397befcf2 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 11 Apr 2024 20:51:22 +0200 Subject: [PATCH 367/382] update --- .../DiffRendererWidget.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffRendererWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffRendererWidget.cs index 79ee62826f0..32910bcf663 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffRendererWidget.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffRendererWidget.cs @@ -120,6 +120,18 @@ public void InitCell () QueueResize (); } + protected override void OnGetPreferredWidth (out int minimum_width, out int natural_width) + { + base.OnGetPreferredWidth (out minimum_width, out natural_width); + minimum_width = natural_width; + } + + protected override void OnGetPreferredHeight (out int minimum_height, out int natural_height) + { + base.OnGetPreferredHeight (out minimum_height, out natural_height); + minimum_height = natural_height; + + } // protected override void OnSizeRequested (ref Requisition requisition) // { // base.OnSizeRequested (ref requisition); From 38540134114c38edc6f10ac98f9a7df49162aa96 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 11 Apr 2024 23:13:15 +0200 Subject: [PATCH 368/382] update --- .../Mono.TextEditor.PopupWindow/ListWidget.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs index 188cf01f55b..7fd22957156 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs @@ -193,7 +193,7 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) protected override bool OnDrawn (Cairo.Context args) { base.OnDrawn (args); - //DrawList (args); + DrawList (args); return true; } From 776eb4908499546bba72691c393dace42e5a8439 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Thu, 11 Apr 2024 23:36:00 +0200 Subject: [PATCH 369/382] update --- .../MonoDevelop.Components/HeaderBox.cs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs index a96825214c5..a0fe68f00a6 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs @@ -212,7 +212,7 @@ protected override bool OnDrawn (Cairo.Context evnt) // var borderColor = new Gdk.GC (GdkWindow); // borderColor.RgbFgColor = BorderColor != null ? BorderColor.Value : Style.Dark (Gtk.StateType.Normal); - // rect = Allocation; + rect = Allocation; // for (int n=0; n Date: Fri, 12 Apr 2024 22:19:09 +0200 Subject: [PATCH 370/382] update --- main/src/core/MonoDevelop.Ide/Gui/generated.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/Gui/generated.cs b/main/src/core/MonoDevelop.Ide/Gui/generated.cs index 70568068855..3ff959b9283 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/generated.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/generated.cs @@ -24,7 +24,7 @@ public static BinContainer Attach (Gtk.Bin bin) { BinContainer bc = new BinContainer (); // bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested); -// bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated); + bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated); bin.Added += new Gtk.AddedHandler (bc.OnAdded); return bc; } @@ -36,12 +36,12 @@ public static BinContainer Attach (Gtk.Bin bin) // } // } -// private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args) -// { + private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args) + { // if ((this.child != null)) { // this.child.Allocation = args.Allocation; // } -// } + } private void OnAdded (object sender, Gtk.AddedArgs args) { From 65942d44f48914f34b2600a9f28a17471a11afd9 Mon Sep 17 00:00:00 2001 From: MakiWolf <73300633+MakiWolf@users.noreply.github.com> Date: Sat, 20 Apr 2024 00:00:35 +0200 Subject: [PATCH 371/382] update --- .../MonoDevelop.CSharp.Formatting/OnTheFlyFormattingPanel.cs | 4 ++-- .../GeneralOptionsPanel.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormattingPanel.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormattingPanel.cs index 527e4077168..11169195cad 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormattingPanel.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormattingPanel.cs @@ -49,8 +49,8 @@ public override void ApplyChanges () public override Control CreatePanelWidget () { widget = new OnTheFlyFormattingPanelWidget (); - if (Xwt.Toolkit.CurrentEngine.Type != Xwt.ToolkitType.Gtk) { - LoggingService.LogError ("OnTheFlyFormattingPanel: Xwt.Toolkit.CurrentEngine.Type != Xwt.ToolkitType.Gtk - currently unsupported"); + if (Xwt.Toolkit.CurrentEngine.Type != Xwt.ToolkitType.Gtk3) { + LoggingService.LogError ("OnTheFlyFormattingPanel: Xwt.Toolkit.CurrentEngine.Type != Xwt.ToolkitType.Gtk3 - currently unsupported"); return null; } return (Gtk.Widget)Xwt.Toolkit.CurrentEngine.GetNativeWidget (widget); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs index f3ebab45795..82ae1143307 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs @@ -64,10 +64,10 @@ public GeneralOptionsPanel() wordWrapVisualGlyphsCheckBox.Toggled += HandleNewEditorOptionToggled; newEditorOptionsBox.PackStart (wordWrapVisualGlyphsCheckBox); - if (Xwt.Toolkit.CurrentEngine.Type == Xwt.ToolkitType.Gtk) + if (Xwt.Toolkit.CurrentEngine.Type == Xwt.ToolkitType.Gtk3) vbox4.PackStart ((Gtk.Widget)Xwt.Toolkit.CurrentEngine.GetNativeWidget (newEditorOptionsBox), false, false, 0); else - LoggingService.LogError ("GeneralOptionsPanel: Xwt.Toolkit.CurrentEngine.Type != Xwt.ToolkitType.Gtk - currently unsupported"); + LoggingService.LogError ("GeneralOptionsPanel: Xwt.Toolkit.CurrentEngine.Type != Xwt.ToolkitType.Gtk3 - currently unsupported"); HandleNewEditorOptionToggled (this, EventArgs.Empty); From 6253db56d7d8fd5a67f45c7e3ba6b69581479fae Mon Sep 17 00:00:00 2001 From: makiwolf Date: Mon, 6 May 2024 23:39:04 +0200 Subject: [PATCH 372/382] update --- .../fsharpbinding/MonoDevelop.FSharp.Gui/generated.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/generated.cs b/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/generated.cs index 7e2c3a06b06..ceeb902d5fb 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/generated.cs +++ b/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/generated.cs @@ -25,7 +25,7 @@ public static BinContainer Attach(Gtk.Bin bin) { BinContainer bc = new BinContainer(); // bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested); -// bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated); + bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated); bin.Added += new Gtk.AddedHandler(bc.OnAdded); return bc; } @@ -38,13 +38,13 @@ public static BinContainer Attach(Gtk.Bin bin) // } // } -// private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args) -// { + private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args) + { // if ((this.child != null)) // { // this.child.Allocation = args.Allocation; // } -// } + } private void OnAdded(object sender, Gtk.AddedArgs args) { From 89f327362266ae546af69e1834949aa1effd7621 Mon Sep 17 00:00:00 2001 From: makiwolf Date: Wed, 12 Feb 2025 18:58:35 +0100 Subject: [PATCH 373/382] update --- .../CellRendererImage.cs | 102 ++++++++-------- .../LanguageCellRenderer.cs | 109 +++++++++--------- 2 files changed, 106 insertions(+), 105 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs index 900ddacab2d..1034784a985 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs @@ -130,43 +130,43 @@ public virtual Image ImageExpanderClosed { bool? ignoreSelection; - // protected override void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags) - // { - // // In light theme: - // // On the Mac, the default unfocused selection background is lighter, so the icon should be black - // // but our `sel` icons are white. - // // - // // Except in the solution treeview, because the Mac's default unfocused selection background is too light for the - // // custom treeview background - // if (!ignoreSelection.HasValue) { - // if (Platform.IsMac) { - // if (IdeTheme.UserInterfaceTheme == Theme.Light) { - // var baseColor = widget.Style.Base (widget.State).ToXwtColor (); - // ignoreSelection = baseColor.Brightness == 1; - // } else { - // ignoreSelection = false; - // } - // } else { - // ignoreSelection = false; - // } - // } - - // var img = GetImage (); - // if (img == null) - // return; - - // var shouldIgnoreSelection = ignoreSelection.GetValueOrDefault () && !widget.HasFocus; - // if (!shouldIgnoreSelection && ((flags & Gtk.CellRendererState.Selected) != 0)) - // img = img.WithStyles ("sel"); - // if (!img.HasFixedSize) - // img = img.WithSize (Gtk.IconSize.Menu); + protected override void OnRender (Cairo.Context ctx, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gtk.CellRendererState flags) + { + // In light theme: + // On the Mac, the default unfocused selection background is lighter, so the icon should be black + // but our `sel` icons are white. + // + // Except in the solution treeview, because the Mac's default unfocused selection background is too light for the + // custom treeview background + if (!ignoreSelection.HasValue) { + //if (Platform.IsMac) { + //if (IdeTheme.UserInterfaceTheme == Theme.Light) { + //var baseColor = widget.Style.Base (widget.State).ToXwtColor (); + //ignoreSelection = baseColor.Brightness == 1; + //} else { + //ignoreSelection = false; + //} + //} else { + ignoreSelection = false; + //} + } + + var img = GetImage (); + if (img == null) + return; + + var shouldIgnoreSelection = ignoreSelection.GetValueOrDefault () && !widget.HasFocus; + if (!shouldIgnoreSelection && ((flags & Gtk.CellRendererState.Selected) != 0)) + img = img.WithStyles ("sel"); + if (!img.HasFixedSize) + img = img.WithSize (Gtk.IconSize.Menu); // using (var ctx = Gdk.CairoHelper.Create (window)) { - // var x = cell_area.X + cell_area.Width / 2 - (int)(img.Width / 2); - // var y = cell_area.Y + cell_area.Height / 2 - (int)(img.Height / 2); - // ctx.DrawImage (widget, img, x, y); + var x = cell_area.X + cell_area.Width / 2 - (int)(img.Width / 2); + var y = cell_area.Y + cell_area.Height / 2 - (int)(img.Height / 2); + ctx.DrawImage (widget, img, x, y); // } - // } + } protected void GetImageInfo (Gdk.Rectangle cell_area, out Image img, out int x, out int y) { @@ -180,23 +180,23 @@ protected void GetImageInfo (Gdk.Rectangle cell_area, out Image img, out int x, } } -// public override void GetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) -// { -// var img = GetImage (); -// if (img != null) { -// if (img.HasFixedSize) { -// width = (int)img.Width; -// height = (int)img.Height; -// } else -// Gtk.IconSize.Menu.GetSize(out width, out height); -// } else -// width = height = 0; -// -// width += (int)Xpad * 2; -// height += (int)Ypad * 2; -// x_offset = (int)(cell_area.Width / 2 - (width / 2)); -// y_offset = (int)(cell_area.Height / 2 - (height / 2)); -// } + protected override void OnGetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + { + var img = GetImage (); + if (img != null) { + if (img.HasFixedSize) { + width = (int)img.Width; + height = (int)img.Height; + } else + Gtk.IconSize.Menu.GetSize(out width, out height); + } else + width = height = 0; + + width += (int)Xpad * 2; + height += (int)Ypad * 2; + x_offset = (int)(cell_area.Width / 2 - (width / 2)); + y_offset = (int)(cell_area.Height / 2 - (height / 2)); + } Image GetImage () { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs index 1ea9b54018a..95cf4071f96 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs @@ -27,6 +27,8 @@ using System.Linq; using Gdk; using Gtk; +using GLib; +using Pango; using Cairo; using MonoDevelop.Components; using MonoDevelop.Ide.Gui; @@ -100,21 +102,21 @@ public Gdk.Rectangle GetLanguageRect () return languageRect; } - // public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - // { - // base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); + protected override void OnGetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + { + base.OnGetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - // textWidth = GetTextWidth (widget); - // int languageRectangleWidth = textWidth + languageLeftHandPadding; - // if (TemplateHasMultipleLanguages ()) { - // languageRectangleWidth += languageRightHandPadding + dropdownTriangleWidth + dropdownTriangleRightHandPadding; - // } else { - // languageRectangleWidth += languageRightHandPadding; - // languageRectangleWidth = Math.Max (languageRectangleWidth, minLanguageRectWidth); - // } + textWidth = GetTextWidth (widget); + int languageRectangleWidth = textWidth + languageLeftHandPadding; + if (TemplateHasMultipleLanguages ()) { + languageRectangleWidth += languageRightHandPadding + dropdownTriangleWidth + dropdownTriangleRightHandPadding; + } else { + languageRectangleWidth += languageRightHandPadding; + languageRectangleWidth = Math.Max (languageRectangleWidth, minLanguageRectWidth); + } - // width = languageRectangleWidth + rightHandCellPadding; - // } + width = languageRectangleWidth + rightHandCellPadding; + } int GetTextWidth (Widget widget) { @@ -137,48 +139,47 @@ int GetTextWidth (Widget widget) } } -// protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) -// { -// if (Template == null) { -// return; -// } -// -// if (!RenderRecentTemplate && (!Template.AvailableLanguages.Any () || !IsTemplateRowSelected (widget, flags))) { -// return; -// } -// + protected override void OnRender (Cairo.Context ctx, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, /*Gdk.Rectangle expose_area,*/ CellRendererState flags) + { + if (Template == null) { + return; + } + + if (!RenderRecentTemplate && (!Template.AvailableLanguages.Any () || !IsTemplateRowSelected (widget, flags))) { + return; + } // using (var ctx = CairoHelper.Create (window)) { -// using (var layout = new Pango.Layout (widget.PangoContext)) { -// int textHeight = 0; -// -// SetMarkup (layout, GetSelectedLanguage ()); -// layout.GetPixelSize (out textWidth, out textHeight); -// -// languageRect = GetLanguageButtonRectangle (window, widget, cell_area, textHeight, textWidth); -// -// StateType state = StateType.Normal; -// if (!RenderRecentTemplate) { -// RoundBorder (ctx, languageRect.X, languageRect.Y, languageRect.Width, languageRect.Height); -// SetSourceColor (ctx, Styles.NewProjectDialog.TemplateLanguageButtonBackground.ToCairoColor ()); -// ctx.Fill (); -// } else { -// state = GetState (widget, flags); -// } -// -// int tw = TemplateHasMultipleLanguages () ? textWidth + dropdownTriangleWidth + 2 : textWidth; -// int languageTextX = languageRect.X + ((languageRect.Width - tw) / 2); -// int languageTextY = languageRect.Y + (languageRect.Height - textHeight) / 2; -// -// window.DrawLayout (widget.Style.TextGC (state), languageTextX, languageTextY, layout); -// -// if (TemplateHasMultipleLanguages ()) { -// int triangleX = languageTextX + textWidth + languageRightHandPadding; -// int triangleY = languageRect.Y + (languageRect.Height - dropdownTriangleHeight) / 2; -// DrawTriangle (ctx, triangleX, triangleY); -// } -// } + using (var layout = new Pango.Layout (widget.PangoContext)) { + int textHeight = 0; + + SetMarkup (layout, GetSelectedLanguage ()); + layout.GetPixelSize (out textWidth, out textHeight); + + languageRect = GetLanguageButtonRectangle (ctx, widget, cell_area, textHeight, textWidth); + + StateType state = StateType.Normal; + if (!RenderRecentTemplate) { + RoundBorder (ctx, languageRect.X, languageRect.Y, languageRect.Width, languageRect.Height); + SetSourceColor (ctx, Styles.NewProjectDialog.TemplateLanguageButtonBackground.ToCairoColor ()); + ctx.Fill (); + } else { + state = GetState (widget, flags); + } + + int tw = TemplateHasMultipleLanguages () ? textWidth + dropdownTriangleWidth + 2 : textWidth; + int languageTextX = languageRect.X + ((languageRect.Width - tw) / 2); + int languageTextY = languageRect.Y + (languageRect.Height - textHeight) / 2; + + //ctx.DrawLayout (widget.Style.TextGC (state), languageTextX, languageTextY, layout); + + if (TemplateHasMultipleLanguages ()) { + int triangleX = languageTextX + textWidth + languageRightHandPadding; + int triangleY = languageRect.Y + (languageRect.Height - dropdownTriangleHeight) / 2; + DrawTriangle (ctx, triangleX, triangleY); + } + } // } -// } + } void DrawTriangle (Cairo.Context ctx, int x, int y) { @@ -193,7 +194,7 @@ void DrawTriangle (Cairo.Context ctx, int x, int y) ctx.Fill (); } - Gdk.Rectangle GetLanguageButtonRectangle (/*Drawable window, */Widget widget, Gdk.Rectangle cell_area, int textHeight, int textWidth) + Gdk.Rectangle GetLanguageButtonRectangle (Cairo.Context window, Widget widget, Gdk.Rectangle cell_area, int textHeight, int textWidth) { int languageRectangleHeight = cell_area.Height - 8; int languageRectangleWidth = textWidth + languageLeftHandPadding; From dff5f9bbad31bfba982c6e095d2bd96cd5ed3273 Mon Sep 17 00:00:00 2001 From: makiwolf Date: Wed, 12 Feb 2025 19:00:48 +0100 Subject: [PATCH 374/382] restore --- .../MonoDevelop.Components/CellRendererImage.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs index 1034784a985..249692f55dc 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs @@ -149,6 +149,9 @@ protected override void OnRender (Cairo.Context ctx, Gtk.Widget widget, Gdk.Rect //} else { ignoreSelection = false; //} + //} else { + // ignoreSelection = false; + //} } var img = GetImage (); From 16e3707286ecee8bebeb2d8743be97481c95c504 Mon Sep 17 00:00:00 2001 From: makiwolf Date: Tue, 18 Feb 2025 23:45:57 +0100 Subject: [PATCH 375/382] update --- .../MonoDevelop.Ide.Projects/LanguageCellRenderer.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs index 95cf4071f96..76055aad6de 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/LanguageCellRenderer.cs @@ -160,7 +160,7 @@ protected override void OnRender (Cairo.Context ctx, Widget widget, Gdk.Rectangl StateType state = StateType.Normal; if (!RenderRecentTemplate) { RoundBorder (ctx, languageRect.X, languageRect.Y, languageRect.Width, languageRect.Height); - SetSourceColor (ctx, Styles.NewProjectDialog.TemplateLanguageButtonBackground.ToCairoColor ()); + SetSourceColor (ctx, new Cairo.Color (15, 69, 19, 1.0)); ctx.Fill (); } else { state = GetState (widget, flags); @@ -169,8 +169,10 @@ protected override void OnRender (Cairo.Context ctx, Widget widget, Gdk.Rectangl int tw = TemplateHasMultipleLanguages () ? textWidth + dropdownTriangleWidth + 2 : textWidth; int languageTextX = languageRect.X + ((languageRect.Width - tw) / 2); int languageTextY = languageRect.Y + (languageRect.Height - textHeight) / 2; - //ctx.DrawLayout (widget.Style.TextGC (state), languageTextX, languageTextY, layout); + ctx.MoveTo(languageTextX, languageTextY); + ctx.SetSourceColor (new Cairo.Color (0.7, 0.8, 0.9, 0.9)); + Pango.CairoHelper.ShowLayout(ctx, layout); if (TemplateHasMultipleLanguages ()) { int triangleX = languageTextX + textWidth + languageRightHandPadding; @@ -186,7 +188,7 @@ void DrawTriangle (Cairo.Context ctx, int x, int y) int width = dropdownTriangleWidth; int height = dropdownTriangleHeight; - SetSourceColor (ctx, Styles.NewProjectDialog.TemplateLanguageButtonTriangle.ToCairoColor ()); + SetSourceColor (ctx, new Cairo.Color (0, 0, 0, 1.0)); ctx.MoveTo (x, y); ctx.LineTo (x + width, y); ctx.LineTo (x + (width / 2), y + height); From f0047cd6a54b885fc2e9b048dc43a4b43f4a4820 Mon Sep 17 00:00:00 2001 From: makiwolf Date: Fri, 21 Feb 2025 18:22:07 +0100 Subject: [PATCH 376/382] update --- .../AutoHideBox.cs | 19 ++--- .../DockContainer.cs | 6 +- .../DockGroup.cs | 12 +-- .../MainToolbar.cs | 1 + .../CellRendererComboBox.cs | 36 ++++----- .../ExtensibleTreeView.cs | 64 ++++++++-------- .../SelectReferenceDialog.cs | 73 ++++++++++--------- 7 files changed, 110 insertions(+), 101 deletions(-) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs index 84546c5cc7c..de4eaa26052 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs @@ -146,7 +146,7 @@ public AutoHideBox (DockFrame frame, DockItem item, Gtk.PositionType pos, int si sepBox.ButtonPressEvent += OnSizeButtonPress; sepBox.ButtonReleaseEvent += OnSizeButtonRelease; sepBox.MotionNotifyEvent += OnSizeMotion; -// sepBox.ExposeEvent += OnGripExpose; + sepBox.Drawn += OnGripExpose; sepBox.EnterNotifyEvent += delegate { insideGrip = true; sepBox.QueueDraw (); }; sepBox.LeaveNotifyEvent += delegate { insideGrip = false; sepBox.QueueDraw (); }; } @@ -358,16 +358,17 @@ void OnSizeMotion (object ob, Gtk.MotionNotifyEventArgs args) } } -// void OnGripExpose (object sender, Gtk.ExposeEventArgs args) -// { -// var w = (EventBox) sender; -// StateType s = insideGrip ? StateType.Prelight : StateType.Normal; -// + void OnGripExpose (object sender, Gtk.DrawnArgs args) + { + var w = (EventBox) sender; + StateFlags s = insideGrip ? StateFlags.Prelight : StateFlags.Normal; + // using (var ctx = CairoHelper.Create (args.Event.Window)) { -// ctx.SetSourceColor (w.Style.Background (s).ToCairoColor ()); -// ctx.Paint (); + var ctx = args.Cr; +// ctx.SetSourceColor (w.StyleContext.GetBackgroundColor(s).ToCairoColor ()); + ctx.Paint (); // } -// } + } } class ScrollableContainer: EventBox diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs index 793871fce86..3a4446c2bd7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs @@ -170,7 +170,7 @@ protected override void OnSizeAllocated (Gdk.Rectangle rect) layout.SizeAllocate (rect); usedSplitters = 0; - layout.DrawSeparators (Gdk.Rectangle.Zero, null, 0, DrawSeparatorOperation.Allocate, null); + layout.DrawSeparators (null, null, 0, DrawSeparatorOperation.Allocate, null); } int usedSplitters; @@ -211,9 +211,9 @@ protected override void ForAll (bool include_internals, Gtk.Callback callback) protected override bool OnDrawn (Context cr) { bool res = base.OnDrawn (cr); - var area = Allocation; + //var area = Allocation; if (layout != null) { - layout.Draw (area, null, 0); + layout.Draw (cr, null, 0); } return res; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs index 4727a51f77c..e20cf518816 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs @@ -843,7 +843,7 @@ internal override void GetMinSize (out int width, out int height) } } - public void Draw (Gdk.Rectangle exposedArea, DockGroup currentHandleGrp, int currentHandleIndex) + public void Draw (Cairo.Context exposedArea, DockGroup currentHandleGrp, int currentHandleIndex) { if (type != DockGroupType.Tabbed) { DrawSeparators (exposedArea, currentHandleGrp, currentHandleIndex, DrawSeparatorOperation.Draw, false, null); @@ -855,12 +855,12 @@ public void Draw (Gdk.Rectangle exposedArea, DockGroup currentHandleGrp, int cur } } - public void DrawSeparators (Gdk.Rectangle exposedArea, DockGroup currentHandleGrp, int currentHandleIndex, DrawSeparatorOperation oper, List areasList) + public void DrawSeparators (Cairo.Context cr, DockGroup currentHandleGrp, int currentHandleIndex, DrawSeparatorOperation oper, List areasList) { - DrawSeparators (exposedArea, currentHandleGrp, currentHandleIndex, oper, true, areasList); + DrawSeparators (cr, currentHandleGrp, currentHandleIndex, oper, true, areasList); } - void DrawSeparators (Gdk.Rectangle exposedArea, DockGroup currentHandleGrp, int currentHandleIndex, DrawSeparatorOperation oper, bool drawChildrenSep, List areasList) + void DrawSeparators (Cairo.Context cr, DockGroup currentHandleGrp, int currentHandleIndex, DrawSeparatorOperation oper, bool drawChildrenSep, List areasList) { if (type == DockGroupType.Tabbed || VisibleObjects.Count == 0) return; @@ -884,7 +884,7 @@ void DrawSeparators (Gdk.Rectangle exposedArea, DockGroup currentHandleGrp, int DockObject ob = VisibleObjects [n]; DockGroup grp = ob as DockGroup; if (grp != null && drawChildrenSep) - grp.DrawSeparators (exposedArea, currentHandleGrp, currentHandleIndex, oper, areasList); + grp.DrawSeparators (cr, currentHandleGrp, currentHandleIndex, oper, areasList); if (ob != last) { if (horiz) x += ob.Allocation.Width + Frame.HandlePadding; @@ -901,6 +901,8 @@ void DrawSeparators (Gdk.Rectangle exposedArea, DockGroup currentHandleGrp, int break; case DrawSeparatorOperation.Draw: // Frame.Container.GdkWindow.DrawRectangle (hgc, true, x, y, hw, hh); + cr.Rectangle(x, y, hw, hh); + cr.Fill(); break; case DrawSeparatorOperation.Allocate: Frame.Container.AllocateSplitter (this, n, new Gdk.Rectangle (x, y, hw, hh)); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs index 1b1ac352d91..a6f978b8392 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs @@ -381,6 +381,7 @@ public void AddWidget (Gtk.Widget widget) protected override bool OnDrawn (Cairo.Context evnt) { using (var context = Gdk.CairoHelper.Create (GdkWindow)) { + context.Rectangle(0, 0, AllocatedWidth, AllocatedHeight); //context.Rectangle ( // evnt.Area.X, // evnt.Area.Y, diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererComboBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererComboBox.cs index 3264b037fdf..f8213e92af3 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererComboBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererComboBox.cs @@ -51,25 +51,25 @@ public string[] Values { set { values = value; } } -// public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) -// { -// base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); -// if (height < rowHeight) -// height = rowHeight; -// } + protected override void OnGetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + { + base.OnGetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); + if (height < rowHeight) + height = rowHeight; + } -// public override ICellEditable StartEditing (Gdk.Event ev, Widget widget, string path, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, CellRendererState flags) -// { -// this.path = path; -// -// Gtk.ComboBox combo = Gtk.ComboBox.NewText (); -// foreach (string s in values) -// combo.AppendText (s); -// -// combo.Active = Array.IndexOf (values, Text); -// combo.Changed += new EventHandler (SelectionChanged); -// return new TreeViewCellContainer (combo); -// } + public ICellEditable StartEditing (Widget widget, Gdk.Event ev, string path, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, CellRendererState flags) + { + this.path = path; + + Gtk.ComboBoxText combo = new Gtk.ComboBoxText (); + foreach (string s in values) + combo.AppendText (s); + + combo.Active = Array.IndexOf (values, Text); + combo.Changed += new EventHandler (SelectionChanged); + return new TreeViewCellContainer (combo); + } void SelectionChanged (object s, EventArgs a) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs index ca37e999a8c..77700cfff8a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs @@ -2820,53 +2820,53 @@ Xwt.Drawing.Image GetResized (Xwt.Drawing.Image value) return resized; } - // public override void GetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - // { - // base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); + protected override void OnGetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + { + base.OnGetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); // /* if (overlayBottomLeft != null || overlayBottomRight != null) // height += overlayOverflow; // if (overlayTopLeft != null || overlayTopRight != null) // height += overlayOverflow; // if (overlayBottomRight != null || overlayTopRight != null) // width += overlayOverflow;*/ - // } + } const int overlayOverflow = 2; - // protected override void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags) - // { - // base.Render (window, widget, background_area, cell_area, expose_area, flags); + protected override void OnRender (Cairo.Context ctx, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gtk.CellRendererState flags) + { + base.OnRender (ctx, widget, background_area, cell_area, flags); - // if (overlayBottomLeft != null || overlayBottomRight != null || overlayTopLeft != null || overlayTopRight != null) { - // int x, y; - // Xwt.Drawing.Image image; - // GetImageInfo (cell_area, out image, out x, out y); + if (overlayBottomLeft != null || overlayBottomRight != null || overlayTopLeft != null || overlayTopRight != null) { + int x, y; + Xwt.Drawing.Image image; + GetImageInfo (cell_area, out image, out x, out y); - // if (image == null) - // return; + if (image == null) + return; - // bool selected = (flags & Gtk.CellRendererState.Selected) != 0; + bool selected = (flags & Gtk.CellRendererState.Selected) != 0; // using (var ctx = Gdk.CairoHelper.Create (window)) { - // if (overlayBottomLeft != null && overlayBottomLeft != NullImage) { - // var img = selected ? overlayBottomLeft.WithStyles ("sel") : overlayBottomLeft; - // ctx.DrawImage (widget, img, x - overlayOverflow, y + image.Height - img.Height + overlayOverflow); - // } - // if (overlayBottomRight != null && overlayBottomRight != NullImage) { - // var img = selected ? overlayBottomRight.WithStyles ("sel") : overlayBottomRight; - // ctx.DrawImage (widget, img, x + image.Width - img.Width + overlayOverflow, y + image.Height - img.Height + overlayOverflow); - // } - // if (overlayTopLeft != null && overlayTopLeft != NullImage) { - // var img = selected ? overlayTopLeft.WithStyles ("sel") : overlayTopLeft; - // ctx.DrawImage (widget, img, x - overlayOverflow, y - overlayOverflow); - // } - // if (overlayTopRight != null && overlayTopRight != NullImage) { - // var img = selected ? overlayTopRight.WithStyles ("sel") : overlayTopRight; - // ctx.DrawImage (widget, img, x + image.Width - img.Width + overlayOverflow, y - overlayOverflow); - // } - // } + if (overlayBottomLeft != null && overlayBottomLeft != NullImage) { + var img = selected ? overlayBottomLeft.WithStyles ("sel") : overlayBottomLeft; + ctx.DrawImage (widget, img, x - overlayOverflow, y + image.Height - img.Height + overlayOverflow); + } + if (overlayBottomRight != null && overlayBottomRight != NullImage) { + var img = selected ? overlayBottomRight.WithStyles ("sel") : overlayBottomRight; + ctx.DrawImage (widget, img, x + image.Width - img.Width + overlayOverflow, y + image.Height - img.Height + overlayOverflow); + } + if (overlayTopLeft != null && overlayTopLeft != NullImage) { + var img = selected ? overlayTopLeft.WithStyles ("sel") : overlayTopLeft; + ctx.DrawImage (widget, img, x - overlayOverflow, y - overlayOverflow); + } + if (overlayTopRight != null && overlayTopRight != NullImage) { + var img = selected ? overlayTopRight.WithStyles ("sel") : overlayTopRight; + ctx.DrawImage (widget, img, x + image.Width - img.Width + overlayOverflow, y - overlayOverflow); + } + } // } - // } + } } class NodeHashtable: Dictionary diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs index a3cc075944e..152239342b4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs @@ -32,6 +32,8 @@ using MonoDevelop.Core; using Gtk; +using Gdk; +using Cairo; using System.Collections.Generic; using MonoDevelop.Components; using MonoDevelop.Components.Commands; @@ -588,41 +590,44 @@ public string SecondaryTextMarkup { } } - // protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - // { - // StateType st = StateType.Normal; - // if ((flags & CellRendererState.Prelit) != 0) - // st = StateType.Prelight; - // if ((flags & CellRendererState.Focused) != 0) - // st = StateType.Normal; - // if ((flags & CellRendererState.Insensitive) != 0) - // st = StateType.Insensitive; - // if ((flags & CellRendererState.Selected) != 0) - // st = widget.HasFocus ? StateType.Selected : Gtk.StateType.Active; + protected override void OnRender (Cairo.Context window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, CellRendererState flags) + { + StateType st = StateType.Normal; + if ((flags & CellRendererState.Prelit) != 0) + st = StateType.Prelight; + if ((flags & CellRendererState.Focused) != 0) + st = StateType.Normal; + if ((flags & CellRendererState.Insensitive) != 0) + st = StateType.Insensitive; + if ((flags & CellRendererState.Selected) != 0) + st = widget.HasFocus ? StateType.Selected : Gtk.StateType.Active; - // SetupLayout (widget, flags); + SetupLayout (widget, flags); - // int w, h; - // layout.GetPixelSize (out w, out h); + int w, h; + layout.GetPixelSize (out w, out h); - // const int textXOffset = 2; // Shift text up slightly in the row. - // int tx = cell_area.X + (int)Xpad; - // int ty = cell_area.Y + (cell_area.Height - h) / 2 - textXOffset; + const int textXOffset = 2; // Shift text up slightly in the row. + int tx = cell_area.X + (int)Xpad; + int ty = cell_area.Y + (cell_area.Height - h) / 2 - textXOffset; - // int textPixelWidth = cell_area.Width - ((int)Xpad * 2) ; - // layout.Width = (int)(textPixelWidth * Pango.Scale.PangoScale); + int textPixelWidth = cell_area.Width - ((int)Xpad * 2) ; + layout.Width = (int)(textPixelWidth * Pango.Scale.PangoScale); - // window.DrawLayout (widget.Style.TextGC (st), tx, ty, layout); - // } + //window.DrawLayout (widget.Style.TextGC (st), tx, ty, layout); + window.MoveTo(tx, ty); + window.SetSourceColor (new Cairo.Color (0.7, 0.8, 0.9, 0.9)); + Pango.CairoHelper.ShowLayout(window, layout); + } - // public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - // { - // base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - // SetupLayout (widget); + protected override void OnGetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + { + base.OnGetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); + SetupLayout (widget); - // int layoutWidth = 0; - // layout.GetPixelSize (out layoutWidth, out height); - // } + int layoutWidth = 0; + layout.GetPixelSize (out layoutWidth, out height); + } void SetupLayout (Widget widget, CellRendererState flags = 0) { @@ -644,12 +649,12 @@ void SetupLayout (Widget widget, CellRendererState flags = 0) layout.SetMarkup (newmarkup); } - // protected override void OnDestroyed () - // { - // base.OnDestroyed (); - // if (layout != null) - // layout.Dispose (); - // } + //protected override void OnDestroyed () + //{ + //base.OnDestroyed (); + //if (layout != null) + // layout.Dispose (); + //} } } From a7442efadbaa94b20cdf729aec14509c632e2932 Mon Sep 17 00:00:00 2001 From: makiwolf Date: Tue, 25 Feb 2025 02:50:48 +0100 Subject: [PATCH 377/382] update --- .../ImportSymbolCompletionData.cs | 12 ++-- .../QuickInfoProvider.cs | 6 +- .../AssemblyBrowserWidget.cs | 21 +++--- .../Mono.TextEditor/Gui/MonoTextEditor.cs | 71 ++++++++++++++----- .../Mono.TextEditor/Gui/TextArea.cs | 24 +++---- .../SourceEditorWidget.cs | 34 ++++++--- .../MonoDevelop.Core/MonoDevelop.Core.csproj | 2 +- .../ContextMenuExtensionsGtk.cs | 22 +++--- .../ListWidget.cs | 6 +- .../ShowTextMateScopesHandler.cs | 2 +- .../MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs | 34 ++++----- 11 files changed, 142 insertions(+), 92 deletions(-) diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs index 2512fa86be0..82876359b6f 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs @@ -217,9 +217,9 @@ public override async Task CreateTooltipInformation (bool sm markup.AppendTaggedText (theme, taggedParts); } else { markup.AppendTaggedText (theme, taggedParts.Take (i)); - //markup.Append (""); + markup.Append (""); markup.AppendLine (); markup.AppendLine (); markup.AppendTaggedText (theme, taggedParts.Skip (i + 1)); @@ -227,9 +227,9 @@ public override async Task CreateTooltipInformation (bool sm } markup.AppendLine (); markup.AppendLine (); - //markup.Append (""); + markup.Append (""); markup.AppendLine (GettextCatalog.GetString ("Note: creates an using for namespace:")); markup.Append (""); markup.Append (Ambience.EscapeText (type.ContainingNamespace.ToDisplayString ())); diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/QuickInfoProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/QuickInfoProvider.cs index 20b43d10872..54968ba2a05 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/QuickInfoProvider.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/QuickInfoProvider.cs @@ -84,9 +84,9 @@ static class QuickInfoProvider var formatter = ctx.RoslynWorkspace.Services.GetLanguageServices (model.Language).GetService (); var documentation = symbol.GetDocumentationParts (model, caretOffset, formatter, cancellationToken); - //sb.Append (""); + sb.Append (""); if (documentation != null && documentation.Any ()) { sb.AppendLine (); diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs index 06801a8b506..4cf9d37ce62 100644 --- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs +++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs @@ -33,6 +33,7 @@ using System.Text; using System.Xml; using Gtk; +using Cairo; using MonoDevelop.Components.Commands; using MonoDevelop.Core; @@ -224,7 +225,7 @@ public AssemblyBrowserWidget () documentationScrolledWindow.PackStart (inspectEditor, true, true, 0); - //this.ExposeEvent += HPaneExpose; + this.Drawn += HPaneExpose; hpaned1 = hpaned1.ReplaceWithWidget (new HPanedThin (), true); hpaned1.Position = 271; @@ -912,14 +913,14 @@ void GenerateOutput () } int oldSize2 = -1; - // void HPaneExpose (object sender, Gtk.ExposeEventArgs args) - // { - // int size = this.Allocation.Width; - // if (size == oldSize2) - // return; - // oldSize2 = size; - // this.hpaned1.Position = Math.Min (350, this.Allocation.Width * 2 / 3); - // } + void HPaneExpose (object sender, Gtk.DrawnArgs args) + { + int size = this.Allocation.Width; + if (size == oldSize2) + return; + oldSize2 = size; + this.hpaned1.Position = Math.Min (350, this.Allocation.Width * 2 / 3); + } internal void Open (string url, AssemblyLoader? currentAssembly = null, bool expandNode = true) { @@ -1132,7 +1133,7 @@ protected override void OnDestroyed () // this.searchInCombobox.Changed -= SearchInComboboxhandleChanged; // this.searchEntry.Changed -= SearchEntryhandleChanged; this.searchTreeview.RowActivated -= SearchTreeviewhandleRowActivated; - //hpaned1.ExposeEvent -= HPaneExpose; + hpaned1.Drawn -= HPaneExpose; base.OnDestroyed (); } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/MonoTextEditor.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/MonoTextEditor.cs index 0d4b44ec3b8..2d100fba106 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/MonoTextEditor.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/MonoTextEditor.cs @@ -46,7 +46,7 @@ namespace Mono.TextEditor { [System.ComponentModel.Category("Mono.TextEditor")] [System.ComponentModel.ToolboxItem(true)] - partial class MonoTextEditor : Container + partial class MonoTextEditor : Gtk.Container, Gtk.IScrollableImplementor { readonly TextArea textArea; @@ -86,7 +86,7 @@ internal MonoTextEditor (TextDocument doc, ITextEditorOptions options, EditMode uiThread = Thread.CurrentThread; GtkWorkarounds.FixContainerLeak (this); this.HasWindow = false; - LayoutCache = new LayoutCache (this); + LayoutCache = new LayoutCache (this); this.textArea = new TextArea (doc, options, initialMode); this.textArea.Initialize (this, doc, options, initialMode); this.textArea.EditorOptionsChanged += (sender, e) => OptionsChanged (sender, e); @@ -143,25 +143,60 @@ void UnregisterAdjustments () vAdjustement = null; hAdjustement = null; } + + bool Gtk.IScrollableImplementor.GetBorder (out Gtk.Border border) { + border = default; + return true; + } + + Gtk.Adjustment hadjustment; + public Gtk.Adjustment Hadjustment { + get { + return hadjustment; + } + set { + hadjustment = value; + if (vadjustment != null) { + OnSetScrollAdjustments (value, vadjustment); + } + } + } + + Gtk.Adjustment vadjustment; + public Gtk.Adjustment Vadjustment { + get { + return vadjustment; + } + set { + vadjustment = value; + if (hadjustment != null) { + OnSetScrollAdjustments (hadjustment, value); + } + } + } + + public Gtk.ScrollablePolicy HscrollPolicy { get; set; } + + public Gtk.ScrollablePolicy VscrollPolicy { get; set; } Adjustment hAdjustement; Adjustment vAdjustement; -// protected override void OnSetScrollAdjustments (Adjustment hAdjustement, Adjustment vAdjustement) -// { -// UnregisterAdjustments (); -// this.vAdjustement = vAdjustement; -// this.hAdjustement = hAdjustement; -// base.OnSetScrollAdjustments (hAdjustement, vAdjustement); -// textArea.SetTextEditorScrollAdjustments (hAdjustement, vAdjustement); -// if (hAdjustement != null) { -// hAdjustement.ValueChanged += HandleAdjustmentValueChange; -// } -// -// if (vAdjustement != null) { -// vAdjustement.ValueChanged += HandleAdjustmentValueChange; -// } -// OnScrollAdjustmentsSet (); -// } + protected virtual void OnSetScrollAdjustments (Adjustment hAdjustement, Adjustment vAdjustement) + { + UnregisterAdjustments (); + this.vAdjustement = vAdjustement; + this.hAdjustement = hAdjustement; + //base.OnSetScrollAdjustments (hAdjustement, vAdjustement); + textArea.SetTextEditorScrollAdjustments (hAdjustement, vAdjustement); + if (hAdjustement != null) { + hAdjustement.ValueChanged += HandleAdjustmentValueChange; + } + + if (vAdjustement != null) { + vAdjustement.ValueChanged += HandleAdjustmentValueChange; + } + OnScrollAdjustmentsSet (); + } void HandleAdjustmentValueChange (object sender, EventArgs e) { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs index 8766e1eedfc..4004f6a202c 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs @@ -1561,18 +1561,18 @@ protected override void OnDragDataReceived (DragContext context, int x, int y, S { var undo = OpenUndoGroup (); int dragOffset = Document.LocationToOffset (dragCaretPos); -// if (context.Action == DragAction.Move) { -// if (CanEdit (Caret.Line) && !selection.IsEmpty) { -// var selectionRange = selection.GetSelectionRange (textEditorData); -// if (selectionRange.Offset < dragOffset) -// dragOffset -= selectionRange.Length; -// Caret.PreserveSelection = true; -// textEditorData.DeleteSelection (selection); -// Caret.PreserveSelection = false; -// -// selection = MonoDevelop.Ide.Editor.Selection.Empty; -// } -// } + if ( context.SelectedAction == DragAction.Move) { + if (CanEdit (Caret.Line) && !selection.IsEmpty) { + var selectionRange = selection.GetSelectionRange (textEditorData); + if (selectionRange.Offset < dragOffset) + dragOffset -= selectionRange.Length; + Caret.PreserveSelection = true; + textEditorData.DeleteSelection (selection); + Caret.PreserveSelection = false; + + selection = MonoDevelop.Ide.Editor.Selection.Empty; + } + } if (selection_data.Length > 0 && selection_data.Format == 8) { Caret.Offset = dragOffset; if (CanEdit (dragCaretPos.Line)) { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs index fa43717099a..79c4b116242 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs @@ -196,9 +196,15 @@ static bool HasAnyFocusedChild (Widget widget) class Border : Gtk.DrawingArea { - protected override bool OnDrawn (Cairo.Context evnt) + protected override bool OnDrawn (Cairo.Context ctx) { //evnt.Window.DrawRectangle (this.Style.DarkGC (State), true, evnt.Area); + int radius = 3; + var x = Allocation.X; + var y = Allocation.Y + 9 - 6; + ctx.RoundedRectangle(x, y, Allocation.Width - 1, Allocation.Height - y, radius, CairoCorners.TopLeft | CairoCorners.TopRight); + //ctx.SetSourceColor(VisualStyle.PadBackgroundColor.Value.ToCairoColor()); + ctx.Fill(); return true; } } @@ -274,19 +280,27 @@ void SetSuppressScrollbar (bool value) return; suppressScrollbar = value; -// if (suppressScrollbar) { + // if (suppressScrollbar) { // scrolledWindow.VScrollbar.SizeRequested += SuppressSize; -// scrolledWindow.VScrollbar.ExposeEvent += SuppressExpose; -// } else { +// scrolledWindow.VScrollbar.Drawn += SuppressExpose; +// int width, height; +// scrolledWindow.VScrollbar.GetSizeRequest (out width, out height); + //scrolledWindow.VScrollbar.SetSizeRequest (width, height); + + // } else { // scrolledWindow.VScrollbar.SizeRequested -= SuppressSize; -// scrolledWindow.VScrollbar.ExposeEvent -= SuppressExpose; -// } + // scrolledWindow.VScrollbar.Drawn -= SuppressExpose; + // int width, height; + // scrolledWindow.VScrollbar.GetSizeRequest (out width, out height); + // scrolledWindow.VScrollbar.SetSizeRequest (width, height); + + // } } // [GLib.ConnectBefore] -// static void SuppressExpose (object o, ExposeEventArgs args) +// static void SuppressExpose (object o, Gtk.DrawnArgs args) // { -// args.RetVal = true; +// args.Cr.Fill (); // } // [GLib.ConnectBefore] @@ -336,8 +350,8 @@ protected override void OnDestroyed () SetSuppressScrollbar (false); QuickTaskStrip.EnableFancyFeatures.Changed -= FancyFeaturesChanged; scrolledWindow.ButtonPressEvent -= PrepareEvent; -// scrolledWindow.Vadjustment.Destroy (); -// scrolledWindow.Hadjustment.Destroy (); + scrolledWindow.Vadjustment.Dispose (); + scrolledWindow.Hadjustment.Dispose (); scrolledWindow.Destroy (); scrolledWindow = null; strip.Destroy (); diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj index 4ed1e937e1a..44e0a6144e5 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj @@ -100,7 +100,7 @@ - + diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs index 76b522957a7..382bad065e3 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs @@ -79,19 +79,19 @@ class PoupHandlerWrapper public PoupHandlerWrapper (ContextMenu menu, Gtk.Menu gtkMenu) { this.menu = menu; - //gtkMenu.ExposeEvent += HandleExposeEvent; + gtkMenu.Drawn += HandleExposeEvent; } -// void HandleExposeEvent (object o, Gtk.ExposeEventArgs args) -// { -// var gtkMenu = (Gtk.Menu)o; -// gtkMenu.ExposeEvent -= HandleExposeEvent; -// int ox, oy; -// gtkMenu.ParentWindow.GetOrigin (out ox, out oy); -// int rx, ry; -// IdeApp.Workbench.RootWindow.GdkWindow.GetOrigin (out rx, out ry); -// menu.Items [0].FireSelectedEvent (new Xwt.Rectangle (ox - rx, oy - ry, gtkMenu.Allocation.Width, gtkMenu.Allocation.Height)); -// } + void HandleExposeEvent (object o, Gtk.DrawnArgs args) + { + var gtkMenu = (Gtk.Menu)o; + gtkMenu.Drawn -= HandleExposeEvent; + int ox, oy; + gtkMenu.ParentWindow.GetOrigin (out ox, out oy); + int rx, ry; + IdeApp.Workbench.RootWindow.GdkWindow.GetOrigin (out rx, out ry); + menu.Items [0].FireSelectedEvent (new Xwt.Rectangle (ox - rx, oy - ry, gtkMenu.Allocation.Width, gtkMenu.Allocation.Height)); + } } public static void ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt, Gtk.Menu menu) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs index 682b255f3cd..ccc30896723 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs @@ -160,9 +160,9 @@ void SetFont () if (noMatchFont != null) noMatchFont.Dispose (); - //itemFont = IdeServices.FontService.MonospaceFont.Copy (); - //categoryFont = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); - //noMatchFont = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); + itemFont = IdeServices.FontService.MonospaceFont.Copy (); + categoryFont = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); + noMatchFont = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11); var newItemFontSize = itemFont.Size; var newCategoryFontSize = categoryFont.Size; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.TextMate/ShowTextMateScopesHandler.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.TextMate/ShowTextMateScopesHandler.cs index 5f2fb94c3f6..294ee455e5d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.TextMate/ShowTextMateScopesHandler.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.TextMate/ShowTextMateScopesHandler.cs @@ -54,7 +54,7 @@ protected override void Run () var window = new TooltipPopoverWindow (); - //window.Markup = "" + sb.ToString () + ""; + window.Markup = "" + sb.ToString () + ""; editor.ShowTooltipWindow (window); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs index 29c0207cc61..9d987a8754f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs @@ -1087,23 +1087,23 @@ class DescriptionCellRendererText : CellRendererText { public int PreferedMaxWidth { get; set; } -// public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) -// { -// int originalWrapWidth = WrapWidth; -// WrapWidth = -1; -// // First calculate Width with WrapWidth=-1 which will give us -// // Width of text in one line(without wrapping) -// base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); -// int oneLineWidth = width; -// WrapWidth = originalWrapWidth; -// // originalWrapWidth(aka WrapWidth) equals to actual width of Column if oneLineWidth is bigger -// // then column width/height we must recalculate, because Height is atm for one line -// // and not multipline that WrapWidth creates... -// if (oneLineWidth > originalWrapWidth) { -// base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); -// } -// width = Math.Min (oneLineWidth, PreferedMaxWidth); -// } + protected override void OnGetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + { + int originalWrapWidth = WrapWidth; + WrapWidth = -1; + // First calculate Width with WrapWidth=-1 which will give us + // Width of text in one line(without wrapping) + base.OnGetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); + int oneLineWidth = width; + WrapWidth = originalWrapWidth; + // originalWrapWidth(aka WrapWidth) equals to actual width of Column if oneLineWidth is bigger + // then column width/height we must recalculate, because Height is atm for one line + // and not multipline that WrapWidth creates... + if (oneLineWidth > originalWrapWidth) { + base.OnGetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); + } + width = Math.Min (oneLineWidth, PreferedMaxWidth); + } } } From 3445157365e806c105ac994eaa4b85cb2bd832ea Mon Sep 17 00:00:00 2001 From: makiwolf Date: Wed, 16 Apr 2025 00:17:18 +0200 Subject: [PATCH 378/382] update --- .../Gui/ResultTooltipProvider.cs | 6 +- .../RefactoringPreviewDialog.cs | 36 ++--- .../Mono.TextEditor.PopupWindow/ListWidget.cs | 149 +++++++++++------- .../Mono.TextEditor/Gui/TextArea.cs | 2 +- .../Mono.TextEditor/Gui/TextViewMargin.cs | 4 +- .../GotoLineNumberWidget.cs | 10 +- .../SourceEditorWidget.cs | 4 +- .../VSEditor/MDUtils.cs | 6 +- .../DockItemTitleTab.cs | 4 +- .../CompactScrolledWindow.cs | 8 +- .../DropDownBoxListWindow.cs | 96 ++++++++--- .../MonoDevelop.Components/GtkUtil.cs | 24 +-- .../TreeViewCellContainer.cs | 12 ++ .../ListWidget.cs | 63 ++++++-- .../ParameterInformationWindow.cs | 2 +- .../RoslynCompletionData.cs | 2 +- .../ExtensibleTreeView.cs | 114 +++++++------- 17 files changed, 343 insertions(+), 199 deletions(-) diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs index b2571000747..58bcf884e6d 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs @@ -74,9 +74,9 @@ partial class ResultTooltipProvider : TooltipProvider if (results.Count == 0) return null; var sb = StringBuilderCache.Allocate (); - // sb.Append (""); + sb.Append (""); int minOffset = int.MaxValue; int maxOffset = -1; bool floatingWidgetShown = false; diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs index cd6efdf09d5..803a779a57c 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs @@ -113,13 +113,13 @@ void SetLocationTextData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, var loc = doc.OffsetToLocation (replaceChange.Offset); string text = string.Format (GettextCatalog.GetString ("(Line:{0}, Column:{1})"), loc.Line, loc.Column); - //if (treeviewPreview.Selection.IterIsSelected (iter)) { + if (treeviewPreview.Selection.IterIsSelected (iter)) { cellRendererText.Text = text; - //} else { + } else { //var color = Style.Text (StateType.Insensitive); //var c = string.Format ("#{0:X02}{1:X02}{2:X02}", color.Red / 256, color.Green / 256, color.Blue / 256); //cellRendererText.Markup = "" + text + ""; - //} + } } void SetDiffCellData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.ITreeModel model, Gtk.TreeIter iter) @@ -267,8 +267,8 @@ void CreateLayout (Widget container, string text) } } - // protected override void Render (Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - // { + protected override void OnRender (Cairo.Context window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, CellRendererState flags) + { // if (isDisposed) // return; // try { @@ -339,20 +339,20 @@ void CreateLayout (Widget container, string text) // } catch (Exception e) { // Console.WriteLine (e); // } - // } + } - // public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int c_width, out int c_height) - // { - // x_offset = y_offset = 0; - // c_width = width; - // c_height = height; - - // if (diffMode) { - // // Add some spacing for the margin - // c_width += 4; - // c_height += 4; - // } - // } + protected override void OnGetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int c_width, out int c_height) + { + x_offset = y_offset = 0; + c_width = width; + c_height = height; + + if (diffMode) { + // Add some spacing for the margin + c_width += 4; + c_height += 4; + } + } StateType GetState (CellRendererState flags) { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs index 7fd22957156..4b30ee2107f 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ListWidget.cs @@ -34,8 +34,44 @@ namespace Mono.TextEditor.PopupWindow { - class ListWidget : Gtk.DrawingArea + class ListWidget : Gtk.DrawingArea, Gtk.IScrollableImplementor { + + bool Gtk.IScrollableImplementor.GetBorder (out Gtk.Border border) { + border = default; + return true; + } + + Gtk.Adjustment hadjustment; + public Gtk.Adjustment Hadjustment { + get { + return hadjustment; + } + set { + hadjustment = value; + if (vadjustment != null) { + OnSetScrollAdjustments (value, vadjustment); + } + } + } + + Gtk.Adjustment vadjustment; + public Gtk.Adjustment Vadjustment { + get { + return vadjustment; + } + set { + vadjustment = value; + if (hadjustment != null) { + OnSetScrollAdjustments (hadjustment, value); + } + } + } + + public Gtk.ScrollablePolicy HscrollPolicy { get; set; } + + public Gtk.ScrollablePolicy VscrollPolicy { get; set; } + int margin = 0; int padding = 4; int listWidth = 300; @@ -167,14 +203,14 @@ protected override bool OnMotionNotifyEvent (EventMotion e) Adjustment hadj; Adjustment vadj; -// protected override void OnSetScrollAdjustments (Adjustment hadj, Adjustment vadj) -// { -// this.hadj = hadj; -// this.vadj = vadj; -// if (this.vadj != null) -// this.vadj.ValueChanged += (sender, e) => QueueDraw (); + protected virtual void OnSetScrollAdjustments (Adjustment hadj, Adjustment vadj) + { + this.hadj = hadj; + this.vadj = vadj; + if (this.vadj != null) + this.vadj.ValueChanged += (sender, e) => QueueDraw (); // base.OnSetScrollAdjustments (hadj, vadj); -// } + } void SetAdjustments (Gdk.Rectangle allocation) { @@ -211,12 +247,13 @@ public int TextOffset { void DrawList (Cairo.Context args) { var window = GdkWindow; - - int winWidth, winHeight; + int winWidth = Window.FrameExtents.Width; + int winHeight = Window.FrameExtents.Height; +// int winWidth, winHeight; // window.GetSize (out winWidth, out winHeight); int ypos = margin; -// int lineWidth = winWidth - margin*2; + int lineWidth = winWidth - margin*2; int xpos = margin + padding; using (var cr = this.CreateXwtContext ()) { @@ -227,67 +264,67 @@ void DrawList (Cairo.Context args) int n = 0; n = (int)(vadj.Value / rowHeight); -// while (ypos < winHeight - margin && n < win.DataProvider.Count) { -// bool hasMarkup = false; -// IMarkupListDataProvider markupListDataProvider = win.DataProvider as IMarkupListDataProvider; -// if (markupListDataProvider != null) { -// if (markupListDataProvider.HasMarkup (n)) { -// layout.Markup = (markupListDataProvider.GetMarkup (n) ?? "<null>"); -// hasMarkup = true; -// } -// } + while (ypos < winHeight - margin && n < win.DataProvider.Count) { + bool hasMarkup = false; + IMarkupListDataProvider markupListDataProvider = win.DataProvider as IMarkupListDataProvider; + if (markupListDataProvider != null) { + if (markupListDataProvider.HasMarkup (n)) { + layout.Markup = (markupListDataProvider.GetMarkup (n) ?? "<null>"); + hasMarkup = true; + } + } // -// if (!hasMarkup) -// layout.Text = (win.DataProvider.GetText (n) ?? ""); + if (!hasMarkup) + layout.Text = (win.DataProvider.GetText (n) ?? ""); // -// Xwt.Drawing.Image icon = win.DataProvider.GetIcon (n); -// int iconHeight, iconWidth; + Xwt.Drawing.Image icon = win.DataProvider.GetIcon (n); + int iconHeight, iconWidth; // -// if (icon != null) { -// iconWidth = (int)icon.Width; -// iconHeight = (int)icon.Height; -// } else if (!Gtk.Icon.SizeLookup (Gtk.IconSize.Menu, out iconWidth, out iconHeight)) { -// iconHeight = iconWidth = 24; -// } + if (icon != null) { + iconWidth = (int)icon.Width; + iconHeight = (int)icon.Height; + } else if (!Gtk.Icon.SizeLookup (Gtk.IconSize.Menu, out iconWidth, out iconHeight)) { + iconHeight = iconWidth = 24; + } // -// var s = layout.GetSize (); -// int typos, iypos; -// int he = (int)s.Height; + var s = layout.GetSize (); + int typos, iypos; + int he = (int)s.Height; // -// typos = he < rowHeight ? ypos + (rowHeight - he) / 2 : ypos; -// iypos = iconHeight < rowHeight ? ypos + (rowHeight - iconHeight) / 2 : ypos; + typos = he < rowHeight ? ypos + (rowHeight - he) / 2 : ypos; + iypos = iconHeight < rowHeight ? ypos + (rowHeight - iconHeight) / 2 : ypos; // -// if (n == selection) { -// if (!disableSelection) { -// cr.Rectangle (margin, ypos, lineWidth, he + padding); + if (n == selection) { + if (!disableSelection) { + cr.Rectangle (margin, ypos, lineWidth, he + padding); // cr.SetColor (this.Style.Base (StateType.Selected).ToXwtColor ()); -// cr.Fill (); + cr.Fill (); // // cr.SetColor (this.Style.Text (StateType.Selected).ToXwtColor ()); -// cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos); -// } else { -// cr.Rectangle (margin, ypos, lineWidth, he + padding); + cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos); + } else { + cr.Rectangle (margin, ypos, lineWidth, he + padding); // cr.SetColor (this.Style.Base (StateType.Selected).ToXwtColor ()); -// cr.Stroke (); -// + cr.Stroke (); + // cr.SetColor (textColor); -// cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos); -// } -// } else { + cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos); + } + } else { // cr.SetColor (textColor); -// cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos); -// } + cr.DrawTextLayout (layout, xpos + iconWidth + 2, typos); + } // -// if (icon != null) -// cr.DrawImage (icon, xpos, iypos); + if (icon != null) + cr.DrawImage (icon, xpos, iypos); // -// ypos += rowHeight; -// n++; + ypos += rowHeight; + n++; // // //reset the markup or it carries over to the next SetText -// if (hasMarkup) -// layout.Markup = string.Empty; -// } + if (hasMarkup) + layout.Markup = string.Empty; + } } } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs index 4004f6a202c..c93ae76689b 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs @@ -917,7 +917,7 @@ protected override void OnRealized () Y = Allocation.Y, Width = Allocation.Width, Height = Allocation.Height, -// Wclass = WindowClass.InputOutput, + Wclass = Gdk.WindowWindowClass.InputOutput, Visual = this.Visual, // Colormap = this.Colormap, EventMask = (int)(this.Events | Gdk.EventMask.ExposureMask), diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs index 1fb326762b0..e773260586a 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs @@ -2756,9 +2756,9 @@ protected internal override void MouseHover (MarginMouseEventArgs args) ShowCodeSegmentPreviewTooltip (TextSegment.Invalid, Gdk.Rectangle.Zero); string link = GetLink != null ? GetLink (args) : null; - //if (!String.IsNullOrEmpty (link)) { + if (!String.IsNullOrEmpty (link)) { base.cursor = textLinkCursor.Value; - //} else { + }// else { //base.cursor = hoverResult.HasCursor ? hoverResult.Cursor : GetDefaultTextCursor (); //} return; diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/GotoLineNumberWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/GotoLineNumberWidget.cs index 5f743ea26c1..c2ceb4951af 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/GotoLineNumberWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/GotoLineNumberWidget.cs @@ -182,20 +182,20 @@ void PreviewLine () RestoreWidgetState (); return; } - //try { + try { int targetLine = TargetLine; - //if (targetLine >= textEditor.Document.LineCount || targetLine < 0) { + if (targetLine >= textEditor.Document.LineCount || targetLine < 0) { targetLine = Math.Max (1, Math.Min (textEditor.Document.LineCount, targetLine)); - // } else { + } //else { // this.entryLineNumber.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Normal)); // this.entryLineNumber.ModifyText (Gtk.StateType.Normal, Style.Foreground (Gtk.StateType.Normal)); // } textEditor.Caret.Line = targetLine; textEditor.CenterToCaret (); - //} catch (System.Exception) { + } catch (System.Exception) { //this.entryLineNumber.ModifyText (Gtk.StateType.Normal, Ide.Gui.Styles.Editor.SearchErrorForegroundColor.ToGdkColor ()); - //} + } } public void Focus () diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs index 79c4b116242..99d69cb6af6 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs @@ -350,8 +350,8 @@ protected override void OnDestroyed () SetSuppressScrollbar (false); QuickTaskStrip.EnableFancyFeatures.Changed -= FancyFeaturesChanged; scrolledWindow.ButtonPressEvent -= PrepareEvent; - scrolledWindow.Vadjustment.Dispose (); - scrolledWindow.Hadjustment.Dispose (); + //scrolledWindow.Vadjustment.Dispose (); + //scrolledWindow.Hadjustment.Dispose (); scrolledWindow.Destroy (); scrolledWindow = null; strip.Destroy (); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/VSEditor/MDUtils.cs b/main/src/addins/MonoDevelop.SourceEditor2/VSEditor/MDUtils.cs index 69281479004..0125510b0a6 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/VSEditor/MDUtils.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/VSEditor/MDUtils.cs @@ -29,7 +29,7 @@ public static string ClassificationsToMarkup (ITextSnapshot snapshot, IList"); + markup.Append (""); markup.AppendLine (); } else { @@ -84,9 +84,9 @@ public static string ClassificationsToMarkup (ITextSnapshot snapshot, IList"); + markup.Append (" size='small'>"); markup.AppendLine (); markup.AppendLine (); markup.Append (""); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs index a520add8387..01fa59f18f7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs @@ -196,8 +196,8 @@ void UpdateVisualStyle () } if (IsRealized && labelWidget?.Visible == true) { - //var font = IdeServices.FontService.SansFont.CopyModified (null, Pango.Weight.Bold); - //font.AbsoluteSize = Pango.Units.FromPixels (11); + var font = IdeServices.FontService.SansFont.CopyModified (null, Pango.Weight.Bold); + font.AbsoluteSize = Pango.Units.FromPixels (11); //labelWidget.ModifyFont (font); //labelWidget.ModifyText (StateType.Normal, (active ? visualStyle.PadTitleLabelColor.Value : visualStyle.InactivePadTitleLabelColor.Value).ToGdkColor ()); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs index 08fb62d0d25..8930f39eaab 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs @@ -116,9 +116,9 @@ protected override void OnSizeAllocated (Gdk.Rectangle allocation) } } - protected override bool OnDrawn (Cairo.Context evnt) + protected override bool OnDrawn (Cairo.Context cr) { - var ret = base.OnDrawn (evnt); + var ret = base.OnDrawn (cr); if (!showBorderLine) return ret; @@ -147,7 +147,7 @@ protected override bool OnDrawn (Cairo.Context evnt) var halfLineWidth = lineWidth / 2.0; //draw the border lines - using (var cr = Gdk.CairoHelper.Create (GdkWindow)) { + //using (var cr = Gdk.CairoHelper.Create (GdkWindow)) { //Gdk.CairoHelper.Region (cr, evnt.Region); cr.Clip (); @@ -176,7 +176,7 @@ protected override bool OnDrawn (Cairo.Context evnt) } cr.Stroke (); - } + //} return ret; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs index 14b8f28ec18..ac8e7c4e4de 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs @@ -223,8 +223,43 @@ protected override bool OnEnterNotifyEvent (Gdk.EventCrossing evnt) return base.OnEnterNotifyEvent (evnt); } - internal class ListWidget: DrawingArea + internal class ListWidget: DrawingArea, Gtk.IScrollableImplementor { + bool Gtk.IScrollableImplementor.GetBorder (out Gtk.Border border) { + border = default; + return true; + } + + Gtk.Adjustment hadjustment; + public Gtk.Adjustment Hadjustment { + get { + return hadjustment; + } + set { + hadjustment = value; + if (vadjustment != null) { + OnSetScrollAdjustments (value, vadjustment); + } + } + } + + Gtk.Adjustment vadjustment; + public Gtk.Adjustment Vadjustment { + get { + return vadjustment; + } + set { + vadjustment = value; + if (hadjustment != null) { + OnSetScrollAdjustments (hadjustment, value); + } + } + } + + public Gtk.ScrollablePolicy HscrollPolicy { get; set; } + + public Gtk.ScrollablePolicy VscrollPolicy { get; set; } + const int leftXAlignment = 1; const int padding = 4; const int iconTextDistance = 4; @@ -462,7 +497,10 @@ protected override bool OnDrawn (Cairo.Context evnt) void DrawList () { - int winWidth = 0, winHeight = 0; + + //int winWidth = 0, winHeight = 0; + int winWidth = Window.FrameExtents.Width; + int winHeight = Window.FrameExtents.Height; // GdkWindow.GetSize (out winWidth, out winHeight); int lineWidth = winWidth - leftXAlignment * 2; @@ -485,29 +523,42 @@ void DrawList () layout.GetPixelSize (out wi, out he); typos = he < rowHeight ? ypos + (rowHeight - he) / 2 : ypos; iypos = iconHeight < rowHeight ? ypos + (rowHeight - iconHeight) / 2 : ypos; - + using (Cairo.Context evnt = Gdk.CairoHelper.Create (GdkWindow)) { if (n == selection) { if (!disableSelection) { + evnt.Rectangle(leftXAlignment, ypos, lineWidth, rowHeight); + evnt.Fill(); + evnt.MoveTo(xpos + iconWidth + iconTextDistance, typos); + evnt.SetSourceColor (new Cairo.Color (0.7, 0.8, 0.9, 0.9)); + Pango.CairoHelper.ShowLayout(evnt, layout); // GdkWindow.DrawRectangle (Style.BaseGC (StateType.Selected), // true, leftXAlignment, ypos, lineWidth, rowHeight); // GdkWindow.DrawLayout (Style.TextGC (StateType.Selected), // xpos + iconWidth + iconTextDistance, typos, layout); if (icon != null) icon = icon.WithStyles ("sel"); - } //else { + } else { + evnt.Rectangle(leftXAlignment, ypos, lineWidth, rowHeight); + evnt.Fill(); + evnt.MoveTo(xpos + iconWidth + iconTextDistance, typos); + evnt.SetSourceColor (new Cairo.Color (0.7, 0.8, 0.9, 0.9)); + Pango.CairoHelper.ShowLayout(evnt, layout); // GdkWindow.DrawRectangle (Style.BaseGC (StateType.Selected), // false, leftXAlignment, ypos, lineWidth, rowHeight); // GdkWindow.DrawLayout (Style.TextGC (StateType.Normal), // xpos + iconWidth + iconTextDistance, typos, layout); -// } - } //else + } + } else { + evnt.MoveTo(xpos + iconWidth + iconTextDistance, typos); + evnt.SetSourceColor (new Cairo.Color (0.7, 0.8, 0.9, 0.9)); + Pango.CairoHelper.ShowLayout(evnt, layout); // GdkWindow.DrawLayout (Style.TextGC (StateType.Normal), // xpos + iconWidth + iconTextDistance, typos, layout); - -// if (icon != null) { + } + if (icon != null) { // using (var ctx = Gdk.CairoHelper.Create (this.GdkWindow)) -// ctx.DrawImage (this, icon, xpos, iypos); -// } + evnt.DrawImage (this, icon, xpos, iypos); + } ypos += rowHeight; n++; @@ -515,6 +566,7 @@ void DrawList () //reset the markup or it carries over to the next SetText layout.SetMarkup (string.Empty); } + } } int GetRowByPosition (int ypos) @@ -622,18 +674,18 @@ void UpdateStyle () Adjustment hAdjustment; Adjustment vAdjustment; -// protected override void OnSetScrollAdjustments (Adjustment hadj, Adjustment vadj) -// { -// hAdjustment = hadj; -// vAdjustment = vadj; -// if (vAdjustment != null) -// vAdjustment.ValueChanged += delegate { -// if (selection > -1) -// Selection = GetRowByPosition (curMouseY); -// QueueDraw (); -// }; -// base.OnSetScrollAdjustments (hadj, vadj); -// } + protected virtual void OnSetScrollAdjustments (Adjustment hadj, Adjustment vadj) + { + hAdjustment = hadj; + vAdjustment = vadj; + if (vAdjustment != null) + vAdjustment.ValueChanged += delegate { + if (selection > -1) + Selection = GetRowByPosition (curMouseY); + QueueDraw (); + }; + //base.OnSetScrollAdjustments (hadj, vadj); + } internal virtual void OnSelectItem (EventArgs e) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs index 93ca7c98fca..b2a380bdcfd 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs @@ -972,18 +972,18 @@ public CellTooltipWindow (TreeView tree, TreeViewColumn col, TreePath path) col.CellSetCellData (tree.Model, iter, false, false); int x = 0; int th = 0; - // CellRenderer[] renderers = col.CellRenderers; - // foreach (CellRenderer cr in renderers) { - // int sp, wi, he, xo, yo; - // col.CellGetPosition (cr, out sp, out wi); - // Gdk.Rectangle crect = new Gdk.Rectangle (x, rect.Y, wi, rect.Height); - // cr.GetSize (tree, ref crect, out xo, out yo, out wi, out he); - // if (cr != renderers [renderers.Length - 1]) - // x += crect.Width + col.Spacing + 1; - // else - // x += wi + 1; - // if (he > th) th = he; - // } + CellRenderer[] renderers = col.Cells; + foreach (CellRenderer cr in renderers) { + int sp, wi, he, xo, yo; + col.CellGetPosition (cr, out sp, out wi); + Gdk.Rectangle crect = new Gdk.Rectangle (x, rect.Y, wi, rect.Height); + //cr.GetSize (tree, ref crect, out xo, out yo, out wi, out he); + if (cr != renderers [renderers.Length - 1]) + x += crect.Width + col.Spacing + 1; + else + x += wi + 1; + //if (he > th) th = he; + } SetSizeRequest (x, th + 2); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TreeViewCellContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TreeViewCellContainer.cs index 92e81cf7f60..a9eeb48f0a1 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TreeViewCellContainer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TreeViewCellContainer.cs @@ -76,6 +76,18 @@ protected override void OnShown () // Do nothing. } + protected override void OnGetPreferredWidth(out int minimum_width, out int natural_width) + { + + base.OnGetPreferredWidth(out minimum_width, out natural_width); + } + + protected override void OnGetPreferredHeight(out int minimum_height, out int natural_height) + { + + base.OnGetPreferredHeight(out minimum_height, out natural_height); + } + // protected override void OnSizeRequested (ref Requisition requisition) // { // base.OnSizeRequested (ref requisition); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs index ccc30896723..01eee0e52be 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs @@ -99,8 +99,44 @@ public CompletionListFilterResult (List filteredItems, List CreateTooltipInformation (Microso } else { markup.AppendTaggedText (theme, taggedParts.Take (i)); markup.Append (""); markup.AppendLine (); markup.AppendLine (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs index 77700cfff8a..6ef149e0131 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs @@ -1401,11 +1401,11 @@ void StartLabelEditInternal() selectionLength = editTextLength - selectionStart; // This will apply the selection as soon as possible GLib.Idle.Add (() => { - //var editable = currentLabelEditable; - //if (editable == null) + var editable = currentLabelEditable; + if (editable == null) return false; - //editable.SelectRegion (selectionStart, selectionStart + selectionLength); + editable.SelectRegion (selectionStart, selectionStart + selectionLength); return false; }); // Ensure we set all our state variables before calling SetCursor @@ -1470,7 +1470,7 @@ void HandleOnEditCancelled (object s, EventArgs args) { editingText = false; text_render.Editable = false; - //currentLabelEditable = null; + currentLabelEditable = null; TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode (); if (node == null) @@ -2173,15 +2173,15 @@ void Destroy () IsDestroyed = true; IdeApp.Preferences.CustomPadFont.Changed -= CustomFontPropertyChanged; if (pix_render != null) { - //pix_render.Destroy (); + pix_render.Dispose (); pix_render = null; } if (complete_column != null) { - //complete_column.Destroy (); + complete_column.Dispose (); complete_column = null; } if (text_render != null) { - //text_render.Destroy (); + text_render.Dispose (); text_render = null; } @@ -2529,7 +2529,8 @@ void SetupLayout (Gtk.Widget widget, Gtk.CellRendererState flags = 0) //fgColor = widget.Style.Text (IdeTheme.UserInterfaceTheme == Theme.Light ? Gtk.StateType.Selected : Gtk.StateType.Normal); //else //fgColor = widget.Style.Text (Gtk.StateType.Insensitive); - //newmarkup = "" + TextMarkup + ""; + //newmarkup = "" + TextMarkup + ""; + newmarkup = "" + TextMarkup + ""; } if (!string.IsNullOrEmpty (SecondaryTextMarkup)) { @@ -2542,42 +2543,45 @@ void SetupLayout (Gtk.Widget widget, Gtk.CellRendererState flags = 0) layout.SetMarkup (newmarkup); } - // protected override void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags) - // { - // Gtk.StateType st = Gtk.StateType.Normal; - // if ((flags & Gtk.CellRendererState.Prelit) != 0) - // st = Gtk.StateType.Prelight; - // if ((flags & Gtk.CellRendererState.Focused) != 0) - // st = Gtk.StateType.Normal; - // if ((flags & Gtk.CellRendererState.Insensitive) != 0) - // st = Gtk.StateType.Insensitive; - // if ((flags & Gtk.CellRendererState.Selected) != 0) - // st = widget.HasFocus ? Gtk.StateType.Selected : Gtk.StateType.Active; - - // SetupLayout (widget, flags); - - // int w, h; - // layout.GetPixelSize (out w, out h); - - // int tx = cell_area.X + (int)Xpad; - // int ty = cell_area.Y + (cell_area.Height - h) / 2; - - // bool hasStatusIcon = StatusIcon != CellRendererImage.NullImage && StatusIcon != null; - - // if (hasStatusIcon) { - // var img = GetResized (StatusIcon, zoom); - // if (st == Gtk.StateType.Selected) - // img = img.WithStyles ("sel"); - // var x = tx + w + StatusIconSpacing; - // using (var ctx = Gdk.CairoHelper.Create (window)) { - // ctx.DrawImage (widget, img, x, cell_area.Y + (cell_area.Height - img.Height) / 2); - // } - // } - - // window.DrawLayout (widget.Style.TextGC (st), tx, ty, layout); - - // hasStatusIcon = false; - // } + protected override void OnRender (Cairo.Context window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gtk.CellRendererState flags) + { + Gtk.StateFlags st = Gtk.StateFlags.Normal; + // if ((flags & Gtk.CellRendererState.Prelit) != 0) + // st = Gtk.StateType.Prelight; + // if ((flags & Gtk.CellRendererState.Focused) != 0) + // st = Gtk.StateType.Normal; + // if ((flags & Gtk.CellRendererState.Insensitive) != 0) + // st = Gtk.StateType.Insensitive; + if ((flags & Gtk.CellRendererState.Selected) != 0) + st = widget.HasFocus ? Gtk.StateFlags.Selected : Gtk.StateFlags.Active; + + SetupLayout (widget, flags); + + int w, h; + layout.GetPixelSize (out w, out h); + + int tx = cell_area.X + (int)Xpad; + int ty = cell_area.Y + (cell_area.Height - h) / 2; + + bool hasStatusIcon = StatusIcon != CellRendererImage.NullImage && StatusIcon != null; + + if (hasStatusIcon) { + var img = GetResized (StatusIcon, zoom); + if (st == Gtk.StateFlags.Selected) + img = img.WithStyles ("sel"); + var x = tx + w + StatusIconSpacing; + //using (var ctx = Gdk.CairoHelper.Create (window)) { + window.DrawImage (widget, img, x, cell_area.Y + (cell_area.Height - img.Height) / 2); + //} + } + + //window.DrawLayout (widget.Style.TextGC (st), tx, ty, layout); + window.MoveTo(tx, ty); + window.SetSourceColor (new Cairo.Color (0.7, 0.8, 0.9, 0.9)); + Pango.CairoHelper.ShowLayout(window, layout); + + hasStatusIcon = false; + } public Gdk.Rectangle GetStatusIconArea (Gtk.Widget widget, Gdk.Rectangle cell_area) { @@ -2592,20 +2596,20 @@ public Gdk.Rectangle GetStatusIconArea (Gtk.Widget widget, Gdk.Rectangle cell_ar return new Gdk.Rectangle (x, cell_area.Y, (int) iconSize.Width, (int) cell_area.Height); } - // public override void GetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - // { - // SetupLayout (widget); + protected override void OnGetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + { + SetupLayout (widget); - // x_offset = y_offset = 0; + x_offset = y_offset = 0; - // layout.GetPixelSize (out width, out height); - // width += (int)Xpad * 2; + layout.GetPixelSize (out width, out height); + width += (int)Xpad * 2; - // if (StatusIcon != CellRendererImage.NullImage && StatusIcon != null) { - // var iconSize = GetZoomedIconSize (StatusIcon, zoom); - // width += (int)iconSize.Width + StatusIconSpacing; - // } - // } + if (StatusIcon != CellRendererImage.NullImage && StatusIcon != null) { + var iconSize = GetZoomedIconSize (StatusIcon, zoom); + width += (int)iconSize.Width + StatusIconSpacing; + } + } protected override void OnEditingStarted (Gtk.ICellEditable editable, string path) { From 91ff68b73606b3e81c367641008bcca4a43632bd Mon Sep 17 00:00:00 2001 From: makiwolf Date: Wed, 16 Apr 2025 00:48:25 +0200 Subject: [PATCH 379/382] update --- NuGet.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet.config b/NuGet.config index 28f0a186b4d..540282a7899 100644 --- a/NuGet.config +++ b/NuGet.config @@ -4,7 +4,7 @@ - + From 74f296bec31cae486c573a4e21c04b0d61cb260e Mon Sep 17 00:00:00 2001 From: makiwolf Date: Sun, 20 Apr 2025 17:01:56 +0200 Subject: [PATCH 380/382] update --- .../MonoDevelop.Debugger/StackTracePad.cs | 18 +- ...Support.Toolbox.ComponentSelectorDialog.cs | 208 ++++++++---------- .../gtk-gui/gui.stetic | 3 +- .../PackageSourceCellRenderer.cs | 68 +++--- .../ModeHelpWindow.cs | 2 +- .../Mono.TextEditor/Gui/TextArea.cs | 2 +- .../BasicChart.cs | 15 +- .../AutoHideBox.cs | 1 + .../MonoDevelop.Components.Docking/DockBar.cs | 2 +- .../DockContainer.cs | 2 +- .../DockFrame.cs | 2 +- .../DockFrameTopLevel.cs | 2 + .../DockItemContainer.cs | 2 +- .../FixedWidthWrapLabel.cs | 4 +- .../MonoDevelop.Components/GtkUtil.cs | 34 +-- .../ListWidget.cs | 4 +- .../SignatureHelpParameterHintingData.cs | 8 +- .../TooltipInformationWindow.cs | 2 +- .../ExtensibleTreeView.cs | 39 ++-- .../ProgressDialog.cs | 1 + 20 files changed, 209 insertions(+), 210 deletions(-) diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs index cec17b9d39e..0b152035c5c 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs @@ -305,15 +305,15 @@ bool GetCellAtPos (int x, int y, out TreePath path, out TreeViewColumn col, out if (tree.GetPathAtPos (x, y, out path, out col, out cx, out cy)) { tree.GetCellArea (path, col); -// foreach (CellRenderer cr in col.CellRenderers) { -// int xo, w; -// -// col.CellGetPosition (cr, out xo, out w); -// if (cr.Visible && cx >= xo && cx < xo + w) { -// cellRenderer = cr; -// return true; -// } -// } + foreach (CellRenderer cr in col.Cells) { + int xo, w; + + col.CellGetPosition (cr, out xo, out w); + if (cr.Visible && cx >= xo && cx < xo + w) { + cellRenderer = cr; + return true; + } + } } cellRenderer = null; diff --git a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs index ddf3b19d47f..4bb76426b79 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs @@ -10,187 +10,169 @@ namespace MonoDevelop.DesignerSupport.Toolbox internal partial class ComponentSelectorDialog { - private global::Gtk.VBox vbox2; + private VBox vbox2; - private global::Gtk.HBox hbox1; + private HBox hbox1; - private global::Gtk.Label label1; + private Label label1; - private global::Gtk.ComboBoxText comboType; + private ComboBoxText comboType; - private global::Gtk.VSeparator vseparator1; + private VSeparator vseparator1; - private global::Gtk.Button button24; + private Button button24; - private global::Gtk.HBox hbox2; + private HBox hbox2; - private global::MonoDevelop.Components.ImageView imageview1; + private ImageView imageview1; - private global::Gtk.Label label2; + private Label label2; - private global::Gtk.ScrolledWindow scrolledwindow1; + private ScrolledWindow scrolledwindow1; - private global::Gtk.TreeView listView; + private TreeView listView; - private global::Gtk.CheckButton checkGroupByCat; + private CheckButton checkGroupByCat; - private global::Gtk.Button buttonCancel; + private Button buttonCancel; - private global::Gtk.Button buttonOk; + private Button buttonOk; - protected virtual void Build() + protected virtual void Build () { - global::Stetic.Gui.Initialize(this); + Gui.Initialize (this); // Widget MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog - this.Name = "MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog"; - this.Title = global::Mono.Unix.Catalog.GetString("Toolbox Item Selector"); - this.WindowPosition = ((global::Gtk.WindowPosition)(4)); + Name = "MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog"; + Title = Catalog.GetString ("Toolbox Item Selector"); + WindowPosition = WindowPosition.CenterOnParent; // Internal child MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.VBox global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = 2; // Container child dialog1_VBox.Gtk.Box+BoxChild - this.vbox2 = new global::Gtk.VBox(); - this.vbox2.Name = "vbox2"; - this.vbox2.Spacing = 6; - this.vbox2.BorderWidth = ((uint)(6)); + vbox2 = new VBox {Name = "vbox2", Spacing = 6, BorderWidth = 6}; // Container child vbox2.Gtk.Box+BoxChild - this.hbox1 = new global::Gtk.HBox(); - this.hbox1.Name = "hbox1"; - this.hbox1.Spacing = 6; + hbox1 = new HBox {Name = "hbox1", Spacing = 6}; // Container child hbox1.Gtk.Box+BoxChild - this.label1 = new global::Gtk.Label(); - this.label1.Name = "label1"; - this.label1.Xalign = 0F; - this.label1.LabelProp = global::Mono.Unix.Catalog.GetString("Type of component:"); - this.hbox1.Add(this.label1); - global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.label1])); + label1 = new Label {Name = "label1", Xalign = 0F, LabelProp = Catalog.GetString ("Type of component:")}; + hbox1.Add (label1); + var w2 = (Box.BoxChild) hbox1[label1]; w2.Position = 0; w2.Expand = false; w2.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - - this.comboType = new global::Gtk.ComboBoxText(); - this.comboType.Name = "comboType"; - this.hbox1.Add(this.comboType); - global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.comboType])); + comboType = new Gtk.ComboBoxText (); + comboType.Name = "comboType"; + hbox1.Add (comboType); + var w3 = (Box.BoxChild) hbox1[comboType]; w3.Position = 1; // Container child hbox1.Gtk.Box+BoxChild - this.vseparator1 = new global::Gtk.VSeparator(); - this.vseparator1.Name = "vseparator1"; - this.hbox1.Add(this.vseparator1); - global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.vseparator1])); + vseparator1 = new VSeparator {Name = "vseparator1"}; + hbox1.Add (vseparator1); + var w4 = (Box.BoxChild) hbox1[vseparator1]; w4.Position = 2; w4.Expand = false; w4.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.button24 = new global::Gtk.Button(); - this.button24.CanFocus = true; - this.button24.Name = "button24"; + button24 = new Button {CanFocus = true, Name = "button24"}; // Container child button24.Gtk.Container+ContainerChild - this.hbox2 = new global::Gtk.HBox(); - this.hbox2.Name = "hbox2"; - this.hbox2.Spacing = 2; + hbox2 = new HBox {Name = "hbox2", Spacing = 2}; // Container child hbox2.Gtk.Box+BoxChild - this.imageview1 = new global::MonoDevelop.Components.ImageView(); - this.imageview1.Name = "imageview1"; - this.imageview1.IconId = "gtk-add"; - this.hbox2.Add(this.imageview1); - global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.imageview1])); + imageview1 = new ImageView {Name = "imageview1", IconId = "gtk-add", IconSize = IconSize.Menu}; + hbox2.Add (imageview1); + var w5 = (Box.BoxChild) hbox2[imageview1]; w5.Position = 0; w5.Expand = false; w5.Fill = false; // Container child hbox2.Gtk.Box+BoxChild - this.label2 = new global::Gtk.Label(); - this.label2.Name = "label2"; - this.label2.LabelProp = global::Mono.Unix.Catalog.GetString("Add Assembly..."); - this.label2.UseUnderline = true; - this.hbox2.Add(this.label2); - global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.label2])); + label2 = new Label { + Name = "label2", LabelProp = Catalog.GetString ("Add Assembly..."), UseUnderline = true + }; + hbox2.Add (label2); + var w6 = (Box.BoxChild) hbox2[label2]; w6.Position = 1; w6.Expand = false; w6.Fill = false; - this.button24.Add(this.hbox2); - this.hbox1.Add(this.button24); - global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.button24])); + button24.Add (hbox2); + hbox1.Add (button24); + var w8 = (Box.BoxChild) hbox1[button24]; w8.Position = 3; w8.Expand = false; - this.vbox2.Add(this.hbox1); - global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1])); + vbox2.Add (hbox1); + var w9 = (Box.BoxChild) vbox2[hbox1]; w9.Position = 0; w9.Expand = false; w9.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.scrolledwindow1 = new global::Gtk.ScrolledWindow(); - this.scrolledwindow1.CanFocus = true; - this.scrolledwindow1.Name = "scrolledwindow1"; - this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1)); + scrolledwindow1 = + new ScrolledWindow {CanFocus = true, Name = "scrolledwindow1", ShadowType = ShadowType.In}; // Container child scrolledwindow1.Gtk.Container+ContainerChild - this.listView = new global::Gtk.TreeView(); - this.listView.CanFocus = true; - this.listView.Name = "listView"; - this.scrolledwindow1.Add(this.listView); - this.vbox2.Add(this.scrolledwindow1); - global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.scrolledwindow1])); + listView = new TreeView {CanFocus = true, Name = "listView"}; + scrolledwindow1.Add (listView); + vbox2.Add (scrolledwindow1); + var w11 = (Box.BoxChild) vbox2[scrolledwindow1]; w11.Position = 1; // Container child vbox2.Gtk.Box+BoxChild - this.checkGroupByCat = new global::Gtk.CheckButton(); - this.checkGroupByCat.CanFocus = true; - this.checkGroupByCat.Name = "checkGroupByCat"; - this.checkGroupByCat.Label = global::Mono.Unix.Catalog.GetString("Group by component category"); - this.checkGroupByCat.DrawIndicator = true; - this.checkGroupByCat.UseUnderline = true; - this.vbox2.Add(this.checkGroupByCat); - global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.checkGroupByCat])); + checkGroupByCat = new CheckButton { + CanFocus = true, + Name = "checkGroupByCat", + Label = Catalog.GetString ("Group by component category"), + DrawIndicator = true, + UseUnderline = true + }; + vbox2.Add (checkGroupByCat); + var w12 = (Box.BoxChild) vbox2[checkGroupByCat]; w12.Position = 2; w12.Expand = false; w12.Fill = false; - w1.Add(this.vbox2); - global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(w1[this.vbox2])); + w1.Add (vbox2); + var w13 = (Box.BoxChild) w1[vbox2]; w13.Position = 0; // Internal child MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.ActionArea - global::Gtk.HButtonBox w14 = (Gtk.HButtonBox)this.ActionArea; + var w14 = ActionArea; w14.Name = "dialog1_ActionArea"; w14.Spacing = 10; w14.BorderWidth = 5; w14.LayoutStyle = ButtonBoxStyle.End; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild - this.buttonCancel = new global::Gtk.Button(); - this.buttonCancel.CanDefault = true; - this.buttonCancel.CanFocus = true; - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.UseStock = true; - this.buttonCancel.UseUnderline = true; - this.buttonCancel.Label = "gtk-cancel"; - this.AddActionWidget(this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w15 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w14[this.buttonCancel])); + buttonCancel = new Button { + CanDefault = true, + CanFocus = true, + Name = "buttonCancel", + UseStock = true, + UseUnderline = true, + Label = "gtk-cancel" + }; + AddActionWidget (buttonCancel, -6); + var w15 = (ButtonBox.ButtonBoxChild) w14[buttonCancel]; w15.Expand = false; w15.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild - this.buttonOk = new global::Gtk.Button(); - this.buttonOk.CanDefault = true; - this.buttonOk.CanFocus = true; - this.buttonOk.Name = "buttonOk"; - this.buttonOk.UseStock = true; - this.buttonOk.UseUnderline = true; - this.buttonOk.Label = "gtk-ok"; - w14.Add(this.buttonOk); - global::Gtk.ButtonBox.ButtonBoxChild w16 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w14[this.buttonOk])); + buttonOk = new Button { + CanDefault = true, + CanFocus = true, + Name = "buttonOk", + UseStock = true, + UseUnderline = true, + Label = "gtk-ok" + }; + w14.Add (buttonOk); + var w16 = (ButtonBox.ButtonBoxChild) w14[buttonOk]; w16.Position = 1; w16.Expand = false; w16.Fill = false; - if ((this.Child != null)) - { - this.Child.ShowAll(); + if (Child != null) { + Child.ShowAll (); } - this.DefaultWidth = 642; - this.DefaultHeight = 433; - this.Hide(); - this.comboType.Changed += new global::System.EventHandler(this.OnComboTypeChanged); - this.button24.Clicked += new global::System.EventHandler(this.OnButton24Clicked); - this.checkGroupByCat.Clicked += new global::System.EventHandler(this.OnCheckbutton1Clicked); - this.buttonOk.Clicked += new global::System.EventHandler(this.OnButtonOkClicked); + + DefaultWidth = 642; + DefaultHeight = 433; + Hide (); + comboType.Changed += OnComboTypeChanged; + button24.Clicked += OnButton24Clicked; + checkGroupByCat.Clicked += OnCheckbutton1Clicked; + buttonOk.Clicked += OnButtonOkClicked; } } -} +} \ No newline at end of file diff --git a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/gui.stetic b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/gui.stetic index f62463f5c48..f57ca8c7c02 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/gui.stetic +++ b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/gui.stetic @@ -6,7 +6,7 @@ - + @@ -80,6 +80,7 @@ gtk-add + Menu 0 diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourceCellRenderer.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourceCellRenderer.cs index bbd5985699d..ad0f192efae 100644 --- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourceCellRenderer.cs +++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourceCellRenderer.cs @@ -54,34 +54,34 @@ public string Text { const int textSpacing = 7; const int textTopSpacing = 3; - // protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - // { - // base.Render (window, widget, background_area, cell_area, expose_area, flags); + protected override void OnRender (Cairo.Context window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, CellRendererState flags) + { + base.OnRender (window, widget, background_area, cell_area, flags); - // if (PackageSourceViewModel == null) - // return; + if (PackageSourceViewModel == null) + return; - // using (var layout = new Pango.Layout (widget.PangoContext)) { - // layout.Alignment = Pango.Alignment.Left; - // layout.SetMarkup (GetPackageSourceNameMarkup ()); - // int packageSourceNameWidth = GetLayoutWidth (layout); - // StateType state = GetState (widget, flags); - - // layout.SetMarkup (GetPackageSourceDescriptionMarkup (flags)); - - // window.DrawLayout (widget.Style.TextGC (state), cell_area.X + textSpacing, cell_area.Y + textTopSpacing, layout); - - // if (!PackageSourceViewModel.IsValid) { - // using (var ctx = Gdk.CairoHelper.Create (window)) { - // ctx.DrawImage (widget, warningImage, cell_area.X + textSpacing + packageSourceNameWidth + imageSpacing, cell_area.Y + textTopSpacing); - // } - - // layout.SetMarkup (GetPackageSourceErrorMarkup (flags)); - // int packageSourceErrorTextX = cell_area.X + textSpacing + packageSourceNameWidth + (int)warningImage.Width + (2 * imageSpacing); - // window.DrawLayout (widget.Style.TextGC (state), packageSourceErrorTextX, cell_area.Y + textTopSpacing, layout); - // } - // } - // } + using (var layout = new Pango.Layout (widget.PangoContext)) { + layout.Alignment = Pango.Alignment.Left; + layout.SetMarkup (GetPackageSourceNameMarkup ()); + int packageSourceNameWidth = GetLayoutWidth (layout); + StateType state = GetState (widget, flags); + + layout.SetMarkup (GetPackageSourceDescriptionMarkup (flags)); + + //window.DrawLayout (widget.Style.TextGC (state), cell_area.X + textSpacing, cell_area.Y + textTopSpacing, layout); + + if (!PackageSourceViewModel.IsValid) { + //using (var ctx = Gdk.CairoHelper.Create (window)) { + window.DrawImage (widget, warningImage, cell_area.X + textSpacing + packageSourceNameWidth + imageSpacing, cell_area.Y + textTopSpacing); + //} + + layout.SetMarkup (GetPackageSourceErrorMarkup (flags)); + int packageSourceErrorTextX = cell_area.X + textSpacing + packageSourceNameWidth + (int)warningImage.Width + (2 * imageSpacing); + //window.DrawLayout (widget.Style.TextGC (state), packageSourceErrorTextX, cell_area.Y + textTopSpacing, layout); + } + } + } StateType GetState (Widget widget, CellRendererState flags) { @@ -132,15 +132,15 @@ string GetPackageSourceErrorMarkup (CellRendererState flags = CellRendererState. PackageSourceViewModel.ValidationFailureMessage); } - // public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - // { - // base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); + protected override void OnGetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + { + base.OnGetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - // using (var layout = new Pango.Layout (widget.PangoContext)) { - // layout.SetMarkup (GetPackageSourceDescriptionMarkup ()); - // height = GetLayoutSize (layout).Height + 8 + textTopSpacing; - // } - // } + using (var layout = new Pango.Layout (widget.PangoContext)) { + layout.SetMarkup (GetPackageSourceDescriptionMarkup ()); + height = GetLayoutSize (layout).Height + 8 + textTopSpacing; + } + } } } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs index bb70872901f..2eac926e8df 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs @@ -65,7 +65,7 @@ void CheckScreenColormap () // Colormap = Screen.RgbColormap; // SupportsAlpha = false; // } else - SupportsAlpha = true; + SupportsAlpha = false; } protected override void OnScreenChanged (Gdk.Screen previous_screen) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs index c93ae76689b..757b7a9ca7d 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs @@ -930,7 +930,7 @@ protected override void OnRealized () // GdkWindow.Background = Style.Background (StateType.Normal); // Style = Style.Attach (GdkWindow); -// imContext.ClientWindow = this.GdkWindow; + imContext.ClientWindow = this.Window; Caret.PositionChanged += CaretPositionChanged; SetWidgetBgFromStyle (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs index 5ec81843456..41971046dcf 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs @@ -457,7 +457,8 @@ protected override bool OnDrawn (Cairo.Context args) int rwidth, rheight; Cairo.Context ctx = Gdk.CairoHelper.Create (GdkWindow); - + rwidth = win.FrameExtents.Width; + rheight = win.FrameExtents.Height; //win.GetSize (out rwidth, out rheight); if (autoStartY || autoEndY) { @@ -494,20 +495,20 @@ protected override bool OnDrawn (Cairo.Context args) if (yrangeChanged) { FixOrigins (); - //int right = rwidth - 2 - AreaBorderWidth; + int right = rwidth - 2 - AreaBorderWidth; left = AreaBorderWidth; left += MeasureAxisSize (AxisPosition.Left) + 1; - //right -= MeasureAxisSize (AxisPosition.Right) + 1; + right -= MeasureAxisSize (AxisPosition.Right) + 1; yrangeChanged = false; - //width = right - left + 1; + width = right - left + 1; if (width <= 0) width = 1; } if (xrangeChanged) { FixOrigins (); - //int bottom = rheight - 2 - AreaBorderWidth; + int bottom = rheight - 2 - AreaBorderWidth; top = AreaBorderWidth; - //bottom -= MeasureAxisSize (AxisPosition.Bottom); + bottom -= MeasureAxisSize (AxisPosition.Bottom); top += MeasureAxisSize (AxisPosition.Top); // Make room for cursor handles @@ -517,7 +518,7 @@ protected override bool OnDrawn (Cairo.Context args) } xrangeChanged = false; - //height = bottom - top + 1; + height = bottom - top + 1; if (height <= 0) height = 1; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs index de4eaa26052..804990b832c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs @@ -366,6 +366,7 @@ void OnGripExpose (object sender, Gtk.DrawnArgs args) // using (var ctx = CairoHelper.Create (args.Event.Window)) { var ctx = args.Cr; // ctx.SetSourceColor (w.StyleContext.GetBackgroundColor(s).ToCairoColor ()); + ctx.SetSourceColor (new Cairo.Color (0.7, 0.8, 0.9, 0.9)); ctx.Paint (); // } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs index 6b6e3d668ef..906c76587ab 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs @@ -62,7 +62,7 @@ internal DockBar (DockFrame frame, Gtk.PositionType position) filler = new Label (); filler.WidthRequest = 4; filler.HeightRequest = 4; - box.PackEnd (filler, false, true, 0); + box.PackEnd (filler, true, true, 0); ShowAll (); UpdateVisibility (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs index 3a4446c2bd7..a8f7c5b62cc 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs @@ -381,7 +381,7 @@ protected override void OnRealized () attributes.Height = Allocation.Height; attributes.Width = Allocation.Width; attributes.WindowType = Gdk.WindowType.Child; -// attributes.Wclass = Gdk.WindowClass.InputOutput; + attributes.Wclass = Gdk.WindowWindowClass.InputOutput; attributes.Visual = Visual; // attributes.Colormap = Colormap; attributes.EventMask = (int)(Events | diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs index a40505ef8e5..7fec88a381c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs @@ -950,7 +950,7 @@ internal void AddTopLevel (DockFrameTopLevel w, int x, int y, int width, int hei w.Parent = this; w.Size = new Size (width, height); Requisition r = w.SizeRequest (); -// w.Allocation = new Gdk.Rectangle (Allocation.X + x, Allocation.Y + y, r.Width, r.Height); + w.SetAllocation(new Gdk.Rectangle (Allocation.X + x, Allocation.Y + y, r.Width, r.Height)); topLevels.Add (w); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrameTopLevel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrameTopLevel.cs index 2b9350a92d7..ef0a7be000e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrameTopLevel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrameTopLevel.cs @@ -131,6 +131,8 @@ void UpdateWindowPos () Application.Invoke ((o, args) => { var pos = frame.GetScreenCoordinates (new Gdk.Point (x, y)); IdeServices.DesktopService.PlaceWindow (ContainerWindow, pos.X, pos.Y, width, height); + ContainerWindow.Move(pos.X, pos.Y); + ContainerWindow.Resize(width, height); repositionRequested = false; }); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs index 71d31010a62..e3478d107b8 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs @@ -144,7 +144,7 @@ void UpdateVisualStyle () item.GetToolbar (DockPositionType.Right).SetStyle (VisualStyle); item.GetToolbar (DockPositionType.Bottom).SetStyle (VisualStyle); - if (VisualStyle.TabStyle == DockTabStyle.Normal) + //if (VisualStyle.TabStyle == DockTabStyle.Normal) ModifyBg (StateType.Normal, VisualStyle.PadBackgroundColor.Value.ToGdkColor ()); //else //ModifyBg (StateType.Normal, Style.Background(StateType.Normal)); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FixedWidthWrapLabel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FixedWidthWrapLabel.cs index a8b98d7aee6..bacb01fcd59 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FixedWidthWrapLabel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FixedWidthWrapLabel.cs @@ -178,13 +178,13 @@ protected override bool OnDrawn (Cairo.Context evnt) { UpdateLayout (); //if (evnt.Window != GdkWindow) { - // return base.OnExposeEvent (evnt); + return base.OnDrawn (evnt); //} //Gtk.Style.PaintLayout (Style, GdkWindow, State, false, evnt.Area, // this, null, Allocation.X, Allocation.Y, layout); - return true; + //return true; } public string Markup { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs index b2a380bdcfd..bc046a03c7f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs @@ -1004,31 +1004,31 @@ protected override bool OnDrawn (Cairo.Context evnt) } col.CellSetCellData (tree.Model, iter, false, false); - // foreach (CellRenderer cr in col.CellRenderers) { - // if (!cr.Visible) - // continue; + foreach (CellRenderer cr in col.Cells) { + if (!cr.Visible) + continue; - // if (cr is CellRendererText) { - // hasFgColor = ((CellRendererText)cr).GetCellForegroundSet (); - // save = ((CellRendererText)cr).ForegroundGdk; + if (cr is CellRendererText) { + hasFgColor = ((CellRendererText)cr).GetCellForegroundSet (); + save = ((CellRendererText)cr).ForegroundGdk; // ((CellRendererText)cr).ForegroundGdk = Style.Foreground (State); - // } + } - // int sp, wi, he, xo, yo; - // col.CellGetPosition (cr, out sp, out wi); - // Gdk.Rectangle bgrect = new Gdk.Rectangle (x, expose.Y, wi, expose.Height - 2); + int sp, wi, he, xo, yo; + col.CellGetPosition (cr, out sp, out wi); + Gdk.Rectangle bgrect = new Gdk.Rectangle (x, expose.Y, wi, expose.Height - 2); // cr.GetSize (tree, ref bgrect, out xo, out yo, out wi, out he); - // int leftMargin = (int) ((bgrect.Width - wi) * cr.Xalign); + int leftMargin = (int) ((bgrect.Width - wi) * cr.Xalign); // int topMargin = (int) ((bgrect.Height - he) * cr.Yalign); // Gdk.Rectangle cellrect = new Gdk.Rectangle (bgrect.X + leftMargin, bgrect.Y + topMargin + 1, wi, he); // cr.Render (this.GdkWindow, this, bgrect, cellrect, expose, CellRendererState.Focused); - // x += bgrect.Width + col.Spacing + 1; + x += bgrect.Width + col.Spacing + 1; - // if (cr is CellRendererText) { - // ((CellRendererText)cr).ForegroundGdk = save; - // ((CellRendererText)cr).SetCellForegroundSet (hasFgColor); - // } - // } + if (cr is CellRendererText) { + ((CellRendererText)cr).ForegroundGdk = save; + ((CellRendererText)cr).SetCellForegroundSet (hasFgColor); + } + } return true; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs index 01eee0e52be..31f9de87f90 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs @@ -417,7 +417,9 @@ protected override bool OnMotionNotifyEvent (EventMotion e) { if (!buttonPressed) return base.OnMotionNotifyEvent (e); - int winWidth, winHeight; +// int winWidth, winHeight; + int width = Window.FrameExtents.Width; + int height = Window.FrameExtents.Height; // this.GdkWindow.GetSize (out winWidth, out winHeight); SelectedItemIndex = GetRowByPosition ((int)e.Y); return true; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/SignatureHelpParameterHintingData.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/SignatureHelpParameterHintingData.cs index 57f7c823f88..db81c2e237b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/SignatureHelpParameterHintingData.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/SignatureHelpParameterHintingData.cs @@ -130,9 +130,9 @@ public override Task CreateTooltipInformation (TextEditor ed } if (documentation.Count > 0) { - //markup.Append (""); + markup.Append (""); markup.AppendLine (); markup.AppendLine (); markup.AppendTaggedText (theme, documentation, 0, MaxParamColumnCount); @@ -150,7 +150,7 @@ public override Task CreateTooltipInformation (TextEditor ed } if (documentation.Count > 0) { markup.Append (""); markup.AppendLine (); markup.AppendLine (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs index e4eaa662bf9..1811509fdc5 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs @@ -275,7 +275,7 @@ internal void SetDefaultScheme () foreColor = Styles.PopoverWindow.DefaultTextColor.ToCairoColor (); headLabel.ModifyFg (StateType.Normal, foreColor.ToGdkColor ()); headLabel.FontDescription = IdeServices.FontService.GetFontDescription ("Editor").CopyModified (Styles.FontScale11); - //Theme.Font = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11).ToXwtFont (); + Theme.Font = IdeServices.FontService.SansFont.CopyModified (Styles.FontScale11).ToXwtFont (); Theme.ShadowColor = Styles.PopoverWindow.ShadowColor; #pragma warning disable CS0612 // Type or member is obsolete if (this.Visible) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs index 6ef149e0131..d77af439b80 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs @@ -449,7 +449,7 @@ bool CheckAndDrop (int x, int y, bool drop, Gdk.DragContext ctx, object[] obj) NodeBuilder[] chain = nav.BuilderChain; bool foundHandler = false; - //DragOperation oper = ctx.Action == Gdk.DragAction.Copy ? DragOperation.Copy : DragOperation.Move; + DragOperation oper = ctx.SelectedAction == Gdk.DragAction.Copy ? DragOperation.Copy : DragOperation.Move; DropPosition dropPos; if (pos == Gtk.TreeViewDropPosition.After) dropPos = DropPosition.After; @@ -465,16 +465,16 @@ bool CheckAndDrop (int x, int y, bool drop, Gdk.DragContext ctx, object[] obj) try { NodeCommandHandler handler = nb.CommandHandler; handler.SetCurrentNode (nav); - // if (handler.CanDropMultipleNodes (obj, oper, dropPos)) { - // foundHandler = true; - // if (drop) { - // if (!updatesLocked) { - // LockUpdates (); - // updatesLocked = true; - // } - // handler.OnMultipleNodeDrop (obj, oper, dropPos); - // } - // } + if (handler.CanDropMultipleNodes (obj, oper, dropPos)) { + foundHandler = true; + if (drop) { + if (!updatesLocked) { + LockUpdates (); + updatesLocked = true; + } + handler.OnMultipleNodeDrop (obj, oper, dropPos); + } + } } catch (Exception ex) { LoggingService.LogError (ex.ToString ()); } @@ -2510,7 +2510,12 @@ void SetupLayout (Gtk.Widget widget, Gtk.CellRendererState flags = 0) if (scaledFont != null) scaledFont.Dispose (); scaledFont = (customFont ?? parent.widget.Style.FontDesc).Copy (); - scaledFont.Size = (int)(customFont.Size * Zoom); + try { + scaledFont.Size = (int)(customFont.Size * Zoom); + } + catch { + Console.WriteLine("Exception in scaledFont.Size = (int)(customFont.Size * Zoom) in file ExtensibleTreeView.cs"); + } if (layout != null) layout.FontDescription = scaledFont; } @@ -2557,9 +2562,13 @@ protected override void OnRender (Cairo.Context window, Gtk.Widget widget, Gdk.R SetupLayout (widget, flags); - int w, h; - layout.GetPixelSize (out w, out h); - + int w =0, h=0; + try { + layout.GetPixelSize (out w, out h); + } + catch { + Console.WriteLine("Exception in layout.GetPixelSize (out w, out h); in file ExtensibleTreeView.cs"); + } int tx = cell_area.X + (int)Xpad; int ty = cell_area.Y + (cell_area.Height - h) / 2; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs index 714e7f73cc4..4ef1c61100f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs @@ -58,6 +58,7 @@ public ProgressDialog (MonoDevelop.Components.Window parent, bool allowCancel, b this.Build (); this.Title = BrandingService.ApplicationName; this.componentsWindowParent = parent; + this.Resizable = false; //HasSeparator = false; ActionArea.Hide (); DefaultHeight = 5; From c1eaa3f0ee8314bfef9a2aeb2b53bb513dfe1cf6 Mon Sep 17 00:00:00 2001 From: makiwolf Date: Wed, 30 Apr 2025 21:26:05 +0200 Subject: [PATCH 381/382] update --- .../MonoDevelop.FSharp.Gui.csproj | 10 +++++++++ .../MonoDevelop.FSharp.Tests/TestHelpers.fs | 2 +- ...Outline.OutlineSortingPreferencesDialog.cs | 4 ++-- ...ormatting.CSharpFormattingProfileDialog.cs | 4 ++-- ...p.Formatting.NewFormattingProfileDialog.cs | 4 ++-- ...evelop.ChangeLogAddIn.AddLogEntryDialog.cs | 4 ++-- ...oyment.Linux.MenuCategorySelectorDialog.cs | 4 ++-- ...onoDevelop.Deployment.FileReplaceDialog.cs | 4 ++-- ...MonoDevelop.Deployment.Gui.DeployDialog.cs | 4 ++-- ...evelop.Deployment.Gui.EditPackageDialog.cs | 4 ++-- ...onoDevelop.Deployment.Gui.InstallDialog.cs | 4 ++-- ...velop.Autotools.GenerateMakefilesDialog.cs | 4 ++-- ...oDevelop.Autotools.MakefileSwitchEditor.cs | 4 ++-- ...oDevelop.Debugger.AttachToProcessDialog.cs | 4 ++-- ...onoDevelop.Debugger.BusyEvaluatorDialog.cs | 4 ++-- ...Develop.Debugger.DebugApplicationDialog.cs | 4 ++-- ...elop.Debugger.ExpressionEvaluatorDialog.cs | 4 ++-- ....Debugger.Viewers.ValueVisualizerDialog.cs | 4 ++-- ...Support.Toolbox.ComponentSelectorDialog.cs | 2 +- ...Gettext.TranslationProjectOptionsDialog.cs | 4 ++-- ...ettext.Translator.LanguageChooserDialog.cs | 4 ++-- ...op.Refactoring.RefactoringPreviewDialog.cs | 4 ++-- ...lop.Refactoring.Rename.RenameItemDialog.cs | 4 ++-- ...g.SignatureChange.SignatureChangeDialog.cs | 4 ++-- ...Editor.OptionPanels.NewColorShemeDialog.cs | 4 ++-- ...ebReferences.Dialogs.UserPasswordDialog.cs | 4 ++-- ...ebReferences.Dialogs.WebReferenceDialog.cs | 4 ++-- ...ionControl.Git.ConflictResolutionDialog.cs | 4 ++-- ...op.VersionControl.Git.CredentialsDialog.cs | 4 ++-- ...lop.VersionControl.Git.EditBranchDialog.cs | 4 ++-- ...lop.VersionControl.Git.EditRemoteDialog.cs | 4 ++-- ...rsionControl.Git.GitConfigurationDialog.cs | 4 ++-- ...oDevelop.VersionControl.Git.MergeDialog.cs | 4 ++-- ...velop.VersionControl.Git.NewStashDialog.cs | 4 ++-- ...noDevelop.VersionControl.Git.PushDialog.cs | 4 ++-- ...p.VersionControl.Git.StashManagerDialog.cs | 4 ++-- ....VersionControl.Git.UserGitConfigDialog.cs | 4 ++-- ...rsionControl.Git.UserInfoConflictDialog.cs | 4 ++-- ....Subversion.Gui.ClientCertificateDialog.cs | 4 ++-- ...ion.Gui.ClientCertificatePasswordDialog.cs | 4 ++-- ...rol.Subversion.Gui.SslServerTrustDialog.cs | 4 ++-- ...ntrol.Subversion.Gui.UserPasswordDialog.cs | 4 ++-- ...lop.VersionControl.Dialogs.CommitDialog.cs | 4 ++-- ...ionControl.Dialogs.EditRepositoryDialog.cs | 4 ++-- ...nControl.Dialogs.SelectRepositoryDialog.cs | 4 ++-- ...op.Ide.CodeTemplates.EditTemplateDialog.cs | 4 ++-- ...Ide.Execution.CustomExecutionModeDialog.cs | 4 ++-- ...cution.CustomExecutionModeManagerDialog.cs | 4 ++-- ...velop.Ide.FindInFiles.FindInFilesDialog.cs | 4 ++-- ...op.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs | 4 ++-- ...elop.Ide.Gui.Dialogs.MultiMessageDialog.cs | 4 ++-- ...Ide.Gui.Dialogs.MultiTaskProgressDialog.cs | 4 ++-- ...Develop.Ide.Gui.Dialogs.NewLayoutDialog.cs | 4 ++-- ...oDevelop.Ide.Gui.Dialogs.ProgressDialog.cs | 4 ++-- ....Ide.Gui.Dialogs.SelectFileFormatDialog.cs | 4 ++-- ...elop.Ide.Projects.AddExternalFileDialog.cs | 4 ++-- ...oDevelop.Ide.Projects.AddMimeTypeDialog.cs | 4 ++-- ...oDevelop.Ide.Projects.ApplyPolicyDialog.cs | 4 ++-- ...Ide.Projects.ConfirmProjectDeleteDialog.cs | 4 ++-- ...Develop.Ide.Projects.DeleteConfigDialog.cs | 4 ++-- ....Ide.Projects.ExportProjectPolicyDialog.cs | 4 ++-- ...velop.Ide.Projects.ExportSolutionDialog.cs | 4 ++-- ....Ide.Projects.ImportProjectPolicyDialog.cs | 4 ++-- ...elop.Ide.Projects.IncludeNewFilesDialog.cs | 4 ++-- .../MonoDevelop.Ide.Projects.NewFileDialog.cs | 5 +++-- ...Develop.Ide.Projects.NewPolicySetDialog.cs | 4 ++-- ....Ide.Projects.ProjectFileSelectorDialog.cs | 4 ++-- ...elop.Ide.Projects.ProjectSelectorDialog.cs | 4 ++-- ...Develop.Ide.Projects.RenameConfigDialog.cs | 4 ++-- ...elop.Ide.Projects.SelectReferenceDialog.cs | 4 ++-- .../MonoDevelop.Ide.SelectEncodingsDialog.cs | 4 ++-- .../MonoDevelop.Components.Docking/DockBar.cs | 2 ++ .../PropertyEditorCell.cs | 22 +++++++++---------- .../PropertyGridTable.cs | 2 +- .../MonoDevelop.Components/GtkUtil.cs | 11 +++++++--- .../MonoDevelop.Components/SectionList.cs | 2 +- .../GtkDocumentToolbar.cs | 2 +- .../AssemblyReferencePanel.cs | 4 ++-- .../MonoDevelop.Ide.Projects/NewFileDialog.cs | 5 ++--- .../PackageReferencePanel.cs | 4 ++-- .../SelectReferenceDialog.cs | 12 +++++----- 81 files changed, 185 insertions(+), 168 deletions(-) diff --git a/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/MonoDevelop.FSharp.Gui.csproj b/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/MonoDevelop.FSharp.Gui.csproj index ff668a3d859..d31c10857f8 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/MonoDevelop.FSharp.Gui.csproj +++ b/main/external/fsharpbinding/MonoDevelop.FSharp.Gui/MonoDevelop.FSharp.Gui.csproj @@ -20,6 +20,16 @@ + + + + + + + + + + diff --git a/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/TestHelpers.fs b/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/TestHelpers.fs index 097b94fea12..b3d0f6c94ec 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/TestHelpers.fs +++ b/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/TestHelpers.fs @@ -24,7 +24,7 @@ module FixtureSetup = //Environment.SetEnvironmentVariable ("MONO_ADDINS_REGISTRY", "/tmp") //Environment.SetEnvironmentVariable ("XDG_CONFIG_HOME", "/tmp") MonoDevelop.FSharp.MDLanguageService.DisableVirtualFileSystem() - Xwt.Application.Initialize (Xwt.ToolkitType.Gtk3) + //Xwt.Application.Initialize (Xwt.ToolkitType.Gtk3) Runtime.Initialize (true) do! IdeApp.Initialize ((new ConsoleProgressMonitor())) do! Runtime.GetService () diff --git a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.cs b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.cs index 1e3fe30a05e..9b464973ba0 100644 --- a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.cs +++ b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.cs @@ -25,7 +25,7 @@ protected virtual void Build () this.DestroyWithParent = true; // Internal child MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.VBox #if GTK3 - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; #else global::Gtk.VBox w1 = this.VBox; #endif @@ -58,7 +58,7 @@ protected virtual void Build () w4.Position = 0; // Internal child MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.ActionArea #if GTK3 - global::Gtk.HButtonBox w5 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w5 = this.ActionArea; #else global::Gtk.HButtonBox w5 = this.ActionArea; #endif diff --git a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs index c40013d81eb..9f9091aebc2 100644 --- a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs +++ b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs @@ -69,7 +69,7 @@ protected virtual void Build () this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.VBox #if GTK3 - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; #else global::Gtk.VBox w1 = this.VBox; #endif @@ -255,7 +255,7 @@ protected virtual void Build () w22.Position = 0; // Internal child MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.ActionArea #if GTK3 - global::Gtk.HButtonBox w23 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w23 = this.ActionArea; #else global::Gtk.HButtonBox w23 = this.ActionArea; #endif diff --git a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.cs b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.cs index f5dea728c9c..f0e4efa1092 100644 --- a/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.cs +++ b/main/src/addins/CSharpBinding/Gui/MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.cs @@ -28,7 +28,7 @@ protected virtual void Build () this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.VBox #if GTK3 - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; #else global::Gtk.VBox w1 = this.VBox; #endif @@ -91,7 +91,7 @@ protected virtual void Build () w6.Fill = false; // Internal child MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.ActionArea #if GTK3 - global::Gtk.HButtonBox w7 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w7 = this.ActionArea; #else global::Gtk.HButtonBox w7 = this.ActionArea; #endif diff --git a/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs b/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs index 3785f2d189d..5b1c28b4a24 100644 --- a/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs +++ b/main/src/addins/ChangeLogAddIn/Gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs @@ -58,7 +58,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Events = ((global::Gdk.EventMask)(256)); w1.Name = "dialog_VBox"; w1.Spacing = 6; @@ -243,7 +243,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox1])); w21.Position = 0; // Internal child MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.ActionArea - global::Gtk.HButtonBox w22 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w22 = this.ActionArea; w22.Events = ((global::Gdk.EventMask)(256)); w22.Name = "ChangeLogAddIn.AddLogEntryDialog_ActionArea"; w22.Spacing = 6; diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/Gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/Gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs index 9c2609cb98d..cb64194bc73 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/Gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/Gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs @@ -20,7 +20,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Menu Category Selection"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -55,7 +55,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5])); w5.Position = 0; // Internal child MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.ActionArea - global::Gtk.HButtonBox w6 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w6 = this.ActionArea; w6.Name = "dialog1_ActionArea"; w6.Spacing = 10; w6.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.FileReplaceDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.FileReplaceDialog.cs index aeecc2b19f8..7cf13ab1e4a 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.FileReplaceDialog.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.FileReplaceDialog.cs @@ -92,7 +92,7 @@ protected virtual void Build () this.Resizable = false; // this.AllowGrow = false; // Internal child MonoDevelop.Deployment.FileReplaceDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.Spacing = 4; w1.BorderWidth = ((uint)(2)); @@ -418,7 +418,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w37 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox2])); w37.Position = 2; // Internal child MonoDevelop.Deployment.FileReplaceDialog.ActionArea - global::Gtk.HButtonBox w38 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w38 = this.ActionArea; w38.Name = "dialog1_ActionArea"; w38.Spacing = 6; w38.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.DeployDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.DeployDialog.cs index b475424ddcf..bb5f682b606 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.DeployDialog.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.DeployDialog.cs @@ -119,7 +119,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Create Package"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Deployment.Gui.DeployDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Events = ((global::Gdk.EventMask)(256)); w1.Name = "dialog_VBox"; w1.BorderWidth = ((uint)(2)); @@ -562,7 +562,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w47 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox1])); w47.Position = 0; // Internal child MonoDevelop.Deployment.Gui.DeployDialog.ActionArea - global::Gtk.HButtonBox w48 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w48 = this.ActionArea; w48.Name = "MonoDevelop.Deployment.DeployDialog_ActionArea"; w48.Spacing = 6; w48.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs index 3a244163c91..d4d24b52835 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs @@ -29,7 +29,7 @@ protected virtual void Build () this.Name = "MonoDevelop.Deployment.Gui.EditPackageDialog"; this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Deployment.Gui.EditPackageDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -151,7 +151,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w13.Position = 0; // Internal child MonoDevelop.Deployment.Gui.EditPackageDialog.ActionArea - global::Gtk.HButtonBox w14 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w14 = this.ActionArea; w14.Name = "dialog1_ActionArea"; w14.Spacing = 6; w14.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.InstallDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.InstallDialog.cs index a099d4003af..1949ac54359 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.InstallDialog.cs +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/Gui/MonoDevelop.Deployment.Gui.InstallDialog.cs @@ -22,7 +22,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Install Project"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Deployment.Gui.InstallDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Events = ((global::Gdk.EventMask)(256)); w1.Name = "dialog_VBox"; w1.BorderWidth = ((uint)(2)); @@ -85,7 +85,7 @@ protected virtual void Build () w7.Expand = false; w7.Fill = false; // Internal child MonoDevelop.Deployment.Gui.InstallDialog.ActionArea - global::Gtk.HButtonBox w8 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w8 = this.ActionArea; w8.Name = "MonoDevelop.Deployment.InstallDialog_ActionArea"; w8.Spacing = 10; w8.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs b/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs index 21e6ec3477b..c3e2660f5c7 100644 --- a/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs +++ b/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs @@ -29,7 +29,7 @@ protected virtual void Build () this.Resizable = false; // this.AllowGrow = false; // Internal child MonoDevelop.Autotools.GenerateMakefilesDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -151,7 +151,7 @@ protected virtual void Build () w13.Expand = false; w13.Fill = false; // Internal child MonoDevelop.Autotools.GenerateMakefilesDialog.ActionArea - global::Gtk.HButtonBox w14 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w14 = this.ActionArea; w14.Name = "dialog1_ActionArea"; w14.Spacing = 6; w14.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.MakefileSwitchEditor.cs b/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.MakefileSwitchEditor.cs index 00a615a549e..b445f3b097b 100644 --- a/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.MakefileSwitchEditor.cs +++ b/main/src/addins/MonoDevelop.Autotools/Gui/MonoDevelop.Autotools.MakefileSwitchEditor.cs @@ -16,7 +16,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Switch editor"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Autotools.MakefileSwitchEditor.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -26,7 +26,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(w1 [this.align])); w2.Position = 0; // Internal child MonoDevelop.Autotools.MakefileSwitchEditor.ActionArea - global::Gtk.HButtonBox w3 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w3 = this.ActionArea; w3.Name = "dialog1_ActionArea"; w3.Spacing = 6; w3.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.AttachToProcessDialog.cs b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.AttachToProcessDialog.cs index d53583a10e1..8e63e7e1990 100644 --- a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.AttachToProcessDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.AttachToProcessDialog.cs @@ -25,7 +25,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(3)); // Internal child MonoDevelop.Debugger.AttachToProcessDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -103,7 +103,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w10.Position = 0; // Internal child MonoDevelop.Debugger.AttachToProcessDialog.ActionArea - global::Gtk.HButtonBox w11 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w11 = this.ActionArea; w11.Name = "dialog1_ActionArea"; w11.Spacing = 6; w11.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.BusyEvaluatorDialog.cs b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.BusyEvaluatorDialog.cs index cccf0382dff..91521e29607 100644 --- a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.BusyEvaluatorDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.BusyEvaluatorDialog.cs @@ -19,7 +19,7 @@ protected virtual void Build() this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.Resizable = false; // Internal child MonoDevelop.Debugger.BusyEvaluatorDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -41,7 +41,7 @@ protected virtual void Build() global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(w1[this.vbox2])); w3.Position = 0; // Internal child MonoDevelop.Debugger.BusyEvaluatorDialog.ActionArea - global::Gtk.HButtonBox w4 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w4 = this.ActionArea; w4.Name = "dialog1_ActionArea"; w4.Spacing = 10; w4.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.DebugApplicationDialog.cs b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.DebugApplicationDialog.cs index 933a58aede6..ef77a99212e 100644 --- a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.DebugApplicationDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.DebugApplicationDialog.cs @@ -36,7 +36,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Debug Application"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Debugger.DebugApplicationDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -141,7 +141,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5])); w11.Position = 0; // Internal child MonoDevelop.Debugger.DebugApplicationDialog.ActionArea - global::Gtk.HButtonBox w12 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w12 = this.ActionArea; w12.Name = "dialog1_ActionArea"; w12.Spacing = 10; w12.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs index 4940df8049a..115bff64028 100644 --- a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs @@ -20,7 +20,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Expression Evaluator"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Debugger.ExpressionEvaluatorDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -81,7 +81,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w7.Position = 0; // Internal child MonoDevelop.Debugger.ExpressionEvaluatorDialog.ActionArea - global::Gtk.HButtonBox w8 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w8 = this.ActionArea; w8.Name = "dialog1_ActionArea"; w8.Spacing = 6; w8.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.Viewers.ValueVisualizerDialog.cs b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.Viewers.ValueVisualizerDialog.cs index c71ae9855d2..c1158e73f49 100644 --- a/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.Viewers.ValueVisualizerDialog.cs +++ b/main/src/addins/MonoDevelop.Debugger/Gui/MonoDevelop.Debugger.Viewers.ValueVisualizerDialog.cs @@ -22,7 +22,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Value Visualizer"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Debugger.Viewers.ValueVisualizerDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -52,7 +52,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.mainBox])); w4.Position = 0; // Internal child MonoDevelop.Debugger.Viewers.ValueVisualizerDialog.ActionArea - global::Gtk.HButtonBox w5 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w5 = this.ActionArea; w5.Name = "dialog1_ActionArea"; w5.Spacing = 10; w5.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs index 4bb76426b79..c68d8d72544 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs @@ -46,7 +46,7 @@ protected virtual void Build () Title = Catalog.GetString ("Toolbox Item Selector"); WindowPosition = WindowPosition.CenterOnParent; // Internal child MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = 2; // Container child dialog1_VBox.Gtk.Box+BoxChild diff --git a/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs b/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs index 8ebefda2f9d..3627a485899 100644 --- a/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs +++ b/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs @@ -42,7 +42,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Gettext.TranslationProjectOptionsDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -248,7 +248,7 @@ protected virtual void Build () w23.Expand = false; w23.Fill = false; // Internal child MonoDevelop.Gettext.TranslationProjectOptionsDialog.ActionArea - global::Gtk.HButtonBox w24 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w24 = this.ActionArea; w24.Name = "dialog1_ActionArea"; w24.Spacing = 6; w24.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs b/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs index de130dfea3f..f131b45c4a8 100644 --- a/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs +++ b/main/src/addins/MonoDevelop.Gettext/Gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs @@ -43,7 +43,7 @@ protected virtual void Build () this.Gravity = ((global::Gdk.Gravity)(5)); this.SkipTaskbarHint = true; // Internal child MonoDevelop.Gettext.Translator.LanguageChooserDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Events = ((global::Gdk.EventMask)(256)); w1.Name = "dialog_VBox"; w1.BorderWidth = ((uint)(2)); @@ -205,7 +205,7 @@ protected virtual void Build () w19.Expand = false; w19.Fill = false; // Internal child MonoDevelop.Gettext.Translator.LanguageChooserDialog.ActionArea - global::Gtk.HButtonBox w20 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w20 = this.ActionArea; w20.Name = "MonoDevelop.Gettext.LanguageChooserDialog_ActionArea"; w20.Spacing = 6; w20.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.RefactoringPreviewDialog.cs b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.RefactoringPreviewDialog.cs index cffa949d889..13b49f1654b 100644 --- a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.RefactoringPreviewDialog.cs +++ b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.RefactoringPreviewDialog.cs @@ -25,7 +25,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Refactoring.RefactoringPreviewDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -59,7 +59,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w5.Position = 0; // Internal child MonoDevelop.Refactoring.RefactoringPreviewDialog.ActionArea - global::Gtk.HButtonBox w6 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w6 = this.ActionArea; w6.Name = "dialog1_ActionArea"; w6.Spacing = 10; w6.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs index 2353c141819..1c9d2adc1f8 100644 --- a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs +++ b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs @@ -37,7 +37,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Refactoring.Rename.RenameItemDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -132,7 +132,7 @@ protected virtual void Build () w10.Expand = false; w10.Fill = false; // Internal child MonoDevelop.Refactoring.Rename.RenameItemDialog.ActionArea - global::Gtk.HButtonBox w11 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w11 = this.ActionArea; w11.Name = "dialog1_ActionArea"; w11.Spacing = 10; w11.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.cs b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.cs index e2340114422..6bc27ca82f8 100644 --- a/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.cs +++ b/main/src/addins/MonoDevelop.Refactoring/Gui/MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.cs @@ -44,7 +44,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.Spacing = 6; w1.BorderWidth = ((uint)(2)); @@ -167,7 +167,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w14.Position = 0; // Internal child MonoDevelop.Refactoring.SignatureChange.SignatureChangeDialog.ActionArea - global::Gtk.HButtonBox w15 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w15 = this.ActionArea; w15.Name = "dialog1_ActionArea"; w15.Spacing = 10; w15.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.cs b/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.cs index 338ea74461f..d83547f0baa 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Gui/MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.cs @@ -31,7 +31,7 @@ protected virtual void Build() this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -115,7 +115,7 @@ protected virtual void Build() w8.Expand = false; w8.Fill = false; // Internal child MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.ActionArea - global::Gtk.HButtonBox w9 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w9 = this.ActionArea; w9.Name = "dialog1_ActionArea"; w9.Spacing = 10; w9.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.UserPasswordDialog.cs b/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.UserPasswordDialog.cs index f0848b51b87..37b7d905917 100644 --- a/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.UserPasswordDialog.cs +++ b/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.UserPasswordDialog.cs @@ -22,7 +22,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Credentials"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.WebReferences.Dialogs.UserPasswordDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -100,7 +100,7 @@ protected virtual void Build () w8.Expand = false; w8.Fill = false; // Internal child MonoDevelop.WebReferences.Dialogs.UserPasswordDialog.ActionArea - global::Gtk.HButtonBox w9 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w9 = this.ActionArea; w9.Name = "dialog1_ActionArea"; w9.Spacing = 10; w9.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs b/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs index bb094aaaf85..096afbdbbb1 100644 --- a/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs +++ b/main/src/addins/MonoDevelop.WebReferences/Gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs @@ -77,7 +77,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Add Web Reference"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.VBox - global::Gtk.VBox w2 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w2 = this.ContentArea; w2.Events = ((global::Gdk.EventMask)(256)); w2.Name = "dlgWindow"; w2.BorderWidth = ((uint)(2)); @@ -244,7 +244,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(w2 [this.vbxContainer])); w17.Position = 0; // Internal child MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.ActionArea - global::Gtk.HButtonBox w18 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w18 = this.ActionArea; w18.Events = ((global::Gdk.EventMask)(256)); w18.Name = "pnlActionArea"; w18.Spacing = 6; diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.ConflictResolutionDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.ConflictResolutionDialog.cs index dfab6e27f6f..d233047f8dc 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.ConflictResolutionDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.ConflictResolutionDialog.cs @@ -19,7 +19,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Merge Conflict Resolution"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.ConflictResolutionDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -49,7 +49,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w4.Position = 0; // Internal child MonoDevelop.VersionControl.Git.ConflictResolutionDialog.ActionArea - global::Gtk.HButtonBox w5 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w5 = this.ActionArea; w5.Name = "dialog1_ActionArea"; w5.Spacing = 10; w5.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.CredentialsDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.CredentialsDialog.cs index 2046aae8ae6..ea803838386 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.CredentialsDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.CredentialsDialog.cs @@ -22,7 +22,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Git Credentials"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.CredentialsDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -57,7 +57,7 @@ protected virtual void Build () w4.Expand = false; w4.Fill = false; // Internal child MonoDevelop.VersionControl.Git.CredentialsDialog.ActionArea - global::Gtk.HButtonBox w5 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w5 = this.ActionArea; w5.Name = "dialog1_ActionArea"; w5.Spacing = 10; w5.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditBranchDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditBranchDialog.cs index 685176dd193..c71eda2436b 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditBranchDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditBranchDialog.cs @@ -32,7 +32,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Branch Properties"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.EditBranchDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -112,7 +112,7 @@ protected virtual void Build () w9.Expand = false; w9.Fill = false; // Internal child MonoDevelop.VersionControl.Git.EditBranchDialog.ActionArea - global::Gtk.HButtonBox w10 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w10 = this.ActionArea; w10.Name = "dialog1_ActionArea"; w10.Spacing = 10; w10.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditRemoteDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditRemoteDialog.cs index 35136ef03ed..c5849454565 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditRemoteDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.EditRemoteDialog.cs @@ -34,7 +34,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Remote Source"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.EditRemoteDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -138,7 +138,7 @@ protected virtual void Build () w10.Expand = false; w10.Fill = false; // Internal child MonoDevelop.VersionControl.Git.EditRemoteDialog.ActionArea - global::Gtk.HButtonBox w11 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w11 = this.ActionArea; w11.Name = "dialog1_ActionArea"; w11.Spacing = 10; w11.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs index 62826d36538..851adf96fde 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs @@ -46,7 +46,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Git Repository Configuration"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.GitConfigurationDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -331,7 +331,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(w1 [this.notebook1])); w30.Position = 0; // Internal child MonoDevelop.VersionControl.Git.GitConfigurationDialog.ActionArea - global::Gtk.HButtonBox w31 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w31 = this.ActionArea; w31.Name = "dialog1_ActionArea"; w31.Spacing = 10; w31.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.MergeDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.MergeDialog.cs index 712299b5940..58de1666848 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.MergeDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.MergeDialog.cs @@ -27,7 +27,7 @@ protected virtual void Build () this.Name = "MonoDevelop.VersionControl.Git.MergeDialog"; this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.MergeDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -86,7 +86,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w7.Position = 0; // Internal child MonoDevelop.VersionControl.Git.MergeDialog.ActionArea - global::Gtk.HButtonBox w8 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w8 = this.ActionArea; w8.Name = "dialog1_ActionArea"; w8.Spacing = 10; w8.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.NewStashDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.NewStashDialog.cs index 428c2c0a960..ace4a552d25 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.NewStashDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.NewStashDialog.cs @@ -18,7 +18,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Stash"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.NewStashDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -50,7 +50,7 @@ protected virtual void Build () w4.Expand = false; w4.Fill = false; // Internal child MonoDevelop.VersionControl.Git.NewStashDialog.ActionArea - global::Gtk.HButtonBox w5 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w5 = this.ActionArea; w5.Name = "dialog1_ActionArea"; w5.Spacing = 10; w5.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.PushDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.PushDialog.cs index ed711ae82ff..2484988dd11 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.PushDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.PushDialog.cs @@ -22,7 +22,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Push to Repository"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.PushDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -81,7 +81,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w8.Position = 0; // Internal child MonoDevelop.VersionControl.Git.PushDialog.ActionArea - global::Gtk.HButtonBox w9 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w9 = this.ActionArea; w9.Name = "dialog1_ActionArea"; w9.Spacing = 10; w9.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.StashManagerDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.StashManagerDialog.cs index 94cfd41189b..6b8118930a4 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.StashManagerDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.StashManagerDialog.cs @@ -23,7 +23,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Stash Manager"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.StashManagerDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -109,7 +109,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox2])); w10.Position = 0; // Internal child MonoDevelop.VersionControl.Git.StashManagerDialog.ActionArea - global::Gtk.HButtonBox w11 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w11 = this.ActionArea; w11.Name = "dialog1_ActionArea"; w11.Spacing = 10; w11.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserGitConfigDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserGitConfigDialog.cs index 0e26500e2df..ca05b45127b 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserGitConfigDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserGitConfigDialog.cs @@ -33,7 +33,7 @@ protected virtual void Build () this.Name = "MonoDevelop.VersionControl.Git.UserGitConfigDialog"; this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.UserGitConfigDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -108,7 +108,7 @@ protected virtual void Build () w10.Expand = false; w10.Fill = false; // Internal child MonoDevelop.VersionControl.Git.UserGitConfigDialog.ActionArea - global::Gtk.HButtonBox w11 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w11 = this.ActionArea; w11.Name = "dialog1_ActionArea"; w11.Spacing = 10; w11.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserInfoConflictDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserInfoConflictDialog.cs index 4a9a0251247..0bf7316317e 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserInfoConflictDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/Gui/MonoDevelop.VersionControl.Git.UserInfoConflictDialog.cs @@ -25,7 +25,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("User Information Conflict"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.VersionControl.Git.UserInfoConflictDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -119,7 +119,7 @@ protected virtual void Build () w11.Expand = false; w11.Fill = false; // Internal child MonoDevelop.VersionControl.Git.UserInfoConflictDialog.ActionArea - global::Gtk.HButtonBox w12 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w12 = this.ActionArea; w12.Name = "dialog1_ActionArea"; w12.Spacing = 10; w12.BorderWidth = ((uint)(5)); diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs index d0e64732fb5..d01d560392e 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs @@ -23,7 +23,7 @@ protected virtual void Build () this.Name = "MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog"; this.Title = global::Mono.Unix.Catalog.GetString ("Client Certificate Required"); // Internal child MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Events = ((global::Gdk.EventMask)(256)); w1.Name = "dialog_VBox"; w1.BorderWidth = ((uint)(2)); @@ -106,7 +106,7 @@ protected virtual void Build () w9.Expand = false; w9.Fill = false; // Internal child MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.ActionArea - global::Gtk.HButtonBox w10 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w10 = this.ActionArea; w10.Events = ((global::Gdk.EventMask)(256)); w10.Name = "MonoDevelop.VersionControl.Subversion.ClientCertificateDialog_ActionArea"; w10.Spacing = 10; diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs index 19410b8df16..9636abeb280 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs @@ -23,7 +23,7 @@ protected virtual void Build () this.Name = "MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog"; this.Title = global::Mono.Unix.Catalog.GetString ("Password for client certificate"); // Internal child MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Events = ((global::Gdk.EventMask)(256)); w1.Name = "dialog_VBox"; w1.BorderWidth = ((uint)(2)); @@ -110,7 +110,7 @@ protected virtual void Build () w9.Expand = false; w9.Fill = false; // Internal child MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.ActionArea - global::Gtk.HButtonBox w10 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w10 = this.ActionArea; w10.Events = ((global::Gdk.EventMask)(256)); w10.Name = "MonoDevelop.VersionControl.Subversion.ClientCertificatePasswordDialog_ActionArea"; w10.Spacing = 10; diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs index 08b7d1ddaab..01797373eef 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs @@ -67,7 +67,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Repository Certified by an Unknown Authority"); this.Modal = true; // Internal child MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Events = ((global::Gdk.EventMask)(256)); w1.Name = "dialog_VBox"; w1.BorderWidth = ((uint)(2)); @@ -340,7 +340,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox1])); w26.Position = 0; // Internal child MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.ActionArea - global::Gtk.HButtonBox w27 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w27 = this.ActionArea; w27.Events = ((global::Gdk.EventMask)(256)); w27.Name = "MonoDevelop.VersionControl.Subversion.SslServerTrustDialog_ActionArea"; w27.Spacing = 10; diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs index 53e3e48c5f5..ed5e72dfda8 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs @@ -27,7 +27,7 @@ protected virtual void Build () this.Resizable = false; //this.AllowGrow = false; // Internal child MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Events = ((global::Gdk.EventMask)(256)); w1.Name = "dialog_VBox"; w1.BorderWidth = ((uint)(2)); @@ -127,7 +127,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w10.Position = 0; // Internal child MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.ActionArea - global::Gtk.HButtonBox w11 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w11 = this.ActionArea; w11.Events = ((global::Gdk.EventMask)(256)); w11.Name = "MonoDevelop.VersionControl.Subversion.UserPasswordDialog_ActionArea"; w11.Spacing = 10; diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs index eeac2698aff..da5ecad00e3 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs @@ -27,7 +27,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.VersionControl.Dialogs.CommitDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Events = ((global::Gdk.EventMask)(256)); w1.Name = "dialog_VBox"; w1.Spacing = 6; @@ -119,7 +119,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(w1 [this.mainBox])); w11.Position = 0; // Internal child MonoDevelop.VersionControl.Dialogs.CommitDialog.ActionArea - global::Gtk.HButtonBox w12 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w12 = this.ActionArea; w12.Events = ((global::Gdk.EventMask)(256)); w12.Name = "VersionControlAddIn.CommitDialog_ActionArea"; w12.Spacing = 6; diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs index f7cb921fabf..e91fcddd9e6 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs @@ -25,7 +25,7 @@ protected virtual void Build () this.BorderWidth = ((uint)(6)); this.DefaultWidth = 500; // Internal child MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Events = ((global::Gdk.EventMask)(256)); w1.Name = "dialog-vbox3"; w1.Spacing = 6; @@ -104,7 +104,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox1])); w9.Position = 0; // Internal child MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.ActionArea - global::Gtk.HButtonBox w10 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w10 = this.ActionArea; w10.Events = ((global::Gdk.EventMask)(256)); w10.Name = "GtkDialog_ActionArea"; w10.Spacing = 10; diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs index 847e9b5ac8d..b8d69964ac4 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs @@ -76,7 +76,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Events = ((global::Gdk.EventMask)(256)); w1.Name = "dialog_VBox"; w1.Spacing = 6; @@ -346,7 +346,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox1])); w28.Position = 0; // Internal child MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.ActionArea - global::Gtk.HButtonBox w29 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w29 = this.ActionArea; w29.Events = ((global::Gdk.EventMask)(256)); w29.Name = "VersionControlAddIn.SelectRepositoryDialog_ActionArea"; w29.Spacing = 10; diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs index d96647117d3..30987f0a42e 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs @@ -43,7 +43,7 @@ protected virtual void Build () this.SkipPagerHint = true; this.SkipTaskbarHint = true; // Internal child MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.Spacing = 6; w1.BorderWidth = ((uint)(2)); @@ -284,7 +284,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(w1 [this.hpaned1])); w27.Position = 0; // Internal child MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.ActionArea - global::Gtk.HButtonBox w28 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w28 = this.ActionArea; w28.Name = "dialog1_ActionArea"; w28.Spacing = 6; w28.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.CustomExecutionModeDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.CustomExecutionModeDialog.cs index 69f27fe1f05..10806e61743 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.CustomExecutionModeDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.CustomExecutionModeDialog.cs @@ -31,7 +31,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.Modal = true; // Internal child MonoDevelop.Ide.Execution.CustomExecutionModeDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -183,7 +183,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(w1 [this.boxEditor])); w17.Position = 0; // Internal child MonoDevelop.Ide.Execution.CustomExecutionModeDialog.ActionArea - global::Gtk.HButtonBox w18 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w18 = this.ActionArea; w18.Name = "dialog1_ActionArea"; w18.Spacing = 10; w18.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.CustomExecutionModeManagerDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.CustomExecutionModeManagerDialog.cs index 56fd68bc2cb..ebec7fbb147 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.CustomExecutionModeManagerDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Execution.CustomExecutionModeManagerDialog.cs @@ -21,7 +21,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Custom Execution Modes"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Execution.CustomExecutionModeManagerDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -97,7 +97,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w9.Position = 0; // Internal child MonoDevelop.Ide.Execution.CustomExecutionModeManagerDialog.ActionArea - global::Gtk.HButtonBox w10 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w10 = this.ActionArea; w10.Name = "dialog1_ActionArea"; w10.Spacing = 10; w10.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs index ef07c667200..25c1147362c 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs @@ -53,7 +53,7 @@ protected virtual void Build () this.SkipPagerHint = true; this.SkipTaskbarHint = true; // Internal child MonoDevelop.Ide.FindInFiles.FindInFilesDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.Spacing = 6; w1.BorderWidth = ((uint)(2)); @@ -223,7 +223,7 @@ protected virtual void Build () w17.Expand = false; w17.Fill = false; // Internal child MonoDevelop.Ide.FindInFiles.FindInFilesDialog.ActionArea - global::Gtk.HButtonBox w18 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w18 = this.ActionArea; w18.Name = "dialog1_ActionArea"; w18.Spacing = 6; w18.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs index 77c33c85d9f..aeadd72b1fd 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs @@ -33,7 +33,7 @@ protected virtual void Build () this.BorderWidth = ((uint)(6)); this.DefaultHeight = 350; // Internal child MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog-vbox1"; w1.Spacing = 6; w1.BorderWidth = ((uint)(2)); @@ -100,7 +100,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox1])); w8.Position = 0; // Internal child MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.ActionArea - global::Gtk.HButtonBox w9 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w9 = this.ActionArea; w9.Name = "GtkDialog_ActionArea"; w9.Spacing = 6; w9.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.MultiMessageDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.MultiMessageDialog.cs index ce620106cc5..c0350797e32 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.MultiMessageDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.MultiMessageDialog.cs @@ -15,7 +15,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Ide.Gui.Dialogs.MultiMessageDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -36,7 +36,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(w1 [this.scrolled])); w5.Position = 0; // Internal child MonoDevelop.Ide.Gui.Dialogs.MultiMessageDialog.ActionArea - global::Gtk.HButtonBox w6 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w6 = this.ActionArea; w6.Name = "dialog1_ActionArea"; w6.Spacing = 6; w6.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.MultiTaskProgressDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.MultiTaskProgressDialog.cs index a78063e9c66..250c06db87b 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.MultiTaskProgressDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.MultiTaskProgressDialog.cs @@ -22,7 +22,7 @@ protected virtual void Build () this.Modal = true; this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Ide.Gui.Dialogs.MultiTaskProgressDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.Spacing = 6; w1.BorderWidth = ((uint)(2)); @@ -82,7 +82,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(w1 [this.detailsScroll])); w7.Position = 3; // Internal child MonoDevelop.Ide.Gui.Dialogs.MultiTaskProgressDialog.ActionArea - global::Gtk.HButtonBox w8 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w8 = this.ActionArea; w8.Name = "dialog1_ActionArea"; w8.Spacing = 6; w8.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs index ac4dfe4e92c..c0d594eb36e 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs @@ -22,7 +22,7 @@ protected virtual void Build () this.BorderWidth = ((uint)(6)); this.Resizable = false; // Internal child MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog-vbox4"; w1.Spacing = 6; w1.BorderWidth = ((uint)(2)); @@ -79,7 +79,7 @@ protected virtual void Build () w7.Expand = false; w7.Fill = false; // Internal child MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.ActionArea - global::Gtk.HButtonBox w8 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w8 = this.ActionArea; w8.Name = "GtkDialog_ActionArea"; w8.Spacing = 6; w8.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.ProgressDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.ProgressDialog.cs index e974cd235ad..806c34e3457 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.ProgressDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.ProgressDialog.cs @@ -24,7 +24,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.Modal = true; // Internal child MonoDevelop.Ide.Gui.Dialogs.ProgressDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -109,7 +109,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w10.Position = 0; // Internal child MonoDevelop.Ide.Gui.Dialogs.ProgressDialog.ActionArea - global::Gtk.HButtonBox w11 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w11 = this.ActionArea; w11.Name = "dialog1_ActionArea"; w11.Spacing = 10; w11.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs index b7814e7a9df..a546454ec1d 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs @@ -45,7 +45,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Select File Format"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -192,7 +192,7 @@ protected virtual void Build () w16.Expand = false; w16.Fill = false; // Internal child MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.ActionArea - global::Gtk.HButtonBox w17 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w17 = this.ActionArea; w17.Name = "dialog1_ActionArea"; w17.Spacing = 10; w17.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.AddExternalFileDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.AddExternalFileDialog.cs index 62cb58d77b4..e212d24a563 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.AddExternalFileDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.AddExternalFileDialog.cs @@ -47,7 +47,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Add File to Folder"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Projects.AddExternalFileDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -205,7 +205,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox1])); w17.Position = 0; // Internal child MonoDevelop.Ide.Projects.AddExternalFileDialog.ActionArea - global::Gtk.HButtonBox w18 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w18 = this.ActionArea; w18.Name = "dialog1_ActionArea"; w18.Spacing = 10; w18.BorderWidth = ((uint)(11)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.AddMimeTypeDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.AddMimeTypeDialog.cs index dabb51b7dd9..0f815aa7659 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.AddMimeTypeDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.AddMimeTypeDialog.cs @@ -27,7 +27,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Add File Type"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Projects.AddMimeTypeDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -88,7 +88,7 @@ protected virtual void Build () w7.Expand = false; w7.Fill = false; // Internal child MonoDevelop.Ide.Projects.AddMimeTypeDialog.ActionArea - global::Gtk.HButtonBox w8 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w8 = this.ActionArea; w8.Name = "dialog1_ActionArea"; w8.Spacing = 10; w8.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ApplyPolicyDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ApplyPolicyDialog.cs index 8087ded224a..b5fd516a20c 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ApplyPolicyDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ApplyPolicyDialog.cs @@ -29,7 +29,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Apply Policies"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Projects.ApplyPolicyDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -160,7 +160,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox3])); w16.Position = 0; // Internal child MonoDevelop.Ide.Projects.ApplyPolicyDialog.ActionArea - global::Gtk.HButtonBox w17 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w17 = this.ActionArea; w17.Name = "dialog1_ActionArea"; w17.Spacing = 10; w17.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ConfirmProjectDeleteDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ConfirmProjectDeleteDialog.cs index 492e5a72712..98c1aac5b8a 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ConfirmProjectDeleteDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ConfirmProjectDeleteDialog.cs @@ -34,7 +34,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.Modal = true; // Internal child MonoDevelop.Ide.Projects.ConfirmProjectDeleteDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -112,7 +112,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w10.Position = 0; // Internal child MonoDevelop.Ide.Projects.ConfirmProjectDeleteDialog.ActionArea - global::Gtk.HButtonBox w11 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w11 = this.ActionArea; w11.Name = "dialog1_ActionArea"; w11.Spacing = 10; w11.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.DeleteConfigDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.DeleteConfigDialog.cs index bc0e432ffe8..a40c8dd4a54 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.DeleteConfigDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.DeleteConfigDialog.cs @@ -25,7 +25,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Delete Configuration"); this.TypeHint = ((global::Gdk.WindowTypeHint)(1)); // Internal child MonoDevelop.Ide.Projects.DeleteConfigDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog-vbox7"; // Container child dialog-vbox7.Gtk.Box+BoxChild this.hbox64 = new global::Gtk.HBox (); @@ -76,7 +76,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox64])); w6.Position = 0; // Internal child MonoDevelop.Ide.Projects.DeleteConfigDialog.ActionArea - global::Gtk.HButtonBox w7 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w7 = this.ActionArea; w7.Name = "dialog-action_area7"; w7.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog-action_area7.Gtk.ButtonBox+ButtonBoxChild diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ExportProjectPolicyDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ExportProjectPolicyDialog.cs index eddbc9cf5e4..d17719e404d 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ExportProjectPolicyDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ExportProjectPolicyDialog.cs @@ -29,7 +29,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Export Policies"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Projects.ExportProjectPolicyDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -163,7 +163,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w16.Position = 0; // Internal child MonoDevelop.Ide.Projects.ExportProjectPolicyDialog.ActionArea - global::Gtk.HButtonBox w17 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w17 = this.ActionArea; w17.Name = "dialog1_ActionArea"; w17.Spacing = 10; w17.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ExportSolutionDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ExportSolutionDialog.cs index a907a78cd7f..820fbf4d84a 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ExportSolutionDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ExportSolutionDialog.cs @@ -34,7 +34,7 @@ protected virtual void Build () this.BorderWidth = ((uint)(6)); this.Resizable = false; // Internal child MonoDevelop.Ide.Projects.ExportSolutionDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Events = ((global::Gdk.EventMask)(256)); w1.Name = "dialog_VBox"; w1.Spacing = 6; @@ -123,7 +123,7 @@ protected virtual void Build () w9.Expand = false; w9.Fill = false; // Internal child MonoDevelop.Ide.Projects.ExportSolutionDialog.ActionArea - global::Gtk.HButtonBox w10 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w10 = this.ActionArea; w10.Name = "MonoDevelop.Ide.ExportProjectDialog_ActionArea"; w10.Spacing = 6; w10.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ImportProjectPolicyDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ImportProjectPolicyDialog.cs index e54480a0c1a..816141ee766 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ImportProjectPolicyDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ImportProjectPolicyDialog.cs @@ -18,7 +18,7 @@ protected virtual void Build () this.Name = "MonoDevelop.Ide.Projects.ImportProjectPolicyDialog"; this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Projects.ImportProjectPolicyDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -70,7 +70,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5])); w6.Position = 0; // Internal child MonoDevelop.Ide.Projects.ImportProjectPolicyDialog.ActionArea - global::Gtk.HButtonBox w7 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w7 = this.ActionArea; w7.Name = "dialog1_ActionArea"; w7.Spacing = 10; w7.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.IncludeNewFilesDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.IncludeNewFilesDialog.cs index b993d2cad3b..035e19ee129 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.IncludeNewFilesDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.IncludeNewFilesDialog.cs @@ -21,7 +21,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Ide.Projects.IncludeNewFilesDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -88,7 +88,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w8.Position = 0; // Internal child MonoDevelop.Ide.Projects.IncludeNewFilesDialog.ActionArea - global::Gtk.HButtonBox w9 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w9 = this.ActionArea; w9.Name = "dialog1_ActionArea"; w9.Spacing = 6; w9.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewFileDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewFileDialog.cs index b152e1bde80..de765f2f0e3 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewFileDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewFileDialog.cs @@ -58,7 +58,7 @@ protected virtual void Build () this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(6)); // Internal child MonoDevelop.Ide.Projects.NewFileDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.Spacing = 6; w1.BorderWidth = ((uint)(2)); @@ -79,6 +79,7 @@ protected virtual void Build () this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child scrolledwindow1.Gtk.Container+ContainerChild this.catView = new global::Gtk.TreeView (); + this.catView.Expand = true; this.catView.WidthRequest = 160; this.catView.CanFocus = true; this.catView.Name = "catView"; @@ -250,7 +251,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); w24.Position = 0; // Internal child MonoDevelop.Ide.Projects.NewFileDialog.ActionArea - global::Gtk.HButtonBox w25 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w25 = this.ActionArea; w25.Name = "dialog1_ActionArea"; w25.Spacing = 6; w25.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewPolicySetDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewPolicySetDialog.cs index 489097a21f0..a651a322bc4 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewPolicySetDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.NewPolicySetDialog.cs @@ -25,7 +25,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("New Policy"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Projects.NewPolicySetDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -78,7 +78,7 @@ protected virtual void Build () w6.Expand = false; w6.Fill = false; // Internal child MonoDevelop.Ide.Projects.NewPolicySetDialog.ActionArea - global::Gtk.HButtonBox w7 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w7 = this.ActionArea; w7.Name = "dialog1_ActionArea"; w7.Spacing = 10; w7.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ProjectFileSelectorDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ProjectFileSelectorDialog.cs index 10b8a4fce6c..8d5d6664e88 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ProjectFileSelectorDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ProjectFileSelectorDialog.cs @@ -41,7 +41,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Select Project File..."); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Projects.ProjectFileSelectorDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -142,7 +142,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(w1 [this.hpaned1])); w14.Position = 0; // Internal child MonoDevelop.Ide.Projects.ProjectFileSelectorDialog.ActionArea - global::Gtk.HButtonBox w15 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w15 = this.ActionArea; w15.Name = "dialog1_ActionArea"; w15.Spacing = 6; w15.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ProjectSelectorDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ProjectSelectorDialog.cs index ac8d2da3b63..19c41d304b4 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ProjectSelectorDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.ProjectSelectorDialog.cs @@ -16,7 +16,7 @@ protected virtual void Build () this.Name = "MonoDevelop.Ide.Projects.ProjectSelectorDialog"; this.WindowPosition = ((global::Gtk.WindowPosition)(4)); // Internal child MonoDevelop.Ide.Projects.ProjectSelectorDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild @@ -47,7 +47,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox4])); w4.Position = 0; // Internal child MonoDevelop.Ide.Projects.ProjectSelectorDialog.ActionArea - global::Gtk.HButtonBox w5 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w5 = this.ActionArea; w5.Name = "dialog1_ActionArea"; w5.Spacing = 10; w5.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.RenameConfigDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.RenameConfigDialog.cs index 3c790af1a87..b9ebcf0d699 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.RenameConfigDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.RenameConfigDialog.cs @@ -19,7 +19,7 @@ protected virtual void Build () this.Title = global::Mono.Unix.Catalog.GetString ("Rename Configuration"); this.TypeHint = ((global::Gdk.WindowTypeHint)(1)); // Internal child MonoDevelop.Ide.Projects.RenameConfigDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "vbox78"; w1.BorderWidth = ((uint)(2)); // Container child vbox78.Gtk.Box+BoxChild @@ -69,7 +69,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox79])); w6.Position = 0; // Internal child MonoDevelop.Ide.Projects.RenameConfigDialog.ActionArea - global::Gtk.HButtonBox w7 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w7 = this.ActionArea; w7.Name = "hbuttonbox2"; w7.Spacing = 6; w7.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.SelectReferenceDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.SelectReferenceDialog.cs index 77523a55a32..256a89fd3aa 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.SelectReferenceDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.Projects.SelectReferenceDialog.cs @@ -45,7 +45,7 @@ protected virtual void Build () this.BorderWidth = ((uint)(6)); this.DestroyWithParent = true; // Internal child MonoDevelop.Ide.Projects.SelectReferenceDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog-vbox2"; w1.Spacing = 6; // Container child dialog-vbox2.Gtk.Box+BoxChild @@ -145,7 +145,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5])); w14.Position = 0; // Internal child MonoDevelop.Ide.Projects.SelectReferenceDialog.ActionArea - global::Gtk.HButtonBox w15 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w15 = this.ActionArea; w15.Name = "dialog-action_area2"; w15.Spacing = 10; w15.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.SelectEncodingsDialog.cs b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.SelectEncodingsDialog.cs index a548ddbedb5..f4a618caada 100644 --- a/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.SelectEncodingsDialog.cs +++ b/main/src/core/MonoDevelop.Ide/Gui/MonoDevelop.Ide.SelectEncodingsDialog.cs @@ -57,7 +57,7 @@ protected virtual void Build () this.DefaultWidth = 700; this.DefaultHeight = 450; // Internal child MonoDevelop.Ide.SelectEncodingsDialog.VBox - global::Gtk.VBox w1 = (Gtk.VBox)this.ContentArea; + global::Gtk.Box w1 = this.ContentArea; w1.Name = "dialog-vbox5"; w1.Spacing = 6; w1.BorderWidth = ((uint)(2)); @@ -215,7 +215,7 @@ protected virtual void Build () global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(w1 [this.table5])); w20.Position = 0; // Internal child MonoDevelop.Ide.SelectEncodingsDialog.ActionArea - global::Gtk.HButtonBox w21 = (Gtk.HButtonBox)this.ActionArea; + global::Gtk.ButtonBox w21 = this.ActionArea; w21.Name = "dialog-action_area5"; w21.Spacing = 6; w21.BorderWidth = ((uint)(5)); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs index 906c76587ab..9901898c246 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs @@ -195,6 +195,7 @@ protected override void OnGetPreferredHeight (out int min_height, out int natura // Add space for the separator if (Orientation == Gtk.Orientation.Horizontal) min_height++; + natural_height++; } } @@ -206,6 +207,7 @@ protected override void OnGetPreferredWidth (out int min_width, out int natural_ // Add space for the separator if (Orientation == Gtk.Orientation.Vertical) min_width++; + natural_width++; } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs index 889571dd3da..4342fb2bd9e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs @@ -142,18 +142,18 @@ public virtual void GetSize (int availableWidth, out int width, out int height) layout.GetPixelSize (out width, out height); } - // public virtual void Render (Drawable window, Cairo.Context ctx, Rectangle bounds, StateType state) - // { - // int w, h; - // layout.GetPixelSize (out w, out h); - // int dy = (bounds.Height - h) / 2; + public virtual void Render (Cairo.Context ctx, Gdk.Rectangle bounds, StateType state) + { + int w, h; + layout.GetPixelSize (out w, out h); + int dy = (bounds.Height - h) / 2; - // ctx.Save (); + ctx.Save (); // ctx.SetSourceColor (container.Style.Text (state).ToCairoColor ()); - // ctx.MoveTo (bounds.X, dy + bounds.Y); - // Pango.CairoHelper.ShowLayout (ctx, layout); - // ctx.Restore (); - // } + ctx.MoveTo (bounds.X, dy + bounds.Y); + Pango.CairoHelper.ShowLayout (ctx, layout); + ctx.Restore (); + } protected virtual IPropertyEditor CreateEditor (Gdk.Rectangle cellArea, StateType state) { @@ -354,7 +354,7 @@ protected override bool OnDrawn (Cairo.Context evnt) rect.Inflate (-3, 0);// Add some margin //using (Cairo.Context ctx = Gdk.CairoHelper.Create (GdkWindow)) { - // cell.Render (GdkWindow, ctx, rect, StateType.Normal); + cell.Render (evnt, rect, StateType.Normal); //} return res; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs index 82e29adc805..43bdbc50ef5 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs @@ -615,7 +615,7 @@ void Draw (Cairo.Context ctx, List rowList, int dividerX, int x, ref i if (r != currentEditorRow) { var bounds = GetInactiveEditorBounds (r); -// cell.Render (GdkWindow, ctx, bounds, state); + cell.Render (ctx, bounds, state); if (r.IsExpandable) { var img = r.Expanded ? discloseUp : discloseDown; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs index bc046a03c7f..a8369a16089 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs @@ -978,11 +978,13 @@ public CellTooltipWindow (TreeView tree, TreeViewColumn col, TreePath path) col.CellGetPosition (cr, out sp, out wi); Gdk.Rectangle crect = new Gdk.Rectangle (x, rect.Y, wi, rect.Height); //cr.GetSize (tree, ref crect, out xo, out yo, out wi, out he); + wi = crect.Width; + he = crect.Height; if (cr != renderers [renderers.Length - 1]) x += crect.Width + col.Spacing + 1; else x += wi + 1; - //if (he > th) th = he; + if (he > th) th = he; } SetSizeRequest (x, th + 2); } @@ -1018,10 +1020,13 @@ protected override bool OnDrawn (Cairo.Context evnt) col.CellGetPosition (cr, out sp, out wi); Gdk.Rectangle bgrect = new Gdk.Rectangle (x, expose.Y, wi, expose.Height - 2); // cr.GetSize (tree, ref bgrect, out xo, out yo, out wi, out he); + wi = bgrect.Width; + he = bgrect.Height; int leftMargin = (int) ((bgrect.Width - wi) * cr.Xalign); - // int topMargin = (int) ((bgrect.Height - he) * cr.Yalign); - // Gdk.Rectangle cellrect = new Gdk.Rectangle (bgrect.X + leftMargin, bgrect.Y + topMargin + 1, wi, he); + int topMargin = (int) ((bgrect.Height - he) * cr.Yalign); + Gdk.Rectangle cellrect = new Gdk.Rectangle (bgrect.X + leftMargin, bgrect.Y + topMargin + 1, wi, he); // cr.Render (this.GdkWindow, this, bgrect, cellrect, expose, CellRendererState.Focused); + cr.Render (evnt, this, bgrect, cellrect, expose, CellRendererState.Focused); x += bgrect.Width + col.Spacing + 1; if (cr is CellRendererText) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs index 9261df9182c..42920fcac77 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs @@ -106,7 +106,7 @@ protected override void OnRealized () var attributes = new Gdk.WindowAttr () { WindowType = Gdk.WindowType.Child, -// Wclass = Gdk.WindowClass.InputOnly, + Wclass = Gdk.WindowWindowClass.InputOnly, EventMask = (int) ( EventMask.EnterNotifyMask | EventMask.LeaveNotifyMask | diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/GtkDocumentToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/GtkDocumentToolbar.cs index 01c3839433b..ac9a69a4b77 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/GtkDocumentToolbar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/GtkDocumentToolbar.cs @@ -115,7 +115,7 @@ void ChangeColor (Gtk.Widget w) // and the Fg color is used for the label. w.ModifyFg (StateType.Prelight, textColor); w.ModifyFg (StateType.Active, textColor); - } else + } //else //w.ModifyText (StateType.Normal, textColor); w.ModifyFg (StateType.Normal, textColor); }; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs index 8df83595dad..1196190ea11 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs @@ -298,9 +298,9 @@ internal static string GetMatchMarkup (Gtk.Widget widget, string text, int[] mat continue; if (pos - lastPos > 0) result.Append (GLib.Markup.EscapeText (text.Substring (lastPos, pos - lastPos))); - result.Append (""); + //result.Append ("\">"); result.Append (GLib.Markup.EscapeText (text[pos].ToString ())); result.Append (""); lastPos = pos + 1; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs index bdd148282eb..4fa792c8035 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs @@ -41,9 +41,7 @@ using MonoDevelop.Components; using MonoDevelop.Components.AutoTest; using System.ComponentModel; -#if GTK3 -using TreeModel = Gtk.ITreeModel; -#endif + namespace MonoDevelop.Ide.Projects { @@ -79,6 +77,7 @@ public NewFileDialog (Project parentProject, string basePath, SolutionFolder par BorderWidth = 6; // HasSeparator = false; + this.Resizable = false; InitializeComponents (); nameEntry.GrabFocus (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/PackageReferencePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/PackageReferencePanel.cs index 21367d25733..61b898bec93 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/PackageReferencePanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/PackageReferencePanel.cs @@ -265,9 +265,9 @@ internal static string GetMatchMarkup (Gtk.Widget widget, string text, int[] mat continue; if (pos - lastPos > 0) result.Append (GLib.Markup.EscapeText (text.Substring (lastPos, pos - lastPos))); - result.Append (""); + //result.Append ("\">"); result.Append (GLib.Markup.EscapeText (text[pos].ToString ())); result.Append (""); lastPos = pos + 1; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs index 152239342b4..511ef77c005 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs @@ -164,7 +164,7 @@ TreeIter AddPackageReference (ProjectReference refInfo) return refTreeStore.AppendValues (txt, secondaryTxt, GetTypeText (refInfo), refInfo.Reference, refInfo, ImageService.GetIcon ("md-package", IconSize.Dnd)); } - [DllImport ("libgtk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport ("libgtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)] private static extern void gtk_notebook_set_action_widget (IntPtr notebook, IntPtr widget, int packType); public SelectReferenceDialog () @@ -592,15 +592,15 @@ public string SecondaryTextMarkup { protected override void OnRender (Cairo.Context window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, CellRendererState flags) { - StateType st = StateType.Normal; + Gtk.StateFlags st = StateFlags.Normal; if ((flags & CellRendererState.Prelit) != 0) - st = StateType.Prelight; + st = StateFlags.Prelight; if ((flags & CellRendererState.Focused) != 0) - st = StateType.Normal; + st = StateFlags.Normal; if ((flags & CellRendererState.Insensitive) != 0) - st = StateType.Insensitive; + st = StateFlags.Insensitive; if ((flags & CellRendererState.Selected) != 0) - st = widget.HasFocus ? StateType.Selected : Gtk.StateType.Active; + st = widget.HasFocus ? Gtk.StateFlags.Selected : Gtk.StateFlags.Active; SetupLayout (widget, flags); From e6a6152f95987c34c573a07a67ea11d5cb4ffd44 Mon Sep 17 00:00:00 2001 From: makiwolf Date: Wed, 2 Jul 2025 16:32:19 +0200 Subject: [PATCH 382/382] update --- .../ManagePackagesDialog.cs | 4 +- .../AnimatedWidget.cs | 2 +- .../MonoDevelop.UnitTesting/Gui/TestPad.cs | 1 + .../Gui/TestResultsPad.cs | 6 +- .../MonoDevelop.Projects.Text/TextFile.cs | 26 +- .../AtkCocoaHelper.cs | 1 + .../DockWindow.cs | 4 +- .../PlaceholderWindow.cs | 6 +- .../AutoHideBox.cs | 16 +- .../MonoDevelop.Components.Docking/DockBar.cs | 20 +- .../DockBarItem.cs | 22 +- .../DockContainer.cs | 44 ++- .../DockItemContainer.cs | 46 +-- .../DockItemTitleTab.cs | 12 +- .../PlaceholderWindow.cs | 2 +- .../IExtendedTitleBarDialogBackend.cs | 3 +- .../IExtendedTitleBarWindowBackend.cs | 3 +- .../ButtonBar.cs | 10 +- .../MainToolbar.cs | 4 +- .../RoundButton.cs | 14 +- .../MonoDevelop.Components/ExtendedLabel.cs | 4 +- .../MonoDevelop.Components/GtkWorkarounds.cs | 9 +- .../MonoDevelop.Components/ImageView.cs | 4 +- .../MonoDevelop.Components/MenuButton.cs | 8 +- .../MonoDevelop.Components/MenuButtonEntry.cs | 8 +- .../MonoDevelop.Components/PangoUtil.cs | 18 +- .../MonoDevelop.Components/PathBar.cs | 8 +- .../MonoDevelop.Components/Xwt/XwtPopup.cs | 17 +- .../CompletionListWindowGtk.cs | 6 +- .../ExtensibleTreeView.cs | 2 +- .../MonoDevelop.Ide.Gui.Components/LogView.cs | 2 +- .../KeyBindingsPanel.cs | 153 ++++----- .../GtkDocumentToolbar.cs | 8 +- .../SelectReferenceDialog.cs | 4 +- .../MonoDevelop.Ide/DispatchService.cs | 2 +- .../MonoDevelop.Ide/GLibLogging.cs | 310 +++++++++--------- main/src/tools/ExtensionTools/Application.cs | 2 +- 37 files changed, 405 insertions(+), 406 deletions(-) diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs index d79b0f6ab53..6a1aa06ba80 100644 --- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs +++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs @@ -119,7 +119,7 @@ public ManagePackagesDialog ( void UpdateTabAccessibility () { - if (tabGroup.Surface.ToolkitEngine.Type == ToolkitType.Gtk) { + if (tabGroup.Surface.ToolkitEngine.Type == ToolkitType.Gtk3) { if (consolidateLabel.Parent.Surface.NativeWidget is Gtk.Container a11yGroup) { a11yGroup.Accessible.SetRole (AtkCocoa.Roles.AXTabGroup); var children = a11yGroup.Children; @@ -214,7 +214,7 @@ void InitializeListView () packagesListView.RowActivated += PackagesListRowActivated; packagesListView.VerticalScrollControl.ValueChanged += PackagesListViewScrollValueChanged; - if (Toolkit.CurrentEngine.Type == ToolkitType.Gtk) { + if (Toolkit.CurrentEngine.Type == ToolkitType.Gtk3) { // TODO: unlike Xwt.TreeView, Xwt.ListView has no UseAlternatingRowColors property var gtkTreeView = packagesListView.Surface.NativeWidget as Gtk.Widget; if (gtkTreeView is Gtk.ScrolledWindow scroll) diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs index ca7c5cb7626..5802be28e3d 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor.Theatrics/AnimatedWidget.cs @@ -125,7 +125,7 @@ protected override void OnRealized () Gdk.WindowAttr attributes = new Gdk.WindowAttr (); attributes.WindowType = Gdk.WindowType.Child; -// attributes.Wclass = Gdk.WindowClass.InputOutput; + attributes.Wclass = Gdk.WindowWindowClass.InputOutput; attributes.EventMask = (int)Gdk.EventMask.ExposureMask; GdkWindow = new Gdk.Window (Parent.GdkWindow, attributes, 0); GdkWindow.UserData = Handle; diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs index 72c50c74b0c..82f65db7679 100644 --- a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs +++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs @@ -984,6 +984,7 @@ class HeaderLabel: Widget public HeaderLabel () { + HasWindow = true; //WidgetFlags |= WidgetFlags.NoWindow; layout = new Pango.Layout (this.PangoContext); } diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestResultsPad.cs b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestResultsPad.cs index 2b20d1ef83f..38081bea55b 100644 --- a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestResultsPad.cs +++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestResultsPad.cs @@ -744,9 +744,9 @@ void ShowTestResult (UnitTest test, UnitTestResult result) int curLine = 1; const int maxLineLength = 255; const int maxLineNumber = 255; - //sb.Append (""); + sb.Append (""); using (var sr = new StringReader (Escape(result.Message))) { while (null != (curLineText = sr.ReadLine ())) { if (curLineText == null) continue; diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/TextFile.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/TextFile.cs index 305a67f5675..69ebb560a3f 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/TextFile.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/TextFile.cs @@ -33,7 +33,7 @@ using System.Text; using System.Runtime.InteropServices; using Mono.Unix; -using Mono.Unix.Native; +using Mono.Unix.Native; using MonoDevelop.Core; using MonoDevelop.Projects.Utility; @@ -41,8 +41,8 @@ namespace MonoDevelop.Projects.Text { public class TextFile: ITextFile { - const string LIBGLIB = "libglib-2.0-0.dll"; - + const string LIBGLIB = "libglib-2.0.so.0"; + FilePath name; StringBuilder text; string sourceEncoding; @@ -50,25 +50,25 @@ public class TextFile: ITextFile public TextFile () { - } - + } + public TextFile (FilePath name) { Read (name); - } - + } + public void Read (FilePath fileName) { Read (fileName, null); - } - + } + public static TextFile ReadFile (FilePath fileName) { TextFile tf = new TextFile (); tf.Read (fileName); return tf; - } - + } + public static TextFile ReadFile (FilePath fileName, string encoding) { TextFile tf = new TextFile (); @@ -163,8 +163,8 @@ public static string GetFileEncoding (FilePath fileName) return file.SourceEncoding; } - #region g_convert - + #region g_convert + static string ConvertFromEncoding (byte[] content, long nread, string fromEncoding) { try { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AtkCocoaHelper/AtkCocoaHelper.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AtkCocoaHelper/AtkCocoaHelper.cs index 20cb652f730..3aa035c6a50 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AtkCocoaHelper/AtkCocoaHelper.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AtkCocoaHelper/AtkCocoaHelper.cs @@ -173,6 +173,7 @@ public class ActionDelegate void HandleSignalAttachment (Action> action) { + owner.AddSignalHandler ("request-actions", new EventHandler (RequestActionsHandler), typeof(GLib.SignalArgs)); // var signal = GLib.Signal.Lookup (owner, "request-actions", typeof (GLib.SignalArgs)); // action (signal, new EventHandler (RequestActionsHandler)); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockWindow.cs index 24d5653a7b4..5180f037fdc 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockWindow.cs @@ -152,9 +152,9 @@ protected override void OnRealized () { base.OnRealized (); // A small delay to make sure the window is fully rendered before showing it - GdkWindow.Opacity = 0; + Window.Opacity = 0; GLib.Timeout.Add (120, delegate { - GdkWindow.Opacity = 1; + Window.Opacity = 1; return false; }); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs index 63ff6d67724..1310e52f17e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs @@ -143,7 +143,7 @@ public void ShowPlaceholder (int x, int y) // TODO: Handle z-ordering of floating windows. int ox = 0, oy = 0; foreach (var notebook in allNotebooks) { - if (notebook.GdkWindow == null) + if (notebook.Window == null) continue; int ox2, oy2; @@ -248,7 +248,7 @@ protected override bool OnFocusOutEvent (EventFocus evt) protected override void OnRealized () { base.OnRealized (); - GdkWindow.Opacity = 0.4; + Window.Opacity = 0.4; } protected override bool OnDrawn (Context ctx) @@ -415,7 +415,7 @@ public DocumentTitleWindow (PlaceholderWindow placeholder, DockNotebookTab dragg static Xwt.Drawing.Image RenderWidget (Widget w) { - Gdk.Window win = w.GdkWindow; + Gdk.Window win = w.Window; if (win == null || !win.IsViewable) { return null; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs index 804990b832c..6f3782be739 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs @@ -100,11 +100,11 @@ public AutoHideBox (DockFrame frame, DockItem item, Gtk.PositionType pos, int si if (horiz) { fr = new HBox (); - sepBox.Realized += delegate { sepBox.GdkWindow.Cursor = resizeCursorW; }; + sepBox.Realized += delegate { sepBox.Window.Cursor = resizeCursorW; }; sepBox.WidthRequest = gripSize; } else { fr = new VBox (); - sepBox.Realized += delegate { sepBox.GdkWindow.Cursor = resizeCursorH; }; + sepBox.Realized += delegate { sepBox.Window.Cursor = resizeCursorH; }; sepBox.HeightRequest = gripSize; } fr.Accessible.SetShouldIgnore (true); @@ -397,22 +397,22 @@ public void SetSize (PositionType expandPosition, int targetSize) protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - base.OnGetPreferredHeight (out min_height, out natural_height); + //base.OnGetPreferredHeight (out min_height, out natural_height); if (scrollMode || Child == null) { - min_height = 0; + min_height = natural_height = 0; } else - min_height = Child.SizeRequest ().Height; + Child.GetPreferredHeight(out min_height, out natural_height); } protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { - base.OnGetPreferredWidth (out min_width, out natural_width); + //base.OnGetPreferredWidth (out min_width, out natural_width); if (scrollMode || Child == null) { - min_width = 0; + min_width = natural_width = 0; } else - min_width = Child.SizeRequest ().Width; + Child.GetPreferredWidth(out min_width, out natural_width); } protected override void OnSizeAllocated (Rectangle alloc) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs index 9901898c246..6c12170bf83 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs @@ -245,22 +245,10 @@ protected override bool OnDrawn (Context ctx) // Dark separator switch (Position) { - case PositionType.Left: - ctx.MoveTo (alloc.X + alloc.Width - 0.5, alloc.Y); - ctx.RelLineTo (0, Allocation.Height); - break; - case PositionType.Right: - ctx.MoveTo (alloc.X + 0.5, alloc.Y); - ctx.RelLineTo (0, Allocation.Height); - break; - case PositionType.Top: - ctx.MoveTo (alloc.X, alloc.Y + alloc.Height + 0.5); - ctx.RelLineTo (Allocation.Width, 0); - break; - case PositionType.Bottom: - ctx.MoveTo (alloc.X, alloc.Y + 0.5); - ctx.RelLineTo (Allocation.Width, 0); - break; + case PositionType.Left:ctx.MoveTo (AllocatedWidth - 0.5, 0); ctx.RelLineTo (0, AllocatedHeight); break; + case PositionType.Right: ctx.MoveTo (0.5, 0); ctx.RelLineTo (0, AllocatedHeight); break; + case PositionType.Top: ctx.MoveTo (0, AllocatedHeight + 0.5); ctx.RelLineTo (AllocatedWidth, 0); break; + case PositionType.Bottom: ctx.MoveTo (0, 0.5); ctx.RelLineTo (AllocatedWidth, 0); break; } ctx.SetSourceColor (Styles.DockSeparatorColor.ToCairoColor ()); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs index c57bab77f79..3e25176e7db 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs @@ -90,18 +90,14 @@ protected override void OnDestroyed () base.OnDestroyed (); } - protected override void OnGetPreferredHeight (out int min_height, out int natural_height) - { - base.OnGetPreferredHeight (out min_height, out natural_height); - - min_height = (int) primary.Height; - } - - protected override void OnGetPreferredWidth (out int min_width, out int natural_width) - { - base.OnGetPreferredWidth (out min_width, out natural_width); + protected override void OnGetPreferredHeight(out int min_height, out int natural_height) + { + min_height = natural_height = (int) primary.Height; + } - min_width = (int) primary.Width; + protected override void OnGetPreferredWidth(out int min_width, out int natural_width) + { + min_width = natural_width = (int) primary.Width; } protected override bool OnDrawn (Context context) @@ -120,8 +116,8 @@ protected override bool OnDrawn (Context context) void RenderIcon (Cairo.Context context, Xwt.Drawing.Image surface, double opacity) { context.DrawImage (this, surface.WithAlpha (opacity), - Allocation.X + (Allocation.Width - surface.Width) / 2, - Allocation.Y + (Allocation.Height - surface.Height) / 2); + (Allocation.Width - surface.Width) / 2, + (Allocation.Height - surface.Height) / 2); } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs index a8f7c5b62cc..b7f54ca8f37 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs @@ -135,22 +135,20 @@ public void StoreAllocation () protected override void OnGetPreferredWidth (out int min_width, out int natural_width) { - min_width = 0; + base.OnGetPreferredWidth(out min_width, out natural_width); if (layout != null) { LayoutWidgets (); - min_width = layout.SizeRequest ().Width; - } - natural_width = min_width; + min_width = natural_width = layout.SizeRequest().Width; + } } protected override void OnGetPreferredHeight (out int min_height, out int natural_height) { - min_height = 0; + base.OnGetPreferredHeight(out min_height, out natural_height); if (layout != null) { LayoutWidgets (); - min_height = layout.SizeRequest ().Height; + min_height = natural_height = layout.SizeRequest().Height; } - natural_height = min_height; } protected override void OnSizeAllocated (Gdk.Rectangle rect) @@ -159,8 +157,8 @@ protected override void OnSizeAllocated (Gdk.Rectangle rect) if (layout == null) return; - if (this.GdkWindow != null) - this.GdkWindow.MoveResize (rect); + if (this.Window != null) + this.Window.MoveResize (rect); // This container has its own window, so allocation of children // is relative to 0,0 @@ -395,12 +393,12 @@ protected override void OnRealized () Gdk.WindowAttributesType.Y | // Gdk.WindowAttributesType.Colormap | Gdk.WindowAttributesType.Visual; - GdkWindow = new Gdk.Window (ParentWindow, attributes, (int)attributes_mask); - GdkWindow.UserData = Handle; + Window = new Gdk.Window (ParentWindow, attributes, (int)attributes_mask); + Window.UserData = Handle; - Style = Style.Attach (GdkWindow); - Style.SetBackground (GdkWindow, State); - this.HasWindow = true; + Style = Style.Attach (Window); + Style.SetBackground (Window, State); + HasWindow = true; //GdkWindow.SetBackPixmap (null, true); @@ -409,10 +407,10 @@ protected override void OnRealized () protected override void OnUnrealized () { - if (this.GdkWindow != null) { - this.GdkWindow.UserData = IntPtr.Zero; - this.GdkWindow.Destroy (); - this.HasWindow = false; + if (this.Window != null) { + this.Window.UserData = IntPtr.Zero; + this.Window.Destroy (); + HasWindow = false; } base.OnUnrealized (); } @@ -440,12 +438,12 @@ internal bool UpdatePlaceholder (DockItem item, Gdk.Size size, bool allowDocking placeholderWindow.AllowDocking = allowDocking; int ox, oy; - GdkWindow.GetOrigin (out ox, out oy); + Window.GetOrigin (out ox, out oy); int tw, th; padTitleWindow.GetSize (out tw, out th); padTitleWindow.Move (ox + px - tw / 2, oy + py - th / 2); - padTitleWindow.GdkWindow.KeepAbove = true; + padTitleWindow.Window.KeepAbove = true; DockDelegate dockDelegate; Gdk.Rectangle rect; @@ -563,15 +561,15 @@ protected override void OnRealized () protected override bool OnEnterNotifyEvent (EventCrossing evnt) { if (Allocation.Height > Allocation.Width) - GdkWindow.Cursor = hresizeCursor; + Window.Cursor = hresizeCursor; else - GdkWindow.Cursor = vresizeCursor; + Window.Cursor = vresizeCursor; return base.OnEnterNotifyEvent (evnt); } protected override bool OnLeaveNotifyEvent (EventCrossing evnt) { - GdkWindow.Cursor = null; + Window.Cursor = null; return base.OnLeaveNotifyEvent (evnt); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs index e3478d107b8..959c324c5cc 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs @@ -267,27 +267,35 @@ protected override void OnRemoved (Widget widget) child = null; } - protected override void OnGetPreferredWidth (out int min_width, out int natural_width) - { - if (child != null) { - min_width = child.SizeRequest ().Width; + protected override void OnGetPreferredWidth(out int min_width, out int natural_width) + { + if (child != null) + { + child.GetPreferredWidth(out min_width, out natural_width); min_width += leftMargin + rightMargin + leftPadding + rightPadding; - } else { - min_width = 0; - } - natural_width = min_width; - } + natural_width = min_width; + } + else + { + natural_width = min_width = 0; + } + } - protected override void OnGetPreferredHeight (out int min_height, out int natural_height) - { - if (child != null) { - min_height = child.SizeRequest ().Height; - min_height += topMargin + bottomMargin + topPadding + bottomPadding; - } else { - min_height = 0; - } - natural_height = min_height; - } + protected override void OnGetPreferredHeight(out int min_height, out int natural_height) + { + if (child != null) + { + child.GetPreferredHeight(out min_height, out natural_height); + min_height += topMargin + bottomMargin + topPadding + bottomPadding; + natural_height = min_height; + } + else + { + natural_height = min_height = 0; + } + } + + protected override void OnSizeAllocated (Gdk.Rectangle allocation) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs index 01fa59f18f7..4de6c8c49e6 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs @@ -198,7 +198,8 @@ void UpdateVisualStyle () if (IsRealized && labelWidget?.Visible == true) { var font = IdeServices.FontService.SansFont.CopyModified (null, Pango.Weight.Bold); font.AbsoluteSize = Pango.Units.FromPixels (11); - //labelWidget.ModifyFont (font); + labelWidget.ModifyFont (font); + labelWidget.ModifyFg (StateType.Normal, (active ? visualStyle.PadTitleLabelColor.Value : visualStyle.InactivePadTitleLabelColor.Value).ToGdkColor ()); //labelWidget.ModifyText (StateType.Normal, (active ? visualStyle.PadTitleLabelColor.Value : visualStyle.InactivePadTitleLabelColor.Value).ToGdkColor ()); } @@ -442,8 +443,8 @@ protected override bool OnButtonReleaseEvent (Gdk.EventButton evnt) } else if (!evnt.TriggersContextMenu () && evnt.Button == 1) { frame.DockInPlaceholder (item); frame.HidePlaceholder (); - if (GdkWindow != null) - GdkWindow.Cursor = null; + if (Window != null) + Window.Cursor = null; frame.Toplevel.KeyPressEvent -= HeaderKeyPress; frame.Toplevel.KeyReleaseEvent -= HeaderKeyRelease; } @@ -482,7 +483,7 @@ protected override bool OnMotionNotifyEvent (Gdk.EventMotion evnt) { if (tabPressed && !item.Behavior.HasFlag (DockItemBehavior.NoGrip) && Math.Abs (evnt.X - pressX) > 3 && Math.Abs (evnt.Y - pressY) > 3) { frame.ShowPlaceholder (item); - GdkWindow.Cursor = fleurCursor; + Window.Cursor = fleurCursor; frame.Toplevel.KeyPressEvent += HeaderKeyPress; frame.Toplevel.KeyReleaseEvent += HeaderKeyRelease; allowPlaceholderDocking = true; @@ -789,7 +790,8 @@ void DrawNormal (Context ctx) var y = Allocation.Y; ctx.Rectangle (x, y + 1, Allocation.Width, Allocation.Height - 1); - ctx.SetSourceColor (Styles.DockBarBackground.ToCairoColor ()); + //ctx.SetSourceColor (Styles.DockBarBackground.ToCairoColor ()); + ctx.SetSourceColor (new Cairo.Color (0.7, 0.8, 0.9, 0.9)); ctx.Fill (); /* diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs index 8486dd261ca..6be705443f3 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs @@ -77,7 +77,7 @@ protected override void OnDestroyed () protected override void OnRealized () { base.OnRealized (); - GdkWindow.Opacity = 0.6; + Window.Opacity = 0.6; } void CreateShape (int width, int height) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarDialogBackend.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarDialogBackend.cs index 7fdb8a317f5..52a8d881456 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarDialogBackend.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarDialogBackend.cs @@ -45,7 +45,8 @@ public override void Initialize () toolbar.GradientBackground = true; toolbar.SetMargins (0, 1, 0, 0); MainBox.PackStart (toolbar, false, false, 0); - ((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0; + MainBox.ReorderChild(toolbar,0); + //((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0; } public void SetHeaderContent (IWidgetBackend backend) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarWindowBackend.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarWindowBackend.cs index dda0af1d649..db5b4e2b937 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarWindowBackend.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarWindowBackend.cs @@ -45,7 +45,8 @@ public override void Initialize () toolbar.GradientBackground = true; toolbar.SetMargins (0, 1, 0, 0); MainBox.PackStart (toolbar, false, false, 0); - ((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0; + MainBox.ReorderChild(toolbar,0); + //((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0; } public void SetHeaderContent (IWidgetBackend backend) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ButtonBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ButtonBar.cs index 27756a03269..e53893d2195 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ButtonBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ButtonBar.cs @@ -186,11 +186,11 @@ protected override void OnGetPreferredWidth (out int min_width, out int natural_ min_width = VisibleButtons.Sum (b => b.Visible ? (!b.IsSeparator ? (int)btnNormalOriginal[0].Width : SeparatorSpacing) : 0); } - protected override bool OnDrawn (Cairo.Context evnt) + protected override bool OnDrawn (Cairo.Context context) { ScaleImages (Allocation.Height); - using (var context = Gdk.CairoHelper.Create (GdkWindow)) { + //using (var context = Gdk.CairoHelper.Create (GdkWindow)) { double x = Allocation.X, y = Allocation.Y; for (int i = 0; i < VisibleButtons.Length; i++) { bool nextIsSeparator = (i < VisibleButtons.Length - 1 && VisibleButtons[i + 1].IsSeparator) || i == VisibleButtons.Length - 1; @@ -210,11 +210,11 @@ protected override bool OnDrawn (Cairo.Context evnt) var icon = ImageService.GetIcon (button.Image, IconSize.Menu); if (!Sensitive || !button.Enabled) icon = icon.WithAlpha (0.4); - context.DrawImage (this, icon, Math.Truncate (x + (img.Width - icon.Width) / 2), Math.Truncate (y + (img.Height - icon.Height) / 2)); + context.DrawImage (this, icon, Math.Truncate ((img.Width - icon.Width) / 2), Math.Truncate ((img.Height - icon.Height) / 2)); x += img.Width; } - } - return base.OnDrawn (evnt); + //} + return base.OnDrawn (context); } Xwt.Drawing.Image ExpandImageVertically (Xwt.Drawing.Image img, int newHeight) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs index a6f978b8392..b3927308149 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs @@ -102,7 +102,7 @@ static bool RuntimeIsSeparator (ITreeModel model, TreeIter iter) return runtime == null || runtime.IsSeparator; } - void RuntimeRenderCell (/*CellLayout layout,*/ CellRenderer cell, ITreeModel model, TreeIter iter) + void RuntimeRenderCell (ICellLayout layout, CellRenderer cell, ITreeModel model, TreeIter iter) { var runtime = (IRuntimeModel)model.GetValue (iter, 0); var renderer = (CellRendererText) cell; @@ -172,7 +172,7 @@ public MainToolbar () if (Platform.IsWindows) ctx.Ellipsize = Pango.EllipsizeMode.Middle; runtimeCombo.PackStart (ctx, true); -// runtimeCombo.SetCellDataFunc (ctx, RuntimeRenderCell); + runtimeCombo.SetCellDataFunc (ctx, RuntimeRenderCell); runtimeCombo.RowSeparatorFunc = RuntimeIsSeparator; runtimeCombo.TooltipText = GettextCatalog.GetString ("The device on which to deploy and launch the projects when running or debugging."); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/RoundButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/RoundButton.cs index 6bf5499dfb3..7b9d6e5dd04 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/RoundButton.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/RoundButton.cs @@ -148,20 +148,20 @@ public OperationIcon Icon { } } - protected override bool OnDrawn (Cairo.Context evnt) + protected override bool OnDrawn (Cairo.Context context) { - using (var context = Gdk.CairoHelper.Create (GdkWindow)) { + //using (var context = Gdk.CairoHelper.Create (GdkWindow)) { DrawBackground (context, Allocation, 15, State); var icon = GetIcon(); - context.DrawImage (this, icon, Allocation.X + Math.Max (0, (Allocation.Width - icon.Width) / 2), Allocation.Y + Math.Max (0, (Allocation.Height - icon.Height) / 2)); - } - return base.OnDrawn (evnt); + context.DrawImage (this, icon, Math.Max (0, (Allocation.Width - icon.Width) / 2), Math.Max (0, (Allocation.Height - icon.Height) / 2)); + //} + return base.OnDrawn (context); } void DrawBackground (Cairo.Context context, Gdk.Rectangle region, int radius, StateType state) { - int x = region.X + region.Width / 2; - int y = region.Y + region.Height / 2; + int x = region.Width / 2; + int y = region.Height / 2; var img = btnNormal; switch (state) { diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ExtendedLabel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ExtendedLabel.cs index 056555f7b62..b585ea814fe 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ExtendedLabel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ExtendedLabel.cs @@ -55,6 +55,7 @@ protected override bool OnDrawn (Cairo.Context evnt) using (var ctx = CairoHelper.Create (GdkWindow)) { //ctx.SetSourceColor (Style.Text (State).ToCairoColor ()); + ctx.SetSourceColor (new Cairo.Color (0.7, 0.8, 0.9, 0.9)); ctx.MoveTo (tx, ty); // In order to get the same result as in MonoDevelop.Components.DockNotebook.TabStrip.DrawTab() @@ -70,9 +71,10 @@ protected override bool OnDrawn (Cairo.Context evnt) using (var lg = new LinearGradient (tx + w - 1, 0, tx + w, 0)) { //var color = Style.Text (State).ToCairoColor (); - //lg.AddColorStop (0, color); + lg.AddColorStop (0, new Cairo.Color(0,0,0,1)); //color.A = 0.99; //lg.AddColorStop (1, color); + lg.AddColorStop (1, new Cairo.Color(0,0,0,1)); ctx.SetSource (lg); Pango.CairoHelper.ShowLayout (ctx, la); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs index 8e8de3984e2..7779b88155f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs @@ -568,9 +568,9 @@ static MappedKeys MapKeys (Gdk.EventKey evt) Gdk.ModifierType modifier = evt.State; byte grp = evt.Group; - if (GtkMinorVersion >= 20) { + //if (GtkMinorVersion >= 20) { gdk_keymap_add_virtual_modifiers (keymap.Handle, ref modifier); - } + //} //full key mapping uint keyval; @@ -965,7 +965,7 @@ public static void SetLinkHandler (this Gtk.Label label, Action urlHandl { Xwt.GtkBackend.GtkWorkarounds.SetLinkHandler (label,urlHandler); #if DD_GTK3_CHECK_FOR_REMOVE - if (GtkMinorVersion >= 18) + //if (GtkMinorVersion >= 18) new UrlHandlerClosure (urlHandler).ConnectTo (label); #endif } @@ -989,8 +989,7 @@ void HandleLink (object sender, ActivateLinkEventArgs args) public void ConnectTo (Gtk.Label label) { - var signal = GLib.Signal.Lookup (label, "activate-link", typeof(ActivateLinkEventArgs)); - signal.AddDelegate (new EventHandler (HandleLink)); + label.AddSignalHandler ("activate-link", new EventHandler (HandleLink), typeof(ActivateLinkEventArgs)); } class ActivateLinkEventArgs : GLib.SignalArgs diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs index 916db6e3113..384cc82b0fc 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs @@ -131,8 +131,8 @@ protected override bool OnDrawn (Context cr) if (image != null) { var alloc = Allocation; alloc.Inflate (-Xpad, -Ypad); - var x = Math.Round (alloc.X + (alloc.Width - image.Width) * Xalign); - var y = Math.Round (alloc.Y + (alloc.Height - image.Height) * Yalign); + var x = Math.Round ((alloc.Width - image.Width) * Xalign); + var y = Math.Round ((alloc.Height - image.Height) * Yalign); cr.Save (); cr.DrawImage (this, IsParentDisabled () ? image.WithAlpha (0.4) : image, x, y); cr.Restore (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButton.cs index 8eaee934e8b..bc8d4a7989d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButton.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButton.cs @@ -126,10 +126,10 @@ void PositionFunc (Menu mn, out int x, out int y, out bool push_in) y += rect.Y + rect.Height; //if the menu would be off the bottom of the screen, "drop" it upwards - //if (y + mn.Requisition.Height > this.Screen.Height) { - // y -= mn.Requisition.Height; - // y -= rect.Height; - //} + if (y + mn.ChildRequisition.Height > this.Screen.Height) { + y -= mn.ChildRequisition.Height; + y -= rect.Height; + } //let GTK reposition the button if it still doesn't fit on the screen push_in = true; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButtonEntry.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButtonEntry.cs index 4a7701786c0..e8191f29600 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButtonEntry.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButtonEntry.cs @@ -182,10 +182,10 @@ void PositionFunc (Gtk.Menu mn, out int x, out int y, out bool push_in) y += rect.Y + rect.Height; //if the menu would be off the bottom of the screen, "drop" it upwards - //if (y + mn.Requisition.Height > button.Screen.Height) { - // y -= mn.Requisition.Height; - // y -= rect.Height; - //} + if (y + mn.ChildRequisition.Height > button.Screen.Height) { + y -= mn.ChildRequisition.Height; + y -= rect.Height; + } //let GTK reposition the menu if it still doesn't fit on the screen push_in = true; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs index e512ea08f7b..fc3fb325ad7 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs @@ -32,15 +32,15 @@ namespace MonoDevelop.Components { public static class PangoUtil { - internal const string LIBGTK = "libgtk-3-0.dll"; - internal const string LIBATK = "libatk-1.0-0.dll"; - internal const string LIBGLIB = "libglib-2.0-0.dll"; - internal const string LIBGDK = "libgdk-3-0.dll"; - internal const string LIBGOBJECT = "libgobject-2.0-0.dll"; - internal const string LIBPANGO = "libpango-1.0-0.dll"; - internal const string LIBPANGOCAIRO = "libpangocairo-1.0-0.dll"; - internal const string LIBQUARTZ = "libgtk-quartz-2.0.dylib"; - internal const string LIBGTKGLUE = "libgtksharpglue-3.so"; + internal const string LIBGTK = "libgtk-3.so.0"; + internal const string LIBATK = "libatk-1.0.so.0"; + internal const string LIBGLIB = "libglib-2.0.so.0"; + internal const string LIBGDK = "libgdk-3.so.0"; + internal const string LIBGOBJECT = "libgobject-2.0.so.0"; + internal const string LIBPANGO = "libpango-1.0.so.0"; + internal const string LIBPANGOCAIRO = "libpangocairo-1.0.so.0"; + //internal const string LIBQUARTZ = "libgtk-quartz-2.0.dylib"; + //internal const string LIBGTKGLUE = "libgtksharpglue-3.so"; /// /// This doesn't leak Pango layouts, unlike some other ways to create them in GTK# <= 2.12.11 diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs index 265af3373bf..873583b3fac 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs @@ -713,10 +713,10 @@ void PositionFunc (Menu mn, out int x, out int y, out bool push_in) y += rect.Height; x += GetHoverXPosition (out w); //if the menu would be off the bottom of the screen, "drop" it upwards - //if (y + mn.Requisition.Height > this.Screen.Height) { - // y -= mn.Requisition.Height; - // y -= rect.Height; - //} + if (y + mn.ChildRequisition.Height > this.Screen.Height) { + y -= mn.ChildRequisition.Height; + y -= rect.Height; + } //let GTK reposition the button if it still doesn't fit on the screen push_in = true; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Xwt/XwtPopup.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Xwt/XwtPopup.cs index 121257b40a9..6a12085ae49 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Xwt/XwtPopup.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Xwt/XwtPopup.cs @@ -174,11 +174,11 @@ void ShowPopup (Gtk.Widget parent, Gdk.EventButton evt, Gdk.Rectangle targetRect targetRect = targetRectangle.ToXwtRectangle (); targetPosition = position; Gdk.Window targetWindow; - if (evt != null) { - eventProvided = true; - targetWindow = evt.Window; - } else - targetWindow = parent.GdkWindow; + if (evt != null) { + eventProvided = true; + targetWindow = evt.Window; + } else + targetWindow = parent.Window; if (targetWindow != null) { int x, y; @@ -202,7 +202,7 @@ void ShowPopupInternal () { Opacity = 0; RepositionWindow (); - Show (); + Show (); // Opacity = 1; } @@ -305,8 +305,9 @@ protected override void OnBoundsChanged (BoundsChangedEventArgs a) public virtual void RepositionWindow (Rectangle? newTargetRect = null) { - if (!HasParent) - return; + + //if (!HasParent) + // return; if (newTargetRect.HasValue) targetRect = newTargetRect.Value; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindowGtk.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindowGtk.cs index f51ea29774b..3e7a7809198 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindowGtk.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindowGtk.cs @@ -353,15 +353,15 @@ public bool RepositionDeclarationViewWindow (TooltipInformationWindow declaratio return false; Gdk.Rectangle rect = list.GetRowArea (item); - if (rect.IsEmpty || rect.Bottom < (int)list.VAdjustment.Value || rect.Y > list.Allocation.Height + (int)list.VAdjustment.Value) - return false; + //if (rect.IsEmpty || rect.Bottom < (int)list.VAdjustment.Value || rect.Y > list.Allocation.Height + (int)list.VAdjustment.Value) + // return false; int ox; int oy; base.GdkWindow.GetOrigin (out ox, out oy); declarationviewwindow.MaximumYTopBound = oy; int y = rect.Y + Theme.Padding - (int)list.VAdjustment.Value; - declarationviewwindow.ShowPopup (this, new Gdk.Rectangle (0, Math.Min (Allocation.Height, Math.Max (0, y)), Allocation.Width, rect.Height), PopupPosition.Left); + //declarationviewwindow.ShowPopup (this, new Gdk.Rectangle (0, Math.Min (Allocation.Height, Math.Max (0, y)), Allocation.Width, rect.Height), PopupPosition.Left); return true; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs index d77af439b80..0753d031ca8 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs @@ -194,7 +194,7 @@ void CustomFontPropertyChanged (object sender, EventArgs a) void UpdateFont () { - //text_render.CustomFont = IdeApp.Preferences.CustomPadFont ?? tree.Style.FontDescription; + text_render.CustomFont = IdeApp.Preferences.CustomPadFont ?? tree.Style.FontDesc; tree.ColumnsAutosize (); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs index e45d64e395e..45c555be9f2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs @@ -515,7 +515,7 @@ void HandleCustomFontChanged (object sender, EventArgs e) void UpdateCustomFont () { - //textEditorControl.ModifyFont (IdeApp.Preferences.CustomOutputPadFont ?? IdeServices.FontService.MonospaceFont); + textEditorControl.ModifyFont (IdeApp.Preferences.CustomOutputPadFont ?? IdeServices.FontService.MonospaceFont); } //mechanism to to batch copy text when large amounts are being dumped diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs index 1d35b739813..bc26f0efacc 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs @@ -955,88 +955,89 @@ bool GetCellPosition (int mx, int my, out int cellx, out int celly, out TreeIter return false; } - // protected override void Render (Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags) - // { - // if (string.IsNullOrEmpty (Text)) - // return; - - // using (var cr = Gdk.CairoHelper.Create (window)) { - // using (var layout = new Pango.Layout (widget.PangoContext)) { - // var xpad = (int)Xpad; - // int w, h; - // Cairo.Color bgColor, fgColor; - // foreach (var key in Text.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { - - // HashSet bindingConflicts; - // if (keyBindingsPanel.conflicts.TryGetValue (key, out bindingConflicts) && bindingConflicts.Contains (Command)) { + protected override void OnRender (Cairo.Context cr, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, CellRendererState flags) + { + + if (string.IsNullOrEmpty (Text)) + return; + + //using (var cr = Gdk.CairoHelper.Create (GdkWindow)) { + using (var layout = new Pango.Layout (widget.PangoContext)) { + var xpad = (int)Xpad; + int w, h; + Cairo.Color bgColor, fgColor; + foreach (var key in Text.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { + + HashSet bindingConflicts; + if (keyBindingsPanel.conflicts.TryGetValue (key, out bindingConflicts) && bindingConflicts.Contains (Command)) { // bgColor = Styles.KeyBindingsPanel.KeyConflictBackgroundColor.ToCairoColor (); // fgColor = Styles.KeyBindingsPanel.KeyConflictForegroundColor.ToCairoColor (); - // } else if (keyBindingsPanel.duplicates.ContainsKey (key)) { + } else if (keyBindingsPanel.duplicates.ContainsKey (key)) { // bgColor = Styles.KeyBindingsPanel.KeyDuplicateBackgroundColor.ToCairoColor (); // fgColor = Styles.KeyBindingsPanel.KeyDuplicateForegroundColor.ToCairoColor (); - // } else { + } else { // bgColor = Styles.KeyBindingsPanel.KeyBackgroundColor.ToCairoColor (); // fgColor = Styles.KeyBindingsPanel.KeyForegroundColor.ToCairoColor (); - // } - - // layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); - // layout.FontDescription = KeySymbolFont; - // layout.GetPixelSize (out w, out h); - - // int buttonWidth = w + (2 * KeyHPadding); - // int buttonHeight = h + (2 * KeyVPadding); - // int x = cell_area.X + xpad; - // double y = cell_area.Y + ((cell_area.Height / 2) - (buttonHeight / 2)); - - // cr.RoundedRectangle (x, y, buttonWidth, buttonHeight, KeyBgRadius); - // cr.LineWidth = 1; - // cr.SetSourceColor (bgColor); - // cr.FillPreserve (); - // cr.SetSourceColor (bgColor); - // cr.Stroke (); - - // cr.SetSourceColor (fgColor); - // cr.MoveTo (x + KeyHPadding, y + KeyVPadding); - // cr.ShowLayout (layout); - // xpad += buttonWidth + Spacing; - // } - // } - // } - // } - - // public override void GetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) - // { - // base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); - // x_offset = y_offset = 0; - // if (string.IsNullOrEmpty (Text)) { - // width = 0; - // height = 0; - // return; - // } - - // using (var layout = new Pango.Layout (widget.PangoContext)) { - // height = 0; - // width = (int)Xpad; - // int w, h, buttonWidth; - // foreach (var key in Text.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { - // layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); - // layout.FontDescription = KeySymbolFont; - // layout.GetPixelSize (out w, out h); - // if (height == 0) - // height = h + (KeyVPadding * 2) + 1; - - // buttonWidth = w + (2 * KeyHPadding); - // width += buttonWidth + Spacing; - // } - // } - // } - - // protected override void OnDestroyed() - // { - // keyBindingsPanel = null; - // HideConflictTooltip (); - // base.OnDestroyed(); - // } + } + + layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); + layout.FontDescription = KeySymbolFont; + layout.GetPixelSize (out w, out h); + + int buttonWidth = w + (2 * KeyHPadding); + int buttonHeight = h + (2 * KeyVPadding); + int x = cell_area.X + xpad; + double y = cell_area.Y + ((cell_area.Height / 2) - (buttonHeight / 2)); + + cr.RoundedRectangle (x, y, buttonWidth, buttonHeight, KeyBgRadius); + cr.LineWidth = 1; + //cr.SetSourceColor (bgColor); + cr.FillPreserve (); + //cr.SetSourceColor (bgColor); + cr.Stroke (); + + //cr.SetSourceColor (fgColor); + cr.MoveTo (x + KeyHPadding, y + KeyVPadding); + cr.ShowLayout (layout); + xpad += buttonWidth + Spacing; + } + } + //} + } + + protected override void OnGetSize (Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) + { + base.OnGetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height); + x_offset = y_offset = 0; + if (string.IsNullOrEmpty (Text)) { + width = 0; + height = 0; + return; + } + + using (var layout = new Pango.Layout (widget.PangoContext)) { + height = 0; + width = (int)Xpad; + int w, h, buttonWidth; + foreach (var key in Text.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { + layout.SetText (KeyBindingManager.BindingToDisplayLabel (key, false)); + layout.FontDescription = KeySymbolFont; + layout.GetPixelSize (out w, out h); + if (height == 0) + height = h + (KeyVPadding * 2) + 1; + + buttonWidth = w + (2 * KeyHPadding); + width += buttonWidth + Spacing; + } + } + } + + // protected override void OnDestroyed() + // { + // keyBindingsPanel = null; + // HideConflictTooltip (); + // base.OnDestroyed(); + // } } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/GtkDocumentToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/GtkDocumentToolbar.cs index ac9a69a4b77..98237789cbc 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/GtkDocumentToolbar.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Shell/GtkDocumentToolbar.cs @@ -159,9 +159,9 @@ public ToolbarBox (float xa, float ya, float sx, float sy) : base (xa, ya, sx, s { } - protected override bool OnDrawn (Cairo.Context evnt) + protected override bool OnDrawn (Cairo.Context ctx) { - using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { + //using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) { ctx.Rectangle (0, 0, Allocation.Width, Allocation.Height); ctx.SetSourceColor (Styles.BreadcrumbBackgroundColor.ToCairoColor ()); ctx.Fill (); @@ -171,8 +171,8 @@ protected override bool OnDrawn (Cairo.Context evnt) ctx.SetSourceColor (Styles.BreadcrumbBottomBorderColor.ToCairoColor ()); ctx.LineWidth = 1; ctx.Stroke (); - } - return base.OnDrawn (evnt); + //} + return base.OnDrawn (ctx); } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs index 511ef77c005..d791c6d1172 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs @@ -163,8 +163,8 @@ TreeIter AddPackageReference (ProjectReference refInfo) } return refTreeStore.AppendValues (txt, secondaryTxt, GetTypeText (refInfo), refInfo.Reference, refInfo, ImageService.GetIcon ("md-package", IconSize.Dnd)); } - - [DllImport ("libgtk-3-0.dll", CallingConvention = CallingConvention.Cdecl)] + + [DllImport ("libgtk-3.so.0", CallingConvention = CallingConvention.Cdecl)] private static extern void gtk_notebook_set_action_widget (IntPtr notebook, IntPtr widget, int packType); public SelectReferenceDialog () diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DispatchService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DispatchService.cs index 8cbdec1fefb..0fe5434f7a2 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DispatchService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DispatchService.cs @@ -86,7 +86,7 @@ static bool HandlerInternal (IntPtr data) const int defaultPriority = 0; - [DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] + [DllImport ("libglib-2.0.so.0", CallingConvention = CallingConvention.Cdecl)] static extern uint g_timeout_add_full (int priority, uint interval, GSourceFuncInternal d, IntPtr data, GLib.DestroyNotify notify); class ExceptionWithStackTraceWithoutThrowing : Exception diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/GLibLogging.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/GLibLogging.cs index 21a4593f6dd..7ad4d693d61 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/GLibLogging.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/GLibLogging.cs @@ -1,42 +1,42 @@ -// -// GLibLogging.cs -// -// Author: -// Michael Hutchinson -// -// Copyright (C) 2008 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - +// +// GLibLogging.cs +// +// Author: +// Michael Hutchinson +// +// Copyright (C) 2008 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + using MonoDevelop.Core; using System.Runtime.InteropServices; using System.Collections; -using System.Runtime.ExceptionServices; -using System.Runtime.CompilerServices; -using System.Diagnostics; - -namespace MonoDevelop.Ide.Gui -{ +using System.Runtime.ExceptionServices; +using System.Runtime.CompilerServices; +using System.Diagnostics; + +namespace MonoDevelop.Ide.Gui +{ static class GLibLogging { #region Begin Workaround @@ -75,7 +75,7 @@ public enum LogLevelFlags : int public class Log { - const string LIBGLIB = "libglib-2.0-0.dll"; + const string LIBGLIB = "libglib-2.0.so.0"; static Hashtable handlers; static void EnsureHash () @@ -104,7 +104,7 @@ public void WriteLog (string logDomain, LogLevelFlags flags, string format, para }; public static uint SetLogHandler (IntPtr logDomain, LogLevelFlags flags, LogFunc logFunc) - { + { uint result = g_log_set_handler (logDomain, flags, LogFuncTrampoline, logFunc); EnsureHash (); handlers[result] = logFunc; @@ -208,122 +208,122 @@ public static void PrintTraceLogFunction (string domain, LogLevelFlags level, st } #endregion End woraround - // If we get more than 1MB of debug info, we don't care. 99.999% of the time we're just doing - // the same thing over and over and we really don't want log files which are 100gb in size - static int RemainingBytes = 1 * 1024 * 1024; - static readonly string[] domains = new string[] {"Gtk", "Gdk", "GLib", "GLib-GObject", "Pango", "GdkPixbuf" }; - static uint[] handles; - - public static bool Enabled - { - get { return handles != null; } - set { - if ((handles != null) == value) - return; - - if (value) { + // If we get more than 1MB of debug info, we don't care. 99.999% of the time we're just doing + // the same thing over and over and we really don't want log files which are 100gb in size + static int RemainingBytes = 1 * 1024 * 1024; + static readonly string[] domains = new string[] {"Gtk", "Gdk", "GLib", "GLib-GObject", "Pango", "GdkPixbuf" }; + static uint[] handles; + + public static bool Enabled + { + get { return handles != null; } + set { + if ((handles != null) == value) + return; + + if (value) { handles = new uint[domains.Length]; - for (int i = 0; i < domains.Length; i++) { + for (int i = 0; i < domains.Length; i++) { IntPtr domain = GLib.Marshaller.StringToPtrGStrdup (domains [i]); - handles [i] = GLibLogging.Log.SetLogHandler (domain, GLibLogging.LogLevelFlags.All, LoggerMethod); - GLib.Marshaller.Free (domain); - } - } else { - for (int i = 0; i < domains.Length; i++) - GLib.Log.RemoveLogHandler (domains[i], handles[i]); - handles = null; - } - } - } - - static void LoggerMethod (IntPtr logDomainPtr, LogLevelFlags logLevel, IntPtr messagePtr) - { - if (RemainingBytes < 0) - return; - - string logDomain = GLib.Marshaller.Utf8PtrToString (logDomainPtr); - string message; - - try { - // Marshal message manually, because the text can contain invalid UTF-8. - // Specifically, with zh_CN, pango fails to render some characters and - // pango's error message contains the broken UTF-8, thus on marshalling - // we need to catch the exception, otherwise we end up in a recursive - // glib exception handling. - message = GLib.Marshaller.Utf8PtrToString (messagePtr); - } catch (Exception e) { - message = "Failed to convert message"; - LoggingService.LogError (message, e); - } - - string msg = string.Format ("{0}-{1}: {2}\n{3}", logDomain, logLevel, message, GetStacktraceIfNeeded (logLevel)); - - switch (logLevel) { - case LogLevelFlags.Debug: - LoggingService.LogDebug (msg); - break; - case LogLevelFlags.Info: - LoggingService.LogInfo (msg); - break; - case LogLevelFlags.Warning: - LoggingService.LogWarning (msg); - break; - case LogLevelFlags.Error: - case LogLevelFlags.Critical: - default: - try { - throw new CriticalGtkException (msg); - } catch (CriticalGtkException e) { - if (logLevel.HasFlag (LogLevelFlags.FlagFatal)) - LoggingService.LogFatalError ($"Fatal {logDomain} error", e); - else - LoggingService.LogInternalError ($"Critical {logDomain} error", e); - } - break; - } - - RemainingBytes -= msg.Length; - if (RemainingBytes < 0) - LoggingService.LogError ("Disabling glib logging for the rest of the session"); - } - - static bool IsMono = Type.GetType ("Mono.Runtime") != null; - - static string GetStacktraceIfNeeded (LogLevelFlags flags) - { - // If it's an Error or a Critical message, we're going to add the stacktrace via the logged exception property, - // we don't need to append it to the message in the log. But we are only doing so on Mono, nowhere else. - if (IsMono && flags.HasFlag (LogLevelFlags.Error | LogLevelFlags.Critical)) - return string.Empty; - - return "Stack trace: \n" + new StackTrace (1, true); - } - - sealed class CriticalGtkException : Exception - { - readonly StackTrace trace = new StackTrace (1, true); - - public CriticalGtkException (string message) : base (message) - { - const System.Reflection.BindingFlags flags = - System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.SetField; - - // HACK: We need to somehow inject our stacktrace, and this is the only way we can - // This is not to transform every glib error into a managed exception - if (IsMono) { - typeof (Exception) - .GetField ("captured_traces", flags) - ?.SetValue (this, new StackTrace [] { trace }); - } - } - - public override string StackTrace => trace.ToString (); - - public override string ToString () - { - // Matches normal exception format: - return GetType () + ": " + Message + Environment.NewLine + trace; - } - } - } -} + handles [i] = GLibLogging.Log.SetLogHandler (domain, GLibLogging.LogLevelFlags.All, LoggerMethod); + GLib.Marshaller.Free (domain); + } + } else { + for (int i = 0; i < domains.Length; i++) + GLib.Log.RemoveLogHandler (domains[i], handles[i]); + handles = null; + } + } + } + + static void LoggerMethod (IntPtr logDomainPtr, LogLevelFlags logLevel, IntPtr messagePtr) + { + if (RemainingBytes < 0) + return; + + string logDomain = GLib.Marshaller.Utf8PtrToString (logDomainPtr); + string message; + + try { + // Marshal message manually, because the text can contain invalid UTF-8. + // Specifically, with zh_CN, pango fails to render some characters and + // pango's error message contains the broken UTF-8, thus on marshalling + // we need to catch the exception, otherwise we end up in a recursive + // glib exception handling. + message = GLib.Marshaller.Utf8PtrToString (messagePtr); + } catch (Exception e) { + message = "Failed to convert message"; + LoggingService.LogError (message, e); + } + + string msg = string.Format ("{0}-{1}: {2}\n{3}", logDomain, logLevel, message, GetStacktraceIfNeeded (logLevel)); + + switch (logLevel) { + case LogLevelFlags.Debug: + LoggingService.LogDebug (msg); + break; + case LogLevelFlags.Info: + LoggingService.LogInfo (msg); + break; + case LogLevelFlags.Warning: + LoggingService.LogWarning (msg); + break; + case LogLevelFlags.Error: + case LogLevelFlags.Critical: + default: + try { + throw new CriticalGtkException (msg); + } catch (CriticalGtkException e) { + if (logLevel.HasFlag (LogLevelFlags.FlagFatal)) + LoggingService.LogFatalError ($"Fatal {logDomain} error", e); + else + LoggingService.LogInternalError ($"Critical {logDomain} error", e); + } + break; + } + + RemainingBytes -= msg.Length; + if (RemainingBytes < 0) + LoggingService.LogError ("Disabling glib logging for the rest of the session"); + } + + static bool IsMono = Type.GetType ("Mono.Runtime") != null; + + static string GetStacktraceIfNeeded (LogLevelFlags flags) + { + // If it's an Error or a Critical message, we're going to add the stacktrace via the logged exception property, + // we don't need to append it to the message in the log. But we are only doing so on Mono, nowhere else. + if (IsMono && flags.HasFlag (LogLevelFlags.Error | LogLevelFlags.Critical)) + return string.Empty; + + return "Stack trace: \n" + new StackTrace (1, true); + } + + sealed class CriticalGtkException : Exception + { + readonly StackTrace trace = new StackTrace (1, true); + + public CriticalGtkException (string message) : base (message) + { + const System.Reflection.BindingFlags flags = + System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.SetField; + + // HACK: We need to somehow inject our stacktrace, and this is the only way we can + // This is not to transform every glib error into a managed exception + if (IsMono) { + typeof (Exception) + .GetField ("captured_traces", flags) + ?.SetValue (this, new StackTrace [] { trace }); + } + } + + public override string StackTrace => trace.ToString (); + + public override string ToString () + { + // Matches normal exception format: + return GetType () + ": " + Message + Environment.NewLine + trace; + } + } + } +} diff --git a/main/src/tools/ExtensionTools/Application.cs b/main/src/tools/ExtensionTools/Application.cs index 7403015edb0..29bd428dcb6 100644 --- a/main/src/tools/ExtensionTools/Application.cs +++ b/main/src/tools/ExtensionTools/Application.cs @@ -42,7 +42,7 @@ public class Application: IApplication public Task Run (string[] arguments) { - Xwt.Application.Initialize (ToolkitType.Gtk); + Xwt.Application.Initialize (ToolkitType.Gtk3); #if MAC var dir = Path.GetDirectoryName (typeof (Application).Assembly.Location); if (ObjCRuntime.Dlfcn.dlopen (Path.Combine (dir, "libxammac.dylib"), 0) == IntPtr.Zero) {