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

Remove unused methods from ConsoleDriver #2300

Closed
tig opened this issue Jan 20, 2023 · 1 comment · Fixed by #2320
Closed

Remove unused methods from ConsoleDriver #2300

tig opened this issue Jan 20, 2023 · 1 comment · Fixed by #2320
Labels
breaking-change For PRs that introduces a breaking change (behavior or API) enhancement

Comments

@tig
Copy link
Collaborator

tig commented Jan 20, 2023

These methods appear to be unused:

		/// <summary>
		/// Set Colors from limit sets of colors.
		/// </summary>
		/// <param name="foreground">Foreground.</param>
		/// <param name="background">Background.</param>
		public abstract void SetColors (ConsoleColor foreground, ConsoleColor background);

		// Advanced uses - set colors to any pre-set pairs, you would need to init_color
		// that independently with the R, G, B values.
		/// <summary>
		/// Advanced uses - set colors to any pre-set pairs, you would need to init_color
		/// that independently with the R, G, B values.
		/// </summary>
		/// <param name="foregroundColorId">Foreground color identifier.</param>
		/// <param name="backgroundColorId">Background color identifier.</param>
		public abstract void SetColors (short foregroundColorId, short backgroundColorId);

		/// <summary>
		/// Disables the cooked event processing from the mouse driver.  At startup, it is assumed mouse events are cooked.
		/// </summary>
		public abstract void UncookMouse ();

		/// <summary>
		/// Enables the cooked event processing from the mouse driver
		/// </summary>
		public abstract void CookMouse ();

In all existing drivers they are either empty implementations or there are no codepaths that call them.

CursesDriver has code in SetColors but there's no code I can find that ever calls ConsoleDriver.SetColors or Driver.SetColors.

We should remove these methods me thinks, even though it might be ḃreaking change (seems very unlikely).

@tig tig added enhancement breaking-change For PRs that introduces a breaking change (behavior or API) labels Jan 20, 2023
@BDisp
Copy link
Collaborator

BDisp commented Jan 20, 2023

I think that are methods come from the PDCurses. I never seen any code used by them, but might have some logic. SetColors I see in the comment that can be used for RGB, but have wrong parameters, maybe superseded by the SetAttribute. The only issue is if someone already has some driver derived from ConsoleDriver.

@tig tig closed this as completed in #2320 Feb 7, 2023
tig added a commit that referenced this issue Feb 7, 2023
Fixes #2300. Removes unused `ConsoleDriver` APIs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change For PRs that introduces a breaking change (behavior or API) enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants