Mercurial > hg > octave-avbm
view scripts/mkdoc.pl @ 16622:818eef7b2618
allow terminal colors to be set from preferences dialog
* QTerminalInterface.h (QTerminalInterface::setBackgroundColor,
QTerminalInterface::setForeroundColor,
QTerminalInterface::setSelectionColor,
QTerminalInterface::setCursorColor): New functions.
* QUnixTerminalImpl.h, QUnixTerminalImpl.cpp
QUnixTerminalImpl::setBackgroundColor,
QUnixTerminalImpl::setForeroundColor,
QUnixTerminalImpl::setSelectionColor,
QUnixTerminalImpl::setCursorColor): New functions.
* QWinTerminalImpl.h, QWinTerminalImpl.cpp
(QConsolePrivate::setCursorColor): New argument, useForegroundColor.
(QConsolePrivate::m_selectionColor, QConsolePrivate::m_cursorColor):
New member variablebs.
(QConsolePrivate::selectionColor, QConsolePrivate::cursorColor,
QConsolePrivate::setSelectionColor, QConsolePrivate::setCursorColor):
Use member variables instead of Windows console color map.
(QConsolePrivate::cursorColor): Return foreground color if stored
color is invalid.
(QConsolePrivate::setCursorColor): Store invalid color if
useForegroundcolor.
(QConsolePrivate::QConsolePrivate): Set default selection and cursor
colors.
* QTerminal.cc (QTerminal::notice_settings): Handle terminal color
settings.
* resource-manager.h, resource-manager.cc
(resource_manager::terminal_color_names,
resource_manager::terminal_default_colors,
resource_manager::terminal_color_chars): New functions.
* settings-dialog.h, settings-dialog.cc
(settings_dialog::read_terminal_colors): New function.
(settings_dialog::settings_dialog): Call read_terminal_colors. Read
valud for using foreground color for cursor color.
(settings_dialog::write_terminal_colors): New function.
(settings_dialog::write_changed_settings): Call
write_terminal_colors. Handle setting for using foreground color for
cursor color.
* settings-dialog.ui: Add color selection to terminal settings
dialog.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 06 May 2013 06:00:44 -0400 |
parents | a52b03df22cb |
children |
line wrap: on
line source
#! /usr/bin/perl -w # # Copyright (C) 2012 Rik Wehbring # # This file is part of Octave. # # Octave is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at # your option) any later version. # # Octave is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, see # <http://www.gnu.org/licenses/>. ## Expecting arguments in this order: ## ## SRCDIR SRCDIR-FILES ... -- LOCAL-FILES ... unless (@ARGV >= 2) { die "Usage: $0 srcdir m_filename1 ..." ; } $srcdir = shift (@ARGV) . '/'; print <<__END_OF_MSG__; ### DO NOT EDIT! ### ### This file is generated automatically from Octave source files. ### Edit source files directly and run make to update this file. __END_OF_MSG__ MFILE: foreach $m_fname (@ARGV) { if ($m_fname eq "--") { $srcdir = "./"; next MFILE; } $full_fname = $srcdir . $m_fname; next MFILE unless ( $full_fname =~ m{(.*)/(@|)([^/]*)/(.*)\.m} ); if ($2) { $fcn = "$2$3/$4"; } else { $fcn = $4; } @help_txt = gethelp ($fcn, $full_fname); next MFILE if ($help_txt[0] eq ""); print "$fcn\n"; print "\@c $fcn scripts/$m_fname\n"; foreach $_ (@help_txt) { s/^\s+\@/\@/ unless $in_example; s/^\s+\@group/\@group/; s/^\s+\@end\s+group/\@end group/; $in_example = (/\s*\@example\b/ .. /\s*\@end\s+example\b/); print $_; } } ################################################################################ # Subroutines ################################################################################ sub gethelp { ($fcn, $fname) = @_[0..1]; open (FH, $fname) or return ""; do { @help_txt = (); ## Advance to non-blank line while (defined ($_ = <FH>) and /^\s*$/) {;} if (! /^\s*(?:#|%)/ or eof (FH)) { ## No comment block found. Return empty string close (FH); return ""; } ## Extract help text stopping when comment block ends do { ## Remove comment characters at start of line s/^\s*(?:#|%){1,2} ?//; push (@help_txt, $_); } until (! defined ($_ = <FH>) or ! /^\s*(?:#|%)/); } until ($help_txt[0] !~ /^(?:Copyright|Author)/); close (FH); return @help_txt; }