[svn r876] renamed project trunk
authorrenatofilho
Thu Oct 25 15:40:47 2007 +0100 (2007-10-25)
branchtrunk
changeset 870735d9b563b02
parent 869 48cf27f814b7
child 871 49947675bace
[svn r876] renamed project
gmyth-dbus/AUTHORS
gmyth-dbus/COPYING
gmyth-dbus/ChangeLog
gmyth-dbus/INSTALL
gmyth-dbus/Makefile.am
gmyth-dbus/NEWS
gmyth-dbus/README
gmyth-dbus/autogen.sh
gmyth-dbus/configure.ac
gmyth-dbus/data/Makefile.am
gmyth-dbus/data/br.org.indt.GMyth.service.in
gmyth-dbus/m4/as-expand.m4
gmyth-dbus/src/Makefile.am
gmyth-dbus/src/gmyth-dbus-common.h
gmyth-dbus/src/gmyth-dbus-server.c
gmyth-dbus/src/gmyth-dbus-server.h
gmyth-dbus/src/gmyth-dbus-server.xml
gmyth-dbus/src/main.c
gmyth-dbus/tests/channel-list.py
myth-dbus/AUTHORS
myth-dbus/COPYING
myth-dbus/ChangeLog
myth-dbus/INSTALL
myth-dbus/Makefile.am
myth-dbus/NEWS
myth-dbus/README
myth-dbus/autogen.sh
myth-dbus/configure.ac
myth-dbus/data/Makefile.am
myth-dbus/data/br.org.indt.GMyth.service.in
myth-dbus/m4/as-expand.m4
myth-dbus/src/Makefile.am
myth-dbus/src/gmyth-dbus-common.h
myth-dbus/src/gmyth-dbus-server.c
myth-dbus/src/gmyth-dbus-server.h
myth-dbus/src/gmyth-dbus-server.xml
myth-dbus/src/main.c
myth-dbus/tests/channel-list.py
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gmyth-dbus/COPYING	Thu Oct 25 15:40:47 2007 +0100
     1.3 @@ -0,0 +1,340 @@
     1.4 +		    GNU GENERAL PUBLIC LICENSE
     1.5 +		       Version 2, June 1991
     1.6 +
     1.7 + Copyright (C) 1989, 1991 Free Software Foundation, Inc.
     1.8 +     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
     1.9 + Everyone is permitted to copy and distribute verbatim copies
    1.10 + of this license document, but changing it is not allowed.
    1.11 +
    1.12 +			    Preamble
    1.13 +
    1.14 +  The licenses for most software are designed to take away your
    1.15 +freedom to share and change it.  By contrast, the GNU General Public
    1.16 +License is intended to guarantee your freedom to share and change free
    1.17 +software--to make sure the software is free for all its users.  This
    1.18 +General Public License applies to most of the Free Software
    1.19 +Foundation's software and to any other program whose authors commit to
    1.20 +using it.  (Some other Free Software Foundation software is covered by
    1.21 +the GNU Library General Public License instead.)  You can apply it to
    1.22 +your programs, too.
    1.23 +
    1.24 +  When we speak of free software, we are referring to freedom, not
    1.25 +price.  Our General Public Licenses are designed to make sure that you
    1.26 +have the freedom to distribute copies of free software (and charge for
    1.27 +this service if you wish), that you receive source code or can get it
    1.28 +if you want it, that you can change the software or use pieces of it
    1.29 +in new free programs; and that you know you can do these things.
    1.30 +
    1.31 +  To protect your rights, we need to make restrictions that forbid
    1.32 +anyone to deny you these rights or to ask you to surrender the rights.
    1.33 +These restrictions translate to certain responsibilities for you if you
    1.34 +distribute copies of the software, or if you modify it.
    1.35 +
    1.36 +  For example, if you distribute copies of such a program, whether
    1.37 +gratis or for a fee, you must give the recipients all the rights that
    1.38 +you have.  You must make sure that they, too, receive or can get the
    1.39 +source code.  And you must show them these terms so they know their
    1.40 +rights.
    1.41 +
    1.42 +  We protect your rights with two steps: (1) copyright the software, and
    1.43 +(2) offer you this license which gives you legal permission to copy,
    1.44 +distribute and/or modify the software.
    1.45 +
    1.46 +  Also, for each author's protection and ours, we want to make certain
    1.47 +that everyone understands that there is no warranty for this free
    1.48 +software.  If the software is modified by someone else and passed on, we
    1.49 +want its recipients to know that what they have is not the original, so
    1.50 +that any problems introduced by others will not reflect on the original
    1.51 +authors' reputations.
    1.52 +
    1.53 +  Finally, any free program is threatened constantly by software
    1.54 +patents.  We wish to avoid the danger that redistributors of a free
    1.55 +program will individually obtain patent licenses, in effect making the
    1.56 +program proprietary.  To prevent this, we have made it clear that any
    1.57 +patent must be licensed for everyone's free use or not licensed at all.
    1.58 +
    1.59 +  The precise terms and conditions for copying, distribution and
    1.60 +modification follow.
    1.61 +
    1.62 +		    GNU GENERAL PUBLIC LICENSE
    1.63 +   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    1.64 +
    1.65 +  0. This License applies to any program or other work which contains
    1.66 +a notice placed by the copyright holder saying it may be distributed
    1.67 +under the terms of this General Public License.  The "Program", below,
    1.68 +refers to any such program or work, and a "work based on the Program"
    1.69 +means either the Program or any derivative work under copyright law:
    1.70 +that is to say, a work containing the Program or a portion of it,
    1.71 +either verbatim or with modifications and/or translated into another
    1.72 +language.  (Hereinafter, translation is included without limitation in
    1.73 +the term "modification".)  Each licensee is addressed as "you".
    1.74 +
    1.75 +Activities other than copying, distribution and modification are not
    1.76 +covered by this License; they are outside its scope.  The act of
    1.77 +running the Program is not restricted, and the output from the Program
    1.78 +is covered only if its contents constitute a work based on the
    1.79 +Program (independent of having been made by running the Program).
    1.80 +Whether that is true depends on what the Program does.
    1.81 +
    1.82 +  1. You may copy and distribute verbatim copies of the Program's
    1.83 +source code as you receive it, in any medium, provided that you
    1.84 +conspicuously and appropriately publish on each copy an appropriate
    1.85 +copyright notice and disclaimer of warranty; keep intact all the
    1.86 +notices that refer to this License and to the absence of any warranty;
    1.87 +and give any other recipients of the Program a copy of this License
    1.88 +along with the Program.
    1.89 +
    1.90 +You may charge a fee for the physical act of transferring a copy, and
    1.91 +you may at your option offer warranty protection in exchange for a fee.
    1.92 +
    1.93 +  2. You may modify your copy or copies of the Program or any portion
    1.94 +of it, thus forming a work based on the Program, and copy and
    1.95 +distribute such modifications or work under the terms of Section 1
    1.96 +above, provided that you also meet all of these conditions:
    1.97 +
    1.98 +    a) You must cause the modified files to carry prominent notices
    1.99 +    stating that you changed the files and the date of any change.
   1.100 +
   1.101 +    b) You must cause any work that you distribute or publish, that in
   1.102 +    whole or in part contains or is derived from the Program or any
   1.103 +    part thereof, to be licensed as a whole at no charge to all third
   1.104 +    parties under the terms of this License.
   1.105 +
   1.106 +    c) If the modified program normally reads commands interactively
   1.107 +    when run, you must cause it, when started running for such
   1.108 +    interactive use in the most ordinary way, to print or display an
   1.109 +    announcement including an appropriate copyright notice and a
   1.110 +    notice that there is no warranty (or else, saying that you provide
   1.111 +    a warranty) and that users may redistribute the program under
   1.112 +    these conditions, and telling the user how to view a copy of this
   1.113 +    License.  (Exception: if the Program itself is interactive but
   1.114 +    does not normally print such an announcement, your work based on
   1.115 +    the Program is not required to print an announcement.)
   1.116 +
   1.117 +These requirements apply to the modified work as a whole.  If
   1.118 +identifiable sections of that work are not derived from the Program,
   1.119 +and can be reasonably considered independent and separate works in
   1.120 +themselves, then this License, and its terms, do not apply to those
   1.121 +sections when you distribute them as separate works.  But when you
   1.122 +distribute the same sections as part of a whole which is a work based
   1.123 +on the Program, the distribution of the whole must be on the terms of
   1.124 +this License, whose permissions for other licensees extend to the
   1.125 +entire whole, and thus to each and every part regardless of who wrote it.
   1.126 +
   1.127 +Thus, it is not the intent of this section to claim rights or contest
   1.128 +your rights to work written entirely by you; rather, the intent is to
   1.129 +exercise the right to control the distribution of derivative or
   1.130 +collective works based on the Program.
   1.131 +
   1.132 +In addition, mere aggregation of another work not based on the Program
   1.133 +with the Program (or with a work based on the Program) on a volume of
   1.134 +a storage or distribution medium does not bring the other work under
   1.135 +the scope of this License.
   1.136 +
   1.137 +  3. You may copy and distribute the Program (or a work based on it,
   1.138 +under Section 2) in object code or executable form under the terms of
   1.139 +Sections 1 and 2 above provided that you also do one of the following:
   1.140 +
   1.141 +    a) Accompany it with the complete corresponding machine-readable
   1.142 +    source code, which must be distributed under the terms of Sections
   1.143 +    1 and 2 above on a medium customarily used for software interchange; or,
   1.144 +
   1.145 +    b) Accompany it with a written offer, valid for at least three
   1.146 +    years, to give any third party, for a charge no more than your
   1.147 +    cost of physically performing source distribution, a complete
   1.148 +    machine-readable copy of the corresponding source code, to be
   1.149 +    distributed under the terms of Sections 1 and 2 above on a medium
   1.150 +    customarily used for software interchange; or,
   1.151 +
   1.152 +    c) Accompany it with the information you received as to the offer
   1.153 +    to distribute corresponding source code.  (This alternative is
   1.154 +    allowed only for noncommercial distribution and only if you
   1.155 +    received the program in object code or executable form with such
   1.156 +    an offer, in accord with Subsection b above.)
   1.157 +
   1.158 +The source code for a work means the preferred form of the work for
   1.159 +making modifications to it.  For an executable work, complete source
   1.160 +code means all the source code for all modules it contains, plus any
   1.161 +associated interface definition files, plus the scripts used to
   1.162 +control compilation and installation of the executable.  However, as a
   1.163 +special exception, the source code distributed need not include
   1.164 +anything that is normally distributed (in either source or binary
   1.165 +form) with the major components (compiler, kernel, and so on) of the
   1.166 +operating system on which the executable runs, unless that component
   1.167 +itself accompanies the executable.
   1.168 +
   1.169 +If distribution of executable or object code is made by offering
   1.170 +access to copy from a designated place, then offering equivalent
   1.171 +access to copy the source code from the same place counts as
   1.172 +distribution of the source code, even though third parties are not
   1.173 +compelled to copy the source along with the object code.
   1.174 +
   1.175 +  4. You may not copy, modify, sublicense, or distribute the Program
   1.176 +except as expressly provided under this License.  Any attempt
   1.177 +otherwise to copy, modify, sublicense or distribute the Program is
   1.178 +void, and will automatically terminate your rights under this License.
   1.179 +However, parties who have received copies, or rights, from you under
   1.180 +this License will not have their licenses terminated so long as such
   1.181 +parties remain in full compliance.
   1.182 +
   1.183 +  5. You are not required to accept this License, since you have not
   1.184 +signed it.  However, nothing else grants you permission to modify or
   1.185 +distribute the Program or its derivative works.  These actions are
   1.186 +prohibited by law if you do not accept this License.  Therefore, by
   1.187 +modifying or distributing the Program (or any work based on the
   1.188 +Program), you indicate your acceptance of this License to do so, and
   1.189 +all its terms and conditions for copying, distributing or modifying
   1.190 +the Program or works based on it.
   1.191 +
   1.192 +  6. Each time you redistribute the Program (or any work based on the
   1.193 +Program), the recipient automatically receives a license from the
   1.194 +original licensor to copy, distribute or modify the Program subject to
   1.195 +these terms and conditions.  You may not impose any further
   1.196 +restrictions on the recipients' exercise of the rights granted herein.
   1.197 +You are not responsible for enforcing compliance by third parties to
   1.198 +this License.
   1.199 +
   1.200 +  7. If, as a consequence of a court judgment or allegation of patent
   1.201 +infringement or for any other reason (not limited to patent issues),
   1.202 +conditions are imposed on you (whether by court order, agreement or
   1.203 +otherwise) that contradict the conditions of this License, they do not
   1.204 +excuse you from the conditions of this License.  If you cannot
   1.205 +distribute so as to satisfy simultaneously your obligations under this
   1.206 +License and any other pertinent obligations, then as a consequence you
   1.207 +may not distribute the Program at all.  For example, if a patent
   1.208 +license would not permit royalty-free redistribution of the Program by
   1.209 +all those who receive copies directly or indirectly through you, then
   1.210 +the only way you could satisfy both it and this License would be to
   1.211 +refrain entirely from distribution of the Program.
   1.212 +
   1.213 +If any portion of this section is held invalid or unenforceable under
   1.214 +any particular circumstance, the balance of the section is intended to
   1.215 +apply and the section as a whole is intended to apply in other
   1.216 +circumstances.
   1.217 +
   1.218 +It is not the purpose of this section to induce you to infringe any
   1.219 +patents or other property right claims or to contest validity of any
   1.220 +such claims; this section has the sole purpose of protecting the
   1.221 +integrity of the free software distribution system, which is
   1.222 +implemented by public license practices.  Many people have made
   1.223 +generous contributions to the wide range of software distributed
   1.224 +through that system in reliance on consistent application of that
   1.225 +system; it is up to the author/donor to decide if he or she is willing
   1.226 +to distribute software through any other system and a licensee cannot
   1.227 +impose that choice.
   1.228 +
   1.229 +This section is intended to make thoroughly clear what is believed to
   1.230 +be a consequence of the rest of this License.
   1.231 +
   1.232 +  8. If the distribution and/or use of the Program is restricted in
   1.233 +certain countries either by patents or by copyrighted interfaces, the
   1.234 +original copyright holder who places the Program under this License
   1.235 +may add an explicit geographical distribution limitation excluding
   1.236 +those countries, so that distribution is permitted only in or among
   1.237 +countries not thus excluded.  In such case, this License incorporates
   1.238 +the limitation as if written in the body of this License.
   1.239 +
   1.240 +  9. The Free Software Foundation may publish revised and/or new versions
   1.241 +of the General Public License from time to time.  Such new versions will
   1.242 +be similar in spirit to the present version, but may differ in detail to
   1.243 +address new problems or concerns.
   1.244 +
   1.245 +Each version is given a distinguishing version number.  If the Program
   1.246 +specifies a version number of this License which applies to it and "any
   1.247 +later version", you have the option of following the terms and conditions
   1.248 +either of that version or of any later version published by the Free
   1.249 +Software Foundation.  If the Program does not specify a version number of
   1.250 +this License, you may choose any version ever published by the Free Software
   1.251 +Foundation.
   1.252 +
   1.253 +  10. If you wish to incorporate parts of the Program into other free
   1.254 +programs whose distribution conditions are different, write to the author
   1.255 +to ask for permission.  For software which is copyrighted by the Free
   1.256 +Software Foundation, write to the Free Software Foundation; we sometimes
   1.257 +make exceptions for this.  Our decision will be guided by the two goals
   1.258 +of preserving the free status of all derivatives of our free software and
   1.259 +of promoting the sharing and reuse of software generally.
   1.260 +
   1.261 +			    NO WARRANTY
   1.262 +
   1.263 +  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
   1.264 +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
   1.265 +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
   1.266 +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
   1.267 +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
   1.268 +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
   1.269 +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
   1.270 +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
   1.271 +REPAIR OR CORRECTION.
   1.272 +
   1.273 +  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
   1.274 +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
   1.275 +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
   1.276 +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
   1.277 +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
   1.278 +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
   1.279 +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
   1.280 +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
   1.281 +POSSIBILITY OF SUCH DAMAGES.
   1.282 +
   1.283 +		     END OF TERMS AND CONDITIONS
   1.284 +
   1.285 +	    How to Apply These Terms to Your New Programs
   1.286 +
   1.287 +  If you develop a new program, and you want it to be of the greatest
   1.288 +possible use to the public, the best way to achieve this is to make it
   1.289 +free software which everyone can redistribute and change under these terms.
   1.290 +
   1.291 +  To do so, attach the following notices to the program.  It is safest
   1.292 +to attach them to the start of each source file to most effectively
   1.293 +convey the exclusion of warranty; and each file should have at least
   1.294 +the "copyright" line and a pointer to where the full notice is found.
   1.295 +
   1.296 +    <one line to give the program's name and a brief idea of what it does.>
   1.297 +    Copyright (C) <year>  <name of author>
   1.298 +
   1.299 +    This program is free software; you can redistribute it and/or modify
   1.300 +    it under the terms of the GNU General Public License as published by
   1.301 +    the Free Software Foundation; either version 2 of the License, or
   1.302 +    (at your option) any later version.
   1.303 +
   1.304 +    This program is distributed in the hope that it will be useful,
   1.305 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   1.306 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   1.307 +    GNU General Public License for more details.
   1.308 +
   1.309 +    You should have received a copy of the GNU General Public License
   1.310 +    along with this program; if not, write to the Free Software
   1.311 +    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
   1.312 +
   1.313 +
   1.314 +Also add information on how to contact you by electronic and paper mail.
   1.315 +
   1.316 +If the program is interactive, make it output a short notice like this
   1.317 +when it starts in an interactive mode:
   1.318 +
   1.319 +    Gnomovision version 69, Copyright (C) year  name of author
   1.320 +    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
   1.321 +    This is free software, and you are welcome to redistribute it
   1.322 +    under certain conditions; type `show c' for details.
   1.323 +
   1.324 +The hypothetical commands `show w' and `show c' should show the appropriate
   1.325 +parts of the General Public License.  Of course, the commands you use may
   1.326 +be called something other than `show w' and `show c'; they could even be
   1.327 +mouse-clicks or menu items--whatever suits your program.
   1.328 +
   1.329 +You should also get your employer (if you work as a programmer) or your
   1.330 +school, if any, to sign a "copyright disclaimer" for the program, if
   1.331 +necessary.  Here is a sample; alter the names:
   1.332 +
   1.333 +  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
   1.334 +  `Gnomovision' (which makes passes at compilers) written by James Hacker.
   1.335 +
   1.336 +  <signature of Ty Coon>, 1 April 1989
   1.337 +  Ty Coon, President of Vice
   1.338 +
   1.339 +This General Public License does not permit incorporating your program into
   1.340 +proprietary programs.  If your program is a subroutine library, you may
   1.341 +consider it more useful to permit linking proprietary applications with the
   1.342 +library.  If this is what you want to do, use the GNU Library General
   1.343 +Public License instead of this License.
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/gmyth-dbus/INSTALL	Thu Oct 25 15:40:47 2007 +0100
     2.3 @@ -0,0 +1,236 @@
     2.4 +Installation Instructions
     2.5 +*************************
     2.6 +
     2.7 +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
     2.8 +Software Foundation, Inc.
     2.9 +
    2.10 +This file is free documentation; the Free Software Foundation gives
    2.11 +unlimited permission to copy, distribute and modify it.
    2.12 +
    2.13 +Basic Installation
    2.14 +==================
    2.15 +
    2.16 +These are generic installation instructions.
    2.17 +
    2.18 +   The `configure' shell script attempts to guess correct values for
    2.19 +various system-dependent variables used during compilation.  It uses
    2.20 +those values to create a `Makefile' in each directory of the package.
    2.21 +It may also create one or more `.h' files containing system-dependent
    2.22 +definitions.  Finally, it creates a shell script `config.status' that
    2.23 +you can run in the future to recreate the current configuration, and a
    2.24 +file `config.log' containing compiler output (useful mainly for
    2.25 +debugging `configure').
    2.26 +
    2.27 +   It can also use an optional file (typically called `config.cache'
    2.28 +and enabled with `--cache-file=config.cache' or simply `-C') that saves
    2.29 +the results of its tests to speed up reconfiguring.  (Caching is
    2.30 +disabled by default to prevent problems with accidental use of stale
    2.31 +cache files.)
    2.32 +
    2.33 +   If you need to do unusual things to compile the package, please try
    2.34 +to figure out how `configure' could check whether to do them, and mail
    2.35 +diffs or instructions to the address given in the `README' so they can
    2.36 +be considered for the next release.  If you are using the cache, and at
    2.37 +some point `config.cache' contains results you don't want to keep, you
    2.38 +may remove or edit it.
    2.39 +
    2.40 +   The file `configure.ac' (or `configure.in') is used to create
    2.41 +`configure' by a program called `autoconf'.  You only need
    2.42 +`configure.ac' if you want to change it or regenerate `configure' using
    2.43 +a newer version of `autoconf'.
    2.44 +
    2.45 +The simplest way to compile this package is:
    2.46 +
    2.47 +  1. `cd' to the directory containing the package's source code and type
    2.48 +     `./configure' to configure the package for your system.  If you're
    2.49 +     using `csh' on an old version of System V, you might need to type
    2.50 +     `sh ./configure' instead to prevent `csh' from trying to execute
    2.51 +     `configure' itself.
    2.52 +
    2.53 +     Running `configure' takes awhile.  While running, it prints some
    2.54 +     messages telling which features it is checking for.
    2.55 +
    2.56 +  2. Type `make' to compile the package.
    2.57 +
    2.58 +  3. Optionally, type `make check' to run any self-tests that come with
    2.59 +     the package.
    2.60 +
    2.61 +  4. Type `make install' to install the programs and any data files and
    2.62 +     documentation.
    2.63 +
    2.64 +  5. You can remove the program binaries and object files from the
    2.65 +     source code directory by typing `make clean'.  To also remove the
    2.66 +     files that `configure' created (so you can compile the package for
    2.67 +     a different kind of computer), type `make distclean'.  There is
    2.68 +     also a `make maintainer-clean' target, but that is intended mainly
    2.69 +     for the package's developers.  If you use it, you may have to get
    2.70 +     all sorts of other programs in order to regenerate files that came
    2.71 +     with the distribution.
    2.72 +
    2.73 +Compilers and Options
    2.74 +=====================
    2.75 +
    2.76 +Some systems require unusual options for compilation or linking that the
    2.77 +`configure' script does not know about.  Run `./configure --help' for
    2.78 +details on some of the pertinent environment variables.
    2.79 +
    2.80 +   You can give `configure' initial values for configuration parameters
    2.81 +by setting variables in the command line or in the environment.  Here
    2.82 +is an example:
    2.83 +
    2.84 +     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
    2.85 +
    2.86 +   *Note Defining Variables::, for more details.
    2.87 +
    2.88 +Compiling For Multiple Architectures
    2.89 +====================================
    2.90 +
    2.91 +You can compile the package for more than one kind of computer at the
    2.92 +same time, by placing the object files for each architecture in their
    2.93 +own directory.  To do this, you must use a version of `make' that
    2.94 +supports the `VPATH' variable, such as GNU `make'.  `cd' to the
    2.95 +directory where you want the object files and executables to go and run
    2.96 +the `configure' script.  `configure' automatically checks for the
    2.97 +source code in the directory that `configure' is in and in `..'.
    2.98 +
    2.99 +   If you have to use a `make' that does not support the `VPATH'
   2.100 +variable, you have to compile the package for one architecture at a
   2.101 +time in the source code directory.  After you have installed the
   2.102 +package for one architecture, use `make distclean' before reconfiguring
   2.103 +for another architecture.
   2.104 +
   2.105 +Installation Names
   2.106 +==================
   2.107 +
   2.108 +By default, `make install' installs the package's commands under
   2.109 +`/usr/local/bin', include files under `/usr/local/include', etc.  You
   2.110 +can specify an installation prefix other than `/usr/local' by giving
   2.111 +`configure' the option `--prefix=PREFIX'.
   2.112 +
   2.113 +   You can specify separate installation prefixes for
   2.114 +architecture-specific files and architecture-independent files.  If you
   2.115 +pass the option `--exec-prefix=PREFIX' to `configure', the package uses
   2.116 +PREFIX as the prefix for installing programs and libraries.
   2.117 +Documentation and other data files still use the regular prefix.
   2.118 +
   2.119 +   In addition, if you use an unusual directory layout you can give
   2.120 +options like `--bindir=DIR' to specify different values for particular
   2.121 +kinds of files.  Run `configure --help' for a list of the directories
   2.122 +you can set and what kinds of files go in them.
   2.123 +
   2.124 +   If the package supports it, you can cause programs to be installed
   2.125 +with an extra prefix or suffix on their names by giving `configure' the
   2.126 +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
   2.127 +
   2.128 +Optional Features
   2.129 +=================
   2.130 +
   2.131 +Some packages pay attention to `--enable-FEATURE' options to
   2.132 +`configure', where FEATURE indicates an optional part of the package.
   2.133 +They may also pay attention to `--with-PACKAGE' options, where PACKAGE
   2.134 +is something like `gnu-as' or `x' (for the X Window System).  The
   2.135 +`README' should mention any `--enable-' and `--with-' options that the
   2.136 +package recognizes.
   2.137 +
   2.138 +   For packages that use the X Window System, `configure' can usually
   2.139 +find the X include and library files automatically, but if it doesn't,
   2.140 +you can use the `configure' options `--x-includes=DIR' and
   2.141 +`--x-libraries=DIR' to specify their locations.
   2.142 +
   2.143 +Specifying the System Type
   2.144 +==========================
   2.145 +
   2.146 +There may be some features `configure' cannot figure out automatically,
   2.147 +but needs to determine by the type of machine the package will run on.
   2.148 +Usually, assuming the package is built to be run on the _same_
   2.149 +architectures, `configure' can figure that out, but if it prints a
   2.150 +message saying it cannot guess the machine type, give it the
   2.151 +`--build=TYPE' option.  TYPE can either be a short name for the system
   2.152 +type, such as `sun4', or a canonical name which has the form:
   2.153 +
   2.154 +     CPU-COMPANY-SYSTEM
   2.155 +
   2.156 +where SYSTEM can have one of these forms:
   2.157 +
   2.158 +     OS KERNEL-OS
   2.159 +
   2.160 +   See the file `config.sub' for the possible values of each field.  If
   2.161 +`config.sub' isn't included in this package, then this package doesn't
   2.162 +need to know the machine type.
   2.163 +
   2.164 +   If you are _building_ compiler tools for cross-compiling, you should
   2.165 +use the option `--target=TYPE' to select the type of system they will
   2.166 +produce code for.
   2.167 +
   2.168 +   If you want to _use_ a cross compiler, that generates code for a
   2.169 +platform different from the build platform, you should specify the
   2.170 +"host" platform (i.e., that on which the generated programs will
   2.171 +eventually be run) with `--host=TYPE'.
   2.172 +
   2.173 +Sharing Defaults
   2.174 +================
   2.175 +
   2.176 +If you want to set default values for `configure' scripts to share, you
   2.177 +can create a site shell script called `config.site' that gives default
   2.178 +values for variables like `CC', `cache_file', and `prefix'.
   2.179 +`configure' looks for `PREFIX/share/config.site' if it exists, then
   2.180 +`PREFIX/etc/config.site' if it exists.  Or, you can set the
   2.181 +`CONFIG_SITE' environment variable to the location of the site script.
   2.182 +A warning: not all `configure' scripts look for a site script.
   2.183 +
   2.184 +Defining Variables
   2.185 +==================
   2.186 +
   2.187 +Variables not defined in a site shell script can be set in the
   2.188 +environment passed to `configure'.  However, some packages may run
   2.189 +configure again during the build, and the customized values of these
   2.190 +variables may be lost.  In order to avoid this problem, you should set
   2.191 +them in the `configure' command line, using `VAR=value'.  For example:
   2.192 +
   2.193 +     ./configure CC=/usr/local2/bin/gcc
   2.194 +
   2.195 +causes the specified `gcc' to be used as the C compiler (unless it is
   2.196 +overridden in the site shell script).  Here is a another example:
   2.197 +
   2.198 +     /bin/bash ./configure CONFIG_SHELL=/bin/bash
   2.199 +
   2.200 +Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
   2.201 +configuration-related scripts to be executed by `/bin/bash'.
   2.202 +
   2.203 +`configure' Invocation
   2.204 +======================
   2.205 +
   2.206 +`configure' recognizes the following options to control how it operates.
   2.207 +
   2.208 +`--help'
   2.209 +`-h'
   2.210 +     Print a summary of the options to `configure', and exit.
   2.211 +
   2.212 +`--version'
   2.213 +`-V'
   2.214 +     Print the version of Autoconf used to generate the `configure'
   2.215 +     script, and exit.
   2.216 +
   2.217 +`--cache-file=FILE'
   2.218 +     Enable the cache: use and save the results of the tests in FILE,
   2.219 +     traditionally `config.cache'.  FILE defaults to `/dev/null' to
   2.220 +     disable caching.
   2.221 +
   2.222 +`--config-cache'
   2.223 +`-C'
   2.224 +     Alias for `--cache-file=config.cache'.
   2.225 +
   2.226 +`--quiet'
   2.227 +`--silent'
   2.228 +`-q'
   2.229 +     Do not print messages saying which checks are being made.  To
   2.230 +     suppress all normal output, redirect it to `/dev/null' (any error
   2.231 +     messages will still be shown).
   2.232 +
   2.233 +`--srcdir=DIR'
   2.234 +     Look for the package's source code in directory DIR.  Usually
   2.235 +     `configure' can determine that directory automatically.
   2.236 +
   2.237 +`configure' also accepts some other, not widely useful, options.  Run
   2.238 +`configure --help' for more details.
   2.239 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/gmyth-dbus/Makefile.am	Thu Oct 25 15:40:47 2007 +0100
     3.3 @@ -0,0 +1,7 @@
     3.4 +SUBDIRS = src data
     3.5 +
     3.6 +EXTRA_DIST = 			\
     3.7 +	ChangeLog
     3.8 +	
     3.9 +DIST_SUBDIRS = 			\
    3.10 +	src data
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/gmyth-dbus/autogen.sh	Thu Oct 25 15:40:47 2007 +0100
     4.3 @@ -0,0 +1,19 @@
     4.4 +#!/bin/sh
     4.5 +# Run this to generate all the initial makefiles, etc.
     4.6 +
     4.7 +srcdir=`dirname $0`
     4.8 +test -z "$srcdir" && srcdir=.
     4.9 +
    4.10 +PKG_NAME="gmythdbus"
    4.11 +
    4.12 +(test -f $srcdir/configure.ac) || {
    4.13 +    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
    4.14 +    echo " top-level $PKG_NAME directory"
    4.15 +    exit 1
    4.16 +}
    4.17 +
    4.18 +which gnome-autogen.sh || {
    4.19 +    echo "You need to install gnome-common from the GNOME CVS"
    4.20 +    exit 1
    4.21 +}
    4.22 +REQUIRED_AUTOMAKE_VERSION=1.9 USE_GNOME2_MACROS=1 . gnome-autogen.sh
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/gmyth-dbus/configure.ac	Thu Oct 25 15:40:47 2007 +0100
     5.3 @@ -0,0 +1,90 @@
     5.4 +#                                               -*- Autoconf -*-
     5.5 +# Process this file with autoconf to produce a configure script.
     5.6 +
     5.7 +AC_PREREQ(2.50)
     5.8 +
     5.9 +AC_INIT([myth-dbus],[0.1])
    5.10 +
    5.11 +AC_CONFIG_MACRO_DIR([m4])
    5.12 +AC_CONFIG_HEADER(config.h)
    5.13 +
    5.14 +dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
    5.15 +AM_MAINTAINER_MODE
    5.16 +dnl make aclocal work in maintainer mode
    5.17 +AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
    5.18 +
    5.19 +AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
    5.20 +
    5.21 +# Checks for programs.
    5.22 +# check for tools
    5.23 +# Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
    5.24 +CFLAGS="$CFLAGS -Wall"
    5.25 +AC_PROG_CC
    5.26 +AC_PROG_LIBTOOL
    5.27 +
    5.28 +# Checks for libraries.
    5.29 +
    5.30 +# Checks for header files.
    5.31 +AC_HEADER_STDC
    5.32 +
    5.33 +#Test if --disable-debug given
    5.34 +AC_ARG_ENABLE(debug,
    5.35 +    AC_HELP_STRING([--disable-debug], [enable debugging mode]))
    5.36 +if test x"$enable_debug" != xno; then
    5.37 +    CFLAGS="$CFLAGS -g -DMYTH_STREAM_USE_DEBUG"
    5.38 +else
    5.39 +    CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS"
    5.40 +fi
    5.41 +
    5.42 +
    5.43 +AS_AC_EXPAND(DATADIR, $datadir)
    5.44 +
    5.45 +DBUS_SERVICES_DIR="$DATADIR/dbus-1/services"
    5.46 +AC_SUBST(DBUS_SERVICES_DIR)
    5.47 +AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for DBUS is])
    5.48 +
    5.49 +
    5.50 +# Checks required packages ####################################################
    5.51 +###############################################################################
    5.52 +
    5.53 +AC_PATH_PROG(DBUSBINDINGTOOL, dbus-binding-tool, no)
    5.54 +if test "x$DBUSBINDINGTOOL" = "xno"; then
    5.55 +    AC_MSG_ERROR([dbus-binding-tool not found in your PATH. Please correct this])
    5.56 +fi
    5.57 +AC_SUBST(DBUS_BINDING_TOOL)
    5.58 +
    5.59 +AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
    5.60 +if test "x$HAVE_PKGCONFIG" = "xno"; then
    5.61 +  AC_MSG_ERROR(you need to have pkgconfig installed !)
    5.62 +fi
    5.63 +
    5.64 +PKG_CHECK_MODULES(DBUS, dbus-glib-1, HAVE_DBUS=yes, HAVE_DBUS=no)
    5.65 +if test "x$HAVE_DBUS" = "xno"; then
    5.66 +  AC_MSG_ERROR(you need dbus-glib-1-dev installed)
    5.67 +fi
    5.68 +AC_SUBST(DBUS_CFLAGS)
    5.69 +AC_SUBST(DBUS_LIBS)
    5.70 +
    5.71 +PKG_CHECK_MODULES(GMYTH, gmyth, HAVE_GMYTH=yes, HAVE_GMYTH=no)
    5.72 +if test "x$HAVE_GMYTH" = "xno"; then
    5.73 +  AC_MSG_ERROR(you need libgmyth-dev installed)
    5.74 +fi
    5.75 +AC_SUBST(GMYTH_CFLAGS)
    5.76 +AC_SUBST(GMYTH_LIBS)
    5.77 +
    5.78 +AC_SUBST(CFLAGS)
    5.79 +AC_SUBST(LDFLAGS)
    5.80 +AC_SUBST(LIBS)
    5.81 +
    5.82 +AC_OUTPUT([
    5.83 +Makefile
    5.84 +src/Makefile
    5.85 +data/Makefile
    5.86 +data/br.org.indt.GMyth.service
    5.87 +])
    5.88 +
    5.89 +if test "x$enable_debug" != "xno"; then
    5.90 +    AC_MSG_NOTICE([Debug: Enabled])
    5.91 +else
    5.92 +    AC_MSG_NOTICE([Debug: Disabled])
    5.93 +fi
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/gmyth-dbus/data/Makefile.am	Thu Oct 25 15:40:47 2007 +0100
     6.3 @@ -0,0 +1,3 @@
     6.4 +# Dbus service file
     6.5 +servicedir = $(DBUS_SERVICES_DIR)
     6.6 +service_DATA = br.org.indt.GMyth.service
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/gmyth-dbus/data/br.org.indt.GMyth.service.in	Thu Oct 25 15:40:47 2007 +0100
     7.3 @@ -0,0 +1,3 @@
     7.4 +[D-BUS Service]
     7.5 +Name=br.org.indt.GMyth
     7.6 +Exec=@prefix@/bin/gmythdbus
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/gmyth-dbus/m4/as-expand.m4	Thu Oct 25 15:40:47 2007 +0100
     8.3 @@ -0,0 +1,40 @@
     8.4 +dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
     8.5 +dnl
     8.6 +dnl example
     8.7 +dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
     8.8 +dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
     8.9 +
    8.10 +AC_DEFUN([AS_AC_EXPAND],
    8.11 +[
    8.12 +  EXP_VAR=[$1]
    8.13 +  FROM_VAR=[$2]
    8.14 +
    8.15 +  dnl first expand prefix and exec_prefix if necessary
    8.16 +  prefix_save=$prefix
    8.17 +  exec_prefix_save=$exec_prefix
    8.18 +
    8.19 +  dnl if no prefix given, then use /usr/local, the default prefix
    8.20 +  if test "x$prefix" = "xNONE"; then
    8.21 +    prefix=$ac_default_prefix
    8.22 +  fi
    8.23 +  dnl if no exec_prefix given, then use prefix
    8.24 +  if test "x$exec_prefix" = "xNONE"; then
    8.25 +    exec_prefix=$prefix
    8.26 +  fi
    8.27 +
    8.28 +  full_var="$FROM_VAR"
    8.29 +  dnl loop until it doesn't change anymore
    8.30 +  while true; do
    8.31 +    new_full_var="`eval echo $full_var`"
    8.32 +    if test "x$new_full_var"="x$full_var"; then break; fi
    8.33 +    full_var=$new_full_var
    8.34 +  done
    8.35 +
    8.36 +  dnl clean up
    8.37 +  full_var=$new_full_var
    8.38 +  AC_SUBST([$1], "$full_var")
    8.39 +
    8.40 +  dnl restore prefix and exec_prefix
    8.41 +  prefix=$prefix_save
    8.42 +  exec_prefix=$exec_prefix_save
    8.43 +])
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/gmyth-dbus/src/Makefile.am	Thu Oct 25 15:40:47 2007 +0100
     9.3 @@ -0,0 +1,24 @@
     9.4 +bin_PROGRAMS = \
     9.5 +	gmythdbus
     9.6 +
     9.7 +gmythdbus_SOURCES = \
     9.8 +	gmyth-dbus-server.h \
     9.9 +	gmyth-dbus-server.c \
    9.10 +	main.c
    9.11 +
    9.12 +gmythdbus_LDADD = \
    9.13 +	$(DBUS_LIBS) \
    9.14 +	$(GMYTH_LIBS)
    9.15 +
    9.16 +AM_CPPFLAGS = \
    9.17 +	$(DBUS_CFLAGS) \
    9.18 +	$(GMYTH_CFLAGS)
    9.19 +
    9.20 +BUILT_SOURCES = \
    9.21 +	gmyth-dbus-server-glue.h
    9.22 +
    9.23 +gmyth-dbus-server-glue.h: gmyth-dbus-server.xml
    9.24 +	@DBUSBINDINGTOOL@ --mode=glib-server --prefix=gmyth_dbus_server --output=gmyth-dbus-server-glue.h  gmyth-dbus-server.xml
    9.25 +
    9.26 +CLEANFILES = \
    9.27 +	$(BUILT_SOURCES)
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/gmyth-dbus/src/gmyth-dbus-common.h	Thu Oct 25 15:40:47 2007 +0100
    10.3 @@ -0,0 +1,57 @@
    10.4 +#ifndef __GMYTH_DBUS_COMMON_H__
    10.5 +#define __GMYTH_DBUS_COMMON_H__
    10.6 +
    10.7 +#define GMYTH_DBUS_SERVER_NAME      "br.org.indt.GMyth"
    10.8 +#define GMYTH_DBUS_SERVER_PATH      "/br/org/indt/GMyth"
    10.9 +#define GMYTH_DBUS_SERVER_IFACE     "br.org.indt.GMyth"
   10.10 +
   10.11 +#define GMYTH_DBUS_PROGRAM_G_TYPE \
   10.12 +    dbus_g_type_get_struct ("GValueArray", \
   10.13 +                            G_TYPE_STRING, \
   10.14 +                            G_TYPE_STRING, \
   10.15 +                            G_TYPE_STRING, \
   10.16 +                            G_TYPE_STRING, \
   10.17 +                            G_TYPE_STRING, \
   10.18 +                            G_TYPE_STRING, \
   10.19 +                            G_TYPE_STRING, \
   10.20 +                            G_TYPE_INVALID);
   10.21 +
   10.22 +#define GMYTH_DBUS_CHANNEL_G_TYPE \
   10.23 +    dbus_g_type_get_struct ("GValueArray", \
   10.24 +                            G_TYPE_INT, \
   10.25 +                            G_TYPE_STRING, \
   10.26 +                            G_TYPE_STRING, \
   10.27 +                            G_TYPE_STRING, \
   10.28 +                            G_TYPE_INVALID);
   10.29 +
   10.30 +#define GMYTH_DBUS_RECORD_G_TYPE \
   10.31 +    dbus_g_type_get_struct ("GValueArray", \
   10.32 +                            G_TYPE_UINT, \
   10.33 +                            G_TYPE_UINT, \
   10.34 +                            G_TYPE_UINT, \
   10.35 +                            G_TYPE_STRING, \
   10.36 +                            G_TYPE_STRING, \
   10.37 +                            G_TYPE_STRING, \
   10.38 +                            G_TYPE_STRING, \
   10.39 +                            G_TYPE_STRING, \
   10.40 +                            G_TYPE_STRING, \
   10.41 +                            G_TYPE_STRING, \
   10.42 +                            G_TYPE_UINT64, \
   10.43 +                            G_TYPE_INVALID);
   10.44 +
   10.45 +#define GMYTH_DBUS_SCHEDULE_G_TYPE \
   10.46 +    dbus_g_type_get_struct ("GValueArray", \
   10.47 +                            G_TYPE_UINT, \
   10.48 +                            G_TYPE_UINT, \
   10.49 +                            G_TYPE_UINT, \
   10.50 +                            G_TYPE_STRING, \
   10.51 +                            G_TYPE_STRING, \
   10.52 +                            G_TYPE_STRING, \
   10.53 +                            G_TYPE_STRING, \
   10.54 +                            G_TYPE_STRING, \
   10.55 +                            G_TYPE_STRING, \
   10.56 +                            G_TYPE_UINT, \
   10.57 +                            G_TYPE_INVALID);
   10.58 +
   10.59 +#endif
   10.60 +
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/gmyth-dbus/src/gmyth-dbus-server.c	Thu Oct 25 15:40:47 2007 +0100
    11.3 @@ -0,0 +1,1029 @@
    11.4 +/**
    11.5 + * GMyth Library
    11.6 + *
    11.7 + * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    11.8 + * @author Renato Filho  <renato.filho@indt.org.br>
    11.9 + *
   11.10 + *
   11.11 + * This program is free software; you can redistribute it and/or modify
   11.12 + * it under the terms of the GNU Lesser General Public License as published by
   11.13 + * the Free Software Foundation; either version 2 of the License, or
   11.14 + * (at your option) any later version.
   11.15 + *
   11.16 + * This program is distributed in the hope that it will be useful,
   11.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   11.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   11.19 + * GNU General Public License for more details.
   11.20 + *
   11.21 + * You should have received a copy of the GNU Lesser General Public License
   11.22 + * along with this program; if not, write to the Free Software
   11.23 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   11.24 + */
   11.25 +
   11.26 +
   11.27 +#ifdef HAVE_CONFIG_H
   11.28 +#include "config.h"
   11.29 +#endif
   11.30 +
   11.31 +
   11.32 +#include <gmyth/gmyth.h>
   11.33 +#include <dbus/dbus-glib-bindings.h>
   11.34 +
   11.35 +
   11.36 +#include "gmyth-dbus-common.h"
   11.37 +#include "gmyth-dbus-server.h"
   11.38 +
   11.39 +#define MYTH_DEFAULT_DB             "mythconverg"
   11.40 +
   11.41 +typedef struct _GMythDbusServerPrivate GMythDbusServerPrivate;
   11.42 +
   11.43 +struct _GMythDbusServerPrivate
   11.44 +{
   11.45 +    GMythBackendInfo *myth_backend;
   11.46 +    GMythEPG         *myth_epg;
   11.47 +    GMythScheduler   *myth_scheduler;
   11.48 +};
   11.49 +
   11.50 +#define GMYTH_DBUS_SERVER_GET_PRIVATE(o) \
   11.51 +    (G_TYPE_INSTANCE_GET_PRIVATE ((o), GMYTH_DBUS_SERVER_TYPE, GMythDbusServerPrivate))
   11.52 +
   11.53 +static void gmyth_dbus_server_class_init (GMythDbusServerClass *klass);
   11.54 +static void gmyth_dbus_server_init       (GMythDbusServer *self);
   11.55 +static void gmyth_dbus_server_dispose    (GObject *object);
   11.56 +static void gmyth_dbus_server_finalize   (GObject *object);
   11.57 +
   11.58 +/* Dbus */
   11.59 +static gboolean gmyth_dbus_server_connect           (GObject *obj,
   11.60 +                                                     const gchar *host,
   11.61 +                                                     guint port,
   11.62 +                                                     const gchar *user,
   11.63 +                                                     const gchar *password,
   11.64 +                                                     gboolean *result,
   11.65 +                                                     GError **error);
   11.66 +static gboolean gmyth_dbus_server_get_channel_list  (GObject *obj,
   11.67 +                                                     GPtrArray **channels,
   11.68 +                                                     GError **error);
   11.69 +static gboolean gmyth_dbus_server_get_channel_info  (GObject *obj,
   11.70 +                                                     gint channel_id,
   11.71 +                                                     GValueArray **info,
   11.72 +                                                     GError **error);
   11.73 +static gboolean gmyth_dbus_server_file_exists       (GObject *obj,
   11.74 +                                                     const gchar *file_name,
   11.75 +                                                     gboolean *exists,
   11.76 +                                                     GError **error);
   11.77 +static gboolean gmyth_dbus_server_get_recorded_list (GObject *obj,
   11.78 +                                                     GPtrArray **channels,
   11.79 +                                                     GError **error);
   11.80 +static gboolean gmyth_dbus_server_get_recorded_info (GObject *obj,
   11.81 +                                                     const gchar *basename,
   11.82 +                                                     GValueArray **info,
   11.83 +                                                     GError **error);
   11.84 +static gboolean gmyth_dbus_server_get_program_list  (GObject *obj,
   11.85 +                                                     gint channel_id,
   11.86 +                                                     const gchar *start_time,
   11.87 +                                                     const gchar *end_time,
   11.88 +                                                     GPtrArray **program_list);
   11.89 +static gboolean gmyth_dbus_server_get_schedule_list (GObject *obj,
   11.90 +                                                     GPtrArray **schedule_list);
   11.91 +
   11.92 +static gboolean gmyth_dbus_server_connected         (GObject *obj,
   11.93 +                                                     gboolean *status,
   11.94 +                                                     GError **error);
   11.95 +static gboolean gmyth_dbus_server_disconnect        (GObject *obj,
   11.96 +                                                     GError **error);
   11.97 +static gboolean gmyth_dbus_server_get_server_info   (GObject *obj,
   11.98 +                                                     guint64 *total_space,
   11.99 +                                                     guint64 *used_space,
  11.100 +                                                     guint64 *free_space,
  11.101 +                                                     GError **error);
  11.102 +static gboolean gmyth_dbus_server_get_thumbnail     (GObject *obj,
  11.103 +                                                     const gchar *uri,
  11.104 +                                                     GByteArray **image,
  11.105 +                                                     GError **error);
  11.106 +static gboolean gmyth_dbus_server_get_channel_icon  (GObject *obj,
  11.107 +                                                     guint channel_id,
  11.108 +                                                     GByteArray **icon,
  11.109 +                                                     GError **error);
  11.110 +static gboolean gmyth_dbus_server_stop_recording    (GObject *obj,
  11.111 +                                                     guint channel_id,
  11.112 +                                                     gboolean *result,
  11.113 +                                                     GError **error);
  11.114 +static gboolean gmyth_dbus_server_add_schedule      (GObject *obj,
  11.115 +                                                     guint channel_id,
  11.116 +                                                     guint program_id,
  11.117 +                                                     const gchar *start_time,
  11.118 +                                                     const gchar *end_time,
  11.119 +                                                     gboolean recurring,
  11.120 +                                                     const gchar *description,
  11.121 +                                                     guint *schedule_id,
  11.122 +                                                     GError **error);
  11.123 +static gboolean gmyth_dbus_server_add_exception     (GObject *obj,
  11.124 +                                                     guint schedule_id,
  11.125 +                                                     guint channel_id,
  11.126 +                                                     guint program_id,
  11.127 +                                                     const gchar *start_time,
  11.128 +                                                     const gchar *end_time,
  11.129 +                                                     const gchar *description,
  11.130 +                                                     GError **error);
  11.131 +static gboolean gmyth_dbus_server_remove_schedule   (GObject *obj,
  11.132 +                                                     guint schedule_id,
  11.133 +                                                     GError **error);
  11.134 +
  11.135 +
  11.136 +#include "gmyth-dbus-server-glue.h"
  11.137 +
  11.138 +
  11.139 +G_DEFINE_TYPE (GMythDbusServer, gmyth_dbus_server, G_TYPE_OBJECT);
  11.140 +
  11.141 +static void
  11.142 +gmyth_dbus_server_class_init (GMythDbusServerClass *klass)
  11.143 +{
  11.144 +    GObjectClass *object_class = G_OBJECT_CLASS (klass);
  11.145 +
  11.146 +    g_type_class_add_private (klass, sizeof (GMythDbusServerPrivate));
  11.147 +
  11.148 +    object_class->dispose = gmyth_dbus_server_dispose;
  11.149 +    object_class->finalize = gmyth_dbus_server_finalize;
  11.150 +
  11.151 +    dbus_g_object_type_install_info (GMYTH_DBUS_SERVER_TYPE,
  11.152 +                                     &dbus_glib_gmyth_dbus_server_object_info);
  11.153 +}
  11.154 +
  11.155 +static void
  11.156 +gmyth_dbus_server_init (GMythDbusServer *self)
  11.157 +{
  11.158 +}
  11.159 +
  11.160 +static void
  11.161 +gmyth_dbus_server_dispose (GObject *object)
  11.162 +{
  11.163 +    G_OBJECT_CLASS (gmyth_dbus_server_parent_class)->dispose (object);
  11.164 +}
  11.165 +
  11.166 +static void
  11.167 +gmyth_dbus_server_finalize (GObject *object)
  11.168 +{
  11.169 +    G_OBJECT_CLASS (gmyth_dbus_server_parent_class)->finalize (object);
  11.170 +}
  11.171 +
  11.172 +static gboolean
  11.173 +gmyth_dbus_server_connect_epg (GMythDbusServer *server)
  11.174 +{
  11.175 +    GMythDbusServerPrivate *priv;
  11.176 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (server);
  11.177 +
  11.178 +    if (!priv->myth_epg)
  11.179 +    {
  11.180 +        priv->myth_epg = gmyth_epg_new();
  11.181 +        if (!gmyth_epg_connect (priv->myth_epg, priv->myth_backend))
  11.182 +        {
  11.183 +            g_object_unref (priv->myth_epg);
  11.184 +            priv->myth_epg = NULL;
  11.185 +            return FALSE;
  11.186 +        }
  11.187 +    }
  11.188 +
  11.189 +    return TRUE;
  11.190 +}
  11.191 +
  11.192 +static gboolean
  11.193 +gmyth_dbus_server_connect_scheduler (GMythDbusServer *server)
  11.194 +{
  11.195 +    GMythDbusServerPrivate *priv;
  11.196 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (server);
  11.197 +
  11.198 +    if (!priv->myth_scheduler)
  11.199 +    {
  11.200 +        priv->myth_scheduler = gmyth_scheduler_new ();
  11.201 +        if (!gmyth_scheduler_connect (priv->myth_scheduler,
  11.202 +                                      priv->myth_backend))
  11.203 +        {
  11.204 +            g_object_unref (priv->myth_scheduler);
  11.205 +            priv->myth_scheduler = NULL;
  11.206 +            return FALSE;
  11.207 +        }
  11.208 +    }
  11.209 +
  11.210 +    return TRUE;
  11.211 +}
  11.212 +
  11.213 +static gboolean
  11.214 +gmyth_dbus_server_connect  (GObject *obj,
  11.215 +                            const gchar *host,
  11.216 +                            guint port,
  11.217 +                            const gchar *user,
  11.218 +                            const gchar *password,
  11.219 +                            gboolean *result,
  11.220 +                            GError **error)
  11.221 +{
  11.222 +    GMythDbusServerPrivate *priv;
  11.223 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  11.224 +
  11.225 +    if (priv->myth_backend)
  11.226 +        return TRUE;
  11.227 +
  11.228 +    priv->myth_backend = gmyth_backend_info_new_full (host,
  11.229 +                                                      user,
  11.230 +                                                      password,
  11.231 +                                                      MYTH_DEFAULT_DB,
  11.232 +                                                      port);
  11.233 +    *result = TRUE;
  11.234 +    return TRUE;
  11.235 +}
  11.236 +
  11.237 +static gboolean
  11.238 +gmyth_dbus_server_connected (GObject *obj,
  11.239 +                             gboolean *status,
  11.240 +                             GError **error)
  11.241 +{
  11.242 +    GMythDbusServerPrivate *priv;
  11.243 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  11.244 +
  11.245 +    if (priv->myth_backend)
  11.246 +        *status = TRUE;
  11.247 +    else
  11.248 +        *status = FALSE;
  11.249 +    return TRUE;
  11.250 +}
  11.251 +
  11.252 +static gboolean
  11.253 +gmyth_dbus_server_disconnect (GObject *obj,
  11.254 +                              GError **error)
  11.255 +{
  11.256 +    GMythDbusServerPrivate *priv;
  11.257 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  11.258 +
  11.259 +    if (priv->myth_epg)
  11.260 +    {
  11.261 +        g_object_unref (priv->myth_epg);
  11.262 +        priv->myth_epg = NULL;
  11.263 +    }
  11.264 +
  11.265 +
  11.266 +    if (priv->myth_backend)
  11.267 +    {
  11.268 +        g_object_unref (priv->myth_backend);
  11.269 +        priv->myth_backend = NULL;
  11.270 +    }
  11.271 +
  11.272 +    if (priv->myth_scheduler)
  11.273 +    {
  11.274 +        g_object_unref (priv->myth_scheduler);
  11.275 +        priv->myth_scheduler = NULL;
  11.276 +    }
  11.277 +
  11.278 +
  11.279 +    return TRUE;
  11.280 +}
  11.281 +
  11.282 +static gboolean
  11.283 +gmyth_dbus_server_get_server_info (GObject *obj,
  11.284 +                                   guint64 *total_space,
  11.285 +                                   guint64 *used_space,
  11.286 +                                   guint64 *free_space,
  11.287 +                                   GError **error)
  11.288 +{
  11.289 +    GMythBackendDetails *details;
  11.290 +    GMythDbusServerPrivate *priv;
  11.291 +    gboolean ret = FALSE;
  11.292 +    GMythSocket *socket;
  11.293 +
  11.294 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  11.295 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  11.296 +
  11.297 +    g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
  11.298 +
  11.299 +    socket = gmyth_backend_info_get_connected_socket (priv->myth_backend);
  11.300 +
  11.301 +    details = NULL;
  11.302 +    gmyth_util_get_backend_details (socket,
  11.303 +                                    &details);
  11.304 +    if (details)
  11.305 +    {
  11.306 +        *total_space = details->total_space;
  11.307 +        *used_space = details->used_space;
  11.308 +        *free_space = *total_space - *used_space;
  11.309 +        gmyth_util_backend_details_free (details);
  11.310 +
  11.311 +        ret = TRUE;
  11.312 +    }
  11.313 +
  11.314 +    g_object_unref (socket);
  11.315 +
  11.316 +    return ret;
  11.317 +}
  11.318 +
  11.319 +
  11.320 +static void
  11.321 +gmyth_dbus_server_parse_channel_info (GMythChannelInfo *info,
  11.322 +                                      GValue *val)
  11.323 +{
  11.324 +    dbus_g_type_struct_set (val,
  11.325 +                            0, info->channel_ID,
  11.326 +                            1, info->channel_num->str,
  11.327 +                            2, info->channel_name->str,
  11.328 +                            3, info->channel_icon->str,
  11.329 +                            G_MAXUINT);
  11.330 +}
  11.331 +
  11.332 +static gboolean 
  11.333 +gmyth_dbus_server_get_channel_info  (GObject *obj,
  11.334 +                                     gint channel_id,
  11.335 +                                     GValueArray **info,
  11.336 +                                     GError **error)
  11.337 +{
  11.338 +    GType ch_type;
  11.339 +    GMythChannelInfo *ch_info;
  11.340 +    GMythDbusServerPrivate *priv;
  11.341 +
  11.342 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  11.343 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  11.344 +
  11.345 +    g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
  11.346 +    g_return_val_if_fail (gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)), FALSE);
  11.347 +
  11.348 +    ch_type = GMYTH_DBUS_CHANNEL_G_TYPE;
  11.349 +
  11.350 +    ch_info = gmyth_epg_get_channel_info (priv->myth_epg, channel_id);
  11.351 +    if (ch_info)
  11.352 +    {
  11.353 +        GValue v = { 0, };
  11.354 +        g_value_init (&v, ch_type);
  11.355 +        g_value_take_boxed (&v, dbus_g_type_specialized_construct (ch_type));
  11.356 +        gmyth_dbus_server_parse_channel_info (ch_info, &v);
  11.357 +
  11.358 +        *info = g_value_get_boxed (&v);
  11.359 +        return TRUE;
  11.360 +    }
  11.361 +
  11.362 +    return FALSE;
  11.363 +}
  11.364 +
  11.365 +
  11.366 +static gboolean
  11.367 +gmyth_dbus_server_get_channel_list (GObject *obj,
  11.368 +                                    GPtrArray **channels,
  11.369 +                                    GError **error)
  11.370 +{
  11.371 +    GList *lst;
  11.372 +    GList *walk;
  11.373 +    int len;
  11.374 +    GType ch_type;
  11.375 +    GMythDbusServerPrivate *priv;
  11.376 +
  11.377 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  11.378 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  11.379 +
  11.380 +    g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
  11.381 +    g_return_val_if_fail (gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)), FALSE);
  11.382 +
  11.383 +
  11.384 +    len = gmyth_epg_get_channel_list (priv->myth_epg, &lst);
  11.385 +
  11.386 +    *channels = g_ptr_array_sized_new (len);
  11.387 +    ch_type = GMYTH_DBUS_CHANNEL_G_TYPE;
  11.388 +
  11.389 +    for (walk = lst; walk != NULL; walk = walk->next)
  11.390 +    {
  11.391 +        GValue ch = { 0, };
  11.392 +        GMythChannelInfo *data;
  11.393 +
  11.394 +        data = (GMythChannelInfo *) walk->data;
  11.395 +
  11.396 +        g_value_init (&ch, ch_type);
  11.397 +        g_value_take_boxed (&ch, dbus_g_type_specialized_construct (ch_type));
  11.398 +        gmyth_dbus_server_parse_channel_info (data, &ch);
  11.399 +        g_ptr_array_add (*channels, g_value_get_boxed (&ch));
  11.400 +    }
  11.401 +
  11.402 +    gmyth_free_channel_list (lst);
  11.403 +    return TRUE;
  11.404 +}
  11.405 +
  11.406 +static gboolean
  11.407 +gmyth_dbus_server_file_exists (GObject *obj,
  11.408 +                               const gchar *file_name,
  11.409 +                               gboolean *exists,
  11.410 +                               GError **error)
  11.411 +{
  11.412 +    GMythDbusServerPrivate *priv;
  11.413 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  11.414 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  11.415 +
  11.416 +    g_return_val_if_fail (priv->myth_backend, FALSE);
  11.417 +
  11.418 +    *exists = gmyth_util_file_exists (priv->myth_backend, file_name);
  11.419 +
  11.420 +    return TRUE;
  11.421 +}
  11.422 +
  11.423 +static gboolean
  11.424 +gmyth_dbus_server_get_program_list (GObject *obj,
  11.425 +                                    gint channel_id,
  11.426 +                                    const gchar *start_time,
  11.427 +                                    const gchar *end_time,
  11.428 +                                    GPtrArray **programs)
  11.429 +{
  11.430 +    GList *list;
  11.431 +    GList *walk;
  11.432 +    gint len;
  11.433 +    GType program_type;
  11.434 +    GTimeVal start_time_val;
  11.435 +    GTimeVal end_time_val;
  11.436 +    GMythDbusServerPrivate *priv;
  11.437 +
  11.438 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  11.439 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  11.440 +
  11.441 +    g_return_val_if_fail (priv->myth_backend, FALSE);
  11.442 +    g_return_val_if_fail (gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)), FALSE);
  11.443 +
  11.444 +    g_time_val_from_iso8601 (start_time, &start_time_val);
  11.445 +    g_time_val_from_iso8601 (end_time, &end_time_val);
  11.446 +
  11.447 +    list = NULL;
  11.448 +    len = gmyth_epg_get_program_list (priv->myth_epg,
  11.449 +                                      &list,
  11.450 +                                      channel_id,
  11.451 +                                      &start_time_val,
  11.452 +                                      &end_time_val);
  11.453 +
  11.454 +    *programs = g_ptr_array_sized_new (len);
  11.455 +    program_type = GMYTH_DBUS_PROGRAM_G_TYPE;
  11.456 +
  11.457 +    for (walk = list; walk != NULL; walk = walk->next)
  11.458 +    {
  11.459 +        GValue program = { 0, };
  11.460 +        gchar *start_str;
  11.461 +        gchar *end_str;
  11.462 +        GMythProgramInfo *data;
  11.463 +
  11.464 +        data = (GMythProgramInfo *) walk->data;
  11.465 +
  11.466 +        if (!data)
  11.467 +            continue;
  11.468 +
  11.469 +        g_value_init (&program, program_type);
  11.470 +        g_value_take_boxed (&program,
  11.471 +                            dbus_g_type_specialized_construct (program_type));
  11.472 +
  11.473 +        start_str = g_time_val_to_iso8601 (data->startts);
  11.474 +        end_str = g_time_val_to_iso8601 (data->endts);
  11.475 +
  11.476 +        dbus_g_type_struct_set (&program,
  11.477 +                                0, data->chanid->str,
  11.478 +                                1, start_str,
  11.479 +                                2, end_str,
  11.480 +                                3, data->title->str,
  11.481 +                                4, data->subtitle->str,
  11.482 +                                5, data->description->str,
  11.483 +                                6, data->category->str,
  11.484 +                                G_MAXUINT);
  11.485 +
  11.486 +        g_ptr_array_add (*programs, g_value_get_boxed (&program));
  11.487 +        g_free (start_str);
  11.488 +        g_free (end_str);
  11.489 +    }
  11.490 +
  11.491 +    if (list)
  11.492 +        gmyth_free_program_list (list);
  11.493 +
  11.494 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  11.495 +    return TRUE;
  11.496 +}
  11.497 +
  11.498 +static void
  11.499 +gmyth_dbus_server_parse_recorded_info (RecordedInfo *info,
  11.500 +                                       GValue *val)
  11.501 +{
  11.502 +    gchar *start_str;
  11.503 +    gchar *end_str;
  11.504 +
  11.505 +    start_str = g_time_val_to_iso8601 (info->start_time);
  11.506 +    end_str = g_time_val_to_iso8601 (info->end_time);
  11.507 +
  11.508 +    dbus_g_type_struct_set (val,
  11.509 +                            0, info->record_id,
  11.510 +                            1, info->program_id,
  11.511 +                            2, info->channel_id,
  11.512 +                            3, start_str,
  11.513 +                            4, end_str,
  11.514 +                            5, info->title->str,
  11.515 +                            6, info->subtitle->str,
  11.516 +                            7, info->description->str,
  11.517 +                            8, info->category->str,
  11.518 +                            9, info->basename->str,
  11.519 +                            10, info->filesize,
  11.520 +                            G_MAXUINT);
  11.521 +    g_free (start_str);
  11.522 +    g_free (end_str);
  11.523 +}
  11.524 +
  11.525 +static gboolean
  11.526 +gmyth_dbus_server_get_recorded_info (GObject *obj,
  11.527 +                                     const gchar *basename,
  11.528 +                                     GValueArray **info,
  11.529 +                                     GError **error)
  11.530 +{
  11.531 +    GType record_type;
  11.532 +    GMythDbusServerPrivate *priv;
  11.533 +    RecordedInfo *record_info;
  11.534 +
  11.535 +
  11.536 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  11.537 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  11.538 +
  11.539 +    g_return_val_if_fail (priv->myth_backend, FALSE);
  11.540 +    g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
  11.541 +
  11.542 +    record_type = GMYTH_DBUS_RECORD_G_TYPE;
  11.543 +
  11.544 +    record_info = gmyth_scheduler_get_recorded_info (priv->myth_scheduler,
  11.545 +                                                     basename);
  11.546 +
  11.547 +    if (record_info)
  11.548 +    {
  11.549 +        GValue r = { 0, };
  11.550 +
  11.551 +        g_value_init (&r, record_type);
  11.552 +        g_value_take_boxed (&r,
  11.553 +                            dbus_g_type_specialized_construct (record_type));
  11.554 +
  11.555 +        gmyth_dbus_server_parse_recorded_info (record_info, &r);
  11.556 +        gmyth_recorded_info_free (record_info);
  11.557 +
  11.558 +        *info = g_value_get_boxed (&r);
  11.559 +
  11.560 +        return TRUE;
  11.561 +    }
  11.562 +
  11.563 +    return FALSE;
  11.564 +}
  11.565 +
  11.566 +
  11.567 +static gboolean
  11.568 +gmyth_dbus_server_get_recorded_list (GObject *obj,
  11.569 +                                     GPtrArray **records,
  11.570 +                                     GError **error)
  11.571 +{
  11.572 +    GList *list;
  11.573 +    GList *walk;
  11.574 +    gint len;
  11.575 +    GType record_type;
  11.576 +    GMythDbusServerPrivate *priv;
  11.577 +
  11.578 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  11.579 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  11.580 +
  11.581 +    g_return_val_if_fail (priv->myth_backend, FALSE);
  11.582 +    g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
  11.583 +
  11.584 +
  11.585 +    len = gmyth_scheduler_get_recorded_list (priv->myth_scheduler,
  11.586 +                                             &list);
  11.587 +
  11.588 +    record_type = GMYTH_DBUS_RECORD_G_TYPE;
  11.589 +    *records = g_ptr_array_sized_new (len);
  11.590 +
  11.591 +    for (walk = list; walk != NULL; walk = walk->next)
  11.592 +    {
  11.593 +        GValue record = { 0, };
  11.594 +        RecordedInfo *data;
  11.595 +
  11.596 +        data = (RecordedInfo *) walk->data;
  11.597 +
  11.598 +        g_value_init (&record, record_type);
  11.599 +        g_value_take_boxed (&record,
  11.600 +                            dbus_g_type_specialized_construct (record_type));
  11.601 +
  11.602 +        gmyth_dbus_server_parse_recorded_info (data, &record);
  11.603 +
  11.604 +        g_ptr_array_add (*records, g_value_get_boxed (&record));
  11.605 +        //g_value_unset (&record);
  11.606 +    }
  11.607 +
  11.608 +    gmyth_recorded_info_list_free (list);
  11.609 +
  11.610 +    return TRUE;
  11.611 +
  11.612 +}
  11.613 +
  11.614 +static gboolean
  11.615 +gmyth_dbus_server_get_schedule_list (GObject *obj,
  11.616 +                                     GPtrArray **schedules)
  11.617 +{
  11.618 +    GList *list;
  11.619 +    GList *walk;
  11.620 +    gint len;
  11.621 +    GType schedule_type;
  11.622 +    GMythDbusServerPrivate *priv;
  11.623 +
  11.624 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  11.625 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  11.626 +
  11.627 +    g_return_val_if_fail (priv->myth_backend, FALSE);
  11.628 +    g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
  11.629 +
  11.630 +
  11.631 +    len = gmyth_scheduler_get_schedule_list (priv->myth_scheduler,
  11.632 +                                             &list);
  11.633 +
  11.634 +    *schedules = g_ptr_array_sized_new (len);
  11.635 +    schedule_type = GMYTH_DBUS_SCHEDULE_G_TYPE;
  11.636 +
  11.637 +    for (walk = list; walk != NULL; walk = walk->next)
  11.638 +    {
  11.639 +        GValue schedule = { 0, };
  11.640 +        ScheduleInfo *data;
  11.641 +        gchar *start_str_time;
  11.642 +        gchar *end_str_time;
  11.643 +
  11.644 +        data = (ScheduleInfo *) walk->data;
  11.645 +
  11.646 +        g_value_init (&schedule, schedule_type);
  11.647 +        g_value_take_boxed (&schedule,
  11.648 +                            dbus_g_type_specialized_construct (schedule_type));
  11.649 +
  11.650 +        start_str_time = g_time_val_to_iso8601 (data->start_time);
  11.651 +        end_str_time = g_time_val_to_iso8601 (data->end_time);
  11.652 +
  11.653 +        dbus_g_type_struct_set (&schedule,
  11.654 +                            0, data->schedule_id,
  11.655 +                            1, data->program_id,
  11.656 +                            2, data->channel_id,
  11.657 +                            3, start_str_time,
  11.658 +                            4, end_str_time,
  11.659 +                            5, data->title->str,
  11.660 +                            6, data->subtitle->str,
  11.661 +                            7, data->description->str,
  11.662 +                            8, data->category->str,
  11.663 +                            9, data->type,
  11.664 +                            G_MAXUINT);
  11.665 +
  11.666 +        g_ptr_array_add (*schedules, g_value_get_boxed (&schedule));
  11.667 +
  11.668 +        g_free (start_str_time);
  11.669 +        g_free (end_str_time);
  11.670 +    }
  11.671 +
  11.672 +    gmyth_schedule_info_list_free (list);
  11.673 +
  11.674 +    return TRUE;
  11.675 +}
  11.676 +
  11.677 +
  11.678 +static gboolean
  11.679 +gmyth_dbus_server_get_thumbnail (GObject *obj,
  11.680 +                                const gchar *uri,
  11.681 +                                GByteArray **image,
  11.682 +                                GError **error)
  11.683 +{
  11.684 +    GMythFileTransfer *file_transfer;
  11.685 +    glong filesize;
  11.686 +    GMythFileReadResult result;
  11.687 +    GMythDbusServerPrivate *priv;
  11.688 +
  11.689 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  11.690 +
  11.691 +    g_return_val_if_fail (priv->myth_backend, FALSE);
  11.692 +
  11.693 +    if (!gmyth_util_file_exists (priv->myth_backend, uri))
  11.694 +        goto fail;
  11.695 +
  11.696 +    file_transfer = gmyth_file_transfer_new (priv->myth_backend);
  11.697 +
  11.698 +    if (!gmyth_file_transfer_open (file_transfer, uri))
  11.699 +        goto fail;
  11.700 +
  11.701 +    filesize = gmyth_file_transfer_get_filesize (file_transfer);
  11.702 +    if (filesize <= 0)
  11.703 +        goto fail;
  11.704 +
  11.705 +    *image = g_byte_array_new ();
  11.706 +    result = gmyth_file_transfer_read (file_transfer, *image, filesize, FALSE);
  11.707 +    if (result == GMYTH_FILE_READ_ERROR)
  11.708 +       goto fail;
  11.709 +
  11.710 +    gmyth_file_transfer_close (file_transfer);
  11.711 +    g_object_unref (file_transfer);
  11.712 +
  11.713 +    if (filesize > (*image)->len)
  11.714 +        goto fail;
  11.715 +
  11.716 +    return TRUE;
  11.717 +
  11.718 +fail:
  11.719 +    if (*image)
  11.720 +        g_byte_array_free (*image, TRUE);
  11.721 +    g_object_unref(file_transfer);
  11.722 +    return FALSE;
  11.723 +}
  11.724 +
  11.725 +static gboolean
  11.726 +gmyth_dbus_server_get_channel_icon (GObject *obj,
  11.727 +                                    guint channel_id,
  11.728 +                                    GByteArray **icon,
  11.729 +                                    GError **error)
  11.730 +{
  11.731 +    GMythChannelInfo *channel = NULL;
  11.732 +    guint8 *icon_data;
  11.733 +    guint icon_length;
  11.734 +    GMythDbusServerPrivate *priv;
  11.735 +
  11.736 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  11.737 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  11.738 +    g_return_val_if_fail (priv->myth_backend, FALSE);
  11.739 +
  11.740 +    channel = gmyth_epg_get_channel_info (priv->myth_epg,
  11.741 +                                         (gint) channel_id);
  11.742 +
  11.743 +    *icon = NULL;
  11.744 +
  11.745 +    if (channel == NULL)
  11.746 +        return FALSE;
  11.747 +
  11.748 +    if (!gmyth_epg_channel_has_icon(priv->myth_epg, channel))
  11.749 +    {
  11.750 +        gmyth_channel_info_free (channel);
  11.751 +        g_debug("Channel does not have icon available");
  11.752 +        return FALSE;
  11.753 +    }
  11.754 +
  11.755 +    icon_data = NULL;
  11.756 +    icon_length = 0;
  11.757 +    if (!gmyth_epg_channel_get_icon (priv->myth_epg,
  11.758 +                                     channel,
  11.759 +                                     &icon_data,
  11.760 +                                     &icon_length)) 
  11.761 +    {
  11.762 +        gmyth_channel_info_free (channel);
  11.763 +        g_warning("Could not get channel icon for channel id = %u", channel_id);
  11.764 +        return FALSE;
  11.765 +    }
  11.766 +
  11.767 +    *icon = g_byte_array_sized_new (icon_length);
  11.768 +    *icon = g_byte_array_append (*icon, icon_data, icon_length);
  11.769 +
  11.770 +    g_free (icon_data);
  11.771 +    gmyth_channel_info_free(channel);
  11.772 +    return TRUE;
  11.773 +}
  11.774 +
  11.775 +
  11.776 +static gboolean
  11.777 +gmyth_dbus_server_stop_recording (GObject *obj,
  11.778 +                                  guint channel_id,
  11.779 +                                  gboolean *result,
  11.780 +                                  GError **error)
  11.781 +{
  11.782 +    gboolean ret = FALSE;
  11.783 +    GMythDbusServerPrivate *priv;
  11.784 +
  11.785 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  11.786 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  11.787 +
  11.788 +    g_return_val_if_fail (priv->myth_backend, FALSE);
  11.789 +    g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
  11.790 +
  11.791 +    ret = gmyth_scheduler_stop_recording (priv->myth_scheduler,
  11.792 +                                          channel_id);
  11.793 +
  11.794 +    return ret;
  11.795 +}
  11.796 +
  11.797 +static ScheduleInfo*
  11.798 +gmyth_dbus_server_new_schedule_info (const gchar* description,
  11.799 +                                     guint channel_id,
  11.800 +                                     guint program_id,
  11.801 +                                     GTimeVal *start_vtime,
  11.802 +                                     GTimeVal *end_vtime)
  11.803 +{
  11.804 +    ScheduleInfo   *new_sched_info;
  11.805 +
  11.806 +    new_sched_info = g_new0(ScheduleInfo, 1);
  11.807 +
  11.808 +    /* record_id == -1 for generating a new id */
  11.809 +    new_sched_info->schedule_id = -1;
  11.810 +
  11.811 +    new_sched_info->channel_id = channel_id;
  11.812 +    new_sched_info->program_id = program_id;
  11.813 +    new_sched_info->start_time = g_new0 (GTimeVal, 1);
  11.814 +    *new_sched_info->start_time = *start_vtime;
  11.815 +    new_sched_info->end_time = g_new0 (GTimeVal, 1);
  11.816 +    *new_sched_info->end_time = *end_vtime;
  11.817 +
  11.818 +    /* TODO: there is no frequency field */
  11.819 +    /*new_sched_info->frequency = -1;*/
  11.820 +
  11.821 +    if (description != NULL) {
  11.822 +        /* FIXME: description parameter is used as title and description */
  11.823 +        new_sched_info->title = g_string_new(description);
  11.824 +        new_sched_info->description = g_string_new(description);
  11.825 +    }
  11.826 +
  11.827 +    return new_sched_info;
  11.828 +}
  11.829 +
  11.830 +static gboolean
  11.831 +gmyth_dbus_server_add_schedule (GObject *obj,
  11.832 +                                guint channel_id,
  11.833 +                                guint program_id,
  11.834 +                                const gchar *start_time,
  11.835 +                                const gchar *end_time,
  11.836 +                                gboolean recurring,
  11.837 +                                const gchar *description,
  11.838 +                                guint *schedule_id,
  11.839 +                                GError **error)
  11.840 +{
  11.841 +    ScheduleInfo *sch_info;
  11.842 +    GTimeVal start_vtime;
  11.843 +    GTimeVal end_vtime;
  11.844 +    GMythDbusServerPrivate *priv;
  11.845 +
  11.846 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  11.847 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  11.848 +
  11.849 +    *schedule_id = 0;
  11.850 +
  11.851 +    g_return_val_if_fail (priv->myth_backend, FALSE);
  11.852 +    g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
  11.853 +
  11.854 +
  11.855 +    g_time_val_from_iso8601 (start_time, &start_vtime);
  11.856 +    g_time_val_from_iso8601 (end_time, &end_vtime);
  11.857 +    sch_info = gmyth_dbus_server_new_schedule_info (description,
  11.858 +                                                    channel_id,
  11.859 +                                                    program_id,
  11.860 +                                                    &start_vtime,
  11.861 +                                                    &end_vtime);
  11.862 +    if (sch_info != NULL) {
  11.863 +        GMythScheduleType type;
  11.864 +        GTimeVal t_now;
  11.865 +        gboolean has_record;
  11.866 +
  11.867 +        type = (recurring ?
  11.868 +                GMYTH_SCHEDULE_ALL_OCCURRENCES :
  11.869 +                GMYTH_SCHEDULE_ONE_OCCURRENCE);
  11.870 +
  11.871 +        g_get_current_time (&t_now);
  11.872 +
  11.873 +        has_record = gmyth_scheduler_was_recorded_before (priv->myth_scheduler, 
  11.874 +                                                          channel_id,
  11.875 +                                                          (time_t) start_vtime.tv_sec);
  11.876 +
  11.877 +
  11.878 +        if ((t_now.tv_sec >= start_vtime.tv_sec)
  11.879 +            && (t_now.tv_sec <= end_vtime.tv_sec) && has_record)
  11.880 +        {
  11.881 +            GMythSocket    *socket;
  11.882 +            gboolean        res = FALSE;
  11.883 +
  11.884 +            socket = gmyth_backend_info_get_connected_socket (priv->myth_backend);
  11.885 +            res = gmyth_scheduler_reactivate_schedule(priv->myth_scheduler,
  11.886 +                                                      channel_id,
  11.887 +                                                      (time_t) start_vtime.tv_sec);
  11.888 +            if (res) {
  11.889 +                GMythStringList *slist = gmyth_string_list_new();
  11.890 +
  11.891 +                gmyth_string_list_append_char_array(slist, "RESCHEDULE_RECORDINGS 0");
  11.892 +                gmyth_socket_sendreceive_stringlist(socket, slist);
  11.893 +                res = (gmyth_string_list_get_int(slist, 0) == 1);
  11.894 +                g_object_unref(slist);
  11.895 +            }
  11.896 +
  11.897 +            g_object_unref(socket);
  11.898 +            return res;
  11.899 +        }
  11.900 +        else
  11.901 +        {
  11.902 +            if (!gmyth_scheduler_add_schedule_full (priv->myth_scheduler,
  11.903 +                                                    sch_info,
  11.904 +                                                    type))
  11.905 +            {
  11.906 +                g_warning("Could not add schedule entry");
  11.907 +                return FALSE;
  11.908 +            }
  11.909 +
  11.910 +            (*schedule_id) = sch_info->schedule_id;
  11.911 +            gmyth_schedule_info_free (sch_info);
  11.912 +            return TRUE;
  11.913 +        }
  11.914 +    }
  11.915 +    return FALSE;
  11.916 +}
  11.917 +
  11.918 +static gboolean
  11.919 +gmyth_dbus_server_add_exception (GObject *obj,
  11.920 +                                 guint schedule_id,
  11.921 +                                 guint channel_id,
  11.922 +                                 guint program_id,
  11.923 +                                 const gchar *start_time,
  11.924 +                                 const gchar *end_time,
  11.925 +                                 const gchar *description,
  11.926 +                                 GError **error)
  11.927 +{
  11.928 +    ScheduleInfo *sch_info;
  11.929 +    GTimeVal start_vtime;
  11.930 +    GTimeVal end_vtime;
  11.931 +    GMythDbusServerPrivate *priv;
  11.932 +
  11.933 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  11.934 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  11.935 +
  11.936 +    g_return_val_if_fail (priv->myth_backend, FALSE);
  11.937 +    g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
  11.938 +
  11.939 +    g_time_val_from_iso8601 (start_time, &start_vtime);
  11.940 +    g_time_val_from_iso8601 (end_time, &end_vtime);
  11.941 +
  11.942 +    sch_info = gmyth_dbus_server_new_schedule_info (description,
  11.943 +                                                   channel_id,
  11.944 +                                                   program_id,
  11.945 +                                                   &start_vtime,
  11.946 +                                                   &end_vtime);
  11.947 +    if (sch_info != NULL)
  11.948 +    {
  11.949 +       if (!gmyth_scheduler_add_exception (priv->myth_scheduler,
  11.950 +                                           schedule_id,
  11.951 +                                           sch_info))
  11.952 +       {
  11.953 +           g_warning ("Could not add schedule exception");
  11.954 +           gmyth_schedule_info_free (sch_info);
  11.955 +           return FALSE;
  11.956 +       }
  11.957 +
  11.958 +       gmyth_schedule_info_free (sch_info);
  11.959 +       return TRUE;
  11.960 +    }
  11.961 +    return FALSE;
  11.962 +}
  11.963 +
  11.964 +static gboolean
  11.965 +gmyth_dbus_server_remove_schedule (GObject *obj,
  11.966 +                                   guint schedule_id,
  11.967 +                                   GError **error)
  11.968 +{
  11.969 +    GMythDbusServerPrivate *priv;
  11.970 +
  11.971 +    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  11.972 +    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  11.973 +
  11.974 +    g_return_val_if_fail (priv->myth_backend, FALSE);
  11.975 +    g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
  11.976 +
  11.977 +    return gmyth_scheduler_delete_schedule (priv->myth_scheduler, schedule_id);
  11.978 +}
  11.979 +
  11.980 +GMythDbusServer*
  11.981 +gmyth_dbus_server_start_dbus_service (void)
  11.982 +{
  11.983 +    GError *error = NULL;
  11.984 +    DBusGProxy *proxy;
  11.985 +    DBusGConnection *bus;
  11.986 +    guint request_ret;
  11.987 +    GMythDbusServer *self;
  11.988 +
  11.989 +    self = g_object_new (GMYTH_DBUS_SERVER_TYPE, NULL);
  11.990 +    g_return_val_if_fail (self, FALSE);
  11.991 +
  11.992 +    /* TODO: should verify if this service was already started */
  11.993 +
  11.994 +    /* connect to session bus */
  11.995 +    bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
  11.996 +    if (bus == NULL) 
  11.997 +    {
  11.998 +        g_warning ("Could not connect to dbus: %s", error->message);
  11.999 +        g_error_free (error);
 11.1000 +        goto fail;
 11.1001 +    }
 11.1002 +
 11.1003 +    /* register dbus object */
 11.1004 +    dbus_g_connection_register_g_object (bus,
 11.1005 +        GMYTH_DBUS_SERVER_PATH, G_OBJECT (self));
 11.1006 +
 11.1007 +    proxy = dbus_g_proxy_new_for_name (bus, DBUS_SERVICE_DBUS,
 11.1008 +                                       DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
 11.1009 +
 11.1010 +    /* registering download manager service */
 11.1011 +    if (!org_freedesktop_DBus_request_name (proxy, GMYTH_DBUS_SERVER_IFACE,
 11.1012 +                                            0, &request_ret, &error)) 
 11.1013 +    {
 11.1014 +        g_warning ("Unable to register dbus service: %d %s",
 11.1015 +                   error->code, error->message);
 11.1016 +        g_error_free (error);
 11.1017 +        goto fail;
 11.1018 +    }
 11.1019 +
 11.1020 +    if (request_ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) 
 11.1021 +    {
 11.1022 +        g_warning ("Got result code %u from requesting name", request_ret);
 11.1023 +        goto fail;
 11.1024 +    }
 11.1025 +
 11.1026 +    return self;
 11.1027 +
 11.1028 +fail:
 11.1029 +    g_object_unref (self);
 11.1030 +    return NULL;
 11.1031 +}
 11.1032 +
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/gmyth-dbus/src/gmyth-dbus-server.h	Thu Oct 25 15:40:47 2007 +0100
    12.3 @@ -0,0 +1,64 @@
    12.4 +/**
    12.5 + * GMyth Library
    12.6 + *
    12.7 + * @file gmyth/gmyth_backend_info.c
    12.8 + * 
    12.9 + * @brief <p> This component represents all the MythTV backend server
   12.10 + * 						configuration information.
   12.11 + *
   12.12 + * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
   12.13 + * @author Renato Filho  <renato.filho@indt.org.br>
   12.14 + *
   12.15 + * 
   12.16 + * This program is free software; you can redistribute it and/or modify
   12.17 + * it under the terms of the GNU Lesser General Public License as published by
   12.18 + * the Free Software Foundation; either version 2 of the License, or
   12.19 + * (at your option) any later version.
   12.20 + *
   12.21 + * This program is distributed in the hope that it will be useful,
   12.22 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   12.23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12.24 + * GNU General Public License for more details.
   12.25 + *
   12.26 + * You should have received a copy of the GNU Lesser General Public License
   12.27 + * along with this program; if not, write to the Free Software
   12.28 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   12.29 + */
   12.30 +
   12.31 +
   12.32 +#ifndef __GMYTH_DBUS_SERVER_H__
   12.33 +#define __GMYTH_DBUS_SERVER_H__
   12.34 +
   12.35 +#include <glib.h>
   12.36 +#include <glib-object.h>
   12.37 +
   12.38 +G_BEGIN_DECLS
   12.39 +
   12.40 +#define GMYTH_DBUS_SERVER_TYPE            (gmyth_dbus_server_get_type ())
   12.41 +#define GMYTH_DBUS_SERVER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_DBUS_SERVER_TYPE, GMythDbusServer))
   12.42 +#define GMYTH_DBUS_SERVER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_DBUS_SERVER_TYPE, GMythDbusServerClass))
   12.43 +#define IS_GMYTH_DBUS_SERVER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_DBUS_SERVER_TYPE))
   12.44 +#define IS_GMYTH_DBUS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GMYTH_DBUS_SERVER_TYPE))
   12.45 +#define GMYTH_DBUS_SERVER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_DBUS_SERVER_TYPE, GMythDbusServerClass))
   12.46 +
   12.47 +
   12.48 +typedef struct _GMythDbusServer      GMythDbusServer;
   12.49 +typedef struct _GMythDbusServerClass GMythDbusServerClass;
   12.50 +
   12.51 +struct _GMythDbusServerClass
   12.52 +{
   12.53 +    GObjectClass parent_class;
   12.54 +};
   12.55 +
   12.56 +struct _GMythDbusServer
   12.57 +{
   12.58 +    GObject parent;
   12.59 +};
   12.60 +
   12.61 +GType gmyth_dbus_server_get_type (void);
   12.62 +GMythDbusServer * gmyth_dbus_server_start_dbus_service (void);
   12.63 +
   12.64 +
   12.65 +G_END_DECLS
   12.66 +
   12.67 +#endif
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/gmyth-dbus/src/gmyth-dbus-server.xml	Thu Oct 25 15:40:47 2007 +0100
    13.3 @@ -0,0 +1,99 @@
    13.4 +<?xml version="1.0" encoding="UTF-8" ?>
    13.5 +
    13.6 +<node name="/br/org/indt/GMyth">
    13.7 +  <interface name="br.org.indt.GMyth">
    13.8 +    <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="gmyth_dbus_server"/>
    13.9 +
   13.10 +    <method name="Connect">
   13.11 +      <arg type="s" name="host" direction="in" />
   13.12 +      <arg type="i" name="port" direction="in" />
   13.13 +      <arg type="s" name="user" direction="in" />
   13.14 +      <arg type="s" name="password" direction="in" />
   13.15 +    </method>
   13.16 +
   13.17 +    <method name="Connected">
   13.18 +      <arg type="b" name="status" direction="out" />
   13.19 +    </method>
   13.20 +
   13.21 +    <method name="Disconnect"/>
   13.22 +
   13.23 +    <method name="GetServerInfo">
   13.24 +      <arg type="t" name="total_space" direction="out" />
   13.25 +      <arg type="t" name="used_space" direction="out" />
   13.26 +      <arg type="t" name="free_space" direction="out" />
   13.27 +    </method>
   13.28 +
   13.29 +    <method name="GetChannelList">
   13.30 +      <arg type="a(isss)" name="channels" direction="out" />
   13.31 +    </method>
   13.32 +
   13.33 +    <method name="GetChannelInfo">
   13.34 +      <arg type="i" name="channel_id" direction="in" />
   13.35 +      <arg type="(isss)" name="details" direction="out" />
   13.36 +    </method>
   13.37 +
   13.38 +    <method name="GetProgramList">
   13.39 +      <arg type="i" name="channel" direction="in" />
   13.40 +      <arg type="s" name="start_time" direction="in" />
   13.41 +      <arg type="s" name="end_time" direction="in" />
   13.42 +      <arg type="a(sssssss)" name="program_list" direction="out" />
   13.43 +    </method>
   13.44 +
   13.45 +    <method name="GetRecordedList">
   13.46 +      <arg type="a(uuussssssst)" name="records" direction="out" />
   13.47 +    </method>
   13.48 +
   13.49 +    <method name="GetRecordedInfo">
   13.50 +      <arg type="s" name="basename" direction="in" />
   13.51 +      <arg type="(uuussssssst)" name="details" direction="out" />
   13.52 +    </method>
   13.53 +
   13.54 +    <method name="GetScheduleList">
   13.55 +      <arg type="a(uuussssu)" name="schedules" direction="out" />
   13.56 +    </method>
   13.57 +
   13.58 +    <method name="FileExists">
   13.59 +      <arg type="s" name="file_name" direction="in" />
   13.60 +      <arg type="b" name="exists" direction="out" />
   13.61 +    </method>
   13.62 +
   13.63 +    <method name="GetThumbnail">
   13.64 +      <arg type="s" name="file_name" direction="in" />
   13.65 +      <arg type="ay" name="image" direction="out" />
   13.66 +    </method>
   13.67 +
   13.68 +    <method name="GetChannelIcon">
   13.69 +      <arg type="i" name="channel_id" direction="in" />
   13.70 +      <arg type="ay" name="icon" direction="out" />
   13.71 +    </method>
   13.72 +
   13.73 +    <method name="StopRecording">
   13.74 +      <arg type="u" name="channel_id" direction="in" />
   13.75 +      <arg type="b" name="result" direction="out" />
   13.76 +    </method>
   13.77 +
   13.78 +    <method name="AddSchedule">
   13.79 +      <arg type="u" name="channel_id" direction="in" />
   13.80 +      <arg type="u" name="program_id" direction="in" />
   13.81 +      <arg type="s" name="start_time" direction="in" />
   13.82 +      <arg type="s" name="end_time" direction="in" />
   13.83 +      <arg type="b" name="recurring" direction="in" />
   13.84 +      <arg type="s" name="description" direction="in" />
   13.85 +      <arg type="u" name="schedule_id" direction="out" />
   13.86 +    </method>
   13.87 +
   13.88 +    <method name="AddException">
   13.89 +      <arg type="u" name="schedule_id" direction="in" />
   13.90 +      <arg type="u" name="program_id" direction="in" />
   13.91 +      <arg type="u" name="channel_id" direction="in" />
   13.92 +      <arg type="s" name="start_time" direction="in" />
   13.93 +      <arg type="s" name="end_time" direction="in" />
   13.94 +      <arg type="s" name="description" direction="in" />
   13.95 +    </method>
   13.96 +
   13.97 +    <method name="RemoveSchedule">
   13.98 +      <arg type="u" name="schedule_id" direction="in" />
   13.99 +    </method>
  13.100 +
  13.101 +  </interface>
  13.102 +</node>
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/gmyth-dbus/src/main.c	Thu Oct 25 15:40:47 2007 +0100
    14.3 @@ -0,0 +1,19 @@
    14.4 +#include "gmyth-dbus-server.h"
    14.5 +
    14.6 +int main (int argc, char* argv[])
    14.7 +{
    14.8 +    GMainLoop *loop;
    14.9 +    GMythDbusServer *srv;
   14.10 +
   14.11 +    g_type_init ();
   14.12 +    g_thread_init (NULL);
   14.13 +
   14.14 +
   14.15 +    loop = g_main_loop_new (NULL, FALSE);
   14.16 +    srv = gmyth_dbus_server_start_dbus_service ();
   14.17 +
   14.18 +    if (srv)
   14.19 +        g_main_loop_run (loop);
   14.20 +
   14.21 +    return 0;
   14.22 +}
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/gmyth-dbus/tests/channel-list.py	Thu Oct 25 15:40:47 2007 +0100
    15.3 @@ -0,0 +1,12 @@
    15.4 +import dbus
    15.5 +bus = dbus.SessionBus()
    15.6 +
    15.7 +proxy = bus.get_object ('br.org.indt.GMyth', '/br/org/indt/GMyth')
    15.8 +iface = dbus.Interface (proxy, dbus_interface='br.org.indt.GMyth')
    15.9 +iface.Connect ('192.168.2.222', 6543, 'mythtv', 'mythtv')
   15.10 +print iface.Connected ()
   15.11 +print iface.GetChannelList ()
   15.12 +print "--------------------------------------------------------"
   15.13 +print iface.GetRecordedList ()
   15.14 +#print iface.FileExists ("teste.nuv")
   15.15 +#print iface.GetProgramList (1003, ')
    16.1 --- a/myth-dbus/COPYING	Thu Oct 25 15:38:08 2007 +0100
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,340 +0,0 @@
    16.4 -		    GNU GENERAL PUBLIC LICENSE
    16.5 -		       Version 2, June 1991
    16.6 -
    16.7 - Copyright (C) 1989, 1991 Free Software Foundation, Inc.
    16.8 -     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
    16.9 - Everyone is permitted to copy and distribute verbatim copies
   16.10 - of this license document, but changing it is not allowed.
   16.11 -
   16.12 -			    Preamble
   16.13 -
   16.14 -  The licenses for most software are designed to take away your
   16.15 -freedom to share and change it.  By contrast, the GNU General Public
   16.16 -License is intended to guarantee your freedom to share and change free
   16.17 -software--to make sure the software is free for all its users.  This
   16.18 -General Public License applies to most of the Free Software
   16.19 -Foundation's software and to any other program whose authors commit to
   16.20 -using it.  (Some other Free Software Foundation software is covered by
   16.21 -the GNU Library General Public License instead.)  You can apply it to
   16.22 -your programs, too.
   16.23 -
   16.24 -  When we speak of free software, we are referring to freedom, not
   16.25 -price.  Our General Public Licenses are designed to make sure that you
   16.26 -have the freedom to distribute copies of free software (and charge for
   16.27 -this service if you wish), that you receive source code or can get it
   16.28 -if you want it, that you can change the software or use pieces of it
   16.29 -in new free programs; and that you know you can do these things.
   16.30 -
   16.31 -  To protect your rights, we need to make restrictions that forbid
   16.32 -anyone to deny you these rights or to ask you to surrender the rights.
   16.33 -These restrictions translate to certain responsibilities for you if you
   16.34 -distribute copies of the software, or if you modify it.
   16.35 -
   16.36 -  For example, if you distribute copies of such a program, whether
   16.37 -gratis or for a fee, you must give the recipients all the rights that
   16.38 -you have.  You must make sure that they, too, receive or can get the
   16.39 -source code.  And you must show them these terms so they know their
   16.40 -rights.
   16.41 -
   16.42 -  We protect your rights with two steps: (1) copyright the software, and
   16.43 -(2) offer you this license which gives you legal permission to copy,
   16.44 -distribute and/or modify the software.
   16.45 -
   16.46 -  Also, for each author's protection and ours, we want to make certain
   16.47 -that everyone understands that there is no warranty for this free
   16.48 -software.  If the software is modified by someone else and passed on, we
   16.49 -want its recipients to know that what they have is not the original, so
   16.50 -that any problems introduced by others will not reflect on the original
   16.51 -authors' reputations.
   16.52 -
   16.53 -  Finally, any free program is threatened constantly by software
   16.54 -patents.  We wish to avoid the danger that redistributors of a free
   16.55 -program will individually obtain patent licenses, in effect making the
   16.56 -program proprietary.  To prevent this, we have made it clear that any
   16.57 -patent must be licensed for everyone's free use or not licensed at all.
   16.58 -
   16.59 -  The precise terms and conditions for copying, distribution and
   16.60 -modification follow.
   16.61 -
   16.62 -		    GNU GENERAL PUBLIC LICENSE
   16.63 -   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
   16.64 -
   16.65 -  0. This License applies to any program or other work which contains
   16.66 -a notice placed by the copyright holder saying it may be distributed
   16.67 -under the terms of this General Public License.  The "Program", below,
   16.68 -refers to any such program or work, and a "work based on the Program"
   16.69 -means either the Program or any derivative work under copyright law:
   16.70 -that is to say, a work containing the Program or a portion of it,
   16.71 -either verbatim or with modifications and/or translated into another
   16.72 -language.  (Hereinafter, translation is included without limitation in
   16.73 -the term "modification".)  Each licensee is addressed as "you".
   16.74 -
   16.75 -Activities other than copying, distribution and modification are not
   16.76 -covered by this License; they are outside its scope.  The act of
   16.77 -running the Program is not restricted, and the output from the Program
   16.78 -is covered only if its contents constitute a work based on the
   16.79 -Program (independent of having been made by running the Program).
   16.80 -Whether that is true depends on what the Program does.
   16.81 -
   16.82 -  1. You may copy and distribute verbatim copies of the Program's
   16.83 -source code as you receive it, in any medium, provided that you
   16.84 -conspicuously and appropriately publish on each copy an appropriate
   16.85 -copyright notice and disclaimer of warranty; keep intact all the
   16.86 -notices that refer to this License and to the absence of any warranty;
   16.87 -and give any other recipients of the Program a copy of this License
   16.88 -along with the Program.
   16.89 -
   16.90 -You may charge a fee for the physical act of transferring a copy, and
   16.91 -you may at your option offer warranty protection in exchange for a fee.
   16.92 -
   16.93 -  2. You may modify your copy or copies of the Program or any portion
   16.94 -of it, thus forming a work based on the Program, and copy and
   16.95 -distribute such modifications or work under the terms of Section 1
   16.96 -above, provided that you also meet all of these conditions:
   16.97 -
   16.98 -    a) You must cause the modified files to carry prominent notices
   16.99 -    stating that you changed the files and the date of any change.
  16.100 -
  16.101 -    b) You must cause any work that you distribute or publish, that in
  16.102 -    whole or in part contains or is derived from the Program or any
  16.103 -    part thereof, to be licensed as a whole at no charge to all third
  16.104 -    parties under the terms of this License.
  16.105 -
  16.106 -    c) If the modified program normally reads commands interactively
  16.107 -    when run, you must cause it, when started running for such
  16.108 -    interactive use in the most ordinary way, to print or display an
  16.109 -    announcement including an appropriate copyright notice and a
  16.110 -    notice that there is no warranty (or else, saying that you provide
  16.111 -    a warranty) and that users may redistribute the program under
  16.112 -    these conditions, and telling the user how to view a copy of this
  16.113 -    License.  (Exception: if the Program itself is interactive but
  16.114 -    does not normally print such an announcement, your work based on
  16.115 -    the Program is not required to print an announcement.)
  16.116 -
  16.117 -These requirements apply to the modified work as a whole.  If
  16.118 -identifiable sections of that work are not derived from the Program,
  16.119 -and can be reasonably considered independent and separate works in
  16.120 -themselves, then this License, and its terms, do not apply to those
  16.121 -sections when you distribute them as separate works.  But when you
  16.122 -distribute the same sections as part of a whole which is a work based
  16.123 -on the Program, the distribution of the whole must be on the terms of
  16.124 -this License, whose permissions for other licensees extend to the
  16.125 -entire whole, and thus to each and every part regardless of who wrote it.
  16.126 -
  16.127 -Thus, it is not the intent of this section to claim rights or contest
  16.128 -your rights to work written entirely by you; rather, the intent is to
  16.129 -exercise the right to control the distribution of derivative or
  16.130 -collective works based on the Program.
  16.131 -
  16.132 -In addition, mere aggregation of another work not based on the Program
  16.133 -with the Program (or with a work based on the Program) on a volume of
  16.134 -a storage or distribution medium does not bring the other work under
  16.135 -the scope of this License.
  16.136 -
  16.137 -  3. You may copy and distribute the Program (or a work based on it,
  16.138 -under Section 2) in object code or executable form under the terms of
  16.139 -Sections 1 and 2 above provided that you also do one of the following:
  16.140 -
  16.141 -    a) Accompany it with the complete corresponding machine-readable
  16.142 -    source code, which must be distributed under the terms of Sections
  16.143 -    1 and 2 above on a medium customarily used for software interchange; or,
  16.144 -
  16.145 -    b) Accompany it with a written offer, valid for at least three
  16.146 -    years, to give any third party, for a charge no more than your
  16.147 -    cost of physically performing source distribution, a complete
  16.148 -    machine-readable copy of the corresponding source code, to be
  16.149 -    distributed under the terms of Sections 1 and 2 above on a medium
  16.150 -    customarily used for software interchange; or,
  16.151 -
  16.152 -    c) Accompany it with the information you received as to the offer
  16.153 -    to distribute corresponding source code.  (This alternative is
  16.154 -    allowed only for noncommercial distribution and only if you
  16.155 -    received the program in object code or executable form with such
  16.156 -    an offer, in accord with Subsection b above.)
  16.157 -
  16.158 -The source code for a work means the preferred form of the work for
  16.159 -making modifications to it.  For an executable work, complete source
  16.160 -code means all the source code for all modules it contains, plus any
  16.161 -associated interface definition files, plus the scripts used to
  16.162 -control compilation and installation of the executable.  However, as a
  16.163 -special exception, the source code distributed need not include
  16.164 -anything that is normally distributed (in either source or binary
  16.165 -form) with the major components (compiler, kernel, and so on) of the
  16.166 -operating system on which the executable runs, unless that component
  16.167 -itself accompanies the executable.
  16.168 -
  16.169 -If distribution of executable or object code is made by offering
  16.170 -access to copy from a designated place, then offering equivalent
  16.171 -access to copy the source code from the same place counts as
  16.172 -distribution of the source code, even though third parties are not
  16.173 -compelled to copy the source along with the object code.
  16.174 -
  16.175 -  4. You may not copy, modify, sublicense, or distribute the Program
  16.176 -except as expressly provided under this License.  Any attempt
  16.177 -otherwise to copy, modify, sublicense or distribute the Program is
  16.178 -void, and will automatically terminate your rights under this License.
  16.179 -However, parties who have received copies, or rights, from you under
  16.180 -this License will not have their licenses terminated so long as such
  16.181 -parties remain in full compliance.
  16.182 -
  16.183 -  5. You are not required to accept this License, since you have not
  16.184 -signed it.  However, nothing else grants you permission to modify or
  16.185 -distribute the Program or its derivative works.  These actions are
  16.186 -prohibited by law if you do not accept this License.  Therefore, by
  16.187 -modifying or distributing the Program (or any work based on the
  16.188 -Program), you indicate your acceptance of this License to do so, and
  16.189 -all its terms and conditions for copying, distributing or modifying
  16.190 -the Program or works based on it.
  16.191 -
  16.192 -  6. Each time you redistribute the Program (or any work based on the
  16.193 -Program), the recipient automatically receives a license from the
  16.194 -original licensor to copy, distribute or modify the Program subject to
  16.195 -these terms and conditions.  You may not impose any further
  16.196 -restrictions on the recipients' exercise of the rights granted herein.
  16.197 -You are not responsible for enforcing compliance by third parties to
  16.198 -this License.
  16.199 -
  16.200 -  7. If, as a consequence of a court judgment or allegation of patent
  16.201 -infringement or for any other reason (not limited to patent issues),
  16.202 -conditions are imposed on you (whether by court order, agreement or
  16.203 -otherwise) that contradict the conditions of this License, they do not
  16.204 -excuse you from the conditions of this License.  If you cannot
  16.205 -distribute so as to satisfy simultaneously your obligations under this
  16.206 -License and any other pertinent obligations, then as a consequence you
  16.207 -may not distribute the Program at all.  For example, if a patent
  16.208 -license would not permit royalty-free redistribution of the Program by
  16.209 -all those who receive copies directly or indirectly through you, then
  16.210 -the only way you could satisfy both it and this License would be to
  16.211 -refrain entirely from distribution of the Program.
  16.212 -
  16.213 -If any portion of this section is held invalid or unenforceable under
  16.214 -any particular circumstance, the balance of the section is intended to
  16.215 -apply and the section as a whole is intended to apply in other
  16.216 -circumstances.
  16.217 -
  16.218 -It is not the purpose of this section to induce you to infringe any
  16.219 -patents or other property right claims or to contest validity of any
  16.220 -such claims; this section has the sole purpose of protecting the
  16.221 -integrity of the free software distribution system, which is
  16.222 -implemented by public license practices.  Many people have made
  16.223 -generous contributions to the wide range of software distributed
  16.224 -through that system in reliance on consistent application of that
  16.225 -system; it is up to the author/donor to decide if he or she is willing
  16.226 -to distribute software through any other system and a licensee cannot
  16.227 -impose that choice.
  16.228 -
  16.229 -This section is intended to make thoroughly clear what is believed to
  16.230 -be a consequence of the rest of this License.
  16.231 -
  16.232 -  8. If the distribution and/or use of the Program is restricted in
  16.233 -certain countries either by patents or by copyrighted interfaces, the
  16.234 -original copyright holder who places the Program under this License
  16.235 -may add an explicit geographical distribution limitation excluding
  16.236 -those countries, so that distribution is permitted only in or among
  16.237 -countries not thus excluded.  In such case, this License incorporates
  16.238 -the limitation as if written in the body of this License.
  16.239 -
  16.240 -  9. The Free Software Foundation may publish revised and/or new versions
  16.241 -of the General Public License from time to time.  Such new versions will
  16.242 -be similar in spirit to the present version, but may differ in detail to
  16.243 -address new problems or concerns.
  16.244 -
  16.245 -Each version is given a distinguishing version number.  If the Program
  16.246 -specifies a version number of this License which applies to it and "any
  16.247 -later version", you have the option of following the terms and conditions
  16.248 -either of that version or of any later version published by the Free
  16.249 -Software Foundation.  If the Program does not specify a version number of
  16.250 -this License, you may choose any version ever published by the Free Software
  16.251 -Foundation.
  16.252 -
  16.253 -  10. If you wish to incorporate parts of the Program into other free
  16.254 -programs whose distribution conditions are different, write to the author
  16.255 -to ask for permission.  For software which is copyrighted by the Free
  16.256 -Software Foundation, write to the Free Software Foundation; we sometimes
  16.257 -make exceptions for this.  Our decision will be guided by the two goals
  16.258 -of preserving the free status of all derivatives of our free software and
  16.259 -of promoting the sharing and reuse of software generally.
  16.260 -
  16.261 -			    NO WARRANTY
  16.262 -
  16.263 -  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
  16.264 -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
  16.265 -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
  16.266 -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
  16.267 -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  16.268 -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
  16.269 -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  16.270 -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
  16.271 -REPAIR OR CORRECTION.
  16.272 -
  16.273 -  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  16.274 -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
  16.275 -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  16.276 -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
  16.277 -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
  16.278 -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  16.279 -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  16.280 -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  16.281 -POSSIBILITY OF SUCH DAMAGES.
  16.282 -
  16.283 -		     END OF TERMS AND CONDITIONS
  16.284 -
  16.285 -	    How to Apply These Terms to Your New Programs
  16.286 -
  16.287 -  If you develop a new program, and you want it to be of the greatest
  16.288 -possible use to the public, the best way to achieve this is to make it
  16.289 -free software which everyone can redistribute and change under these terms.
  16.290 -
  16.291 -  To do so, attach the following notices to the program.  It is safest
  16.292 -to attach them to the start of each source file to most effectively
  16.293 -convey the exclusion of warranty; and each file should have at least
  16.294 -the "copyright" line and a pointer to where the full notice is found.
  16.295 -
  16.296 -    <one line to give the program's name and a brief idea of what it does.>
  16.297 -    Copyright (C) <year>  <name of author>
  16.298 -
  16.299 -    This program is free software; you can redistribute it and/or modify
  16.300 -    it under the terms of the GNU General Public License as published by
  16.301 -    the Free Software Foundation; either version 2 of the License, or
  16.302 -    (at your option) any later version.
  16.303 -
  16.304 -    This program is distributed in the hope that it will be useful,
  16.305 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.306 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.307 -    GNU General Public License for more details.
  16.308 -
  16.309 -    You should have received a copy of the GNU General Public License
  16.310 -    along with this program; if not, write to the Free Software
  16.311 -    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  16.312 -
  16.313 -
  16.314 -Also add information on how to contact you by electronic and paper mail.
  16.315 -
  16.316 -If the program is interactive, make it output a short notice like this
  16.317 -when it starts in an interactive mode:
  16.318 -
  16.319 -    Gnomovision version 69, Copyright (C) year  name of author
  16.320 -    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  16.321 -    This is free software, and you are welcome to redistribute it
  16.322 -    under certain conditions; type `show c' for details.
  16.323 -
  16.324 -The hypothetical commands `show w' and `show c' should show the appropriate
  16.325 -parts of the General Public License.  Of course, the commands you use may
  16.326 -be called something other than `show w' and `show c'; they could even be
  16.327 -mouse-clicks or menu items--whatever suits your program.
  16.328 -
  16.329 -You should also get your employer (if you work as a programmer) or your
  16.330 -school, if any, to sign a "copyright disclaimer" for the program, if
  16.331 -necessary.  Here is a sample; alter the names:
  16.332 -
  16.333 -  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  16.334 -  `Gnomovision' (which makes passes at compilers) written by James Hacker.
  16.335 -
  16.336 -  <signature of Ty Coon>, 1 April 1989
  16.337 -  Ty Coon, President of Vice
  16.338 -
  16.339 -This General Public License does not permit incorporating your program into
  16.340 -proprietary programs.  If your program is a subroutine library, you may
  16.341 -consider it more useful to permit linking proprietary applications with the
  16.342 -library.  If this is what you want to do, use the GNU Library General
  16.343 -Public License instead of this License.
    17.1 --- a/myth-dbus/INSTALL	Thu Oct 25 15:38:08 2007 +0100
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,236 +0,0 @@
    17.4 -Installation Instructions
    17.5 -*************************
    17.6 -
    17.7 -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
    17.8 -Software Foundation, Inc.
    17.9 -
   17.10 -This file is free documentation; the Free Software Foundation gives
   17.11 -unlimited permission to copy, distribute and modify it.
   17.12 -
   17.13 -Basic Installation
   17.14 -==================
   17.15 -
   17.16 -These are generic installation instructions.
   17.17 -
   17.18 -   The `configure' shell script attempts to guess correct values for
   17.19 -various system-dependent variables used during compilation.  It uses
   17.20 -those values to create a `Makefile' in each directory of the package.
   17.21 -It may also create one or more `.h' files containing system-dependent
   17.22 -definitions.  Finally, it creates a shell script `config.status' that
   17.23 -you can run in the future to recreate the current configuration, and a
   17.24 -file `config.log' containing compiler output (useful mainly for
   17.25 -debugging `configure').
   17.26 -
   17.27 -   It can also use an optional file (typically called `config.cache'
   17.28 -and enabled with `--cache-file=config.cache' or simply `-C') that saves
   17.29 -the results of its tests to speed up reconfiguring.  (Caching is
   17.30 -disabled by default to prevent problems with accidental use of stale
   17.31 -cache files.)
   17.32 -
   17.33 -   If you need to do unusual things to compile the package, please try
   17.34 -to figure out how `configure' could check whether to do them, and mail
   17.35 -diffs or instructions to the address given in the `README' so they can
   17.36 -be considered for the next release.  If you are using the cache, and at
   17.37 -some point `config.cache' contains results you don't want to keep, you
   17.38 -may remove or edit it.
   17.39 -
   17.40 -   The file `configure.ac' (or `configure.in') is used to create
   17.41 -`configure' by a program called `autoconf'.  You only need
   17.42 -`configure.ac' if you want to change it or regenerate `configure' using
   17.43 -a newer version of `autoconf'.
   17.44 -
   17.45 -The simplest way to compile this package is:
   17.46 -
   17.47 -  1. `cd' to the directory containing the package's source code and type
   17.48 -     `./configure' to configure the package for your system.  If you're
   17.49 -     using `csh' on an old version of System V, you might need to type
   17.50 -     `sh ./configure' instead to prevent `csh' from trying to execute
   17.51 -     `configure' itself.
   17.52 -
   17.53 -     Running `configure' takes awhile.  While running, it prints some
   17.54 -     messages telling which features it is checking for.
   17.55 -
   17.56 -  2. Type `make' to compile the package.
   17.57 -
   17.58 -  3. Optionally, type `make check' to run any self-tests that come with
   17.59 -     the package.
   17.60 -
   17.61 -  4. Type `make install' to install the programs and any data files and
   17.62 -     documentation.
   17.63 -
   17.64 -  5. You can remove the program binaries and object files from the
   17.65 -     source code directory by typing `make clean'.  To also remove the
   17.66 -     files that `configure' created (so you can compile the package for
   17.67 -     a different kind of computer), type `make distclean'.  There is
   17.68 -     also a `make maintainer-clean' target, but that is intended mainly
   17.69 -     for the package's developers.  If you use it, you may have to get
   17.70 -     all sorts of other programs in order to regenerate files that came
   17.71 -     with the distribution.
   17.72 -
   17.73 -Compilers and Options
   17.74 -=====================
   17.75 -
   17.76 -Some systems require unusual options for compilation or linking that the
   17.77 -`configure' script does not know about.  Run `./configure --help' for
   17.78 -details on some of the pertinent environment variables.
   17.79 -
   17.80 -   You can give `configure' initial values for configuration parameters
   17.81 -by setting variables in the command line or in the environment.  Here
   17.82 -is an example:
   17.83 -
   17.84 -     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
   17.85 -
   17.86 -   *Note Defining Variables::, for more details.
   17.87 -
   17.88 -Compiling For Multiple Architectures
   17.89 -====================================
   17.90 -
   17.91 -You can compile the package for more than one kind of computer at the
   17.92 -same time, by placing the object files for each architecture in their
   17.93 -own directory.  To do this, you must use a version of `make' that
   17.94 -supports the `VPATH' variable, such as GNU `make'.  `cd' to the
   17.95 -directory where you want the object files and executables to go and run
   17.96 -the `configure' script.  `configure' automatically checks for the
   17.97 -source code in the directory that `configure' is in and in `..'.
   17.98 -
   17.99 -   If you have to use a `make' that does not support the `VPATH'
  17.100 -variable, you have to compile the package for one architecture at a
  17.101 -time in the source code directory.  After you have installed the
  17.102 -package for one architecture, use `make distclean' before reconfiguring
  17.103 -for another architecture.
  17.104 -
  17.105 -Installation Names
  17.106 -==================
  17.107 -
  17.108 -By default, `make install' installs the package's commands under
  17.109 -`/usr/local/bin', include files under `/usr/local/include', etc.  You
  17.110 -can specify an installation prefix other than `/usr/local' by giving
  17.111 -`configure' the option `--prefix=PREFIX'.
  17.112 -
  17.113 -   You can specify separate installation prefixes for
  17.114 -architecture-specific files and architecture-independent files.  If you
  17.115 -pass the option `--exec-prefix=PREFIX' to `configure', the package uses
  17.116 -PREFIX as the prefix for installing programs and libraries.
  17.117 -Documentation and other data files still use the regular prefix.
  17.118 -
  17.119 -   In addition, if you use an unusual directory layout you can give
  17.120 -options like `--bindir=DIR' to specify different values for particular
  17.121 -kinds of files.  Run `configure --help' for a list of the directories
  17.122 -you can set and what kinds of files go in them.
  17.123 -
  17.124 -   If the package supports it, you can cause programs to be installed
  17.125 -with an extra prefix or suffix on their names by giving `configure' the
  17.126 -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
  17.127 -
  17.128 -Optional Features
  17.129 -=================
  17.130 -
  17.131 -Some packages pay attention to `--enable-FEATURE' options to
  17.132 -`configure', where FEATURE indicates an optional part of the package.
  17.133 -They may also pay attention to `--with-PACKAGE' options, where PACKAGE
  17.134 -is something like `gnu-as' or `x' (for the X Window System).  The
  17.135 -`README' should mention any `--enable-' and `--with-' options that the
  17.136 -package recognizes.
  17.137 -
  17.138 -   For packages that use the X Window System, `configure' can usually
  17.139 -find the X include and library files automatically, but if it doesn't,
  17.140 -you can use the `configure' options `--x-includes=DIR' and
  17.141 -`--x-libraries=DIR' to specify their locations.
  17.142 -
  17.143 -Specifying the System Type
  17.144 -==========================
  17.145 -
  17.146 -There may be some features `configure' cannot figure out automatically,
  17.147 -but needs to determine by the type of machine the package will run on.
  17.148 -Usually, assuming the package is built to be run on the _same_
  17.149 -architectures, `configure' can figure that out, but if it prints a
  17.150 -message saying it cannot guess the machine type, give it the
  17.151 -`--build=TYPE' option.  TYPE can either be a short name for the system
  17.152 -type, such as `sun4', or a canonical name which has the form:
  17.153 -
  17.154 -     CPU-COMPANY-SYSTEM
  17.155 -
  17.156 -where SYSTEM can have one of these forms:
  17.157 -
  17.158 -     OS KERNEL-OS
  17.159 -
  17.160 -   See the file `config.sub' for the possible values of each field.  If
  17.161 -`config.sub' isn't included in this package, then this package doesn't
  17.162 -need to know the machine type.
  17.163 -
  17.164 -   If you are _building_ compiler tools for cross-compiling, you should
  17.165 -use the option `--target=TYPE' to select the type of system they will
  17.166 -produce code for.
  17.167 -
  17.168 -   If you want to _use_ a cross compiler, that generates code for a
  17.169 -platform different from the build platform, you should specify the
  17.170 -"host" platform (i.e., that on which the generated programs will
  17.171 -eventually be run) with `--host=TYPE'.
  17.172 -
  17.173 -Sharing Defaults
  17.174 -================
  17.175 -
  17.176 -If you want to set default values for `configure' scripts to share, you
  17.177 -can create a site shell script called `config.site' that gives default
  17.178 -values for variables like `CC', `cache_file', and `prefix'.
  17.179 -`configure' looks for `PREFIX/share/config.site' if it exists, then
  17.180 -`PREFIX/etc/config.site' if it exists.  Or, you can set the
  17.181 -`CONFIG_SITE' environment variable to the location of the site script.
  17.182 -A warning: not all `configure' scripts look for a site script.
  17.183 -
  17.184 -Defining Variables
  17.185 -==================
  17.186 -
  17.187 -Variables not defined in a site shell script can be set in the
  17.188 -environment passed to `configure'.  However, some packages may run
  17.189 -configure again during the build, and the customized values of these
  17.190 -variables may be lost.  In order to avoid this problem, you should set
  17.191 -them in the `configure' command line, using `VAR=value'.  For example:
  17.192 -
  17.193 -     ./configure CC=/usr/local2/bin/gcc
  17.194 -
  17.195 -causes the specified `gcc' to be used as the C compiler (unless it is
  17.196 -overridden in the site shell script).  Here is a another example:
  17.197 -
  17.198 -     /bin/bash ./configure CONFIG_SHELL=/bin/bash
  17.199 -
  17.200 -Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
  17.201 -configuration-related scripts to be executed by `/bin/bash'.
  17.202 -
  17.203 -`configure' Invocation
  17.204 -======================
  17.205 -
  17.206 -`configure' recognizes the following options to control how it operates.
  17.207 -
  17.208 -`--help'
  17.209 -`-h'
  17.210 -     Print a summary of the options to `configure', and exit.
  17.211 -
  17.212 -`--version'
  17.213 -`-V'
  17.214 -     Print the version of Autoconf used to generate the `configure'
  17.215 -     script, and exit.
  17.216 -
  17.217 -`--cache-file=FILE'
  17.218 -     Enable the cache: use and save the results of the tests in FILE,
  17.219 -     traditionally `config.cache'.  FILE defaults to `/dev/null' to
  17.220 -     disable caching.
  17.221 -
  17.222 -`--config-cache'
  17.223 -`-C'
  17.224 -     Alias for `--cache-file=config.cache'.
  17.225 -
  17.226 -`--quiet'
  17.227 -`--silent'
  17.228 -`-q'
  17.229 -     Do not print messages saying which checks are being made.  To
  17.230 -     suppress all normal output, redirect it to `/dev/null' (any error
  17.231 -     messages will still be shown).
  17.232 -
  17.233 -`--srcdir=DIR'
  17.234 -     Look for the package's source code in directory DIR.  Usually
  17.235 -     `configure' can determine that directory automatically.
  17.236 -
  17.237 -`configure' also accepts some other, not widely useful, options.  Run
  17.238 -`configure --help' for more details.
  17.239 -
    18.1 --- a/myth-dbus/Makefile.am	Thu Oct 25 15:38:08 2007 +0100
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,7 +0,0 @@
    18.4 -SUBDIRS = src data
    18.5 -
    18.6 -EXTRA_DIST = 			\
    18.7 -	ChangeLog
    18.8 -	
    18.9 -DIST_SUBDIRS = 			\
   18.10 -	src data
    19.1 --- a/myth-dbus/autogen.sh	Thu Oct 25 15:38:08 2007 +0100
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,19 +0,0 @@
    19.4 -#!/bin/sh
    19.5 -# Run this to generate all the initial makefiles, etc.
    19.6 -
    19.7 -srcdir=`dirname $0`
    19.8 -test -z "$srcdir" && srcdir=.
    19.9 -
   19.10 -PKG_NAME="gmythdbus"
   19.11 -
   19.12 -(test -f $srcdir/configure.ac) || {
   19.13 -    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
   19.14 -    echo " top-level $PKG_NAME directory"
   19.15 -    exit 1
   19.16 -}
   19.17 -
   19.18 -which gnome-autogen.sh || {
   19.19 -    echo "You need to install gnome-common from the GNOME CVS"
   19.20 -    exit 1
   19.21 -}
   19.22 -REQUIRED_AUTOMAKE_VERSION=1.9 USE_GNOME2_MACROS=1 . gnome-autogen.sh
    20.1 --- a/myth-dbus/configure.ac	Thu Oct 25 15:38:08 2007 +0100
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,90 +0,0 @@
    20.4 -#                                               -*- Autoconf -*-
    20.5 -# Process this file with autoconf to produce a configure script.
    20.6 -
    20.7 -AC_PREREQ(2.50)
    20.8 -
    20.9 -AC_INIT([myth-dbus],[0.1])
   20.10 -
   20.11 -AC_CONFIG_MACRO_DIR([m4])
   20.12 -AC_CONFIG_HEADER(config.h)
   20.13 -
   20.14 -dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
   20.15 -AM_MAINTAINER_MODE
   20.16 -dnl make aclocal work in maintainer mode
   20.17 -AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
   20.18 -
   20.19 -AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
   20.20 -
   20.21 -# Checks for programs.
   20.22 -# check for tools
   20.23 -# Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
   20.24 -CFLAGS="$CFLAGS -Wall"
   20.25 -AC_PROG_CC
   20.26 -AC_PROG_LIBTOOL
   20.27 -
   20.28 -# Checks for libraries.
   20.29 -
   20.30 -# Checks for header files.
   20.31 -AC_HEADER_STDC
   20.32 -
   20.33 -#Test if --disable-debug given
   20.34 -AC_ARG_ENABLE(debug,
   20.35 -    AC_HELP_STRING([--disable-debug], [enable debugging mode]))
   20.36 -if test x"$enable_debug" != xno; then
   20.37 -    CFLAGS="$CFLAGS -g -DMYTH_STREAM_USE_DEBUG"
   20.38 -else
   20.39 -    CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS"
   20.40 -fi
   20.41 -
   20.42 -
   20.43 -AS_AC_EXPAND(DATADIR, $datadir)
   20.44 -
   20.45 -DBUS_SERVICES_DIR="$DATADIR/dbus-1/services"
   20.46 -AC_SUBST(DBUS_SERVICES_DIR)
   20.47 -AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for DBUS is])
   20.48 -
   20.49 -
   20.50 -# Checks required packages ####################################################
   20.51 -###############################################################################
   20.52 -
   20.53 -AC_PATH_PROG(DBUSBINDINGTOOL, dbus-binding-tool, no)
   20.54 -if test "x$DBUSBINDINGTOOL" = "xno"; then
   20.55 -    AC_MSG_ERROR([dbus-binding-tool not found in your PATH. Please correct this])
   20.56 -fi
   20.57 -AC_SUBST(DBUS_BINDING_TOOL)
   20.58 -
   20.59 -AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
   20.60 -if test "x$HAVE_PKGCONFIG" = "xno"; then
   20.61 -  AC_MSG_ERROR(you need to have pkgconfig installed !)
   20.62 -fi
   20.63 -
   20.64 -PKG_CHECK_MODULES(DBUS, dbus-glib-1, HAVE_DBUS=yes, HAVE_DBUS=no)
   20.65 -if test "x$HAVE_DBUS" = "xno"; then
   20.66 -  AC_MSG_ERROR(you need dbus-glib-1-dev installed)
   20.67 -fi
   20.68 -AC_SUBST(DBUS_CFLAGS)
   20.69 -AC_SUBST(DBUS_LIBS)
   20.70 -
   20.71 -PKG_CHECK_MODULES(GMYTH, gmyth, HAVE_GMYTH=yes, HAVE_GMYTH=no)
   20.72 -if test "x$HAVE_GMYTH" = "xno"; then
   20.73 -  AC_MSG_ERROR(you need libgmyth-dev installed)
   20.74 -fi
   20.75 -AC_SUBST(GMYTH_CFLAGS)
   20.76 -AC_SUBST(GMYTH_LIBS)
   20.77 -
   20.78 -AC_SUBST(CFLAGS)
   20.79 -AC_SUBST(LDFLAGS)
   20.80 -AC_SUBST(LIBS)
   20.81 -
   20.82 -AC_OUTPUT([
   20.83 -Makefile
   20.84 -src/Makefile
   20.85 -data/Makefile
   20.86 -data/br.org.indt.GMyth.service
   20.87 -])
   20.88 -
   20.89 -if test "x$enable_debug" != "xno"; then
   20.90 -    AC_MSG_NOTICE([Debug: Enabled])
   20.91 -else
   20.92 -    AC_MSG_NOTICE([Debug: Disabled])
   20.93 -fi
    21.1 --- a/myth-dbus/data/Makefile.am	Thu Oct 25 15:38:08 2007 +0100
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,3 +0,0 @@
    21.4 -# Dbus service file
    21.5 -servicedir = $(DBUS_SERVICES_DIR)
    21.6 -service_DATA = br.org.indt.GMyth.service
    22.1 --- a/myth-dbus/data/br.org.indt.GMyth.service.in	Thu Oct 25 15:38:08 2007 +0100
    22.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.3 @@ -1,3 +0,0 @@
    22.4 -[D-BUS Service]
    22.5 -Name=br.org.indt.GMyth
    22.6 -Exec=@prefix@/bin/gmythdbus
    23.1 --- a/myth-dbus/m4/as-expand.m4	Thu Oct 25 15:38:08 2007 +0100
    23.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.3 @@ -1,40 +0,0 @@
    23.4 -dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
    23.5 -dnl
    23.6 -dnl example
    23.7 -dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
    23.8 -dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
    23.9 -
   23.10 -AC_DEFUN([AS_AC_EXPAND],
   23.11 -[
   23.12 -  EXP_VAR=[$1]
   23.13 -  FROM_VAR=[$2]
   23.14 -
   23.15 -  dnl first expand prefix and exec_prefix if necessary
   23.16 -  prefix_save=$prefix
   23.17 -  exec_prefix_save=$exec_prefix
   23.18 -
   23.19 -  dnl if no prefix given, then use /usr/local, the default prefix
   23.20 -  if test "x$prefix" = "xNONE"; then
   23.21 -    prefix=$ac_default_prefix
   23.22 -  fi
   23.23 -  dnl if no exec_prefix given, then use prefix
   23.24 -  if test "x$exec_prefix" = "xNONE"; then
   23.25 -    exec_prefix=$prefix
   23.26 -  fi
   23.27 -
   23.28 -  full_var="$FROM_VAR"
   23.29 -  dnl loop until it doesn't change anymore
   23.30 -  while true; do
   23.31 -    new_full_var="`eval echo $full_var`"
   23.32 -    if test "x$new_full_var"="x$full_var"; then break; fi
   23.33 -    full_var=$new_full_var
   23.34 -  done
   23.35 -
   23.36 -  dnl clean up
   23.37 -  full_var=$new_full_var
   23.38 -  AC_SUBST([$1], "$full_var")
   23.39 -
   23.40 -  dnl restore prefix and exec_prefix
   23.41 -  prefix=$prefix_save
   23.42 -  exec_prefix=$exec_prefix_save
   23.43 -])
    24.1 --- a/myth-dbus/src/Makefile.am	Thu Oct 25 15:38:08 2007 +0100
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,24 +0,0 @@
    24.4 -bin_PROGRAMS = \
    24.5 -	gmythdbus
    24.6 -
    24.7 -gmythdbus_SOURCES = \
    24.8 -	gmyth-dbus-server.h \
    24.9 -	gmyth-dbus-server.c \
   24.10 -	main.c
   24.11 -
   24.12 -gmythdbus_LDADD = \
   24.13 -	$(DBUS_LIBS) \
   24.14 -	$(GMYTH_LIBS)
   24.15 -
   24.16 -AM_CPPFLAGS = \
   24.17 -	$(DBUS_CFLAGS) \
   24.18 -	$(GMYTH_CFLAGS)
   24.19 -
   24.20 -BUILT_SOURCES = \
   24.21 -	gmyth-dbus-server-glue.h
   24.22 -
   24.23 -gmyth-dbus-server-glue.h: gmyth-dbus-server.xml
   24.24 -	@DBUSBINDINGTOOL@ --mode=glib-server --prefix=gmyth_dbus_server --output=gmyth-dbus-server-glue.h  gmyth-dbus-server.xml
   24.25 -
   24.26 -CLEANFILES = \
   24.27 -	$(BUILT_SOURCES)
    25.1 --- a/myth-dbus/src/gmyth-dbus-common.h	Thu Oct 25 15:38:08 2007 +0100
    25.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.3 @@ -1,57 +0,0 @@
    25.4 -#ifndef __GMYTH_DBUS_COMMON_H__
    25.5 -#define __GMYTH_DBUS_COMMON_H__
    25.6 -
    25.7 -#define GMYTH_DBUS_SERVER_NAME      "br.org.indt.GMyth"
    25.8 -#define GMYTH_DBUS_SERVER_PATH      "/br/org/indt/GMyth"
    25.9 -#define GMYTH_DBUS_SERVER_IFACE     "br.org.indt.GMyth"
   25.10 -
   25.11 -#define GMYTH_DBUS_PROGRAM_G_TYPE \
   25.12 -    dbus_g_type_get_struct ("GValueArray", \
   25.13 -                            G_TYPE_STRING, \
   25.14 -                            G_TYPE_STRING, \
   25.15 -                            G_TYPE_STRING, \
   25.16 -                            G_TYPE_STRING, \
   25.17 -                            G_TYPE_STRING, \
   25.18 -                            G_TYPE_STRING, \
   25.19 -                            G_TYPE_STRING, \
   25.20 -                            G_TYPE_INVALID);
   25.21 -
   25.22 -#define GMYTH_DBUS_CHANNEL_G_TYPE \
   25.23 -    dbus_g_type_get_struct ("GValueArray", \
   25.24 -                            G_TYPE_INT, \
   25.25 -                            G_TYPE_STRING, \
   25.26 -                            G_TYPE_STRING, \
   25.27 -                            G_TYPE_STRING, \
   25.28 -                            G_TYPE_INVALID);
   25.29 -
   25.30 -#define GMYTH_DBUS_RECORD_G_TYPE \
   25.31 -    dbus_g_type_get_struct ("GValueArray", \
   25.32 -                            G_TYPE_UINT, \
   25.33 -                            G_TYPE_UINT, \
   25.34 -                            G_TYPE_UINT, \
   25.35 -                            G_TYPE_STRING, \
   25.36 -                            G_TYPE_STRING, \
   25.37 -                            G_TYPE_STRING, \
   25.38 -                            G_TYPE_STRING, \
   25.39 -                            G_TYPE_STRING, \
   25.40 -                            G_TYPE_STRING, \
   25.41 -                            G_TYPE_STRING, \
   25.42 -                            G_TYPE_UINT64, \
   25.43 -                            G_TYPE_INVALID);
   25.44 -
   25.45 -#define GMYTH_DBUS_SCHEDULE_G_TYPE \
   25.46 -    dbus_g_type_get_struct ("GValueArray", \
   25.47 -                            G_TYPE_UINT, \
   25.48 -                            G_TYPE_UINT, \
   25.49 -                            G_TYPE_UINT, \
   25.50 -                            G_TYPE_STRING, \
   25.51 -                            G_TYPE_STRING, \
   25.52 -                            G_TYPE_STRING, \
   25.53 -                            G_TYPE_STRING, \
   25.54 -                            G_TYPE_STRING, \
   25.55 -                            G_TYPE_STRING, \
   25.56 -                            G_TYPE_UINT, \
   25.57 -                            G_TYPE_INVALID);
   25.58 -
   25.59 -#endif
   25.60 -
    26.1 --- a/myth-dbus/src/gmyth-dbus-server.c	Thu Oct 25 15:38:08 2007 +0100
    26.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.3 @@ -1,1029 +0,0 @@
    26.4 -/**
    26.5 - * GMyth Library
    26.6 - *
    26.7 - * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    26.8 - * @author Renato Filho  <renato.filho@indt.org.br>
    26.9 - *
   26.10 - *
   26.11 - * This program is free software; you can redistribute it and/or modify
   26.12 - * it under the terms of the GNU Lesser General Public License as published by
   26.13 - * the Free Software Foundation; either version 2 of the License, or
   26.14 - * (at your option) any later version.
   26.15 - *
   26.16 - * This program is distributed in the hope that it will be useful,
   26.17 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   26.18 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   26.19 - * GNU General Public License for more details.
   26.20 - *
   26.21 - * You should have received a copy of the GNU Lesser General Public License
   26.22 - * along with this program; if not, write to the Free Software
   26.23 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   26.24 - */
   26.25 -
   26.26 -
   26.27 -#ifdef HAVE_CONFIG_H
   26.28 -#include "config.h"
   26.29 -#endif
   26.30 -
   26.31 -
   26.32 -#include <gmyth/gmyth.h>
   26.33 -#include <dbus/dbus-glib-bindings.h>
   26.34 -
   26.35 -
   26.36 -#include "gmyth-dbus-common.h"
   26.37 -#include "gmyth-dbus-server.h"
   26.38 -
   26.39 -#define MYTH_DEFAULT_DB             "mythconverg"
   26.40 -
   26.41 -typedef struct _GMythDbusServerPrivate GMythDbusServerPrivate;
   26.42 -
   26.43 -struct _GMythDbusServerPrivate
   26.44 -{
   26.45 -    GMythBackendInfo *myth_backend;
   26.46 -    GMythEPG         *myth_epg;
   26.47 -    GMythScheduler   *myth_scheduler;
   26.48 -};
   26.49 -
   26.50 -#define GMYTH_DBUS_SERVER_GET_PRIVATE(o) \
   26.51 -    (G_TYPE_INSTANCE_GET_PRIVATE ((o), GMYTH_DBUS_SERVER_TYPE, GMythDbusServerPrivate))
   26.52 -
   26.53 -static void gmyth_dbus_server_class_init (GMythDbusServerClass *klass);
   26.54 -static void gmyth_dbus_server_init       (GMythDbusServer *self);
   26.55 -static void gmyth_dbus_server_dispose    (GObject *object);
   26.56 -static void gmyth_dbus_server_finalize   (GObject *object);
   26.57 -
   26.58 -/* Dbus */
   26.59 -static gboolean gmyth_dbus_server_connect           (GObject *obj,
   26.60 -                                                     const gchar *host,
   26.61 -                                                     guint port,
   26.62 -                                                     const gchar *user,
   26.63 -                                                     const gchar *password,
   26.64 -                                                     gboolean *result,
   26.65 -                                                     GError **error);
   26.66 -static gboolean gmyth_dbus_server_get_channel_list  (GObject *obj,
   26.67 -                                                     GPtrArray **channels,
   26.68 -                                                     GError **error);
   26.69 -static gboolean gmyth_dbus_server_get_channel_info  (GObject *obj,
   26.70 -                                                     gint channel_id,
   26.71 -                                                     GValueArray **info,
   26.72 -                                                     GError **error);
   26.73 -static gboolean gmyth_dbus_server_file_exists       (GObject *obj,
   26.74 -                                                     const gchar *file_name,
   26.75 -                                                     gboolean *exists,
   26.76 -                                                     GError **error);
   26.77 -static gboolean gmyth_dbus_server_get_recorded_list (GObject *obj,
   26.78 -                                                     GPtrArray **channels,
   26.79 -                                                     GError **error);
   26.80 -static gboolean gmyth_dbus_server_get_recorded_info (GObject *obj,
   26.81 -                                                     const gchar *basename,
   26.82 -                                                     GValueArray **info,
   26.83 -                                                     GError **error);
   26.84 -static gboolean gmyth_dbus_server_get_program_list  (GObject *obj,
   26.85 -                                                     gint channel_id,
   26.86 -                                                     const gchar *start_time,
   26.87 -                                                     const gchar *end_time,
   26.88 -                                                     GPtrArray **program_list);
   26.89 -static gboolean gmyth_dbus_server_get_schedule_list (GObject *obj,
   26.90 -                                                     GPtrArray **schedule_list);
   26.91 -
   26.92 -static gboolean gmyth_dbus_server_connected         (GObject *obj,
   26.93 -                                                     gboolean *status,
   26.94 -                                                     GError **error);
   26.95 -static gboolean gmyth_dbus_server_disconnect        (GObject *obj,
   26.96 -                                                     GError **error);
   26.97 -static gboolean gmyth_dbus_server_get_server_info   (GObject *obj,
   26.98 -                                                     guint64 *total_space,
   26.99 -                                                     guint64 *used_space,
  26.100 -                                                     guint64 *free_space,
  26.101 -                                                     GError **error);
  26.102 -static gboolean gmyth_dbus_server_get_thumbnail     (GObject *obj,
  26.103 -                                                     const gchar *uri,
  26.104 -                                                     GByteArray **image,
  26.105 -                                                     GError **error);
  26.106 -static gboolean gmyth_dbus_server_get_channel_icon  (GObject *obj,
  26.107 -                                                     guint channel_id,
  26.108 -                                                     GByteArray **icon,
  26.109 -                                                     GError **error);
  26.110 -static gboolean gmyth_dbus_server_stop_recording    (GObject *obj,
  26.111 -                                                     guint channel_id,
  26.112 -                                                     gboolean *result,
  26.113 -                                                     GError **error);
  26.114 -static gboolean gmyth_dbus_server_add_schedule      (GObject *obj,
  26.115 -                                                     guint channel_id,
  26.116 -                                                     guint program_id,
  26.117 -                                                     const gchar *start_time,
  26.118 -                                                     const gchar *end_time,
  26.119 -                                                     gboolean recurring,
  26.120 -                                                     const gchar *description,
  26.121 -                                                     guint *schedule_id,
  26.122 -                                                     GError **error);
  26.123 -static gboolean gmyth_dbus_server_add_exception     (GObject *obj,
  26.124 -                                                     guint schedule_id,
  26.125 -                                                     guint channel_id,
  26.126 -                                                     guint program_id,
  26.127 -                                                     const gchar *start_time,
  26.128 -                                                     const gchar *end_time,
  26.129 -                                                     const gchar *description,
  26.130 -                                                     GError **error);
  26.131 -static gboolean gmyth_dbus_server_remove_schedule   (GObject *obj,
  26.132 -                                                     guint schedule_id,
  26.133 -                                                     GError **error);
  26.134 -
  26.135 -
  26.136 -#include "gmyth-dbus-server-glue.h"
  26.137 -
  26.138 -
  26.139 -G_DEFINE_TYPE (GMythDbusServer, gmyth_dbus_server, G_TYPE_OBJECT);
  26.140 -
  26.141 -static void
  26.142 -gmyth_dbus_server_class_init (GMythDbusServerClass *klass)
  26.143 -{
  26.144 -    GObjectClass *object_class = G_OBJECT_CLASS (klass);
  26.145 -
  26.146 -    g_type_class_add_private (klass, sizeof (GMythDbusServerPrivate));
  26.147 -
  26.148 -    object_class->dispose = gmyth_dbus_server_dispose;
  26.149 -    object_class->finalize = gmyth_dbus_server_finalize;
  26.150 -
  26.151 -    dbus_g_object_type_install_info (GMYTH_DBUS_SERVER_TYPE,
  26.152 -                                     &dbus_glib_gmyth_dbus_server_object_info);
  26.153 -}
  26.154 -
  26.155 -static void
  26.156 -gmyth_dbus_server_init (GMythDbusServer *self)
  26.157 -{
  26.158 -}
  26.159 -
  26.160 -static void
  26.161 -gmyth_dbus_server_dispose (GObject *object)
  26.162 -{
  26.163 -    G_OBJECT_CLASS (gmyth_dbus_server_parent_class)->dispose (object);
  26.164 -}
  26.165 -
  26.166 -static void
  26.167 -gmyth_dbus_server_finalize (GObject *object)
  26.168 -{
  26.169 -    G_OBJECT_CLASS (gmyth_dbus_server_parent_class)->finalize (object);
  26.170 -}
  26.171 -
  26.172 -static gboolean
  26.173 -gmyth_dbus_server_connect_epg (GMythDbusServer *server)
  26.174 -{
  26.175 -    GMythDbusServerPrivate *priv;
  26.176 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (server);
  26.177 -
  26.178 -    if (!priv->myth_epg)
  26.179 -    {
  26.180 -        priv->myth_epg = gmyth_epg_new();
  26.181 -        if (!gmyth_epg_connect (priv->myth_epg, priv->myth_backend))
  26.182 -        {
  26.183 -            g_object_unref (priv->myth_epg);
  26.184 -            priv->myth_epg = NULL;
  26.185 -            return FALSE;
  26.186 -        }
  26.187 -    }
  26.188 -
  26.189 -    return TRUE;
  26.190 -}
  26.191 -
  26.192 -static gboolean
  26.193 -gmyth_dbus_server_connect_scheduler (GMythDbusServer *server)
  26.194 -{
  26.195 -    GMythDbusServerPrivate *priv;
  26.196 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (server);
  26.197 -
  26.198 -    if (!priv->myth_scheduler)
  26.199 -    {
  26.200 -        priv->myth_scheduler = gmyth_scheduler_new ();
  26.201 -        if (!gmyth_scheduler_connect (priv->myth_scheduler,
  26.202 -                                      priv->myth_backend))
  26.203 -        {
  26.204 -            g_object_unref (priv->myth_scheduler);
  26.205 -            priv->myth_scheduler = NULL;
  26.206 -            return FALSE;
  26.207 -        }
  26.208 -    }
  26.209 -
  26.210 -    return TRUE;
  26.211 -}
  26.212 -
  26.213 -static gboolean
  26.214 -gmyth_dbus_server_connect  (GObject *obj,
  26.215 -                            const gchar *host,
  26.216 -                            guint port,
  26.217 -                            const gchar *user,
  26.218 -                            const gchar *password,
  26.219 -                            gboolean *result,
  26.220 -                            GError **error)
  26.221 -{
  26.222 -    GMythDbusServerPrivate *priv;
  26.223 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  26.224 -
  26.225 -    if (priv->myth_backend)
  26.226 -        return TRUE;
  26.227 -
  26.228 -    priv->myth_backend = gmyth_backend_info_new_full (host,
  26.229 -                                                      user,
  26.230 -                                                      password,
  26.231 -                                                      MYTH_DEFAULT_DB,
  26.232 -                                                      port);
  26.233 -    *result = TRUE;
  26.234 -    return TRUE;
  26.235 -}
  26.236 -
  26.237 -static gboolean
  26.238 -gmyth_dbus_server_connected (GObject *obj,
  26.239 -                             gboolean *status,
  26.240 -                             GError **error)
  26.241 -{
  26.242 -    GMythDbusServerPrivate *priv;
  26.243 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  26.244 -
  26.245 -    if (priv->myth_backend)
  26.246 -        *status = TRUE;
  26.247 -    else
  26.248 -        *status = FALSE;
  26.249 -    return TRUE;
  26.250 -}
  26.251 -
  26.252 -static gboolean
  26.253 -gmyth_dbus_server_disconnect (GObject *obj,
  26.254 -                              GError **error)
  26.255 -{
  26.256 -    GMythDbusServerPrivate *priv;
  26.257 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  26.258 -
  26.259 -    if (priv->myth_epg)
  26.260 -    {
  26.261 -        g_object_unref (priv->myth_epg);
  26.262 -        priv->myth_epg = NULL;
  26.263 -    }
  26.264 -
  26.265 -
  26.266 -    if (priv->myth_backend)
  26.267 -    {
  26.268 -        g_object_unref (priv->myth_backend);
  26.269 -        priv->myth_backend = NULL;
  26.270 -    }
  26.271 -
  26.272 -    if (priv->myth_scheduler)
  26.273 -    {
  26.274 -        g_object_unref (priv->myth_scheduler);
  26.275 -        priv->myth_scheduler = NULL;
  26.276 -    }
  26.277 -
  26.278 -
  26.279 -    return TRUE;
  26.280 -}
  26.281 -
  26.282 -static gboolean
  26.283 -gmyth_dbus_server_get_server_info (GObject *obj,
  26.284 -                                   guint64 *total_space,
  26.285 -                                   guint64 *used_space,
  26.286 -                                   guint64 *free_space,
  26.287 -                                   GError **error)
  26.288 -{
  26.289 -    GMythBackendDetails *details;
  26.290 -    GMythDbusServerPrivate *priv;
  26.291 -    gboolean ret = FALSE;
  26.292 -    GMythSocket *socket;
  26.293 -
  26.294 -    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  26.295 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  26.296 -
  26.297 -    g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
  26.298 -
  26.299 -    socket = gmyth_backend_info_get_connected_socket (priv->myth_backend);
  26.300 -
  26.301 -    details = NULL;
  26.302 -    gmyth_util_get_backend_details (socket,
  26.303 -                                    &details);
  26.304 -    if (details)
  26.305 -    {
  26.306 -        *total_space = details->total_space;
  26.307 -        *used_space = details->used_space;
  26.308 -        *free_space = *total_space - *used_space;
  26.309 -        gmyth_util_backend_details_free (details);
  26.310 -
  26.311 -        ret = TRUE;
  26.312 -    }
  26.313 -
  26.314 -    g_object_unref (socket);
  26.315 -
  26.316 -    return ret;
  26.317 -}
  26.318 -
  26.319 -
  26.320 -static void
  26.321 -gmyth_dbus_server_parse_channel_info (GMythChannelInfo *info,
  26.322 -                                      GValue *val)
  26.323 -{
  26.324 -    dbus_g_type_struct_set (val,
  26.325 -                            0, info->channel_ID,
  26.326 -                            1, info->channel_num->str,
  26.327 -                            2, info->channel_name->str,
  26.328 -                            3, info->channel_icon->str,
  26.329 -                            G_MAXUINT);
  26.330 -}
  26.331 -
  26.332 -static gboolean 
  26.333 -gmyth_dbus_server_get_channel_info  (GObject *obj,
  26.334 -                                     gint channel_id,
  26.335 -                                     GValueArray **info,
  26.336 -                                     GError **error)
  26.337 -{
  26.338 -    GType ch_type;
  26.339 -    GMythChannelInfo *ch_info;
  26.340 -    GMythDbusServerPrivate *priv;
  26.341 -
  26.342 -    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  26.343 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  26.344 -
  26.345 -    g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
  26.346 -    g_return_val_if_fail (gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)), FALSE);
  26.347 -
  26.348 -    ch_type = GMYTH_DBUS_CHANNEL_G_TYPE;
  26.349 -
  26.350 -    ch_info = gmyth_epg_get_channel_info (priv->myth_epg, channel_id);
  26.351 -    if (ch_info)
  26.352 -    {
  26.353 -        GValue v = { 0, };
  26.354 -        g_value_init (&v, ch_type);
  26.355 -        g_value_take_boxed (&v, dbus_g_type_specialized_construct (ch_type));
  26.356 -        gmyth_dbus_server_parse_channel_info (ch_info, &v);
  26.357 -
  26.358 -        *info = g_value_get_boxed (&v);
  26.359 -        return TRUE;
  26.360 -    }
  26.361 -
  26.362 -    return FALSE;
  26.363 -}
  26.364 -
  26.365 -
  26.366 -static gboolean
  26.367 -gmyth_dbus_server_get_channel_list (GObject *obj,
  26.368 -                                    GPtrArray **channels,
  26.369 -                                    GError **error)
  26.370 -{
  26.371 -    GList *lst;
  26.372 -    GList *walk;
  26.373 -    int len;
  26.374 -    GType ch_type;
  26.375 -    GMythDbusServerPrivate *priv;
  26.376 -
  26.377 -    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  26.378 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  26.379 -
  26.380 -    g_return_val_if_fail (priv->myth_backend != NULL, FALSE);
  26.381 -    g_return_val_if_fail (gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)), FALSE);
  26.382 -
  26.383 -
  26.384 -    len = gmyth_epg_get_channel_list (priv->myth_epg, &lst);
  26.385 -
  26.386 -    *channels = g_ptr_array_sized_new (len);
  26.387 -    ch_type = GMYTH_DBUS_CHANNEL_G_TYPE;
  26.388 -
  26.389 -    for (walk = lst; walk != NULL; walk = walk->next)
  26.390 -    {
  26.391 -        GValue ch = { 0, };
  26.392 -        GMythChannelInfo *data;
  26.393 -
  26.394 -        data = (GMythChannelInfo *) walk->data;
  26.395 -
  26.396 -        g_value_init (&ch, ch_type);
  26.397 -        g_value_take_boxed (&ch, dbus_g_type_specialized_construct (ch_type));
  26.398 -        gmyth_dbus_server_parse_channel_info (data, &ch);
  26.399 -        g_ptr_array_add (*channels, g_value_get_boxed (&ch));
  26.400 -    }
  26.401 -
  26.402 -    gmyth_free_channel_list (lst);
  26.403 -    return TRUE;
  26.404 -}
  26.405 -
  26.406 -static gboolean
  26.407 -gmyth_dbus_server_file_exists (GObject *obj,
  26.408 -                               const gchar *file_name,
  26.409 -                               gboolean *exists,
  26.410 -                               GError **error)
  26.411 -{
  26.412 -    GMythDbusServerPrivate *priv;
  26.413 -    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  26.414 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  26.415 -
  26.416 -    g_return_val_if_fail (priv->myth_backend, FALSE);
  26.417 -
  26.418 -    *exists = gmyth_util_file_exists (priv->myth_backend, file_name);
  26.419 -
  26.420 -    return TRUE;
  26.421 -}
  26.422 -
  26.423 -static gboolean
  26.424 -gmyth_dbus_server_get_program_list (GObject *obj,
  26.425 -                                    gint channel_id,
  26.426 -                                    const gchar *start_time,
  26.427 -                                    const gchar *end_time,
  26.428 -                                    GPtrArray **programs)
  26.429 -{
  26.430 -    GList *list;
  26.431 -    GList *walk;
  26.432 -    gint len;
  26.433 -    GType program_type;
  26.434 -    GTimeVal start_time_val;
  26.435 -    GTimeVal end_time_val;
  26.436 -    GMythDbusServerPrivate *priv;
  26.437 -
  26.438 -    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  26.439 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  26.440 -
  26.441 -    g_return_val_if_fail (priv->myth_backend, FALSE);
  26.442 -    g_return_val_if_fail (gmyth_dbus_server_connect_epg (GMYTH_DBUS_SERVER (obj)), FALSE);
  26.443 -
  26.444 -    g_time_val_from_iso8601 (start_time, &start_time_val);
  26.445 -    g_time_val_from_iso8601 (end_time, &end_time_val);
  26.446 -
  26.447 -    list = NULL;
  26.448 -    len = gmyth_epg_get_program_list (priv->myth_epg,
  26.449 -                                      &list,
  26.450 -                                      channel_id,
  26.451 -                                      &start_time_val,
  26.452 -                                      &end_time_val);
  26.453 -
  26.454 -    *programs = g_ptr_array_sized_new (len);
  26.455 -    program_type = GMYTH_DBUS_PROGRAM_G_TYPE;
  26.456 -
  26.457 -    for (walk = list; walk != NULL; walk = walk->next)
  26.458 -    {
  26.459 -        GValue program = { 0, };
  26.460 -        gchar *start_str;
  26.461 -        gchar *end_str;
  26.462 -        GMythProgramInfo *data;
  26.463 -
  26.464 -        data = (GMythProgramInfo *) walk->data;
  26.465 -
  26.466 -        if (!data)
  26.467 -            continue;
  26.468 -
  26.469 -        g_value_init (&program, program_type);
  26.470 -        g_value_take_boxed (&program,
  26.471 -                            dbus_g_type_specialized_construct (program_type));
  26.472 -
  26.473 -        start_str = g_time_val_to_iso8601 (data->startts);
  26.474 -        end_str = g_time_val_to_iso8601 (data->endts);
  26.475 -
  26.476 -        dbus_g_type_struct_set (&program,
  26.477 -                                0, data->chanid->str,
  26.478 -                                1, start_str,
  26.479 -                                2, end_str,
  26.480 -                                3, data->title->str,
  26.481 -                                4, data->subtitle->str,
  26.482 -                                5, data->description->str,
  26.483 -                                6, data->category->str,
  26.484 -                                G_MAXUINT);
  26.485 -
  26.486 -        g_ptr_array_add (*programs, g_value_get_boxed (&program));
  26.487 -        g_free (start_str);
  26.488 -        g_free (end_str);
  26.489 -    }
  26.490 -
  26.491 -    if (list)
  26.492 -        gmyth_free_program_list (list);
  26.493 -
  26.494 -    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  26.495 -    return TRUE;
  26.496 -}
  26.497 -
  26.498 -static void
  26.499 -gmyth_dbus_server_parse_recorded_info (RecordedInfo *info,
  26.500 -                                       GValue *val)
  26.501 -{
  26.502 -    gchar *start_str;
  26.503 -    gchar *end_str;
  26.504 -
  26.505 -    start_str = g_time_val_to_iso8601 (info->start_time);
  26.506 -    end_str = g_time_val_to_iso8601 (info->end_time);
  26.507 -
  26.508 -    dbus_g_type_struct_set (val,
  26.509 -                            0, info->record_id,
  26.510 -                            1, info->program_id,
  26.511 -                            2, info->channel_id,
  26.512 -                            3, start_str,
  26.513 -                            4, end_str,
  26.514 -                            5, info->title->str,
  26.515 -                            6, info->subtitle->str,
  26.516 -                            7, info->description->str,
  26.517 -                            8, info->category->str,
  26.518 -                            9, info->basename->str,
  26.519 -                            10, info->filesize,
  26.520 -                            G_MAXUINT);
  26.521 -    g_free (start_str);
  26.522 -    g_free (end_str);
  26.523 -}
  26.524 -
  26.525 -static gboolean
  26.526 -gmyth_dbus_server_get_recorded_info (GObject *obj,
  26.527 -                                     const gchar *basename,
  26.528 -                                     GValueArray **info,
  26.529 -                                     GError **error)
  26.530 -{
  26.531 -    GType record_type;
  26.532 -    GMythDbusServerPrivate *priv;
  26.533 -    RecordedInfo *record_info;
  26.534 -
  26.535 -
  26.536 -    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  26.537 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  26.538 -
  26.539 -    g_return_val_if_fail (priv->myth_backend, FALSE);
  26.540 -    g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
  26.541 -
  26.542 -    record_type = GMYTH_DBUS_RECORD_G_TYPE;
  26.543 -
  26.544 -    record_info = gmyth_scheduler_get_recorded_info (priv->myth_scheduler,
  26.545 -                                                     basename);
  26.546 -
  26.547 -    if (record_info)
  26.548 -    {
  26.549 -        GValue r = { 0, };
  26.550 -
  26.551 -        g_value_init (&r, record_type);
  26.552 -        g_value_take_boxed (&r,
  26.553 -                            dbus_g_type_specialized_construct (record_type));
  26.554 -
  26.555 -        gmyth_dbus_server_parse_recorded_info (record_info, &r);
  26.556 -        gmyth_recorded_info_free (record_info);
  26.557 -
  26.558 -        *info = g_value_get_boxed (&r);
  26.559 -
  26.560 -        return TRUE;
  26.561 -    }
  26.562 -
  26.563 -    return FALSE;
  26.564 -}
  26.565 -
  26.566 -
  26.567 -static gboolean
  26.568 -gmyth_dbus_server_get_recorded_list (GObject *obj,
  26.569 -                                     GPtrArray **records,
  26.570 -                                     GError **error)
  26.571 -{
  26.572 -    GList *list;
  26.573 -    GList *walk;
  26.574 -    gint len;
  26.575 -    GType record_type;
  26.576 -    GMythDbusServerPrivate *priv;
  26.577 -
  26.578 -    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  26.579 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  26.580 -
  26.581 -    g_return_val_if_fail (priv->myth_backend, FALSE);
  26.582 -    g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
  26.583 -
  26.584 -
  26.585 -    len = gmyth_scheduler_get_recorded_list (priv->myth_scheduler,
  26.586 -                                             &list);
  26.587 -
  26.588 -    record_type = GMYTH_DBUS_RECORD_G_TYPE;
  26.589 -    *records = g_ptr_array_sized_new (len);
  26.590 -
  26.591 -    for (walk = list; walk != NULL; walk = walk->next)
  26.592 -    {
  26.593 -        GValue record = { 0, };
  26.594 -        RecordedInfo *data;
  26.595 -
  26.596 -        data = (RecordedInfo *) walk->data;
  26.597 -
  26.598 -        g_value_init (&record, record_type);
  26.599 -        g_value_take_boxed (&record,
  26.600 -                            dbus_g_type_specialized_construct (record_type));
  26.601 -
  26.602 -        gmyth_dbus_server_parse_recorded_info (data, &record);
  26.603 -
  26.604 -        g_ptr_array_add (*records, g_value_get_boxed (&record));
  26.605 -        //g_value_unset (&record);
  26.606 -    }
  26.607 -
  26.608 -    gmyth_recorded_info_list_free (list);
  26.609 -
  26.610 -    return TRUE;
  26.611 -
  26.612 -}
  26.613 -
  26.614 -static gboolean
  26.615 -gmyth_dbus_server_get_schedule_list (GObject *obj,
  26.616 -                                     GPtrArray **schedules)
  26.617 -{
  26.618 -    GList *list;
  26.619 -    GList *walk;
  26.620 -    gint len;
  26.621 -    GType schedule_type;
  26.622 -    GMythDbusServerPrivate *priv;
  26.623 -
  26.624 -    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  26.625 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  26.626 -
  26.627 -    g_return_val_if_fail (priv->myth_backend, FALSE);
  26.628 -    g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
  26.629 -
  26.630 -
  26.631 -    len = gmyth_scheduler_get_schedule_list (priv->myth_scheduler,
  26.632 -                                             &list);
  26.633 -
  26.634 -    *schedules = g_ptr_array_sized_new (len);
  26.635 -    schedule_type = GMYTH_DBUS_SCHEDULE_G_TYPE;
  26.636 -
  26.637 -    for (walk = list; walk != NULL; walk = walk->next)
  26.638 -    {
  26.639 -        GValue schedule = { 0, };
  26.640 -        ScheduleInfo *data;
  26.641 -        gchar *start_str_time;
  26.642 -        gchar *end_str_time;
  26.643 -
  26.644 -        data = (ScheduleInfo *) walk->data;
  26.645 -
  26.646 -        g_value_init (&schedule, schedule_type);
  26.647 -        g_value_take_boxed (&schedule,
  26.648 -                            dbus_g_type_specialized_construct (schedule_type));
  26.649 -
  26.650 -        start_str_time = g_time_val_to_iso8601 (data->start_time);
  26.651 -        end_str_time = g_time_val_to_iso8601 (data->end_time);
  26.652 -
  26.653 -        dbus_g_type_struct_set (&schedule,
  26.654 -                            0, data->schedule_id,
  26.655 -                            1, data->program_id,
  26.656 -                            2, data->channel_id,
  26.657 -                            3, start_str_time,
  26.658 -                            4, end_str_time,
  26.659 -                            5, data->title->str,
  26.660 -                            6, data->subtitle->str,
  26.661 -                            7, data->description->str,
  26.662 -                            8, data->category->str,
  26.663 -                            9, data->type,
  26.664 -                            G_MAXUINT);
  26.665 -
  26.666 -        g_ptr_array_add (*schedules, g_value_get_boxed (&schedule));
  26.667 -
  26.668 -        g_free (start_str_time);
  26.669 -        g_free (end_str_time);
  26.670 -    }
  26.671 -
  26.672 -    gmyth_schedule_info_list_free (list);
  26.673 -
  26.674 -    return TRUE;
  26.675 -}
  26.676 -
  26.677 -
  26.678 -static gboolean
  26.679 -gmyth_dbus_server_get_thumbnail (GObject *obj,
  26.680 -                                const gchar *uri,
  26.681 -                                GByteArray **image,
  26.682 -                                GError **error)
  26.683 -{
  26.684 -    GMythFileTransfer *file_transfer;
  26.685 -    glong filesize;
  26.686 -    GMythFileReadResult result;
  26.687 -    GMythDbusServerPrivate *priv;
  26.688 -
  26.689 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  26.690 -
  26.691 -    g_return_val_if_fail (priv->myth_backend, FALSE);
  26.692 -
  26.693 -    if (!gmyth_util_file_exists (priv->myth_backend, uri))
  26.694 -        goto fail;
  26.695 -
  26.696 -    file_transfer = gmyth_file_transfer_new (priv->myth_backend);
  26.697 -
  26.698 -    if (!gmyth_file_transfer_open (file_transfer, uri))
  26.699 -        goto fail;
  26.700 -
  26.701 -    filesize = gmyth_file_transfer_get_filesize (file_transfer);
  26.702 -    if (filesize <= 0)
  26.703 -        goto fail;
  26.704 -
  26.705 -    *image = g_byte_array_new ();
  26.706 -    result = gmyth_file_transfer_read (file_transfer, *image, filesize, FALSE);
  26.707 -    if (result == GMYTH_FILE_READ_ERROR)
  26.708 -       goto fail;
  26.709 -
  26.710 -    gmyth_file_transfer_close (file_transfer);
  26.711 -    g_object_unref (file_transfer);
  26.712 -
  26.713 -    if (filesize > (*image)->len)
  26.714 -        goto fail;
  26.715 -
  26.716 -    return TRUE;
  26.717 -
  26.718 -fail:
  26.719 -    if (*image)
  26.720 -        g_byte_array_free (*image, TRUE);
  26.721 -    g_object_unref(file_transfer);
  26.722 -    return FALSE;
  26.723 -}
  26.724 -
  26.725 -static gboolean
  26.726 -gmyth_dbus_server_get_channel_icon (GObject *obj,
  26.727 -                                    guint channel_id,
  26.728 -                                    GByteArray **icon,
  26.729 -                                    GError **error)
  26.730 -{
  26.731 -    GMythChannelInfo *channel = NULL;
  26.732 -    guint8 *icon_data;
  26.733 -    guint icon_length;
  26.734 -    GMythDbusServerPrivate *priv;
  26.735 -
  26.736 -    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  26.737 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  26.738 -    g_return_val_if_fail (priv->myth_backend, FALSE);
  26.739 -
  26.740 -    channel = gmyth_epg_get_channel_info (priv->myth_epg,
  26.741 -                                         (gint) channel_id);
  26.742 -
  26.743 -    *icon = NULL;
  26.744 -
  26.745 -    if (channel == NULL)
  26.746 -        return FALSE;
  26.747 -
  26.748 -    if (!gmyth_epg_channel_has_icon(priv->myth_epg, channel))
  26.749 -    {
  26.750 -        gmyth_channel_info_free (channel);
  26.751 -        g_debug("Channel does not have icon available");
  26.752 -        return FALSE;
  26.753 -    }
  26.754 -
  26.755 -    icon_data = NULL;
  26.756 -    icon_length = 0;
  26.757 -    if (!gmyth_epg_channel_get_icon (priv->myth_epg,
  26.758 -                                     channel,
  26.759 -                                     &icon_data,
  26.760 -                                     &icon_length)) 
  26.761 -    {
  26.762 -        gmyth_channel_info_free (channel);
  26.763 -        g_warning("Could not get channel icon for channel id = %u", channel_id);
  26.764 -        return FALSE;
  26.765 -    }
  26.766 -
  26.767 -    *icon = g_byte_array_sized_new (icon_length);
  26.768 -    *icon = g_byte_array_append (*icon, icon_data, icon_length);
  26.769 -
  26.770 -    g_free (icon_data);
  26.771 -    gmyth_channel_info_free(channel);
  26.772 -    return TRUE;
  26.773 -}
  26.774 -
  26.775 -
  26.776 -static gboolean
  26.777 -gmyth_dbus_server_stop_recording (GObject *obj,
  26.778 -                                  guint channel_id,
  26.779 -                                  gboolean *result,
  26.780 -                                  GError **error)
  26.781 -{
  26.782 -    gboolean ret = FALSE;
  26.783 -    GMythDbusServerPrivate *priv;
  26.784 -
  26.785 -    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  26.786 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  26.787 -
  26.788 -    g_return_val_if_fail (priv->myth_backend, FALSE);
  26.789 -    g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
  26.790 -
  26.791 -    ret = gmyth_scheduler_stop_recording (priv->myth_scheduler,
  26.792 -                                          channel_id);
  26.793 -
  26.794 -    return ret;
  26.795 -}
  26.796 -
  26.797 -static ScheduleInfo*
  26.798 -gmyth_dbus_server_new_schedule_info (const gchar* description,
  26.799 -                                     guint channel_id,
  26.800 -                                     guint program_id,
  26.801 -                                     GTimeVal *start_vtime,
  26.802 -                                     GTimeVal *end_vtime)
  26.803 -{
  26.804 -    ScheduleInfo   *new_sched_info;
  26.805 -
  26.806 -    new_sched_info = g_new0(ScheduleInfo, 1);
  26.807 -
  26.808 -    /* record_id == -1 for generating a new id */
  26.809 -    new_sched_info->schedule_id = -1;
  26.810 -
  26.811 -    new_sched_info->channel_id = channel_id;
  26.812 -    new_sched_info->program_id = program_id;
  26.813 -    new_sched_info->start_time = g_new0 (GTimeVal, 1);
  26.814 -    *new_sched_info->start_time = *start_vtime;
  26.815 -    new_sched_info->end_time = g_new0 (GTimeVal, 1);
  26.816 -    *new_sched_info->end_time = *end_vtime;
  26.817 -
  26.818 -    /* TODO: there is no frequency field */
  26.819 -    /*new_sched_info->frequency = -1;*/
  26.820 -
  26.821 -    if (description != NULL) {
  26.822 -        /* FIXME: description parameter is used as title and description */
  26.823 -        new_sched_info->title = g_string_new(description);
  26.824 -        new_sched_info->description = g_string_new(description);
  26.825 -    }
  26.826 -
  26.827 -    return new_sched_info;
  26.828 -}
  26.829 -
  26.830 -static gboolean
  26.831 -gmyth_dbus_server_add_schedule (GObject *obj,
  26.832 -                                guint channel_id,
  26.833 -                                guint program_id,
  26.834 -                                const gchar *start_time,
  26.835 -                                const gchar *end_time,
  26.836 -                                gboolean recurring,
  26.837 -                                const gchar *description,
  26.838 -                                guint *schedule_id,
  26.839 -                                GError **error)
  26.840 -{
  26.841 -    ScheduleInfo *sch_info;
  26.842 -    GTimeVal start_vtime;
  26.843 -    GTimeVal end_vtime;
  26.844 -    GMythDbusServerPrivate *priv;
  26.845 -
  26.846 -    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  26.847 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  26.848 -
  26.849 -    *schedule_id = 0;
  26.850 -
  26.851 -    g_return_val_if_fail (priv->myth_backend, FALSE);
  26.852 -    g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
  26.853 -
  26.854 -
  26.855 -    g_time_val_from_iso8601 (start_time, &start_vtime);
  26.856 -    g_time_val_from_iso8601 (end_time, &end_vtime);
  26.857 -    sch_info = gmyth_dbus_server_new_schedule_info (description,
  26.858 -                                                    channel_id,
  26.859 -                                                    program_id,
  26.860 -                                                    &start_vtime,
  26.861 -                                                    &end_vtime);
  26.862 -    if (sch_info != NULL) {
  26.863 -        GMythScheduleType type;
  26.864 -        GTimeVal t_now;
  26.865 -        gboolean has_record;
  26.866 -
  26.867 -        type = (recurring ?
  26.868 -                GMYTH_SCHEDULE_ALL_OCCURRENCES :
  26.869 -                GMYTH_SCHEDULE_ONE_OCCURRENCE);
  26.870 -
  26.871 -        g_get_current_time (&t_now);
  26.872 -
  26.873 -        has_record = gmyth_scheduler_was_recorded_before (priv->myth_scheduler, 
  26.874 -                                                          channel_id,
  26.875 -                                                          (time_t) start_vtime.tv_sec);
  26.876 -
  26.877 -
  26.878 -        if ((t_now.tv_sec >= start_vtime.tv_sec)
  26.879 -            && (t_now.tv_sec <= end_vtime.tv_sec) && has_record)
  26.880 -        {
  26.881 -            GMythSocket    *socket;
  26.882 -            gboolean        res = FALSE;
  26.883 -
  26.884 -            socket = gmyth_backend_info_get_connected_socket (priv->myth_backend);
  26.885 -            res = gmyth_scheduler_reactivate_schedule(priv->myth_scheduler,
  26.886 -                                                      channel_id,
  26.887 -                                                      (time_t) start_vtime.tv_sec);
  26.888 -            if (res) {
  26.889 -                GMythStringList *slist = gmyth_string_list_new();
  26.890 -
  26.891 -                gmyth_string_list_append_char_array(slist, "RESCHEDULE_RECORDINGS 0");
  26.892 -                gmyth_socket_sendreceive_stringlist(socket, slist);
  26.893 -                res = (gmyth_string_list_get_int(slist, 0) == 1);
  26.894 -                g_object_unref(slist);
  26.895 -            }
  26.896 -
  26.897 -            g_object_unref(socket);
  26.898 -            return res;
  26.899 -        }
  26.900 -        else
  26.901 -        {
  26.902 -            if (!gmyth_scheduler_add_schedule_full (priv->myth_scheduler,
  26.903 -                                                    sch_info,
  26.904 -                                                    type))
  26.905 -            {
  26.906 -                g_warning("Could not add schedule entry");
  26.907 -                return FALSE;
  26.908 -            }
  26.909 -
  26.910 -            (*schedule_id) = sch_info->schedule_id;
  26.911 -            gmyth_schedule_info_free (sch_info);
  26.912 -            return TRUE;
  26.913 -        }
  26.914 -    }
  26.915 -    return FALSE;
  26.916 -}
  26.917 -
  26.918 -static gboolean
  26.919 -gmyth_dbus_server_add_exception (GObject *obj,
  26.920 -                                 guint schedule_id,
  26.921 -                                 guint channel_id,
  26.922 -                                 guint program_id,
  26.923 -                                 const gchar *start_time,
  26.924 -                                 const gchar *end_time,
  26.925 -                                 const gchar *description,
  26.926 -                                 GError **error)
  26.927 -{
  26.928 -    ScheduleInfo *sch_info;
  26.929 -    GTimeVal start_vtime;
  26.930 -    GTimeVal end_vtime;
  26.931 -    GMythDbusServerPrivate *priv;
  26.932 -
  26.933 -    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  26.934 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  26.935 -
  26.936 -    g_return_val_if_fail (priv->myth_backend, FALSE);
  26.937 -    g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
  26.938 -
  26.939 -    g_time_val_from_iso8601 (start_time, &start_vtime);
  26.940 -    g_time_val_from_iso8601 (end_time, &end_vtime);
  26.941 -
  26.942 -    sch_info = gmyth_dbus_server_new_schedule_info (description,
  26.943 -                                                   channel_id,
  26.944 -                                                   program_id,
  26.945 -                                                   &start_vtime,
  26.946 -                                                   &end_vtime);
  26.947 -    if (sch_info != NULL)
  26.948 -    {
  26.949 -       if (!gmyth_scheduler_add_exception (priv->myth_scheduler,
  26.950 -                                           schedule_id,
  26.951 -                                           sch_info))
  26.952 -       {
  26.953 -           g_warning ("Could not add schedule exception");
  26.954 -           gmyth_schedule_info_free (sch_info);
  26.955 -           return FALSE;
  26.956 -       }
  26.957 -
  26.958 -       gmyth_schedule_info_free (sch_info);
  26.959 -       return TRUE;
  26.960 -    }
  26.961 -    return FALSE;
  26.962 -}
  26.963 -
  26.964 -static gboolean
  26.965 -gmyth_dbus_server_remove_schedule (GObject *obj,
  26.966 -                                   guint schedule_id,
  26.967 -                                   GError **error)
  26.968 -{
  26.969 -    GMythDbusServerPrivate *priv;
  26.970 -
  26.971 -    g_debug ("%s:%d", __FUNCTION__, __LINE__);
  26.972 -    priv = GMYTH_DBUS_SERVER_GET_PRIVATE (obj);
  26.973 -
  26.974 -    g_return_val_if_fail (priv->myth_backend, FALSE);
  26.975 -    g_return_val_if_fail (gmyth_dbus_server_connect_scheduler (GMYTH_DBUS_SERVER (obj)), FALSE);
  26.976 -
  26.977 -    return gmyth_scheduler_delete_schedule (priv->myth_scheduler, schedule_id);
  26.978 -}
  26.979 -
  26.980 -GMythDbusServer*
  26.981 -gmyth_dbus_server_start_dbus_service (void)
  26.982 -{
  26.983 -    GError *error = NULL;
  26.984 -    DBusGProxy *proxy;
  26.985 -    DBusGConnection *bus;
  26.986 -    guint request_ret;
  26.987 -    GMythDbusServer *self;
  26.988 -
  26.989 -    self = g_object_new (GMYTH_DBUS_SERVER_TYPE, NULL);
  26.990 -    g_return_val_if_fail (self, FALSE);
  26.991 -
  26.992 -    /* TODO: should verify if this service was already started */
  26.993 -
  26.994 -    /* connect to session bus */
  26.995 -    bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
  26.996 -    if (bus == NULL) 
  26.997 -    {
  26.998 -        g_warning ("Could not connect to dbus: %s", error->message);
  26.999 -        g_error_free (error);
 26.1000 -        goto fail;
 26.1001 -    }
 26.1002 -
 26.1003 -    /* register dbus object */
 26.1004 -    dbus_g_connection_register_g_object (bus,
 26.1005 -        GMYTH_DBUS_SERVER_PATH, G_OBJECT (self));
 26.1006 -
 26.1007 -    proxy = dbus_g_proxy_new_for_name (bus, DBUS_SERVICE_DBUS,
 26.1008 -                                       DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
 26.1009 -
 26.1010 -    /* registering download manager service */
 26.1011 -    if (!org_freedesktop_DBus_request_name (proxy, GMYTH_DBUS_SERVER_IFACE,
 26.1012 -                                            0, &request_ret, &error)) 
 26.1013 -    {
 26.1014 -        g_warning ("Unable to register dbus service: %d %s",
 26.1015 -                   error->code, error->message);
 26.1016 -        g_error_free (error);
 26.1017 -        goto fail;
 26.1018 -    }
 26.1019 -
 26.1020 -    if (request_ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) 
 26.1021 -    {
 26.1022 -        g_warning ("Got result code %u from requesting name", request_ret);
 26.1023 -        goto fail;
 26.1024 -    }
 26.1025 -
 26.1026 -    return self;
 26.1027 -
 26.1028 -fail:
 26.1029 -    g_object_unref (self);
 26.1030 -    return NULL;
 26.1031 -}
 26.1032 -
    27.1 --- a/myth-dbus/src/gmyth-dbus-server.h	Thu Oct 25 15:38:08 2007 +0100
    27.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.3 @@ -1,64 +0,0 @@
    27.4 -/**
    27.5 - * GMyth Library
    27.6 - *
    27.7 - * @file gmyth/gmyth_backend_info.c
    27.8 - * 
    27.9 - * @brief <p> This component represents all the MythTV backend server
   27.10 - * 						configuration information.
   27.11 - *
   27.12 - * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
   27.13 - * @author Renato Filho  <renato.filho@indt.org.br>
   27.14 - *
   27.15 - * 
   27.16 - * This program is free software; you can redistribute it and/or modify
   27.17 - * it under the terms of the GNU Lesser General Public License as published by
   27.18 - * the Free Software Foundation; either version 2 of the License, or
   27.19 - * (at your option) any later version.
   27.20 - *
   27.21 - * This program is distributed in the hope that it will be useful,
   27.22 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   27.23 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   27.24 - * GNU General Public License for more details.
   27.25 - *
   27.26 - * You should have received a copy of the GNU Lesser General Public License
   27.27 - * along with this program; if not, write to the Free Software
   27.28 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   27.29 - */
   27.30 -
   27.31 -
   27.32 -#ifndef __GMYTH_DBUS_SERVER_H__
   27.33 -#define __GMYTH_DBUS_SERVER_H__
   27.34 -
   27.35 -#include <glib.h>
   27.36 -#include <glib-object.h>
   27.37 -
   27.38 -G_BEGIN_DECLS
   27.39 -
   27.40 -#define GMYTH_DBUS_SERVER_TYPE            (gmyth_dbus_server_get_type ())
   27.41 -#define GMYTH_DBUS_SERVER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_DBUS_SERVER_TYPE, GMythDbusServer))
   27.42 -#define GMYTH_DBUS_SERVER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_DBUS_SERVER_TYPE, GMythDbusServerClass))
   27.43 -#define IS_GMYTH_DBUS_SERVER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_DBUS_SERVER_TYPE))
   27.44 -#define IS_GMYTH_DBUS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GMYTH_DBUS_SERVER_TYPE))
   27.45 -#define GMYTH_DBUS_SERVER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_DBUS_SERVER_TYPE, GMythDbusServerClass))
   27.46 -
   27.47 -
   27.48 -typedef struct _GMythDbusServer      GMythDbusServer;
   27.49 -typedef struct _GMythDbusServerClass GMythDbusServerClass;
   27.50 -
   27.51 -struct _GMythDbusServerClass
   27.52 -{
   27.53 -    GObjectClass parent_class;
   27.54 -};
   27.55 -
   27.56 -struct _GMythDbusServer
   27.57 -{
   27.58 -    GObject parent;
   27.59 -};
   27.60 -
   27.61 -GType gmyth_dbus_server_get_type (void);
   27.62 -GMythDbusServer * gmyth_dbus_server_start_dbus_service (void);
   27.63 -
   27.64 -
   27.65 -G_END_DECLS
   27.66 -
   27.67 -#endif
    28.1 --- a/myth-dbus/src/gmyth-dbus-server.xml	Thu Oct 25 15:38:08 2007 +0100
    28.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.3 @@ -1,99 +0,0 @@
    28.4 -<?xml version="1.0" encoding="UTF-8" ?>
    28.5 -
    28.6 -<node name="/br/org/indt/GMyth">
    28.7 -  <interface name="br.org.indt.GMyth">
    28.8 -    <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="gmyth_dbus_server"/>
    28.9 -
   28.10 -    <method name="Connect">
   28.11 -      <arg type="s" name="host" direction="in" />
   28.12 -      <arg type="i" name="port" direction="in" />
   28.13 -      <arg type="s" name="user" direction="in" />
   28.14 -      <arg type="s" name="password" direction="in" />
   28.15 -    </method>
   28.16 -
   28.17 -    <method name="Connected">
   28.18 -      <arg type="b" name="status" direction="out" />
   28.19 -    </method>
   28.20 -
   28.21 -    <method name="Disconnect"/>
   28.22 -
   28.23 -    <method name="GetServerInfo">
   28.24 -      <arg type="t" name="total_space" direction="out" />
   28.25 -      <arg type="t" name="used_space" direction="out" />
   28.26 -      <arg type="t" name="free_space" direction="out" />
   28.27 -    </method>
   28.28 -
   28.29 -    <method name="GetChannelList">
   28.30 -      <arg type="a(isss)" name="channels" direction="out" />
   28.31 -    </method>
   28.32 -
   28.33 -    <method name="GetChannelInfo">
   28.34 -      <arg type="i" name="channel_id" direction="in" />
   28.35 -      <arg type="(isss)" name="details" direction="out" />
   28.36 -    </method>
   28.37 -
   28.38 -    <method name="GetProgramList">
   28.39 -      <arg type="i" name="channel" direction="in" />
   28.40 -      <arg type="s" name="start_time" direction="in" />
   28.41 -      <arg type="s" name="end_time" direction="in" />
   28.42 -      <arg type="a(sssssss)" name="program_list" direction="out" />
   28.43 -    </method>
   28.44 -
   28.45 -    <method name="GetRecordedList">
   28.46 -      <arg type="a(uuussssssst)" name="records" direction="out" />
   28.47 -    </method>
   28.48 -
   28.49 -    <method name="GetRecordedInfo">
   28.50 -      <arg type="s" name="basename" direction="in" />
   28.51 -      <arg type="(uuussssssst)" name="details" direction="out" />
   28.52 -    </method>
   28.53 -
   28.54 -    <method name="GetScheduleList">
   28.55 -      <arg type="a(uuussssu)" name="schedules" direction="out" />
   28.56 -    </method>
   28.57 -
   28.58 -    <method name="FileExists">
   28.59 -      <arg type="s" name="file_name" direction="in" />
   28.60 -      <arg type="b" name="exists" direction="out" />
   28.61 -    </method>
   28.62 -
   28.63 -    <method name="GetThumbnail">
   28.64 -      <arg type="s" name="file_name" direction="in" />
   28.65 -      <arg type="ay" name="image" direction="out" />
   28.66 -    </method>
   28.67 -
   28.68 -    <method name="GetChannelIcon">
   28.69 -      <arg type="i" name="channel_id" direction="in" />
   28.70 -      <arg type="ay" name="icon" direction="out" />
   28.71 -    </method>
   28.72 -
   28.73 -    <method name="StopRecording">
   28.74 -      <arg type="u" name="channel_id" direction="in" />
   28.75 -      <arg type="b" name="result" direction="out" />
   28.76 -    </method>
   28.77 -
   28.78 -    <method name="AddSchedule">
   28.79 -      <arg type="u" name="channel_id" direction="in" />
   28.80 -      <arg type="u" name="program_id" direction="in" />
   28.81 -      <arg type="s" name="start_time" direction="in" />
   28.82 -      <arg type="s" name="end_time" direction="in" />
   28.83 -      <arg type="b" name="recurring" direction="in" />
   28.84 -      <arg type="s" name="description" direction="in" />
   28.85 -      <arg type="u" name="schedule_id" direction="out" />
   28.86 -    </method>
   28.87 -
   28.88 -    <method name="AddException">
   28.89 -      <arg type="u" name="schedule_id" direction="in" />
   28.90 -      <arg type="u" name="program_id" direction="in" />
   28.91 -      <arg type="u" name="channel_id" direction="in" />
   28.92 -      <arg type="s" name="start_time" direction="in" />
   28.93 -      <arg type="s" name="end_time" direction="in" />
   28.94 -      <arg type="s" name="description" direction="in" />
   28.95 -    </method>
   28.96 -
   28.97 -    <method name="RemoveSchedule">
   28.98 -      <arg type="u" name="schedule_id" direction="in" />
   28.99 -    </method>
  28.100 -
  28.101 -  </interface>
  28.102 -</node>
    29.1 --- a/myth-dbus/src/main.c	Thu Oct 25 15:38:08 2007 +0100
    29.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.3 @@ -1,19 +0,0 @@
    29.4 -#include "gmyth-dbus-server.h"
    29.5 -
    29.6 -int main (int argc, char* argv[])
    29.7 -{
    29.8 -    GMainLoop *loop;
    29.9 -    GMythDbusServer *srv;
   29.10 -
   29.11 -    g_type_init ();
   29.12 -    g_thread_init (NULL);
   29.13 -
   29.14 -
   29.15 -    loop = g_main_loop_new (NULL, FALSE);
   29.16 -    srv = gmyth_dbus_server_start_dbus_service ();
   29.17 -
   29.18 -    if (srv)
   29.19 -        g_main_loop_run (loop);
   29.20 -
   29.21 -    return 0;
   29.22 -}
    30.1 --- a/myth-dbus/tests/channel-list.py	Thu Oct 25 15:38:08 2007 +0100
    30.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.3 @@ -1,12 +0,0 @@
    30.4 -import dbus
    30.5 -bus = dbus.SessionBus()
    30.6 -
    30.7 -proxy = bus.get_object ('br.org.indt.GMyth', '/br/org/indt/GMyth')
    30.8 -iface = dbus.Interface (proxy, dbus_interface='br.org.indt.GMyth')
    30.9 -iface.Connect ('192.168.2.222', 6543, 'mythtv', 'mythtv')
   30.10 -print iface.Connected ()
   30.11 -print iface.GetChannelList ()
   30.12 -print "--------------------------------------------------------"
   30.13 -print iface.GetRecordedList ()
   30.14 -#print iface.FileExists ("teste.nuv")
   30.15 -#print iface.GetProgramList (1003, ')