Branch: refs/heads/master
Author: Frank Lanitz <frank(a)frank.uvena.de>
Committer: Frank Lanitz <frank(a)frank.uvena.de>
Date: Sun, 26 Aug 2012 09:16:12
Commit: ca0c77f32eaa317784e1624900fd3128a72d2ffe
https://github.com/geany/geany-plugins/commit/ca0c77f32eaa317784e1624900fd3…
Log Message:
-----------
Merge pull request #61 from codebrainz/markdown
New Plugin: Markdown
Modified Paths:
--------------
Makefile.am
build/markdown.m4
configure.ac
markdown/AUTHORS
markdown/COPYING
markdown/ChangeLog
markdown/Makefile.am
markdown/NEWS
markdown/README
markdown/discount/COPYRIGHT
markdown/discount/CREDITS
markdown/discount/Csio.c
markdown/discount/Makefile.am
markdown/discount/amalloc.c
markdown/discount/amalloc.h
markdown/discount/basename.c
markdown/discount/blocktags
markdown/discount/config.h
markdown/discount/css.c
markdown/discount/cstring.h
markdown/discount/discount-changes.patch
markdown/discount/docheader.c
markdown/discount/dumptree.c
markdown/discount/emmatch.c
markdown/discount/flags.c
markdown/discount/generate.c
markdown/discount/html5.c
markdown/discount/markdown.c
markdown/discount/markdown.h
markdown/discount/mkdio.c
markdown/discount/mkdio.h
markdown/discount/resource.c
markdown/discount/setup.c
markdown/discount/tags.c
markdown/discount/tags.h
markdown/discount/toc.c
markdown/discount/version.c
markdown/discount/xml.c
markdown/discount/xmlpage.c
markdown/docs/Makefile.am
markdown/docs/help.html
markdown/docs/plugin.png
markdown/docs/plugin_mgr.png
markdown/docs/plugin_prefs.png
markdown/docs/plugin_small.png
markdown/docs/set_filetype.png
markdown/docs/settings.png
markdown/src/Makefile.am
markdown/src/conf.c
markdown/src/conf.h
markdown/src/plugin.c
markdown/src/viewer.c
markdown/src/viewer.h
Modified: Makefile.am
4 files changed, 4 insertions(+), 0 deletions(-)
===================================================================
@@ -90,6 +90,10 @@ if ENABLE_GPROJECT
SUBDIRS += gproject
endif
+if ENABLE_MARKDOWN
+SUBDIRS += markdown
+endif
+
if ENABLE_MULTITERM
SUBDIRS += multiterm
endif
Modified: build/markdown.m4
21 files changed, 21 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,21 @@
+AC_DEFUN([GP_CHECK_MARKDOWN],
+[
+ GP_ARG_DISABLE([markdown], [auto])
+
+ GTK_VERSION=2.16
+ WEBKIT_VERSION=1.1.13
+
+ GP_CHECK_PLUGIN_DEPS([markdown], [MARKDOWN],
+ [gtk+-2.0 >= ${GTK_VERSION}
+ webkit-1.0 >= ${WEBKIT_VERSION}
+ gthread-2.0])
+
+ GP_STATUS_PLUGIN_ADD([Markdown], [$enable_markdown])
+
+ AC_CONFIG_FILES([
+ markdown/Makefile
+ markdown/discount/Makefile
+ markdown/src/Makefile
+ markdown/docs/Makefile
+ ])
+])
Modified: configure.ac
1 files changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -46,6 +46,7 @@ GP_CHECK_GEANYVC
GP_CHECK_GEANYPG
GP_CHECK_GENIUSPASTE
GP_CHECK_GPROJECT
+GP_CHECK_MARKDOWN
GP_CHECK_MULTITERM
GP_CHECK_PRETTYPRINTER
GP_CHECK_SHIFTCOLUMN
Modified: markdown/AUTHORS
1 files changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1 @@
+Matthew Brush <mbrush(a)codebrainz.ca>
Modified: markdown/COPYING
339 files changed, 339 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
Modified: markdown/ChangeLog
0 files changed, 0 insertions(+), 0 deletions(-)
===================================================================
No diff available, check online
Modified: markdown/Makefile.am
4 files changed, 4 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,4 @@
+include $(top_srcdir)/build/vars.auxfiles.mk
+
+SUBDIRS = discount src docs
+plugin = markdown
Modified: markdown/NEWS
0 files changed, 0 insertions(+), 0 deletions(-)
===================================================================
No diff available, check online
Modified: markdown/README
182 files changed, 182 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,182 @@
+Markdown
+========
+
+.. image:: plugin_small.png
+ :align: center
+ :alt: The Markdown plugin in action
+ :target: plugin.png
+
+.. contents::
+
+About
+-----
+
+This plugin provides a real-time preview of rendered Markdown, that is,
+`Markdown <http://daringfireball.net/projects/markdown>`_ converted to HTML
+and inserted into an HTML template and loaded into a
+`WebKit <http://www.webkit.org>`_ view.
+
+Features
+--------
+
+ * Allows placing the preview in the sidebar or message window areas
+ * Updates the preview on-the-fly as you type, automatically.
+ * Allows simple customization of fonts and colours and complete control
+ with custom template files.
+
+Usage
+-----
+
+The preview is active by default for all documents with a Markdown filetype
+set. To set a document's filetype, choose from the menus:
+
+.. image:: set_filetype.png
+ :align: center
+ :alt: Choosing Document->Set Filetype->Markup Languages->Markdown source file
+ :target: set_filetype.png
+
+Other than that the operation should be fully automatic. Use the Plugin
+Preferences mechanism to customize some settings as described below.
+
+For more information on Markdown syntax, read the
+`Markdown Syntax Documentation
+<http://daringfireball.net/projects/markdown/syntax>`_.
+
+*Preferences*
+^^^^^^^^^^^^^
+
+.. image:: settings.png
+ :align: center
+ :alt: The Markdown plugin's preferences GUI
+ :target: settings.png
+
+Using Geany's normal Plugin Preferences mechanism, you can customize some
+important settings related to the Markdown preview. The preferences dialog
+allows changing the following settings:
+
+========= ===================================================================
+Name Description
+========= ===================================================================
+Position The area of Geany's UI to put the preview view, currently either
+ in the sidebar or message window (bottom) areas.
+Font The regular body font of the preview.
+Code Font The font to use for the code tags (monospaced) font of the preview.
+BG Color The preview's background color.
+FG Color The preview's foreground (text) color.
+Template The file containing the HTML template for the preview.
+========= ===================================================================
+
+There's two ways to access the Plugin settings, one is through the
+Plugin Manager using the buttons highlighted below:
+
+.. image:: plugin_mgr.png
+ :align: center
+ :alt: The Plugin Manager dialog showing the Help and Preferences buttons.
+ :target: plugin_mgr.png
+
+Clicking the ``Help`` button opens this document in HTML format in your web
+browser. The other way to access the plugin's preferences is through the
+``Edit`` menu as pictured below:
+
+.. image:: plugin_prefs.png
+ :align: center
+ :alt: Accessing plugin preferences from the Edit menu.
+ :target: plugin_prefs.png
+
+*Custom Templates*
+^^^^^^^^^^^^^^^^^^
+
+You can provide a custom HTML template file which contains the substitution
+strings that get replaced at run-time. The following substitution strings
+are available:
+
+============================ ================================================
+Substitution String Description
+============================ ================================================
+``@@markdown@@`` The most important substitution string and
+ gets replaced with the HTML generated from the
+ editor's Markdown buffer. Not having this one
+ in the template makes the plugin completely
+ useless.
+``@@font_name@@`` The normal font family.
+``@@code_font_name@@`` The code/monospace font family.
+``@@font_point_size@@`` The size in points of the normal font.
+``@@code_font_point_size@@`` The size in points of the code/monospace font.
+``@@bg_color@@`` The background color in hex/HTML color notation.
+``@@fg_color@@`` The foreground (text) color in hex/HTML color
+ notation.
+============================ ================================================
+
+The default template file (at the time of writing) contains the following
+HTML code::
+
+ <html>
+ <head>
+ <style type="text/css">
+ body {
+ font-family: @@font_name@@;
+ font-size: @@font_point_size@@pt;
+ background-color: @@bg_color@@;
+ color: @@fg_color@@;
+ }
+ code {
+ font-family: @@code_font_name@@;
+ font-size: @@code_font_point_size@@pt;
+ }
+ </style>
+ </head>
+ <body>
+ @@markdown@@
+ </body>
+ </html>
+
+As you can see it's just normal HTML/CSS and you can tweak it to make the
+preview contents look exactly how you want. The preview view is a WebKit
+browser, the same one used by `Google's Chrome Browser
+<http://google.com/chrome>`_ and `Apple's Safari Browser
+<http://apple.com/safari>`_ as well as numerous others, and it supports many
+modern features such as HTML5 and CSS3 support (at least partially).
+
+If you mess up the default ``template.html`` file, just delete it and the
+default one will be recreated the next time the Markdown plugin is reloaded
+(for example when Geany restarts).
+
+Requirements
+------------
+
+The plugin depends on the following libraries:
+
+ * `GTK+ <http://www.gtk.org>`_ 2.16 or greater
+ * `WebKitGTK+ <http://webkitgtk.org>`_ 1.1.18 or greater
+
+License
+-------
+
+The Markdown plugin is licensed under the GNU General Public License,
+version 2. For the full text of the license, please visit
+http://www.gnu.org/licenses/gpl-2.0.html. The GPL license covers all code
+and files *not* in the ``discount`` directory.
+
+All code inside the ``discount`` directory is under a BSD-style license
+(see the ``discount/COPYRIGHT`` file) and all contributions to this code
+*will* remain under this license. This will make it easier to integrate
+improvements to Discount back upstream if it ever makes sense. So far the
+only changes are superficial to allow it to build with the Geany-Plugins
+build system and to prevent some compiler warnings.
+
+Authors
+-------
+
+The Geany Markdown plugin is written and maintained by::
+
+ Matthew Brush <matt(at)geany(dot)org>
+
+The plugin includes the Discount Markdown library, developed by::
+
+ David Loren Parsons <http://www.pell.portland.or.us/~orc>
+
+Contact
+-------
+
+You can email me at ``matt(at)geany(dot)org``, or find me on the
+``#geany`` IRC channel on FreeNode, with the nickname ``codebrainz``.
Modified: markdown/discount/COPYRIGHT
47 files changed, 47 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,47 @@
+->Copyright (C) 2007 David Loren Parsons.
+All rights reserved.<-
+
+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, sublicence, 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:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions, and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution, and in the same place and form as other
+ copyright, license and disclaimer information.
+
+ 3. The end-user documentation included with the redistribution, if
+ any, must include the following acknowledgment:
+
+ This product includes software developed by
+ David Loren Parsons <http://www.pell.portland.or.us/~orc>
+
+ in the same place and form as other third-party acknowledgments.
+ Alternately, this acknowledgment may appear in the software
+ itself, in the same form and location as other such third-party
+ acknowledgments.
+
+ 4. Except as contained in this notice, the name of David Loren
+ Parsons shall not be used in advertising or otherwise to promote
+ the sale, use or other dealings in this Software without prior
+ written authorization from David Loren Parsons.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL DAVID LOREN PARSONS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
Modified: markdown/discount/CREDITS
35 files changed, 35 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,35 @@
+Discount is primarily my work, but it has only reached the point
+where it is via contributions, critiques, and bug reports from a
+host of other people, some of which are listed before. If your
+name isn't on this list, please remind me
+ -david parsons (orc(a)pell.chi.il.us)
+
+
+Josh Wood -- Plan9 support.
+Mike Schiraldi -- Reddit style automatic links, MANY MANY MANY
+ bug reports about boundary conditions and
+ places where I didn't get it right.
+Jjgod Jiang -- Table of contents support.
+Petite Abeille -- Many bug reports about places where I didn't
+ get it right.
+Tim Channon -- inspiration for the `mkd_xhtmlpage()` function
+Christian Herenz-- Many bug reports regarding my implementation of
+ `[]()` and `![]()`
+A.S.Bradbury -- Portability bug reports for 64 bit systems.
+Joyent -- Loan of a solaris box so I could get discount
+ working under solaris.
+Ryan Tomayko -- Portability requests (and the rdiscount ruby
+ binding.)
+yidabu -- feedback on the documentation, bug reports
+ against utf-8 support.
+Pierre Joye -- bug reports, php discount binding.
+Masayoshi Sekimura- perl discount binding.
+Jeremy Hinegardner- bug reports about list handling.
+Andrew White -- bug reports about the format of generated urls.
+Steve Huff -- bug reports about Makefile portability (for Fink)
+Ignacio Burgue?o-- bug reports about `>%class%`
+Henrik Nyh -- bug reports about embedded html handling.
+John J. Foerch -- bug reports about incorrect `–` and `—`
+ translations.
+
+
Modified: markdown/discount/Csio.c
61 files changed, 61 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,61 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include "cstring.h"
+#include "markdown.h"
+#include "amalloc.h"
+
+
+/* putc() into a cstring
+ */
+void
+Csputc(int c, Cstring *iot)
+{
+ EXPAND(*iot) = c;
+}
+
+
+/* printf() into a cstring
+ */
+int
+Csprintf(Cstring *iot, char *fmt, ...)
+{
+ va_list ptr;
+ int siz=100;
+
+ do {
+ RESERVE(*iot, siz);
+ va_start(ptr, fmt);
+ siz = vsnprintf(T(*iot)+S(*iot), ALLOCATED(*iot)-S(*iot), fmt, ptr);
+ va_end(ptr);
+ } while ( siz > (ALLOCATED(*iot)-S(*iot)) );
+
+ S(*iot) += siz;
+ return siz;
+}
+
+
+/* write() into a cstring
+ */
+int
+Cswrite(Cstring *iot, char *bfr, int size)
+{
+ RESERVE(*iot, size);
+ memcpy(T(*iot)+S(*iot), bfr, size);
+ S(*iot) += size;
+ return size;
+}
+
+
+/* reparse() into a cstring
+ */
+void
+Csreparse(Cstring *iot, char *buf, int size, int flags)
+{
+ MMIOT f;
+ ___mkd_initmmiot(&f, 0);
+ ___mkd_reparse(buf, size, 0, &f);
+ ___mkd_emblock(&f);
+ SUFFIX(*iot, T(f.out), S(f.out));
+ ___mkd_freemmiot(&f, 0);
+}
Modified: markdown/discount/Makefile.am
31 files changed, 31 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,31 @@
+noinst_LTLIBRARIES = libdiscount.la
+
+libdiscount_la_SOURCES = \
+ amalloc.c \
+ amalloc.h \
+ basename.c \
+ config.h \
+ Csio.c \
+ css.c \
+ cstring.h \
+ docheader.c \
+ dumptree.c \
+ emmatch.c \
+ flags.c \
+ generate.c \
+ html5.c \
+ markdown.c \
+ markdown.h \
+ mkdio.c \
+ mkdio.h \
+ resource.c \
+ setup.c \
+ tags.c \
+ tags.h \
+ toc.c \
+ version.c \
+ xml.c \
+ xmlpage.c
+
+libdiscount_la_CPPFLAGS = @MARKDOWN_CFLAGS@
+libdiscount_la_LIBADD = @MARKDOWN_LIBS@
Modified: markdown/discount/amalloc.c
111 files changed, 111 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,111 @@
+/*
+ * debugging malloc()/realloc()/calloc()/free() that attempts
+ * to keep track of just what's been allocated today.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#define MAGIC 0x1f2e3d4c
+
+struct alist { int magic, size; struct alist *next, *last; };
+
+static struct alist list = { 0, 0, 0, 0 };
+
+static int mallocs=0;
+static int reallocs=0;
+static int frees=0;
+
+void *
+acalloc(int size, int count)
+{
+ struct alist *ret = calloc(size + sizeof(struct alist), count);
+
+ if ( ret ) {
+ ret->magic = MAGIC;
+ ret->size = size * count;
+ if ( list.next ) {
+ ret->next = list.next;
+ ret->last = &list;
+ ret->next->last = ret;
+ list.next = ret;
+ }
+ else {
+ ret->last = ret->next = &list;
+ list.next = list.last = ret;
+ }
+ ++mallocs;
+ return ret+1;
+ }
+ return 0;
+}
+
+
+void*
+amalloc(int size)
+{
+ return acalloc(size,1);
+}
+
+
+void
+afree(void *ptr)
+{
+ struct alist *p2 = ((struct alist*)ptr)-1;
+
+ if ( p2->magic == MAGIC ) {
+ p2->last->next = p2->next;
+ p2->next->last = p2->last;
+ ++frees;
+ free(p2);
+ }
+ else
+ free(ptr);
+}
+
+
+void *
+arealloc(void *ptr, int size)
+{
+ struct alist *p2 = ((struct alist*)ptr)-1;
+ struct alist save;
+
+ if ( p2->magic == MAGIC ) {
+ save.next = p2->next;
+ save.last = p2->last;
+ p2 = realloc(p2, sizeof(*p2) + size);
+
+ if ( p2 ) {
+ p2->size = size;
+ p2->next->last = p2;
+ p2->last->next = p2;
+ ++reallocs;
+ return p2+1;
+ }
+ else {
+ save.next->last = save.last;
+ save.last->next = save.next;
+ return 0;
+ }
+ }
+ return realloc(ptr, size);
+}
+
+
+void
+adump()
+{
+ struct alist *p;
+
+
+ for ( p = list.next; p && (p != &list); p = p->next ) {
+ fprintf(stderr, "allocated: %d byte%s\n", p->size, (p->size==1) ? "" : "s");
+ fprintf(stderr, " [%.*s]\n", p->size, (char*)(p+1));
+ }
+
+ if ( getenv("AMALLOC_STATISTICS") ) {
+ fprintf(stderr, "%d malloc%s\n", mallocs, (mallocs==1)?"":"s");
+ fprintf(stderr, "%d realloc%s\n", reallocs, (reallocs==1)?"":"s");
+ fprintf(stderr, "%d free%s\n", frees, (frees==1)?"":"s");
+ }
+}
Modified: markdown/discount/amalloc.h
29 files changed, 29 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,29 @@
+/*
+ * debugging malloc()/realloc()/calloc()/free() that attempts
+ * to keep track of just what's been allocated today.
+ */
+#ifndef AMALLOC_D
+#define AMALLOC_D
+
+#include "config.h"
+
+#ifdef USE_AMALLOC
+
+extern void *amalloc(int);
+extern void *acalloc(int,int);
+extern void *arealloc(void*,int);
+extern void afree(void*);
+extern void adump();
+
+#define malloc amalloc
+#define calloc acalloc
+#define realloc arealloc
+#define free afree
+
+#else
+
+#define adump() (void)1
+
+#endif
+
+#endif/*AMALLOC_D*/
Modified: markdown/discount/basename.c
43 files changed, 43 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,43 @@
+/*
+ * mkdio -- markdown front end input functions
+ *
+ * Copyright (C) 2007 David L Parsons.
+ * The redistribution terms are provided in the COPYRIGHT file that must
+ * be distributed with this source code.
+ */
+#include "config.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+#include "mkdio.h"
+#include "cstring.h"
+#include "amalloc.h"
+
+static char *
+e_basename(const char *string, const int size, void *context)
+{
+ char *ret;
+ char *base = (char*)context;
+
+ if ( base && string && (*string == '/') && (ret=malloc(strlen(base)+size+2)) ) {
+ strcpy(ret, base);
+ strncat(ret, string, size);
+ return ret;
+ }
+ return 0;
+}
+
+static void
+e_free(char *string, void *context)
+{
+ if ( string ) free(string);
+}
+
+void
+mkd_basename(MMIOT *document, char *base)
+{
+ mkd_e_url(document, e_basename);
+ mkd_e_data(document, base);
+ mkd_e_free(document, e_free);
+}
Modified: markdown/discount/blocktags
33 files changed, 33 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,33 @@
+static struct kw blocktags[] = {
+ { "P", 1, 0 },
+ { "DL", 2, 0 },
+ { "H1", 2, 0 },
+ { "H2", 2, 0 },
+ { "H3", 2, 0 },
+ { "H4", 2, 0 },
+ { "H5", 2, 0 },
+ { "H6", 2, 0 },
+ { "HR", 2, 1 },
+ { "OL", 2, 0 },
+ { "UL", 2, 0 },
+ { "BDO", 3, 0 },
+ { "DFN", 3, 0 },
+ { "DIV", 3, 0 },
+ { "MAP", 3, 0 },
+ { "PRE", 3, 0 },
+ { "WBR", 3, 0 },
+ { "XMP", 3, 0 },
+ { "NOBR", 4, 0 },
+ { "STYLE", 5, 0 },
+ { "TABLE", 5, 0 },
+ { "CENTER", 6, 0 },
+ { "IFRAME", 6, 0 },
+ { "OBJECT", 6, 0 },
+ { "SCRIPT", 6, 0 },
+ { "ADDRESS", 7, 0 },
+ { "LISTING", 7, 0 },
+ { "PLAINTEXT", 9, 0 },
+ { "BLOCKQUOTE", 10, 0 },
+};
+
+#define NR_blocktags 29
Modified: markdown/discount/config.h
35 files changed, 35 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,35 @@
+/*
+ * In the upstream Discount tree, this file is auto-generated, for the
+ * Geany plugin it's not.
+ */
+#ifndef DISCOUNT_CONFIG_H
+#define DISCOUNT_CONFIG_H 1
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+#define OS_LINUX G_OS_UNIX
+#define USE_DISCOUNT_DL 0
+#define DWORD guint32
+#define WORD guint16
+#define BYTE guint8
+#define HAVE_BASENAME 0
+#define HAVE_LIBGEN_H 0
+#define HAVE_PWD_H 0
+#define HAVE_GETPWUID 0
+#define HAVE_SRANDOM 0
+#define INITRNG(x) srandom((unsigned int)x)
+#define HAVE_BZERO 0
+#define HAVE_RANDOM 0
+#define COINTOSS() (random()&1)
+#define HAVE_STRCASECMP 0
+#define HAVE_STRNCASECMP 0
+#define HAVE_FCHDIR 0
+#define TABSTOP 4
+#define HAVE_MALLOC_H 0
+#define VERSION "2.1.3"
+
+G_END_DECLS
+
+#endif /* DISCOUNT_CONFIG_H */
Modified: markdown/discount/css.c
85 files changed, 85 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,85 @@
+/* markdown: a C implementation of John Gruber's Markdown markup language.
+ *
+ * Copyright (C) 2009 David L Parsons.
+ * The redistribution terms are provided in the COPYRIGHT file that must
+ * be distributed with this source code.
+ */
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <time.h>
+#include <ctype.h>
+
+#include "config.h"
+
+#include "cstring.h"
+#include "markdown.h"
+#include "amalloc.h"
+
+
+/*
+ * dump out stylesheet sections.
+ */
+static void
+stylesheets(Paragraph *p, Cstring *f)
+{
+ Line* q;
+
+ for ( ; p ; p = p->next ) {
+ if ( p->typ == STYLE ) {
+ for ( q = p->text; q ; q = q->next ) {
+ Cswrite(f, T(q->text), S(q->text));
+ Csputc('\n', f);
+ }
+ }
+ if ( p->down )
+ stylesheets(p->down, f);
+ }
+}
+
+
+/* dump any embedded styles to a string
+ */
+int
+mkd_css(Document *d, char **res)
+{
+ Cstring f;
+ int size;
+
+ if ( res && d && d->compiled ) {
+ *res = 0;
+ CREATE(f);
+ RESERVE(f, 100);
+ stylesheets(d->code, &f);
+
+ if ( (size = S(f)) > 0 ) {
+ EXPAND(f) = 0;
+ /* HACK ALERT! HACK ALERT! HACK ALERT! */
+ *res = T(f);/* we know that a T(Cstring) is a character pointer */
+ /* so we can simply pick it up and carry it away, */
+ /* leaving the husk of the Ctring on the stack */
+ /* END HACK ALERT */
+ }
+ else
+ DELETE(f);
+ return size;
+ }
+ return EOF;
+}
+
+
+/* dump any embedded styles to a file
+ */
+int
+mkd_generatecss(Document *d, FILE *f)
+{
+ char *res;
+ int written = EOF, size = mkd_css(d, &res);
+
+ if ( size > 0 )
+ written = fwrite(res, 1, size, f);
+ if ( res )
+ free(res);
+ return (written == size) ? size : EOF;
+}
Modified: markdown/discount/cstring.h
77 files changed, 77 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,77 @@
+/* two template types: STRING(t) which defines a pascal-style string
+ * of element (t) [STRING(char) is the closest to the pascal string],
+ * and ANCHOR(t) which defines a baseplate that a linked list can be
+ * built up from. [The linked list /must/ contain a ->next pointer
+ * for linking the list together with.]
+ */
+#ifndef _CSTRING_D
+#define _CSTRING_D
+
+#include <string.h>
+#include <stdlib.h>
+
+#ifndef __WITHOUT_AMALLOC
+# include "amalloc.h"
+#endif
+
+/* expandable Pascal-style string.
+ */
+#define STRING(type) struct { type *text; int size, alloc; }
+
+#define CREATE(x) ( (T(x) = (void*)0), (S(x) = (x).alloc = 0) )
+#define EXPAND(x) (S(x)++)[(S(x) < (x).alloc) \
+ ? (T(x)) \
+ : (T(x) = T(x) ? realloc(T(x), sizeof T(x)[0] * ((x).alloc += 100)) \
+ : malloc(sizeof T(x)[0] * ((x).alloc += 100)) )]
+
+#define DELETE(x) ALLOCATED(x) ? (free(T(x)), S(x) = (x).alloc = 0) \
+ : ( S(x) = 0 )
+#define CLIP(t,i,sz) \
+ ( ((i) >= 0) && ((sz) > 0) && (((i)+(sz)) <= S(t)) ) ? \
+ (memmove(&T(t)[i], &T(t)[i+sz], (S(t)-(i+sz)+1)*sizeof(T(t)[0])), \
+ S(t) -= (sz)) : -1
+
+#define RESERVE(x, sz) T(x) = ((x).alloc > S(x) + (sz) \
+ ? T(x) \
+ : T(x) \
+ ? realloc(T(x), sizeof T(x)[0] * ((x).alloc = 100+(sz)+S(x))) \
+ : malloc(sizeof T(x)[0] * ((x).alloc = 100+(sz)+S(x))))
+#define SUFFIX(t,p,sz) \
+ memcpy(((S(t) += (sz)) - (sz)) + \
+ (T(t) = T(t) ? realloc(T(t), sizeof T(t)[0] * ((t).alloc += sz)) \
+ : malloc(sizeof T(t)[0] * ((t).alloc += sz))), \
+ (p), sizeof(T(t)[0])*(sz))
+
+#define MDPREFIX(t,p,sz) \
+ RESERVE( (t), (sz) ); \
+ if ( S(t) ) { memmove(T(t)+(sz), T(t), S(t)); } \
+ memcpy( T(t), (p), (sz) ); \
+ S(t) += (sz)
+
+/* reference-style links (and images) are stored in an array
+ */
+#define T(x) (x).text
+#define S(x) (x).size
+#define ALLOCATED(x) (x).alloc
+
+/* abstract anchor type that defines a list base
+ * with a function that attaches an element to
+ * the end of the list.
+ *
+ * the list base field is named .text so that the T()
+ * macro will work with it.
+ */
+#define ANCHOR(t) struct { t *text, *end; }
+#define E(t) ((t).end)
+
+#define ATTACH(t, p) ( T(t) ? ( (E(t)->next = (p)), (E(t) = (p)) ) \
+ : ( (T(t) = E(t) = (p)) ) )
+
+typedef STRING(char) Cstring;
+
+extern void Csputc(int, Cstring *);
+extern int Csprintf(Cstring *, char *, ...);
+extern int Cswrite(Cstring *, char *, int);
+extern void Csreparse(Cstring *, char *, int, int);
+
+#endif/*_CSTRING_D*/
Modified: markdown/discount/discount-changes.patch
1006 files changed, 1006 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,1006 @@
+Only in discount/: blocktags
+Only in discount/: config.h
+Only in discount-2.1.3/: configure.inc
+Only in discount-2.1.3/: configure.sh
+diff -ru discount-2.1.3/cstring.h discount/cstring.h
+--- discount-2.1.3/cstring.h 2012-01-16 13:08:52.000000000 -0800
++++ discount/cstring.h 2012-07-16 02:46:53.027807216 -0700
+@@ -42,7 +42,7 @@
+ : malloc(sizeof T(t)[0] * ((t).alloc += sz))), \
+ (p), sizeof(T(t)[0])*(sz))
+
+-#define PREFIX(t,p,sz) \
++#define MDPREFIX(t,p,sz) \
+ RESERVE( (t), (sz) ); \
+ if ( S(t) ) { memmove(T(t)+(sz), T(t), S(t)); } \
+ memcpy( T(t), (p), (sz) ); \
+Only in discount/: .deps
+Only in discount/: discount-changes.patch
+diff -ru discount-2.1.3/emmatch.c discount/emmatch.c
+--- discount-2.1.3/emmatch.c 2012-01-16 13:08:52.000000000 -0800
++++ discount/emmatch.c 2012-07-16 02:46:53.031807216 -0700
+@@ -141,7 +141,7 @@
+
+ emblock(f, first, e);
+
+- PREFIX(start->b_text, emtags[match-1].open, emtags[match-1].size-1);
++ MDPREFIX(start->b_text, emtags[match-1].open, emtags[match-1].size-1);
+ SUFFIX(end->b_post, emtags[match-1].close, emtags[match-1].size);
+
+ emmatch(f, first, last);
+diff -ru discount-2.1.3/generate.c discount/generate.c
+--- discount-2.1.3/generate.c 2012-01-16 13:08:52.000000000 -0800
++++ discount/generate.c 2012-07-16 17:56:36.659229192 -0700
+@@ -115,7 +115,7 @@
+ Qchar(int c, MMIOT *f)
+ {
+ block *cur;
+-
++
+ if ( S(f->Q) == 0 ) {
+ cur = &EXPAND(f->Q);
+ memset(cur, 0, sizeof *cur);
+@@ -125,7 +125,7 @@
+ cur = &T(f->Q)[S(f->Q)-1];
+
+ EXPAND(cur->b_text) = c;
+-
++
+ }
+
+
+@@ -188,7 +188,7 @@
+ MMIOT sub;
+
+ ___mkd_initmmiot(&sub, f->footnotes);
+-
++
+ sub.flags = f->flags | flags;
+ sub.cb = f->cb;
+ sub.ref_prefix = f->ref_prefix;
+@@ -196,10 +196,10 @@
+ push(bfr, size, &sub);
+ EXPAND(sub.in) = 0;
+ S(sub.in)--;
+-
++
+ text(&sub);
+ ___mkd_emblock(&sub);
+-
++
+ Qwrite(T(sub.out), S(sub.out), f);
+
+ ___mkd_freemmiot(&sub, f->footnotes);
+@@ -223,7 +223,7 @@
+ if ( !( ispunct(c) || isspace(c) ) )
+ Qchar('\\', f);
+ }
+-
++
+ if ( c == '&' )
+ Qstring("&", f);
+ else if ( c == '<' )
+@@ -355,7 +355,7 @@
+ /* extract a <...>-encased url from the input stream.
+ * (markdown 1.0.2b8 compatibility; older versions
+ * of markdown treated the < and > as syntactic
+- * sugar that didn't have to be there. 1.0.2b8
++ * sugar that didn't have to be there. 1.0.2b8
+ * requires a closing >, and then falls into the
+ * title or closing )
+ */
+@@ -385,13 +385,13 @@
+ good=1;
+ else if ( image && (c == '=') && linkysize(f,p) )
+ good=1;
+- else
++ else
+ good=( c == ')' );
+
+ if ( good ) {
+ if ( peek(f, 1) == ')' )
+ pull(f);
+-
++
+ ___mkd_tidy(&p->link);
+ }
+
+@@ -437,12 +437,12 @@
+ }
+ if ( peek(f, 1) == ')' )
+ pull(f);
+-
++
+ ___mkd_tidy(&p->link);
+-
++
+ if ( mayneedtotrim && (T(p->link)[S(p->link)-1] == '>') )
+ --S(p->link);
+-
++
+ return 1;
+ }
+
+@@ -453,12 +453,12 @@
+ static struct _protocol {
+ char *name;
+ int nlen;
+-} protocol[] = {
++} protocol[] = {
+ #define _aprotocol(x) { x, (sizeof x)-1 }
+- _aprotocol( "https:" ),
+- _aprotocol( "http:" ),
++ _aprotocol( "https:" ),
++ _aprotocol( "http:" ),
+ _aprotocol( "news:" ),
+- _aprotocol( "ftp:" ),
++ _aprotocol( "ftp:" ),
+ #undef _aprotocol
+ };
+ #define NRPROTOCOLS (sizeof protocol / sizeof protocol[0])
+@@ -479,7 +479,7 @@
+
+ /*
+ * all the tag types that linkylinky can produce are
+- * defined by this structure.
++ * defined by this structure.
+ */
+ typedef struct linkytype {
+ char *pat;
+@@ -538,12 +538,12 @@
+ printlinkyref(MMIOT *f, linkytype *tag, char *link, int size)
+ {
+ char *edit;
+-
++
+ if ( f->flags & IS_LABEL )
+ return;
+-
++
+ Qstring(tag->link_pfx, f);
+-
++
+ if ( tag->kind & IS_URL ) {
+ if ( f->cb && f->cb->e_url && (edit = (*f->cb->e_url)(link, size, f->cb->e_data)) ) {
+ puturl(edit, strlen(edit), f, 0);
+@@ -583,7 +583,7 @@
+ {
+ if ( ref->flags & REFERENCED )
+ return 0;
+-
++
+ if ( f->flags & IS_LABEL )
+ ___mkd_reparse(T(text), S(text), linkt.flags, f);
+ else {
+@@ -659,7 +659,7 @@
+ int start = mmiottell(f);
+ Cstring name;
+ Footnote key, *ref;
+-
++
+ int status = 0;
+ int extra_footnote = 0;
+
+@@ -677,7 +677,7 @@
+
+ if ( isspace(peek(f,1)) )
+ pull(f);
+-
++
+ if ( peek(f,1) == '[' ) {
+ pull(f); /* consume leading '[' */
+ goodlink = linkylabel(f, &key.tag);
+@@ -692,7 +692,7 @@
+ if ( (f->flags & MKD_EXTRA_FOOTNOTE) && (!image) && S(name) && T(name)[0] == '^' )
+ extra_footnote = 1;
+ }
+-
++
+ if ( goodlink ) {
+ if ( !S(key.tag) ) {
+ DELETE(key.tag);
+@@ -737,7 +737,7 @@
+ }
+ }
+
+-
++
+ /*
+ * convert an email address to a string of nonsense
+ */
+@@ -775,7 +775,7 @@
+ {
+ int size, count, c;
+ int subsize=0, subtick=0;
+-
++
+ *endticks = ticks;
+ for (size = 0; (c=peek(f,size+ticks)) != EOF; size ++) {
+ if ( (c == tickchar) && ( count = nrticks(size+ticks,tickchar,f)) ) {
+@@ -836,7 +836,7 @@
+
+ if ( size > 1 && peek(f, size-1) == ' ' ) --size;
+ if ( peek(f,i) == ' ' ) ++i, --size;
+-
++
+ Qstring("<code>", f);
+ code(f, cursor(f)+(i-1), size);
+ Qstring("</code>", f);
+@@ -873,17 +873,17 @@
+ maybe_address(char *p, int size)
+ {
+ int ok = 0;
+-
++
+ for ( ;size && (isalnum(*p) || strchr("._-+*", *p)); ++p, --size)
+ ;
+
+ if ( ! (size && *p == '@') )
+ return 0;
+-
++
+ --size, ++p;
+
+ if ( size && *p == '.' ) return 0;
+-
++
+ for ( ;size && (isalnum(*p) || strchr("._-+", *p)); ++p, --size )
+ if ( *p == '.' && size > 1 ) ok = 1;
+
+@@ -902,7 +902,7 @@
+ int address= 0;
+ int mailto = 0;
+ char *text = cursor(f);
+-
++
+ if ( f->flags & MKD_NOLINKS ) return 0;
+
+ if ( (size > 7) && strncasecmp(text, "mailto:", 7) == 0 ) {
+@@ -912,10 +912,10 @@
+ address = 1;
+ mailto = 7; /* 7 is the length of "mailto:"; we need this */
+ }
+- else
++ else
+ address = maybe_address(text, size);
+
+- if ( address ) {
++ if ( address ) {
+ Qstring("<a href=\"", f);
+ if ( !mailto ) {
+ /* supply a mailto: protocol if one wasn't attached */
+@@ -982,7 +982,7 @@
+ return 0;
+ else
+ size++;
+-
++
+ if ( forbidden_tag(f) )
+ return 0;
+
+@@ -996,7 +996,7 @@
+ return 1;
+ }
+ }
+-
++
+ return 0;
+ }
+
+@@ -1226,7 +1226,7 @@
+ else
+ Qchar(c, f);
+ break;
+-
++
+ case '!': if ( peek(f,1) == '[' ) {
+ pull(f);
+ if ( tag_text(f) || !linkylinky(1, f) )
+@@ -1296,7 +1296,7 @@
+ Qem(f,c,rep);
+ }
+ break;
+-
++
+ case '~': if ( (f->flags & (MKD_NOSTRIKETHROUGH|MKD_TAGTEXT|MKD_STRICT)) || ! tickhandler(f,c,2,0, delspan) )
+ Qchar(c, f);
+ break;
+@@ -1317,7 +1317,7 @@
+ }
+ Qchar(c, f);
+ break;
+-
++
+ case ':': case '|':
+ if ( f->flags & MKD_NOTABLES ) {
+ Qchar('\\', f);
+@@ -1326,7 +1326,7 @@
+ }
+ Qchar(c, f);
+ break;
+-
++
+ case '>': case '#': case '.': case '-':
+ case '+': case '{': case '}': case ']':
+ case '!': case '[': case '*': case '_':
+@@ -1413,7 +1413,7 @@
+ ___mkd_tidy(&p->text);
+ if ( T(p->text)[S(p->text)-1] == '|' )
+ --S(p->text);
+-
++
+ Qstring("<tr>\n", f);
+ while ( idx < S(p->text) ) {
+ first = idx;
+@@ -1474,7 +1474,7 @@
+ for (p=T(dash->text), start=dash->dle; start < S(dash->text); ) {
+ char first, last;
+ int end;
+-
++
+ last=first=0;
+ for (end=start ; (end < S(dash->text)) && p[end] != '|'; ++ end ) {
+ if ( p[end] == '\\' )
+@@ -1569,10 +1569,10 @@
+ printhtml(Line *t, MMIOT *f)
+ {
+ int blanks;
+-
++
+ for ( blanks=0; t ; t = t->next )
+ if ( S(t->text) ) {
+- for ( ; blanks; --blanks )
++ for ( ; blanks; --blanks )
+ Qchar('\n', f);
+
+ Qwrite(T(t->text), S(t->text), f);
+@@ -1651,7 +1651,7 @@
+ display(Paragraph *p, MMIOT *f)
+ {
+ if ( !p ) return 0;
+-
++
+ switch ( p->typ ) {
+ case STYLE:
+ case WHITESPACE:
+@@ -1660,15 +1660,15 @@
+ case HTML:
+ printhtml(p->text, f);
+ break;
+-
++
+ case CODE:
+ printcode(p->text, f);
+ break;
+-
++
+ case QUOTE:
+ htmlify(p->down, p->ident ? "div" : "blockquote", p->ident, f);
+ break;
+-
++
+ case UL:
+ case OL:
+ case AL:
+@@ -1694,7 +1694,7 @@
+ case SOURCE:
+ htmlify(p->down, 0, 0, f);
+ break;
+-
++
+ default:
+ printblock(p, f);
+ break;
+@@ -1715,7 +1715,7 @@
+ return;
+
+ Csprintf(&m->out, "\n<div class=\"footnotes\">\n<hr/>\n<ol>\n");
+-
++
+ for ( i=1; i <= m->reference; i++ ) {
+ for ( j=0; j < S(*m->footnotes); j++ ) {
+ t = &T(*m->footnotes)[j];
+@@ -1740,22 +1740,23 @@
+ mkd_document(Document *p, char **res)
+ {
+ int size;
+-
++
+ if ( p && p->compiled ) {
+- if ( ! p->html ) {
+- htmlify(p->code, 0, 0, p->ctx);
+- if ( p->ctx->flags & MKD_EXTRA_FOOTNOTE )
+- mkd_extra_footnotes(p->ctx);
+- p->html = 1;
+- }
+
+- size = S(p->ctx->out);
+-
+- if ( (size == 0) || T(p->ctx->out)[size-1] )
+- EXPAND(p->ctx->out) = 0;
+-
+- *res = T(p->ctx->out);
+- return size;
++ if ( ! p->html ) {
++ htmlify(p->code, 0, 0, p->ctx);
++ if ( p->ctx->flags & MKD_EXTRA_FOOTNOTE )
++ mkd_extra_footnotes(p->ctx);
++ p->html = 1;
++ }
++
++ size = S(p->ctx->out);
++
++ if ( (size == 0) || T(p->ctx->out)[size-1] )
++ EXPAND(p->ctx->out) = 0;
++
++ *res = T(p->ctx->out);
++ return size;
+ }
+ return EOF;
+ }
+Only in discount-2.1.3/: INSTALL
+Only in discount-2.1.3/: main.c
+Only in discount-2.1.3/: Makefile.in
+Only in discount-2.1.3/: makepage.1
+Only in discount-2.1.3/: makepage.c
+Only in discount-2.1.3/: markdown.1
+Only in discount-2.1.3/: markdown.3
+Only in discount-2.1.3/: markdown.7
+diff -ru discount-2.1.3/markdown.c discount/markdown.c
+--- discount-2.1.3/markdown.c 2012-01-16 13:08:52.000000000 -0800
++++ discount/markdown.c 2012-07-16 19:52:23.619155626 -0700
+@@ -125,11 +125,11 @@
+ * the !-- doesn't need to end in a whitespace
+ */
+ return &comment;
+-
++
+ /* find how long the tag is so we can check to see if
+ * it's a block-level tag
+ */
+- for ( i=1; i < len && T(p->text)[i] != '>'
++ for ( i=1; i < len && T(p->text)[i] != '>'
+ && T(p->text)[i] != '/'
+ && !isspace(T(p->text)[i]); ++i )
+ ;
+@@ -193,7 +193,7 @@
+ l->flags |= CHECKED;
+ l->kind = chk_text;
+ l->count = 0;
+-
++
+ if (l->dle >= 4) { l->kind=chk_code; return; }
+
+ for ( eol = S(l->text); eol > l->dle && isspace(T(l->text)[eol-1]); --eol )
+@@ -261,10 +261,10 @@
+ int i, closing, depth=0;
+
+ *unclosed = 0;
+-
++
+ if ( tag == &comment )
+ return commentblock(p, unclosed);
+-
++
+ if ( tag->selfclose ) {
+ ret = f.t->next;
+ f.t->next = 0;
+@@ -286,7 +286,7 @@
+ }
+ }
+ }
+- else {
++ else {
+ if ( closing = (c == '/') ) c = flogetc(&f);
+
+ for ( i=0; i < tag->size; c=flogetc(&f) ) {
+@@ -369,7 +369,7 @@
+ issetext(Line *t, int *htyp)
+ {
+ Line *n;
+-
++
+ /* check for setext-style HEADER
+ * ======
+ */
+@@ -407,10 +407,10 @@
+ end_of_block(Line *t)
+ {
+ int dummy;
+-
++
+ if ( !t )
+ return 0;
+-
++
+ return ( (S(t->text) <= t->dle) || ishr(t) || ishdr(t, &dummy) );
+ }
+
+@@ -448,11 +448,11 @@
+ is_extra_dt(Line *t, int *clip)
+ {
+ #if USE_EXTRA_DL
+-
++
+ if ( t && t->next && T(t->text)[0] != '='
+ && T(t->text)[S(t->text)-1] != '=') {
+ Line *x;
+-
++
+ if ( iscode(t) || end_of_block(t) )
+ return 0;
+
+@@ -460,7 +460,7 @@
+ *clip = x->dle+2;
+ return t;
+ }
+-
++
+ if ( x=is_extra_dt(t->next, clip) )
+ return x;
+ }
+@@ -488,7 +488,7 @@
+ {
+ int i, j;
+ char *q;
+-
++
+ if ( end_of_block(t) )
+ return 0;
+
+@@ -514,7 +514,7 @@
+ return AL;
+ }
+
+- strtoul(T(t->text)+t->dle, &q, 10);
++ unsigned long res = strtoul(T(t->text)+t->dle, &q, 10);
+ if ( (q > T(t->text)+t->dle) && (q == T(t->text) + (j-1)) ) {
+ j = nextnonblank(t,j);
+ *clip = (j > 4) ? 4 : j;
+@@ -539,7 +539,7 @@
+ /* p->text is header, p->next->text is -'s or ='s
+ */
+ pp->hnumber = (T(p->next->text)[0] == '=') ? 1 : 2;
+-
++
+ ret = p->next->next;
+ ___mkd_freeLine(p->next);
+ p->next = 0;
+@@ -614,7 +614,7 @@
+ Paragraph *ret;
+
+ first = (*ptr);
+-
++
+ /* don't allow zero-length code fences
+ */
+ if ( (first->next == 0) || iscodefence(first->next, first->count) )
+@@ -744,7 +744,7 @@
+ * it just takes ^> to start a quote, following lines, if quoted,
+ * assume that the prefix is ``> ''. This means that code needs
+ * to be indented *5* spaces from the leading '>', but *4* spaces
+- * from the start of the line. This does not appear to be
++ * from the start of the line. This does not appear to be
+ * documented in the reference implementation, but it's the
+ * way the markdown sample web form at Daring Fireball works.
+ */
+@@ -782,14 +782,14 @@
+ if ( isdivmarker(p->text,0,flags) ) {
+ char *prefix = "class";
+ int i;
+-
++
+ q = p->text;
+ p->text = p->text->next;
+
+ if ( (i = szmarkerclass(1+T(q->text))) == 3 )
+ /* and this would be an "%id:" prefix */
+ prefix="id";
+-
++
+ if ( p->ident = malloc(4+strlen(prefix)+S(q->text)) )
+ sprintf(p->ident, "%s=\"%.*s\"", prefix, S(q->text)-(i+2),
+ T(q->text)+(i+1) );
+@@ -861,7 +861,7 @@
+ {
+ ParagraphRoot d = { 0, 0 };
+ Paragraph *p;
+- Line *q = top->text, *text = 0, *labels;
++ Line *q = top->text, *text = 0, *labels;
+ int z, para;
+
+ while (( labels = q )) {
+@@ -874,8 +874,8 @@
+
+ if (( para = (text != q->next) ))
+ ___mkd_freeLineRange(q, text);
+-
+- q->next = 0;
++
++ q->next = 0;
+ if ( kind == 1 /* discount dl */ )
+ for ( q = labels; q; q = q->next ) {
+ CLIP(q->text, 0, 1);
+@@ -901,7 +901,7 @@
+ anchor.next = text;
+ ___mkd_freeLineRange(&anchor,q);
+ text = q;
+-
++
+ }
+
+ if ( kind == 2 && is_extra_dd(q) )
+@@ -922,7 +922,7 @@
+ int para = 0, z;
+
+ while (( text = q )) {
+-
++
+ p = Pp(&d, text, LISTITEM);
+ text = listitem(p, clip, f->flags, 0);
+
+@@ -973,7 +973,7 @@
+ Line *np = p->next;
+
+ Footnote *foot = &EXPAND(*f->footnotes);
+-
++
+ CREATE(foot->tag);
+ CREATE(foot->link);
+ CREATE(foot->title);
+@@ -1201,14 +1201,14 @@
+ while ( ptr ) {
+ if ( iscode(ptr) ) {
+ p = Pp(&d, ptr, CODE);
+-
++
+ if ( f->flags & MKD_1_COMPAT) {
+ /* HORRIBLE STANDARDS KLUDGE: the first line of every block
+ * has trailing whitespace trimmed off.
+ */
+ ___mkd_tidy(&p->text->text);
+ }
+-
++
+ ptr = codeblock(p);
+ }
+ #if WITH_FENCED_CODE
+@@ -1276,10 +1276,10 @@
+ mkd_compile(Document *doc, DWORD flags)
+ {
+ if ( !doc )
+- return 0;
++ return 0;
+
+ if ( doc->compiled )
+- return 1;
++ return 1;
+
+ doc->compiled = 1;
+ memset(doc->ctx, 0, sizeof(MMIOT) );
+@@ -1300,3 +1300,15 @@
+ return 1;
+ }
+
++char *mkd_compile_document(const char *s, DWORD flags)
++{
++ char *ptr = NULL;
++ Document *doc;
++
++ doc = mkd_string(s, strlen(s), flags);
++ mkd_compile(doc, 0);
++ mkd_document(doc, &ptr);
++ ptr = mkd_cleanup_return_buffer(doc, NULL);
++
++ return ptr;
++}
+diff -ru discount-2.1.3/markdown.h discount/markdown.h
+--- discount-2.1.3/markdown.h 2012-01-16 13:08:52.000000000 -0800
++++ discount/markdown.h 2012-07-16 19:52:01.611155862 -0700
+@@ -19,7 +19,7 @@
+ } Footnote;
+
+ /* each input line is read into a Line, which contains the line,
+- * the offset of the first non-space character [this assumes
++ * the offset of the first non-space character [this assumes
+ * that all tabs will be expanded to spaces!], and a pointer to
+ * the next line.
+ */
+@@ -144,6 +144,7 @@
+ Callback_data cb; /* callback functions & private data */
+ } Document;
+
++extern char *mkd_compile_document(const char *, DWORD);
+
+ extern int mkd_firstnonblank(Line *);
+ extern int mkd_compile(Document *, DWORD);
+@@ -155,6 +156,7 @@
+ extern int mkd_xml(char *, int , char **);
+ extern int mkd_generatexml(char *, int, FILE *);
+ extern void mkd_cleanup(Document *);
++extern char *mkd_cleanup_return_buffer(Document *, long*);
+ extern int mkd_line(char *, int, char **, DWORD);
+ extern int mkd_generateline(char *, int, FILE*, DWORD);
+ #define mkd_text mkd_generateline
+@@ -180,6 +182,7 @@
+ extern void ___mkd_freefootnotes(MMIOT *);
+ extern void ___mkd_initmmiot(MMIOT *, void *);
+ extern void ___mkd_freemmiot(MMIOT *, void *);
++extern char* ___mkd_freemmiot_return_buffer(MMIOT *, void *, long*);
+ extern void ___mkd_freeLineRange(Line *, Line *);
+ extern void ___mkd_xml(char *, int, FILE *);
+ extern void ___mkd_reparse(char *, int, int, MMIOT*);
+Only in discount-2.1.3/: mkd2html.1
+Only in discount-2.1.3/: mkd2html.c
+Only in discount-2.1.3/: mkd-callbacks.3
+Only in discount-2.1.3/: mkd-extensions.7
+Only in discount-2.1.3/: mkd-functions.3
+diff -ru discount-2.1.3/mkdio.c discount/mkdio.c
+--- discount-2.1.3/mkdio.c 2012-01-16 13:08:52.000000000 -0800
++++ discount/mkdio.c 2012-07-16 18:03:40.619224702 -0700
+@@ -24,11 +24,11 @@
+ Document *ret = calloc(sizeof(Document), 1);
+
+ if ( ret ) {
+- if (( ret->ctx = calloc(sizeof(MMIOT), 1) )) {
+- ret->magic = VALID_DOCUMENT;
+- return ret;
+- }
+- free(ret);
++ if (( ret->ctx = calloc(sizeof(MMIOT), 1) )) {
++ ret->magic = VALID_DOCUMENT;
++ return ret;
++ }
++ free(ret);
+ }
+ return 0;
+ }
+@@ -50,22 +50,22 @@
+ ATTACH(a->content, p);
+
+ while ( size-- ) {
+- if ( (c = *str++) == '\t' ) {
+- /* expand tabs into ->tabstop spaces. We use ->tabstop
+- * because the ENTIRE FREAKING COMPUTER WORLD uses editors
+- * that don't do ^T/^D, but instead use tabs for indentation,
+- * and, of course, set their tabs down to 4 spaces
+- */
+- do {
+- EXPAND(p->text) = ' ';
+- } while ( ++xp % a->tabstop );
+- }
+- else if ( c >= ' ' ) {
+- if ( c == '|' )
+- p->flags |= PIPECHAR;
+- EXPAND(p->text) = c;
+- ++xp;
+- }
++ if ( (c = *str++) == '\t' ) {
++ /* expand tabs into ->tabstop spaces. We use ->tabstop
++ * because the ENTIRE FREAKING COMPUTER WORLD uses editors
++ * that don't do ^T/^D, but instead use tabs for indentation,
++ * and, of course, set their tabs down to 4 spaces
++ */
++ do {
++ EXPAND(p->text) = ' ';
++ } while ( ++xp % a->tabstop );
++ }
++ else if ( c >= ' ' ) {
++ if ( c == '|' )
++ p->flags |= PIPECHAR;
++ EXPAND(p->text) = c;
++ ++xp;
++ }
+ }
+ EXPAND(p->text) = 0;
+ S(p->text)--;
+@@ -102,37 +102,37 @@
+ CREATE(line);
+
+ while ( (c = (*getc)(ctx)) != EOF ) {
+- if ( c == '\n' ) {
+- if ( pandoc != EOF && pandoc < 3 ) {
+- if ( S(line) && (T(line)[0] == '%') )
+- pandoc++;
+- else
+- pandoc = EOF;
+- }
+- queue(a, &line);
+- S(line) = 0;
+- }
+- else if ( isprint(c) || isspace(c) || (c & 0x80) )
+- EXPAND(line) = c;
++ if ( c == '\n' ) {
++ if ( pandoc != EOF && pandoc < 3 ) {
++ if ( S(line) && (T(line)[0] == '%') )
++ pandoc++;
++ else
++ pandoc = EOF;
++ }
++ queue(a, &line);
++ S(line) = 0;
++ }
++ else if ( isprint(c) || isspace(c) || (c & 0x80) )
++ EXPAND(line) = c;
+ }
+
+ if ( S(line) )
+- queue(a, &line);
++ queue(a, &line);
+
+ DELETE(line);
+
+ if ( (pandoc == 3) && !(flags & (MKD_NOHEADER|MKD_STRICT)) ) {
+- /* the first three lines started with %, so we have a header.
+- * clip the first three lines out of content and hang them
+- * off header.
+- */
+- Line *headers = T(a->content);
++ /* the first three lines started with %, so we have a header.
++ * clip the first three lines out of content and hang them
++ * off header.
++ */
++ Line *headers = T(a->content);
++
++ a->title = headers; header_dle(a->title);
++ a->author= headers->next; header_dle(a->author);
++ a->date = headers->next->next; header_dle(a->date);
+
+- a->title = headers; header_dle(a->title);
+- a->author= headers->next; header_dle(a->author);
+- a->date = headers->next->next; header_dle(a->date);
+-
+- T(a->content) = headers->next->next->next;
++ T(a->content) = headers->next->next->next;
+ }
+
+ return a;
+@@ -227,7 +227,7 @@
+ char *line;
+
+ size = mkd_line(s, len, &line, IS_LABEL);
+-
++
+ if ( labelformat && (size>0) && !isalpha(line[0]) )
+ (*outchar)('L',out);
+ for ( i=0; i < size ; i++ ) {
+@@ -241,7 +241,7 @@
+ else
+ (*outchar)(c,out);
+ }
+-
++
+ if (line)
+ free(line);
+ }
+@@ -266,13 +266,13 @@
+ {
+ MMIOT f;
+ int len;
+-
++
+ mkd_parse_line(bfr, size, &f, flags);
+
+ if ( len = S(f.out) ) {
+ /* kludge alert; we know that T(f.out) is malloced memory,
+ * so we can just steal it away. This is awful -- there
+- * should be an opaque method that transparently moves
++ * should be an opaque method that transparently moves
+ * the pointer out of the embedded Cstring.
+ */
+ EXPAND(f.out) = 0;
+Only in discount/: mkdio.h
+Only in discount-2.1.3/: mkdio.h.in
+Only in discount-2.1.3/: mkd-line.3
+Only in discount-2.1.3/: mktags.c
+Only in discount-2.1.3/: pgm_options.c
+Only in discount-2.1.3/: pgm_options.h
+Only in discount-2.1.3/: Plan9
+Only in discount-2.1.3/: README
+diff -ru discount-2.1.3/resource.c discount/resource.c
+--- discount-2.1.3/resource.c 2012-01-16 13:08:52.000000000 -0800
++++ discount/resource.c 2012-07-16 18:40:37.947201222 -0700
+@@ -107,14 +107,33 @@
+ void
+ ___mkd_freemmiot(MMIOT *f, void *footnotes)
+ {
+- if ( f ) {
+- DELETE(f->in);
+- DELETE(f->out);
+- DELETE(f->Q);
+- if ( f->footnotes != footnotes )
+- ___mkd_freefootnotes(f);
+- memset(f, 0, sizeof *f);
+- }
++ if ( f ) {
++ DELETE(f->in);
++ DELETE(f->out);
++ DELETE(f->Q);
++ if ( f->footnotes != footnotes )
++ ___mkd_freefootnotes(f);
++ memset(f, 0, sizeof *f);
++ }
++}
++
++/* free the contents of a MMIOT except the output buffer, but leave the
++ * object alone. return the output buffer to the caller. */
++char *
++___mkd_freemmiot_return_buffer(MMIOT *f, void *footnotes, long *out_len)
++{
++ char *ptr = NULL;
++ if ( f ) {
++ DELETE(f->in);
++ ptr = T(f->out); /* save pointer */
++ if (out_len)
++ *out_len = S(f->out); /* save length */
++ DELETE(f->Q);
++ if ( f->footnotes != footnotes )
++ ___mkd_freefootnotes(f);
++ memset(f, 0, sizeof *f);
++ }
++ return ptr;
+ }
+
+
+@@ -140,18 +159,41 @@
+ void
+ mkd_cleanup(Document *doc)
+ {
+- if ( doc && (doc->magic == VALID_DOCUMENT) ) {
+- if ( doc->ctx ) {
+- ___mkd_freemmiot(doc->ctx, 0);
+- free(doc->ctx);
+- }
+-
+- if ( doc->code) ___mkd_freeParagraph(doc->code);
+- if ( doc->title) ___mkd_freeLine(doc->title);
+- if ( doc->author) ___mkd_freeLine(doc->author);
+- if ( doc->date) ___mkd_freeLine(doc->date);
+- if ( T(doc->content) ) ___mkd_freeLines(T(doc->content));
+- memset(doc, 0, sizeof doc[0]);
+- free(doc);
++ if ( doc && (doc->magic == VALID_DOCUMENT) ) {
++ if ( doc->ctx ) {
++ ___mkd_freemmiot(doc->ctx, 0);
++ free(doc->ctx);
++ }
++
++ if ( doc->code) ___mkd_freeParagraph(doc->code);
++ if ( doc->title) ___mkd_freeLine(doc->title);
++ if ( doc->author) ___mkd_freeLine(doc->author);
++ if ( doc->date) ___mkd_freeLine(doc->date);
++ if ( T(doc->content) ) ___mkd_freeLines(T(doc->content));
++ memset(doc, 0, sizeof doc[0]);
++ free(doc);
++ }
++}
++
++char *
++mkd_cleanup_return_buffer(Document *doc, long *out_len)
++{
++ char *ptr = NULL;
++
++ if ( doc && (doc->magic == VALID_DOCUMENT) ) {
++ if ( doc->ctx ) {
++ ptr = ___mkd_freemmiot_return_buffer(doc->ctx, 0, out_len);
++ free(doc->ctx);
+ }
++
++ if ( doc->code) ___mkd_freeParagraph(doc->code);
++ if ( doc->title) ___mkd_freeLine(doc->title);
++ if ( doc->author) ___mkd_freeLine(doc->author);
++ if ( doc->date) ___mkd_freeLine(doc->date);
++ if ( T(doc->content) ) ___mkd_freeLines(T(doc->content));
++ memset(doc, 0, sizeof doc[0]);
++ free(doc);
++ }
++
++ return ptr;
+ }
+Only in discount-2.1.3/: tests
+Only in discount-2.1.3/: theme.1
+Only in discount-2.1.3/: theme.c
+Only in discount-2.1.3/: tools
+Only in discount-2.1.3/: VERSION
+Only in discount/: version.c
+Only in discount-2.1.3/: version.c.in
Modified: markdown/discount/docheader.c
49 files changed, 49 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,49 @@
+/*
+ * docheader -- get values from the document header
+ *
+ * Copyright (C) 2007 David L Parsons.
+ * The redistribution terms are provided in the COPYRIGHT file that must
+ * be distributed with this source code.
+ */
+#include "config.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+#include "cstring.h"
+#include "markdown.h"
+#include "amalloc.h"
+
+static char *
+onlyifset(Line *l)
+{
+ char *ret = T(l->text) + l->dle;
+
+ return ret[0] ? ret : 0;
+}
+
+char *
+mkd_doc_title(Document *doc)
+{
+ if ( doc && doc->title )
+ return onlyifset(doc->title);
+ return 0;
+}
+
+
+char *
+mkd_doc_author(Document *doc)
+{
+ if ( doc && doc->author )
+ return onlyifset(doc->author);
+ return 0;
+}
+
+
+char *
+mkd_doc_date(Document *doc)
+{
+ if ( doc && doc->date )
+ return onlyifset(doc->date);
+ return 0;
+}
Modified: markdown/discount/dumptree.c
152 files changed, 152 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,152 @@
+/* markdown: a C implementation of John Gruber's Markdown markup language.
+ *
+ * Copyright (C) 2007 David L Parsons.
+ * The redistribution terms are provided in the COPYRIGHT file that must
+ * be distributed with this source code.
+ */
+#include <stdio.h>
+#include "markdown.h"
+#include "cstring.h"
+#include "amalloc.h"
+
+struct frame {
+ int indent;
+ char c;
+};
+
+typedef STRING(struct frame) Stack;
+
+static char *
+Pptype(int typ)
+{
+ switch (typ) {
+ case WHITESPACE: return "whitespace";
+ case CODE : return "code";
+ case QUOTE : return "quote";
+ case MARKUP : return "markup";
+ case HTML : return "html";
+ case DL : return "dl";
+ case UL : return "ul";
+ case OL : return "ol";
+ case LISTITEM : return "item";
+ case HDR : return "header";
+ case HR : return "hr";
+ case TABLE : return "table";
+ case SOURCE : return "source";
+ case STYLE : return "style";
+ default : return "mystery node!";
+ }
+}
+
+static void
+pushpfx(int indent, char c, Stack *sp)
+{
+ struct frame *q = &EXPAND(*sp);
+
+ q->indent = indent;
+ q->c = c;
+}
+
+
+static void
+poppfx(Stack *sp)
+{
+ S(*sp)--;
+}
+
+
+static void
+changepfx(Stack *sp, char c)
+{
+ char ch;
+
+ if ( !S(*sp) ) return;
+
+ ch = T(*sp)[S(*sp)-1].c;
+
+ if ( ch == '+' || ch == '|' )
+ T(*sp)[S(*sp)-1].c = c;
+}
+
+
+static void
+printpfx(Stack *sp, FILE *f)
+{
+ int i;
+ char c;
+
+ if ( !S(*sp) ) return;
+
+ c = T(*sp)[S(*sp)-1].c;
+
+ if ( c == '+' || c == '-' ) {
+ fprintf(f, "--%c", c);
+ T(*sp)[S(*sp)-1].c = (c == '-') ? ' ' : '|';
+ }
+ else
+ for ( i=0; i < S(*sp); i++ ) {
+ if ( i )
+ fprintf(f, " ");
+ fprintf(f, "%*s%c", T(*sp)[i].indent + 2, " ", T(*sp)[i].c);
+ if ( T(*sp)[i].c == '`' )
+ T(*sp)[i].c = ' ';
+ }
+ fprintf(f, "--");
+}
+
+
+static void
+dumptree(Paragraph *pp, Stack *sp, FILE *f)
+{
+ int count;
+ Line *p;
+ int d;
+ static char *Begin[] = { 0, "P", "center" };
+
+ while ( pp ) {
+ if ( !pp->next )
+ changepfx(sp, '`');
+ printpfx(sp, f);
+
+ d = fprintf(f, "[%s", Pptype(pp->typ));
+ if ( pp->ident )
+ d += fprintf(f, " %s", pp->ident);
+ if ( pp->align > 1 )
+ d += fprintf(f, ", <%s>", Begin[pp->align]);
+
+ for (count=0, p=pp->text; p; ++count, (p = p->next) )
+ ;
+
+ if ( count )
+ d += fprintf(f, ", %d line%s", count, (count==1)?"":"s");
+
+ d += fprintf(f, "]");
+
+ if ( pp->down ) {
+ pushpfx(d, pp->down->next ? '+' : '-', sp);
+ dumptree(pp->down, sp, f);
+ poppfx(sp);
+ }
+ else fputc('\n', f);
+ pp = pp->next;
+ }
+}
+
+
+int
+mkd_dump(Document *doc, FILE *out, int flags, char *title)
+{
+ Stack stack;
+
+ if (mkd_compile(doc, flags) ) {
+
+ CREATE(stack);
+ pushpfx(fprintf(out, "%s", title), doc->code->next ? '+' : '-', &stack);
+ dumptree(doc->code, &stack, out);
+ DELETE(stack);
+
+ mkd_cleanup(doc);
+ return 0;
+ }
+ return -1;
+}
Modified: markdown/discount/emmatch.c
188 files changed, 188 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,188 @@
+/* markdown: a C implementation of John Gruber's Markdown markup language.
+ *
+ * Copyright (C) 2010 David L Parsons.
+ * The redistribution terms are provided in the COPYRIGHT file that must
+ * be distributed with this source code.
+ */
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <time.h>
+#include <ctype.h>
+
+#include "config.h"
+
+#include "cstring.h"
+#include "markdown.h"
+#include "amalloc.h"
+
+
+/* emmatch: the emphasis mangler that's run after a block
+ * of html has been generated.
+ *
+ * It should create MarkdownTest_1.0 (and _1.0.3)
+ * compatable emphasis for non-pathological cases
+ * and it should fail in a standards-compliant way
+ * when someone attempts to feed it junk.
+ *
+ * Emmatching is done after the input has been
+ * processed into a STRING (f->Q) of text and
+ * emphasis blocks. After ___mkd_emblock() finishes,
+ * it truncates f->Q and leaves the rendered paragraph
+ * if f->out.
+ */
+
+
+/* empair() -- find the NEAREST matching emphasis token (or
+ * subtoken of a 3+ long emphasis token.
+ */
+static int
+empair(MMIOT *f, int first, int last, int match)
+{
+
+ int i;
+ block *begin, *p;
+
+ begin = &T(f->Q)[first];
+
+ for (i=first+1; i <= last; i++) {
+ p = &T(f->Q)[i];
+
+ if ( (p->b_type != bTEXT) && (p->b_count <= 0) )
+ continue; /* break? */
+
+ if ( p->b_type == begin->b_type ) {
+ if ( p->b_count == match ) /* exact match */
+ return i;
+
+ if ( p->b_count > 2 ) /* fuzzy match */
+ return i;
+ }
+ }
+ return 0;
+} /* empair */
+
+
+/* emfill() -- if an emphasis token has leftover stars or underscores,
+ * convert them back into character and append them to b_text.
+ */
+static void
+emfill(block *p)
+{
+ int j;
+
+ if ( p->b_type == bTEXT )
+ return;
+
+ for (j=0; j < p->b_count; j++)
+ EXPAND(p->b_text) = p->b_char;
+ p->b_count = 0;
+} /* emfill */
+
+
+static void
+emclose(MMIOT *f, int first, int last)
+{
+ int j;
+
+ for (j=first+1; j<last-1; j++)
+ emfill(&T(f->Q)[j]);
+}
+
+
+static struct emtags {
+ char open[10];
+ char close[10];
+ int size;
+} emtags[] = { { "<em>" , "</em>", 5 }, { "<strong>", "</strong>", 9 } };
+
+
+static void emblock(MMIOT*,int,int);
+
+
+/* emmatch() -- match emphasis for a single emphasis token.
+ */
+static void
+emmatch(MMIOT *f, int first, int last)
+{
+ block *start = &T(f->Q)[first];
+ int e, e2, match;
+
+ switch (start->b_count) {
+ case 2: if ( e = empair(f,first,last,match=2) )
+ break;
+ case 1: e = empair(f,first,last,match=1);
+ break;
+ case 0: return;
+ default:
+ e = empair(f,first,last,1);
+ e2= empair(f,first,last,2);
+
+ if ( e2 >= e ) {
+ e = e2;
+ match = 2;
+ }
+ else
+ match = 1;
+ break;
+ }
+
+ if ( e ) {
+ /* if we found emphasis to match, match it, recursively call
+ * emblock to match emphasis inside the new html block, add
+ * the emphasis markers for the block, then (tail) recursively
+ * call ourself to match any remaining emphasis on this token.
+ */
+ block *end = &T(f->Q)[e];
+
+ end->b_count -= match;
+ start->b_count -= match;
+
+ emblock(f, first, e);
+
+ MDPREFIX(start->b_text, emtags[match-1].open, emtags[match-1].size-1);
+ SUFFIX(end->b_post, emtags[match-1].close, emtags[match-1].size);
+
+ emmatch(f, first, last);
+ }
+} /* emmatch */
+
+
+/* emblock() -- walk a blocklist, attempting to match emphasis
+ */
+static void
+emblock(MMIOT *f, int first, int last)
+{
+ int i;
+
+ for ( i = first; i <= last; i++ )
+ if ( T(f->Q)[i].b_type != bTEXT )
+ emmatch(f, i, last);
+ emclose(f, first, last);
+} /* emblock */
+
+
+/* ___mkd_emblock() -- emblock a string of blocks, then concatenate the
+ * resulting text onto f->out.
+ */
+void
+___mkd_emblock(MMIOT *f)
+{
+ int i;
+ block *p;
+
+ emblock(f, 0, S(f->Q)-1);
+
+ for (i=0; i < S(f->Q); i++) {
+ p = &T(f->Q)[i];
+ emfill(p);
+
+ if ( S(p->b_post) ) { SUFFIX(f->out, T(p->b_post), S(p->b_post));
+ DELETE(p->b_post); }
+ if ( S(p->b_text) ) { SUFFIX(f->out, T(p->b_text), S(p->b_text));
+ DELETE(p->b_text); }
+ }
+
+ S(f->Q) = 0;
+} /* ___mkd_emblock */
Modified: markdown/discount/flags.c
84 files changed, 84 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,84 @@
+#include <stdio.h>
+#include "markdown.h"
+
+struct flagnames {
+ DWORD flag;
+ char *name;
+};
+
+static struct flagnames flagnames[] = {
+ { MKD_NOLINKS, "!LINKS" },
+ { MKD_NOIMAGE, "!IMAGE" },
+ { MKD_NOPANTS, "!PANTS" },
+ { MKD_NOHTML, "!HTML" },
+ { MKD_STRICT, "STRICT" },
+ { MKD_TAGTEXT, "TAGTEXT" },
+ { MKD_NO_EXT, "!EXT" },
+ { MKD_CDATA, "CDATA" },
+ { MKD_NOSUPERSCRIPT, "!SUPERSCRIPT" },
+ { MKD_NORELAXED, "!RELAXED" },
+ { MKD_NOTABLES, "!TABLES" },
+ { MKD_NOSTRIKETHROUGH,"!STRIKETHROUGH" },
+ { MKD_TOC, "TOC" },
+ { MKD_1_COMPAT, "MKD_1_COMPAT" },
+ { MKD_AUTOLINK, "AUTOLINK" },
+ { MKD_SAFELINK, "SAFELINK" },
+ { MKD_NOHEADER, "!HEADER" },
+ { MKD_TABSTOP, "TABSTOP" },
+ { MKD_NODIVQUOTE, "!DIVQUOTE" },
+ { MKD_NOALPHALIST, "!ALPHALIST" },
+ { MKD_NODLIST, "!DLIST" },
+ { MKD_EXTRA_FOOTNOTE, "FOOTNOTE" },
+};
+#define NR(x) (sizeof x/sizeof x[0])
+
+
+void
+mkd_flags_are(FILE *f, DWORD flags, int htmlplease)
+{
+ int i;
+ int not, set, even=1;
+ char *name;
+
+ if ( htmlplease )
+ fprintf(f, "<table class=\"mkd_flags_are\">\n");
+ for (i=0; i < NR(flagnames); i++) {
+ set = flags & flagnames[i].flag;
+ name = flagnames[i].name;
+ if ( not = (*name == '!') ) {
+ ++name;
+ set = !set;
+ }
+
+ if ( htmlplease ) {
+ if ( even ) fprintf(f, " <tr>");
+ fprintf(f, "<td>");
+ }
+ else
+ fputc(' ', f);
+
+ if ( !set )
+ fprintf(f, htmlplease ? "<s>" : "!");
+
+ fprintf(f, "%s", name);
+
+ if ( htmlplease ) {
+ if ( !set )
+ fprintf(f, "</s>");
+ fprintf(f, "</td>");
+ if ( !even ) fprintf(f, "</tr>\n");
+ }
+ even = !even;
+ }
+ if ( htmlplease ) {
+ if ( even ) fprintf(f, "</tr>\n");
+ fprintf(f, "</table>\n");
+ }
+}
+
+void
+mkd_mmiot_flags(FILE *f, MMIOT *m, int htmlplease)
+{
+ if ( m )
+ mkd_flags_are(f, m->flags, htmlplease);
+}
Modified: markdown/discount/generate.c
1763 files changed, 1763 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,1763 @@
+/* markdown: a C implementation of John Gruber's Markdown markup language.
+ *
+ * Copyright (C) 2007 David L Parsons.
+ * The redistribution terms are provided in the COPYRIGHT file that must
+ * be distributed with this source code.
+ */
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <time.h>
+#include <ctype.h>
+
+#include "config.h"
+
+#include "cstring.h"
+#include "markdown.h"
+#include "amalloc.h"
+
+typedef int (*stfu)(const void*,const void*);
+typedef void (*spanhandler)(MMIOT*,int);
+
+/* forward declarations */
+static void text(MMIOT *f);
+static Paragraph *display(Paragraph*, MMIOT*);
+
+/* externals from markdown.c */
+int __mkd_footsort(Footnote *, Footnote *);
+
+/*
+ * push text into the generator input buffer
+ */
+static void
+push(char *bfr, int size, MMIOT *f)
+{
+ while ( size-- > 0 )
+ EXPAND(f->in) = *bfr++;
+}
+
+
+/* look <i> characters ahead of the cursor.
+ */
+static inline int
+peek(MMIOT *f, int i)
+{
+
+ i += (f->isp-1);
+
+ return (i >= 0) && (i < S(f->in)) ? T(f->in)[i] : EOF;
+}
+
+
+/* pull a byte from the input buffer
+ */
+static inline int
+pull(MMIOT *f)
+{
+ return ( f->isp < S(f->in) ) ? T(f->in)[f->isp++] : EOF;
+}
+
+
+/* return a pointer to the current position in the input buffer.
+ */
+static inline char*
+cursor(MMIOT *f)
+{
+ return T(f->in) + f->isp;
+}
+
+
+static inline int
+isthisspace(MMIOT *f, int i)
+{
+ int c = peek(f, i);
+
+ return isspace(c) || (c == EOF);
+}
+
+
+static inline int
+isthisalnum(MMIOT *f, int i)
+{
+ int c = peek(f, i);
+
+ return (c != EOF) && isalnum(c);
+}
+
+
+static inline int
+isthisnonword(MMIOT *f, int i)
+{
+ return isthisspace(f, i) || ispunct(peek(f,i));
+}
+
+
+/* return/set the current cursor position
+ */
+#define mmiotseek(f,x) (f->isp = x)
+#define mmiottell(f) (f->isp)
+
+
+/* move n characters forward ( or -n characters backward) in the input buffer.
+ */
+static void
+shift(MMIOT *f, int i)
+{
+ if (f->isp + i >= 0 )
+ f->isp += i;
+}
+
+
+/* Qchar()
+ */
+static void
+Qchar(int c, MMIOT *f)
+{
+ block *cur;
+
+ if ( S(f->Q) == 0 ) {
+ cur = &EXPAND(f->Q);
+ memset(cur, 0, sizeof *cur);
+ cur->b_type = bTEXT;
+ }
+ else
+ cur = &T(f->Q)[S(f->Q)-1];
+
+ EXPAND(cur->b_text) = c;
+
+}
+
+
+/* Qstring()
+ */
+static void
+Qstring(char *s, MMIOT *f)
+{
+ while (*s)
+ Qchar(*s++, f);
+}
+
+
+/* Qwrite()
+ */
+static void
+Qwrite(char *s, int size, MMIOT *f)
+{
+ while (size-- > 0)
+ Qchar(*s++, f);
+}
+
+
+/* Qprintf()
+ */
+static void
+Qprintf(MMIOT *f, char *fmt, ...)
+{
+ char bfr[80];
+ va_list ptr;
+
+ va_start(ptr,fmt);
+ vsnprintf(bfr, sizeof bfr, fmt, ptr);
+ va_end(ptr);
+ Qstring(bfr, f);
+}
+
+
+/* Qem()
+ */
+static void
+Qem(MMIOT *f, char c, int count)
+{
+ block *p = &EXPAND(f->Q);
+
+ memset(p, 0, sizeof *p);
+ p->b_type = (c == '*') ? bSTAR : bUNDER;
+ p->b_char = c;
+ p->b_count = count;
+
+ memset(&EXPAND(f->Q), 0, sizeof(block));
+}
+
+
+/* generate html from a markup fragment
+ */
+void
+___mkd_reparse(char *bfr, int size, int flags, MMIOT *f)
+{
+ MMIOT sub;
+
+ ___mkd_initmmiot(&sub, f->footnotes);
+
+ sub.flags = f->flags | flags;
+ sub.cb = f->cb;
+ sub.ref_prefix = f->ref_prefix;
+
+ push(bfr, size, &sub);
+ EXPAND(sub.in) = 0;
+ S(sub.in)--;
+
+ text(&sub);
+ ___mkd_emblock(&sub);
+
+ Qwrite(T(sub.out), S(sub.out), f);
+
+ ___mkd_freemmiot(&sub, f->footnotes);
+}
+
+
+/*
+ * write out a url, escaping problematic characters
+ */
+static void
+puturl(char *s, int size, MMIOT *f, int display)
+{
+ unsigned char c;
+
+ while ( size-- > 0 ) {
+ c = *s++;
+
+ if ( c == '\\' && size-- > 0 ) {
+ c = *s++;
+
+ if ( !( ispunct(c) || isspace(c) ) )
+ Qchar('\\', f);
+ }
+
+ if ( c == '&' )
+ Qstring("&", f);
+ else if ( c == '<' )
+ Qstring("<", f);
+ else if ( c == '"' )
+ Qstring("%22", f);
+ else if ( isalnum(c) || ispunct(c) || (display && isspace(c)) )
+ Qchar(c, f);
+ else if ( c == 003 ) /* untokenize ^C */
+ Qstring(" ", f);
+ else
+ Qprintf(f, "%%%02X", c);
+ }
+}
+
+
+/* advance forward until the next character is not whitespace
+ */
+static int
+eatspace(MMIOT *f)
+{
+ int c;
+
+ for ( ; ((c=peek(f, 1)) != EOF) && isspace(c); pull(f) )
+ ;
+ return c;
+}
+
+
+/* (match (a (nested (parenthetical (string.)))))
+ */
+static int
+parenthetical(int in, int out, MMIOT *f)
+{
+ int size, indent, c;
+
+ for ( indent=1,size=0; indent; size++ ) {
+ if ( (c = pull(f)) == EOF )
+ return EOF;
+ else if ( (c == '\\') && (peek(f,1) == out || peek(f,1) == in) ) {
+ ++size;
+ pull(f);
+ }
+ else if ( c == in )
+ ++indent;
+ else if ( c == out )
+ --indent;
+ }
+ return size ? (size-1) : 0;
+}
+
+
+/* extract a []-delimited label from the input stream.
+ */
+static int
+linkylabel(MMIOT *f, Cstring *res)
+{
+ char *ptr = cursor(f);
+ int size;
+
+ if ( (size = parenthetical('[',']',f)) != EOF ) {
+ T(*res) = ptr;
+ S(*res) = size;
+ return 1;
+ }
+ return 0;
+}
+
+
+/* see if the quote-prefixed linky segment is actually a title.
+ */
+static int
+linkytitle(MMIOT *f, char quote, Footnote *ref)
+{
+ int whence = mmiottell(f);
+ char *title = cursor(f);
+ char *e;
+ register int c;
+
+ while ( (c = pull(f)) != EOF ) {
+ e = cursor(f);
+ if ( c == quote ) {
+ if ( (c = eatspace(f)) == ')' ) {
+ T(ref->title) = 1+title;
+ S(ref->title) = (e-title)-2;
+ return 1;
+ }
+ }
+ }
+ mmiotseek(f, whence);
+ return 0;
+}
+
+
+/* extract a =HHHxWWW size from the input stream
+ */
+static int
+linkysize(MMIOT *f, Footnote *ref)
+{
+ int height=0, width=0;
+ int whence = mmiottell(f);
+ int c;
+
+ if ( isspace(peek(f,0)) ) {
+ pull(f); /* eat '=' */
+
+ for ( c = pull(f); isdigit(c); c = pull(f))
+ width = (width * 10) + (c - '0');
+
+ if ( c == 'x' ) {
+ for ( c = pull(f); isdigit(c); c = pull(f))
+ height = (height*10) + (c - '0');
+
+ if ( isspace(c) )
+ c = eatspace(f);
+
+ if ( (c == ')') || ((c == '\'' || c == '"') && linkytitle(f, c, ref)) ) {
+ ref->height = height;
+ ref->width = width;
+ return 1;
+ }
+ }
+ }
+ mmiotseek(f, whence);
+ return 0;
+}
+
+
+/* extract a <...>-encased url from the input stream.
+ * (markdown 1.0.2b8 compatibility; older versions
+ * of markdown treated the < and > as syntactic
+ * sugar that didn't have to be there. 1.0.2b8
+ * requires a closing >, and then falls into the
+ * title or closing )
+ */
+static int
+linkybroket(MMIOT *f, int image, Footnote *p)
+{
+ int c;
+ int good = 0;
+
+ T(p->link) = cursor(f);
+ for ( S(p->link)=0; (c = pull(f)) != '>'; ++S(p->link) ) {
+ /* pull in all input until a '>' is found, or die trying.
+ */
+ if ( c == EOF )
+ return 0;
+ else if ( (c == '\\') && ispunct(peek(f,2)) ) {
+ ++S(p->link);
+ pull(f);
+ }
+ }
+
+ c = eatspace(f);
+
+ /* next nonspace needs to be a title, a size, or )
+ */
+ if ( ( c == '\'' || c == '"' ) && linkytitle(f,c,p) )
+ good=1;
+ else if ( image && (c == '=') && linkysize(f,p) )
+ good=1;
+ else
+ good=( c == ')' );
+
+ if ( good ) {
+ if ( peek(f, 1) == ')' )
+ pull(f);
+
+ ___mkd_tidy(&p->link);
+ }
+
+ return good;
+} /* linkybroket */
+
+
+/* extract a (-prefixed url from the input stream.
+ * the label is either of the format `<link>`, where I
+ * extract until I find a >, or it is of the format
+ * `text`, where I extract until I reach a ')', a quote,
+ * or (if image) a '='
+ */
+static int
+linkyurl(MMIOT *f, int image, Footnote *p)
+{
+ int c;
+ int mayneedtotrim=0;
+
+ if ( (c = eatspace(f)) == EOF )
+ return 0;
+
+ if ( c == '<' ) {
+ pull(f);
+ if ( !(f->flags & MKD_1_COMPAT) )
+ return linkybroket(f,image,p);
+ mayneedtotrim=1;
+ }
+
+ T(p->link) = cursor(f);
+ for ( S(p->link)=0; (c = peek(f,1)) != ')'; ++S(p->link) ) {
+ if ( c == EOF )
+ return 0;
+ else if ( (c == '"' || c == '\'') && linkytitle(f, c, p) )
+ break;
+ else if ( image && (c == '=') && linkysize(f, p) )
+ break;
+ else if ( (c == '\\') && ispunct(peek(f,2)) ) {
+ ++S(p->link);
+ pull(f);
+ }
+ pull(f);
+ }
+ if ( peek(f, 1) == ')' )
+ pull(f);
+
+ ___mkd_tidy(&p->link);
+
+ if ( mayneedtotrim && (T(p->link)[S(p->link)-1] == '>') )
+ --S(p->link);
+
+ return 1;
+}
+
+
+
+/* prefixes for <automatic links>
+ */
+static struct _protocol {
+ char *name;
+ int nlen;
+} protocol[] = {
+#define _aprotocol(x) { x, (sizeof x)-1 }
+ _aprotocol( "https:" ),
+ _aprotocol( "http:" ),
+ _aprotocol( "news:" ),
+ _aprotocol( "ftp:" ),
+#undef _aprotocol
+};
+#define NRPROTOCOLS (sizeof protocol / sizeof protocol[0])
+
+
+static int
+isautoprefix(char *text, int size)
+{
+ int i;
+ struct _protocol *p;
+
+ for (i=0, p=protocol; i < NRPROTOCOLS; i++, p++)
+ if ( (size >= p->nlen) && strncasecmp(text, p->name, p->nlen) == 0 )
+ return 1;
+ return 0;
+}
+
+
+/*
+ * all the tag types that linkylinky can produce are
+ * defined by this structure.
+ */
+typedef struct linkytype {
+ char *pat;
+ int szpat;
+ char *link_pfx; /* tag prefix and link pointer (eg: "<a href="\"" */
+ char *link_sfx; /* link suffix (eg: "\"" */
+ int WxH; /* this tag allows width x height arguments */
+ char *text_pfx; /* text prefix (eg: ">" */
+ char *text_sfx; /* text suffix (eg: "</a>" */
+ int flags; /* reparse flags */
+ int kind; /* tag is url or something else? */
+#define IS_URL 0x01
+} linkytype;
+
+static linkytype imaget = { 0, 0, "<img src=\"", "\"",
+ 1, " alt=\"", "\" />", MKD_NOIMAGE|MKD_TAGTEXT, IS_URL };
+static linkytype linkt = { 0, 0, "<a href=\"", "\"",
+ 0, ">", "</a>", MKD_NOLINKS, IS_URL };
+
+/*
+ * pseudo-protocols for [][];
+ *
+ * id: generates <a id="link">tag</a>
+ * class: generates <span class="link">tag</span>
+ * raw: just dump the link without any processing
+ */
+static linkytype specials[] = {
+ { "id:", 3, "<span id=\"", "\"", 0, ">", "</span>", 0, 0 },
+ { "raw:", 4, 0, 0, 0, 0, 0, MKD_NOHTML, 0 },
+ { "lang:", 5, "<span lang=\"", "\"", 0, ">", "</span>", 0, 0 },
+ { "abbr:", 5, "<abbr title=\"", "\"", 0, ">", "</abbr>", 0, 0 },
+ { "class:", 6, "<span class=\"", "\"", 0, ">", "</span>", 0, 0 },
+} ;
+
+#define NR(x) (sizeof x / sizeof x[0])
+
+/* see if t contains one of our pseudo-protocols.
+ */
+static linkytype *
+pseudo(Cstring t)
+{
+ int i;
+ linkytype *r;
+
+ for ( i=0, r=specials; i < NR(specials); i++,r++ ) {
+ if ( (S(t) > r->szpat) && (strncasecmp(T(t), r->pat, r->szpat) == 0) )
+ return r;
+ }
+ return 0;
+}
+
+
+/* print out the start of an `img' or `a' tag, applying callbacks as needed.
+ */
+static void
+printlinkyref(MMIOT *f, linkytype *tag, char *link, int size)
+{
+ char *edit;
+
+ if ( f->flags & IS_LABEL )
+ return;
+
+ Qstring(tag->link_pfx, f);
+
+ if ( tag->kind & IS_URL ) {
+ if ( f->cb && f->cb->e_url && (edit = (*f->cb->e_url)(link, size, f->cb->e_data)) ) {
+ puturl(edit, strlen(edit), f, 0);
+ if ( f->cb->e_free ) (*f->cb->e_free)(edit, f->cb->e_data);
+ }
+ else
+ puturl(link + tag->szpat, size - tag->szpat, f, 0);
+ }
+ else
+ ___mkd_reparse(link + tag->szpat, size - tag->szpat, MKD_TAGTEXT, f);
+
+ Qstring(tag->link_sfx, f);
+
+ if ( f->cb && f->cb->e_flags && (edit = (*f->cb->e_flags)(link, size, f->cb->e_data)) ) {
+ Qchar(' ', f);
+ Qstring(edit, f);
+ if ( f->cb->e_free ) (*f->cb->e_free)(edit, f->cb->e_data);
+ }
+} /* printlinkyref */
+
+
+/* helper function for php markdown extra footnotes; allow the user to
+ * define a prefix tag instead of just `fn`
+ */
+static char *
+p_or_nothing(p)
+MMIOT *p;
+{
+ return p->ref_prefix ? p->ref_prefix : "fn";
+}
+
+
+/* php markdown extra/daring fireball style print footnotes
+ */
+static int
+extra_linky(MMIOT *f, Cstring text, Footnote *ref)
+{
+ if ( ref->flags & REFERENCED )
+ return 0;
+
+ if ( f->flags & IS_LABEL )
+ ___mkd_reparse(T(text), S(text), linkt.flags, f);
+ else {
+ ref->flags |= REFERENCED;
+ ref->refnumber = ++ f->reference;
+ Qprintf(f, "<sup id=\"%sref:%d\"><a href=\"#%s:%d\" rel=\"footnote\">%d</a></sup>",
+ p_or_nothing(f), ref->refnumber,
+ p_or_nothing(f), ref->refnumber, ref->refnumber);
+ }
+ return 1;
+} /* extra_linky */
+
+
+/* print out a linky (or fail if it's Not Allowed)
+ */
+static int
+linkyformat(MMIOT *f, Cstring text, int image, Footnote *ref)
+{
+ linkytype *tag;
+
+ if ( image || (ref == 0) )
+ tag = &imaget;
+ else if ( tag = pseudo(ref->link) ) {
+ if ( f->flags & (MKD_NO_EXT|MKD_SAFELINK) )
+ return 0;
+ }
+ else if ( (f->flags & MKD_SAFELINK) && T(ref->link)
+ && (T(ref->link)[0] != '/')
+ && !isautoprefix(T(ref->link), S(ref->link)) )
+ /* if MKD_SAFELINK, only accept links that are local or
+ * a well-known protocol
+ */
+ return 0;
+ else
+ tag = &linkt;
+
+ if ( f->flags & tag->flags )
+ return 0;
+
+ if ( f->flags & IS_LABEL )
+ ___mkd_reparse(T(text), S(text), tag->flags, f);
+ else if ( tag->link_pfx ) {
+ printlinkyref(f, tag, T(ref->link), S(ref->link));
+
+ if ( tag->WxH ) {
+ if ( ref->height ) Qprintf(f," height=\"%d\"", ref->height);
+ if ( ref->width ) Qprintf(f, " width=\"%d\"", ref->width);
+ }
+
+ if ( S(ref->title) ) {
+ Qstring(" title=\"", f);
+ ___mkd_reparse(T(ref->title), S(ref->title), MKD_TAGTEXT, f);
+ Qchar('"', f);
+ }
+
+ Qstring(tag->text_pfx, f);
+ ___mkd_reparse(T(text), S(text), tag->flags, f);
+ Qstring(tag->text_sfx, f);
+ }
+ else
+ Qwrite(T(ref->link) + tag->szpat, S(ref->link) - tag->szpat, f);
+
+ return 1;
+} /* linkyformat */
+
+
+/*
+ * process embedded links and images
+ */
+static int
+linkylinky(int image, MMIOT *f)
+{
+ int start = mmiottell(f);
+ Cstring name;
+ Footnote key, *ref;
+
+ int status = 0;
+ int extra_footnote = 0;
+
+ CREATE(name);
+ memset(&key, 0, sizeof key);
+
+ if ( linkylabel(f, &name) ) {
+ if ( peek(f,1) == '(' ) {
+ pull(f);
+ if ( linkyurl(f, image, &key) )
+ status = linkyformat(f, name, image, &key);
+ }
+ else {
+ int goodlink, implicit_mark = mmiottell(f);
+
+ if ( isspace(peek(f,1)) )
+ pull(f);
+
+ if ( peek(f,1) == '[' ) {
+ pull(f); /* consume leading '[' */
+ goodlink = linkylabel(f, &key.tag);
+ }
+ else {
+ /* new markdown implicit name syntax doesn't
+ * require a second []
+ */
+ mmiotseek(f, implicit_mark);
+ goodlink = !(f->flags & MKD_1_COMPAT);
+
+ if ( (f->flags & MKD_EXTRA_FOOTNOTE) && (!image) && S(name) && T(name)[0] == '^' )
+ extra_footnote = 1;
+ }
+
+ if ( goodlink ) {
+ if ( !S(key.tag) ) {
+ DELETE(key.tag);
+ T(key.tag) = T(name);
+ S(key.tag) = S(name);
+ }
+
+ if ( ref = bsearch(&key, T(*f->footnotes), S(*f->footnotes),
+ sizeof key, (stfu)__mkd_footsort) ) {
+ if ( extra_footnote )
+ status = extra_linky(f,name,ref);
+ else
+ status = linkyformat(f, name, image, ref);
+ }
+ else if ( f->flags & IS_LABEL )
+ status = linkyformat(f, name, image, 0);
+ }
+ }
+ }
+
+ DELETE(name);
+ ___mkd_freefootnote(&key);
+
+ if ( status == 0 )
+ mmiotseek(f, start);
+
+ return status;
+}
+
+
+/* write a character to output, doing text escapes ( & -> &,
+ * > -> > < -> < )
+ */
+static void
+cputc(int c, MMIOT *f)
+{
+ switch (c) {
+ case '&': Qstring("&", f); break;
+ case '>': Qstring(">", f); break;
+ case '<': Qstring("<", f); break;
+ default : Qchar(c, f); break;
+ }
+}
+
+
+/*
+ * convert an email address to a string of nonsense
+ */
+static void
+mangle(char *s, int len, MMIOT *f)
+{
+ while ( len-- > 0 ) {
+ Qstring("&#", f);
+ Qprintf(f, COINTOSS() ? "x%02x;" : "%02d;", *((unsigned char*)(s++)) );
+ }
+}
+
+
+/* nrticks() -- count up a row of tick marks
+ */
+static int
+nrticks(int offset, int tickchar, MMIOT *f)
+{
+ int tick = 0;
+
+ while ( peek(f, offset+tick) == tickchar ) tick++;
+
+ return tick;
+} /* nrticks */
+
+
+/* matchticks() -- match a certain # of ticks, and if that fails
+ * match the largest subset of those ticks.
+ *
+ * if a subset was matched, return the # of ticks
+ * that were matched.
+ */
+static int
+matchticks(MMIOT *f, int tickchar, int ticks, int *endticks)
+{
+ int size, count, c;
+ int subsize=0, subtick=0;
+
+ *endticks = ticks;
+ for (size = 0; (c=peek(f,size+ticks)) != EOF; size ++) {
+ if ( (c == tickchar) && ( count = nrticks(size+ticks,tickchar,f)) ) {
+ if ( count == ticks )
+ return size;
+ else if ( count ) {
+ if ( (count > subtick) && (count < ticks) ) {
+ subsize = size;
+ subtick = count;
+ }
+ size += count;
+ }
+ }
+ }
+ if ( subsize ) {
+ *endticks = subtick;
+ return subsize;
+ }
+ return 0;
+} /* matchticks */
+
+
+/* code() -- write a string out as code. The only characters that have
+ * special meaning in a code block are * `<' and `&' , which
+ * are /always/ expanded to < and &
+ */
+static void
+code(MMIOT *f, char *s, int length)
+{
+ int i,c;
+
+ for ( i=0; i < length; i++ )
+ if ( (c = s[i]) == 003) /* ^C: expand back to 2 spaces */
+ Qstring(" ", f);
+ else
+ cputc(c, f);
+} /* code */
+
+
+/* delspan() -- write out a chunk of text, blocking with <del>...</del>
+ */
+static void
+delspan(MMIOT *f, int size)
+{
+ Qstring("<del>", f);
+ ___mkd_reparse(cursor(f)-1, size, 0, f);
+ Qstring("</del>", f);
+}
+
+
+/* codespan() -- write out a chunk of text as code, trimming one
+ * space off the front and/or back as appropriate.
+ */
+static void
+codespan(MMIOT *f, int size)
+{
+ int i=0;
+
+ if ( size > 1 && peek(f, size-1) == ' ' ) --size;
+ if ( peek(f,i) == ' ' ) ++i, --size;
+
+ Qstring("<code>", f);
+ code(f, cursor(f)+(i-1), size);
+ Qstring("</code>", f);
+} /* codespan */
+
+
+/* before letting a tag through, validate against
+ * MKD_NOLINKS and MKD_NOIMAGE
+ */
+static int
+forbidden_tag(MMIOT *f)
+{
+ int c = toupper(peek(f, 1));
+
+ if ( f->flags & MKD_NOHTML )
+ return 1;
+
+ if ( c == 'A' && (f->flags & MKD_NOLINKS) && !isthisalnum(f,2) )
+ return 1;
+ if ( c == 'I' && (f->flags & MKD_NOIMAGE)
+ && strncasecmp(cursor(f)+1, "MG", 2) == 0
+ && !isthisalnum(f,4) )
+ return 1;
+ return 0;
+}
+
+
+/* Check a string to see if it looks like a mail address
+ * "looks like a mail address" means alphanumeric + some
+ * s@@ Diff output truncated at 100000 characters. @@
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
Branch: refs/heads/master
Author: Frank Lanitz <frank(a)frank.uvena.de>
Committer: Frank Lanitz <frank(a)frank.uvena.de>
Date: Mon, 06 Aug 2012 16:42:51
Commit: 0ce743e05172e343cf3bfe254ea0507f38fcd60d
https://github.com/geany/geany-plugins/commit/0ce743e05172e343cf3bfe254ea05…
Log Message:
-----------
Merge branch 'b4n/wip/commander'
Add new plugin "Commander"
Modified Paths:
--------------
Makefile.am
build/commander.m4
commander/AUTHORS
commander/COPYING
commander/ChangeLog
commander/Makefile.am
commander/NEWS
commander/README
commander/src/Makefile.am
commander/src/commander-plugin.c
commander/wscript_build
commander/wscript_configure
configure.ac
Modified: Makefile.am
4 files changed, 4 insertions(+), 0 deletions(-)
===================================================================
@@ -10,6 +10,10 @@ if ENABLE_CODENAV
SUBDIRS += codenav
endif
+if ENABLE_COMMANDER
+SUBDIRS += commander
+endif
+
if ENABLE_DEBUGGER
SUBDIRS += debugger
endif
Modified: build/commander.m4
15 files changed, 15 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,15 @@
+AC_DEFUN([GP_CHECK_COMMANDER],
+[
+ GP_ARG_DISABLE([Commander], [auto])
+
+ GP_CHECK_PLUGIN_DEPS([Commander], [COMMANDER],
+ [gtk+-2.0 >= 2.16
+ glib-2.0 >= 2.4])
+
+ GP_STATUS_PLUGIN_ADD([Commander], [$enable_commander])
+
+ AC_CONFIG_FILES([
+ commander/Makefile
+ commander/src/Makefile
+ ])
+])
Modified: commander/AUTHORS
1 files changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1 @@
+Colomban Wendling <ban(at)herbesfolles(dot)org>
Modified: commander/COPYING
674 files changed, 674 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
Modified: commander/ChangeLog
0 files changed, 0 insertions(+), 0 deletions(-)
===================================================================
No diff available, check online
Modified: commander/Makefile.am
4 files changed, 4 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,4 @@
+include $(top_srcdir)/build/vars.auxfiles.mk
+
+SUBDIRS = src
+plugin = commander
Modified: commander/NEWS
0 files changed, 0 insertions(+), 0 deletions(-)
===================================================================
No diff available, check online
Modified: commander/README
45 files changed, 45 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,45 @@
+=========
+Commander
+=========
+
+.. contents::
+
+
+About
+=====
+
+Commander is a plugin for Geany that provides a command panel for rapid access
+to any action.
+
+
+Usage
+=====
+
+After having enabled the plugin inside Geany through Geany's plugin manager,
+you'll need to setup a keybinding for triggering the Commander panel. Go to
+the preferences, and under the Keybindings tab set the *Commander -> Show Panel*
+keybinding
+
+
+License
+=======
+
+This plugin is distributed under the terms of the GNU General Public License
+as published by the Free Software Foundation, either version 2 of the
+License, or (at your option) any later version. You should have received a copy
+of the GNU General Public License along with this plugin. If not, see
+<http://www.gnu.org/licenses/>.
+
+
+Contact
+=======
+
+You can email me at <ban(at)herbesfolles(dot)org>, and I may also be on the
+#geany channel on FreeNode, under the `b4n` nickname.
+
+
+Bug reports and feature requests
+--------------------------------
+
+To report a bug or ask for a new feature, please use the Geany-Plugins tracker
+on SourceForge: http://sourceforge.net/tracker/?group_id=222729
Modified: commander/src/Makefile.am
17 files changed, 17 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,17 @@
+include $(top_srcdir)/build/vars.build.mk
+plugin = commander
+
+geanyplugins_LTLIBRARIES = commander.la
+
+
+commander_la_SOURCES = commander-plugin.c
+commander_la_CPPFLAGS = $(AM_CPPFLAGS) \
+ -DPLUGIN=\"$(plugin)\" \
+ -DG_LOG_DOMAIN=\"Commander\"
+commander_la_CFLAGS = $(AM_CFLAGS) \
+ $(COMMANDER_CFLAGS)
+commander_la_LIBADD = $(COMMONLIBS) \
+ $(COMMANDER_LIBS)
+
+
+include $(top_srcdir)/build/cppcheck.mk
Modified: commander/src/commander-plugin.c
701 files changed, 701 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,701 @@
+/*
+ *
+ * Copyright (C) 2012 Colomban Wendling <ban(a)herbesfolles.org>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "config.h"
+
+#include <string.h>
+#include <glib.h>
+#include <glib/gi18n-lib.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+
+#include <geanyplugin.h>
+
+
+GeanyPlugin *geany_plugin;
+GeanyData *geany_data;
+GeanyFunctions *geany_functions;
+
+PLUGIN_VERSION_CHECK(205)
+
+PLUGIN_SET_TRANSLATABLE_INFO (
+ LOCALEDIR, GETTEXT_PACKAGE,
+ _("Commander"),
+ _("Provides a command panel for quick access to actions, files and more"),
+ VERSION,
+ "Colomban Wendling <ban(a)herbesfolles.org>"
+)
+
+
+/* GTK compatibility functions/macros */
+
+#if ! GTK_CHECK_VERSION (2, 18, 0)
+# define gtk_widget_get_visible(w) \
+ (GTK_WIDGET_VISIBLE (w))
+# define gtk_widget_set_can_focus(w) \
+ (GTK_WIDGET_SET_FLAGS ((w), GTK_CAN_FOCUS))
+#endif
+
+#if ! GTK_CHECK_VERSION (2, 21, 8)
+# define GDK_KEY_Down GDK_Down
+# define GDK_KEY_Escape GDK_Escape
+# define GDK_KEY_ISO_Enter GDK_ISO_Enter
+# define GDK_KEY_KP_Enter GDK_KP_Enter
+# define GDK_KEY_Page_Down GDK_Page_Down
+# define GDK_KEY_Page_Up GDK_Page_Up
+# define GDK_KEY_Return GDK_Return
+# define GDK_KEY_Tab GDK_Tab
+# define GDK_KEY_Up GDK_Up
+#endif
+
+
+/* Plugin */
+
+enum {
+ KB_SHOW_PANEL,
+ KB_COUNT
+};
+
+struct {
+ GtkWidget *panel;
+ GtkWidget *entry;
+ GtkWidget *view;
+ GtkListStore *store;
+ GtkTreeModel *sort;
+
+ GtkTreePath *last_path;
+} plugin_data = {
+ NULL, NULL, NULL,
+ NULL, NULL,
+ NULL
+};
+
+typedef enum {
+ COL_TYPE_MENU_ITEM = 1 << 0,
+ COL_TYPE_FILE = 1 << 1,
+ COL_TYPE_ANY = 0xffff
+} ColType;
+
+enum {
+ COL_LABEL,
+ COL_PATH,
+ COL_TYPE,
+ COL_WIDGET,
+ COL_DOCUMENT,
+ COL_COUNT
+};
+
+
+#define SEPARATORS " -_/\\\"'"
+#define IS_SEPARATOR(c) (strchr (SEPARATORS, (c)))
+#define next_separator(p) (strpbrk (p, SEPARATORS))
+
+/* TODO: be more tolerant regarding unmatched character in the needle.
+ * Right now, we implicitly accept unmatched characters at the end of the
+ * needle but absolutely not at the start. e.g. "xpy" won't match "python" at
+ * all, though "pyx" will. */
+static inline gint
+get_score (const gchar *needle,
+ const gchar *haystack)
+{
+ if (needle == NULL || haystack == NULL ||
+ *needle == '\0' || *haystack == '\0') {
+ return 0;
+ }
+
+ if (IS_SEPARATOR (*haystack)) {
+ return get_score (needle, haystack + 1);
+ }
+
+ if (IS_SEPARATOR (*needle)) {
+ return get_score (needle + 1, next_separator (haystack));
+ }
+
+ if (*needle == *haystack) {
+ gint a = get_score (needle + 1, haystack + 1) + 1;
+ gint b = get_score (needle, next_separator (haystack));
+
+ return MAX (a, b);
+ } else {
+ return get_score (needle, next_separator (haystack));
+ }
+}
+
+static gint
+key_score (const gchar *key_,
+ const gchar *text_)
+{
+ gchar *text = g_utf8_casefold (text_, -1);
+ gchar *key = g_utf8_casefold (key_, -1);
+ gint score;
+
+ score = get_score (key, text);
+
+ g_free (text);
+ g_free (key);
+
+ return score;
+}
+
+static const gchar *
+get_key (gint *type_)
+{
+ gint type = COL_TYPE_ANY;
+ const gchar *key = gtk_entry_get_text (GTK_ENTRY (plugin_data.entry));
+
+ if (g_str_has_prefix (key, "f:")) {
+ key += 2;
+ type = COL_TYPE_FILE;
+ } else if (g_str_has_prefix (key, "c:")) {
+ key += 2;
+ type = COL_TYPE_MENU_ITEM;
+ }
+
+ if (type_) {
+ *type_ = type;
+ }
+
+ return key;
+}
+
+static void
+tree_view_set_cursor_from_iter (GtkTreeView *view,
+ GtkTreeIter *iter)
+{
+ GtkTreePath *path;
+
+ path = gtk_tree_model_get_path (gtk_tree_view_get_model (view), iter);
+ gtk_tree_view_set_cursor (view, path, NULL, FALSE);
+ gtk_tree_path_free (path);
+}
+
+static void
+tree_view_move_focus (GtkTreeView *view,
+ GtkMovementStep step,
+ gint amount)
+{
+ GtkTreeIter iter;
+ GtkTreePath *path;
+ GtkTreeModel *model = gtk_tree_view_get_model (view);
+ gboolean valid = FALSE;
+
+ gtk_tree_view_get_cursor (view, &path, NULL);
+ if (! path) {
+ valid = gtk_tree_model_get_iter_first (model, &iter);
+ } else {
+ switch (step) {
+ case GTK_MOVEMENT_BUFFER_ENDS:
+ valid = gtk_tree_model_get_iter_first (model, &iter);
+ if (valid && amount > 0) {
+ GtkTreeIter prev;
+
+ do {
+ prev = iter;
+ } while (gtk_tree_model_iter_next (model, &iter));
+ iter = prev;
+ }
+ break;
+
+ case GTK_MOVEMENT_PAGES:
+ /* FIXME: move by page */
+ case GTK_MOVEMENT_DISPLAY_LINES:
+ gtk_tree_model_get_iter (model, &iter, path);
+ if (amount > 0) {
+ while ((valid = gtk_tree_model_iter_next (model, &iter)) &&
+ --amount > 0)
+ ;
+ } else if (amount < 0) {
+ while ((valid = gtk_tree_path_prev (path)) && --amount > 0)
+ ;
+
+ if (valid) {
+ gtk_tree_model_get_iter (model, &iter, path);
+ }
+ }
+ break;
+
+ default:
+ g_assert_not_reached ();
+ }
+ gtk_tree_path_free (path);
+ }
+
+ if (valid) {
+ tree_view_set_cursor_from_iter (view, &iter);
+ } else {
+ gtk_widget_error_bell (GTK_WIDGET (view));
+ }
+}
+
+static void
+tree_view_activate_focused_row (GtkTreeView *view)
+{
+ GtkTreePath *path;
+ GtkTreeViewColumn *column;
+
+ gtk_tree_view_get_cursor (view, &path, &column);
+ if (path) {
+ gtk_tree_view_row_activated (view, path, column);
+ gtk_tree_path_free (path);
+ }
+}
+
+static void
+store_populate_menu_items (GtkListStore *store,
+ GtkMenuShell *menu,
+ const gchar *parent_path)
+{
+ GList *children;
+ GList *node;
+
+ children = gtk_container_get_children (GTK_CONTAINER (menu));
+ for (node = children; node; node = node->next) {
+ if (GTK_IS_SEPARATOR_MENU_ITEM (node->data) ||
+ ! gtk_widget_get_visible (node->data)) {
+ /* skip that */
+ } else if (GTK_IS_MENU_ITEM (node->data)) {
+ GtkWidget *submenu;
+ gchar *path;
+ gchar *item_label;
+ gboolean use_underline;
+ GtkStockItem item;
+
+ if (GTK_IS_IMAGE_MENU_ITEM (node->data) &&
+ gtk_image_menu_item_get_use_stock (node->data) &&
+ gtk_stock_lookup (gtk_menu_item_get_label (node->data), &item)) {
+ item_label = g_strdup (item.label);
+ use_underline = TRUE;
+ } else {
+ item_label = g_strdup (gtk_menu_item_get_label (node->data));
+ use_underline = gtk_menu_item_get_use_underline (node->data);
+ }
+
+ /* remove underlines */
+ if (use_underline) {
+ gchar *p = item_label;
+ gsize len = strlen (p);
+
+ while ((p = strchr (p, '_')) != NULL) {
+ len -= (gsize) (p - item_label);
+
+ memmove (p, p + 1, len);
+ }
+ }
+
+ if (parent_path) {
+ path = g_strconcat (parent_path, " \342\206\222 " /* right arrow */,
+ item_label, NULL);
+ } else {
+ path = g_strdup (item_label);
+ }
+
+ submenu = gtk_menu_item_get_submenu (node->data);
+ if (submenu) {
+ /* go deeper in the menus... */
+ store_populate_menu_items (store, GTK_MENU_SHELL (submenu), path);
+ } else {
+ gchar *tmp;
+ gchar *tooltip;
+ gchar *label = g_markup_printf_escaped ("<big>%s</big>", item_label);
+
+ tooltip = gtk_widget_get_tooltip_markup (node->data);
+ if (tooltip) {
+ SETPTR (label, g_strconcat (label, "\n<small>", tooltip, "</small>", NULL));
+ g_free (tooltip);
+ }
+
+ tmp = g_markup_escape_text (path, -1);
+ SETPTR (label, g_strconcat (label, "\n<small><i>", tmp, "</i></small>", NULL));
+ g_free (tmp);
+
+ gtk_list_store_insert_with_values (store, NULL, -1,
+ COL_LABEL, label,
+ COL_PATH, path,
+ COL_TYPE, COL_TYPE_MENU_ITEM,
+ COL_WIDGET, node->data,
+ -1);
+
+ g_free (label);
+ }
+
+ g_free (item_label);
+ g_free (path);
+ } else {
+ g_warning ("Unknown widget type in the menu: %s",
+ G_OBJECT_TYPE_NAME (node->data));
+ }
+ }
+ g_list_free (children);
+}
+
+static GtkWidget *
+find_menubar (GtkContainer *container)
+{
+ GList *children;
+ GList *node;
+ GtkWidget *menubar = NULL;
+
+ children = gtk_container_get_children (container);
+ for (node = children; ! menubar && node; node = node->next) {
+ if (GTK_IS_MENU_BAR (node->data)) {
+ menubar = node->data;
+ } else if GTK_IS_CONTAINER (node->data) {
+ menubar = find_menubar (node->data);
+ }
+ }
+ g_list_free (children);
+
+ return menubar;
+}
+
+static void
+fill_store (GtkListStore *store)
+{
+ GtkWidget *menubar;
+ guint i;
+
+ /* menu items */
+ menubar = find_menubar (GTK_CONTAINER (geany_data->main_widgets->window));
+ store_populate_menu_items (store, GTK_MENU_SHELL (menubar), NULL);
+
+ /* open files */
+ foreach_document (i) {
+ gchar *basename = g_path_get_basename (DOC_FILENAME (documents[i]));
+ gchar *label = g_markup_printf_escaped ("<big>%s</big>\n"
+ "<small><i>%s</i></small>",
+ basename,
+ DOC_FILENAME (documents[i]));
+
+ gtk_list_store_insert_with_values (store, NULL, -1,
+ COL_LABEL, label,
+ COL_PATH, DOC_FILENAME (documents[i]),
+ COL_TYPE, COL_TYPE_FILE,
+ COL_DOCUMENT, documents[i],
+ -1);
+ g_free (basename);
+ g_free (label);
+ }
+}
+
+static gint
+sort_func (GtkTreeModel *model,
+ GtkTreeIter *a,
+ GtkTreeIter *b,
+ gpointer dummy)
+{
+ gint scorea;
+ gint scoreb;
+ gchar *patha;
+ gchar *pathb;
+ gint typea;
+ gint typeb;
+ gint type;
+ const gchar *key = get_key (&type);
+
+ gtk_tree_model_get (model, a, COL_PATH, &patha, COL_TYPE, &typea, -1);
+ gtk_tree_model_get (model, b, COL_PATH, &pathb, COL_TYPE, &typeb, -1);
+
+ scorea = key_score (key, patha);
+ scoreb = key_score (key, pathb);
+
+ if (! (typea & type)) {
+ scorea -= 0xf000;
+ }
+ if (! (typeb & type)) {
+ scoreb -= 0xf000;
+ }
+
+ g_free (patha);
+ g_free (pathb);
+
+ return scoreb - scorea;
+}
+
+static gboolean
+on_panel_key_press_event (GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer dummy)
+{
+ switch (event->keyval) {
+ case GDK_KEY_Escape:
+ gtk_widget_hide (widget);
+ return TRUE;
+
+ case GDK_KEY_Tab:
+ /* avoid leaving the entry */
+ return TRUE;
+
+ case GDK_KEY_Return:
+ case GDK_KEY_KP_Enter:
+ case GDK_KEY_ISO_Enter:
+ tree_view_activate_focused_row (GTK_TREE_VIEW (plugin_data.view));
+ return TRUE;
+
+ case GDK_KEY_Page_Up:
+ case GDK_KEY_Page_Down:
+ tree_view_move_focus (GTK_TREE_VIEW (plugin_data.view),
+ GTK_MOVEMENT_PAGES,
+ event->keyval == GDK_KEY_Page_Up ? -1 : 1);
+ return TRUE;
+
+ case GDK_KEY_Up:
+ case GDK_KEY_Down: {
+ tree_view_move_focus (GTK_TREE_VIEW (plugin_data.view),
+ GTK_MOVEMENT_DISPLAY_LINES,
+ event->keyval == GDK_KEY_Up ? -1 : 1);
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+static void
+on_entry_text_notify (GObject *object,
+ GParamSpec *pspec,
+ gpointer dummy)
+{
+ GtkTreeIter iter;
+ GtkTreeView *view = GTK_TREE_VIEW (plugin_data.view);
+ GtkTreeModel *model = gtk_tree_view_get_model (view);
+
+ /* we force re-sorting the whole model from how it was before, and the
+ * back to the new filter. this is somewhat hackish but since we don't
+ * know the original sorting order, and GtkTreeSortable don't have a
+ * resort() API anyway. */
+ gtk_tree_model_sort_reset_default_sort_func (GTK_TREE_MODEL_SORT (model));
+ gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (model),
+ sort_func, NULL, NULL);
+
+ if (gtk_tree_model_get_iter_first (model, &iter)) {
+ tree_view_set_cursor_from_iter (view, &iter);
+ }
+}
+
+static void
+on_entry_activate (GtkEntry *entry,
+ gpointer dummy)
+{
+ tree_view_activate_focused_row (GTK_TREE_VIEW (plugin_data.view));
+}
+
+static void
+on_panel_hide (GtkWidget *widget,
+ gpointer dummy)
+{
+ GtkTreeView *view = GTK_TREE_VIEW (plugin_data.view);
+
+ if (plugin_data.last_path) {
+ gtk_tree_path_free (plugin_data.last_path);
+ plugin_data.last_path = NULL;
+ }
+ gtk_tree_view_get_cursor (view, &plugin_data.last_path, NULL);
+
+ gtk_list_store_clear (plugin_data.store);
+}
+
+static void
+on_panel_show (GtkWidget *widget,
+ gpointer dummy)
+{
+ GtkTreePath *path;
+ GtkTreeView *view = GTK_TREE_VIEW (plugin_data.view);
+
+ fill_store (plugin_data.store);
+
+ gtk_widget_grab_focus (plugin_data.entry);
+
+ if (plugin_data.last_path) {
+ gtk_tree_view_set_cursor (view, plugin_data.last_path, NULL, FALSE);
+ gtk_tree_view_scroll_to_cell (view, plugin_data.last_path, NULL,
+ TRUE, 0.5, 0.5);
+ }
+ /* make sure the cursor is set (e.g. if plugin_data.last_path wasn't valid) */
+ gtk_tree_view_get_cursor (view, &path, NULL);
+ if (path) {
+ gtk_tree_path_free (path);
+ } else {
+ GtkTreeIter iter;
+
+ if (gtk_tree_model_get_iter_first (gtk_tree_view_get_model (view), &iter)) {
+ tree_view_set_cursor_from_iter (GTK_TREE_VIEW (plugin_data.view), &iter);
+ }
+ }
+}
+
+static void
+on_view_row_activated (GtkTreeView *view,
+ GtkTreePath *path,
+ GtkTreeViewColumn *column,
+ gpointer dummy)
+{
+ GtkTreeModel *model = gtk_tree_view_get_model (view);
+ GtkTreeIter iter;
+
+ if (gtk_tree_model_get_iter (model, &iter, path)) {
+ gint type;
+
+ gtk_tree_model_get (model, &iter, COL_TYPE, &type, -1);
+
+ switch (type) {
+ case COL_TYPE_FILE: {
+ GeanyDocument *doc;
+ gint page;
+
+ gtk_tree_model_get (model, &iter, COL_DOCUMENT, &doc, -1);
+ page = document_get_notebook_page (doc);
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (geany_data->main_widgets->notebook),
+ page);
+ break;
+ }
+
+ case COL_TYPE_MENU_ITEM: {
+ GtkMenuItem *item;
+
+ gtk_tree_model_get (model, &iter, COL_WIDGET, &item, -1);
+ gtk_menu_item_activate (item);
+ g_object_unref (item);
+
+ break;
+ }
+ }
+ gtk_widget_hide (plugin_data.panel);
+ }
+}
+
+static void
+create_panel (void)
+{
+ GtkWidget *frame;
+ GtkWidget *box;
+ GtkWidget *scroll;
+ GtkTreeViewColumn *col;
+ GtkCellRenderer *cell;
+
+ plugin_data.panel = g_object_new (GTK_TYPE_WINDOW,
+ "decorated", FALSE,
+ "default-width", 500,
+ "default-height", 200,
+ "transient-for", geany_data->main_widgets->window,
+ "window-position", GTK_WIN_POS_CENTER_ON_PARENT,
+ "type-hint", GDK_WINDOW_TYPE_HINT_DIALOG,
+ "skip-taskbar-hint", TRUE,
+ "skip-pager-hint", TRUE,
+ NULL);
+ g_signal_connect (plugin_data.panel, "focus-out-event",
+ G_CALLBACK (gtk_widget_hide), NULL);
+ g_signal_connect (plugin_data.panel, "show",
+ G_CALLBACK (on_panel_show), NULL);
+ g_signal_connect (plugin_data.panel, "hide",
+ G_CALLBACK (on_panel_hide), NULL);
+ g_signal_connect (plugin_data.panel, "key-press-event",
+ G_CALLBACK (on_panel_key_press_event), NULL);
+
+ frame = gtk_frame_new (NULL);
+ gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
+ gtk_container_add (GTK_CONTAINER (plugin_data.panel), frame);
+
+ box = gtk_vbox_new (FALSE, 0);
+ gtk_container_add (GTK_CONTAINER (frame), box);
+
+ plugin_data.entry = gtk_entry_new ();
+ g_signal_connect (plugin_data.entry, "notify::text",
+ G_CALLBACK (on_entry_text_notify), NULL);
+ g_signal_connect (plugin_data.entry, "activate",
+ G_CALLBACK (on_entry_activate), NULL);
+ gtk_box_pack_start (GTK_BOX (box), plugin_data.entry, FALSE, TRUE, 0);
+
+ plugin_data.store = gtk_list_store_new (COL_COUNT,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_INT,
+ GTK_TYPE_WIDGET,
+ G_TYPE_POINTER);
+
+ plugin_data.sort = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (plugin_data.store));
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (plugin_data.sort),
+ GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
+ GTK_SORT_ASCENDING);
+
+ scroll = g_object_new (GTK_TYPE_SCROLLED_WINDOW,
+ "hscrollbar-policy", GTK_POLICY_AUTOMATIC,
+ "vscrollbar-policy", GTK_POLICY_AUTOMATIC,
+ NULL);
+ gtk_box_pack_start (GTK_BOX (box), scroll, TRUE, TRUE, 0);
+
+ plugin_data.view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (plugin_data.sort));
+ gtk_widget_set_can_focus (plugin_data.view, FALSE);
+ gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (plugin_data.view), FALSE);
+ cell = gtk_cell_renderer_text_new ();
+ g_object_set (cell, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+ col = gtk_tree_view_column_new_with_attributes (NULL, cell,
+ "markup", COL_LABEL,
+ NULL);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (plugin_data.view), col);
+ g_signal_connect (plugin_data.view, "row-activated",
+ G_CALLBACK (on_view_row_activated), NULL);
+ gtk_container_add (GTK_CONTAINER (scroll), plugin_data.view);
+
+ gtk_widget_show_all (frame);
+}
+
+static void
+on_kb_show_panel (guint key_id)
+{
+ gtk_widget_show (plugin_data.panel);
+}
+
+static gboolean
+on_plugin_idle_init (gpointer dummy)
+{
+ create_panel ();
+
+ return FALSE;
+}
+
+void
+plugin_init (GeanyData *data)
+{
+ GeanyKeyGroup *group;
+
+ group = plugin_set_key_group (geany_plugin, "commander", KB_COUNT, NULL);
+ keybindings_set_item (group, KB_SHOW_PANEL, on_kb_show_panel,
+ 0, 0, "show_panel", _("Show Command Panel"), NULL);
+
+ /* delay for other plugins to have a chance to load before, so we will
+ * include their items */
+ plugin_idle_add (geany_plugin, on_plugin_idle_init, NULL);
+}
+
+void
+plugin_cleanup (void)
+{
+ if (plugin_data.panel) {
+ gtk_widget_destroy (plugin_data.panel);
+ }
+ if (plugin_data.last_path) {
+ gtk_tree_path_free (plugin_data.last_path);
+ }
+}
+
+void
+plugin_help (void)
+{
+ utils_open_browser (DOCDIR "/" PLUGIN "/README");
+}
Modified: commander/wscript_build
37 files changed, 37 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+#
+# WAF build script for geany-plugins - Web Helper
+#
+# Copyright 2010 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# $Id$
+
+
+from build.wafutils import build_plugin
+
+
+name = 'Commander'
+sources = [
+ 'src/commander-plugin.c']
+
+libraries = ['GTK', 'GLIB']
+features = ['glib2']
+
+task = build_plugin(bld, name,
+ sources=sources,
+ libraries=libraries,
+ features=features)
Modified: commander/wscript_configure
39 files changed, 39 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+#
+# WAF build script for geany-plugins - Web Helper
+#
+# Copyright 2010 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# $Id$
+
+from build.wafutils import check_cfg_cached
+
+
+conf.load ('glib2')
+
+packages = [
+ ('gtk+-2.0', '2.16', 'GTK'),
+ ('glib-2.0', '2.16', 'GLIB'),
+]
+
+for package_name, package_version, uselib_store in packages:
+ check_cfg_cached(conf,
+ package=package_name,
+ atleast_version=package_version,
+ uselib_store=uselib_store,
+ mandatory=True,
+ args='--cflags --libs')
Modified: configure.ac
1 files changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -26,6 +26,7 @@ GP_CHECK_CFLAGS
dnl plugin checks
GP_CHECK_ADDONS
GP_CHECK_CODENAV
+GP_CHECK_COMMANDER
GP_CHECK_DEBUGGER
GP_CHECK_DEVHELP
GP_CHECK_GEANYDOC
@@ Diff output truncated at 100000 characters. @@
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).