diff --git a/nagisa/COPYING b/nagisa/COPYING new file mode 100644 index 0000000..5b6e7c6 --- /dev/null +++ b/nagisa/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library 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. + + + Copyright (C) + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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. + + , 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 Library General +Public License instead of this License. diff --git a/nagisa/Doxyfile b/nagisa/Doxyfile new file mode 100644 index 0000000..97cd516 --- /dev/null +++ b/nagisa/Doxyfile @@ -0,0 +1,275 @@ +# Doxyfile 1.4.1-KDevelop + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = nagisa.kdevelop +PROJECT_NUMBER = 0.1 +OUTPUT_DIRECTORY = +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = /home/tamra/ANef/honoka/ +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = YES +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = /home/tamra/ANef/nagisa +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.C \ + *.CC \ + *.C++ \ + *.II \ + *.I++ \ + *.H \ + *.HH \ + *.H++ \ + *.CS \ + *.PHP \ + *.PHP3 \ + *.M \ + *.MM \ + *.C \ + *.H \ + *.tlh \ + *.diff \ + *.patch \ + *.moc \ + *.xpm \ + *.dox +RECURSIVE = yes +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = yes +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = nagisa.tag +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/nagisa/nagisa.pro b/nagisa/nagisa.pro new file mode 100644 index 0000000..20f1cba --- /dev/null +++ b/nagisa/nagisa.pro @@ -0,0 +1,6 @@ +SUBDIRS += src +TEMPLATE = subdirs +CONFIG += release \ + warn_on \ + qt \ + thread diff --git a/nagisa/src/jp109.xml b/nagisa/src/jp109.xml new file mode 100644 index 0000000..d142c78 --- /dev/null +++ b/nagisa/src/jp109.xml @@ -0,0 +1,462 @@ + + + ESC + + + F1 + + + F2 + + + F3 + + + F4 + + + F5 + + + F6 + + + F7 + + + F8 + + + F9 + + + F10 + + + F11 + + + F12 + + + 半角 +全角 + 漢字 + + + 1 + ! + + + + 2 + " + + + + 3 + # + + + + + 4 + $ + + + + + 5 + % + + + + + 6 + & + + + + + 7 + ' + + + + + 8 + ( + + + + + 9 + ) + + + + + 0 + ~ + + + + + - + = + + + + ^ + ~ + + + + \ + | + + + + Back +Space + + + Tab + + + q + Q + + + + w + W + + + + e + E + + + + + r + R + + + + t + T + + + + y + Y + + + + u + U + + + + i + I + + + + o + O + + + + p + P + + + + @ + ` + + + + [ + { + + + + + Enter + + + 英数 + + + a + A + + + + s + S + + + + d + D + + + + f + F + + + + g + G + + + + h + H + + + + j + J + + + + k + K + + + + l + L + + + + ; + + + + + + : + * + + + + ] + } + + + + + Shift + + + z + Z + + + + + x + X + + + + c + C + + + + v + V + + + + b + B + + + + n + N + + + + m + M + + + + , + < + + + + + . + > + + + + + / + ? + + + + + \ + _ + + + + Shift + + + Ctrl + + + Win + + + Alt + + + 無変換 + + + + + + 変換 + + + カタカナ +ひらがな + ローマ字 + + + Alt + + + Win + + + Menu + + + Ctrl + + + Prt +Scr + + + Scroll +Lock + + + Pause + + + Insert + + + Home + + + Page +Up + + + Delete + + + End + + + Page +Down + + + Up + + + Left + + + Down + + + Right + + + Num +Lock + + + / + + + * + + + - + + + 7 + + + 8 + + + 9 + + + + + + + 4 + + + 5 + + + 6 + + + 1 + + + 2 + + + 3 + + + Enter + + + 0 + + + . + + + + かな入力モード + + + Shiftロック + + + Ctrlロック + + + + diff --git a/nagisa/src/jpkeytable.h b/nagisa/src/jpkeytable.h new file mode 100644 index 0000000..b083c56 --- /dev/null +++ b/nagisa/src/jpkeytable.h @@ -0,0 +1,157 @@ +/* + UTF8 +*/ + +/*************************************************************************** + * Copyright (C) 2005 by Teppei Tamra * + * TAM(tam-t@par.odn.ne.jp) * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef JPKEYTABLE_H +#define JPKEYTABLE_H + +struct { + int x; + int y; + int w; + int h; + char color[64]; + char label[64]; + char event[64]; + char shift_label[64]; + char shift_event[64]; + char alt_label[64]; + char alt_event[64]; + char grp_label[64]; + char grp_event[64]; + char shift_grp_label[64]; + char shift_grp_event[64]; + char modifier[64]; +} jpkeytable[] = { + {0,0,2,2,"gray","ESC","escape","","","","","","","","",""}, + {4,0,2,2,"gray","F1","F1","","","","","","","","",""}, + {6,0,2,2,"gray","F2","F2","","","","","","","","",""}, + {8,0,2,2,"gray","F3","F3","","","","","","","","",""}, + {10,0,2,2,"gray","F4","F4","","","","","","","","",""}, + {13,0,2,2,"gray","F5","F5","","","","","","","","",""}, + {15,0,2,2,"gray","F6","F6","","","","","","","","",""}, + {17,0,2,2,"gray","F7","F7","","","","","","","","",""}, + {19,0,2,2,"gray","F8","F8","","","","","","","","",""}, + {22,0,2,2,"gray","F9","F9","","","","","","","","",""}, + {24,0,2,2,"gray","F10","F10","","","","","","","","",""}, + {26,0,2,2,"gray","F11","F11","","","","","","","","",""}, + {28,0,2,2,"gray","F12","F12","","","","","","","","",""}, + {0,4,2,2,"gray","半角\n全角","Zenkaku_Hankaku","","","漢字","Kanji","","","","","grp"}, + {2,4,2,2,"white","1","1","!","exclam","","","ぬ","","","",""}, + {4,4,2,2,"white","2","2","\"","backslash","","","ふ","","","",""}, + {6,4,2,2,"white","3","3","#","numbersign","","","あ","","","",""}, + {8,4,2,2,"white","4","4","$","dollar","","","う","","ぅ","",""}, + {10,4,2,2,"white","5","5","%","percent","","","え","","ぇ","",""}, + {12,4,2,2,"white","6","6","&","ampersand","","","お","","ぉ","",""}, + {14,4,2,2,"white","7","7","'","apostrophe","","","や","","ゃ","",""}, + {16,4,2,2,"white","8","8","(","parenleft","","","ゆ","","ゅ","",""}, + {18,4,2,2,"white","9","9",")","parenright","","","よ","","ょ","",""}, + {20,4,2,2,"white","0","0","~","asciitilde","","","わ","","を","",""}, + {22,4,2,2,"white","-","-","=","equal","","","ほ","","","",""}, + {24,4,2,2,"white","^","^","~","asciitilde","","","へ","","","",""}, + {26,4,2,2,"white","\\","\\","|","bar","","","ー","","","",""}, + {28,4,2,2,"gray","Back\nSpace","BackSpace","","","","","","","","",""}, + {0,6,3,2,"gray","Tab","Tab","","","","","","","","",""}, + {3,6,2,2,"white","q","q","Q","Q","","","た","","","",""}, + {5,6,2,2,"white","w","w","W","W","","","て","","","",""}, + {7,6,2,2,"white","e","e","E","E","","","い","","ぃ","",""}, + {9,6,2,2,"white","r","r","R","R","","","す","","","",""}, + {11,6,2,2,"white","t","t","T","T","","","か","","","",""}, + {13,6,2,2,"white","y","y","Y","Y","","","ん","","","",""}, + {15,6,2,2,"white","u","u","U","U","","","な","","","",""}, + {17,6,2,2,"white","i","i","I","I","","","に","","","",""}, + {19,6,2,2,"white","o","o","O","O","","","ら","","","",""}, + {21,6,2,2,"white","p","p","P","P","","","せ","","","",""}, + {23,6,2,2,"white","@","at","`","grave","","","゛","","","",""}, + {25,6,2,2,"white","[","bracketleft","{","braceleft","","","゜","","「","",""}, + {28,6,2,4,"gray","Enter","Return","","","","","","","","",""}, + {0,8,4,2,"gray","英数","Eisu_toggle","","","","","","","","",""}, + {4,8,2,2,"white","a","a","A","A","","","ち","","","",""}, + {6,8,2,2,"white","s","s","S","S","","","と","","","",""}, + {8,8,2,2,"white","d","d","D","D","","","し","","","",""}, + {10,8,2,2,"white","f","f","F","F","","","は","","","",""}, + {12,8,2,2,"white","g","g","G","G","","","き","","","",""}, + {14,8,2,2,"white","h","h","H","H","","","く","","","",""}, + {16,8,2,2,"white","j","j","J","J","","","ま","","","",""}, + {18,8,2,2,"white","k","k","K","K","","","の","","","",""}, + {20,8,2,2,"white","l","l","L","L","","","り","","","",""}, + {22,8,2,2,"white",";","semicolon","+","plus","","","れ","","","",""}, + {24,8,2,2,"white",":","colon","*","asterisk","","","け","","","",""}, + {26,8,2,2,"white","]","bracketright","}","braceright","","","む","","」","",""}, + {0,10,5,2,"gray","Shift","Shift_L","","","","","","","","","shift"}, + {5,10,2,2,"white","z","z","Z","Z","","","つ","","","",""}, + {7,10,2,2,"white","x","x","X","X","","","さ","","","",""}, + {9,10,2,2,"white","c","c","C","C","","","そ","","","",""}, + {11,10,2,2,"white","v","v","V","V","","","ひ","","","",""}, + {13,10,2,2,"white","b","b","B","B","","","こ","","","",""}, + {15,10,2,2,"white","n","n","N","N","","","み","","","",""}, + {17,10,2,2,"white","m","m","M","M","","","も","","","",""}, + {19,10,2,2,"white",",","comma","<","less","","","ね","","、","",""}, + {21,10,2,2,"white",".","period",">","greater","","","る","","。","",""}, + {23,10,2,2,"white","/","slash","?","question","","","め","","・","",""}, + {25,10,2,2,"white","\\","backslash","_","underscore","","","ろ","","","",""}, + {27,10,3,2,"gray","Shift","Shift_R","","","","","","","","","shift"}, + {0,12,3,2,"gray","Ctrl","Control_L","","","","","","","","","control"}, + {3,12,2,2,"gray","Win","","","","","","","","","",""}, + {5,12,3,2,"gray","Alt","Alt_L","","","","","","","","","alt"}, + {8,12,3,2,"gray","無変換","Muhenkan","","","","","","","","",""}, + {11,12,5,2,"gray"," ","space","","","","","","","","",""}, + {16,12,3,2,"gray","変換","Henkan","","","","","","","","",""}, + {19,12,2,2,"gray","カタカナ\nひらがな","Hiragana_Katakana","","","ローマ字","Romaji","","","","",""}, + {21,12,2,2,"gray","Alt","Alt_R","","","","","","","","","alt"}, + {23,12,2,2,"gray","Win","","","","","","","","","",""}, + {25,12,2,2,"gray","Menu","ISO_Level3_Shift","","","","","","","","",""}, + {27,12,3,2,"gray","Ctrl","Control_R","","","","","","","","","control"}, + {31,0,2,2,"gray","Prt\nScr","Print","","","","","","","","",""}, + {33,0,2,2,"gray","Scroll\nLock","Scroll_Lock","","","","","","","","",""}, + {35,0,2,2,"gray","Pause","Break","","","","","","","","",""}, + {31,4,2,2,"gray","Insert","Insert","","","","","","","","",""}, + {33,4,2,2,"gray","Home","Home","","","","","","","","",""}, + {35,4,2,2,"gray","Page\nUp","Page_Up","","","","","","","","",""}, + {31,6,2,2,"gray","Delete","Delete","","","","","","","","",""}, + {33,6,2,2,"gray","End","End","","","","","","","","",""}, + {35,6,2,2,"gray","Page\nDown","Page_Down","","","","","","","","",""}, + {33,10,2,2,"gray","Up","Up","","","","","","","","",""}, + {31,12,2,2,"gray","Left","Left","","","","","","","","",""}, + {33,12,2,2,"gray","Down","Down","","","","","","","","",""}, + {35,12,2,2,"gray","Right","Right","","","","","","","","",""}, + {38,4,2,2,"gray","Num\nLock","Num_Lock","","","","","","","","",""}, + {40,4,2,2,"gray","/","KP_Divide","","","","","","","","",""}, + {42,4,2,2,"gray","*","KP_Multiply","","","","","","","","",""}, + {44,4,2,2,"gray","-","KP_Subtract","","","","","","","","",""}, + {38,6,2,2,"white","7","KP_7","","","","","","","","",""}, + {40,6,2,2,"white","8","KP_8","","","","","","","","",""}, + {42,6,2,2,"white","9","KP_9","","","","","","","","",""}, + {44,6,2,4,"gray","+","KP_Add","","","","","","","","",""}, + {38,8,2,2,"white","4","KP_4","","","","","","","","",""}, + {40,8,2,2,"white","5","KP_5","","","","","","","","",""}, + {42,8,2,2,"white","6","KP_6","","","","","","","","",""}, + {38,10,2,2,"white","1","KP_1","","","","","","","","",""}, + {40,10,2,2,"white","2","KP_2","","","","","","","","",""}, + {42,10,2,2,"white","3","KP_3","","","","","","","","",""}, + {44,10,2,4,"gray","Enter","KP_Enter","","","","","","","","",""}, + {38,12,4,2,"white","0","KP_0","","","","","","","","",""}, + {42,12,2,2,"gray",".","KP_Decimal","","","","","","","","",""}, + {0,0,0,0,"","","","","","","","","","","",""} +}; + +#endif diff --git a/nagisa/src/keybutton.cpp b/nagisa/src/keybutton.cpp new file mode 100644 index 0000000..ee53a05 --- /dev/null +++ b/nagisa/src/keybutton.cpp @@ -0,0 +1,241 @@ +/*************************************************************************** + * Copyright (C) 2005 by Teppei Tamra * + * TAM(tam-t@par.odn.ne.jp) * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include "keybutton.h" +#include + +KeyGroup::KeyGroup() +{ +} + +KeyGroup::KeyGroup(const QString &_name,const QString &_label,const QString &_event,const QString &_modifier) +{ + setValue(_name,_label,_event,_modifier); +} + +KeyGroup::~KeyGroup() +{ +} + +void KeyGroup::setValue(const QString &_name,const QString &_label,const QString &_event,const QString &_modifier) +{ + QStringList l = QStringList::split("+",_name); + l.sort(); + name = l.join("+"); + label = _label; + event = _event; + modifier = _modifier; + +} + + +KeyButton::KeyButton(QWidget *parent, + unsigned int pos_x,unsigned int pos_y, + unsigned int width, unsigned int height,const QColor &keycolor, + bool toggled,const char *name) + : QPushButton(parent, name) +{ + x = pos_x; + y = pos_y; + w = width; + h = height; + holded = false; + color = keycolor; + if (toggled) setToggleButton(true); + timer = new QTimer(this); + connect(timer,SIGNAL(timeout()),this,SLOT(hold())); + +// QToolTip::add(this,l.replace('\n',' ') + "\n[" + event + "]"); + + setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); + setFixedHeight(h * 20); + setFixedWidth(w * 20); + setPaletteBackgroundColor(color); + + if (isToggleButton()) { + connect(this,SIGNAL(toggled(bool)),this,SLOT(keyToggled(bool))); + } else { + connect(this,SIGNAL(pressed()),this,SLOT(keyPressed())); + connect(this,SIGNAL(released()),this,SLOT(keyReleased())); + } +} + + +KeyButton::~KeyButton() +{ +} + + +/*! + \fn KeyButton::updateLabel() + */ +void KeyButton::updateLabel() +{ + QFont f = font(); + int s = (w > h ? h : w); + if (current.label.length() > 1) f.setPixelSize(6 * s); + else f.setPixelSize(12 * s); + setFont(f); + setText(current.label); + update(); + show(); +} + + + +/*! + \fn KeyButton::getX() + */ +int KeyButton::getX() +{ + return x; +} + + +/*! + \fn KeyButton::getY() + */ +int KeyButton::getY() +{ + return y; +} + + +/*! + \fn KeyButton::getH() + */ +int KeyButton::getH() +{ + return h; +} + + +/*! + \fn KeyButton::getW() + */ +int KeyButton::getW() +{ + return w; +} + + +/*! + \fn KeyButton::getElement(QDomDocument &doc) + */ +QDomElement KeyButton::getElement(QDomDocument &doc) +{ + QDomElement element = doc.createElement("key"); + element.setAttribute("x",x); + element.setAttribute("y",y); + element.setAttribute("width",w); + element.setAttribute("height",h); + element.setAttribute("type","button"); + element.setAttribute("color",color.name()); + + for(unsigned int i = 0;i < list.count();i ++) { + QDomElement e = doc.createElement("group"); + e.setAttribute("name",list[i].name); + e.setAttribute("modifier",list[i].modifier); + e.setAttribute("event",list[i].event); + e.appendChild(doc.createTextNode(list[i].label)); + element.appendChild(e); + } + return element; +} + + +/*! + \fn KeyButton::appendGroup(KeyGroup group) + */ +void KeyButton::appendGroup(KeyGroup group) +{ + list.append(group); + if (list.count() == 1) { + current = list[0]; + updateLabel(); + } +} + + + +/*! + \fn KeyButton::changeGroup(const QString &name) + */ +void KeyButton::changeGroup(const QString &name) +{ + for(unsigned int i = 0;i < list.count();i ++) { + if ((list[i].name == name) || ((list[i].name == "") && (name == ""))) { + current = list[i]; + break; + } + } + updateLabel(); +} + + +/*! + \fn KeyButton::keyPressed() + */ +void KeyButton::keyPressed() +{ + if (!holded) { + timer->stop(); + timer->start(1000); + emit pressed(current.event,current.modifier); + } else { + setPaletteBackgroundColor(color); + holded = false; + } +} + + +/*! + \fn KeyButton::keyReleased() + */ +void KeyButton::keyReleased() +{ + timer->stop(); + if (!holded) + emit released(current.event,current.modifier); +} + + +/*! + \fn KeyButton::keyToggled(bool s) + */ +void KeyButton::keyToggled(bool s) +{ + if (s) keyPressed(); + else keyReleased(); +} + + +/*! + \fn KeyButton::hold() + */ +void KeyButton::hold() +{ + if (!isToggleButton()) { + holded = true; + setPaletteBackgroundColor(QColor("red")); + } +} diff --git a/nagisa/src/keybutton.h b/nagisa/src/keybutton.h new file mode 100644 index 0000000..23dd518 --- /dev/null +++ b/nagisa/src/keybutton.h @@ -0,0 +1,97 @@ +/*************************************************************************** + * Copyright (C) 2005 by Teppei Tamra * + * TAM(tam-t@par.odn.ne.jp) * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef KEYBUTTON_H +#define KEYBUTTON_H + +#include +#include +#include +#include +#include +#include + +/** +@author Teppei Tamra +*/ +class KeyButton; + +class KeyGroup +{ +public: + friend class KeyButton; + KeyGroup(); + KeyGroup(const QString &_name,const QString &_label,const QString &_event,const QString &_modifier); + ~KeyGroup(); + void setValue(const QString &_name,const QString &_label,const QString &_event,const QString &_modifier); + void setValue(const KeyGroup &g) { + setValue(g.name,g.label,g.event,g.modifier); + }; +protected: + QString name; + QString label; + QString event; + QString modifier; +}; + +typedef QValueList KeyGroupList; + +class KeyButton : public QPushButton +{ +Q_OBJECT +public: + KeyButton(QWidget *parent, + unsigned int pos_x,unsigned int pos_y, + unsigned int width = 2, unsigned int height = 2,const QColor &keycolor = QColor("white"), + bool toggled = false, + const char *name = 0); + + ~KeyButton(); + int getX(); + int getY(); + int getH(); + int getW(); + QDomElement getElement(QDomDocument &doc); + void appendGroup(KeyGroup group); + void updateLabel(); + void changeGroup(const QString &name); + +protected: + QTimer *timer; + KeyGroupList list; + KeyGroup current; + QColor color; + bool holded; + int h; + int w; + int x; + int y; + +signals: + void pressed(const QString &event,const QString &modifier); + void released(const QString &event,const QString &modifier); +protected slots: + void keyPressed(); + void keyReleased(); + void keyToggled(bool s); + void hold(); +}; + + +#endif diff --git a/nagisa/src/main.cpp b/nagisa/src/main.cpp new file mode 100644 index 0000000..283dd51 --- /dev/null +++ b/nagisa/src/main.cpp @@ -0,0 +1,39 @@ +/*************************************************************************** + * Copyright (C) 2005 by Teppei Tamra * + * TAM(tam-t@par.odn.ne.jp) * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#include +#include +#include +#include "nagisa.h" + +int main( int argc, char ** argv ) { + QApplication a( argc, argv ); + + QTranslator t(0); + t.load(QString(NAGISADATADIR) + QString("/nagisa_") + QStringList::split(".",QTextCodec::locale())[0] + ".qm" ); + a.installTranslator(&t); + QString file; + if (argc >= 2) file = argv[1]; + nagisa * mw = new nagisa(file); + QObject::connect(&a,SIGNAL(lastWindowClosed()),&a,SLOT(quit())); + mw->show(); + return a.exec(); +} diff --git a/nagisa/src/nagisa.cpp b/nagisa/src/nagisa.cpp new file mode 100644 index 0000000..e7c65b2 --- /dev/null +++ b/nagisa/src/nagisa.cpp @@ -0,0 +1,199 @@ +/*************************************************************************** + * Copyright (C) 2005 by Teppei Tamra * + * TAM(tam-t@par.odn.ne.jp) * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +/* +#ifdef Q_WS_X11 +# include +#endif +*/ + +#define Uses_SCIM_SOCKET +#define Uses_SCIM_TRANSACTION +#define Uses_SCIM_HELPER +#include +#include +#include +#include +#include + +#include "nagisa.h" + +#include +#include + + +static scim::HelperAgent agent; + +nagisa::nagisa(const QString &xml) +// : QWidget( 0, "nagisa",Qt::WStyle_Customize | Qt::WStyle_DialogBorder | Qt::WStyle_StaysOnTop) + : QWidget( 0, "nagisa", Qt::WStyle_Customize | Qt::WX11BypassWM | Qt::WStyle_StaysOnTop) +{ + QString file = xml; + if (file == "") file = "jp109.xml"; + id = -1; + + mousePress = false; + + QVBoxLayout *lay = new QVBoxLayout(this); + lay->setAutoAdd(true); + scaleButton = new QToolButton(this); + scaleButton->setText(tr("Nagisa Keypad")); + scaleButton->setMouseTracking(true); + + menu = new QPopupMenu(scaleButton); + menu_scale = menu->insertItem(tr("hide"),this,SLOT(scale())); + menu_connect = menu->insertItem(tr("connect"),this,SLOT(connectToScim())); + menu_exit = menu->insertItem(tr("exit"),this,SLOT(close())); + scaleButton->setPopup(menu); + connect(scaleButton,SIGNAL(clicked()),this,SLOT(scale())); + NagisaKeyboard *b = new NagisaKeyboard(file,this); + contents = b; + b->show(); + + status = new QLabel(this); + + show(); + + connect(b,SIGNAL(pressed(const QString& )),this,SLOT(sendKeyPressEvent(const QString& ))); + connect(b,SIGNAL(released(const QString& )),this,SLOT(sendKeyReleaseEvent(const QString& ))); + connect(b,SIGNAL(status(const QString& )),this,SLOT(updateStatus(const QString& ))); + + connectToScim(); +} + + +nagisa::~nagisa() +{ +} + + + + +/*! + \fn nagisa::sendKeyPressEvent(const QString &e) + */ +void nagisa::sendKeyPressEvent(const QString &e) +{ + if (id < 0) return; + scim::KeyEvent key; + if (!scim::scim_string_to_key(key,e)) return; + agent.send_key_event(-1,"",key); +} + +/*! + \fn nagisa::sendKeyReleaseEvent(const QString &e) + */ +void nagisa::sendKeyReleaseEvent(const QString &e) +{ + if (id < 0) return; + scim::KeyEvent key; + if (!scim::scim_string_to_key(key,e)) return; + key.mask |= scim::SCIM_KEY_ReleaseMask; + agent.send_key_event(-1,"",key); +} + + + +/*! + \fn nagisa::mousePressEvent(QMouseEvent *e) + */ +void nagisa::mousePressEvent(QMouseEvent *e) +{ + mousePress = true; + mouseX = e->x(); + mouseY = e->y(); +} + + +/*! + \fn nagisa::mouseReleaseEvent(QMouseEvent *e) + */ +void nagisa::mouseReleaseEvent(QMouseEvent *e) +{ + mousePress = false; + mouseX = e->x(); + mouseY = e->y(); +} + + +/*! + \fn nagisa::mouseMoveEvent(QMouseEvent *e) + */ +void nagisa::mouseMoveEvent(QMouseEvent *e) +{ + if (mousePress) { + move(e->globalX() - mouseX,e->globalY() - mouseY); + } +} + + + + +/*! + \fn nagisa::scale() + */ +void nagisa::scale() +{ + if (contents->isShown()) { + contents->hide(); + status->hide(); + menu->changeItem(menu_scale,tr("show")); + } else { + contents->show(); + status->show(); + menu->changeItem(menu_scale,tr("hide")); + } + adjustSize(); +} + + +/*! + \fn nagisa::connectToScim() + */ +void nagisa::connectToScim() +{ + if (id < 0) { + scim::HelperInfo info("e135e0ee-5588-423e-a027-f07d769c12a3","Nagisa","","Nagisa helper.", + scim::SCIM_HELPER_STAND_ALONE | scim::SCIM_HELPER_NEED_SCREEN_INFO | scim::SCIM_HELPER_NEED_SPOT_LOCATION_INFO); + // �ʲ��������Ϥꤳ������٤����ȡ� + // #ifdef Q_WS_X11 + // scim::String display = XDisplayString(qt_xdisplay()); + // #else + // scim::String display = getenv("DISPLAY"); + // #endif + scim::String display = getenv("DISPLAY"); + id = agent.open_connection(info,display); + } else { + agent.close_connection(); + id = -1; + } + + if (id < 0) menu->changeItem(menu_connect,tr("connect")); + else menu->changeItem(menu_connect,tr("disconnect")); +} + + +/*! + \fn nagisa::updateStatus(const QString &s) + */ +void nagisa::updateStatus(const QString &s) +{ + status->setText(s); +} diff --git a/nagisa/src/nagisa.h b/nagisa/src/nagisa.h new file mode 100644 index 0000000..40f04d4 --- /dev/null +++ b/nagisa/src/nagisa.h @@ -0,0 +1,65 @@ +/*************************************************************************** + * Copyright (C) 2005 by Teppei Tamra * + * TAM(tam-t@par.odn.ne.jp) * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#ifndef NAGISA_H +#define NAGISA_H + +#include +#include +#include +#include + +class nagisa: public QWidget +{ + Q_OBJECT + +public: + nagisa(const QString &xml = 0); + ~nagisa(); + +public slots: + void sendKeyPressEvent(const QString &e); + void sendKeyReleaseEvent(const QString &e); +protected: + virtual void mousePressEvent(QMouseEvent *e); + virtual void mouseReleaseEvent(QMouseEvent *e); + virtual void mouseMoveEvent(QMouseEvent *e); +protected: + bool mousePress; + int mouseX; + int mouseY; + QWidget *contents; + QLabel *status; + QToolButton *scaleButton; + QPopupMenu *menu; + int menu_scale; + int menu_connect; + int menu_exit; + int id; + +protected slots: + void scale(); + void connectToScim(); + void updateStatus(const QString &s); +}; + + +#endif diff --git a/nagisa/src/nagisa_ja_JP.qm b/nagisa/src/nagisa_ja_JP.qm new file mode 100644 index 0000000..a7db524 --- /dev/null +++ b/nagisa/src/nagisa_ja_JP.qm Binary files differ diff --git a/nagisa/src/nagisa_ja_JP.ts b/nagisa/src/nagisa_ja_JP.ts new file mode 100644 index 0000000..cf0de5e --- /dev/null +++ b/nagisa/src/nagisa_ja_JP.ts @@ -0,0 +1,37 @@ + + + @default + + W/H + 半角 +全角 + + + + nagisa + + hide + 隠す + + + connect + 接続 + + + exit + 終了 + + + show + 表示 + + + disconnect + 切断 + + + Nagisa Keypad + なぎさたんキーボード + + + diff --git a/nagisa/src/nagisakeyboard.cpp b/nagisa/src/nagisakeyboard.cpp new file mode 100644 index 0000000..17f2703 --- /dev/null +++ b/nagisa/src/nagisakeyboard.cpp @@ -0,0 +1,183 @@ +/*************************************************************************** + * Copyright (C) 2005 by Teppei Tamra * + * TAM(tam-t@par.odn.ne.jp) * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "nagisakeyboard.h" +#include + +NagisaKeyboard::NagisaKeyboard(QWidget *parent, const char *name) + : QWidget(parent, name) +{ + init(); +} + +NagisaKeyboard::NagisaKeyboard(const QString &xml, QWidget *parent, const char *name) + : QWidget(parent, name) +{ + init(); + setTableFile(xml); +} + +void NagisaKeyboard::init() +{ + grid = new QGridLayout(this,1,1,0,20); +} + + +NagisaKeyboard::~NagisaKeyboard() +{ +} + + + + +/*! + \fn NagisaKeyboard::layout() + */ +void NagisaKeyboard::layout() +{ + for(unsigned int i = 0;i < keys.count();i ++) { + grid->addMultiCellWidget(keys[i], + keys[i]->getY(),keys[i]->getY() + keys[i]->getH(), + keys[i]->getX(),keys[i]->getX() + keys[i]->getW()); + } + adjustSize(); + show(); +} + + +/*! + \fn NagisaKeyboard::pressed(const QString &name,const QString &modifier) + */ +void NagisaKeyboard::pressed(const QString &name,const QString &modifier) +{ + QString keyEvent; + if (uniq(modifiers).join("+") != "") keyEvent = uniq(modifiers).join("+") + "+" + name; + else keyEvent = name; + emit status(keyEvent); + show(); + emit pressed(keyEvent); + if (modifier != "") { + modifiers.append(modifier); + modifiers.sort(); + for(unsigned int i = 0;i < keys.count();i ++) { + keys[i]->changeGroup(uniq(modifiers).join("+")); + } + } +} + + +/*! + \fn NagisaKeyboard::released(const QString &name,const QString &modifier) + */ +void NagisaKeyboard::released(const QString &name,const QString &modifier) +{ + QString keyEvent; + if (uniq(modifiers).join("+") != "") keyEvent = uniq(modifiers).join("+") + "+" + name; + else keyEvent = name; + emit status(""); + show(); + emit released(keyEvent); + if (modifier != "") { + // iterator��remove���ʤ�����ᡣ + modifiers.remove(modifiers.find(modifier)); + for(unsigned int i = 0;i < keys.count();i ++) { + keys[i]->changeGroup(uniq(modifiers).join("+")); + } + } +} + + + + +/*! + \fn NagisaKeyboard::parser(const QString &xml) + */ +void NagisaKeyboard::parser(const QString &xml) +{ + QFile file(xml); + if (!file.open(IO_ReadOnly)) { + file.setName(QString(NAGISADATADIR) + "/" + xml); + if (!file.open(IO_ReadOnly)) { + return; + } + } + if (!doc.setContent(&file)) return; + file.close(); + QDomElement root = doc.documentElement(); + QDomNode node = root.firstChild(); + while(!node.isNull()) { + QDomElement element = node.toElement(); + if(!element.isNull()) { + if (element.tagName() == "key") { + KeyButton *key = new KeyButton(this, + element.attribute("x","0").toInt(), + element.attribute("y","0").toInt(), + element.attribute("width","2").toInt(), + element.attribute("height","2").toInt(), + element.attribute("color","white"), + element.attribute("type","button") == "toggle" + ); + connect(key,SIGNAL(pressed(const QString&, const QString& )),this,SLOT(pressed(const QString&, const QString& ))); + connect(key,SIGNAL(released(const QString&, const QString& )),this,SLOT(released(const QString&, const QString& ))); + + QDomNode group = element.firstChild(); + while(!group.isNull()) { + QDomElement groupElement = group.toElement(); + if (!groupElement.isNull()) { + if (groupElement.tagName() == "group") { + key->appendGroup(KeyGroup( + groupElement.attribute("name",""), + groupElement.text(), + groupElement.attribute("event",""), + groupElement.attribute("modifier","") + )); + } + } + group = group.nextSibling(); + } + keys.append(key); + } + } + node = node.nextSibling(); + } +} + + +/*! + \fn NagisaKeyboard::setTableFile(const QString &xml) + */ +void NagisaKeyboard::setTableFile(const QString &xml) +{ + parser(xml); + layout(); + show(); +} + + +/*! + \fn NagisaKeyboard::uniq(const QStringList &list) + */ +const QStringList NagisaKeyboard::uniq(const QStringList &list) +{ + QStringList res; + for(unsigned int i = 0;i < list.count();i ++) { + if (!res.contains(list[i])) res.append(list[i]); + } + return res; +} diff --git a/nagisa/src/nagisakeyboard.h b/nagisa/src/nagisakeyboard.h new file mode 100644 index 0000000..b59fcef --- /dev/null +++ b/nagisa/src/nagisakeyboard.h @@ -0,0 +1,60 @@ +/*************************************************************************** + * Copyright (C) 2005 by Teppei Tamra * + * TAM(tam-t@par.odn.ne.jp) * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef NAGISAKEYBOARD_H +#define NAGISAKEYBOARD_H + +#include +#include +#include +#include +#include + +/** +@author Teppei Tamra +*/ +class NagisaKeyboard : public QWidget +{ +Q_OBJECT +public: + NagisaKeyboard(QWidget *parent = 0, const char *name = 0); + NagisaKeyboard(const QString &xml, QWidget *parent = 0, const char *name = 0); + ~NagisaKeyboard(); + static const QStringList uniq(const QStringList &list); + +protected: + QGridLayout *grid; + QValueList keys; + QDomDocument doc; + QStringList modifiers; +protected: + void init(); + void layout(); + void parser(const QString &xml); + void setTableFile(const QString &xml); +protected slots: + void pressed(const QString &name,const QString &modifier); + void released(const QString &name,const QString &modifier); +signals: + void pressed(const QString &event); + void released(const QString &event); + void status(const QString &s); +}; + +#endif diff --git a/nagisa/src/src.pro b/nagisa/src/src.pro new file mode 100644 index 0000000..a29e24d --- /dev/null +++ b/nagisa/src/src.pro @@ -0,0 +1,29 @@ +# File generated by kdevelop's qmake manager. +# ------------------------------------------- +# Subdir relative project main directory: ./src +# Target is ????????: ../bin/nagisa +PREFIX = /usr/local +TRANSLATIONS += nagisa_ja_JP.ts +HEADERS += nagisa.h \ + nagisakeyboard.h \ + keybutton.h \ + nagisakeytable.h +SOURCES += nagisa.cpp \ + main.cpp \ + nagisakeyboard.cpp \ + keybutton.cpp +SCIM_LIBS += $$system(pkg-config --libs scim) +SCIM_INCLUDE += $$system(pkg-config --variable includedir scim) +LIBS += $$SCIM_LIBS +DATA.path = $$PREFIX/share/nagisa +DATA.files = jp109.xml nagisa_ja_JP.qm +target.path = $$PREFIX/bin +INCLUDEPATH += $$SCIM_INCLUDE/scim-1.0 +DEFINES += NAGISADATADIR=\"$$DATA.path\" +TARGET = nagisa +CONFIG += release \ +warn_on \ +qt \ +thread +INSTALLS += DATA target +TEMPLATE = app