Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add plugin copy/paste to manage OS clipboard input/output #159

Open
labordep opened this issue Feb 2, 2024 · 2 comments
Open

Add plugin copy/paste to manage OS clipboard input/output #159

labordep opened this issue Feb 2, 2024 · 2 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@labordep
Copy link
Member

labordep commented Feb 2, 2024

The idea is to propose a plugin to manage interactions with the operating system clipboard.
This feature have a high value for UI designer, but in Pharo the way to manage the clipboard is not "clear".
Actually for Windows we have a project to do that (https://github.com/OpenSmock/OS-Windows), and it works nicely.
But I don't know how to do that for others platforms.
May be we need to have a common API, OS agnostic, to manage that.

In consequence this is necessary to propose a Pyramid plugin with a good level of front-end API to manage that, because the clipboard management backend can change depending decision of that in Pharo. This clipboard management can be implemented in an other project to support the interaction with the OS. The Pyramid plugin can use this project to exploit the clipboard. This is a reflexion to have with @ELePors.

About features in Pyramid, copying a BlElement should fill the clipboard with theses capacities:

  • A bitmap image of the BlElement (PNG, JPEG, etc.) => to paste this element in Word, Excel, Mail, Figma, etc.
  • A text representation of the BlElement (i.e. some properties) => to paste this element in a notepad
  • A SVG representation of the BlElement => to paste this element in a design tool like Figma, Inkscape, Adobe Illustrator, etc.
  • A bit Pyramid version of the BlElement => to paste this element in another Pyramid projet => to paste this element in Word, Excel, Mail, etc.
    [Futur] - An HTML version of the BlElement (with the bitmap image)

Actual use-cases:
Copy a BlElement from Pyramid and paste it in a mail as an image.

@Nyan11 what is actually available ?

@labordep labordep added enhancement New feature or request question Further information is requested labels Feb 2, 2024
@Nyan11
Copy link
Collaborator

Nyan11 commented Feb 2, 2024

You can add custom menu in a plugin with:

"Create a Pyramid plugin"

Object << #PyramidQuickMenu
	traits: {TPyramidPlugin};
	slots: {};
	tag: 'plugin-space';
	package: 'Pyramid-Bloc'
"In the connectOn: method do ->"
connectOn: aPyramidEditor

	(aPyramidEditor window services at: #selectionMenu) addItem: [
		:aBuilder | self menuFor: aBuilder ]
"In the menuFor: do ->"

menuFor: aBuilder

	aBuilder
		addGroupEmptySelection: [ :group :empty |
			group
				addItem: [ :item |
					item
						name: 'i am a menu for nothing';
						enabled: true;
						action: [ self inform: 'nothing' ];
						yourself ];
				yourself ]
		order: 40.
	aBuilder
		addGroupSingleSelection: [ :group :single |
			group
				addItem: [ :item |
					item
						name: 'i am a menu for single';
						enabled: true;
						action: [ self inform: single printString ];
						yourself ];
				yourself ]
		order: 40.
	aBuilder
		addGroupMultiSelection: [ :group :multi |
			group
				addItem: [ :item |
					item
						name: 'i am a menu for mutli';
						enabled: true;
						action: [ self inform: multi size printString ];
						yourself ];
				yourself ]
		order: 40

@Nyan11
Copy link
Collaborator

Nyan11 commented Apr 4, 2024

You can also export a Bloc design as a Form and then transform the Form as a png. I do not know if others export format exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants