[svn r796] Moved maemo-ui to maemo-ui-old trunk
authormelunko
Wed Aug 01 14:50:29 2007 +0100 (2007-08-01)
branchtrunk
changeset 7907a914b3fafc1
parent 789 f9cd59844f78
child 791 cdafc5e948b8
[svn r796] Moved maemo-ui to maemo-ui-old
maemo-ui-old/AUTHORS
maemo-ui-old/COPYING
maemo-ui-old/ChangeLog
maemo-ui-old/INSTALL
maemo-ui-old/Makefile.am
maemo-ui-old/NEWS
maemo-ui-old/README
maemo-ui-old/autogen.sh
maemo-ui-old/common/Makefile.am
maemo-ui-old/common/autogen-helper.sh
maemo-ui-old/configure.ac
maemo-ui-old/m4/Makefile.am
maemo-ui-old/m4/ac_doxygen.m4
maemo-ui-old/m4/as-compiler-flag.m4
maemo-ui-old/m4/as-expand.m4
maemo-ui-old/m4/as-version.m4
maemo-ui-old/pixmaps/Makefile.am
maemo-ui-old/pixmaps/mmyth_logo.png
maemo-ui-old/src/Makefile.am
maemo-ui-old/src/mmyth_epg_grid_view.c
maemo-ui-old/src/mmyth_epg_grid_view.h
maemo-ui-old/src/mmyth_epg_grid_widget.c
maemo-ui-old/src/mmyth_epg_grid_widget.h
maemo-ui-old/src/mmyth_main.c
maemo-ui-old/src/mmyth_recordui.c
maemo-ui-old/src/mmyth_recordui.h
maemo-ui-old/src/mmyth_schedulerui.c
maemo-ui-old/src/mmyth_schedulerui.h
maemo-ui-old/src/mmyth_tvplayer.c
maemo-ui-old/src/mmyth_tvplayer.h
maemo-ui-old/src/mmyth_ui.c
maemo-ui-old/src/mmyth_ui.h
maemo-ui-old/src/mmyth_uicommon.c
maemo-ui-old/src/mmyth_uicommon.h
maemo-ui-old/src/mmyth_uisettings.c
maemo-ui-old/src/mmyth_uisettings.h
maemo-ui/AUTHORS
maemo-ui/COPYING
maemo-ui/ChangeLog
maemo-ui/INSTALL
maemo-ui/Makefile.am
maemo-ui/NEWS
maemo-ui/README
maemo-ui/autogen.sh
maemo-ui/common/Makefile.am
maemo-ui/common/autogen-helper.sh
maemo-ui/configure.ac
maemo-ui/m4/Makefile.am
maemo-ui/m4/ac_doxygen.m4
maemo-ui/m4/as-compiler-flag.m4
maemo-ui/m4/as-expand.m4
maemo-ui/m4/as-version.m4
maemo-ui/pixmaps/Makefile.am
maemo-ui/pixmaps/mmyth_logo.png
maemo-ui/src/Makefile.am
maemo-ui/src/mmyth_epg_grid_view.c
maemo-ui/src/mmyth_epg_grid_view.h
maemo-ui/src/mmyth_epg_grid_widget.c
maemo-ui/src/mmyth_epg_grid_widget.h
maemo-ui/src/mmyth_main.c
maemo-ui/src/mmyth_recordui.c
maemo-ui/src/mmyth_recordui.h
maemo-ui/src/mmyth_schedulerui.c
maemo-ui/src/mmyth_schedulerui.h
maemo-ui/src/mmyth_tvplayer.c
maemo-ui/src/mmyth_tvplayer.h
maemo-ui/src/mmyth_ui.c
maemo-ui/src/mmyth_ui.h
maemo-ui/src/mmyth_uicommon.c
maemo-ui/src/mmyth_uicommon.h
maemo-ui/src/mmyth_uisettings.c
maemo-ui/src/mmyth_uisettings.h
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/maemo-ui-old/AUTHORS	Wed Aug 01 14:50:29 2007 +0100
     1.3 @@ -0,0 +1,4 @@
     1.4 +Alexsandro Jose Virginio dos Santos <alexsandro.santos@indt.org.br>
     1.5 +Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
     1.6 +Leonardo Sobral Cunha <leonardo.cunha@indt.org.br>
     1.7 +Rosfran Lins Borges <rosfran.borges@indt.org.br>
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/maemo-ui-old/COPYING	Wed Aug 01 14:50:29 2007 +0100
     2.3 @@ -0,0 +1,504 @@
     2.4 +		  GNU LESSER GENERAL PUBLIC LICENSE
     2.5 +		       Version 2.1, February 1999
     2.6 +
     2.7 + Copyright (C) 1991, 1999 Free Software Foundation, Inc.
     2.8 +     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     2.9 + Everyone is permitted to copy and distribute verbatim copies
    2.10 + of this license document, but changing it is not allowed.
    2.11 +
    2.12 +[This is the first released version of the Lesser GPL.  It also counts
    2.13 + as the successor of the GNU Library Public License, version 2, hence
    2.14 + the version number 2.1.]
    2.15 +
    2.16 +			    Preamble
    2.17 +
    2.18 +  The licenses for most software are designed to take away your
    2.19 +freedom to share and change it.  By contrast, the GNU General Public
    2.20 +Licenses are intended to guarantee your freedom to share and change
    2.21 +free software--to make sure the software is free for all its users.
    2.22 +
    2.23 +  This license, the Lesser General Public License, applies to some
    2.24 +specially designated software packages--typically libraries--of the
    2.25 +Free Software Foundation and other authors who decide to use it.  You
    2.26 +can use it too, but we suggest you first think carefully about whether
    2.27 +this license or the ordinary General Public License is the better
    2.28 +strategy to use in any particular case, based on the explanations below.
    2.29 +
    2.30 +  When we speak of free software, we are referring to freedom of use,
    2.31 +not price.  Our General Public Licenses are designed to make sure that
    2.32 +you have the freedom to distribute copies of free software (and charge
    2.33 +for this service if you wish); that you receive source code or can get
    2.34 +it if you want it; that you can change the software and use pieces of
    2.35 +it in new free programs; and that you are informed that you can do
    2.36 +these things.
    2.37 +
    2.38 +  To protect your rights, we need to make restrictions that forbid
    2.39 +distributors to deny you these rights or to ask you to surrender these
    2.40 +rights.  These restrictions translate to certain responsibilities for
    2.41 +you if you distribute copies of the library or if you modify it.
    2.42 +
    2.43 +  For example, if you distribute copies of the library, whether gratis
    2.44 +or for a fee, you must give the recipients all the rights that we gave
    2.45 +you.  You must make sure that they, too, receive or can get the source
    2.46 +code.  If you link other code with the library, you must provide
    2.47 +complete object files to the recipients, so that they can relink them
    2.48 +with the library after making changes to the library and recompiling
    2.49 +it.  And you must show them these terms so they know their rights.
    2.50 +
    2.51 +  We protect your rights with a two-step method: (1) we copyright the
    2.52 +library, and (2) we offer you this license, which gives you legal
    2.53 +permission to copy, distribute and/or modify the library.
    2.54 +
    2.55 +  To protect each distributor, we want to make it very clear that
    2.56 +there is no warranty for the free library.  Also, if the library is
    2.57 +modified by someone else and passed on, the recipients should know
    2.58 +that what they have is not the original version, so that the original
    2.59 +author's reputation will not be affected by problems that might be
    2.60 +introduced by others.
    2.61 +
    2.62 +  Finally, software patents pose a constant threat to the existence of
    2.63 +any free program.  We wish to make sure that a company cannot
    2.64 +effectively restrict the users of a free program by obtaining a
    2.65 +restrictive license from a patent holder.  Therefore, we insist that
    2.66 +any patent license obtained for a version of the library must be
    2.67 +consistent with the full freedom of use specified in this license.
    2.68 +
    2.69 +  Most GNU software, including some libraries, is covered by the
    2.70 +ordinary GNU General Public License.  This license, the GNU Lesser
    2.71 +General Public License, applies to certain designated libraries, and
    2.72 +is quite different from the ordinary General Public License.  We use
    2.73 +this license for certain libraries in order to permit linking those
    2.74 +libraries into non-free programs.
    2.75 +
    2.76 +  When a program is linked with a library, whether statically or using
    2.77 +a shared library, the combination of the two is legally speaking a
    2.78 +combined work, a derivative of the original library.  The ordinary
    2.79 +General Public License therefore permits such linking only if the
    2.80 +entire combination fits its criteria of freedom.  The Lesser General
    2.81 +Public License permits more lax criteria for linking other code with
    2.82 +the library.
    2.83 +
    2.84 +  We call this license the "Lesser" General Public License because it
    2.85 +does Less to protect the user's freedom than the ordinary General
    2.86 +Public License.  It also provides other free software developers Less
    2.87 +of an advantage over competing non-free programs.  These disadvantages
    2.88 +are the reason we use the ordinary General Public License for many
    2.89 +libraries.  However, the Lesser license provides advantages in certain
    2.90 +special circumstances.
    2.91 +
    2.92 +  For example, on rare occasions, there may be a special need to
    2.93 +encourage the widest possible use of a certain library, so that it becomes
    2.94 +a de-facto standard.  To achieve this, non-free programs must be
    2.95 +allowed to use the library.  A more frequent case is that a free
    2.96 +library does the same job as widely used non-free libraries.  In this
    2.97 +case, there is little to gain by limiting the free library to free
    2.98 +software only, so we use the Lesser General Public License.
    2.99 +
   2.100 +  In other cases, permission to use a particular library in non-free
   2.101 +programs enables a greater number of people to use a large body of
   2.102 +free software.  For example, permission to use the GNU C Library in
   2.103 +non-free programs enables many more people to use the whole GNU
   2.104 +operating system, as well as its variant, the GNU/Linux operating
   2.105 +system.
   2.106 +
   2.107 +  Although the Lesser General Public License is Less protective of the
   2.108 +users' freedom, it does ensure that the user of a program that is
   2.109 +linked with the Library has the freedom and the wherewithal to run
   2.110 +that program using a modified version of the Library.
   2.111 +
   2.112 +  The precise terms and conditions for copying, distribution and
   2.113 +modification follow.  Pay close attention to the difference between a
   2.114 +"work based on the library" and a "work that uses the library".  The
   2.115 +former contains code derived from the library, whereas the latter must
   2.116 +be combined with the library in order to run.
   2.117 +
   2.118 +		  GNU LESSER GENERAL PUBLIC LICENSE
   2.119 +   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
   2.120 +
   2.121 +  0. This License Agreement applies to any software library or other
   2.122 +program which contains a notice placed by the copyright holder or
   2.123 +other authorized party saying it may be distributed under the terms of
   2.124 +this Lesser General Public License (also called "this License").
   2.125 +Each licensee is addressed as "you".
   2.126 +
   2.127 +  A "library" means a collection of software functions and/or data
   2.128 +prepared so as to be conveniently linked with application programs
   2.129 +(which use some of those functions and data) to form executables.
   2.130 +
   2.131 +  The "Library", below, refers to any such software library or work
   2.132 +which has been distributed under these terms.  A "work based on the
   2.133 +Library" means either the Library or any derivative work under
   2.134 +copyright law: that is to say, a work containing the Library or a
   2.135 +portion of it, either verbatim or with modifications and/or translated
   2.136 +straightforwardly into another language.  (Hereinafter, translation is
   2.137 +included without limitation in the term "modification".)
   2.138 +
   2.139 +  "Source code" for a work means the preferred form of the work for
   2.140 +making modifications to it.  For a library, complete source code means
   2.141 +all the source code for all modules it contains, plus any associated
   2.142 +interface definition files, plus the scripts used to control compilation
   2.143 +and installation of the library.
   2.144 +
   2.145 +  Activities other than copying, distribution and modification are not
   2.146 +covered by this License; they are outside its scope.  The act of
   2.147 +running a program using the Library is not restricted, and output from
   2.148 +such a program is covered only if its contents constitute a work based
   2.149 +on the Library (independent of the use of the Library in a tool for
   2.150 +writing it).  Whether that is true depends on what the Library does
   2.151 +and what the program that uses the Library does.
   2.152 +  
   2.153 +  1. You may copy and distribute verbatim copies of the Library's
   2.154 +complete source code as you receive it, in any medium, provided that
   2.155 +you conspicuously and appropriately publish on each copy an
   2.156 +appropriate copyright notice and disclaimer of warranty; keep intact
   2.157 +all the notices that refer to this License and to the absence of any
   2.158 +warranty; and distribute a copy of this License along with the
   2.159 +Library.
   2.160 +
   2.161 +  You may charge a fee for the physical act of transferring a copy,
   2.162 +and you may at your option offer warranty protection in exchange for a
   2.163 +fee.
   2.164 +
   2.165 +  2. You may modify your copy or copies of the Library or any portion
   2.166 +of it, thus forming a work based on the Library, and copy and
   2.167 +distribute such modifications or work under the terms of Section 1
   2.168 +above, provided that you also meet all of these conditions:
   2.169 +
   2.170 +    a) The modified work must itself be a software library.
   2.171 +
   2.172 +    b) You must cause the files modified to carry prominent notices
   2.173 +    stating that you changed the files and the date of any change.
   2.174 +
   2.175 +    c) You must cause the whole of the work to be licensed at no
   2.176 +    charge to all third parties under the terms of this License.
   2.177 +
   2.178 +    d) If a facility in the modified Library refers to a function or a
   2.179 +    table of data to be supplied by an application program that uses
   2.180 +    the facility, other than as an argument passed when the facility
   2.181 +    is invoked, then you must make a good faith effort to ensure that,
   2.182 +    in the event an application does not supply such function or
   2.183 +    table, the facility still operates, and performs whatever part of
   2.184 +    its purpose remains meaningful.
   2.185 +
   2.186 +    (For example, a function in a library to compute square roots has
   2.187 +    a purpose that is entirely well-defined independent of the
   2.188 +    application.  Therefore, Subsection 2d requires that any
   2.189 +    application-supplied function or table used by this function must
   2.190 +    be optional: if the application does not supply it, the square
   2.191 +    root function must still compute square roots.)
   2.192 +
   2.193 +These requirements apply to the modified work as a whole.  If
   2.194 +identifiable sections of that work are not derived from the Library,
   2.195 +and can be reasonably considered independent and separate works in
   2.196 +themselves, then this License, and its terms, do not apply to those
   2.197 +sections when you distribute them as separate works.  But when you
   2.198 +distribute the same sections as part of a whole which is a work based
   2.199 +on the Library, the distribution of the whole must be on the terms of
   2.200 +this License, whose permissions for other licensees extend to the
   2.201 +entire whole, and thus to each and every part regardless of who wrote
   2.202 +it.
   2.203 +
   2.204 +Thus, it is not the intent of this section to claim rights or contest
   2.205 +your rights to work written entirely by you; rather, the intent is to
   2.206 +exercise the right to control the distribution of derivative or
   2.207 +collective works based on the Library.
   2.208 +
   2.209 +In addition, mere aggregation of another work not based on the Library
   2.210 +with the Library (or with a work based on the Library) on a volume of
   2.211 +a storage or distribution medium does not bring the other work under
   2.212 +the scope of this License.
   2.213 +
   2.214 +  3. You may opt to apply the terms of the ordinary GNU General Public
   2.215 +License instead of this License to a given copy of the Library.  To do
   2.216 +this, you must alter all the notices that refer to this License, so
   2.217 +that they refer to the ordinary GNU General Public License, version 2,
   2.218 +instead of to this License.  (If a newer version than version 2 of the
   2.219 +ordinary GNU General Public License has appeared, then you can specify
   2.220 +that version instead if you wish.)  Do not make any other change in
   2.221 +these notices.
   2.222 +
   2.223 +  Once this change is made in a given copy, it is irreversible for
   2.224 +that copy, so the ordinary GNU General Public License applies to all
   2.225 +subsequent copies and derivative works made from that copy.
   2.226 +
   2.227 +  This option is useful when you wish to copy part of the code of
   2.228 +the Library into a program that is not a library.
   2.229 +
   2.230 +  4. You may copy and distribute the Library (or a portion or
   2.231 +derivative of it, under Section 2) in object code or executable form
   2.232 +under the terms of Sections 1 and 2 above provided that you accompany
   2.233 +it with the complete corresponding machine-readable source code, which
   2.234 +must be distributed under the terms of Sections 1 and 2 above on a
   2.235 +medium customarily used for software interchange.
   2.236 +
   2.237 +  If distribution of object code is made by offering access to copy
   2.238 +from a designated place, then offering equivalent access to copy the
   2.239 +source code from the same place satisfies the requirement to
   2.240 +distribute the source code, even though third parties are not
   2.241 +compelled to copy the source along with the object code.
   2.242 +
   2.243 +  5. A program that contains no derivative of any portion of the
   2.244 +Library, but is designed to work with the Library by being compiled or
   2.245 +linked with it, is called a "work that uses the Library".  Such a
   2.246 +work, in isolation, is not a derivative work of the Library, and
   2.247 +therefore falls outside the scope of this License.
   2.248 +
   2.249 +  However, linking a "work that uses the Library" with the Library
   2.250 +creates an executable that is a derivative of the Library (because it
   2.251 +contains portions of the Library), rather than a "work that uses the
   2.252 +library".  The executable is therefore covered by this License.
   2.253 +Section 6 states terms for distribution of such executables.
   2.254 +
   2.255 +  When a "work that uses the Library" uses material from a header file
   2.256 +that is part of the Library, the object code for the work may be a
   2.257 +derivative work of the Library even though the source code is not.
   2.258 +Whether this is true is especially significant if the work can be
   2.259 +linked without the Library, or if the work is itself a library.  The
   2.260 +threshold for this to be true is not precisely defined by law.
   2.261 +
   2.262 +  If such an object file uses only numerical parameters, data
   2.263 +structure layouts and accessors, and small macros and small inline
   2.264 +functions (ten lines or less in length), then the use of the object
   2.265 +file is unrestricted, regardless of whether it is legally a derivative
   2.266 +work.  (Executables containing this object code plus portions of the
   2.267 +Library will still fall under Section 6.)
   2.268 +
   2.269 +  Otherwise, if the work is a derivative of the Library, you may
   2.270 +distribute the object code for the work under the terms of Section 6.
   2.271 +Any executables containing that work also fall under Section 6,
   2.272 +whether or not they are linked directly with the Library itself.
   2.273 +
   2.274 +  6. As an exception to the Sections above, you may also combine or
   2.275 +link a "work that uses the Library" with the Library to produce a
   2.276 +work containing portions of the Library, and distribute that work
   2.277 +under terms of your choice, provided that the terms permit
   2.278 +modification of the work for the customer's own use and reverse
   2.279 +engineering for debugging such modifications.
   2.280 +
   2.281 +  You must give prominent notice with each copy of the work that the
   2.282 +Library is used in it and that the Library and its use are covered by
   2.283 +this License.  You must supply a copy of this License.  If the work
   2.284 +during execution displays copyright notices, you must include the
   2.285 +copyright notice for the Library among them, as well as a reference
   2.286 +directing the user to the copy of this License.  Also, you must do one
   2.287 +of these things:
   2.288 +
   2.289 +    a) Accompany the work with the complete corresponding
   2.290 +    machine-readable source code for the Library including whatever
   2.291 +    changes were used in the work (which must be distributed under
   2.292 +    Sections 1 and 2 above); and, if the work is an executable linked
   2.293 +    with the Library, with the complete machine-readable "work that
   2.294 +    uses the Library", as object code and/or source code, so that the
   2.295 +    user can modify the Library and then relink to produce a modified
   2.296 +    executable containing the modified Library.  (It is understood
   2.297 +    that the user who changes the contents of definitions files in the
   2.298 +    Library will not necessarily be able to recompile the application
   2.299 +    to use the modified definitions.)
   2.300 +
   2.301 +    b) Use a suitable shared library mechanism for linking with the
   2.302 +    Library.  A suitable mechanism is one that (1) uses at run time a
   2.303 +    copy of the library already present on the user's computer system,
   2.304 +    rather than copying library functions into the executable, and (2)
   2.305 +    will operate properly with a modified version of the library, if
   2.306 +    the user installs one, as long as the modified version is
   2.307 +    interface-compatible with the version that the work was made with.
   2.308 +
   2.309 +    c) Accompany the work with a written offer, valid for at
   2.310 +    least three years, to give the same user the materials
   2.311 +    specified in Subsection 6a, above, for a charge no more
   2.312 +    than the cost of performing this distribution.
   2.313 +
   2.314 +    d) If distribution of the work is made by offering access to copy
   2.315 +    from a designated place, offer equivalent access to copy the above
   2.316 +    specified materials from the same place.
   2.317 +
   2.318 +    e) Verify that the user has already received a copy of these
   2.319 +    materials or that you have already sent this user a copy.
   2.320 +
   2.321 +  For an executable, the required form of the "work that uses the
   2.322 +Library" must include any data and utility programs needed for
   2.323 +reproducing the executable from it.  However, as a special exception,
   2.324 +the materials to be distributed need not include anything that is
   2.325 +normally distributed (in either source or binary form) with the major
   2.326 +components (compiler, kernel, and so on) of the operating system on
   2.327 +which the executable runs, unless that component itself accompanies
   2.328 +the executable.
   2.329 +
   2.330 +  It may happen that this requirement contradicts the license
   2.331 +restrictions of other proprietary libraries that do not normally
   2.332 +accompany the operating system.  Such a contradiction means you cannot
   2.333 +use both them and the Library together in an executable that you
   2.334 +distribute.
   2.335 +
   2.336 +  7. You may place library facilities that are a work based on the
   2.337 +Library side-by-side in a single library together with other library
   2.338 +facilities not covered by this License, and distribute such a combined
   2.339 +library, provided that the separate distribution of the work based on
   2.340 +the Library and of the other library facilities is otherwise
   2.341 +permitted, and provided that you do these two things:
   2.342 +
   2.343 +    a) Accompany the combined library with a copy of the same work
   2.344 +    based on the Library, uncombined with any other library
   2.345 +    facilities.  This must be distributed under the terms of the
   2.346 +    Sections above.
   2.347 +
   2.348 +    b) Give prominent notice with the combined library of the fact
   2.349 +    that part of it is a work based on the Library, and explaining
   2.350 +    where to find the accompanying uncombined form of the same work.
   2.351 +
   2.352 +  8. You may not copy, modify, sublicense, link with, or distribute
   2.353 +the Library except as expressly provided under this License.  Any
   2.354 +attempt otherwise to copy, modify, sublicense, link with, or
   2.355 +distribute the Library is void, and will automatically terminate your
   2.356 +rights under this License.  However, parties who have received copies,
   2.357 +or rights, from you under this License will not have their licenses
   2.358 +terminated so long as such parties remain in full compliance.
   2.359 +
   2.360 +  9. You are not required to accept this License, since you have not
   2.361 +signed it.  However, nothing else grants you permission to modify or
   2.362 +distribute the Library or its derivative works.  These actions are
   2.363 +prohibited by law if you do not accept this License.  Therefore, by
   2.364 +modifying or distributing the Library (or any work based on the
   2.365 +Library), you indicate your acceptance of this License to do so, and
   2.366 +all its terms and conditions for copying, distributing or modifying
   2.367 +the Library or works based on it.
   2.368 +
   2.369 +  10. Each time you redistribute the Library (or any work based on the
   2.370 +Library), the recipient automatically receives a license from the
   2.371 +original licensor to copy, distribute, link with or modify the Library
   2.372 +subject to these terms and conditions.  You may not impose any further
   2.373 +restrictions on the recipients' exercise of the rights granted herein.
   2.374 +You are not responsible for enforcing compliance by third parties with
   2.375 +this License.
   2.376 +
   2.377 +  11. If, as a consequence of a court judgment or allegation of patent
   2.378 +infringement or for any other reason (not limited to patent issues),
   2.379 +conditions are imposed on you (whether by court order, agreement or
   2.380 +otherwise) that contradict the conditions of this License, they do not
   2.381 +excuse you from the conditions of this License.  If you cannot
   2.382 +distribute so as to satisfy simultaneously your obligations under this
   2.383 +License and any other pertinent obligations, then as a consequence you
   2.384 +may not distribute the Library at all.  For example, if a patent
   2.385 +license would not permit royalty-free redistribution of the Library by
   2.386 +all those who receive copies directly or indirectly through you, then
   2.387 +the only way you could satisfy both it and this License would be to
   2.388 +refrain entirely from distribution of the Library.
   2.389 +
   2.390 +If any portion of this section is held invalid or unenforceable under any
   2.391 +particular circumstance, the balance of the section is intended to apply,
   2.392 +and the section as a whole is intended to apply in other circumstances.
   2.393 +
   2.394 +It is not the purpose of this section to induce you to infringe any
   2.395 +patents or other property right claims or to contest validity of any
   2.396 +such claims; this section has the sole purpose of protecting the
   2.397 +integrity of the free software distribution system which is
   2.398 +implemented by public license practices.  Many people have made
   2.399 +generous contributions to the wide range of software distributed
   2.400 +through that system in reliance on consistent application of that
   2.401 +system; it is up to the author/donor to decide if he or she is willing
   2.402 +to distribute software through any other system and a licensee cannot
   2.403 +impose that choice.
   2.404 +
   2.405 +This section is intended to make thoroughly clear what is believed to
   2.406 +be a consequence of the rest of this License.
   2.407 +
   2.408 +  12. If the distribution and/or use of the Library is restricted in
   2.409 +certain countries either by patents or by copyrighted interfaces, the
   2.410 +original copyright holder who places the Library under this License may add
   2.411 +an explicit geographical distribution limitation excluding those countries,
   2.412 +so that distribution is permitted only in or among countries not thus
   2.413 +excluded.  In such case, this License incorporates the limitation as if
   2.414 +written in the body of this License.
   2.415 +
   2.416 +  13. The Free Software Foundation may publish revised and/or new
   2.417 +versions of the Lesser General Public License from time to time.
   2.418 +Such new versions will be similar in spirit to the present version,
   2.419 +but may differ in detail to address new problems or concerns.
   2.420 +
   2.421 +Each version is given a distinguishing version number.  If the Library
   2.422 +specifies a version number of this License which applies to it and
   2.423 +"any later version", you have the option of following the terms and
   2.424 +conditions either of that version or of any later version published by
   2.425 +the Free Software Foundation.  If the Library does not specify a
   2.426 +license version number, you may choose any version ever published by
   2.427 +the Free Software Foundation.
   2.428 +
   2.429 +  14. If you wish to incorporate parts of the Library into other free
   2.430 +programs whose distribution conditions are incompatible with these,
   2.431 +write to the author to ask for permission.  For software which is
   2.432 +copyrighted by the Free Software Foundation, write to the Free
   2.433 +Software Foundation; we sometimes make exceptions for this.  Our
   2.434 +decision will be guided by the two goals of preserving the free status
   2.435 +of all derivatives of our free software and of promoting the sharing
   2.436 +and reuse of software generally.
   2.437 +
   2.438 +			    NO WARRANTY
   2.439 +
   2.440 +  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
   2.441 +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
   2.442 +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
   2.443 +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
   2.444 +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
   2.445 +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   2.446 +PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
   2.447 +LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
   2.448 +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
   2.449 +
   2.450 +  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
   2.451 +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
   2.452 +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
   2.453 +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
   2.454 +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
   2.455 +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
   2.456 +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
   2.457 +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
   2.458 +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
   2.459 +DAMAGES.
   2.460 +
   2.461 +		     END OF TERMS AND CONDITIONS
   2.462 +
   2.463 +           How to Apply These Terms to Your New Libraries
   2.464 +
   2.465 +  If you develop a new library, and you want it to be of the greatest
   2.466 +possible use to the public, we recommend making it free software that
   2.467 +everyone can redistribute and change.  You can do so by permitting
   2.468 +redistribution under these terms (or, alternatively, under the terms of the
   2.469 +ordinary General Public License).
   2.470 +
   2.471 +  To apply these terms, attach the following notices to the library.  It is
   2.472 +safest to attach them to the start of each source file to most effectively
   2.473 +convey the exclusion of warranty; and each file should have at least the
   2.474 +"copyright" line and a pointer to where the full notice is found.
   2.475 +
   2.476 +    <one line to give the library's name and a brief idea of what it does.>
   2.477 +    Copyright (C) <year>  <name of author>
   2.478 +
   2.479 +    This library is free software; you can redistribute it and/or
   2.480 +    modify it under the terms of the GNU Lesser General Public
   2.481 +    License as published by the Free Software Foundation; either
   2.482 +    version 2.1 of the License, or (at your option) any later version.
   2.483 +
   2.484 +    This library is distributed in the hope that it will be useful,
   2.485 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
   2.486 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   2.487 +    Lesser General Public License for more details.
   2.488 +
   2.489 +    You should have received a copy of the GNU Lesser General Public
   2.490 +    License along with this library; if not, write to the Free Software
   2.491 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   2.492 +
   2.493 +Also add information on how to contact you by electronic and paper mail.
   2.494 +
   2.495 +You should also get your employer (if you work as a programmer) or your
   2.496 +school, if any, to sign a "copyright disclaimer" for the library, if
   2.497 +necessary.  Here is a sample; alter the names:
   2.498 +
   2.499 +  Yoyodyne, Inc., hereby disclaims all copyright interest in the
   2.500 +  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
   2.501 +
   2.502 +  <signature of Ty Coon>, 1 April 1990
   2.503 +  Ty Coon, President of Vice
   2.504 +
   2.505 +That's all there is to it!
   2.506 +
   2.507 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/maemo-ui-old/ChangeLog	Wed Aug 01 14:50:29 2007 +0100
     3.3 @@ -0,0 +1,24 @@
     3.4 +2006-08-17 Rosfran Borges <rosfran.borges@indt.org.br>
     3.5 +	* Added the correct gstreamer-base package (GSTBASE) at the configure.ac; 
     3.6 +	GSTBASE_CFLAGS and GSTBASE_LIBS variables had the same values from
     3.7 +	the GST_CFLAGS/GST_LIBS.
     3.8 +
     3.9 +2006-08-16 Rosfran Borges <rosfran.borges@indt.org.br>
    3.10 +	* Fixed some installation issues, regarding lib-installing to the
    3.11 +	correct directory, and copying the header files to the destination
    3.12 +	dir (make install).
    3.13 +	* Put 'pkg-config' resource to the Maemo Myth library. The name of the
    3.14 +	PKG-CONFIG resource is 'maemo-myth', plus the minor and major version.
    3.15 +	Actually, the version is '0.1', so the library config file is:  
    3.16 +	'maemo-myth-0.1.pc'. You can type: 'pkg-config --cflags --libs 
    3.17 +	maemo-myth-0.1'.
    3.18 +	* Many adjustments in the automake/autoconf configuration files
    3.19 +	(configure.ac, Makefile.am) - some autotools misusage fixed.
    3.20 +	* Added the MythURI structure, and the URI parsing utility functions
    3.21 +	(missing in the GLib).
    3.22 +	* Some functions were exported (myth_socket, mmyth_context), that's 
    3.23 +	why many ther modules need to use them.
    3.24 +	* Fixed some library dependencies.
    3.25 +	* Prepared to be used inside the GStreamer (linking with the MythTV
    3.26 +	plug-in).
    3.27 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/maemo-ui-old/INSTALL	Wed Aug 01 14:50:29 2007 +0100
     4.3 @@ -0,0 +1,236 @@
     4.4 +Installation Instructions
     4.5 +*************************
     4.6 +
     4.7 +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
     4.8 +Software Foundation, Inc.
     4.9 +
    4.10 +This file is free documentation; the Free Software Foundation gives
    4.11 +unlimited permission to copy, distribute and modify it.
    4.12 +
    4.13 +Basic Installation
    4.14 +==================
    4.15 +
    4.16 +These are generic installation instructions.
    4.17 +
    4.18 +   The `configure' shell script attempts to guess correct values for
    4.19 +various system-dependent variables used during compilation.  It uses
    4.20 +those values to create a `Makefile' in each directory of the package.
    4.21 +It may also create one or more `.h' files containing system-dependent
    4.22 +definitions.  Finally, it creates a shell script `config.status' that
    4.23 +you can run in the future to recreate the current configuration, and a
    4.24 +file `config.log' containing compiler output (useful mainly for
    4.25 +debugging `configure').
    4.26 +
    4.27 +   It can also use an optional file (typically called `config.cache'
    4.28 +and enabled with `--cache-file=config.cache' or simply `-C') that saves
    4.29 +the results of its tests to speed up reconfiguring.  (Caching is
    4.30 +disabled by default to prevent problems with accidental use of stale
    4.31 +cache files.)
    4.32 +
    4.33 +   If you need to do unusual things to compile the package, please try
    4.34 +to figure out how `configure' could check whether to do them, and mail
    4.35 +diffs or instructions to the address given in the `README' so they can
    4.36 +be considered for the next release.  If you are using the cache, and at
    4.37 +some point `config.cache' contains results you don't want to keep, you
    4.38 +may remove or edit it.
    4.39 +
    4.40 +   The file `configure.ac' (or `configure.in') is used to create
    4.41 +`configure' by a program called `autoconf'.  You only need
    4.42 +`configure.ac' if you want to change it or regenerate `configure' using
    4.43 +a newer version of `autoconf'.
    4.44 +
    4.45 +The simplest way to compile this package is:
    4.46 +
    4.47 +  1. `cd' to the directory containing the package's source code and type
    4.48 +     `./configure' to configure the package for your system.  If you're
    4.49 +     using `csh' on an old version of System V, you might need to type
    4.50 +     `sh ./configure' instead to prevent `csh' from trying to execute
    4.51 +     `configure' itself.
    4.52 +
    4.53 +     Running `configure' takes awhile.  While running, it prints some
    4.54 +     messages telling which features it is checking for.
    4.55 +
    4.56 +  2. Type `make' to compile the package.
    4.57 +
    4.58 +  3. Optionally, type `make check' to run any self-tests that come with
    4.59 +     the package.
    4.60 +
    4.61 +  4. Type `make install' to install the programs and any data files and
    4.62 +     documentation.
    4.63 +
    4.64 +  5. You can remove the program binaries and object files from the
    4.65 +     source code directory by typing `make clean'.  To also remove the
    4.66 +     files that `configure' created (so you can compile the package for
    4.67 +     a different kind of computer), type `make distclean'.  There is
    4.68 +     also a `make maintainer-clean' target, but that is intended mainly
    4.69 +     for the package's developers.  If you use it, you may have to get
    4.70 +     all sorts of other programs in order to regenerate files that came
    4.71 +     with the distribution.
    4.72 +
    4.73 +Compilers and Options
    4.74 +=====================
    4.75 +
    4.76 +Some systems require unusual options for compilation or linking that the
    4.77 +`configure' script does not know about.  Run `./configure --help' for
    4.78 +details on some of the pertinent environment variables.
    4.79 +
    4.80 +   You can give `configure' initial values for configuration parameters
    4.81 +by setting variables in the command line or in the environment.  Here
    4.82 +is an example:
    4.83 +
    4.84 +     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
    4.85 +
    4.86 +   *Note Defining Variables::, for more details.
    4.87 +
    4.88 +Compiling For Multiple Architectures
    4.89 +====================================
    4.90 +
    4.91 +You can compile the package for more than one kind of computer at the
    4.92 +same time, by placing the object files for each architecture in their
    4.93 +own directory.  To do this, you must use a version of `make' that
    4.94 +supports the `VPATH' variable, such as GNU `make'.  `cd' to the
    4.95 +directory where you want the object files and executables to go and run
    4.96 +the `configure' script.  `configure' automatically checks for the
    4.97 +source code in the directory that `configure' is in and in `..'.
    4.98 +
    4.99 +   If you have to use a `make' that does not support the `VPATH'
   4.100 +variable, you have to compile the package for one architecture at a
   4.101 +time in the source code directory.  After you have installed the
   4.102 +package for one architecture, use `make distclean' before reconfiguring
   4.103 +for another architecture.
   4.104 +
   4.105 +Installation Names
   4.106 +==================
   4.107 +
   4.108 +By default, `make install' installs the package's commands under
   4.109 +`/usr/local/bin', include files under `/usr/local/include', etc.  You
   4.110 +can specify an installation prefix other than `/usr/local' by giving
   4.111 +`configure' the option `--prefix=PREFIX'.
   4.112 +
   4.113 +   You can specify separate installation prefixes for
   4.114 +architecture-specific files and architecture-independent files.  If you
   4.115 +pass the option `--exec-prefix=PREFIX' to `configure', the package uses
   4.116 +PREFIX as the prefix for installing programs and libraries.
   4.117 +Documentation and other data files still use the regular prefix.
   4.118 +
   4.119 +   In addition, if you use an unusual directory layout you can give
   4.120 +options like `--bindir=DIR' to specify different values for particular
   4.121 +kinds of files.  Run `configure --help' for a list of the directories
   4.122 +you can set and what kinds of files go in them.
   4.123 +
   4.124 +   If the package supports it, you can cause programs to be installed
   4.125 +with an extra prefix or suffix on their names by giving `configure' the
   4.126 +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
   4.127 +
   4.128 +Optional Features
   4.129 +=================
   4.130 +
   4.131 +Some packages pay attention to `--enable-FEATURE' options to
   4.132 +`configure', where FEATURE indicates an optional part of the package.
   4.133 +They may also pay attention to `--with-PACKAGE' options, where PACKAGE
   4.134 +is something like `gnu-as' or `x' (for the X Window System).  The
   4.135 +`README' should mention any `--enable-' and `--with-' options that the
   4.136 +package recognizes.
   4.137 +
   4.138 +   For packages that use the X Window System, `configure' can usually
   4.139 +find the X include and library files automatically, but if it doesn't,
   4.140 +you can use the `configure' options `--x-includes=DIR' and
   4.141 +`--x-libraries=DIR' to specify their locations.
   4.142 +
   4.143 +Specifying the System Type
   4.144 +==========================
   4.145 +
   4.146 +There may be some features `configure' cannot figure out automatically,
   4.147 +but needs to determine by the type of machine the package will run on.
   4.148 +Usually, assuming the package is built to be run on the _same_
   4.149 +architectures, `configure' can figure that out, but if it prints a
   4.150 +message saying it cannot guess the machine type, give it the
   4.151 +`--build=TYPE' option.  TYPE can either be a short name for the system
   4.152 +type, such as `sun4', or a canonical name which has the form:
   4.153 +
   4.154 +     CPU-COMPANY-SYSTEM
   4.155 +
   4.156 +where SYSTEM can have one of these forms:
   4.157 +
   4.158 +     OS KERNEL-OS
   4.159 +
   4.160 +   See the file `config.sub' for the possible values of each field.  If
   4.161 +`config.sub' isn't included in this package, then this package doesn't
   4.162 +need to know the machine type.
   4.163 +
   4.164 +   If you are _building_ compiler tools for cross-compiling, you should
   4.165 +use the option `--target=TYPE' to select the type of system they will
   4.166 +produce code for.
   4.167 +
   4.168 +   If you want to _use_ a cross compiler, that generates code for a
   4.169 +platform different from the build platform, you should specify the
   4.170 +"host" platform (i.e., that on which the generated programs will
   4.171 +eventually be run) with `--host=TYPE'.
   4.172 +
   4.173 +Sharing Defaults
   4.174 +================
   4.175 +
   4.176 +If you want to set default values for `configure' scripts to share, you
   4.177 +can create a site shell script called `config.site' that gives default
   4.178 +values for variables like `CC', `cache_file', and `prefix'.
   4.179 +`configure' looks for `PREFIX/share/config.site' if it exists, then
   4.180 +`PREFIX/etc/config.site' if it exists.  Or, you can set the
   4.181 +`CONFIG_SITE' environment variable to the location of the site script.
   4.182 +A warning: not all `configure' scripts look for a site script.
   4.183 +
   4.184 +Defining Variables
   4.185 +==================
   4.186 +
   4.187 +Variables not defined in a site shell script can be set in the
   4.188 +environment passed to `configure'.  However, some packages may run
   4.189 +configure again during the build, and the customized values of these
   4.190 +variables may be lost.  In order to avoid this problem, you should set
   4.191 +them in the `configure' command line, using `VAR=value'.  For example:
   4.192 +
   4.193 +     ./configure CC=/usr/local2/bin/gcc
   4.194 +
   4.195 +causes the specified `gcc' to be used as the C compiler (unless it is
   4.196 +overridden in the site shell script).  Here is a another example:
   4.197 +
   4.198 +     /bin/bash ./configure CONFIG_SHELL=/bin/bash
   4.199 +
   4.200 +Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
   4.201 +configuration-related scripts to be executed by `/bin/bash'.
   4.202 +
   4.203 +`configure' Invocation
   4.204 +======================
   4.205 +
   4.206 +`configure' recognizes the following options to control how it operates.
   4.207 +
   4.208 +`--help'
   4.209 +`-h'
   4.210 +     Print a summary of the options to `configure', and exit.
   4.211 +
   4.212 +`--version'
   4.213 +`-V'
   4.214 +     Print the version of Autoconf used to generate the `configure'
   4.215 +     script, and exit.
   4.216 +
   4.217 +`--cache-file=FILE'
   4.218 +     Enable the cache: use and save the results of the tests in FILE,
   4.219 +     traditionally `config.cache'.  FILE defaults to `/dev/null' to
   4.220 +     disable caching.
   4.221 +
   4.222 +`--config-cache'
   4.223 +`-C'
   4.224 +     Alias for `--cache-file=config.cache'.
   4.225 +
   4.226 +`--quiet'
   4.227 +`--silent'
   4.228 +`-q'
   4.229 +     Do not print messages saying which checks are being made.  To
   4.230 +     suppress all normal output, redirect it to `/dev/null' (any error
   4.231 +     messages will still be shown).
   4.232 +
   4.233 +`--srcdir=DIR'
   4.234 +     Look for the package's source code in directory DIR.  Usually
   4.235 +     `configure' can determine that directory automatically.
   4.236 +
   4.237 +`configure' also accepts some other, not widely useful, options.  Run
   4.238 +`configure --help' for more details.
   4.239 +
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/maemo-ui-old/Makefile.am	Wed Aug 01 14:50:29 2007 +0100
     5.3 @@ -0,0 +1,8 @@
     5.4 +SUBDIRS= src pixmaps
     5.5 +
     5.6 +EXTRA_DIST =                            \
     5.7 +        autogen.sh                      \
     5.8 +        AUTHORS                         \
     5.9 +        COPYING                         \
    5.10 +        README
    5.11 +
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/maemo-ui-old/autogen.sh	Wed Aug 01 14:50:29 2007 +0100
     6.3 @@ -0,0 +1,99 @@
     6.4 +#!/bin/sh
     6.5 +# Run this to generate all the initial makefiles, etc.
     6.6 +
     6.7 +DIE=0
     6.8 +package=gmyth
     6.9 +srcfile=configure.ac
    6.10 +
    6.11 +# a quick cvs co if necessary to alleviate the pain - may remove this
    6.12 +# when developers get a clue ;)
    6.13 +if test ! -d common; 
    6.14 +then 
    6.15 +  echo "+ getting common/ from svn"
    6.16 + svn co common 
    6.17 +fi
    6.18 +
    6.19 +# source helper functions
    6.20 +if test ! -f common/autogen-helper.sh;
    6.21 +then
    6.22 +  echo There is something wrong with your source tree.
    6.23 +  echo You are missing common/autogen-helper.sh
    6.24 +  exit 1
    6.25 +fi
    6.26 +. common/autogen-helper.sh
    6.27 +
    6.28 +CONFIGURE_DEF_OPT='--enable-maintainer-mode'
    6.29 +
    6.30 +autogen_options 
    6.31 +
    6.32 +echo -n "+ check for build tools"
    6.33 +if test ! -z "$NOCHECK"; then echo " skipped"; else  echo; fi
    6.34 +version_check "autoconf" "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53" \
    6.35 +              "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 53 || DIE=1
    6.36 +version_check "automake" "$AUTOMAKE automake automake-1.9 automake-1.8 automake-1.7 automake-1.6" \
    6.37 +              "ftp://ftp.gnu.org/pub/gnu/automake/" 1 6 || DIE=1
    6.38 +version_check "libtoolize" "$LIBTOOLIZE libtoolize" \
    6.39 +              "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1
    6.40 +version_check "pkg-config" "" \
    6.41 +              "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
    6.42 +
    6.43 +die_check $DIE
    6.44 +
    6.45 +aclocal_check || DIE=1
    6.46 +autoheader_check || DIE=1
    6.47 +
    6.48 +die_check $DIE
    6.49 +
    6.50 +# if no arguments specified then this will be printed
    6.51 +if test -z "$*"; then
    6.52 +  echo "+ checking for autogen.sh options"
    6.53 +  echo "  This autogen script will automatically run ./configure as:"
    6.54 +  echo "  ./configure $CONFIGURE_DEF_OPT"
    6.55 +  echo "  To pass any additional options, please specify them on the $0"
    6.56 +  echo "  command line."
    6.57 +fi
    6.58 +
    6.59 +toplevel_check $srcfile
    6.60 +
    6.61 +tool_run "$aclocal" "-I m4 $ACLOCAL_FLAGS"
    6.62 +tool_run "$libtoolize" "--copy --force"
    6.63 +tool_run "$autoheader"
    6.64 +
    6.65 +# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
    6.66 +echo timestamp > stamp-h.in 2> /dev/null
    6.67 +
    6.68 +tool_run "$autoconf"
    6.69 +tool_run "$automake" "-a -c"
    6.70 +
    6.71 +# if enable exists, add an -enable option for each of the lines in that file
    6.72 +if test -f enable; then
    6.73 +  for a in `cat enable`; do
    6.74 +    CONFIGURE_FILE_OPT="--enable-$a"
    6.75 +  done
    6.76 +fi
    6.77 +
    6.78 +# if disable exists, add an -disable option for each of the lines in that file
    6.79 +if test -f disable; then
    6.80 +  for a in `cat disable`; do
    6.81 +    CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a"
    6.82 +  done
    6.83 +fi
    6.84 +
    6.85 +test -n "$NOCONFIGURE" && {
    6.86 +  echo "+ skipping configure stage for package $package, as requested."
    6.87 +  echo "+ autogen.sh done."
    6.88 +  exit 0
    6.89 +}
    6.90 +
    6.91 +echo "+ running configure ... "
    6.92 +test ! -z "$CONFIGURE_DEF_OPT" && echo "  ./configure default flags: $CONFIGURE_DEF_OPT"
    6.93 +test ! -z "$CONFIGURE_EXT_OPT" && echo "  ./configure external flags: $CONFIGURE_EXT_OPT"
    6.94 +test ! -z "$CONFIGURE_FILE_OPT" && echo "  ./configure enable/disable flags: $CONFIGURE_FILE_OPT"
    6.95 +echo
    6.96 +
    6.97 +./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || {
    6.98 +        echo "  configure failed"
    6.99 +        exit 1
   6.100 +}
   6.101 +
   6.102 +echo "Now type 'make' to compile $package."
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/maemo-ui-old/common/Makefile.am	Wed Aug 01 14:50:29 2007 +0100
     7.3 @@ -0,0 +1,1 @@
     7.4 +EXTRA_DIST = autogen-helper.sh
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/maemo-ui-old/common/autogen-helper.sh	Wed Aug 01 14:50:29 2007 +0100
     8.3 @@ -0,0 +1,302 @@
     8.4 +# a silly hack that generates autoregen.sh but it's handy
     8.5 +echo "#!/bin/sh" > autoregen.sh
     8.6 +echo "./autogen.sh $@ \$@" >> autoregen.sh
     8.7 +chmod +x autoregen.sh
     8.8 +
     8.9 +# helper functions for autogen.sh
    8.10 +
    8.11 +debug ()
    8.12 +# print out a debug message if DEBUG is a defined variable
    8.13 +{
    8.14 +  if test ! -z "$DEBUG"
    8.15 +  then
    8.16 +    echo "DEBUG: $1"
    8.17 +  fi
    8.18 +}
    8.19 +
    8.20 +version_check ()
    8.21 +# check the version of a package
    8.22 +# first argument : package name (executable)
    8.23 +# second argument : optional path where to look for it instead
    8.24 +# third argument : source download url
    8.25 +# rest of arguments : major, minor, micro version
    8.26 +# all consecutive ones : suggestions for binaries to use
    8.27 +# (if not specified in second argument)
    8.28 +{
    8.29 +  PACKAGE=$1
    8.30 +  PKG_PATH=$2
    8.31 +  URL=$3
    8.32 +  MAJOR=$4
    8.33 +  MINOR=$5
    8.34 +  MICRO=$6
    8.35 +
    8.36 +  # for backwards compatibility, we let PKG_PATH=PACKAGE when PKG_PATH null
    8.37 +  if test -z "$PKG_PATH"; then PKG_PATH=$PACKAGE; fi
    8.38 +  debug "major $MAJOR minor $MINOR micro $MICRO"
    8.39 +  VERSION=$MAJOR
    8.40 +  if test ! -z "$MINOR"; then VERSION=$VERSION.$MINOR; else MINOR=0; fi
    8.41 +  if test ! -z "$MICRO"; then VERSION=$VERSION.$MICRO; else MICRO=0; fi
    8.42 +
    8.43 +  debug "major $MAJOR minor $MINOR micro $MICRO"
    8.44 +  
    8.45 +  for SUGGESTION in $PKG_PATH; do 
    8.46 +    COMMAND="$SUGGESTION"
    8.47 +
    8.48 +    # don't check if asked not to
    8.49 +    test -z "$NOCHECK" && {
    8.50 +      echo -n "  checking for $COMMAND >= $VERSION ... "
    8.51 +    } || {
    8.52 +      # we set a var with the same name as the package, but stripped of
    8.53 +      # unwanted chars
    8.54 +      VAR=`echo $PACKAGE | sed 's/-//g'`
    8.55 +      debug "setting $VAR"
    8.56 +      eval $VAR="$COMMAND"
    8.57 +      return 0
    8.58 +    }
    8.59 +
    8.60 +    debug "checking version with $COMMAND"
    8.61 +    ($COMMAND --version) < /dev/null > /dev/null 2>&1 || 
    8.62 +    {
    8.63 +      echo "not found."
    8.64 +      continue
    8.65 +    }
    8.66 +    # strip everything that's not a digit, then use cut to get the first field
    8.67 +    pkg_version=`$COMMAND --version|head -n 1|sed 's/^[^0-9]*//'|cut -d' ' -f1`
    8.68 +    debug "pkg_version $pkg_version"
    8.69 +    # remove any non-digit characters from the version numbers to permit numeric
    8.70 +    # comparison
    8.71 +    pkg_major=`echo $pkg_version | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
    8.72 +    pkg_minor=`echo $pkg_version | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
    8.73 +    pkg_micro=`echo $pkg_version | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
    8.74 +    test -z "$pkg_major" && pkg_major=0
    8.75 +    test -z "$pkg_minor" && pkg_minor=0
    8.76 +    test -z "$pkg_micro" && pkg_micro=0
    8.77 +    debug "found major $pkg_major minor $pkg_minor micro $pkg_micro"
    8.78 +
    8.79 +    #start checking the version
    8.80 +    debug "version check"
    8.81 +
    8.82 +    # reset check
    8.83 +    WRONG=
    8.84 +
    8.85 +    if [ ! "$pkg_major" -gt "$MAJOR" ]; then
    8.86 +      debug "major: $pkg_major <= $MAJOR"
    8.87 +      if [ "$pkg_major" -lt "$MAJOR" ]; then
    8.88 +        debug "major: $pkg_major < $MAJOR"
    8.89 +        WRONG=1
    8.90 +      elif [ ! "$pkg_minor" -gt "$MINOR" ]; then
    8.91 +        debug "minor: $pkg_minor <= $MINOR"
    8.92 +        if [ "$pkg_minor" -lt "$MINOR" ]; then
    8.93 +          debug "minor: $pkg_minor < $MINOR"
    8.94 +          WRONG=1
    8.95 +        elif [ "$pkg_micro" -lt "$MICRO" ]; then
    8.96 +          debug "micro: $pkg_micro < $MICRO"
    8.97 +	  WRONG=1
    8.98 +        fi
    8.99 +      fi
   8.100 +    fi
   8.101 +
   8.102 +    if test ! -z "$WRONG"; then
   8.103 +      echo "found $pkg_version, not ok !"
   8.104 +      continue
   8.105 +    else
   8.106 +      echo "found $pkg_version, ok."
   8.107 +      # we set a var with the same name as the package, but stripped of
   8.108 +      # unwanted chars
   8.109 +      VAR=`echo $PACKAGE | sed 's/-//g'`
   8.110 +      debug "setting $VAR"
   8.111 +      eval $VAR="$COMMAND"
   8.112 +      return 0
   8.113 +    fi
   8.114 +  done
   8.115 +
   8.116 +  echo "not found !"
   8.117 +  echo "You must have $PACKAGE installed to compile $package."
   8.118 +  echo "Download the appropriate package for your distribution,"
   8.119 +  echo "or get the source tarball at $URL"
   8.120 +  return 1;
   8.121 +}
   8.122 +
   8.123 +aclocal_check ()
   8.124 +{
   8.125 +  # normally aclocal is part of automake
   8.126 +  # so we expect it to be in the same place as automake
   8.127 +  # so if a different automake is supplied, we need to adapt as well
   8.128 +  # so how's about replacing automake with aclocal in the set var,
   8.129 +  # and saving that in $aclocal ?
   8.130 +  # note, this will fail if the actual automake isn't called automake*
   8.131 +  # or if part of the path before it contains it
   8.132 +  if [ -z "$automake" ]; then
   8.133 +    echo "Error: no automake variable set !"
   8.134 +    return 1
   8.135 +  else
   8.136 +    aclocal=`echo $automake | sed s/automake/aclocal/`
   8.137 +    debug "aclocal: $aclocal"
   8.138 +    if [ "$aclocal" != "aclocal" ];
   8.139 +    then
   8.140 +      CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-aclocal=$aclocal"
   8.141 +    fi
   8.142 +    if [ ! -x `which $aclocal` ]; then
   8.143 +      echo "Error: cannot execute $aclocal !"
   8.144 +      return 1
   8.145 +    fi
   8.146 +  fi
   8.147 +}
   8.148 +
   8.149 +autoheader_check ()
   8.150 +{
   8.151 +  # same here - autoheader is part of autoconf
   8.152 +  # use the same voodoo
   8.153 +  if [ -z "$autoconf" ]; then
   8.154 +    echo "Error: no autoconf variable set !"
   8.155 +    return 1
   8.156 +  else
   8.157 +    autoheader=`echo $autoconf | sed s/autoconf/autoheader/`
   8.158 +    debug "autoheader: $autoheader"
   8.159 +    if [ "$autoheader" != "autoheader" ];
   8.160 +    then
   8.161 +      CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoheader=$autoheader"
   8.162 +    fi
   8.163 +    if [ ! -x `which $autoheader` ]; then
   8.164 +      echo "Error: cannot execute $autoheader !"
   8.165 +      return 1
   8.166 +    fi
   8.167 +  fi
   8.168 +
   8.169 +}
   8.170 +
   8.171 +autoconf_2_52d_check ()
   8.172 +{
   8.173 +  # autoconf 2.52d has a weird issue involving a yes:no error
   8.174 +  # so don't allow it's use
   8.175 +  test -z "$NOCHECK" && {
   8.176 +    ac_version=`$autoconf --version|head -n 1|sed 's/^[a-zA-Z\.\ ()]*//;s/ .*$//'`
   8.177 +    if test "$ac_version" = "2.52d"; then
   8.178 +      echo "autoconf 2.52d has an issue with our current build."
   8.179 +      echo "We don't know who's to blame however.  So until we do, get a"
   8.180 +      echo "regular version.  RPM's of a working version are on the gstreamer site."
   8.181 +      exit 1
   8.182 +    fi
   8.183 +  }
   8.184 +  return 0
   8.185 +}
   8.186 +
   8.187 +die_check ()
   8.188 +{
   8.189 +  # call with $DIE
   8.190 +  # if set to 1, we need to print something helpful then die
   8.191 +  DIE=$1
   8.192 +  if test "x$DIE" = "x1";
   8.193 +  then
   8.194 +    echo
   8.195 +    echo "- Please get the right tools before proceeding."
   8.196 +    echo "- Alternatively, if you're sure we're wrong, run with --nocheck."
   8.197 +    exit 1
   8.198 +  fi
   8.199 +}
   8.200 +
   8.201 +autogen_options ()
   8.202 +{
   8.203 +  if test "x$1" = "x"; then
   8.204 +    return 0
   8.205 +  fi
   8.206 +
   8.207 +  while test "x$1" != "x" ; do
   8.208 +    optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
   8.209 +    case "$1" in
   8.210 +      --noconfigure)
   8.211 +          NOCONFIGURE=defined
   8.212 +	  AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --noconfigure"
   8.213 +          echo "+ configure run disabled"
   8.214 +          shift
   8.215 +          ;;
   8.216 +      --nocheck)
   8.217 +	  AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --nocheck"
   8.218 +          NOCHECK=defined
   8.219 +          echo "+ autotools version check disabled"
   8.220 +          shift
   8.221 +          ;;
   8.222 +      --debug)
   8.223 +          DEBUG=defined
   8.224 +	  AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --debug"
   8.225 +          echo "+ debug output enabled"
   8.226 +          shift
   8.227 +          ;;
   8.228 +      --prefix=*)
   8.229 +	  CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT --prefix=$optarg"
   8.230 +	  echo "+ passing --prefix=$optarg to configure"
   8.231 +          shift
   8.232 +          ;;
   8.233 +      --prefix)
   8.234 +	  shift
   8.235 +	  echo "DEBUG: $1"
   8.236 +	  CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT --prefix=$1"
   8.237 +	  echo "+ passing --prefix=$1 to configure"
   8.238 +          shift
   8.239 +          ;;
   8.240 +      -h|--help)
   8.241 +          echo "autogen.sh (autogen options) -- (configure options)"
   8.242 +          echo "autogen.sh help options: "
   8.243 +          echo " --noconfigure            don't run the configure script"
   8.244 +          echo " --nocheck                don't do version checks"
   8.245 +          echo " --debug                  debug the autogen process"
   8.246 +	  echo " --prefix		  will be passed on to configure"
   8.247 +          echo
   8.248 +          echo " --with-autoconf PATH     use autoconf in PATH"
   8.249 +          echo " --with-automake PATH     use automake in PATH"
   8.250 +          echo
   8.251 +          echo "to pass options to configure, put them as arguments after -- "
   8.252 +	  exit 1
   8.253 +          ;;
   8.254 +      --with-automake=*)
   8.255 +          AUTOMAKE=$optarg
   8.256 +          echo "+ using alternate automake in $optarg"
   8.257 +	  CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-automake=$AUTOMAKE"
   8.258 +          shift
   8.259 +          ;;
   8.260 +      --with-autoconf=*)
   8.261 +          AUTOCONF=$optarg
   8.262 +          echo "+ using alternate autoconf in $optarg"
   8.263 +	  CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoconf=$AUTOCONF"
   8.264 +          shift
   8.265 +          ;;
   8.266 +      --disable*|--enable*|--with*)
   8.267 +          echo "+ passing option $1 to configure"
   8.268 +	  CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $1"
   8.269 +          shift
   8.270 +          ;;
   8.271 +       --) shift ; break ;;
   8.272 +      *) echo "- ignoring unknown autogen.sh argument $1"; shift ;;
   8.273 +    esac
   8.274 +  done
   8.275 +
   8.276 +  for arg do CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $arg"; done
   8.277 +  if test ! -z "$CONFIGURE_EXT_OPT"
   8.278 +  then
   8.279 +    echo "+ options passed to configure: $CONFIGURE_EXT_OPT"
   8.280 +  fi
   8.281 +}
   8.282 +
   8.283 +toplevel_check ()
   8.284 +{
   8.285 +  srcfile=$1
   8.286 +  test -f $srcfile || {
   8.287 +        echo "You must run this script in the top-level $package directory"
   8.288 +        exit 1
   8.289 +  }
   8.290 +}
   8.291 +
   8.292 +
   8.293 +tool_run ()
   8.294 +{
   8.295 +  tool=$1
   8.296 +  options=$2
   8.297 +  run_if_fail=$3
   8.298 +  echo "+ running $tool $options..."
   8.299 +  $tool $options || {
   8.300 +    echo
   8.301 +    echo $tool failed
   8.302 +    eval $run_if_fail
   8.303 +    exit 1
   8.304 +  }
   8.305 +}
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/maemo-ui-old/configure.ac	Wed Aug 01 14:50:29 2007 +0100
     9.3 @@ -0,0 +1,229 @@
     9.4 +#                                               -*- Autoconf -*-
     9.5 +# Process this file with autoconf to produce a configure script.
     9.6 +
     9.7 +AC_PREREQ(2.50)
     9.8 +
     9.9 +AC_INIT([maemo-myth],[0.1])
    9.10 +
    9.11 +dnl AC_CONFIG_SRCDIR([src/mmyth_main.c])
    9.12 +AC_CONFIG_HEADER(config.h)
    9.13 +
    9.14 +dnl when going to/from release please set the nano (fourth number) right !
    9.15 +dnl releases only do Wall, SVN and prerelease does Werror too
    9.16 +AS_VERSION(maemo-myth, GMYTH, 0, 1, 0, 3, GMYTH_SVN="no", GMYTH_SVN="yes")
    9.17 +
    9.18 +GMYTH_MAJORMINOR=$GMYTH_MAJOR_VERSION.$GMYTH_MINOR_VERSION
    9.19 +
    9.20 +AC_SUBST(GMYTH_MAJORMINOR)
    9.21 +
    9.22 +dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
    9.23 +AM_MAINTAINER_MODE
    9.24 +dnl make aclocal work in maintainer mode
    9.25 +AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
    9.26 +
    9.27 +# Checks for programs.
    9.28 +# check for tools
    9.29 +# Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
    9.30 +CFLAGS="$CFLAGS -Wall"
    9.31 +AC_PROG_CC
    9.32 +AC_PROG_LIBTOOL
    9.33 +
    9.34 +# Checks for libraries.
    9.35 +
    9.36 +# Checks for header files.
    9.37 +AC_HEADER_STDC
    9.38 +AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
    9.39 +
    9.40 +# Checks for typedefs, structures, and compiler characteristics.
    9.41 +AC_C_CONST
    9.42 +AC_TYPE_PID_T
    9.43 +AC_STRUCT_TM
    9.44 +
    9.45 +# Checks for library functions.
    9.46 +AC_FUNC_FORK
    9.47 +AC_PROG_GCC_TRADITIONAL
    9.48 +AC_FUNC_MALLOC
    9.49 +AC_FUNC_MKTIME
    9.50 +AC_FUNC_VPRINTF
    9.51 +AC_CHECK_FUNCS([memset socket stime strstr strtoul])
    9.52 +
    9.53 +AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
    9.54 +
    9.55 +# Checks required packages
    9.56 +
    9.57 +dnl Test if --disable-debug given
    9.58 +AC_ARG_ENABLE(debug,
    9.59 +	[AC_HELP_STRING([--disable-debug], [disable debugging mode])],
    9.60 +	enable_debug="$enableval",
    9.61 +	enable_debug=yes)
    9.62 +
    9.63 +if test "x$enable_debug" = "xyes" ; then
    9.64 +      CFLAGS="$CFLAGS -g"
    9.65 +else
    9.66 +      AC_DEFINE( NDEBUG, 1, [disable debug messages] )
    9.67 +      CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS -DNDEBUG"
    9.68 +fi          
    9.69 +
    9.70 +AM_CONDITIONAL( NDEBUG, test "x$enable_debug" = "xyes" )
    9.71 +
    9.72 +# Check for pkgconfig
    9.73 +AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
    9.74 +# Give error and exit if we don't have pkgconfig
    9.75 +if test "x$HAVE_PKGCONFIG" = "xno"; then
    9.76 +  AC_MSG_ERROR(you need to have pkgconfig installed !)
    9.77 +fi
    9.78 +
    9.79 +# Check for Glib2.0
    9.80 +PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
    9.81 +
    9.82 +# Give error and exit if we don't have glib
    9.83 +if test "x$HAVE_GLIB" = "xno"; then
    9.84 +  AC_MSG_ERROR(you need glib-2.0 installed)
    9.85 +fi
    9.86 +
    9.87 +# make GLIB_CFLAGS and GLIB_LIBS available
    9.88 +AC_SUBST(GLIB_CFLAGS)
    9.89 +AC_SUBST(GLIB_LIBS)
    9.90 +
    9.91 +# Check for GObject2.0
    9.92 +PKG_CHECK_MODULES(GOBJECT,
    9.93 +  gobject-2.0,
    9.94 +  HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
    9.95 +
    9.96 +# Give error and exit if we don't have gobject
    9.97 +if test "x$HAVE_GOBJECT" = "xno"; then
    9.98 +  AC_MSG_ERROR(you need gobject-2.0 installed)
    9.99 +fi
   9.100 +
   9.101 +# make GOBJECT_CFLAGS and GOBJECT_LIBS available
   9.102 +AC_SUBST(GOBJECT_CFLAGS)
   9.103 +AC_SUBST(GOBJECT_LIBS)
   9.104 +
   9.105 +# Check for GTK+-2.0
   9.106 +PKG_CHECK_MODULES(GTK, gtk+-2.0, HAVE_GTK=yes,HAVE_GTK=no)
   9.107 +
   9.108 +# Give error and exit if we don't have gtk
   9.109 +if test "x$HAVE_GTK" = "xyes"; then
   9.110 +  AC_DEFINE(WITH_GTK, 1, [build with GTK+ related stuff])
   9.111 +  dnl AC_MSG_ERROR(you need gtk+-2.0 installed)
   9.112 +else
   9.113 +  AC_MSG_RESULT(no)
   9.114 +fi
   9.115 +
   9.116 +AM_CONDITIONAL(WITH_GTK, test "x$HAVE_GTK" = "xyes" )
   9.117 +
   9.118 +# make GTK_CFLAGS and GTK_LIBS available
   9.119 +AC_SUBST(GTK_CFLAGS)
   9.120 +AC_SUBST(GTK_LIBS)
   9.121 +
   9.122 +dnl ========== Check for Hildon Libraries
   9.123 +PKG_CHECK_MODULES(HILDON,
   9.124 +  libosso hildon-lgpl libosso hildon-status-bar-lib libhildonmenu hildon-base-lib hildon-control-panel hildon-libs,
   9.125 +  HAVE_HILDON=yes, HAVE_HILDON=no)
   9.126 +
   9.127 +if test "x$HAVE_HILDON" = "xyes"; then
   9.128 +  HILDON_CFLAGS="$HILDON_CFLAGS -DMAEMO_PLATFORM"
   9.129 +  AC_DEFINE(MAEMO_PLATFORM, 1, [build with hildon libs])
   9.130 +else
   9.131 +  AC_MSG_RESULT(no)
   9.132 +fi
   9.133 +
   9.134 +AM_CONDITIONAL(MAEMO_PLATFORM, test "x$HAVE_HILDON" = "xyes")
   9.135 +
   9.136 +dnl make HILDON_CFLAGS and HILDON_LIBS available
   9.137 +AC_SUBST(HILDON_CFLAGS)
   9.138 +AC_SUBST(HILDON_LIBS)
   9.139 +
   9.140 +# Check for libxml-2.0
   9.141 +PKG_CHECK_MODULES(LIBXML, libxml-2.0, HAVE_LIBXML=yes,HAVE_LIBXML=no)
   9.142 +
   9.143 +# Give error and exit if we don't have libxml
   9.144 +if test "x$HAVE_LIBXML" = "xno"; then
   9.145 +  AC_MSG_ERROR(you need libxml-2.0 installed)
   9.146 +fi
   9.147 +
   9.148 +# make LIBXML_CFLAGS and LIBXML_LIBS available
   9.149 +AC_SUBST(LIBXML_CFLAGS)
   9.150 +AC_SUBST(LIBXML_LIBS)
   9.151 +
   9.152 +
   9.153 +# check for gstreamer development files
   9.154 +GST_REQUIRED=0.10
   9.155 +GST_MAJORMINOR=0.10
   9.156 +PKG_CHECK_MODULES(GST, \
   9.157 +  gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED,
   9.158 +  HAVE_GST=yes, HAVE_GST=no)
   9.159 +
   9.160 +# Give error and exit if we don't have gstreamer
   9.161 +if test "x$HAVE_GST" = "xno"; then
   9.162 +  AC_MSG_ERROR(you need gstreamer development packages installed !)
   9.163 +fi
   9.164 +
   9.165 +# make GST_CFLAGS and GST_LIBS available
   9.166 +AC_SUBST(GST_CFLAGS)
   9.167 +AC_SUBST(GST_LIBS)
   9.168 +
   9.169 +# check for gstreamer-base plugins (xoverlay interface)
   9.170 +GSTBASE_REQUIRED=0.10
   9.171 +GSTBASE_MAJORMINOR=0.10
   9.172 +PKG_CHECK_MODULES(GSTBASE, \
   9.173 +  gstreamer-base-$GSTBASE_MAJORMINOR >= $GSTBASE_REQUIRED,
   9.174 +  HAVE_GSTBASE=yes, HAVE_GSTBASE=no)
   9.175 +
   9.176 +# Give error and exit if we don't have gstreamer base libraries
   9.177 +if test "x$HAVE_GSTBASE" = "xno"; then
   9.178 +  AC_MSG_ERROR(you need gstreamer base development packages installed !)
   9.179 +fi
   9.180 +
   9.181 +# make GSTBASE_CFLAGS and GSTBASE_LIBS available
   9.182 +AC_SUBST(GSTBASE_CFLAGS)
   9.183 +AC_SUBST(GSTBASE_LIBS)
   9.184 +
   9.185 +# make GST_MAJORMINOR available in Makefile.am
   9.186 +AC_SUBST(GST_MAJORMINOR)
   9.187 +
   9.188 +
   9.189 +# check for gstreamer-base plugins (xoverlay interface)
   9.190 +GSTPLUGINSBASE_REQUIRED=0.10
   9.191 +GSTPLUGINSBASE_MAJORMINOR=0.10
   9.192 +PKG_CHECK_MODULES(GSTPLUGINSBASE, \
   9.193 +  gstreamer-plugins-base-$GSTPLUGINSBASE_MAJORMINOR >= $GSTPLUGINSBASE_REQUIRED,
   9.194 +  HAVE_GSTPLUGINSBASE=yes, HAVE_GSTPLUGINSBASE=no)
   9.195 +
   9.196 +# Give error and exit if we don't have gstreamer base libraries
   9.197 +if test "x$HAVE_GSTPLUGINSBASE" = "xno"; then
   9.198 +  AC_MSG_ERROR(you need gstreamer plugins base development packages installed !)
   9.199 +fi
   9.200 +
   9.201 +# make GSTPLUGINSBASE_CFLAGS and GSTPLUGINSBASE_LIBS available
   9.202 +AC_SUBST(GSTPLUGINSBASE_CFLAGS)
   9.203 +AC_SUBST(GSTPLUGINSBASE_LIBS)
   9.204 +
   9.205 +# check for gstreamer-interfaces (xoverlay interface)
   9.206 +AC_CHECK_FUNC( gst_x_overlay_get_type,
   9.207 +  HAVE_GSTINTERFACES=yes, HAVE_GSTINTERFACES=no )
   9.208 +
   9.209 +# Give error and exit if we don't have gstreamer base libraries
   9.210 +if test "x$HAVE_GSTINTERFACES" = "xno"; then
   9.211 +  AC_MSG_NOTICE(you need gstreamer interfaces development packages installed !)
   9.212 +  CFLAGS="$CFLAGS -lgstinterfaces-$GSTPLUGINSBASE_MAJORMINOR"
   9.213 +fi
   9.214 +
   9.215 +# Check for gmyth-0.1
   9.216 +
   9.217 +PKG_CHECK_MODULES(LIBGMYTH, gmyth-0.1, HAVE_LIBGMYTH=yes,HAVE_LIBGMYTH=no)
   9.218 +
   9.219 +# Give error and exit if we don't have gmyth-0.1
   9.220 +if test "x$HAVE_LIBGMYTH" = "xno"; then
   9.221 +  AC_MSG_ERROR(you need gmyth-0.1 installed)
   9.222 +fi
   9.223 +
   9.224 +# make LIBXML_CFLAGS and LIBXML_LIBS available
   9.225 +AC_SUBST(LIBGMYTH_CFLAGS)
   9.226 +AC_SUBST(LIBGMYTH_LIBS)
   9.227 +
   9.228 +
   9.229 +AC_CONFIG_FILES([Makefile
   9.230 +                src/Makefile
   9.231 +                pixmaps/Makefile])
   9.232 +AC_OUTPUT
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/maemo-ui-old/m4/Makefile.am	Wed Aug 01 14:50:29 2007 +0100
    10.3 @@ -0,0 +1,7 @@
    10.4 +EXTRA_DIST = \
    10.5 +        ac_doxygen.m4 \
    10.6 +        as-compiler-flag.m4 \
    10.7 +        as-expand.m4 \
    10.8 +        as-version.m4 \
    10.9 +        as-gtk-doc.m4
   10.10 +
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/maemo-ui-old/m4/ac_doxygen.m4	Wed Aug 01 14:50:29 2007 +0100
    11.3 @@ -0,0 +1,312 @@
    11.4 +# This file is part of Autoconf.                       -*- Autoconf -*-
    11.5 +
    11.6 +# Copyright (C) 2004 Oren Ben-Kiki
    11.7 +# This file is distributed under the same terms as the Autoconf macro files.
    11.8 +
    11.9 +# Generate automatic documentation using Doxygen. Works in concert with the
   11.10 +# aminclude.m4 file and a compatible doxygen configuration file. Defines the
   11.11 +# following public macros:
   11.12 +#
   11.13 +# DX_???_FEATURE(ON|OFF) - control the default setting fo a Doxygen feature.
   11.14 +# Supported features are 'DOXYGEN' itself, 'DOT' for generating graphics,
   11.15 +# 'HTML' for plain HTML, 'CHM' for compressed HTML help (for MS users), 'CHI'
   11.16 +# for generating a seperate .chi file by the .chm file, and 'MAN', 'RTF',
   11.17 +# 'XML', 'PDF' and 'PS' for the appropriate output formats. The environment
   11.18 +# variable DOXYGEN_PAPER_SIZE may be specified to override the default 'a4wide'
   11.19 +# paper size.
   11.20 +#
   11.21 +# By default, HTML, PDF and PS documentation is generated as this seems to be
   11.22 +# the most popular and portable combination. MAN pages created by Doxygen are
   11.23 +# usually problematic, though by picking an appropriate subset and doing some
   11.24 +# massaging they might be better than nothing. CHM and RTF are specific for MS
   11.25 +# (note that you can't generate both HTML and CHM at the same time). The XML is
   11.26 +# rather useless unless you apply specialized post-processing to it.
   11.27 +#
   11.28 +# The macro mainly controls the default state of the feature. The use can
   11.29 +# override the default by specifying --enable or --disable. The macros ensure
   11.30 +# that contradictory flags are not given (e.g., --enable-doxygen-html and
   11.31 +# --enable-doxygen-chm, --enable-doxygen-anything with --disable-doxygen, etc.)
   11.32 +# Finally, each feature will be automatically disabled (with a warning) if the
   11.33 +# required programs are missing.
   11.34 +#
   11.35 +# Once all the feature defaults have been specified, call DX_INIT_DOXYGEN with
   11.36 +# the following parameters: a one-word name for the project for use as a
   11.37 +# filename base etc., an optional configuration file name (the default is
   11.38 +# 'Doxyfile', the same as Doxygen's default), and an optional output directory
   11.39 +# name (the default is 'doxygen-doc').
   11.40 +
   11.41 +## ----------##
   11.42 +## Defaults. ##
   11.43 +## ----------##
   11.44 +
   11.45 +DX_ENV=""
   11.46 +AC_DEFUN([DX_FEATURE_doc],  ON)
   11.47 +AC_DEFUN([DX_FEATURE_dot],  ON)
   11.48 +AC_DEFUN([DX_FEATURE_man],  OFF)
   11.49 +AC_DEFUN([DX_FEATURE_html], ON)
   11.50 +AC_DEFUN([DX_FEATURE_chm],  OFF)
   11.51 +AC_DEFUN([DX_FEATURE_chi],  OFF)
   11.52 +AC_DEFUN([DX_FEATURE_rtf],  OFF)
   11.53 +AC_DEFUN([DX_FEATURE_xml],  OFF)
   11.54 +AC_DEFUN([DX_FEATURE_pdf],  ON)
   11.55 +AC_DEFUN([DX_FEATURE_ps],   ON)
   11.56 +
   11.57 +## --------------- ##
   11.58 +## Private macros. ##
   11.59 +## --------------- ##
   11.60 +
   11.61 +# DX_ENV_APPEND(VARIABLE, VALUE)
   11.62 +# ------------------------------
   11.63 +# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen.
   11.64 +AC_DEFUN([DX_ENV_APPEND], [AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])])
   11.65 +
   11.66 +# DX_DIRNAME_EXPR
   11.67 +# ---------------
   11.68 +# Expand into a shell expression prints the directory part of a path.
   11.69 +AC_DEFUN([DX_DIRNAME_EXPR],
   11.70 +         [[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']])
   11.71 +
   11.72 +# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF)
   11.73 +# -------------------------------------
   11.74 +# Expands according to the M4 (static) status of the feature.
   11.75 +AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])])
   11.76 +
   11.77 +# DX_REQUIRE_PROG(VARIABLE, PROGRAM)
   11.78 +# ----------------------------------
   11.79 +# Require the specified program to be found for the DX_CURRENT_FEATURE to work.
   11.80 +AC_DEFUN([DX_REQUIRE_PROG], [
   11.81 +AC_PATH_TOOL([$1], [$2])
   11.82 +if test "$DX_FLAG_[]DX_CURRENT_FEATURE$$1" = 1; then
   11.83 +    AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION])
   11.84 +    AC_SUBST([DX_FLAG_[]DX_CURRENT_FEATURE], 0)
   11.85 +fi
   11.86 +])
   11.87 +
   11.88 +# DX_TEST_FEATURE(FEATURE)
   11.89 +# ------------------------
   11.90 +# Expand to a shell expression testing whether the feature is active.
   11.91 +AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1])
   11.92 +
   11.93 +# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE)
   11.94 +# -------------------------------------------------
   11.95 +# Verify that a required features has the right state before trying to turn on
   11.96 +# the DX_CURRENT_FEATURE.
   11.97 +AC_DEFUN([DX_CHECK_DEPEND], [
   11.98 +test "$DX_FLAG_$1" = "$2" \
   11.99 +|| AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1,
  11.100 +                            requires, contradicts) doxygen-DX_CURRENT_FEATURE])
  11.101 +])
  11.102 +
  11.103 +# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE)
  11.104 +# ----------------------------------------------------------
  11.105 +# Turn off the DX_CURRENT_FEATURE if the required feature is off.
  11.106 +AC_DEFUN([DX_CLEAR_DEPEND], [
  11.107 +test "$DX_FLAG_$1" = "$2" || AC_SUBST([DX_FLAG_[]DX_CURRENT_FEATURE], 0)
  11.108 +])
  11.109 +
  11.110 +# DX_FEATURE_ARG(FEATURE, DESCRIPTION,
  11.111 +#                CHECK_DEPEND, CLEAR_DEPEND,
  11.112 +#                REQUIRE, DO-IF-ON, DO-IF-OFF)
  11.113 +# --------------------------------------------
  11.114 +# Parse the command-line option controlling a feature. CHECK_DEPEND is called
  11.115 +# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND),
  11.116 +# otherwise CLEAR_DEPEND is called to turn off the default state if a required
  11.117 +# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional
  11.118 +# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and
  11.119 +# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature.
  11.120 +AC_DEFUN([DX_ARG_ABLE], [
  11.121 +    AC_DEFUN([DX_CURRENT_FEATURE], [$1])
  11.122 +    AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2])
  11.123 +    AC_ARG_ENABLE(doxygen-$1,
  11.124 +                  [AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1],
  11.125 +                                                      [--enable-doxygen-$1]),
  11.126 +                                  DX_IF_FEATURE([$1], [don't $2], [$2]))],
  11.127 +                  [
  11.128 +case "$enableval" in
  11.129 +#(
  11.130 +y|Y|yes|Yes|YES)
  11.131 +    AC_SUBST([DX_FLAG_$1], 1)
  11.132 +    $3
  11.133 +;; #(
  11.134 +n|N|no|No|NO)
  11.135 +    AC_SUBST([DX_FLAG_$1], 0)
  11.136 +;; #(
  11.137 +*)
  11.138 +    AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1])
  11.139 +;;
  11.140 +esac
  11.141 +], [
  11.142 +AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)])
  11.143 +$4
  11.144 +])
  11.145 +if DX_TEST_FEATURE([$1]); then
  11.146 +    $5
  11.147 +    :
  11.148 +fi
  11.149 +if DX_TEST_FEATURE([$1]); then
  11.150 +    AM_CONDITIONAL(DX_COND_$1, :)
  11.151 +    $6
  11.152 +    :
  11.153 +else
  11.154 +    AM_CONDITIONAL(DX_COND_$1, false)
  11.155 +    $7
  11.156 +    :
  11.157 +fi
  11.158 +])
  11.159 +
  11.160 +## -------------- ##
  11.161 +## Public macros. ##
  11.162 +## -------------- ##
  11.163 +
  11.164 +# DX_XXX_FEATURE(DEFAULT_STATE)
  11.165 +# -----------------------------
  11.166 +AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc],  [$1])])
  11.167 +AC_DEFUN([DX_MAN_FEATURE],     [AC_DEFUN([DX_FEATURE_man],  [$1])])
  11.168 +AC_DEFUN([DX_HTML_FEATURE],    [AC_DEFUN([DX_FEATURE_html], [$1])])
  11.169 +AC_DEFUN([DX_CHM_FEATURE],     [AC_DEFUN([DX_FEATURE_chm],  [$1])])
  11.170 +AC_DEFUN([DX_CHI_FEATURE],     [AC_DEFUN([DX_FEATURE_chi],  [$1])])
  11.171 +AC_DEFUN([DX_RTF_FEATURE],     [AC_DEFUN([DX_FEATURE_rtf],  [$1])])
  11.172 +AC_DEFUN([DX_XML_FEATURE],     [AC_DEFUN([DX_FEATURE_xml],  [$1])])
  11.173 +AC_DEFUN([DX_XML_FEATURE],     [AC_DEFUN([DX_FEATURE_xml],  [$1])])
  11.174 +AC_DEFUN([DX_PDF_FEATURE],     [AC_DEFUN([DX_FEATURE_pdf],  [$1])])
  11.175 +AC_DEFUN([DX_PS_FEATURE],      [AC_DEFUN([DX_FEATURE_ps],   [$1])])
  11.176 +
  11.177 +# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR])
  11.178 +# ---------------------------------------------------------
  11.179 +# PROJECT also serves as the base name for the documentation files.
  11.180 +# The default CONFIG-FILE is "Doxyfile" and OUTPUT-DOC-DIR is "doxygen-doc".
  11.181 +AC_DEFUN([DX_INIT_DOXYGEN], [
  11.182 +
  11.183 +# Files:
  11.184 +AC_SUBST([DX_PROJECT], [$1])
  11.185 +AC_SUBST([DX_CONFIG], [ifelse([$2], [], Doxyfile, [$2])])
  11.186 +AC_SUBST([DX_DOCDIR], [ifelse([$3], [], doxygen-doc, [$3])])
  11.187 +
  11.188 +# Environment variables used inside doxygen.cfg:
  11.189 +DX_ENV_APPEND(SRCDIR, $srcdir)
  11.190 +DX_ENV_APPEND(PROJECT, $DX_PROJECT)
  11.191 +DX_ENV_APPEND(DOCDIR, $DX_DOCDIR)
  11.192 +DX_ENV_APPEND(VERSION, $PACKAGE_VERSION)
  11.193 +
  11.194 +# Doxygen itself:
  11.195 +DX_ARG_ABLE(doc, [generate any doxygen documentation],
  11.196 +            [],
  11.197 +            [],
  11.198 +            [DX_REQUIRE_PROG([DX_DOXYGEN], doxygen)
  11.199 +             DX_REQUIRE_PROG([DX_PERL], perl)],
  11.200 +            [DX_ENV_APPEND(PERL_PATH, $DX_PERL)])
  11.201 +
  11.202 +# Dot for graphics:
  11.203 +DX_ARG_ABLE(dot, [generate graphics for doxygen documentation],
  11.204 +            [DX_CHECK_DEPEND(doc, 1)],
  11.205 +            [DX_CLEAR_DEPEND(doc, 1)],
  11.206 +            [DX_REQUIRE_PROG([DX_DOT], dot)],
  11.207 +            [DX_ENV_APPEND(HAVE_DOT, YES)
  11.208 +             DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])],
  11.209 +            [DX_ENV_APPEND(HAVE_DOT, NO)])
  11.210 +
  11.211 +# Man pages generation:
  11.212 +DX_ARG_ABLE(man, [generate doxygen manual pages],
  11.213 +            [DX_CHECK_DEPEND(doc, 1)],
  11.214 +            [DX_CLEAR_DEPEND(doc, 1)],
  11.215 +            [],
  11.216 +            [DX_ENV_APPEND(GENERATE_MAN, YES)],
  11.217 +            [DX_ENV_APPEND(GENERATE_MAN, NO)])
  11.218 +
  11.219 +# RTF file generation:
  11.220 +DX_ARG_ABLE(rtf, [generate doxygen RTF documentation],
  11.221 +            [DX_CHECK_DEPEND(doc, 1)],
  11.222 +            [DX_CLEAR_DEPEND(doc, 1)],
  11.223 +            [],
  11.224 +            [DX_ENV_APPEND(GENERATE_RTF, YES)],
  11.225 +            [DX_ENV_APPEND(GENERATE_RTF, NO)])
  11.226 +
  11.227 +# XML file generation:
  11.228 +DX_ARG_ABLE(xml, [generate doxygen XML documentation],
  11.229 +            [DX_CHECK_DEPEND(doc, 1)],
  11.230 +            [DX_CLEAR_DEPEND(doc, 1)],
  11.231 +            [],
  11.232 +            [DX_ENV_APPEND(GENERATE_XML, YES)],
  11.233 +            [DX_ENV_APPEND(GENERATE_XML, NO)])
  11.234 +
  11.235 +# (Compressed) HTML help generation:
  11.236 +DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation],
  11.237 +            [DX_CHECK_DEPEND(doc, 1)],
  11.238 +            [DX_CLEAR_DEPEND(doc, 1)],
  11.239 +            [DX_REQUIRE_PROG([DX_HHC], hhc)],
  11.240 +            [DX_ENV_APPEND(HHC_PATH, $DX_HHC)
  11.241 +             DX_ENV_APPEND(GENERATE_HTML, YES)
  11.242 +             DX_ENV_APPEND(GENERATE_HTMLHELP, YES)],
  11.243 +            [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)])
  11.244 +
  11.245 +# Seperate CHI file generation.
  11.246 +DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file],
  11.247 +            [DX_CHECK_DEPEND(chm, 1)],
  11.248 +            [DX_CLEAR_DEPEND(chm, 1)],
  11.249 +            [],
  11.250 +            [DX_ENV_APPEND(GENERATE_CHI, YES)],
  11.251 +            [DX_ENV_APPEND(GENERATE_CHI, NO)])
  11.252 +
  11.253 +# Plain HTML pages generation:
  11.254 +DX_ARG_ABLE(html, [generate doxygen plain HTML documentation],
  11.255 +            [DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)],
  11.256 +            [DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)],
  11.257 +            [],
  11.258 +            [DX_ENV_APPEND(GENERATE_HTML, YES)],
  11.259 +            [DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)])
  11.260 +
  11.261 +# PostScript file generation:
  11.262 +DX_ARG_ABLE(ps, [generate doxygen PostScript documentation],
  11.263 +            [DX_CHECK_DEPEND(doc, 1)],
  11.264 +            [DX_CLEAR_DEPEND(doc, 1)],
  11.265 +            [DX_REQUIRE_PROG([DX_LATEX], latex)
  11.266 +             DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
  11.267 +             DX_REQUIRE_PROG([DX_DVIPS], dvips)
  11.268 +             DX_REQUIRE_PROG([DX_EGREP], egrep)])
  11.269 +
  11.270 +# PDF file generation:
  11.271 +DX_ARG_ABLE(pdf, [generate doxygen PDF documentation],
  11.272 +            [DX_CHECK_DEPEND(doc, 1)],
  11.273 +            [DX_CLEAR_DEPEND(doc, 1)],
  11.274 +            [DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex)
  11.275 +             DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
  11.276 +             DX_REQUIRE_PROG([DX_EGREP], egrep)])
  11.277 +
  11.278 +# LaTeX generation for PS and/or PDF:
  11.279 +if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then
  11.280 +    AM_CONDITIONAL(DX_COND_latex, :)
  11.281 +    DX_ENV_APPEND(GENERATE_LATEX, YES)
  11.282 +else
  11.283 +    AM_CONDITIONAL(DX_COND_latex, false)
  11.284 +    DX_ENV_APPEND(GENERATE_LATEX, NO)
  11.285 +fi
  11.286 +
  11.287 +# Paper size for PS and/or PDF:
  11.288 +AC_ARG_VAR(DOXYGEN_PAPER_SIZE,
  11.289 +           [a4wide (default), a4, letter, legal or executive])
  11.290 +case "$DOXYGEN_PAPER_SIZE" in
  11.291 +#(
  11.292 +"")
  11.293 +    AC_SUBST(DOXYGEN_PAPER_SIZE, "")
  11.294 +;; #(
  11.295 +a4wide|a4|letter|legal|executive)
  11.296 +    DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE)
  11.297 +;; #(
  11.298 +*)
  11.299 +    AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'])
  11.300 +;;
  11.301 +esac
  11.302 +
  11.303 +#For debugging:
  11.304 +#echo DX_FLAG_doc=$DX_FLAG_doc
  11.305 +#echo DX_FLAG_dot=$DX_FLAG_dot
  11.306 +#echo DX_FLAG_man=$DX_FLAG_man
  11.307 +#echo DX_FLAG_html=$DX_FLAG_html
  11.308 +#echo DX_FLAG_chm=$DX_FLAG_chm
  11.309 +#echo DX_FLAG_chi=$DX_FLAG_chi
  11.310 +#echo DX_FLAG_rtf=$DX_FLAG_rtf
  11.311 +#echo DX_FLAG_xml=$DX_FLAG_xml
  11.312 +#echo DX_FLAG_pdf=$DX_FLAG_pdf
  11.313 +#echo DX_FLAG_ps=$DX_FLAG_ps
  11.314 +#echo DX_ENV=$DX_ENV
  11.315 +])
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/maemo-ui-old/m4/as-compiler-flag.m4	Wed Aug 01 14:50:29 2007 +0100
    12.3 @@ -0,0 +1,33 @@
    12.4 +dnl as-compiler-flag.m4 0.1.0
    12.5 +
    12.6 +dnl autostars m4 macro for detection of compiler flags
    12.7 +
    12.8 +dnl David Schleef <ds@schleef.org>
    12.9 +
   12.10 +dnl $Id: as-compiler-flag.m4,v 1.1.1.1 2005/08/26 00:42:44 andrunko Exp $
   12.11 +
   12.12 +dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
   12.13 +dnl Tries to compile with the given CFLAGS.
   12.14 +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
   12.15 +dnl and ACTION-IF-NOT-ACCEPTED otherwise.
   12.16 +
   12.17 +AC_DEFUN([AS_COMPILER_FLAG],
   12.18 +[
   12.19 +  AC_MSG_CHECKING([to see if compiler understands $1])
   12.20 +
   12.21 +  save_CFLAGS="$CFLAGS"
   12.22 +  CFLAGS="$CFLAGS $1"
   12.23 +
   12.24 +  AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
   12.25 +  CFLAGS="$save_CFLAGS"
   12.26 +
   12.27 +  if test "X$flag_ok" = Xyes ; then
   12.28 +    $2
   12.29 +    true
   12.30 +  else
   12.31 +    $3
   12.32 +    true
   12.33 +  fi
   12.34 +  AC_MSG_RESULT([$flag_ok])
   12.35 +])
   12.36 +
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/maemo-ui-old/m4/as-expand.m4	Wed Aug 01 14:50:29 2007 +0100
    13.3 @@ -0,0 +1,40 @@
    13.4 +dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
    13.5 +dnl
    13.6 +dnl example
    13.7 +dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
    13.8 +dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
    13.9 +
   13.10 +AC_DEFUN([AS_AC_EXPAND],
   13.11 +[
   13.12 +  EXP_VAR=[$1]
   13.13 +  FROM_VAR=[$2]
   13.14 +
   13.15 +  dnl first expand prefix and exec_prefix if necessary
   13.16 +  prefix_save=$prefix
   13.17 +  exec_prefix_save=$exec_prefix
   13.18 +
   13.19 +  dnl if no prefix given, then use /usr/local, the default prefix
   13.20 +  if test "x$prefix" = "xNONE"; then
   13.21 +    prefix=$ac_default_prefix
   13.22 +  fi
   13.23 +  dnl if no exec_prefix given, then use prefix
   13.24 +  if test "x$exec_prefix" = "xNONE"; then
   13.25 +    exec_prefix=$prefix
   13.26 +  fi
   13.27 +
   13.28 +  full_var="$FROM_VAR"
   13.29 +  dnl loop until it doesn't change anymore
   13.30 +  while true; do
   13.31 +    new_full_var="`eval echo $full_var`"
   13.32 +    if test "x$new_full_var"="x$full_var"; then break; fi
   13.33 +    full_var=$new_full_var
   13.34 +  done
   13.35 +
   13.36 +  dnl clean up
   13.37 +  full_var=$new_full_var
   13.38 +  AC_SUBST([$1], "$full_var")
   13.39 +
   13.40 +  dnl restore prefix and exec_prefix
   13.41 +  prefix=$prefix_save
   13.42 +  exec_prefix=$exec_prefix_save
   13.43 +])
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/maemo-ui-old/m4/as-version.m4	Wed Aug 01 14:50:29 2007 +0100
    14.3 @@ -0,0 +1,59 @@
    14.4 +dnl version.m4 0.0.5
    14.5 +dnl autostars m4 macro for versioning
    14.6 +dnl thomas@apestaart.org
    14.7 +dnl
    14.8 +dnl AS_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, MICRO, NANO, ACTION_IF_NO_NANO, ACTION_IF_NANO)
    14.9 +dnl example
   14.10 +dnl AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2,)
   14.11 +dnl for a 0.3.2 release version
   14.12 +dnl
   14.13 +dnl this macro
   14.14 +dnl - defines [$PREFIX]_MAJOR, MINOR and MICRO
   14.15 +dnl - if NANO is empty, then we're in release mode, else in cvs/dev mode
   14.16 +dnl - defines [$PREFIX], VERSION, and [$PREFIX]_RELEASE
   14.17 +dnl - executes the relevant action
   14.18 +dnl - AC_SUBST's PACKAGE, VERSION, [$PREFIX] and [$PREFIX]_RELEASE
   14.19 +dnl   as well as the little ones
   14.20 +dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents
   14.21 +dnl   maintainer mode from running ok
   14.22 +dnl
   14.23 +dnl don't forget to put #undef [$2] and [$2]_RELEASE in acconfig.h
   14.24 +
   14.25 +AC_DEFUN([AS_VERSION],
   14.26 +[
   14.27 +  PACKAGE=[$1]
   14.28 +  [$2]_MAJOR_VERSION=[$3]
   14.29 +  [$2]_MINOR_VERSION=[$4]
   14.30 +  [$2]_MICRO_VERSION=[$5]
   14.31 +  NANO=[$6]
   14.32 +  [$2]_NANO_VERSION=$NANO
   14.33 +  if test "x$NANO" = "x" || test "x$NANO" = "x0";
   14.34 +  then
   14.35 +      AC_MSG_NOTICE(configuring [$1] for release)
   14.36 +      VERSION=[$3].[$4].[$5]
   14.37 +      [$2]_RELEASE=1
   14.38 +      dnl execute action
   14.39 +      ifelse([$7], , :, [$7])
   14.40 +  else
   14.41 +      AC_MSG_NOTICE(configuring [$1] for development with nano $NANO)
   14.42 +      VERSION=[$3].[$4].[$5].$NANO
   14.43 +      [$2]_RELEASE=`date +%Y%m%d_%H%M%S`
   14.44 +      dnl execute action
   14.45 +      ifelse([$8], , :, [$8])
   14.46 +  fi
   14.47 +
   14.48 +  [$2]_VERSION=$VERSION
   14.49 +  AC_DEFINE_UNQUOTED([$2]_VERSION, "$[$2]_VERSION", [Define the version])
   14.50 +  AC_SUBST([$2]_VERSION)
   14.51 +  
   14.52 +  AC_SUBST([$2]_RELEASE)
   14.53 +
   14.54 +  AC_SUBST([$2]_MAJOR_VERSION)
   14.55 +  AC_SUBST([$2]_MINOR_VERSION)
   14.56 +  AC_SUBST([$2]_MICRO_VERSION)
   14.57 +  AC_SUBST([$2]_NANO_VERSION)
   14.58 +  AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name])
   14.59 +  AC_SUBST(PACKAGE)
   14.60 +  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version])
   14.61 +  AC_SUBST(VERSION)
   14.62 +])
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/maemo-ui-old/pixmaps/Makefile.am	Wed Aug 01 14:50:29 2007 +0100
    15.3 @@ -0,0 +1,11 @@
    15.4 +# Adding the application icon
    15.5 +#icondir = $(datadir)/mmyth/pixmaps
    15.6 +#icon_DATA = \
    15.7 +#	mmyth.png
    15.8 +
    15.9 +
   15.10 +# Adding the application resources
   15.11 +pixmapdir = $(pkgdatadir)/pixmaps
   15.12 +pixmap_DATA = mmyth_logo.png
   15.13 +
   15.14 +EXTRA_DIST = $(pixmap_DATA)
    16.1 Binary file maemo-ui-old/pixmaps/mmyth_logo.png has changed
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/maemo-ui-old/src/Makefile.am	Wed Aug 01 14:50:29 2007 +0100
    17.3 @@ -0,0 +1,46 @@
    17.4 +bin_PROGRAMS = mmyth
    17.5 +
    17.6 +mmyth_SOURCES =	\
    17.7 +		mmyth_main.c			\
    17.8 +		mmyth_ui.c				\
    17.9 +		mmyth_uicommon.c		\
   17.10 +		mmyth_epg_grid_view.c	\
   17.11 +		mmyth_epg_grid_widget.c	\
   17.12 +		mmyth_recordui.c		\
   17.13 +		mmyth_uisettings.c		\
   17.14 +		mmyth_schedulerui.c		\
   17.15 +		mmyth_tvplayer.c
   17.16 +
   17.17 +mmyth_CFLAGS = \
   17.18 +		$(GTK_CFLAGS) \
   17.19 +		$(GLIB_CFLAGS) \
   17.20 +		$(GST_CFLAGS) \
   17.21 +		$(GSTBASE_CFLAGS) \
   17.22 +		$(GSTPLUGINSBASE_CFLAGS) \
   17.23 +		$(MYSQL_CFLAGS) \
   17.24 +		$(LIBGMYTH_CFLAGS) \
   17.25 +		-I$(top_srcdir)/src \
   17.26 +		-DDATA_DIR=\""$(pkgdatadir)"\" \
   17.27 +		-DPIX_DIR=\""$(pkgdatadir)/pixmaps/"\" \
   17.28 +		-DICON_DIR=\""$(datadir)/pixmaps/"\" \
   17.29 +		-g3 -O0
   17.30 +
   17.31 +if MAEMO_PLATFORM 
   17.32 +mmyth_CFLAGS+= \
   17.33 +	$(HILDON_CFLAGS)
   17.34 +endif
   17.35 +
   17.36 +mmyth_LDADD = 	\
   17.37 +		$(LIBGMYTH_LIBS) \
   17.38 +		$(GTK_LIBS) \
   17.39 +		$(GLIB_LIBS) \
   17.40 +		$(GST_LIBS) \
   17.41 +		$(GSTBASE_LIBS) \
   17.42 +		$(GSTPLUGINSBASE_LIBS) \
   17.43 +		$(GSTINTERFACES_LIBS)
   17.44 +
   17.45 +if MAEMO_PLATFORM
   17.46 +mmyth_LDADD += 	\
   17.47 +	$(HILDON_LIBS)
   17.48 +endif
   17.49 +
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/maemo-ui-old/src/mmyth_epg_grid_view.c	Wed Aug 01 14:50:29 2007 +0100
    18.3 @@ -0,0 +1,243 @@
    18.4 +#include <string.h>
    18.5 +#include <stdlib.h>
    18.6 +#include <gtk/gtk.h>
    18.7 +#include <gdk/gdkkeysyms.h>
    18.8 +#include <time.h>
    18.9 +
   18.10 +#include "mmyth_epg_grid_view.h"
   18.11 +#include "mmyth_epg_grid_widget.h"
   18.12 +
   18.13 +/*
   18.14 + * Service genre 
   18.15 + */
   18.16 +#define GENRE_MIN               0
   18.17 +#define GENRE_MAX               10
   18.18 +#define GENRE_UNDEFINED         0
   18.19 +#define GENRE_MOVIE             1
   18.20 +#define GENRE_NEWS              2
   18.21 +#define GENRE_SHOW              3
   18.22 +#define GENRE_SPORTS            4
   18.23 +#define GENRE_CHILDREN          5
   18.24 +#define GENRE_MUSIC             6
   18.25 +#define GENRE_CULTURE           7
   18.26 +#define GENRE_SOCIAL            8
   18.27 +#define GENRE_EDUCATION         9
   18.28 +#define GENRE_LEISURE           10
   18.29 +
   18.30 +#define NRO_HOURS 3
   18.31 +
   18.32 +/*
   18.33 + * Function prototypes
   18.34 + */
   18.35 +static void     update_service_details(MMythEpgGridWidget * object,
   18.36 +                                       gpointer arg1, gpointer user_data);
   18.37 +static gboolean key_press_epg_grid_view(GtkWidget * widget,
   18.38 +                                        GdkEventKey * event,
   18.39 +                                        gpointer user_data);
   18.40 +
   18.41 +static GtkWidget *mmyth_epg_grid_widget = NULL;
   18.42 +
   18.43 +/*
   18.44 + * is a GtkEventBox 
   18.45 + */
   18.46 +static GtkWidget *program_details_area = NULL;
   18.47 +static GtkWidget *details_main_hbox = NULL;
   18.48 +static GtkWidget *details_vbox = NULL;
   18.49 +static GtkWidget *details_logo_vbox = NULL;
   18.50 +
   18.51 +/*
   18.52 + * update signal callback from MMythEpgGridWidget 
   18.53 + */
   18.54 +static void
   18.55 +update_service_details(MMythEpgGridWidget * object, gpointer arg1,
   18.56 +                       gpointer user_data)
   18.57 +{
   18.58 +    g_return_if_fail(arg1 != NULL);
   18.59 +
   18.60 +    EpgGridItem    *epg_grid_item = (EpgGridItem *) arg1;
   18.61 +
   18.62 +    gchar           sel_prog_desc[100] = "<big><b>";
   18.63 +    gchar           time_buffer[50];
   18.64 +
   18.65 +    /*
   18.66 +     * FIXME: get first content from content_list
   18.67 +     */
   18.68 +    GMythProgramInfo *proginfo =
   18.69 +        (GMythProgramInfo *) epg_grid_item->proginfo;
   18.70 +
   18.71 +    if (proginfo) {
   18.72 +        GString        *prog_name = proginfo->title;
   18.73 +        GString        *service_name = proginfo->chanid;
   18.74 +
   18.75 +        if (details_vbox != NULL)
   18.76 +            gtk_container_remove(GTK_CONTAINER(details_main_hbox),
   18.77 +                                 details_vbox);
   18.78 +
   18.79 +        /*
   18.80 +         * update service description 
   18.81 +         */
   18.82 +        strcat(sel_prog_desc, service_name->str);
   18.83 +        strcat(sel_prog_desc, "</b></big>");
   18.84 +
   18.85 +        GtkWidget      *fst_line_lbl = gtk_label_new(NULL);
   18.86 +        gtk_misc_set_alignment(GTK_MISC(fst_line_lbl), 0.0, 0.0);
   18.87 +        gtk_label_set_markup(GTK_LABEL(fst_line_lbl), sel_prog_desc);
   18.88 +
   18.89 +        /*
   18.90 +         * freeing char[] 
   18.91 +         */
   18.92 +        sel_prog_desc[0] = 0;
   18.93 +        strcat(sel_prog_desc, "\t");
   18.94 +        strcat(sel_prog_desc, prog_name->str);
   18.95 +
   18.96 +        struct tm       loctime_start,
   18.97 +                        loctime_end;
   18.98 +
   18.99 +        // Convert it to local time representation. 
  18.100 +        /*
  18.101 +         * FIXME: conversion from time to localtime is different in
  18.102 +         * different machines 
  18.103 +         */
  18.104 +        long int        schedule_start_time = proginfo->startts->tv_sec;
  18.105 +        long int        schedule_end_time = proginfo->endts->tv_sec;
  18.106 +
  18.107 +        if (localtime_r(&schedule_start_time, &loctime_start) == NULL) {
  18.108 +            g_warning("localtime_r error in mmyth_epg_grid_view!\n");
  18.109 +        }
  18.110 +#if 0
  18.111 +        fprintf(stderr, asctime(loctime_start));
  18.112 +#endif
  18.113 +
  18.114 +        strftime(time_buffer, 100, "  %H:%M - ", &loctime_start);
  18.115 +        strcat(sel_prog_desc, time_buffer);
  18.116 +
  18.117 +        if (localtime_r(&schedule_end_time, &loctime_end) == NULL) {
  18.118 +            g_warning("localtime_r error in mmyth_epg_grid_view!\n");
  18.119 +        }
  18.120 +#if 0
  18.121 +        fprintf(stderr, asctime(loctime_end));
  18.122 +#endif
  18.123 +
  18.124 +        strftime(time_buffer, 100, "%H:%M\n", &loctime_end);
  18.125 +        strcat(sel_prog_desc, time_buffer);
  18.126 +
  18.127 +        GtkWidget      *snd_line_lbl = gtk_label_new(NULL);
  18.128 +        gtk_misc_set_alignment(GTK_MISC(snd_line_lbl), 0.0, 0.0);
  18.129 +        gtk_label_set_markup(GTK_LABEL(snd_line_lbl), sel_prog_desc);
  18.130 +
  18.131 +        // add the current selected program description to the label
  18.132 +        details_vbox = gtk_vbox_new(FALSE, 0);
  18.133 +        GtkWidget      *fst_line_hbox = gtk_hbox_new(FALSE, 0);
  18.134 +
  18.135 +        gtk_box_pack_start(GTK_BOX(fst_line_hbox),
  18.136 +                           fst_line_lbl, FALSE, FALSE, 6);
  18.137 +        gtk_box_pack_start(GTK_BOX(details_vbox),
  18.138 +                           fst_line_hbox, FALSE, FALSE, 0);
  18.139 +        gtk_box_pack_start(GTK_BOX(details_vbox),
  18.140 +                           snd_line_lbl, FALSE, FALSE, 0);
  18.141 +        gtk_box_pack_start(GTK_BOX(details_main_hbox),
  18.142 +                           details_vbox, FALSE, FALSE, 0);
  18.143 +
  18.144 +        gtk_widget_show_all(details_main_hbox);
  18.145 +    }
  18.146 +}
  18.147 +
  18.148 +/*
  18.149 + * Callback for hardware keys 
  18.150 + */
  18.151 +static          gboolean
  18.152 +key_press_epg_grid_view(GtkWidget * widget,
  18.153 +                        GdkEventKey * event, gpointer user_data)
  18.154 +{
  18.155 +    MMythEpgGridWidget *mmyth_epg_grid_widget =
  18.156 +        (MMythEpgGridWidget *) user_data;
  18.157 +
  18.158 +    return mmyth_epg_grid_widget_key_press(mmyth_epg_grid_widget, widget,
  18.159 +                                           event);
  18.160 +}
  18.161 +
  18.162 +GtkWidget      *
  18.163 +epg_grid_view_new(MMythUi * mmyth_ui)
  18.164 +{
  18.165 +    GtkWidget      *scrolled_window;
  18.166 +    scrolled_window = gtk_scrolled_window_new(NULL, NULL);
  18.167 +    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window),
  18.168 +                                   GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
  18.169 +
  18.170 +    gtk_widget_modify_bg(scrolled_window, GTK_STATE_NORMAL,
  18.171 +                         &main_bg_color);
  18.172 +
  18.173 +    GtkWidget      *main_vbox = gtk_vbox_new(FALSE, 0);
  18.174 +    // gtk_container_set_border_width(main_vbox, 4); 
  18.175 +
  18.176 +    GtkWidget      *details_event_box = gtk_event_box_new();
  18.177 +    gtk_widget_modify_bg(details_event_box, GTK_STATE_NORMAL,
  18.178 +                         &main_bg_color);
  18.179 +
  18.180 +    program_details_area = gtk_vbox_new(FALSE, 0);
  18.181 +    gtk_container_add(GTK_CONTAINER(details_event_box),
  18.182 +                      program_details_area);
  18.183 +    gtk_container_set_border_width(GTK_CONTAINER(program_details_area), 4);
  18.184 +
  18.185 +    details_main_hbox = gtk_hbox_new(FALSE, 10);
  18.186 +
  18.187 +    gtk_box_pack_start(GTK_BOX(program_details_area),
  18.188 +                       details_main_hbox, FALSE, FALSE, 0);
  18.189 +
  18.190 +    details_logo_vbox = gtk_vbox_new(FALSE, 0);
  18.191 +
  18.192 +    GtkWidget      *details_desc_vbox = gtk_vbox_new(FALSE, 0);
  18.193 +
  18.194 +    gtk_box_pack_start(GTK_BOX(details_main_hbox),
  18.195 +                       details_desc_vbox, FALSE, FALSE, 0);
  18.196 +    gtk_box_pack_start(GTK_BOX(details_main_hbox),
  18.197 +                       details_logo_vbox, FALSE, FALSE, 0);
  18.198 +
  18.199 +    gtk_widget_set_size_request(program_details_area, -1, 120);
  18.200 +
  18.201 +    mmyth_epg_grid_widget = mmyth_epg_grid_widget_new();
  18.202 +    g_signal_connect(mmyth_epg_grid_widget, "selection_updated",
  18.203 +                     G_CALLBACK(update_service_details), NULL);
  18.204 +
  18.205 +    /*
  18.206 +     * select by default the first service 
  18.207 +     */
  18.208 +    /*
  18.209 +     * depends on mount services 
  18.210 +     */
  18.211 +    if (MMYTH_EPG_GRID_WIDGET(mmyth_epg_grid_widget)->epg_view_model) {
  18.212 +        GList          *fst_service = (GList *)
  18.213 +            MMYTH_EPG_GRID_WIDGET(mmyth_epg_grid_widget)->epg_view_model->
  18.214 +            data;
  18.215 +        mmyth_epg_grid_widget_update_service(MMYTH_EPG_GRID_WIDGET
  18.216 +                                             (mmyth_epg_grid_widget),
  18.217 +                                             fst_service);
  18.218 +    }
  18.219 +
  18.220 +    gtk_box_pack_start(GTK_BOX(main_vbox),
  18.221 +                       details_event_box, FALSE, FALSE, 0);
  18.222 +    gtk_box_pack_start(GTK_BOX(main_vbox),
  18.223 +                       gtk_hseparator_new(), FALSE, FALSE, 0);
  18.224 +    gtk_box_pack_start(GTK_BOX(main_vbox),
  18.225 +                       mmyth_epg_grid_widget, FALSE, FALSE, 0);
  18.226 +
  18.227 +    gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW
  18.228 +                                          (scrolled_window), main_vbox);
  18.229 +
  18.230 +    /*
  18.231 +     * Add hardware button listener to application 
  18.232 +     */
  18.233 +    g_signal_connect(mmyth_ui->main_window, "key_press_event",
  18.234 +                     G_CALLBACK(key_press_epg_grid_view),
  18.235 +                     mmyth_epg_grid_widget);
  18.236 +
  18.237 +    gtk_widget_show_all(scrolled_window);
  18.238 +
  18.239 +    return scrolled_window;
  18.240 +}
  18.241 +
  18.242 +/*
  18.243 + * DVBHScheduleEvent * mmyth_epg_grid_view_get_selected_schedule() {
  18.244 + * return mmyth_epg_grid_get_selected_schedule
  18.245 + * (MMYTH_EPG_GRID_WIDGET(mmyth_epg_grid_widget)); } 
  18.246 + */
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/maemo-ui-old/src/mmyth_epg_grid_view.h	Wed Aug 01 14:50:29 2007 +0100
    19.3 @@ -0,0 +1,8 @@
    19.4 +#ifndef MMYTH_ESG_GRID_VIEW_H_
    19.5 +#define MMYTH_ESG_GRID_VIEW_H_
    19.6 +
    19.7 +#include "mmyth_ui.h"
    19.8 +
    19.9 +GtkWidget      *epg_grid_view_new(MMythUi * mmyth_ui);
   19.10 +
   19.11 +#endif                          /* MMYTH_ESG_GRID_VIEW_H_ */
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/maemo-ui-old/src/mmyth_epg_grid_widget.c	Wed Aug 01 14:50:29 2007 +0100
    20.3 @@ -0,0 +1,776 @@
    20.4 +#include <gtk/gtksignal.h>
    20.5 +#include <gdk/gdkevents.h>
    20.6 +#include <gdk/gdkkeysyms.h>
    20.7 +
    20.8 +#include "mmyth_uicommon.h"
    20.9 +#include "mmyth_epg_grid_widget.h"
   20.10 +
   20.11 +#include <gmyth/gmyth_util.h>
   20.12 +#include <gmyth/gmyth_epg.h>
   20.13 +
   20.14 +#define PIXELS_HOUR 105
   20.15 +#define PROGRAM_SEPARATION 2
   20.16 +
   20.17 +enum {
   20.18 +    SELECTION_UPDATED_SIGNAL,
   20.19 +    LAST_SIGNAL
   20.20 +};
   20.21 +
   20.22 +struct _MMythEpgGridWidgetPrivate {
   20.23 +    /*
   20.24 +     * private widget components 
   20.25 +     */
   20.26 +    GtkWidget      *epg_channels_vbox;
   20.27 +    GtkWidget      *epg_programs_vbox;
   20.28 +
   20.29 +    GHashTable     *service_model_hash;
   20.30 +
   20.31 +    /*
   20.32 +     * guidegrid attributes 
   20.33 +     */
   20.34 +    gboolean        show_favorites;
   20.35 +    gint            current_start_channel_id;
   20.36 +
   20.37 +    GTimeVal       *current_start_time;
   20.38 +    GTimeVal       *current_end_time;
   20.39 +
   20.40 +    guint           selected_channel_index;
   20.41 +
   20.42 +    /*
   20.43 +     * GList of ProgramInfo for each Channel 
   20.44 +     */
   20.45 +    GList          *program_list[MAX_DISPLAY_CHANS];
   20.46 +    GList          *channel_list;
   20.47 +
   20.48 +    GMythEPG       *mmyth_epg;
   20.49 +
   20.50 +    GMythBackendInfo *backend_info;
   20.51 +
   20.52 +    gint            DISPLAY_CHANS;
   20.53 +};
   20.54 +
   20.55 +static void     mmyth_epg_grid_widget_class_init(MMythEpgGridWidgetClass *
   20.56 +                                                 klass);
   20.57 +static void     mmyth_epg_grid_widget_init(MMythEpgGridWidget * object);
   20.58 +static void    
   20.59 +mmyth_epg_grid_widget_private_init(MMythEpgGridWidgetPrivate * private);
   20.60 +static void     mmyth_epg_grid_widget_mount_services(MMythEpgGridWidget *
   20.61 +                                                     object,
   20.62 +                                                     GTimeVal * start_time,
   20.63 +                                                     GTimeVal * end_time);
   20.64 +static void     mmyth_epg_grid_widget_mount_header(MMythEpgGridWidget *
   20.65 +                                                   object);
   20.66 +static void     mmyth_epg_grid_widget_clicked(GtkWidget * widget,
   20.67 +                                              GdkEventExpose * event,
   20.68 +                                              gpointer data);
   20.69 +static GtkWidget *create_event_box_lbl(gchar * str, int width,
   20.70 +                                       const GdkColor * bg_color,
   20.71 +                                       const GdkColor * fg_color);
   20.72 +
   20.73 +static void    
   20.74 +mmyth_epg_grid_widget_fill_programinfos(MMythEpgGridWidgetPrivate *
   20.75 +                                        private);
   20.76 +static void    
   20.77 +mmyth_epg_grid_widget_fill_program_row_infos(MMythEpgGridWidgetPrivate *
   20.78 +                                             private, unsigned int chanNum,
   20.79 +                                             unsigned int row);
   20.80 +
   20.81 +static gint     mmyth_epg_grid_widget_signals[LAST_SIGNAL] = { 0 };
   20.82 +
   20.83 +G_DEFINE_TYPE(MMythEpgGridWidget, mmyth_epg_grid_widget,
   20.84 +              GTK_TYPE_EVENT_BOX)
   20.85 +
   20.86 +    static void
   20.87 +     
   20.88 +        
   20.89 +        
   20.90 +        
   20.91 +        
   20.92 +        
   20.93 +        
   20.94 +        
   20.95 +        
   20.96 +        
   20.97 +        
   20.98 +        
   20.99 +        
  20.100 +          mmyth_epg_grid_widget_class_init(MMythEpgGridWidgetClass * klass)
  20.101 +{
  20.102 +    g_type_class_add_private(klass, sizeof(MMythEpgGridWidgetPrivate));
  20.103 +
  20.104 +    mmyth_epg_grid_widget_signals[SELECTION_UPDATED_SIGNAL] =
  20.105 +        g_signal_new("selection_updated", G_TYPE_FROM_CLASS(klass),
  20.106 +                     G_SIGNAL_RUN_FIRST, 0, NULL, NULL,
  20.107 +                     g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
  20.108 +                     G_TYPE_POINTER);
  20.109 +}
  20.110 +
  20.111 +static void
  20.112 +mmyth_epg_grid_widget_private_init(MMythEpgGridWidgetPrivate * private)
  20.113 +{
  20.114 +    time_t          cur_time;
  20.115 +
  20.116 +    g_return_if_fail(private != NULL);
  20.117 +
  20.118 +    private->epg_channels_vbox = NULL;
  20.119 +    private->epg_programs_vbox = NULL;
  20.120 +    private->service_model_hash = NULL;
  20.121 +
  20.122 +    private->show_favorites = FALSE;
  20.123 +    private->current_start_channel_id = -1;
  20.124 +
  20.125 +    /*
  20.126 +     * Selected the first diplayable channel initially 
  20.127 +     */
  20.128 +    private->selected_channel_index = 0;
  20.129 +
  20.130 +    /*
  20.131 +     * TODO fix the current start/end time 
  20.132 +     */
  20.133 +    private->current_start_time = g_new0(GTimeVal, 1);
  20.134 +    private->current_start_time->tv_sec = time(&cur_time);
  20.135 +
  20.136 +    private->current_end_time = g_new0(GTimeVal, 1);
  20.137 +    private->current_end_time->tv_sec = time(&cur_time) + 10800;
  20.138 +
  20.139 +    private->DISPLAY_CHANS = MAX_DISPLAY_CHANS;
  20.140 +
  20.141 +    private->backend_info =
  20.142 +        gmyth_backend_info_new_full("localhost", "mythtv", "mythtv",
  20.143 +                                    "mythconverg", 6543);
  20.144 +
  20.145 +    // TODO: Close the epg and unref it in dispose call
  20.146 +    private->mmyth_epg = gmyth_epg_new();
  20.147 +    if (!gmyth_epg_connect(private->mmyth_epg, private->backend_info)) {
  20.148 +        g_warning("[%s] Could not connect mysql handler to db",
  20.149 +                  __FUNCTION__);
  20.150 +        g_object_unref(private->mmyth_epg);
  20.151 +        private->mmyth_epg = NULL;
  20.152 +    }
  20.153 +}
  20.154 +
  20.155 +static void
  20.156 +mmyth_epg_grid_widget_init(MMythEpgGridWidget * mmyth_epg_grid_widget)
  20.157 +{
  20.158 +    MMythEpgGridWidgetPrivate *private =
  20.159 +        MMYTH_EPG_GRID_WIDGET_GET_PRIVATE(mmyth_epg_grid_widget);
  20.160 +
  20.161 +    /*
  20.162 +     * init private fields 
  20.163 +     */
  20.164 +    mmyth_epg_grid_widget_private_init(private);
  20.165 +
  20.166 +    mmyth_epg_grid_widget->epg_view_model = NULL;
  20.167 +    mmyth_epg_grid_widget->selected_grid_item = NULL;
  20.168 +
  20.169 +    GtkWidget      *epg_event_box = GTK_WIDGET(mmyth_epg_grid_widget);
  20.170 +    gtk_widget_modify_bg(epg_event_box, GTK_STATE_NORMAL, &main_bg_color);
  20.171 +    gtk_widget_set_size_request(epg_event_box, 0, 125);
  20.172 +
  20.173 +    GtkWidget      *epg_main_hbox = gtk_hbox_new(FALSE, 10);
  20.174 +    gtk_container_set_border_width(GTK_CONTAINER(epg_main_hbox), 10);
  20.175 +
  20.176 +    gtk_container_add(GTK_CONTAINER(epg_event_box), epg_main_hbox);
  20.177 +
  20.178 +    /*
  20.179 +     * channels vbox 
  20.180 +     */
  20.181 +    GtkWidget      *epg_channels_vbox = gtk_vbox_new(FALSE, 3);
  20.182 +    private->epg_channels_vbox = epg_channels_vbox;
  20.183 +
  20.184 +    /*
  20.185 +     * programs vbox 
  20.186 +     */
  20.187 +    GtkWidget      *epg_programs_vbox = gtk_vbox_new(FALSE, 3);
  20.188 +    private->epg_programs_vbox = epg_programs_vbox;
  20.189 +
  20.190 +    /*
  20.191 +     * packing start 
  20.192 +     */
  20.193 +    gtk_box_pack_start(GTK_BOX(epg_main_hbox),
  20.194 +                       epg_channels_vbox, FALSE, FALSE, 0);
  20.195 +    gtk_box_pack_start(GTK_BOX(epg_main_hbox),
  20.196 +                       epg_programs_vbox, FALSE, FALSE, 0);
  20.197 +
  20.198 +    /*
  20.199 +     * table header (first line) 
  20.200 +     */
  20.201 +    mmyth_epg_grid_widget_mount_header(mmyth_epg_grid_widget);
  20.202 +
  20.203 +    /*
  20.204 +     * service programs 
  20.205 +     */
  20.206 +    /*
  20.207 +     * mount service programs with current time 
  20.208 +     */
  20.209 +    mmyth_epg_grid_widget_mount_services(mmyth_epg_grid_widget,
  20.210 +                                         private->current_start_time,
  20.211 +                                         private->current_end_time);
  20.212 +}
  20.213 +
  20.214 +GtkWidget      *
  20.215 +mmyth_epg_grid_widget_new()
  20.216 +{
  20.217 +    return GTK_WIDGET(gtk_type_new(mmyth_epg_grid_widget_get_type()));
  20.218 +}
  20.219 +
  20.220 +static void
  20.221 +mmyth_epg_grid_widget_mount_services(MMythEpgGridWidget *
  20.222 +                                     mmyth_epg_grid_widget,
  20.223 +                                     GTimeVal * start_time,
  20.224 +                                     GTimeVal * end_time)
  20.225 +{
  20.226 +    GList          *proglist;
  20.227 +    GList          *channel_list = NULL;
  20.228 +    GMythChannelInfo *channel_info;
  20.229 +
  20.230 +    int             chanid;
  20.231 +    MMythEpgGridWidgetPrivate *private =
  20.232 +        MMYTH_EPG_GRID_WIDGET_GET_PRIVATE(mmyth_epg_grid_widget);
  20.233 +
  20.234 +    // update view_model
  20.235 +    /*
  20.236 +     * FIXME shallow free or recursive? 
  20.237 +     */
  20.238 +    if (mmyth_epg_grid_widget->epg_view_model != NULL) {
  20.239 +        g_list_free(mmyth_epg_grid_widget->epg_view_model);
  20.240 +        mmyth_epg_grid_widget->epg_view_model = NULL;
  20.241 +    }
  20.242 +
  20.243 +    if (private->service_model_hash != NULL) {
  20.244 +        g_hash_table_destroy(private->service_model_hash);
  20.245 +    }
  20.246 +
  20.247 +    private->service_model_hash = g_hash_table_new(NULL, NULL);
  20.248 +
  20.249 +    /*
  20.250 +     * fill program infos from db 
  20.251 +     */
  20.252 +    mmyth_epg_grid_widget_fill_programinfos(private);
  20.253 +
  20.254 +    channel_list = private->channel_list;
  20.255 +
  20.256 +    /*
  20.257 +     * for each channel get_programs() 
  20.258 +     */
  20.259 +    for (chanid = 0; channel_list &&
  20.260 +         chanid < private->DISPLAY_CHANS; chanid++) {
  20.261 +        proglist = (GList *) private->program_list[chanid];
  20.262 +
  20.263 +        channel_info = (GMythChannelInfo *) channel_list->data;
  20.264 +        channel_list = g_list_next(channel_list);
  20.265 +
  20.266 +        /*
  20.267 +         * Service Title
  20.268 +         */
  20.269 +        GString        *name = NULL;
  20.270 +        if (channel_info->channel_name)
  20.271 +            name = g_string_new(channel_info->channel_name->str);
  20.272 +
  20.273 +        GdkColor        title_bg_color;
  20.274 +        title_bg_color.red = 5000;
  20.275 +        title_bg_color.green = 9000;
  20.276 +        title_bg_color.blue = 40000;
  20.277 +
  20.278 +        GdkColor        title_fg_color;
  20.279 +        title_fg_color.red = 60000;
  20.280 +        title_fg_color.green = 60000;
  20.281 +        title_fg_color.blue = 60000;
  20.282 +
  20.283 +        GtkWidget      *event_box_channel =
  20.284 +            create_event_box_lbl(name->str, 90,
  20.285 +                                 &title_bg_color,
  20.286 +                                 &title_fg_color);
  20.287 +
  20.288 +        gtk_box_pack_start(GTK_BOX(private->epg_channels_vbox),
  20.289 +                           event_box_channel, FALSE, FALSE, 0);
  20.290 +
  20.291 +        GtkWidget      *epg_line_hbox = gtk_hbox_new(FALSE, 0);
  20.292 +
  20.293 +        GdkColor        bg_color;
  20.294 +        bg_color.red = 5000;
  20.295 +        bg_color.green = 30000;
  20.296 +        bg_color.blue = 60000;
  20.297 +
  20.298 +        GdkColor        fg_color;
  20.299 +        fg_color.red = 60000;
  20.300 +        fg_color.green = 60000;
  20.301 +        fg_color.blue = 60000;
  20.302 +
  20.303 +        /*
  20.304 +         * Content parsing 
  20.305 +         */
  20.306 +        GList          *epg_grid_list = NULL;
  20.307 +
  20.308 +        GMythProgramInfo *proginfo;
  20.309 +        int             pixel_count = 0;
  20.310 +        for (; proglist; proglist = proglist->next) {
  20.311 +            proginfo = (GMythProgramInfo *) proglist->data;
  20.312 +
  20.313 +            GString        *content_name = proginfo->title;
  20.314 +
  20.315 +            GTimeVal       *initial_time = g_new0(GTimeVal, 1);
  20.316 +            GTimeVal       *last_time = g_new0(GTimeVal, 1);
  20.317 +            GTimeVal       *duration = g_new0(GTimeVal, 1);
  20.318 +
  20.319 +            GTimeVal       *schedule_start_time = proginfo->startts;
  20.320 +            GTimeVal       *schedule_end_time = proginfo->endts;
  20.321 +
  20.322 +            initial_time->tv_sec =
  20.323 +                (schedule_start_time->tv_sec <
  20.324 +                 start_time->tv_sec) ? start_time->
  20.325 +                tv_sec : schedule_start_time->tv_sec;
  20.326 +            last_time->tv_sec =
  20.327 +                (schedule_end_time->tv_sec >
  20.328 +                 end_time->tv_sec) ? end_time->tv_sec : schedule_end_time->
  20.329 +                tv_sec;
  20.330 +            duration->tv_sec = last_time->tv_sec - initial_time->tv_sec;
  20.331 +
  20.332 +            // Verify program time 
  20.333 +#if 0
  20.334 +            g_debug("ServiceID: %d, ScheduleID: %d\n", service->id,
  20.335 +                    schedule->id);
  20.336 +            fprintf(stderr, "program time\nfrom = %d, to = %d\n",
  20.337 +                    schedule->validFrom, schedule->validTo);
  20.338 +
  20.339 +            struct tm       loctime;
  20.340 +
  20.341 +            /*
  20.342 +             * Convert it to local time representation. 
  20.343 +             */
  20.344 +            if (localtime_r((time_t *) & schedule->validFrom, &loctime) ==
  20.345 +                NULL) {
  20.346 +                g_warning("localtime_r error in mmyth_epg_grid_widget!\n");
  20.347 +                return NULL;
  20.348 +            }
  20.349 +            fprintf(stderr, asctime(&loctime));
  20.350 +
  20.351 +            if (localtime_r((time_t *) & schedule->validTo, &loctime) ==
  20.352 +                NULL) {
  20.353 +                g_warning("localtime_r error in mmyth_epg_grid_widget!\n");
  20.354 +                return NULL;
  20.355 +            }
  20.356 +            fprintf(stderr, asctime(&loctime));
  20.357 +#endif
  20.358 +
  20.359 +            /*
  20.360 +             * fprintf(stderr, "duration = %d\n", duration); 
  20.361 +             */
  20.362 +            double          duration_hour =
  20.363 +                duration->tv_sec / (double) 3600.0;
  20.364 +            /*
  20.365 +             * fprintf(stderr, "duration_hour = %lf\n", duration_hour); 
  20.366 +             */
  20.367 +
  20.368 +            int             size = PIXELS_HOUR * duration_hour;
  20.369 +
  20.370 +            /*
  20.371 +             * complete hour 
  20.372 +             */
  20.373 +            /*
  20.374 +             * FIXME: UGLY WRONG HACK TO ALIGN PROGRAM TIME!!!
  20.375 +             */
  20.376 +            if (last_time->tv_sec % 3600 != 0) {
  20.377 +                size -= PROGRAM_SEPARATION;
  20.378 +            }
  20.379 +            if (initial_time->tv_sec % 3600 != 0) {
  20.380 +                size -= PROGRAM_SEPARATION;
  20.381 +            }
  20.382 +
  20.383 +            pixel_count += size + PROGRAM_SEPARATION;
  20.384 +            GtkWidget      *event_box =
  20.385 +                create_event_box_lbl(content_name->str,
  20.386 +                                     size, &bg_color,
  20.387 +                                     &fg_color);
  20.388 +            gtk_widget_add_events(event_box,
  20.389 +                                  GDK_BUTTON_PRESS_MASK |
  20.390 +                                  GDK_BUTTON_RELEASE_MASK);
  20.391 +
  20.392 +            /*
  20.393 +             * create EpgGridItem 
  20.394 +             */
  20.395 +            EpgGridItem    *epg_grid_item = g_new0(EpgGridItem, 1);
  20.396 +            epg_grid_item->proginfo = proginfo;
  20.397 +            epg_grid_item->event_box = event_box;
  20.398 +            epg_grid_item->object = mmyth_epg_grid_widget;
  20.399 +
  20.400 +            epg_grid_list =
  20.401 +                g_list_prepend(epg_grid_list, (gpointer) epg_grid_item);
  20.402 +
  20.403 +            gtk_box_pack_start(GTK_BOX(epg_line_hbox),
  20.404 +                               event_box, FALSE, FALSE,
  20.405 +                               PROGRAM_SEPARATION);
  20.406 +
  20.407 +            g_signal_connect(G_OBJECT(event_box), "button-press-event",
  20.408 +                             G_CALLBACK(mmyth_epg_grid_widget_clicked),
  20.409 +                             (gpointer *) epg_grid_list);
  20.410 +        }
  20.411 +#if 0
  20.412 +        printf("chaind = %d!!!!" chanid);
  20.413 +        fflush(stdout);
  20.414 +#endif
  20.415 +
  20.416 +        if (!epg_grid_list) {
  20.417 +            /*
  20.418 +             * No programs for current channel 
  20.419 +             */
  20.420 +            /*
  20.421 +             * FIXME: size HARDCODED 
  20.422 +             */
  20.423 +            GtkWidget      *event_box =
  20.424 +                create_event_box_lbl("No program list available",
  20.425 +                                     PIXELS_HOUR * 3, &bg_color,
  20.426 +                                     &fg_color);
  20.427 +            gtk_widget_add_events(event_box,
  20.428 +                                  GDK_BUTTON_PRESS_MASK |
  20.429 +                                  GDK_BUTTON_RELEASE_MASK);
  20.430 +
  20.431 +            /*
  20.432 +             * create EpgGridItem 
  20.433 +             */
  20.434 +            EpgGridItem    *epg_grid_item = g_new0(EpgGridItem, 1);
  20.435 +            epg_grid_item->proginfo = NULL;
  20.436 +            epg_grid_item->event_box = event_box;
  20.437 +            epg_grid_item->object = mmyth_epg_grid_widget;
  20.438 +
  20.439 +            epg_grid_list =
  20.440 +                g_list_prepend(epg_grid_list, (gpointer) epg_grid_item);
  20.441 +
  20.442 +            gtk_box_pack_start(GTK_BOX(epg_line_hbox),
  20.443 +                               event_box, FALSE, FALSE,
  20.444 +                               PROGRAM_SEPARATION);
  20.445 +
  20.446 +            g_signal_connect(G_OBJECT(event_box), "button-press-event",
  20.447 +                             G_CALLBACK(mmyth_epg_grid_widget_clicked),
  20.448 +                             (gpointer *) epg_grid_list);
  20.449 +        }
  20.450 +
  20.451 +        epg_grid_list = g_list_reverse(epg_grid_list);
  20.452 +        mmyth_epg_grid_widget->epg_view_model =
  20.453 +            g_list_append(mmyth_epg_grid_widget->epg_view_model,
  20.454 +                          epg_grid_list);
  20.455 +
  20.456 +        gtk_box_pack_start(GTK_BOX(private->epg_programs_vbox),
  20.457 +                           epg_line_hbox, FALSE, FALSE, 0);
  20.458 +    }
  20.459 +}
  20.460 +
  20.461 +static void
  20.462 +mmyth_epg_grid_widget_mount_header(MMythEpgGridWidget *
  20.463 +                                   mmyth_epg_grid_widget)
  20.464 +{
  20.465 +    MMythEpgGridWidgetPrivate *private =
  20.466 +        MMYTH_EPG_GRID_WIDGET_GET_PRIVATE(mmyth_epg_grid_widget);
  20.467 +
  20.468 +    struct tm       hour_tm;
  20.469 +    const gchar     name_title[] = "Today";
  20.470 +    GtkWidget      *lbl_title = gtk_label_new(name_title);
  20.471 +
  20.472 +    gtk_misc_set_alignment(GTK_MISC(lbl_title), 0.0, 0.5);
  20.473 +
  20.474 +    gtk_box_pack_start(GTK_BOX(private->epg_channels_vbox),
  20.475 +                       lbl_title, FALSE, FALSE, 0);
  20.476 +
  20.477 +    /*
  20.478 +     * hours title line 
  20.479 +     */
  20.480 +    GtkWidget      *epg_programs_hours_hbox = gtk_hbox_new(TRUE, 0);
  20.481 +
  20.482 +    if (localtime_r
  20.483 +        ((time_t *) & private->current_start_time->tv_sec,
  20.484 +         &hour_tm) == NULL) {
  20.485 +        g_warning("localtime_r error in mmyth_epg_grid_widget!\n");
  20.486 +        return;
  20.487 +    }
  20.488 +
  20.489 +    if (hour_tm.tm_min > 30) {
  20.490 +        hour_tm.tm_min = 30;
  20.491 +    } else if (hour_tm.tm_min > 0) {
  20.492 +        hour_tm.tm_min = 0;
  20.493 +    }
  20.494 +
  20.495 +    gchar           hour1_str[10];
  20.496 +    strftime(hour1_str, 8, "%H:%M", &hour_tm);
  20.497 +    GtkWidget      *lbl_hour1 = gtk_label_new(hour1_str);
  20.498 +    gtk_misc_set_alignment(GTK_MISC(lbl_hour1), 0.0, 0.5);
  20.499 +
  20.500 +    hour_tm.tm_hour++;
  20.501 +    gchar           hour2_str[10];
  20.502 +    strftime(hour2_str, 8, "%H:%M", &hour_tm);
  20.503 +    GtkWidget      *lbl_hour2 = gtk_label_new(hour2_str);
  20.504 +    gtk_misc_set_alignment(GTK_MISC(lbl_hour2), 0.0, 0.5);
  20.505 +
  20.506 +    hour_tm.tm_hour++;
  20.507 +    gchar           hour3_str[10];
  20.508 +    strftime(hour3_str, 8, "%H:%M", &hour_tm);
  20.509 +    GtkWidget      *lbl_hour3 = gtk_label_new(hour3_str);
  20.510 +    gtk_misc_set_alignment(GTK_MISC(lbl_hour3), 0.0, 0.5);
  20.511 +
  20.512 +    gtk_box_pack_start(GTK_BOX(epg_programs_hours_hbox),
  20.513 +                       lbl_hour1, TRUE, TRUE, 0);
  20.514 +    gtk_box_pack_start(GTK_BOX(epg_programs_hours_hbox),
  20.515 +                       lbl_hour2, TRUE, TRUE, 0);
  20.516 +    gtk_box_pack_start(GTK_BOX(epg_programs_hours_hbox),
  20.517 +                       lbl_hour3, TRUE, TRUE, 0);
  20.518 +
  20.519 +    gtk_box_pack_start(GTK_BOX(private->epg_programs_vbox),
  20.520 +                       epg_programs_hours_hbox, FALSE, FALSE, 0);
  20.521 +}
  20.522 +
  20.523 +/******************************************************************************
  20.524 + *              INTERNAL CALLBACKS FOR STATE CHANGE                           *
  20.525 + *****************************************************************************/
  20.526 +static void
  20.527 +mmyth_epg_grid_widget_deselect_service(MMythEpgGridWidget *
  20.528 +                                       mmyth_epg_grid_widget)
  20.529 +{
  20.530 +    EpgGridItem    *epg_grid_item;
  20.531 +
  20.532 +    /*
  20.533 +     * deselect
  20.534 +     */
  20.535 +    if (mmyth_epg_grid_widget->selected_grid_item != NULL) {
  20.536 +        epg_grid_item =
  20.537 +            (EpgGridItem *) mmyth_epg_grid_widget->selected_grid_item->
  20.538 +            data;
  20.539 +        gtk_widget_set_state(GTK_WIDGET(epg_grid_item->event_box),
  20.540 +                             GTK_STATE_NORMAL);
  20.541 +    }
  20.542 +}
  20.543 +
  20.544 +static void
  20.545 +mmyth_epg_grid_widget_clicked(GtkWidget * widget,
  20.546 +                              GdkEventExpose * event, gpointer data)
  20.547 +{
  20.548 +    g_return_if_fail(data != NULL);
  20.549 +
  20.550 +    GList          *epg_grid_item_list = (GList *) data;
  20.551 +    EpgGridItem    *epg_grid_item =
  20.552 +        (EpgGridItem *) epg_grid_item_list->data;
  20.553 +
  20.554 +    /*
  20.555 +     * update the selected service 
  20.556 +     */
  20.557 +    mmyth_epg_grid_widget_update_service(epg_grid_item->object,
  20.558 +                                         (GList *) data);
  20.559 +}
  20.560 +
  20.561 +void
  20.562 +mmyth_epg_grid_widget_update_service(MMythEpgGridWidget * object,
  20.563 +                                     GList * selected_grid_list)
  20.564 +{
  20.565 +    g_return_if_fail(object != NULL);
  20.566 +    g_return_if_fail(selected_grid_list != NULL);
  20.567 +
  20.568 +    EpgGridItem    *epg_grid_item =
  20.569 +        (EpgGridItem *) selected_grid_list->data;
  20.570 +
  20.571 +    mmyth_epg_grid_widget_deselect_service(epg_grid_item->object);
  20.572 +
  20.573 +    /*
  20.574 +     * updating current selected schedule_item and schedule_list
  20.575 +     */
  20.576 +    object->selected_grid_item = selected_grid_list;
  20.577 +
  20.578 +    /*
  20.579 +     * set state of the event box 
  20.580 +     */
  20.581 +    gtk_widget_set_state(GTK_WIDGET(epg_grid_item->event_box),
  20.582 +                         GTK_STATE_SELECTED);
  20.583 +    /*
  20.584 +     * emit update signal for listeners 
  20.585 +     */
  20.586 +    g_signal_emit(object,
  20.587 +                  mmyth_epg_grid_widget_signals[SELECTION_UPDATED_SIGNAL],
  20.588 +                  0, (gpointer) epg_grid_item);
  20.589 +}
  20.590 +
  20.591 +static GtkWidget *
  20.592 +create_event_box_lbl(gchar * str, int width, const GdkColor * bg_color,
  20.593 +                     const GdkColor * fg_color)
  20.594 +{
  20.595 +    GtkWidget      *event_box = gtk_event_box_new();
  20.596 +    GtkWidget      *lbl = gtk_label_new(str);
  20.597 +    gtk_label_set_ellipsize(GTK_LABEL(lbl), PANGO_ELLIPSIZE_END);
  20.598 +
  20.599 +    gtk_widget_modify_bg(event_box, GTK_STATE_NORMAL, bg_color);
  20.600 +    gtk_widget_modify_fg(lbl, GTK_STATE_NORMAL, fg_color);
  20.601 +
  20.602 +    /*
  20.603 +     * selected colors are const
  20.604 +     */
  20.605 +    GdkColor        selected_bg_color;
  20.606 +    selected_bg_color.red = 100;
  20.607 +    selected_bg_color.green = 40000;
  20.608 +    selected_bg_color.blue = 100;
  20.609 +
  20.610 +    GdkColor        selected_fg_color;
  20.611 +    selected_fg_color.red = 100;
  20.612 +    selected_fg_color.green = 100;
  20.613 +    selected_fg_color.blue = 100;
  20.614 +
  20.615 +    gtk_widget_modify_bg(event_box, GTK_STATE_SELECTED,
  20.616 +                         &selected_bg_color);
  20.617 +    gtk_widget_modify_fg(lbl, GTK_STATE_SELECTED, &selected_fg_color);
  20.618 +
  20.619 +    gtk_misc_set_alignment(GTK_MISC(lbl), 0.0, 0.5);
  20.620 +    gtk_container_add(GTK_CONTAINER(event_box), lbl);
  20.621 +    gtk_widget_set_size_request(event_box, width, -1);
  20.622 +
  20.623 +    return event_box;
  20.624 +}
  20.625 +
  20.626 +/******************************************************************************
  20.627 + *                            METHODS                                         *
  20.628 + *****************************************************************************/
  20.629 +
  20.630 +/*
  20.631 + * Callback for hardware keys 
  20.632 + */
  20.633 +gboolean
  20.634 +mmyth_epg_grid_widget_key_press(MMythEpgGridWidget * object,
  20.635 +                                GtkWidget * widget, GdkEventKey * event)
  20.636 +{
  20.637 +    MMythEpgGridWidgetPrivate *private =
  20.638 +        MMYTH_EPG_GRID_WIDGET_GET_PRIVATE(object);
  20.639 +
  20.640 +    EpgGridItem    *epg_grid_item;
  20.641 +    GList          *tmp;
  20.642 +
  20.643 +    /*
  20.644 +     * List of selected_grid_item 
  20.645 +     */
  20.646 +    GList          *selected_view_model;
  20.647 +
  20.648 +    gint            channel_index;
  20.649 +
  20.650 +    if (object->selected_grid_item == NULL) {
  20.651 +        g_warning("No program selected");
  20.652 +        return FALSE;
  20.653 +    }
  20.654 +
  20.655 +    epg_grid_item = (EpgGridItem *) object->selected_grid_item->data;
  20.656 +
  20.657 +    channel_index = private->selected_channel_index;
  20.658 +
  20.659 +    switch (event->keyval) {
  20.660 +    case GDK_Up:
  20.661 +        selected_view_model =
  20.662 +            g_list_nth(object->epg_view_model, channel_index - 1);
  20.663 +        if (selected_view_model != NULL) {
  20.664 +            private->selected_channel_index = channel_index - 1;
  20.665 +            tmp = (GList *) selected_view_model->data;
  20.666 +            /*
  20.667 +             * TODO: select a better centralized item currently is
  20.668 +             * picking the 1st or last item 
  20.669 +             */
  20.670 +            if (g_list_next(object->selected_grid_item) == NULL &&
  20.671 +                g_list_previous(object->selected_grid_item) != NULL) {
  20.672 +                /*
  20.673 +                 * in this case the new selected will be the last 
  20.674 +                 */
  20.675 +                tmp = g_list_last(tmp);
  20.676 +            }
  20.677 +
  20.678 +            /*
  20.679 +             * update the selected service 
  20.680 +             */
  20.681 +            mmyth_epg_grid_widget_update_service(object, tmp);
  20.682 +        }
  20.683 +        return TRUE;
  20.684 +    case GDK_Down:
  20.685 +        selected_view_model =
  20.686 +            g_list_nth(object->epg_view_model, channel_index + 1);
  20.687 +        if (selected_view_model != NULL) {
  20.688 +            private->selected_channel_index = channel_index + 1;
  20.689 +            tmp = (GList *) selected_view_model->data;
  20.690 +            /*
  20.691 +             * TODO: select a better centralized item currently is
  20.692 +             * picking the 1st or last item 
  20.693 +             */
  20.694 +            if (g_list_next(object->selected_grid_item) == NULL &&
  20.695 +                g_list_previous(object->selected_grid_item) != NULL) {
  20.696 +                /*
  20.697 +                 * in this case the new selected will be the last 
  20.698 +                 */
  20.699 +                tmp = g_list_last(tmp);
  20.700 +            }
  20.701 +
  20.702 +            /*
  20.703 +             * update the selected service 
  20.704 +             */
  20.705 +            mmyth_epg_grid_widget_update_service(object, tmp);
  20.706 +        }
  20.707 +        return TRUE;
  20.708 +    case GDK_Left:
  20.709 +        tmp = g_list_previous(object->selected_grid_item);
  20.710 +        if (tmp != NULL) {
  20.711 +            /*
  20.712 +             * update the selected service 
  20.713 +             */
  20.714 +            mmyth_epg_grid_widget_update_service(object, tmp);
  20.715 +        }
  20.716 +        return TRUE;
  20.717 +    case GDK_Right:
  20.718 +        tmp = g_list_next(object->selected_grid_item);
  20.719 +        if (tmp != NULL) {
  20.720 +            /*
  20.721 +             * update the selected service 
  20.722 +             */
  20.723 +            mmyth_epg_grid_widget_update_service(object, tmp);
  20.724 +        }
  20.725 +        return TRUE;
  20.726 +    default:
  20.727 +        return TRUE;
  20.728 +    }
  20.729 +
  20.730 +    return FALSE;
  20.731 +}
  20.732 +
  20.733 +static void
  20.734 +mmyth_epg_grid_widget_fill_programinfos(MMythEpgGridWidgetPrivate *
  20.735 +                                        private)
  20.736 +{
  20.737 +    GList          *channels_list = NULL;
  20.738 +    int             y;
  20.739 +
  20.740 +    if ((private->mmyth_epg != NULL) &&
  20.741 +        (gmyth_epg_get_channel_list(private->mmyth_epg, &channels_list) <
  20.742 +         0)) {
  20.743 +        private->channel_list = NULL;
  20.744 +        return;
  20.745 +    }
  20.746 +
  20.747 +    private->channel_list = channels_list;
  20.748 +
  20.749 +    for (y = 0; y < private->DISPLAY_CHANS && channels_list; y++) {
  20.750 +        GMythChannelInfo *channel_info =
  20.751 +            (GMythChannelInfo *) channels_list->data;
  20.752 +
  20.753 +        mmyth_epg_grid_widget_fill_program_row_infos(private,
  20.754 +                                                     channel_info->
  20.755 +                                                     channel_ID, y);
  20.756 +
  20.757 +        channels_list = g_list_next(channels_list);
  20.758 +    }
  20.759 +}
  20.760 +
  20.761 +static void
  20.762 +mmyth_epg_grid_widget_fill_program_row_infos(MMythEpgGridWidgetPrivate *
  20.763 +                                             private, guint chanNum,
  20.764 +                                             guint row)
  20.765 +{
  20.766 +    gint            res = gmyth_epg_get_program_list(private->mmyth_epg,
  20.767 +                                                     &(private->
  20.768 +                                                       program_list[row]),
  20.769 +                                                     chanNum,
  20.770 +                                                     private->
  20.771 +                                                     current_start_time,
  20.772 +                                                     private->
  20.773 +                                                     current_end_time);
  20.774 +
  20.775 +    if (res < 0) {
  20.776 +        g_warning("[%s] Error while retrieving epg programs",
  20.777 +                  __FUNCTION__);
  20.778 +    }
  20.779 +}
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/maemo-ui-old/src/mmyth_epg_grid_widget.h	Wed Aug 01 14:50:29 2007 +0100
    21.3 @@ -0,0 +1,87 @@
    21.4 +#ifndef __MMYTH_EPG_GRID_WIDGET_H__
    21.5 +#define __MMYTH_EPG_GRID_WIDGET_H__
    21.6 +
    21.7 +#include <glib-object.h>
    21.8 +#include <gdk/gdk.h>
    21.9 +#include <gtk/gtkvbox.h>
   21.10 +#include <gtk/gtkeventbox.h>
   21.11 +
   21.12 +#include <gmyth/gmyth_common.h>
   21.13 +#include <gmyth/gmyth_backendinfo.h>
   21.14 +#define MAX_DISPLAY_CHANS 4
   21.15 +
   21.16 +G_BEGIN_DECLS
   21.17 +#define MMYTH_EPG_GRID_WIDGET_TYPE               (mmyth_epg_grid_widget_get_type ())
   21.18 +#define MMYTH_EPG_GRID_WIDGET(obj)               (GTK_CHECK_CAST ((obj), MMYTH_EPG_GRID_WIDGET_TYPE, MMythEpgGridWidget))
   21.19 +#define MMYTH_EPG_GRID_WIDGET_CLASS(klass)       (GTK_CHECK_CLASS_CAST ((klass), MMYTH_EPG_GRID_WIDGET_TYPE, MMythEpgGridWidgetClass))
   21.20 +#define IS_MMYTH_EPG_GRID_WIDGET(obj)            (GTK_CHECK_TYPE ((obj), MMYTH_EPG_GRID_WIDGET_TYPE))
   21.21 +#define IS_MMYTH_EPG_GRID_WIDGET_CLASS(klass)    (GTK_CHECK_CLASS_TYPE ((klass), MMYTH_EPG_GRID_WIDGET_TYPE))
   21.22 +#define MMYTH_EPG_GRID_WIDGET_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), MMYTH_EPG_GRID_WIDGET_TYPE, MMythEpgGridWidgetClass))
   21.23 +#define MMYTH_EPG_GRID_WIDGET_GET_PRIVATE(obj)   (G_TYPE_INSTANCE_GET_PRIVATE ((obj), MMYTH_EPG_GRID_WIDGET_TYPE, MMythEpgGridWidgetPrivate))
   21.24 +typedef struct _MMythEpgGridWidget MMythEpgGridWidget;
   21.25 +typedef struct _MMythEpgGridWidgetClass MMythEpgGridWidgetClass;
   21.26 +typedef struct _MMythEpgGridWidgetPrivate MMythEpgGridWidgetPrivate;
   21.27 +
   21.28 +struct _MMythEpgGridWidgetClass {
   21.29 +    GtkEventBoxClass parent_class;
   21.30 +
   21.31 +    /*
   21.32 +     * callbacks 
   21.33 +     */
   21.34 +    /*
   21.35 +     * no one for now 
   21.36 +     */
   21.37 +};
   21.38 +
   21.39 +struct _MMythEpgGridWidget {
   21.40 +    GtkEventBox     event_box;
   21.41 +
   21.42 +    /*
   21.43 +     * Selected Widgets Logic
   21.44 +     */
   21.45 +    /*
   21.46 +     * List os Service Model in the current view the data of this list are 
   21.47 +     * GList for the programs of each service 
   21.48 +     */
   21.49 +    GList          *epg_view_model;
   21.50 +
   21.51 +    /*
   21.52 +     * Selected Schedule Item
   21.53 +     */
   21.54 +    GList          *selected_grid_item;
   21.55 +
   21.56 +};
   21.57 +
   21.58 +
   21.59 +GType           mmyth_epg_grid_widget_get_type(void);
   21.60 +GtkWidget      *mmyth_epg_grid_widget_new(void);
   21.61 +/*
   21.62 + * DVBHScheduleEvent* mmyth_epg_grid_get_selected_schedule
   21.63 + * (MMythEpgGridWidget * object);
   21.64 + */
   21.65 +void            mmyth_epg_grid_widget_update_service(MMythEpgGridWidget *
   21.66 +                                                     object,
   21.67 +                                                     GList *
   21.68 +                                                     epg_grid_item_node);
   21.69 +gboolean        mmyth_epg_grid_widget_key_press(MMythEpgGridWidget *
   21.70 +                                                object, GtkWidget * widget,
   21.71 +                                                GdkEventKey * event);
   21.72 +
   21.73 +typedef struct _EpgGridItem EpgGridItem;
   21.74 +
   21.75 +/*
   21.76 + * FIXME: auxiliary struct 
   21.77 + */
   21.78 +struct _EpgGridItem {
   21.79 +
   21.80 +    GMythProgramInfo *proginfo;
   21.81 +    GtkWidget      *event_box;
   21.82 +
   21.83 +    /*
   21.84 +     * for callback purposes 
   21.85 +     */
   21.86 +    MMythEpgGridWidget *object;
   21.87 +};
   21.88 +
   21.89 +G_END_DECLS
   21.90 +#endif                          /* __MMYTH_EPG_GRID_WIDGET_H__ */
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/maemo-ui-old/src/mmyth_main.c	Wed Aug 01 14:50:29 2007 +0100
    22.3 @@ -0,0 +1,122 @@
    22.4 +
    22.5 +#include <gtk/gtk.h>
    22.6 +
    22.7 +#include "config.h"
    22.8 +
    22.9 +#ifdef MAEMO_PLATFORM
   22.10 +#include "hildon-widgets/hildon-program.h"
   22.11 +#include "hildon-widgets/hildon-window.h"
   22.12 +#endif
   22.13 +
   22.14 +#include <gmyth/gmyth_recorder.h>
   22.15 +#include <gmyth/gmyth_backendinfo.h>
   22.16 +#include <gmyth/gmyth_tvchain.h>
   22.17 +#include <gmyth/gmyth_remote_util.h>
   22.18 +
   22.19 +#include "mmyth_ui.h"
   22.20 +#include "mmyth_tvplayer.h"
   22.21 +
   22.22 +static void
   22.23 +cb_destroy(GtkWidget * widget, gpointer data)
   22.24 +{
   22.25 +    MMythUi        *mmyth_ui = (MMythUi *) data;
   22.26 +
   22.27 +    if (mmyth_ui->tvplayer != NULL) {
   22.28 +        if (mmyth_tvplayer_is_playing(mmyth_ui->tvplayer))
   22.29 +            mmyth_tvplayer_stop_playing(mmyth_ui->tvplayer);
   22.30 +    }
   22.31 +
   22.32 +    mmyth_ui_finalize(mmyth_ui);
   22.33 +
   22.34 +    gtk_main_quit();
   22.35 +}
   22.36 +
   22.37 +#ifdef NDEBUG
   22.38 +static void
   22.39 +debug_error_func(const gchar * log_domain, GLogLevelFlags log_level,
   22.40 +                 const gchar * message, gpointer user_data)
   22.41 +{
   22.42 +    /*
   22.43 +     * leave this with NO print out messages, once you need to disable
   22.44 +     * debug messages! 
   22.45 +     */
   22.46 +    // g_print ( "[%s] DEBUG messages disabled!\n", __FUNCTION__ );
   22.47 +}
   22.48 +#endif
   22.49 +
   22.50 +gint
   22.51 +main(gint argc, gchar * argv[])
   22.52 +{
   22.53 +    GtkWidget      *window;
   22.54 +    MMythUi        *mmyth_ui;
   22.55 +#ifdef MAEMO_PLATFORM
   22.56 +    HildonProgram  *program = NULL;
   22.57 +#endif
   22.58 +
   22.59 +    /*
   22.60 +     * init threads 
   22.61 +     */
   22.62 +    g_thread_init(NULL);
   22.63 +
   22.64 +    /*
   22.65 +     * Initializes GTK 
   22.66 +     */
   22.67 +    gtk_init(&argc, &argv);
   22.68 +    gst_init(&argc, &argv);
   22.69 +#ifdef NDEBUG
   22.70 +    g_log_set_default_handler(debug_error_func, NULL);
   22.71 +#endif
   22.72 +
   22.73 +    /*
   22.74 +     * Init libmmyth context 
   22.75 +     */
   22.76 +    /*
   22.77 +     * TODO 
   22.78 +     */
   22.79 +#ifndef MAEMO_PLATFORM
   22.80 +    /*
   22.81 +     * create the main window 
   22.82 +     */
   22.83 +    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   22.84 +    gtk_widget_set_size_request(window, MAIN_WINDOW_WIDTH,
   22.85 +                                MAIN_WINDOW_HEIGHT);
   22.86 +    gtk_window_set_title(GTK_WINDOW(window), "Mythtv Frontend");
   22.87 +#else
   22.88 +    /*
   22.89 +     * Creating Hildonized main view 
   22.90 +     */
   22.91 +    program = HILDON_PROGRAM(hildon_program_get_instance());
   22.92 +    window = hildon_window_new();
   22.93 +
   22.94 +    // g_signal_connect(G_OBJECT(window), "delete_event", gtk_main_quit,
   22.95 +    // NULL);
   22.96 +
   22.97 +    hildon_program_add_window(program, HILDON_WINDOW(window));
   22.98 +    g_set_application_name("Maemo Mythtv");
   22.99 +#endif
  22.100 +
  22.101 +    /*
  22.102 +     * Initializes MMyth Widgets 
  22.103 +     */
  22.104 +#ifdef MAEMO_PLATFORM
  22.105 +    mmyth_ui = mmyth_ui_initialize(program, window);
  22.106 +#else
  22.107 +    mmyth_ui = mmyth_ui_initialize(window);
  22.108 +#endif
  22.109 +
  22.110 +    // mmyth_ui->loop = g_main_loop_new (NULL, FALSE);
  22.111 +
  22.112 +    /*
  22.113 +     * Connect destroy signal handling 
  22.114 +     */
  22.115 +    g_signal_connect(window, "destroy", G_CALLBACK(cb_destroy), mmyth_ui);
  22.116 +
  22.117 +    /*
  22.118 +     * Shows main window and start gtk loop 
  22.119 +     */
  22.120 +    gtk_widget_show(window);
  22.121 +
  22.122 +    gtk_main();
  22.123 +
  22.124 +    return 0;
  22.125 +}
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/maemo-ui-old/src/mmyth_recordui.c	Wed Aug 01 14:50:29 2007 +0100
    23.3 @@ -0,0 +1,433 @@
    23.4 +#include <gtk/gtk.h>
    23.5 +#include <glib.h>
    23.6 +#include <sys/types.h>
    23.7 +#include <sys/stat.h>
    23.8 +#include <unistd.h>
    23.9 +#include <string.h>
   23.10 +#include <stdio.h>
   23.11 +#include <stdlib.h>
   23.12 +
   23.13 +#include "mmyth_ui.h"
   23.14 +#include "mmyth_recordui.h"
   23.15 +
   23.16 +/*
   23.17 + * GMyth library includes 
   23.18 + */
   23.19 +#include <gmyth/gmyth_scheduler.h>
   23.20 +#include <gmyth/gmyth_util.h>
   23.21 +
   23.22 +enum {
   23.23 +    START_DATE_COLUMN = 0,
   23.24 +    TITLE_COLUMN,
   23.25 +    CHAN_ID_COLUMN,
   23.26 +    END_TIME_COLUMN,
   23.27 +    RECORD_ID_COLUMN,
   23.28 +    BASENAME_COLUMN,
   23.29 +    N_COLUMNS
   23.30 +};
   23.31 +
   23.32 +gboolean
   23.33 +mmyth_recordui_reload_all(MMythRecordUI * recordui)
   23.34 +{
   23.35 +    gboolean        res = FALSE;
   23.36 +
   23.37 +    res = mmyth_recordui_reload_schedule(recordui);
   23.38 +
   23.39 +    res = res & mmyth_recordui_reload_record(recordui);
   23.40 +
   23.41 +
   23.42 +    if (!res)
   23.43 +        g_warning
   23.44 +            ("[%s] Error while reloading schedule and recording content",
   23.45 +             __FUNCTION__);
   23.46 +
   23.47 +    return res;
   23.48 +}
   23.49 +
   23.50 +gboolean
   23.51 +mmyth_recordui_reload_schedule(MMythRecordUI * recordui)
   23.52 +{
   23.53 +    gint            new_row = 0;
   23.54 +    ScheduleInfo   *schedule_info;
   23.55 +    GList          *schedule_list;
   23.56 +    GtkTreeIter     iter;
   23.57 +    gchar          *start_date_time = NULL;
   23.58 +    gchar          *end_date_time = NULL;
   23.59 +    GString        *str_aux = g_string_new("");
   23.60 +    gint            res;
   23.61 +
   23.62 +    gtk_tree_store_clear(recordui->sch_tree_store);
   23.63 +
   23.64 +    res =
   23.65 +        gmyth_scheduler_get_schedule_list(recordui->scheduler,
   23.66 +                                          &(schedule_list));
   23.67 +    if (res < 0) {
   23.68 +        g_warning
   23.69 +            ("[%s] Retrieved NULL list of scheduled data from database",
   23.70 +             __FUNCTION__);
   23.71 +        return FALSE;
   23.72 +    }
   23.73 +
   23.74 +    for (; schedule_list; schedule_list = schedule_list->next) {
   23.75 +        schedule_info = (ScheduleInfo *) schedule_list->data;
   23.76 +
   23.77 +        gtk_tree_store_insert(recordui->sch_tree_store, &iter, NULL,
   23.78 +                              new_row++);
   23.79 +
   23.80 +        start_date_time =
   23.81 +            gmyth_util_time_to_string_from_time_val(schedule_info->
   23.82 +                                                    start_time);
   23.83 +        end_date_time =
   23.84 +            gmyth_util_time_to_string_from_time_val(schedule_info->
   23.85 +                                                    end_time);
   23.86 +
   23.87 +        g_string_printf(str_aux, "%d", schedule_info->channel_id);
   23.88 +
   23.89 +        gtk_tree_store_set(recordui->sch_tree_store, &iter, START_DATE_COLUMN, start_date_time, TITLE_COLUMN, schedule_info->title->str, CHAN_ID_COLUMN, str_aux->str, END_TIME_COLUMN, end_date_time,  // It 
   23.90 +                                                                                                                                                                                                        // doesn't 
   23.91 +                                                                                                                                                                                                        // appear
   23.92 +                           RECORD_ID_COLUMN, schedule_info->record_id, -1); // the 
   23.93 +                                                                            // last 
   23.94 +                                                                            // line 
   23.95 +                                                                            // is 
   23.96 +                                                                            // a 
   23.97 +                                                                            // hidden 
   23.98 +                                                                            // item 
   23.99 +                                                                            // to 
  23.100 +                                                                            // be 
  23.101 +                                                                            // used 
  23.102 +                                                                            // in 
  23.103 +                                                                            // searching 
  23.104 +                                                                            // tasks
  23.105 +    }
  23.106 +
  23.107 +    g_debug("[%s] %d lines added to schedule list UI", __FUNCTION__,
  23.108 +            new_row);
  23.109 +
  23.110 +    /*
  23.111 +     * free allocated memory 
  23.112 +     */
  23.113 +    if (!start_date_time)
  23.114 +        g_free(start_date_time);
  23.115 +    if (!end_date_time)
  23.116 +        g_free(end_date_time);
  23.117 +    g_string_free(str_aux, FALSE);
  23.118 +
  23.119 +    return TRUE;
  23.120 +}
  23.121 +
  23.122 +gboolean
  23.123 +mmyth_recordui_reload_record(MMythRecordUI * recordui)
  23.124 +{
  23.125 +    gint            new_row = 0;
  23.126 +    RecordedInfo   *recorded_info;
  23.127 +    GList          *record_list = NULL;
  23.128 +    GtkTreeIter     iter;
  23.129 +    gchar          *start_date_time = NULL;
  23.130 +    gchar          *end_date_time = NULL;
  23.131 +    GString        *str_aux = g_string_new("");
  23.132 +    gint            res;
  23.133 +
  23.134 +    gtk_tree_store_clear(recordui->rec_tree_store);
  23.135 +
  23.136 +    res =
  23.137 +        gmyth_scheduler_get_recorded_list(recordui->scheduler,
  23.138 +                                          &record_list);
  23.139 +    if (res < 0) {
  23.140 +        g_warning
  23.141 +            ("[%s] Retrieved NULL list of recorded data from database",
  23.142 +             __FUNCTION__);
  23.143 +        return FALSE;
  23.144 +    }
  23.145 +
  23.146 +    for (; record_list; record_list = record_list->next) {
  23.147 +        recorded_info = (RecordedInfo *) record_list->data;
  23.148 +
  23.149 +        gtk_tree_store_insert(recordui->rec_tree_store, &iter, NULL,
  23.150 +                              new_row++);
  23.151 +
  23.152 +        start_date_time =
  23.153 +            gmyth_util_time_to_string_from_time_val(recorded_info->
  23.154 +                                                    start_time);
  23.155 +        end_date_time =
  23.156 +            gmyth_util_time_to_string_from_time_val(recorded_info->
  23.157 +                                                    end_time);
  23.158 +
  23.159 +        g_string_printf(str_aux, "%d", recorded_info->channel_id);
  23.160 +
  23.161 +        gtk_tree_store_set(recordui->rec_tree_store, &iter, START_DATE_COLUMN, start_date_time, TITLE_COLUMN, recorded_info->title->str, CHAN_ID_COLUMN, str_aux->str, END_TIME_COLUMN, end_date_time,  // It 
  23.162 +                                                                                                                                                                                                        // doesn't 
  23.163 +                                                                                                                                                                                                        // appear
  23.164 +                           RECORD_ID_COLUMN, recorded_info->record_id,
  23.165 +                           BASENAME_COLUMN, recorded_info->basename->str,
  23.166 +                           -1);
  23.167 +        // the last line is a hidden item to be used in searching tasks 
  23.168 +    }
  23.169 +
  23.170 +    g_debug("[%s] %d lines added to record list UI", __FUNCTION__,
  23.171 +            new_row);
  23.172 +
  23.173 +    /*
  23.174 +     * free allocated memory 
  23.175 +     */
  23.176 +    if (NULL != start_date_time)
  23.177 +        g_free(start_date_time);
  23.178 +    if (NULL != end_date_time)
  23.179 +        g_free(end_date_time);
  23.180 +    g_string_free(str_aux, FALSE);
  23.181 +
  23.182 +    return TRUE;
  23.183 +}
  23.184 +
  23.185 +
  23.186 +MMythRecordUI  *
  23.187 +mmyth_recordui_new(GMythBackendInfo * backend_info)
  23.188 +{
  23.189 +    MMythRecordUI  *recordui = g_new0(MMythRecordUI, 1);
  23.190 +
  23.191 +    g_return_val_if_fail(backend_info != NULL, NULL);
  23.192 +
  23.193 +    recordui->backend_info = backend_info;
  23.194 +
  23.195 +    recordui->scrolled_window = gtk_scrolled_window_new(NULL, NULL);
  23.196 +    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW
  23.197 +                                   (recordui->scrolled_window),
  23.198 +                                   GTK_POLICY_AUTOMATIC,
  23.199 +                                   GTK_POLICY_AUTOMATIC);
  23.200 +
  23.201 +    recordui->viewport = gtk_viewport_new(NULL, NULL);
  23.202 +    gtk_container_add(GTK_CONTAINER(recordui->scrolled_window),
  23.203 +                      recordui->viewport);
  23.204 +
  23.205 +    recordui->notebook = gtk_notebook_new();
  23.206 +    gtk_container_set_border_width(GTK_CONTAINER(recordui->notebook), 1);
  23.207 +    gtk_notebook_set_scrollable(GTK_NOTEBOOK(recordui->notebook), TRUE);
  23.208 +    gtk_notebook_popup_enable(GTK_NOTEBOOK(recordui->notebook));
  23.209 +    gtk_container_add(GTK_CONTAINER(recordui->viewport),
  23.210 +                      recordui->notebook);
  23.211 +    gtk_notebook_popup_disable(GTK_NOTEBOOK(recordui->notebook));
  23.212 +
  23.213 +    /*
  23.214 +     * Schedule tab 
  23.215 +     */
  23.216 +    recordui->sch_scrolled_window = gtk_scrolled_window_new(NULL, NULL);
  23.217 +    gtk_container_add(GTK_CONTAINER(recordui->notebook),
  23.218 +                      recordui->sch_scrolled_window);
  23.219 +    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW
  23.220 +                                   (recordui->sch_scrolled_window),
  23.221 +                                   GTK_POLICY_AUTOMATIC,
  23.222 +                                   GTK_POLICY_AUTOMATIC);
  23.223 +    gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW
  23.224 +                                        (recordui->sch_scrolled_window),
  23.225 +                                        GTK_SHADOW_IN);
  23.226 +
  23.227 +    /*
  23.228 +     * The basename column in the sched_tree_store is not being used
  23.229 +     */
  23.230 +    recordui->sch_tree_store =
  23.231 +        gtk_tree_store_new(N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING,
  23.232 +                           G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT,
  23.233 +                           G_TYPE_STRING);
  23.234 +
  23.235 +    recordui->sch_treeview =
  23.236 +        gtk_tree_view_new_with_model(GTK_TREE_MODEL
  23.237 +                                     (recordui->sch_tree_store));
  23.238 +    gtk_container_add(GTK_CONTAINER(recordui->sch_scrolled_window),
  23.239 +                      recordui->sch_treeview);
  23.240 +    recordui->sch_renderer = gtk_cell_renderer_text_new();
  23.241 +    // g_object_set(G_OBJECT(renderer1), "foreground", "green",
  23.242 +    // "background", "black", NULL);
  23.243 +    recordui->sch_column1 =
  23.244 +        gtk_tree_view_column_new_with_attributes("Start time",
  23.245 +                                                 recordui->sch_renderer,
  23.246 +                                                 "text", START_DATE_COLUMN,
  23.247 +                                                 NULL);
  23.248 +    gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->sch_treeview),
  23.249 +                                recordui->sch_column1);
  23.250 +    recordui->sch_column2 =
  23.251 +        gtk_tree_view_column_new_with_attributes("Title",
  23.252 +                                                 recordui->sch_renderer,
  23.253 +                                                 "text", TITLE_COLUMN,
  23.254 +                                                 NULL);
  23.255 +    gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->sch_treeview),
  23.256 +                                recordui->sch_column2);
  23.257 +    recordui->sch_column3 =
  23.258 +        gtk_tree_view_column_new_with_attributes("Channel",
  23.259 +                                                 recordui->sch_renderer,
  23.260 +                                                 "text", CHAN_ID_COLUMN,
  23.261 +                                                 NULL);
  23.262 +    gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->sch_treeview),
  23.263 +                                recordui->sch_column3);
  23.264 +    gtk_tree_view_column_set_resizable(recordui->sch_column1, TRUE);
  23.265 +    gtk_tree_view_column_set_resizable(recordui->sch_column2, TRUE);
  23.266 +    gtk_tree_view_column_set_resizable(recordui->sch_column3, TRUE);
  23.267 +    gtk_tree_view_column_set_reorderable(recordui->sch_column1, TRUE);
  23.268 +    gtk_tree_view_column_set_reorderable(recordui->sch_column2, TRUE);
  23.269 +    gtk_tree_view_column_set_reorderable(recordui->sch_column3, TRUE);
  23.270 +    // recordui->sch_column4 = 
  23.271 +    // gtk_tree_view_column_new_with_attributes("",
  23.272 +    // recordui->sch_renderer, "text", END_TIME_COLUMN, NULL);
  23.273 +    // gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->sch_treeview), 
  23.274 +    // recordui->sch_column4);
  23.275 +
  23.276 +    recordui->sch_label = gtk_label_new(("Schedule"));
  23.277 +    gtk_notebook_set_tab_label(GTK_NOTEBOOK(recordui->notebook),
  23.278 +                               gtk_notebook_get_nth_page(GTK_NOTEBOOK
  23.279 +                                                         (recordui->
  23.280 +                                                          notebook), 0),
  23.281 +                               recordui->sch_label);
  23.282 +
  23.283 +    // Record items tab
  23.284 +    // g_object_set(G_OBJECT(renderer2), "foreground", "blue", NULL);
  23.285 +    recordui->rec_scrolled_window = gtk_scrolled_window_new(NULL, NULL);
  23.286 +    gtk_container_add(GTK_CONTAINER(recordui->notebook),
  23.287 +                      recordui->rec_scrolled_window);
  23.288 +    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW
  23.289 +                                   (recordui->rec_scrolled_window),
  23.290 +                                   GTK_POLICY_AUTOMATIC,
  23.291 +                                   GTK_POLICY_AUTOMATIC);
  23.292 +    gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW
  23.293 +                                        (recordui->rec_scrolled_window),
  23.294 +                                        GTK_SHADOW_IN);
  23.295 +
  23.296 +    recordui->rec_tree_store =
  23.297 +        gtk_tree_store_new(N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING,
  23.298 +                           G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT,
  23.299 +                           G_TYPE_STRING);
  23.300 +    recordui->rec_treeview =
  23.301 +        gtk_tree_view_new_with_model(GTK_TREE_MODEL
  23.302 +                                     (recordui->rec_tree_store));
  23.303 +    gtk_container_add(GTK_CONTAINER(recordui->rec_scrolled_window),
  23.304 +                      recordui->rec_treeview);
  23.305 +    recordui->rec_renderer = gtk_cell_renderer_text_new();
  23.306 +    // g_object_set(G_OBJECT(renderer1), "foreground", "green",
  23.307 +    // "background", "black", NULL);
  23.308 +
  23.309 +    recordui->rec_column1 =
  23.310 +        gtk_tree_view_column_new_with_attributes("Start time",
  23.311 +                                                 recordui->rec_renderer,
  23.312 +                                                 "text", START_DATE_COLUMN,
  23.313 +                                                 NULL);
  23.314 +    gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->rec_treeview),
  23.315 +                                recordui->rec_column1);
  23.316 +    recordui->rec_column2 =
  23.317 +        gtk_tree_view_column_new_with_attributes("Title",
  23.318 +                                                 recordui->rec_renderer,
  23.319 +                                                 "text", TITLE_COLUMN,
  23.320 +                                                 NULL);
  23.321 +    gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->rec_treeview),
  23.322 +                                recordui->rec_column2);
  23.323 +    recordui->rec_column3 =
  23.324 +        gtk_tree_view_column_new_with_attributes("Channel",
  23.325 +                                                 recordui->rec_renderer,
  23.326 +                                                 "text", CHAN_ID_COLUMN,
  23.327 +                                                 NULL);
  23.328 +    gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->rec_treeview),
  23.329 +                                recordui->rec_column3);
  23.330 +    gtk_tree_view_column_set_resizable(recordui->rec_column1, TRUE);
  23.331 +    gtk_tree_view_column_set_resizable(recordui->rec_column2, TRUE);
  23.332 +    gtk_tree_view_column_set_resizable(recordui->rec_column3, TRUE);
  23.333 +    gtk_tree_view_column_set_reorderable(recordui->rec_column1, TRUE);
  23.334 +    gtk_tree_view_column_set_reorderable(recordui->rec_column2, TRUE);
  23.335 +    gtk_tree_view_column_set_reorderable(recordui->rec_column3, TRUE);
  23.336 +    // recordui->rec_column4 =
  23.337 +    // gtk_tree_view_column_new_with_attributes("",
  23.338 +    // recordui->rec_renderer, "text", END_TIME_COLUMN, NULL);
  23.339 +    // gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->rec_treeview),
  23.340 +    // recordui->rec_column4);
  23.341 +
  23.342 +    recordui->rec_label = gtk_label_new(("Recorded"));
  23.343 +    gtk_notebook_set_tab_label(GTK_NOTEBOOK(recordui->notebook),
  23.344 +                               gtk_notebook_get_nth_page(GTK_NOTEBOOK
  23.345 +                                                         (recordui->
  23.346 +                                                          notebook), 1),
  23.347 +                               recordui->rec_label);
  23.348 +
  23.349 +    // Gets the mmyth scheduler manager
  23.350 +    recordui->scheduler = gmyth_scheduler_new(backend_info);
  23.351 +
  23.352 +    /*
  23.353 +     * init connection to the backend 
  23.354 +     */
  23.355 +    gmyth_scheduler_connect(recordui->scheduler,
  23.356 +                            recordui->scheduler->backend_info);
  23.357 +
  23.358 +    return recordui;
  23.359 +}
  23.360 +
  23.361 +void
  23.362 +mmyth_recordui_free(MMythRecordUI * recordui)
  23.363 +{
  23.364 +    // FIXME: Release memory here!
  23.365 +    /*
  23.366 +     * close connection to the backend 
  23.367 +     */
  23.368 +    gmyth_scheduler_disconnect(recordui->scheduler);
  23.369 +}
  23.370 +
  23.371 +void
  23.372 +mmyth_recordui_delete_selected(GtkButton * button,
  23.373 +                               MMythRecordUI * recordui)
  23.374 +{
  23.375 +    GtkTreeSelection *selection;
  23.376 +    GtkTreeModel   *list_store;
  23.377 +    GtkTreeIter     iter;
  23.378 +    int             index;
  23.379 +    int             curr_page = 0;
  23.380 +
  23.381 +    curr_page =
  23.382 +        gtk_notebook_get_current_page(GTK_NOTEBOOK(recordui->notebook));
  23.383 +
  23.384 +    if (curr_page == 0) {
  23.385 +        selection =
  23.386 +            gtk_tree_view_get_selection(GTK_TREE_VIEW
  23.387 +                                        (recordui->sch_treeview));
  23.388 +        if (selection != NULL) {
  23.389 +            gtk_tree_selection_get_selected(selection, &list_store, &iter);
  23.390 +            gtk_tree_model_get(list_store, &iter, RECORD_ID_COLUMN, &index,
  23.391 +                               -1);
  23.392 +            gmyth_scheduler_delete_schedule(recordui->scheduler, index);
  23.393 +            mmyth_recordui_reload_schedule(recordui);
  23.394 +            return;
  23.395 +        }
  23.396 +
  23.397 +    } else if (curr_page == 1) {
  23.398 +        selection =
  23.399 +            gtk_tree_view_get_selection(GTK_TREE_VIEW
  23.400 +                                        (recordui->rec_treeview));
  23.401 +        if (selection != NULL) {
  23.402 +            gtk_tree_selection_get_selected(selection, &list_store, &iter);
  23.403 +            gtk_tree_model_get(list_store, &iter, RECORD_ID_COLUMN, &index,
  23.404 +                               -1);
  23.405 +            gmyth_scheduler_delete_recorded(recordui->scheduler, index);
  23.406 +            mmyth_recordui_reload_record(recordui);
  23.407 +            return;
  23.408 +        }
  23.409 +    }
  23.410 +
  23.411 +    g_warning("[%s] None element was removed from the list", __FUNCTION__);
  23.412 +}
  23.413 +
  23.414 +/*
  23.415 + * FIXME: change this function name, it is returning the basename_column
  23.416 + * that represents the nuv filename of the recorded content 
  23.417 + */
  23.418 +gchar          *
  23.419 +mmyth_recordui_get_selected_recorded(MMythRecordUI * recordui)
  23.420 +{
  23.421 +    GtkTreeSelection *selection = NULL;
  23.422 +    GtkTreeModel   *list_store = NULL;
  23.423 +    GtkTreeIter     iter;
  23.424 +    gchar          *path = NULL;
  23.425 +
  23.426 +    /*
  23.427 +     * returning nuv filename, basename_column 
  23.428 +     */
  23.429 +    selection =
  23.430 +        gtk_tree_view_get_selection(GTK_TREE_VIEW(recordui->rec_treeview));
  23.431 +    if (gtk_tree_selection_get_selected(selection, &list_store, &iter)) {
  23.432 +        gtk_tree_model_get(list_store, &iter, BASENAME_COLUMN, &path, -1);
  23.433 +    }
  23.434 +    // FIXME: MOVE THIS TO OTHER PLACE
  23.435 +    return path;
  23.436 +}
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/maemo-ui-old/src/mmyth_recordui.h	Wed Aug 01 14:50:29 2007 +0100
    24.3 @@ -0,0 +1,52 @@
    24.4 +#ifndef MMYTH_RECORD_H_
    24.5 +#define MMYTH_RECORD_H_
    24.6 +
    24.7 +#include <gmyth/gmyth_scheduler.h>
    24.8 +#include <gmyth/gmyth_backendinfo.h>
    24.9 +
   24.10 +typedef struct _MMythRecordUI {
   24.11 +    GtkWidget      *scrolled_window;
   24.12 +    GtkWidget      *viewport;
   24.13 +    GtkWidget      *notebook;
   24.14 +
   24.15 +    GtkWidget      *rec_scrolled_window;
   24.16 +    GtkWidget      *sch_scrolled_window;
   24.17 +    GtkWidget      *rec_treeview;
   24.18 +    GtkWidget      *sch_treeview;
   24.19 +    GtkWidget      *rec_label;
   24.20 +    GtkWidget      *sch_label;
   24.21 +
   24.22 +    GtkTreeViewColumn *rec_column1;
   24.23 +    GtkTreeViewColumn *rec_column2;
   24.24 +    GtkTreeViewColumn *rec_column3;
   24.25 +    GtkTreeViewColumn *rec_column4;
   24.26 +    GtkTreeViewColumn *sch_column1;
   24.27 +    GtkTreeViewColumn *sch_column2;
   24.28 +    GtkTreeViewColumn *sch_column3;
   24.29 +    GtkTreeViewColumn *sch_column4;
   24.30 +
   24.31 +    GtkCellRenderer *rec_renderer;
   24.32 +    GtkCellRenderer *sch_renderer;
   24.33 +
   24.34 +    GtkTreeStore   *sch_tree_store;
   24.35 +    GtkTreeStore   *rec_tree_store;
   24.36 +
   24.37 +    GMythScheduler *scheduler;
   24.38 +
   24.39 +    GMythBackendInfo *backend_info;
   24.40 +
   24.41 +} MMythRecordUI;
   24.42 +
   24.43 +MMythRecordUI  *mmyth_recordui_new(GMythBackendInfo * backend_info);
   24.44 +void            mmyth_recordui_free(MMythRecordUI * recordui);
   24.45 +
   24.46 +void            mmyth_recordui_delete_selected(GtkButton * button,
   24.47 +                                               MMythRecordUI * recordui);
   24.48 +gboolean        mmyth_recordui_reload_all(MMythRecordUI * recordui);
   24.49 +gboolean        mmyth_recordui_reload_schedule(MMythRecordUI * recordui);
   24.50 +gboolean        mmyth_recordui_reload_record(MMythRecordUI * recordui);
   24.51 +
   24.52 +gchar          *mmyth_recordui_get_selected_recorded(MMythRecordUI *
   24.53 +                                                     recordui);
   24.54 +
   24.55 +#endif                          /* MMYTH_RECORD_H_ */
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/maemo-ui-old/src/mmyth_schedulerui.c	Wed Aug 01 14:50:29 2007 +0100
    25.3 @@ -0,0 +1,443 @@
    25.4 +#include <gtk/gtk.h>
    25.5 +#include <glib.h>
    25.6 +#include <glib/gprintf.h>
    25.7 +#include <sys/types.h>
    25.8 +#include <sys/stat.h>
    25.9 +#include <unistd.h>
   25.10 +#include <string.h>
   25.11 +#include <stdio.h>
   25.12 +
   25.13 +#include "mmyth_ui.h"
   25.14 +#include "mmyth_uicommon.h"
   25.15 +#include "mmyth_recordui.h"
   25.16 +#include "mmyth_schedulerui.h"
   25.17 +
   25.18 +/*
   25.19 + * GMyth library includes 
   25.20 + */
   25.21 +#include <gmyth/gmyth_scheduler.h>
   25.22 +#include <gmyth/gmyth_common.h>
   25.23 +#include <gmyth/gmyth_epg.h>
   25.24 +
   25.25 +static void     run_calendar_dialog(GtkButton * button, gpointer data);
   25.26 +
   25.27 +static void     add_channel_field(MMythSchedulerUI * scheduler_ui,
   25.28 +                                  GtkWidget * vbox);
   25.29 +static void     add_time_field(MMythSchedulerUI * scheduler_ui,
   25.30 +                               GtkWidget * vbox);
   25.31 +static void     add_date_field(MMythSchedulerUI * scheduler_ui,
   25.32 +                               GtkWidget * vbox);
   25.33 +static void     add_duration_field(MMythSchedulerUI * scheduler_ui,
   25.34 +                                   GtkWidget * vbox);
   25.35 +static void     add_frequency_field(MMythSchedulerUI * scheduler_ui,
   25.36 +                                    GtkWidget * vbox);
   25.37 +static void     add_title_field(MMythSchedulerUI * scheduler_ui,
   25.38 +                                GtkWidget * vbox);
   25.39 +
   25.40 +MMythSchedulerUI *
   25.41 +mmyth_schedulerui_new(GMythBackendInfo * backend_info)
   25.42 +{
   25.43 +    GtkWidget      *scrolledwindow;
   25.44 +    GtkWidget      *viewport;
   25.45 +    GtkWidget      *head_hbox;
   25.46 +    GtkWidget      *fields_vbox;
   25.47 +    GtkWidget      *hseparator;
   25.48 +    GtkWidget      *label;
   25.49 +
   25.50 +    MMythSchedulerUI *scheduler_ui = g_new0(MMythSchedulerUI, 1);
   25.51 +
   25.52 +    scheduler_ui->backend_info = backend_info;
   25.53 +
   25.54 +    scrolledwindow = gtk_scrolled_window_new(NULL, NULL);
   25.55 +    scheduler_ui->main_widget = scrolledwindow;
   25.56 +    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow),
   25.57 +                                   GTK_POLICY_AUTOMATIC,
   25.58 +                                   GTK_POLICY_AUTOMATIC);
   25.59 +
   25.60 +    // Is this needed? 
   25.61 +    viewport = gtk_viewport_new(NULL, NULL);
   25.62 +    gtk_container_add(GTK_CONTAINER(scrolledwindow), viewport);
   25.63 +
   25.64 +    // Is this needed?
   25.65 +    head_hbox = gtk_hbox_new(FALSE, 0);
   25.66 +    gtk_container_add(GTK_CONTAINER(viewport), head_hbox);
   25.67 +
   25.68 +    fields_vbox = gtk_vbox_new(FALSE, 0);
   25.69 +    gtk_box_pack_start(GTK_BOX(head_hbox), fields_vbox, TRUE, TRUE, 0);
   25.70 +    gtk_container_set_border_width(GTK_CONTAINER(fields_vbox), 10);
   25.71 +
   25.72 +    label = gtk_label_new_with_mnemonic(("Manual Schedule Recording"));
   25.73 +    gtk_box_pack_start(GTK_BOX(fields_vbox), label, FALSE, FALSE, 0);
   25.74 +    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
   25.75 +
   25.76 +    hseparator = gtk_hseparator_new();
   25.77 +    gtk_box_pack_start(GTK_BOX(fields_vbox), hseparator, FALSE, TRUE, 0);
   25.78 +
   25.79 +    add_channel_field(scheduler_ui, fields_vbox);
   25.80 +    add_time_field(scheduler_ui, fields_vbox);
   25.81 +    add_date_field(scheduler_ui, fields_vbox);
   25.82 +    add_duration_field(scheduler_ui, fields_vbox);
   25.83 +    add_frequency_field(scheduler_ui, fields_vbox);
   25.84 +    add_title_field(scheduler_ui, fields_vbox);
   25.85 +
   25.86 +    return scheduler_ui;
   25.87 +}
   25.88 +
   25.89 +static void
   25.90 +set_date_from_calendar(GtkCalendar * calendar, gpointer data)
   25.91 +{
   25.92 +    char            sched_date[24];
   25.93 +
   25.94 +    MMythSchedulerUI *scheduler_ui = (MMythSchedulerUI *) data;
   25.95 +
   25.96 +    // FIXME: Change this, save another value instead of month_temp,
   25.97 +    // day_temp, ... 
   25.98 +    gtk_calendar_get_date(GTK_CALENDAR(calendar),
   25.99 +                          &(scheduler_ui->year_temp),
  25.100 +                          &(scheduler_ui->month_temp),
  25.101 +                          &(scheduler_ui->day_temp));
  25.102 +
  25.103 +    sched_date[23] = '\0';
  25.104 +    g_sprintf(sched_date, "%04d %02d %02d (yyyy mm dd)",
  25.105 +              scheduler_ui->year_temp, scheduler_ui->month_temp + 1,
  25.106 +              scheduler_ui->day_temp);
  25.107 +
  25.108 +    gtk_button_set_label(GTK_BUTTON(scheduler_ui->date_button),
  25.109 +                         sched_date);
  25.110 +
  25.111 +    gtk_widget_destroy(scheduler_ui->calendar_dialog);
  25.112 +    scheduler_ui->calendar_dialog = NULL;
  25.113 +    scheduler_ui->calendar = NULL;
  25.114 +}
  25.115 +
  25.116 +// calendar
  25.117 +static void
  25.118 +run_calendar_dialog(GtkButton * button, gpointer data)
  25.119 +{
  25.120 +
  25.121 +    GtkWidget      *dialog_vbox;
  25.122 +    MMythSchedulerUI *scheduler_ui = (MMythSchedulerUI *) data;
  25.123 +
  25.124 +    // calendar_dialog and calendar are been released at
  25.125 +    // set_date_from_calendar ()
  25.126 +    scheduler_ui->calendar_dialog = gtk_dialog_new();
  25.127 +    gtk_container_set_border_width(GTK_CONTAINER
  25.128 +                                   (scheduler_ui->calendar_dialog), 1);
  25.129 +    gtk_window_set_title(GTK_WINDOW(scheduler_ui->calendar_dialog),
  25.130 +                         "Select starting date");
  25.131 +    gtk_window_set_position(GTK_WINDOW(scheduler_ui->calendar_dialog),
  25.132 +                            GTK_WIN_POS_CENTER);
  25.133 +    gtk_window_set_decorated(GTK_WINDOW(scheduler_ui->calendar_dialog),
  25.134 +                             FALSE);
  25.135 +
  25.136 +    dialog_vbox = GTK_DIALOG(scheduler_ui->calendar_dialog)->vbox;
  25.137 +
  25.138 +    scheduler_ui->calendar = gtk_calendar_new();
  25.139 +
  25.140 +    gtk_box_pack_start(GTK_BOX(dialog_vbox), scheduler_ui->calendar, TRUE,
  25.141 +                       TRUE, 0);
  25.142 +    gtk_calendar_display_options(GTK_CALENDAR(scheduler_ui->calendar),
  25.143 +                                 GTK_CALENDAR_SHOW_HEADING |
  25.144 +                                 GTK_CALENDAR_SHOW_DAY_NAMES);
  25.145 +
  25.146 +    gtk_widget_show_all(scheduler_ui->calendar_dialog);
  25.147 +
  25.148 +    g_signal_connect(G_OBJECT(scheduler_ui->calendar),
  25.149 +                     "day-selected-double-click",
  25.150 +                     G_CALLBACK(set_date_from_calendar), data);
  25.151 +}
  25.152 +
  25.153 +
  25.154 +gboolean
  25.155 +mmyth_schedulerui_save(MMythSchedulerUI * scheduler_ui)
  25.156 +{
  25.157 +    GMythScheduler *scheduler;
  25.158 +    ScheduleInfo   *schedule_info;
  25.159 +    GMythChannelInfo *channel_info;
  25.160 +
  25.161 +    GList          *clist;
  25.162 +    gint            index,
  25.163 +                    duration;
  25.164 +    gint            frequency;
  25.165 +    struct tm       start_tm;
  25.166 +
  25.167 +    schedule_info = g_new0(ScheduleInfo, 1);
  25.168 +    if (schedule_info == NULL) {
  25.169 +        g_warning("Error allocating memory");
  25.170 +        return FALSE;
  25.171 +    }
  25.172 +
  25.173 +    clist = scheduler_ui->channel_list;
  25.174 +
  25.175 +    index =
  25.176 +        gtk_combo_box_get_active(GTK_COMBO_BOX
  25.177 +                                 (scheduler_ui->channel_combobox));
  25.178 +
  25.179 +    if (clist != NULL)
  25.180 +        clist = g_list_nth(clist, index);
  25.181 +
  25.182 +    if (clist) {
  25.183 +        g_debug("[%s] New schedule: %d", __FUNCTION__, index);
  25.184 +    } else {
  25.185 +        g_warning("[%s] Error when adding new schedule", __FUNCTION__);
  25.186 +        return FALSE;
  25.187 +    }
  25.188 +
  25.189 +    channel_info = clist->data;
  25.190 +
  25.191 +    /*
  25.192 +     * initialize schedule_info 
  25.193 +     */
  25.194 +    schedule_info->channel_id = channel_info->channel_ID;
  25.195 +
  25.196 +    start_tm.tm_hour =
  25.197 +        (int)
  25.198 +        gtk_spin_button_get_value(GTK_SPIN_BUTTON
  25.199 +                                  (scheduler_ui->hour_spinbutton));
  25.200 +    start_tm.tm_min =
  25.201 +        (int)
  25.202 +        gtk_spin_button_get_value(GTK_SPIN_BUTTON
  25.203 +                                  (scheduler_ui->min_spinbutton));
  25.204 +    start_tm.tm_sec = 0;
  25.205 +
  25.206 +    start_tm.tm_mday = (gint) scheduler_ui->day_temp;
  25.207 +    start_tm.tm_mon = (gint) scheduler_ui->month_temp;
  25.208 +    start_tm.tm_year = (gint) scheduler_ui->year_temp - 1900;   // years
  25.209 +                                                                // since
  25.210 +                                                                // 1900
  25.211 +    GTimeVal       *time_val_local = g_new0(GTimeVal, 1);
  25.212 +    time_val_local->tv_sec = timelocal(&start_tm);
  25.213 +
  25.214 +    schedule_info->start_time = time_val_local;
  25.215 +    if (NULL == schedule_info->start_time) {
  25.216 +        g_warning("timelocal error!\n");
  25.217 +        return FALSE;
  25.218 +    }
  25.219 +
  25.220 +    duration =
  25.221 +        (gint)
  25.222 +        gtk_spin_button_get_value(GTK_SPIN_BUTTON
  25.223 +                                  (scheduler_ui->duration_spinbutton));
  25.224 +    schedule_info->end_time = schedule_info->start_time + (duration * 60);
  25.225 +
  25.226 +    /*
  25.227 +     * TODO: frequency is not implemented yet 
  25.228 +     */
  25.229 +    frequency =
  25.230 +        gtk_combo_box_get_active(GTK_COMBO_BOX
  25.231 +                                 (scheduler_ui->freq_combobox));
  25.232 +
  25.233 +    schedule_info->title = g_string_new("");
  25.234 +    g_string_printf(schedule_info->title, "%s",
  25.235 +                    gtk_entry_get_text(GTK_ENTRY
  25.236 +                                       (scheduler_ui->title_entry)));
  25.237 +
  25.238 +    /*
  25.239 +     * FIXME: Architecture change to reuse the scheduler created in the
  25.240 +     * recordui! 
  25.241 +     */
  25.242 +    scheduler = gmyth_scheduler_new();
  25.243 +
  25.244 +    gmyth_scheduler_connect(scheduler, scheduler->backend_info);
  25.245 +
  25.246 +    /*
  25.247 +     * FIXME: set record_id = -1 to add a new schedule 
  25.248 +     */
  25.249 +    schedule_info->record_id = -1;
  25.250 +    gmyth_scheduler_add_schedule(scheduler, schedule_info);
  25.251 +
  25.252 +    gmyth_scheduler_disconnect(scheduler);
  25.253 +
  25.254 +    /*
  25.255 +     * free allocated memory 
  25.256 +     */
  25.257 +    g_object_unref(scheduler);
  25.258 +    g_free(schedule_info);
  25.259 +
  25.260 +    return TRUE;
  25.261 +}
  25.262 +
  25.263 +static GtkWidget *
  25.264 +add_line(GtkWidget * vbox, const gchar * str)
  25.265 +{
  25.266 +    GtkWidget      *label;
  25.267 +    GtkWidget      *hbox = gtk_hbox_new(FALSE, 0);
  25.268 +
  25.269 +    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
  25.270 +    gtk_container_set_border_width(GTK_CONTAINER(hbox), 3);
  25.271 +
  25.272 +    label = gtk_label_new(str);
  25.273 +    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
  25.274 +    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
  25.275 +
  25.276 +    return hbox;
  25.277 +}
  25.278 +
  25.279 +static void
  25.280 +add_channel_field(MMythSchedulerUI * scheduler_ui, GtkWidget * vbox)
  25.281 +{
  25.282 +    GtkWidget      *combobox;
  25.283 +
  25.284 +    GtkWidget      *hbox = add_line(vbox, "Channel:    ");
  25.285 +
  25.286 +    combobox = gtk_combo_box_new_text();
  25.287 +
  25.288 +    scheduler_ui->channel_combobox = combobox;
  25.289 +    gtk_box_pack_start(GTK_BOX(hbox), combobox, FALSE, FALSE, 0);
  25.290 +
  25.291 +    GMythEPG       *mmyth_epg = gmyth_epg_new();
  25.292 +    if (!gmyth_epg_connect(mmyth_epg, scheduler_ui->backend_info)) {
  25.293 +        // FIXME: Without this list the scheduler UI should not be shown!
  25.294 +        g_warning("[%s] Error when getting list of channels",
  25.295 +                  __FUNCTION__);
  25.296 +    }
  25.297 +
  25.298 +    if (gmyth_epg_get_channel_list
  25.299 +        (mmyth_epg, &(scheduler_ui->channel_list)) < 0) {
  25.300 +        g_debug("[%s] Error while trying to retrieve channel list",
  25.301 +                __FUNCTION__);
  25.302 +    } else {
  25.303 +        GList          *clist = scheduler_ui->channel_list;
  25.304 +        GMythChannelInfo *channel_info;
  25.305 +
  25.306 +        while (clist != NULL) {
  25.307 +            channel_info = clist->data;
  25.308 +            clist = clist->next;
  25.309 +            gtk_combo_box_append_text(GTK_COMBO_BOX
  25.310 +                                      (scheduler_ui->channel_combobox),
  25.311 +                                      (channel_info->channel_name->str));
  25.312 +        }
  25.313 +
  25.314 +        gtk_combo_box_set_active(GTK_COMBO_BOX
  25.315 +                                 (scheduler_ui->channel_combobox), 0);
  25.316 +    }
  25.317 +}
  25.318 +
  25.319 +static void
  25.320 +add_time_field(MMythSchedulerUI * scheduler_ui, GtkWidget * vbox)
  25.321 +{
  25.322 +    GtkWidget      *label;
  25.323 +    GtkObject      *spinbutton_adj;
  25.324 +    GtkWidget      *hbox = add_line(vbox, "Time:         ");
  25.325 +
  25.326 +    time_t          real_time;
  25.327 +    struct tm       sched_time;
  25.328 +
  25.329 +    time(&real_time);
  25.330 +
  25.331 +    if (localtime_r((time_t *) & real_time, &sched_time) == NULL) {
  25.332 +        g_warning("localtime_r error in mmyth_epg_grid_view!\n");
  25.333 +        return;
  25.334 +    }
  25.335 +
  25.336 +    if (sched_time.tm_min > 30) {
  25.337 +        sched_time.tm_hour = sched_time.tm_hour + 1;
  25.338 +        sched_time.tm_min = 0;
  25.339 +    } else if (sched_time.tm_min > 0) {
  25.340 +        sched_time.tm_min = 30;
  25.341 +    }
  25.342 +
  25.343 +    scheduler_ui->year_temp = (guint) sched_time.tm_year + 1900;
  25.344 +    scheduler_ui->month_temp = (guint) sched_time.tm_mon;
  25.345 +    scheduler_ui->day_temp = (guint) sched_time.tm_mday;
  25.346 +
  25.347 +    // hour entry
  25.348 +    spinbutton_adj =
  25.349 +        gtk_adjustment_new(sched_time.tm_hour, 00, 23, 1, 10, 10);
  25.350 +    scheduler_ui->hour_spinbutton =
  25.351 +        gtk_spin_button_new(GTK_ADJUSTMENT(spinbutton_adj), 1, 0);
  25.352 +    gtk_box_pack_start(GTK_BOX(hbox), scheduler_ui->hour_spinbutton, FALSE,
  25.353 +                       FALSE, 0);
  25.354 +
  25.355 +    label = gtk_label_new((" : "));
  25.356 +    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
  25.357 +    gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT);
  25.358 +    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
  25.359 +
  25.360 +    // minute entry
  25.361 +    spinbutton_adj =
  25.362 +        gtk_adjustment_new(sched_time.tm_min, 0, 59, 1, 10, 10);
  25.363 +    scheduler_ui->min_spinbutton =
  25.364 +        gtk_spin_button_new(GTK_ADJUSTMENT(spinbutton_adj), 1, 0);
  25.365 +    gtk_box_pack_start(GTK_BOX(hbox), scheduler_ui->min_spinbutton, FALSE,
  25.366 +                       FALSE, 0);
  25.367 +
  25.368 +    label = gtk_label_new((" (hh:mm)"));
  25.369 +
  25.370 +    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
  25.371 +
  25.372 +}
  25.373 +
  25.374 +static void
  25.375 +add_date_field(MMythSchedulerUI * scheduler_ui, GtkWidget * vbox)
  25.376 +{
  25.377 +    char            sched_date[24];
  25.378 +    GtkWidget      *hbox = add_line(vbox, "Date:        ");
  25.379 +
  25.380 +    // sched_date = ctime(&real_time);
  25.381 +    g_sprintf(sched_date, "%04d %02d %02d (yyyy mm dd)",
  25.382 +              scheduler_ui->year_temp, scheduler_ui->month_temp + 1,
  25.383 +              scheduler_ui->day_temp);
  25.384 +    sched_date[23] = '\0';
  25.385 +
  25.386 +    scheduler_ui->date_button = gtk_button_new_with_label(sched_date);
  25.387 +    gtk_box_pack_start(GTK_BOX(hbox), scheduler_ui->date_button, FALSE,
  25.388 +                       FALSE, 0);
  25.389 +    gtk_button_set_relief(GTK_BUTTON(scheduler_ui->date_button),
  25.390 +                          GTK_RELIEF_NONE);
  25.391 +
  25.392 +    g_signal_connect(G_OBJECT(scheduler_ui->date_button), "clicked",
  25.393 +                     G_CALLBACK(run_calendar_dialog), scheduler_ui);
  25.394 +
  25.395 +}
  25.396 +
  25.397 +static void
  25.398 +add_duration_field(MMythSchedulerUI * scheduler_ui, GtkWidget * vbox)
  25.399 +{
  25.400 +    GtkWidget      *hbox = add_line(vbox, "Duration:   ");
  25.401 +    GtkWidget      *label;
  25.402 +    GtkObject      *spinbutton_adj;
  25.403 +
  25.404 +    spinbutton_adj = gtk_adjustment_new(60, 5, 360, 5, 60, 60);
  25.405 +    scheduler_ui->duration_spinbutton =
  25.406 +        gtk_spin_button_new(GTK_ADJUSTMENT(spinbutton_adj), 1, 0);
  25.407 +    gtk_box_pack_start(GTK_BOX(hbox), scheduler_ui->duration_spinbutton,
  25.408 +                       FALSE, TRUE, 0);
  25.409 +    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON
  25.410 +                                (scheduler_ui->duration_spinbutton), TRUE);
  25.411 +
  25.412 +    label = gtk_label_new((" (minutes)     "));
  25.413 +    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
  25.414 +}
  25.415 +
  25.416 +static void
  25.417 +add_frequency_field(MMythSchedulerUI * scheduler_ui, GtkWidget * vbox)
  25.418 +{
  25.419 +
  25.420 +    GtkWidget      *hbox = add_line(vbox, "Frequency: ");
  25.421 +
  25.422 +    scheduler_ui->freq_combobox = gtk_combo_box_new_text();
  25.423 +    gtk_box_pack_start(GTK_BOX(hbox), scheduler_ui->freq_combobox, FALSE,
  25.424 +                       FALSE, 0);
  25.425 +    gtk_combo_box_append_text(GTK_COMBO_BOX(scheduler_ui->freq_combobox),
  25.426 +                              ("Only this day               "));
  25.427 +    gtk_combo_box_append_text(GTK_COMBO_BOX(scheduler_ui->freq_combobox),
  25.428 +                              ("Daily                            "));
  25.429 +    gtk_combo_box_append_text(GTK_COMBO_BOX(scheduler_ui->freq_combobox),
  25.430 +                              ("Weekly                         "));
  25.431 +    gtk_combo_box_set_active(GTK_COMBO_BOX(scheduler_ui->freq_combobox),
  25.432 +                             0);
  25.433 +
  25.434 +}
  25.435 +
  25.436 +static void
  25.437 +add_title_field(MMythSchedulerUI * scheduler_ui, GtkWidget * vbox)
  25.438 +{
  25.439 +    GtkWidget      *hbox = add_line(vbox, "Title:           ");
  25.440 +
  25.441 +    scheduler_ui->title_entry = gtk_entry_new();
  25.442 +    gtk_box_pack_start(GTK_BOX(hbox), scheduler_ui->title_entry, FALSE,
  25.443 +                       FALSE, 0);
  25.444 +    gtk_entry_set_text(GTK_ENTRY(scheduler_ui->title_entry), "(Optional)");
  25.445 +
  25.446 +}
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/maemo-ui-old/src/mmyth_schedulerui.h	Wed Aug 01 14:50:29 2007 +0100
    26.3 @@ -0,0 +1,53 @@
    26.4 +#ifndef MMYTH_SCHEDULERECORDING_H_
    26.5 +#define MMYTH_SCHEDULERECORDING_H_
    26.6 +
    26.7 +#include <glib.h>
    26.8 +
    26.9 +#include <gmyth/gmyth_backendinfo.h>
   26.10 +
   26.11 +typedef struct _MMythSchedulerUI {
   26.12 +
   26.13 +    GList          *channel_list;
   26.14 +
   26.15 +    GtkWidget      *main_widget;
   26.16 +
   26.17 +    GtkWidget      *channel_combobox;
   26.18 +    GtkWidget      *freq_combobox;
   26.19 +    GtkWidget      *hour_spinbutton;
   26.20 +    GtkWidget      *min_spinbutton;
   26.21 +    GtkWidget      *duration_spinbutton;
   26.22 +    GtkWidget      *title_entry;
   26.23 +    GtkWidget      *date_button;
   26.24 +
   26.25 +    GtkWidget      *calendar_dialog;
   26.26 +    GtkWidget      *calendar;
   26.27 +
   26.28 +    guint           year_temp,
   26.29 +                    month_temp,
   26.30 +                    day_temp;
   26.31 +
   26.32 +    GMythBackendInfo *backend_info;
   26.33 +
   26.34 +} MMythSchedulerUI;
   26.35 +
   26.36 +typedef struct {
   26.37 +    long int        channel_id;
   26.38 +
   26.39 +    struct tm       start_tm;
   26.40 +
   26.41 +    int             duration;
   26.42 +    int             frequency;
   26.43 +
   26.44 +    GString        *title;
   26.45 +
   26.46 +} ScheduleEntry;
   26.47 +
   26.48 +MMythSchedulerUI *mmyth_schedulerui_new(GMythBackendInfo * backend_info);
   26.49 +
   26.50 +gboolean        mmyth_schedulerui_save(MMythSchedulerUI * scheduler_ui);
   26.51 +
   26.52 +void            mmyth_schedulerui_cb_schedule_button(GtkButton * button,
   26.53 +                                                     gpointer user_data);
   26.54 +
   26.55 +
   26.56 +#endif                          /* MMYTH_SCHEDULERECORDING_H_ */
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/maemo-ui-old/src/mmyth_tvplayer.c	Wed Aug 01 14:50:29 2007 +0100
    27.3 @@ -0,0 +1,712 @@
    27.4 +/**
    27.5 + * GMyth Library
    27.6 + *
    27.7 + * @file gmyth/mmyth_tvplayer.c
    27.8 + * 
    27.9 + * @brief <p> This component provides playback of the remote A/V using
   27.10 + * GStreamer.
   27.11 + * 
   27.12 + * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
   27.13 + * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
   27.14 + *
   27.15 +    *//*
   27.16 +    * 
   27.17 +    * This program is free software; you can redistribute it and/or modify
   27.18 +    * it under the terms of the GNU Lesser General Public License as published by
   27.19 +    * the Free Software Foundation; either version 2 of the License, or
   27.20 +    * (at your option) any later version.
   27.21 +    *
   27.22 +    * This program is distributed in the hope that it will be useful,
   27.23 +    * but WITHOUT ANY WARRANTY; without even the implied warranty of
   27.24 +    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   27.25 +    * GNU General Public License for more details.
   27.26 +    *
   27.27 +    * You should have received a copy of the GNU Lesser General Public License
   27.28 +    * along with this program; if not, write to the Free Software
   27.29 +    * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   27.30 +    */
   27.31 +
   27.32 +#include "mmyth_tvplayer.h"
   27.33 +
   27.34 +#include <gdk/gdkx.h>
   27.35 +
   27.36 +#include <gmyth/gmyth_remote_util.h>
   27.37 +
   27.38 +#define MYTHTV_VERSION_DEFAULT	30
   27.39 +
   27.40 +typedef struct _GstPlayerWindowStateChange {
   27.41 +    GstElement     *play;
   27.42 +    GstState        old_state,
   27.43 +                    new_state;
   27.44 +    MMythTVPlayer  *tvplayer;
   27.45 +} GstPlayerWindowStateChange;
   27.46 +
   27.47 +typedef struct _GstPlayerWindowTagFound {
   27.48 +    GstElement     *play;
   27.49 +    GstTagList     *taglist;
   27.50 +    MMythTVPlayer  *tvplayer;
   27.51 +} GstPlayerWindowTagFound;
   27.52 +
   27.53 +/*
   27.54 + * static gboolean idle_state (gpointer data); 
   27.55 + */
   27.56 +static gboolean bus_call(GstBus * bus, GstMessage * msg, gpointer data);
   27.57 +
   27.58 +static void     mmyth_tvplayer_class_init(MMythTVPlayerClass * klass);
   27.59 +static void     mmyth_tvplayer_init(MMythTVPlayer * object);
   27.60 +
   27.61 +static void     mmyth_tvplayer_dispose(GObject * object);
   27.62 +static void     mmyth_tvplayer_finalize(GObject * object);
   27.63 +
   27.64 +G_DEFINE_TYPE(MMythTVPlayer, mmyth_tvplayer, G_TYPE_OBJECT)
   27.65 +
   27.66 +    static gboolean mmyth_tvplayer_create_pipeline(MMythTVPlayer *
   27.67 +                                                   tvplayer);
   27.68 +    static void     new_pad_cb(GstElement * element, GstPad * pad,
   27.69 +                               gpointer data);
   27.70 +
   27.71 +    static gboolean expose_cb(GtkWidget * widget,
   27.72 +                              GdkEventExpose * event, gpointer user_data);
   27.73 +
   27.74 +    static void
   27.75 +                    mmyth_tvplayer_class_init(MMythTVPlayerClass * klass)
   27.76 +{
   27.77 +    GObjectClass   *gobject_class;
   27.78 +
   27.79 +    gobject_class = (GObjectClass *) klass;
   27.80 +
   27.81 +    gobject_class->dispose = mmyth_tvplayer_dispose;
   27.82 +    gobject_class->finalize = mmyth_tvplayer_finalize;
   27.83 +}
   27.84 +
   27.85 +static void
   27.86 +new_pad_cb(GstElement * element, GstPad * pad, gpointer data)
   27.87 +{
   27.88 +    MMythTVPlayer  *tvplayer = MMYTH_TVPLAYER(data);
   27.89 +    GstPadLinkReturn ret;
   27.90 +    char           *s;
   27.91 +
   27.92 +    s = gst_caps_to_string(pad->caps);
   27.93 +
   27.94 +    if (s[0] == 'a') {
   27.95 +        ret =
   27.96 +            gst_pad_link(pad,
   27.97 +                         gst_element_get_pad(tvplayer->audioqueue1,
   27.98 +                                             "sink"));
   27.99 +    } else {
  27.100 +        ret =
  27.101 +            gst_pad_link(pad,
  27.102 +                         gst_element_get_pad(tvplayer->videoqueue1,
  27.103 +                                             "sink"));
  27.104 +    }
  27.105 +
  27.106 +    g_free(s);
  27.107 +}
  27.108 +
  27.109 +static          gboolean
  27.110 +expose_cb(GtkWidget * widget, GdkEventExpose * event, gpointer user_data)
  27.111 +{
  27.112 +    MMythTVPlayer  *tvplayer = MMYTH_TVPLAYER(user_data);
  27.113 +
  27.114 +    if (tvplayer && tvplayer->videow) {
  27.115 +        gst_x_overlay_set_xwindow_id(GST_X_OVERLAY
  27.116 +                                     (tvplayer->gst_videosink),
  27.117 +                                     GDK_WINDOW_XWINDOW(widget->window));
  27.118 +        return TRUE;
  27.119 +    }
  27.120 +
  27.121 +    g_warning("MMythTVPlayer expose called before setting video window\n");
  27.122 +
  27.123 +    return FALSE;
  27.124 +}
  27.125 +
  27.126 +static void
  27.127 +mmyth_tvplayer_init(MMythTVPlayer * tvplayer)
  27.128 +{
  27.129 +    tvplayer->gst_pipeline = NULL;
  27.130 +    tvplayer->gst_source = NULL;
  27.131 +    tvplayer->gst_videodec = NULL;
  27.132 +    tvplayer->gst_videosink = NULL;
  27.133 +    tvplayer->gst_videocolortrs = NULL;
  27.134 +    tvplayer->videoqueue1 = NULL;
  27.135 +    tvplayer->videoqueue2 = NULL;
  27.136 +    tvplayer->audioqueue1 = NULL;
  27.137 +    tvplayer->audioqueue2 = NULL;
  27.138 +
  27.139 +    /*
  27.140 +     * GTKWidget for rendering the video 
  27.141 +     */
  27.142 +    tvplayer->videow = NULL;
  27.143 +    tvplayer->expose_handler = 0;
  27.144 +
  27.145 +    tvplayer->backend_hostname = NULL;
  27.146 +    tvplayer->backend_port = 0;
  27.147 +    tvplayer->local_hostname = NULL;
  27.148 +
  27.149 +    tvplayer->recorder = NULL;
  27.150 +    tvplayer->tvchain = NULL;
  27.151 +    tvplayer->proginfo = NULL;
  27.152 +}
  27.153 +
  27.154 +static void
  27.155 +mmyth_tvplayer_dispose(GObject * object)
  27.156 +{
  27.157 +
  27.158 +    G_OBJECT_CLASS(mmyth_tvplayer_parent_class)->dispose(object);
  27.159 +}
  27.160 +
  27.161 +static void
  27.162 +mmyth_tvplayer_finalize(GObject * object)
  27.163 +{
  27.164 +    g_signal_handlers_destroy(object);
  27.165 +
  27.166 +    MMythTVPlayer  *tvplayer = MMYTH_TVPLAYER(object);
  27.167 +
  27.168 +    g_debug("[%s] Finalizing tvplayer", __FUNCTION__);
  27.169 +
  27.170 +    if (tvplayer->videow != NULL) {
  27.171 +        if (g_signal_handler_is_connected(tvplayer->videow,
  27.172 +                                          tvplayer->expose_handler)) {
  27.173 +            g_signal_handler_disconnect(tvplayer->videow,
  27.174 +                                        tvplayer->expose_handler);
  27.175 +        }
  27.176 +        g_object_unref(tvplayer->videow);
  27.177 +    }
  27.178 +
  27.179 +    if (tvplayer->recorder != NULL)
  27.180 +        g_object_unref(tvplayer->recorder);
  27.181 +    if (tvplayer->tvchain != NULL)
  27.182 +        g_object_unref(tvplayer->tvchain);
  27.183 +    if (tvplayer->proginfo != NULL)
  27.184 +        g_object_unref(tvplayer->proginfo);
  27.185 +
  27.186 +    // Release Gstreamer elements
  27.187 +    if (tvplayer->gst_pipeline != NULL)
  27.188 +        g_object_unref(tvplayer->gst_pipeline);
  27.189 +    if (tvplayer->gst_source != NULL)
  27.190 +        g_object_unref(tvplayer->gst_source);
  27.191 +    if (tvplayer->gst_videodec != NULL)
  27.192 +        g_object_unref(tvplayer->gst_videodec);
  27.193 +    if (tvplayer->gst_videocolortrs != NULL)
  27.194 +        g_object_unref(tvplayer->gst_videocolortrs);
  27.195 +    if (tvplayer->gst_videosink != NULL)
  27.196 +        g_object_unref(tvplayer->gst_videosink);
  27.197 +    if (tvplayer->videoqueue1 != NULL)
  27.198 +        g_object_unref(tvplayer->videoqueue1);
  27.199 +    if (tvplayer->videoqueue2 != NULL)
  27.200 +        g_object_unref(tvplayer->videoqueue2);
  27.201 +    if (tvplayer->audioqueue1 != NULL)
  27.202 +        g_object_unref(tvplayer->audioqueue1);
  27.203 +    if (tvplayer->audioqueue2 != NULL)
  27.204 +        g_object_unref(tvplayer->audioqueue2);
  27.205 +
  27.206 +    G_OBJECT_CLASS(mmyth_tvplayer_parent_class)->finalize(object);
  27.207 +}
  27.208 +
  27.209 +/** Creates a new instance of MMythTVPlayer. 
  27.210 + * 
  27.211 + * @return a new instance of MMythTVPlayer.
  27.212 + */
  27.213 +MMythTVPlayer  *
  27.214 +mmyth_tvplayer_new()
  27.215 +{
  27.216 +    MMythTVPlayer  *tvplayer =
  27.217 +        MMYTH_TVPLAYER(g_object_new(MMYTH_TVPLAYER_TYPE, NULL));
  27.218 +
  27.219 +    return tvplayer;
  27.220 +}
  27.221 +
  27.222 +/** Initializes the tv player.
  27.223 + *
  27.224 + * @param tvplayer the object instance.
  27.225 + * @return gboolean TRUE if the pipeline was created 
  27.226 + * successfully, FALSE otherwise.
  27.227 + */
  27.228 +gboolean
  27.229 +mmyth_tvplayer_initialize(MMythTVPlayer * tvplayer,
  27.230 +                          GMythBackendInfo * backend_info)
  27.231 +{
  27.232 +    tvplayer->backend_info = backend_info;
  27.233 +
  27.234 +    if (!mmyth_tvplayer_create_pipeline(tvplayer)) {
  27.235 +        g_warning
  27.236 +            ("[%s] Error while creating pipeline. TV Player not initialized",
  27.237 +             __FUNCTION__);
  27.238 +        return FALSE;
  27.239 +    } else {
  27.240 +        g_debug("[%s] GStreamer pipeline created", __FUNCTION__);
  27.241 +    }
  27.242 +
  27.243 +    return TRUE;
  27.244 +}
  27.245 +
  27.246 +/** Creates the GStreamer pipeline used by the player.
  27.247 + *
  27.248 + * @param tvplayer the object instance.
  27.249 + * @return gboolean TRUE if the pipeline was created 
  27.250 + * successfully, FALSE otherwise.
  27.251 + */
  27.252 +static          gboolean
  27.253 +mmyth_tvplayer_create_pipeline(MMythTVPlayer * tvplayer)
  27.254 +{
  27.255 +    GstElement     *pipeline;
  27.256 +    GstElement     *source,
  27.257 +                   *parser;
  27.258 +    GstElement     *videodec,
  27.259 +                   *videosink;
  27.260 +    GstElement     *videocolortrs;
  27.261 +#ifndef MAEMO_PLATFORM
  27.262 +    GstElement     *audiodec,
  27.263 +                   *audioconv,
  27.264 +                   *audioqueue2;
  27.265 +#endif
  27.266 +    GstElement     *audiosink;
  27.267 +    GstElement     *videoqueue1,
  27.268 +                   *videoqueue2,
  27.269 +                   *audioqueue1;
  27.270 +
  27.271 +    g_debug("MMythTVPlayer: Setting the Gstreamer pipeline\n");
  27.272 +
  27.273 +    pipeline = gst_pipeline_new("video-player");
  27.274 +    source = gst_element_factory_make("mythtvsrc", "myth-source");
  27.275 +    parser = gst_element_factory_make("nuvdemux", "nuv-demux");
  27.276 +
  27.277 +    /*
  27.278 +     * Gstreamer Video elements 
  27.279 +     */
  27.280 +    videoqueue1 = gst_element_factory_make("queue", "video-queue1");
  27.281 +    videodec = gst_element_factory_make("ffdec_mpeg4", "video-decoder");
  27.282 +    videoqueue2 = gst_element_factory_make("queue", "video-queue2");
  27.283 +    videocolortrs =
  27.284 +        gst_element_factory_make("ffmpegcolorspace",
  27.285 +                                 "image-color-transforms");
  27.286 +
  27.287 +#ifdef MAEMO_PLATFORM
  27.288 +    videosink = gst_element_factory_make("sdlvideosink", "image-output");
  27.289 +#else
  27.290 +    videosink = gst_element_factory_make("xvimagesink", "image-output");
  27.291 +#endif
  27.292 +
  27.293 +    /*
  27.294 +     * Gstreamer Audio elements 
  27.295 +     */
  27.296 +    audioqueue1 = gst_element_factory_make("queue", "audio-queue1");
  27.297 +#ifdef MAEMO_PLATFORM
  27.298 +    audiosink = gst_element_factory_make("dspmp3sink", "audio-output");
  27.299 +#else
  27.300 +    audioqueue2 = gst_element_factory_make("queue", "audio-queue2");
  27.301 +    audiodec = gst_element_factory_make("mad", "audio-decoder");
  27.302 +    audioconv =
  27.303 +        gst_element_factory_make("audioconvert", "audio-converter");
  27.304 +    audiosink = gst_element_factory_make("alsasink", "audio-output");
  27.305 +#endif
  27.306 +
  27.307 +    if (!(pipeline && source && parser && videodec && videosink) ||
  27.308 +        !(videoqueue1 && videoqueue2 && audioqueue1 && audiosink)) {
  27.309 +        /*
  27.310 +         * FIXME: hanlde the error correctly 
  27.311 +         */
  27.312 +        /*
  27.313 +         * video_alignment is not being created (below) and is causing
  27.314 +         * problems to the ui 
  27.315 +         */
  27.316 +
  27.317 +        tvplayer->gst_pipeline = NULL;
  27.318 +        tvplayer->gst_videodec = NULL;
  27.319 +        tvplayer->gst_videosink = NULL;
  27.320 +        tvplayer->gst_videocolortrs = NULL;
  27.321 +
  27.322 +        g_warning("GstElement creation error!\n");
  27.323 +        return FALSE;
  27.324 +    }
  27.325 +#ifndef MAEMO_PLATFORM
  27.326 +    if (!(audiodec && audioconv)) {
  27.327 +        g_warning("GstElement for audio stream creation error!");
  27.328 +        return FALSE;
  27.329 +    }
  27.330 +#endif
  27.331 +
  27.332 +    tvplayer->gst_pipeline = pipeline;
  27.333 +    tvplayer->gst_source = source;
  27.334 +    tvplayer->gst_videodec = videodec;
  27.335 +    tvplayer->gst_videosink = videosink;
  27.336 +    tvplayer->gst_videocolortrs = videocolortrs;
  27.337 +    g_object_ref(tvplayer->gst_pipeline);
  27.338 +    g_object_ref(tvplayer->gst_source);
  27.339 +    g_object_ref(tvplayer->gst_videodec);
  27.340 +    g_object_ref(tvplayer->gst_videosink);
  27.341 +    g_object_ref(tvplayer->gst_videocolortrs);
  27.342 +
  27.343 +    tvplayer->videoqueue1 = videoqueue1;
  27.344 +    tvplayer->videoqueue2 = videoqueue2;
  27.345 +    tvplayer->audioqueue1 = audioqueue1;
  27.346 +    g_object_ref(tvplayer->videoqueue1);
  27.347 +    g_object_ref(tvplayer->videoqueue2);
  27.348 +    g_object_ref(tvplayer->audioqueue1);
  27.349 +
  27.350 +#ifndef MAEMO_PLATFORM
  27.351 +    tvplayer->audioqueue2 = audioqueue2;
  27.352 +    g_object_ref(tvplayer->audioqueue2);
  27.353 +#endif
  27.354 +
  27.355 +    // g_object_set (G_OBJECT (videosink), "sync", TRUE, NULL);
  27.356 +    g_object_set(G_OBJECT(audiosink), "sync", FALSE, NULL);
  27.357 +
  27.358 +    gst_bus_add_watch(gst_pipeline_get_bus
  27.359 +                      (GST_PIPELINE(tvplayer->gst_pipeline)), bus_call,
  27.360 +                      tvplayer);
  27.361 +
  27.362 +    gst_bin_add_many(GST_BIN(pipeline), source, parser, videoqueue1,
  27.363 +                     videodec, videoqueue2, videocolortrs, videosink,
  27.364 +                     NULL);
  27.365 +
  27.366 +#ifndef MAEMO_PLATFORM
  27.367 +    gst_bin_add_many(GST_BIN(pipeline), audioqueue1, audiodec, audioconv,
  27.368 +                     audioqueue2, audiosink, NULL);
  27.369 +#else
  27.370 +    gst_bin_add_many(GST_BIN(pipeline), audioqueue1, audiosink, NULL);
  27.371 +#endif
  27.372 +
  27.373 +    {
  27.374 +        // GstCaps *rtpcaps = gst_caps_new_simple ("application/x-rtp",
  27.375 +        // NULL);
  27.376 +        // gst_element_link_filtered(source, parser, rtpcaps);
  27.377 +    }
  27.378 +
  27.379 +    gst_element_link(source, parser);
  27.380 +    gst_element_link_many(videoqueue1, videodec, videoqueue2,
  27.381 +                          videocolortrs, videosink, NULL);
  27.382 +
  27.383 +#ifndef MAEMO_PLATFORM
  27.384 +    gst_element_link_many(videosink, audioqueue1, audiodec, audioconv,
  27.385 +                          audioqueue2, audiosink, NULL);
  27.386 +#else
  27.387 +    gst_element_link_many(videosink, audioqueue1, audiosink, NULL);
  27.388 +#endif
  27.389 +
  27.390 +    g_signal_connect(parser, "pad-added", G_CALLBACK(new_pad_cb),
  27.391 +                     tvplayer);
  27.392 +
  27.393 +    return TRUE;
  27.394 +}
  27.395 +
  27.396 +/** Configures the backend and the tv player 
  27.397 + * for playing the recorded content A/V.
  27.398 + *
  27.399 + * FIXME: Change filename to program info or other structure about the recorded
  27.400 + *
  27.401 + * @param tvplayer the object instance.
  27.402 + * @param filename the file uri of the recorded content to be played.
  27.403 + * @return TRUE if successfull, FALSE if any error happens.
  27.404 + */
  27.405 +gboolean
  27.406 +mmyth_tvplayer_record_setup(MMythTVPlayer * tvplayer,
  27.407 +                            const gchar * filename)
  27.408 +{
  27.409 +    // FIXME: we should receive the uri instead of filename
  27.410 +    const gchar    *hostname =
  27.411 +        gmyth_backend_info_get_hostname(tvplayer->backend_info);
  27.412 +    const gint      port =
  27.413 +        gmyth_backend_info_get_port(tvplayer->backend_info);
  27.414 +
  27.415 +    GString        *fullpath = g_string_new("myth://");
  27.416 +    g_string_append_printf(fullpath, "%s:%d/%s", hostname, port, filename);
  27.417 +
  27.418 +    tvplayer->is_livetv = FALSE;
  27.419 +
  27.420 +    g_debug("[%s] Setting record uri to gstreamer pipeline to %s",
  27.421 +            __FUNCTION__, fullpath->str);
  27.422 +
  27.423 +    g_object_set(G_OBJECT(tvplayer->gst_source), "location",
  27.424 +                 fullpath->str, NULL);
  27.425 +
  27.426 +    return TRUE;
  27.427 +}
  27.428 +
  27.429 +/** Configures the backend and the tv player 
  27.430 + * for playing the live tv.
  27.431 + *
  27.432 + * @param tvplayer the object instance.
  27.433 + * @return TRUE if successfull, FALSE if any error happens.
  27.434 + */
  27.435 +gboolean
  27.436 +mmyth_tvplayer_livetv_setup(MMythTVPlayer * tvplayer)
  27.437 +{
  27.438 +    gboolean        res = TRUE;
  27.439 +
  27.440 +    tvplayer->livetv = gmyth_livetv_new();
  27.441 +
  27.442 +    if (!gmyth_livetv_setup(tvplayer->livetv, tvplayer->backend_info))
  27.443 +        goto error;
  27.444 +
  27.445 +    return res;
  27.446 +
  27.447 +  error:
  27.448 +    res = FALSE;
  27.449 +    if (tvplayer->livetv != NULL) {
  27.450 +        g_object_unref(tvplayer->livetv);
  27.451 +    }
  27.452 +
  27.453 +    if (tvplayer->local_hostname != NULL) {
  27.454 +        g_string_free(tvplayer->local_hostname, TRUE);
  27.455 +    }
  27.456 +
  27.457 +    if (tvplayer->recorder != NULL) {
  27.458 +        g_object_unref(tvplayer->recorder);
  27.459 +        tvplayer->recorder = NULL;
  27.460 +    }
  27.461 +
  27.462 +    if (tvplayer->tvchain != NULL) {
  27.463 +        g_object_unref(tvplayer->tvchain);
  27.464 +        tvplayer->tvchain = NULL;
  27.465 +    }
  27.466 +
  27.467 +    if (tvplayer->proginfo != NULL) {
  27.468 +        g_object_unref(tvplayer->proginfo);
  27.469 +        tvplayer->proginfo = NULL;
  27.470 +    }
  27.471 +
  27.472 +    return res;
  27.473 +
  27.474 +}
  27.475 +
  27.476 +/** Sets the GTK video widget for the tv player. 
  27.477 + *
  27.478 + * @param tvplayer the object instance.
  27.479 + * @param videow the GTK video window.
  27.480 + * @return TRUE if successfull, FALSE if any error happens.
  27.481 + */
  27.482 +gboolean
  27.483 +mmyth_tvplayer_set_widget(MMythTVPlayer * tvplayer, GtkWidget * videow)
  27.484 +{
  27.485 +    tvplayer->videow = videow;
  27.486 +    g_object_ref(videow);
  27.487 +
  27.488 +    g_debug("[%s] Setting widget for tv player render", __FUNCTION__);
  27.489 +
  27.490 +    tvplayer->expose_handler =
  27.491 +        g_signal_connect(tvplayer->videow, "expose-event",
  27.492 +                         G_CALLBACK(expose_cb), tvplayer);
  27.493 +
  27.494 +    // g_signal_connect(miptv_ui->videow, "size_request",
  27.495 +    // G_CALLBACK(cb_preferred_video_size), miptv_ui);
  27.496 +
  27.497 +    return TRUE;
  27.498 +}
  27.499 +
  27.500 +static          gboolean
  27.501 +bus_call(GstBus * bus, GstMessage * msg, gpointer data)
  27.502 +{
  27.503 +    // MMythTVPlayer *tvplayer = MMYTH_TVPLAYER ( data );
  27.504 +    // GMainLoop *loop = tvplayer->loop;
  27.505 +
  27.506 +    switch (GST_MESSAGE_TYPE(msg)) {
  27.507 +    case GST_MESSAGE_EOS:
  27.508 +        printf("End of stream\n");
  27.509 +        // g_idle_add ((GSourceFunc) idle_eos, data);
  27.510 +        gst_element_set_state(GST_ELEMENT(GST_MESSAGE_SRC(msg)),
  27.511 +                              GST_STATE_NULL);
  27.512 +        gst_element_set_locked_state(GST_ELEMENT(GST_MESSAGE_SRC(msg)),
  27.513 +                                     TRUE);
  27.514 +        break;
  27.515 +    case GST_MESSAGE_ERROR:
  27.516 +        {
  27.517 +            gchar          *debug;
  27.518 +            GError         *err;
  27.519 +
  27.520 +            gst_message_parse_error(msg, &err, &debug);
  27.521 +            g_free(debug);
  27.522 +
  27.523 +            printf("Error: %s\n", err->message);
  27.524 +            g_error_free(err);
  27.525 +
  27.526 +            // g_main_loop_quit (loop);
  27.527 +        }
  27.528 +        break;
  27.529 +    default:
  27.530 +        printf(gst_message_type_get_name(GST_MESSAGE_TYPE(msg)));
  27.531 +        printf("\n");
  27.532 +        break;
  27.533 +    }
  27.534 +
  27.535 +    return TRUE;
  27.536 +}
  27.537 +
  27.538 +
  27.539 +#if 0
  27.540 +static          gboolean
  27.541 +idle_state(gpointer data)
  27.542 +{
  27.543 +    GstPlayerWindowStateChange *st = data;
  27.544 +
  27.545 +    if (st->old_state == GST_STATE_PLAYING) {
  27.546 +        if (st->miptv_ui->idle_id != 0) {
  27.547 +            g_source_remove(st->miptv_ui->idle_id);
  27.548 +            st->miptv_ui->idle_id = 0;
  27.549 +        }
  27.550 +    } else if (st->new_state == GST_STATE_PLAYING) {
  27.551 +        if (st->miptv_ui->idle_id != 0)
  27.552 +            g_source_remove(st->miptv_ui->idle_id);
  27.553 +
  27.554 +        st->miptv_ui->idle_id = g_idle_add(cb_iterate, st->miptv_ui);
  27.555 +    }
  27.556 +
  27.557 +    /*
  27.558 +     * new movie loaded? 
  27.559 +     */
  27.560 +    if (st->old_state == GST_STATE_READY
  27.561 +        && st->new_state > GST_STATE_READY) {
  27.562 +
  27.563 +        /*
  27.564 +         * gboolean have_video = FALSE; 
  27.565 +         */
  27.566 +
  27.567 +        gtk_widget_show(st->miptv_ui->videow);
  27.568 +
  27.569 +        gtk_window_resize(GTK_WINDOW(st->miptv_ui->main_window), 1, 1);
  27.570 +
  27.571 +    }
  27.572 +
  27.573 +    /*
  27.574 +     * discarded movie? 
  27.575 +     */
  27.576 +    if (st->old_state > GST_STATE_READY
  27.577 +        && st->new_state == GST_STATE_READY) {
  27.578 +
  27.579 +        if (st->miptv_ui->tagcache) {
  27.580 +            gst_tag_list_free(st->miptv_ui->tagcache);
  27.581 +            st->miptv_ui->tagcache = NULL;
  27.582 +        }
  27.583 +    }
  27.584 +
  27.585 +    gst_object_unref(GST_OBJECT(st->play));
  27.586 +    // g_object_unref (G_OBJECT (st->win));
  27.587 +    g_free(st);
  27.588 +
  27.589 +    /*
  27.590 +     * once 
  27.591 +     */
  27.592 +    return FALSE;
  27.593 +}
  27.594 +
  27.595 +#endif
  27.596 +
  27.597 +/** Stops playing the current A/V.
  27.598 + *
  27.599 + * FIXME: How to proceed differently between livetv 
  27.600 + * and recorded content?
  27.601 + *
  27.602 + * @param tvplayer the object instance.
  27.603 + * @return void 
  27.604 + */
  27.605 +void
  27.606 +mmyth_tvplayer_stop_playing(MMythTVPlayer * tvplayer)
  27.607 +{
  27.608 +    g_debug("[%s] Setting gstreamer pipeline state to NULL", __FUNCTION__);
  27.609 +
  27.610 +    gst_element_set_state(tvplayer->gst_pipeline, GST_STATE_NULL);
  27.611 +
  27.612 +    if (tvplayer->is_livetv) {
  27.613 +        if (!gmyth_recorder_stop_livetv(tvplayer->recorder)) {
  27.614 +            g_warning("[%s] Error while stoping remote encoder",
  27.615 +                      __FUNCTION__);
  27.616 +        }
  27.617 +    }
  27.618 +}
  27.619 +
  27.620 +/** Queries if the tvplayer is active playing A/V content.
  27.621 + *
  27.622 + * @param tvplayer the object instance.
  27.623 + * @return TRUE if the tvplayer is active, FALSE otherwise.
  27.624 + */
  27.625 +gboolean
  27.626 +mmyth_tvplayer_is_playing(MMythTVPlayer * tvplayer)
  27.627 +{
  27.628 +    return (GST_STATE(tvplayer->gst_pipeline) == GST_STATE_PLAYING);
  27.629 +}
  27.630 +
  27.631 +/** Static function that sets the tvplayer state to PLAYING.
  27.632 + *
  27.633 + * @param tvplayer the object instance.
  27.634 + * @return TRUE if the tvplayer is active, FALSE otherwise.
  27.635 + */
  27.636 +static          gboolean
  27.637 +idle_play(gpointer data)
  27.638 +{
  27.639 +    MMythTVPlayer  *tvplayer = MMYTH_TVPLAYER(data);
  27.640 +
  27.641 +    g_debug("MMythTVPlayer: Setting pipeline state to PLAYING\n");
  27.642 +
  27.643 +    gst_element_set_state(tvplayer->gst_pipeline, GST_STATE_PLAYING);
  27.644 +
  27.645 +    return FALSE;
  27.646 +}
  27.647 +
  27.648 +/** Start playing A/V with the tvplayer attributes.
  27.649 + *
  27.650 + * @param tvplayer the object instance.
  27.651 + */
  27.652 +void
  27.653 +mmyth_tvplayer_start_playing(MMythTVPlayer * tvplayer)
  27.654 +{
  27.655 +
  27.656 +    // FIXME: Move this to livetv_setup??
  27.657 +    if (tvplayer->is_livetv) {
  27.658 +
  27.659 +#if 0
  27.660 +        if (!tvplayer || !(tvplayer->proginfo)
  27.661 +            || !(tvplayer->local_hostname)
  27.662 +            || !(tvplayer->gst_source)) {
  27.663 +            g_warning("GMythtvPlayer not ready to start playing\n");
  27.664 +        }
  27.665 +
  27.666 +        if (!(tvplayer->proginfo->pathname)) {
  27.667 +            g_warning
  27.668 +                ("[%s] Playback url is null, could not play the myth content",
  27.669 +                 __FUNCTION__);
  27.670 +            return;
  27.671 +        }
  27.672 +
  27.673 +        g_debug("MMythTVPlayer: Start playing %s",
  27.674 +                tvplayer->proginfo->pathname->str);
  27.675 +#endif
  27.676 +        g_object_set(G_OBJECT(tvplayer->gst_source), "mythtv-live",
  27.677 +                     TRUE, NULL);
  27.678 +#if 0
  27.679 +        if (tvplayer->tvchain != NULL) {
  27.680 +            GString        *str_chainid =
  27.681 +                gmyth_tvchain_get_id(tvplayer->tvchain);
  27.682 +            g_print("[%s]\tCHAIN ID: %s\n", __FUNCTION__,
  27.683 +                    str_chainid->str);
  27.684 +
  27.685 +            g_object_set(G_OBJECT(tvplayer->gst_source),
  27.686 +                         "mythtv-live-chainid", g_strdup(str_chainid->str),
  27.687 +                         NULL);
  27.688 +            if (str_chainid != NULL)
  27.689 +                g_string_free(str_chainid, FALSE);
  27.690 +        }
  27.691 +
  27.692 +        if (tvplayer->recorder != NULL)
  27.693 +            g_object_set(G_OBJECT(tvplayer->gst_source), "mythtv-live-id",
  27.694 +                         tvplayer->recorder->recorder_num, NULL);
  27.695 +        g_debug("[%s] Setting location to %s", __FUNCTION__,
  27.696 +                tvplayer->proginfo->pathname->str);
  27.697 +
  27.698 +        /*
  27.699 +         * Sets the gstreamer properties acording to the service access
  27.700 +         * address 
  27.701 +         */
  27.702 +        g_object_set(G_OBJECT(tvplayer->gst_source), "location",
  27.703 +                     tvplayer->proginfo->pathname->str, NULL);
  27.704 +#endif
  27.705 +    }
  27.706 +
  27.707 +    g_object_set(G_OBJECT(tvplayer->gst_source), "mythtv-version",
  27.708 +                 MYTHTV_VERSION_DEFAULT, NULL);
  27.709 +
  27.710 +    g_object_set(G_OBJECT(tvplayer->gst_source), "mythtv-debug",
  27.711 +                 TRUE, NULL);
  27.712 +
  27.713 +    g_idle_add(idle_play, tvplayer);
  27.714 +
  27.715 +}
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/maemo-ui-old/src/mmyth_tvplayer.h	Wed Aug 01 14:50:29 2007 +0100
    28.3 @@ -0,0 +1,122 @@
    28.4 +/**
    28.5 + * GMyth Library
    28.6 + *
    28.7 + * @file gmyth/mmyth_tvplayer.h
    28.8 + * 
    28.9 + * @brief <p> This component provides playback of the remote A/V using
   28.10 + * GStreamer.
   28.11 + * 
   28.12 + * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
   28.13 + * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
   28.14 + *
   28.15 +    *//*
   28.16 +    * 
   28.17 +    * This program is free software; you can redistribute it and/or modify
   28.18 +    * it under the terms of the GNU Lesser General Public License as published by
   28.19 +    * the Free Software Foundation; either version 2 of the License, or
   28.20 +    * (at your option) any later version.
   28.21 +    *
   28.22 +    * This program is distributed in the hope that it will be useful,
   28.23 +    * but WITHOUT ANY WARRANTY; without even the implied warranty of
   28.24 +    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   28.25 +    * GNU General Public License for more details.
   28.26 +    *
   28.27 +    * You should have received a copy of the GNU Lesser General Public License
   28.28 +    * along with this program; if not, write to the Free Software
   28.29 +    * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   28.30 +    */
   28.31 +
   28.32 +#ifndef MMYTH_TVPLAYER_H_
   28.33 +#define MMYTH_TVPLAYER_H_
   28.34 +
   28.35 +#include <glib-object.h>
   28.36 +#include <gtk/gtk.h>
   28.37 +
   28.38 +/*
   28.39 + * GStreamer includes 
   28.40 + */
   28.41 +#include <gst/gst.h>
   28.42 +#include <gst/interfaces/xoverlay.h>
   28.43 +
   28.44 +#include <gmyth/gmyth_recorder.h>
   28.45 +#include <gmyth/gmyth_tvchain.h>
   28.46 +#include <gmyth/gmyth_common.h>
   28.47 +#include <gmyth/gmyth_livetv.h>
   28.48 +
   28.49 +G_BEGIN_DECLS
   28.50 +#define MMYTH_TVPLAYER_TYPE               (mmyth_tvplayer_get_type ())
   28.51 +#define MMYTH_TVPLAYER(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), MMYTH_TVPLAYER_TYPE, MMythTVPlayer))
   28.52 +#define MMYTH_TVPLAYER_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), MMYTH_TVPLAYER_TYPE, MMythTVPlayerClass))
   28.53 +#define IS_MMYTH_TVPLAYER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), MMYTH_TVPLAYER_TYPE))
   28.54 +#define IS_MMYTH_TVPLAYER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), MMYTH_TVPLAYER_TYPE))
   28.55 +#define MMYTH_TVPLAYER_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), MMYTH_TVPLAYER_TYPE, MMythTVPlayerClass))
   28.56 +typedef struct _MMythTVPlayer MMythTVPlayer;
   28.57 +typedef struct _MMythTVPlayerClass MMythTVPlayerClass;
   28.58 +
   28.59 +struct _MMythTVPlayerClass {
   28.60 +    GObjectClass    parent_class;
   28.61 +
   28.62 +    /*
   28.63 +     * callbacks 
   28.64 +     */
   28.65 +    /*
   28.66 +     * no one for now 
   28.67 +     */
   28.68 +};
   28.69 +
   28.70 +struct _MMythTVPlayer {
   28.71 +    GObject         parent;
   28.72 +
   28.73 +    GstElement     *gst_pipeline;
   28.74 +    GstElement     *gst_source;
   28.75 +    GstElement     *gst_videodec;
   28.76 +    GstElement     *gst_videosink;
   28.77 +    GstElement     *gst_videocolortrs;
   28.78 +    GstElement     *videoqueue1;
   28.79 +    GstElement     *videoqueue2;
   28.80 +    GstElement     *audioqueue1;
   28.81 +    GstElement     *audioqueue2;
   28.82 +
   28.83 +    gulong          expose_handler;
   28.84 +    // GMainLoop *loop;
   28.85 +
   28.86 +    GtkWidget      *videow;
   28.87 +
   28.88 +    /*
   28.89 +     * Backend connection related variables 
   28.90 +     */
   28.91 +    GString        *backend_hostname;
   28.92 +    gint            backend_port;
   28.93 +    GString        *local_hostname;
   28.94 +
   28.95 +    GMythRecorder  *recorder;
   28.96 +    GMythTVChain   *tvchain;
   28.97 +    GMythProgramInfo *proginfo;
   28.98 +    GMythLiveTV    *livetv;
   28.99 +
  28.100 +    GMythBackendInfo *backend_info;
  28.101 +
  28.102 +    gboolean        is_livetv;
  28.103 +};
  28.104 +
  28.105 +
  28.106 +GType           mmyth_tvplayer_get_type(void);
  28.107 +
  28.108 +MMythTVPlayer  *mmyth_tvplayer_new();
  28.109 +gboolean        mmyth_tvplayer_initialize(MMythTVPlayer * tvplayer,
  28.110 +                                          GMythBackendInfo * backend_info);
  28.111 +
  28.112 +void            mmyth_tvplayer_start_playing(MMythTVPlayer * tvplayer);
  28.113 +void            mmyth_tvplayer_stop_playing(MMythTVPlayer * tvplayer);
  28.114 +
  28.115 +gboolean        mmyth_tvplayer_set_widget(MMythTVPlayer * tvplayer,
  28.116 +                                          GtkWidget * videow);
  28.117 +
  28.118 +gboolean        mmyth_tvplayer_is_playing(MMythTVPlayer * tvplayer);
  28.119 +
  28.120 +gboolean        mmyth_tvplayer_record_setup(MMythTVPlayer * tvplayer,
  28.121 +                                            const gchar * filename);
  28.122 +gboolean        mmyth_tvplayer_livetv_setup(MMythTVPlayer * tvplayer);
  28.123 +
  28.124 +G_END_DECLS
  28.125 +#endif                          /* MMYTH_TVPLAYER_H_ */
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/maemo-ui-old/src/mmyth_ui.c	Wed Aug 01 14:50:29 2007 +0100
    29.3 @@ -0,0 +1,894 @@
    29.4 +
    29.5 +#include <glib-object.h>
    29.6 +#include <sys/types.h>
    29.7 +#include <sys/stat.h>
    29.8 +#include <unistd.h>
    29.9 +#include <string.h>
   29.10 +#include <stdio.h>
   29.11 +#include <gtk/gtk.h>
   29.12 +#include <gdk/gdkx.h>
   29.13 +#include <gst/interfaces/xoverlay.h>
   29.14 +#include <assert.h>
   29.15 +
   29.16 +#include "mmyth_ui.h"
   29.17 +#include "mmyth_uicommon.h"
   29.18 +#include "mmyth_schedulerui.h"
   29.19 +#include "mmyth_recordui.h"
   29.20 +#include "mmyth_uisettings.h"
   29.21 +#include "mmyth_epg_grid_view.h"
   29.22 +#include "mmyth_tvplayer.h"
   29.23 +
   29.24 +/*
   29.25 + * GMyth library includes 
   29.26 + */
   29.27 +
   29.28 +#ifndef MAEMO_PLATFORM
   29.29 +static gint     button_press_handler(GtkWidget * widget, GdkEvent * event);
   29.30 +#endif
   29.31 +
   29.32 +static MMythUiCommon *create_main_view(MMythUi * mmyth_ui);
   29.33 +static MMythUiCommon *create_video_view(MMythUi * mmyth_ui);
   29.34 +static MMythUiCommon *create_epg_grid_view(MMythUi * mmyth_ui);
   29.35 +static MMythUiCommon *create_record_view(MMythUi * mmyth_ui);
   29.36 +static MMythUiCommon *create_schedule_view(MMythUi * mmyth_ui);
   29.37 +
   29.38 +static void     cb_video_close_button(GtkButton * button,
   29.39 +                                      gpointer user_data);
   29.40 +static void     cb_record_button(GtkButton * button, gpointer user_data);
   29.41 +static void     cb_menu_item_settings(GtkMenuItem * menuitem,
   29.42 +                                      gpointer user_data);
   29.43 +
   29.44 +/*
   29.45 + * main box from button box separator
   29.46 + */
   29.47 +static GtkWidget *main_vseparator = NULL;
   29.48 +
   29.49 +GdkPixbuf      *icon_sports,
   29.50 +               *icon_news,
   29.51 +               *icon_movies,
   29.52 +               *icon_shows,
   29.53 +               *icon_default;
   29.54 +
   29.55 +#ifndef MAEMO_PLATFORM
   29.56 +/*
   29.57 + * FIXME: 
   29.58 + */
   29.59 +static MMythUi *popup_mmyth_ui;
   29.60 +#endif
   29.61 +
   29.62 +MMythUi        *
   29.63 +mmyth_ui_initialize(
   29.64 +#ifdef MAEMO_PLATFORM
   29.65 +                       HildonProgram * program,
   29.66 +#endif
   29.67 +                       GtkWidget * main_window)
   29.68 +{
   29.69 +    MMythUi        *mmyth_ui;
   29.70 +
   29.71 +    mmyth_ui = g_new0(MMythUi, 1);
   29.72 +
   29.73 +    mmyth_ui->backend_info =
   29.74 +        gmyth_backend_info_new_full("localhost", "mythtv", "mythtv",
   29.75 +                                    "mythconverg", 6543);
   29.76 +
   29.77 +    mmyth_ui->main_window = main_window;
   29.78 +    mmyth_ui->videow = NULL;
   29.79 +    mmyth_ui->mmyth_recordui = NULL;
   29.80 +    mmyth_ui->mmyth_schedulerui = NULL;
   29.81 +
   29.82 +    /*
   29.83 +     * Horizontal box that divides the view into control and video area 
   29.84 +     */
   29.85 +    mmyth_ui->main_hbox = gtk_hbox_new(FALSE, 0);
   29.86 +    gtk_widget_show(mmyth_ui->main_hbox);
   29.87 +    g_object_ref(mmyth_ui->main_hbox);
   29.88 +
   29.89 +    main_bg_color.red = 65000;
   29.90 +    main_bg_color.green = 65000;
   29.91 +    main_bg_color.blue = 65000;
   29.92 +
   29.93 +
   29.94 +#ifndef MAEMO_PLATFORM
   29.95 +    /*
   29.96 +     * Popup menu 
   29.97 +     */
   29.98 +    popup_mmyth_ui = mmyth_ui;
   29.99 +    g_signal_connect(G_OBJECT(mmyth_ui->main_hbox), "event",
  29.100 +                     G_CALLBACK(button_press_handler),
  29.101 +                     G_OBJECT(mmyth_ui->main_hbox));
  29.102 +
  29.103 +#else                           // #ifdef MAEMO
  29.104 +
  29.105 +    mmyth_ui->main_menu = GTK_MENU(gtk_menu_new());
  29.106 +    hildon_program_set_common_menu(program, mmyth_ui->main_menu);
  29.107 +
  29.108 +    mmyth_ui->menu_setup = gtk_menu_item_new_with_label("Setup");
  29.109 +    gtk_widget_set_size_request(GTK_WIDGET(mmyth_ui->menu_setup), 150, 40);
  29.110 +    gtk_menu_append(mmyth_ui->main_menu, mmyth_ui->menu_setup);
  29.111 +
  29.112 +    g_signal_connect(G_OBJECT(mmyth_ui->menu_setup), "activate",
  29.113 +                     G_CALLBACK(cb_menu_item_settings), mmyth_ui);
  29.114 +
  29.115 +    gtk_widget_show_all(GTK_WIDGET(mmyth_ui->main_menu));
  29.116 +#endif
  29.117 +
  29.118 +    // Main widget is mmyth_ui->main_hbox
  29.119 +    mmyth_ui->main_uicommon = create_main_view(mmyth_ui);
  29.120 +
  29.121 +    gtk_container_add(GTK_CONTAINER(mmyth_ui->main_window),
  29.122 +                      mmyth_ui->main_hbox);
  29.123 +
  29.124 +    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->main_uicommon);
  29.125 +
  29.126 +    return mmyth_ui;
  29.127 +}
  29.128 +
  29.129 +void
  29.130 +mmyth_ui_finalize(MMythUi * mmyth_ui)
  29.131 +{
  29.132 +    if (mmyth_ui != NULL) {
  29.133 +        if (mmyth_ui->main_uicommon)
  29.134 +            mmyth_uicommon_free(mmyth_ui->main_uicommon);
  29.135 +        if (mmyth_ui->video_uicommon)
  29.136 +            mmyth_uicommon_free(mmyth_ui->video_uicommon);
  29.137 +        if (mmyth_ui->epg_grid_uicommon)
  29.138 +            mmyth_uicommon_free(mmyth_ui->epg_grid_uicommon);
  29.139 +        if (mmyth_ui->record_uicommon)
  29.140 +            mmyth_uicommon_free(mmyth_ui->record_uicommon);
  29.141 +        if (mmyth_ui->schedule_uicommon)
  29.142 +            mmyth_uicommon_free(mmyth_ui->schedule_uicommon);
  29.143 +
  29.144 +        g_free(mmyth_ui);
  29.145 +    }
  29.146 +}
  29.147 +
  29.148 +void
  29.149 +mmyth_ui_set_widget(MMythUi * mmyth_ui, MMythUiCommon * new_uicommon)
  29.150 +{
  29.151 +    if (new_uicommon == NULL) {
  29.152 +        g_warning("MMythUI setting a NULL UI_Common as current display\n");
  29.153 +        return;
  29.154 +    }
  29.155 +
  29.156 +    if (mmyth_ui->current_uicommon) {
  29.157 +        if (mmyth_ui->current_uicommon == mmyth_ui->video_uicommon) {
  29.158 +            gtk_widget_hide(mmyth_ui->current_uicommon->main_widget);
  29.159 +            gtk_widget_hide(mmyth_ui->videow);
  29.160 +        } else {
  29.161 +            gtk_container_remove(GTK_CONTAINER(mmyth_ui->main_hbox),
  29.162 +                                 mmyth_ui->current_uicommon->main_widget);
  29.163 +        }
  29.164 +
  29.165 +        gtk_container_remove(GTK_CONTAINER(mmyth_ui->main_hbox),
  29.166 +                             mmyth_ui->current_uicommon->event_box);
  29.167 +        gtk_container_remove(GTK_CONTAINER(mmyth_ui->main_hbox),
  29.168 +                             main_vseparator);
  29.169 +
  29.170 +    }
  29.171 +
  29.172 +    if (new_uicommon->main_widget == mmyth_ui->video_alignment) {
  29.173 +        // gst_player_video_show (GST_PLAYER_VIDEO(mmyth_ui->videow));
  29.174 +        gtk_widget_show(mmyth_ui->video_alignment);
  29.175 +        gtk_widget_show(mmyth_ui->videow);
  29.176 +    } else {
  29.177 +        /*
  29.178 +         * FIXME: Fst call is NULL when mmyth_player_init fails 
  29.179 +         */
  29.180 +        if (mmyth_ui->video_alignment != NULL)
  29.181 +            gtk_widget_hide(mmyth_ui->video_alignment);
  29.182 +        /*
  29.183 +         * FIXME: Fst call is NULL when mmyth_player_init fails 
  29.184 +         */
  29.185 +        if (mmyth_ui->videow != NULL)
  29.186 +            gtk_widget_hide(mmyth_ui->videow);
  29.187 +
  29.188 +        gtk_box_pack_start(GTK_BOX(mmyth_ui->main_hbox),
  29.189 +                           new_uicommon->main_widget, TRUE, TRUE, 0);
  29.190 +    }
  29.191 +
  29.192 +    if (main_vseparator == NULL) {
  29.193 +        /*
  29.194 +         * FIXME: should free this variable
  29.195 +         */
  29.196 +        main_vseparator = gtk_vseparator_new();
  29.197 +        g_object_ref(main_vseparator);
  29.198 +    }
  29.199 +    gtk_box_pack_start(GTK_BOX(mmyth_ui->main_hbox),
  29.200 +                       main_vseparator, FALSE, FALSE, 0);
  29.201 +    gtk_widget_show(main_vseparator);
  29.202 +
  29.203 +    gtk_box_pack_end(GTK_BOX(mmyth_ui->main_hbox), new_uicommon->event_box,
  29.204 +                     FALSE, FALSE, 0);
  29.205 +
  29.206 +    mmyth_ui->current_uicommon = new_uicommon;
  29.207 +
  29.208 +}
  29.209 +
  29.210 +/*
  29.211 + * The close callback is the same for all windows
  29.212 + */
  29.213 +static void
  29.214 +cb_not_impl_button(GtkButton * button, gpointer user_data)
  29.215 +{
  29.216 +    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  29.217 +
  29.218 +    GtkWidget      *msg_dialog =
  29.219 +        gtk_message_dialog_new(GTK_WINDOW(mmyth_ui->main_window),
  29.220 +                               GTK_DIALOG_MODAL |
  29.221 +                               GTK_DIALOG_DESTROY_WITH_PARENT,
  29.222 +                               GTK_MESSAGE_INFO,
  29.223 +                               GTK_BUTTONS_OK,
  29.224 +                               "Feature not implemented");
  29.225 +    gtk_widget_set_size_request(msg_dialog, 350, 120);
  29.226 +
  29.227 +    gtk_dialog_run(GTK_DIALOG(msg_dialog));
  29.228 +
  29.229 +    gtk_widget_destroy(GTK_WIDGET(msg_dialog));
  29.230 +}
  29.231 +
  29.232 +/******************************************************************************
  29.233 + *                        POPUP MENU WIDGET METHODS                           *
  29.234 + *****************************************************************************/
  29.235 +
  29.236 +static void
  29.237 +cb_menu_item_settings(GtkMenuItem * menuitem, gpointer user_data)
  29.238 +{
  29.239 +
  29.240 +    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  29.241 +
  29.242 +    if (mmyth_uisettings_run(GTK_WINDOW(mmyth_ui->main_window))) {
  29.243 +        // If user changes the settings, we restart the context
  29.244 +        g_debug("[%s] Restarting mmyth_context to new settings",
  29.245 +                __FUNCTION__);
  29.246 +        // gmyth_context_initialize();
  29.247 +    }
  29.248 +}
  29.249 +
  29.250 +#ifndef MAEMO_PLATFORM
  29.251 +
  29.252 +static void
  29.253 +detacher(GtkWidget * attach_widget, GtkMenu * menu)
  29.254 +{
  29.255 +
  29.256 +}
  29.257 +
  29.258 +static void
  29.259 +do_popup_menu(GtkWidget * my_widget, GdkEventButton * event)
  29.260 +{
  29.261 +    GtkWidget      *popup;
  29.262 +
  29.263 +    int             button,
  29.264 +                    event_time;
  29.265 +
  29.266 +    GtkWidget      *item_general;
  29.267 +    GtkWidget      *image;
  29.268 +
  29.269 +    popup = gtk_menu_new();
  29.270 +
  29.271 +    item_general = gtk_image_menu_item_new_with_mnemonic("Setup");
  29.272 +    gtk_widget_show(item_general);
  29.273 +    gtk_container_add(GTK_CONTAINER(popup), item_general);
  29.274 +
  29.275 +    image = gtk_image_new_from_stock("gtk-edit", GTK_ICON_SIZE_MENU);
  29.276 +    gtk_widget_show(image);
  29.277 +    gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item_general),
  29.278 +                                  image);
  29.279 +
  29.280 +    g_signal_connect(G_OBJECT(item_general), "activate",
  29.281 +                     G_CALLBACK(cb_menu_item_settings), popup_mmyth_ui);
  29.282 +
  29.283 +    if (event) {
  29.284 +        button = event->button;
  29.285 +        event_time = event->time;
  29.286 +    } else {
  29.287 +        button = 0;
  29.288 +        event_time = gtk_get_current_event_time();
  29.289 +    }
  29.290 +
  29.291 +    gtk_menu_attach_to_widget(GTK_MENU(popup), my_widget, detacher);
  29.292 +    gtk_menu_popup(GTK_MENU(popup), NULL, NULL, NULL, NULL,
  29.293 +                   button, event_time);
  29.294 +    gtk_widget_show_all(popup);
  29.295 +}
  29.296 +
  29.297 +/*
  29.298 + * Respond to a button-press by posting a menu passed in as widget. Note
  29.299 + * that the "widget" argument is the menu being posted, NOT the button
  29.300 + * that was pressed. 
  29.301 + */
  29.302 +static          gint
  29.303 +button_press_handler(GtkWidget * widget, GdkEvent * event)
  29.304 +{
  29.305 +
  29.306 +    if (event->type == GDK_BUTTON_PRESS) {
  29.307 +        GdkEventButton *bevent = (GdkEventButton *) event;
  29.308 +        /*
  29.309 +         * Ignore double-clicks and triple-clicks 
  29.310 +         */
  29.311 +        if (bevent->button == 3) {
  29.312 +            do_popup_menu(widget, bevent);
  29.313 +            return TRUE;
  29.314 +        }
  29.315 +    }
  29.316 +
  29.317 +    /*
  29.318 +     * Tell calling code that we have not handled this event; pass it on. 
  29.319 +     */
  29.320 +    return FALSE;
  29.321 +}
  29.322 +#endif
  29.323 +
  29.324 +/******************************************************************************
  29.325 + *                          MAIN APP VIEW METHODS                             *
  29.326 + *****************************************************************************/
  29.327 +
  29.328 +static void
  29.329 +cb_close_button(GtkButton * button, gpointer user_data)
  29.330 +{
  29.331 +    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  29.332 +
  29.333 +    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->main_uicommon);
  29.334 +}
  29.335 +
  29.336 +static void
  29.337 +cb_watch_tv_button(GtkButton * button, gpointer user_data)
  29.338 +{
  29.339 +    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  29.340 +    gboolean        res = FALSE;
  29.341 +
  29.342 +    if (!(mmyth_ui->video_uicommon))
  29.343 +        mmyth_ui->video_uicommon = create_video_view(mmyth_ui);
  29.344 +
  29.345 +    // Creates the tv player that will retrieve the mythtv content, decode 
  29.346 +    // and show it
  29.347 +    mmyth_ui->tvplayer = mmyth_tvplayer_new();
  29.348 +    /*
  29.349 +     * choose here if this is a LiveTV session 
  29.350 +     */
  29.351 +    mmyth_ui->tvplayer->is_livetv = TRUE;
  29.352 +
  29.353 +    res =
  29.354 +        mmyth_tvplayer_initialize(mmyth_ui->tvplayer,
  29.355 +                                  mmyth_ui->backend_info);
  29.356 +
  29.357 +    if (!res) {
  29.358 +        g_warning("[%s] Could not initialize tvplayer", __FUNCTION__);
  29.359 +
  29.360 +        g_object_unref(mmyth_ui->tvplayer);
  29.361 +        mmyth_ui->tvplayer = NULL;
  29.362 +
  29.363 +        GtkWidget      *dialog =
  29.364 +            gtk_message_dialog_new(GTK_WINDOW(mmyth_ui->main_window),
  29.365 +                                   GTK_DIALOG_DESTROY_WITH_PARENT,
  29.366 +                                   GTK_MESSAGE_ERROR,
  29.367 +                                   GTK_BUTTONS_CLOSE,
  29.368 +                                   "MMyth found errors while starting TV Player, please check "
  29.369 +                                   "the GStreamer installation");
  29.370 +
  29.371 +        gtk_dialog_run(GTK_DIALOG(dialog));
  29.372 +        gtk_widget_destroy(dialog);
  29.373 +
  29.374 +        return;
  29.375 +    }
  29.376 +    // res = mmyth_tvplayer_livetv_setup (mmyth_ui->tvplayer);
  29.377 +    // 
  29.378 +    if (mmyth_ui && mmyth_ui->tvplayer && res) {
  29.379 +        mmyth_tvplayer_set_widget(mmyth_ui->tvplayer, mmyth_ui->videow);
  29.380 +        mmyth_tvplayer_start_playing(mmyth_ui->tvplayer);
  29.381 +    } else {
  29.382 +        // TODO: Show Alert with error description!
  29.383 +        g_warning("[%s] MMythUI can't initialize tv_player", __FUNCTION__);
  29.384 +        g_object_unref(mmyth_ui->tvplayer);
  29.385 +        mmyth_ui->tvplayer = NULL;
  29.386 +        // FIXME: Show the exact error that happened
  29.387 +        GtkWidget      *dialog =
  29.388 +            gtk_message_dialog_new(GTK_WINDOW(mmyth_ui->main_window),
  29.389 +                                   GTK_DIALOG_DESTROY_WITH_PARENT,
  29.390 +                                   GTK_MESSAGE_ERROR,
  29.391 +                                   GTK_BUTTONS_CLOSE,
  29.392 +                                   "Error while starting TV Player, please check if the backend"
  29.393 +                                   " is running properly and a tv card is available!");
  29.394 +        gtk_dialog_run(GTK_DIALOG(dialog));
  29.395 +        gtk_widget_destroy(dialog);
  29.396 +        return;
  29.397 +    }
  29.398 +    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->video_uicommon);
  29.399 +
  29.400 +}
  29.401 +
  29.402 +static void
  29.403 +cb_epg_button(GtkButton * button, gpointer user_data)
  29.404 +{
  29.405 +    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  29.406 +
  29.407 +    if (!(mmyth_ui->epg_grid_uicommon))
  29.408 +        mmyth_ui->epg_grid_uicommon = create_epg_grid_view(mmyth_ui);
  29.409 +
  29.410 +    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->epg_grid_uicommon);
  29.411 +}
  29.412 +
  29.413 +static MMythUiCommon *
  29.414 +create_main_view(MMythUi * mmyth_ui)
  29.415 +{
  29.416 +    MMythUiCommon  *ui_common;
  29.417 +    GtkWidget      *main_widget;
  29.418 +    GtkWidget      *image;
  29.419 +
  29.420 +    g_debug("Creating Main UI Common");
  29.421 +
  29.422 +    // FIXME: file path
  29.423 +#ifdef MMYTH_DEV
  29.424 +    image = gtk_image_new_from_file("../pixmaps/mmyth_logo.png");
  29.425 +#else
  29.426 +    image = gtk_image_new_from_file(PIX_DIR "mmyth_logo.png");
  29.427 +#endif
  29.428 +
  29.429 +    main_widget = gtk_event_box_new();
  29.430 +
  29.431 +    gtk_container_add(GTK_CONTAINER(main_widget), image);
  29.432 +
  29.433 +
  29.434 +    gtk_widget_show_all(main_widget);
  29.435 +    g_object_ref(main_widget);
  29.436 +
  29.437 +    ui_common = mmyth_uicommon_new(main_widget,
  29.438 +                                   "Watch TV", "EPG", "Recording");
  29.439 +
  29.440 +    /*
  29.441 +     * Button signals 
  29.442 +     */
  29.443 +    // FIXME
  29.444 +    g_signal_connect(G_OBJECT(ui_common->button1), "clicked",
  29.445 +                     G_CALLBACK(cb_watch_tv_button), mmyth_ui);
  29.446 +    g_signal_connect(G_OBJECT(ui_common->button2), "clicked",
  29.447 +                     G_CALLBACK(cb_epg_button), mmyth_ui);
  29.448 +    g_signal_connect(G_OBJECT(ui_common->button3), "clicked",
  29.449 +                     G_CALLBACK(cb_record_button), mmyth_ui);
  29.450 +
  29.451 +    return ui_common;
  29.452 +
  29.453 +}
  29.454 +
  29.455 +/******************************************************************************
  29.456 + *                         epg GRID VIEW METHODS                              *
  29.457 + *****************************************************************************/
  29.458 +
  29.459 +static MMythUiCommon *
  29.460 +create_epg_grid_view(MMythUi * mmyth_ui)
  29.461 +{
  29.462 +    MMythUiCommon  *ui_common;
  29.463 +
  29.464 +    g_debug("Creating EPG Grid UI Common");
  29.465 +
  29.466 +    GtkWidget      *epg_grid_view =
  29.467 +        GTK_WIDGET(epg_grid_view_new(mmyth_ui));
  29.468 +
  29.469 +    ui_common = mmyth_uicommon_new(epg_grid_view,
  29.470 +                                   "Play", "Record", "Close");
  29.471 +
  29.472 +    /*
  29.473 +     * Button signals 
  29.474 +     */
  29.475 +    g_signal_connect(G_OBJECT(ui_common->button1), "clicked",
  29.476 +                     G_CALLBACK(cb_not_impl_button), mmyth_ui);
  29.477 +    g_signal_connect(G_OBJECT(ui_common->button2), "clicked",
  29.478 +                     G_CALLBACK(cb_record_button), mmyth_ui);
  29.479 +    g_signal_connect(G_OBJECT(ui_common->button3), "clicked",
  29.480 +                     G_CALLBACK(cb_close_button), mmyth_ui);
  29.481 +
  29.482 +    return ui_common;
  29.483 +}
  29.484 +/******************************************************************************
  29.485 + *                         SCHEDULE VIEW METHODS                                *
  29.486 + ******************************************************************************/
  29.487 +
  29.488 +static void
  29.489 +cb_save_new_schedule(GtkButton * button, gpointer user_data)
  29.490 +{
  29.491 +    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  29.492 +
  29.493 +    if (!(mmyth_ui->schedule_uicommon))
  29.494 +        mmyth_ui->schedule_uicommon = create_schedule_view(mmyth_ui);
  29.495 +
  29.496 +    mmyth_schedulerui_save(mmyth_ui->mmyth_schedulerui);
  29.497 +
  29.498 +    mmyth_recordui_reload_schedule(mmyth_ui->mmyth_recordui);
  29.499 +
  29.500 +    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->record_uicommon);
  29.501 +
  29.502 +}
  29.503 +
  29.504 +static void
  29.505 +cb_edit_scheduled(GtkTreeView * tree_view, GtkTreePath * path,
  29.506 +                  GtkTreeViewColumn * column, gpointer user_data)
  29.507 +{
  29.508 +    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  29.509 +    GtkTreeSelection *selection;
  29.510 +    GtkTreeModel   *list_store;
  29.511 +    GtkTreeIter     iter;
  29.512 +    int             index;
  29.513 +    // gint new_row = 0, record_id = 0;
  29.514 +    ScheduleInfo   *schedule_info;
  29.515 +    GList          *schedule_list;
  29.516 +    // GtkTreeIter iter;
  29.517 +    gint            res;
  29.518 +
  29.519 +    // gtk_tree_store_clear(recordui->sch_tree_store); 
  29.520 +
  29.521 +    res =
  29.522 +        gmyth_scheduler_get_schedule_list(mmyth_ui->mmyth_recordui->
  29.523 +                                          scheduler, &(schedule_list));
  29.524 +    if (res < 0) {
  29.525 +        g_warning
  29.526 +            ("[%s] Retrieved NULL list of scheduled data from database",
  29.527 +             __FUNCTION__);
  29.528 +        // return FALSE;
  29.529 +    }
  29.530 +    printf("\nX %d", res);
  29.531 +    fflush(stdout);
  29.532 +
  29.533 +    selection =
  29.534 +        gtk_tree_view_get_selection(GTK_TREE_VIEW
  29.535 +                                    (mmyth_ui->mmyth_recordui->
  29.536 +                                     sch_treeview));
  29.537 +
  29.538 +    gtk_tree_selection_get_selected(selection, &list_store, &iter);
  29.539 +    gtk_tree_model_get(list_store, &iter, 4, &index, -1);
  29.540 +
  29.541 +    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->schedule_uicommon);
  29.542 +
  29.543 +    if (!(mmyth_ui->schedule_uicommon))
  29.544 +        mmyth_ui->schedule_uicommon = create_schedule_view(mmyth_ui);
  29.545 +
  29.546 +    schedule_list =
  29.547 +        g_list_nth(schedule_list,
  29.548 +                   g_ascii_strtoull(gtk_tree_path_to_string(path), NULL,
  29.549 +                                    10));
  29.550 +    schedule_info = (ScheduleInfo *) schedule_list->data;
  29.551 +
  29.552 +    printf("\nstarttime: %ld", schedule_info->start_time->tv_sec);
  29.553 +    fflush(stdout);
  29.554 +}
  29.555 +
  29.556 +static MMythUiCommon *
  29.557 +create_schedule_view(MMythUi * mmyth_ui)
  29.558 +{
  29.559 +    MMythUiCommon  *ui_common;
  29.560 +    GtkWidget      *schedule_widget;
  29.561 +
  29.562 +    g_debug("Creating Schedule UI Common");
  29.563 +
  29.564 +    mmyth_ui->mmyth_schedulerui =
  29.565 +        mmyth_schedulerui_new(mmyth_ui->backend_info);
  29.566 +    if (mmyth_ui->mmyth_schedulerui == NULL) {
  29.567 +        g_warning("[%s] Error while creating scheduler ui", __FUNCTION__);
  29.568 +        return NULL;
  29.569 +    }
  29.570 +
  29.571 +    schedule_widget = mmyth_ui->mmyth_schedulerui->main_widget;
  29.572 +
  29.573 +    gtk_widget_show_all(schedule_widget);
  29.574 +    g_object_ref(schedule_widget);
  29.575 +
  29.576 +    ui_common = mmyth_uicommon_new(schedule_widget,
  29.577 +                                   "Save", "Clear", "Cancel");
  29.578 +
  29.579 +    /*
  29.580 +     * Button signals 
  29.581 +     */
  29.582 +    g_signal_connect(G_OBJECT(ui_common->button1), "clicked",
  29.583 +                     G_CALLBACK(cb_save_new_schedule), mmyth_ui);
  29.584 +    g_signal_connect(G_OBJECT(ui_common->button2), "clicked",
  29.585 +                     G_CALLBACK(cb_not_impl_button), mmyth_ui);
  29.586 +    g_signal_connect(G_OBJECT(ui_common->button3), "clicked",
  29.587 +                     G_CALLBACK(cb_record_button), mmyth_ui);
  29.588 +
  29.589 +    return ui_common;
  29.590 +}
  29.591 +/******************************************************************************
  29.592 + *                         RECORD VIEW METHODS                                *
  29.593 + ******************************************************************************/
  29.594 +static void
  29.595 +cb_record_button(GtkButton * button, gpointer user_data)
  29.596 +{
  29.597 +    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  29.598 +
  29.599 +    if (!(mmyth_ui->record_uicommon)) {
  29.600 +        mmyth_ui->record_uicommon = create_record_view(mmyth_ui);
  29.601 +        mmyth_ui->schedule_uicommon = create_schedule_view(mmyth_ui);
  29.602 +    }
  29.603 +
  29.604 +    mmyth_recordui_reload_all(mmyth_ui->mmyth_recordui);
  29.605 +
  29.606 +    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->record_uicommon);
  29.607 +
  29.608 +}
  29.609 +
  29.610 +static void
  29.611 +cb_record_close_button(GtkButton * button, gpointer user_data)
  29.612 +{
  29.613 +    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  29.614 +
  29.615 +    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->main_uicommon);
  29.616 +
  29.617 +    mmyth_recordui_free(mmyth_ui->mmyth_recordui);
  29.618 +
  29.619 +    if (mmyth_ui->record_uicommon) {
  29.620 +        gtk_widget_destroy(mmyth_ui->record_uicommon->main_widget);
  29.621 +        mmyth_uicommon_free(mmyth_ui->record_uicommon);
  29.622 +        mmyth_ui->record_uicommon = NULL;
  29.623 +    }
  29.624 +
  29.625 +    if (mmyth_ui->schedule_uicommon) {
  29.626 +        // mmyth_uicommon_free(mmyth_ui->schedule_uicommon);
  29.627 +    }
  29.628 +}
  29.629 +
  29.630 +
  29.631 +
  29.632 +
  29.633 +static void
  29.634 +play_selected_recorded(gpointer user_data)
  29.635 +{
  29.636 +    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  29.637 +    gboolean        res = FALSE;
  29.638 +
  29.639 +    gchar          *path =
  29.640 +        mmyth_recordui_get_selected_recorded(mmyth_ui->mmyth_recordui);
  29.641 +
  29.642 +    if (path == NULL) {
  29.643 +        // This should never happens. Play button is just activated when
  29.644 +        // a recording is selected.
  29.645 +        g_warning
  29.646 +            ("[%s] Play button pressed while none recorded is selected",
  29.647 +             __FUNCTION__);
  29.648 +        return;
  29.649 +    }
  29.650 +
  29.651 +    if (!(mmyth_ui->video_uicommon))
  29.652 +        mmyth_ui->video_uicommon = create_video_view(mmyth_ui);
  29.653 +
  29.654 +    // Creates the tv player that will retrieve the mythtv content, decode 
  29.655 +    // and show it
  29.656 +    mmyth_ui->tvplayer = mmyth_tvplayer_new();
  29.657 +    g_debug("[%s] New TV Player created: %d\n", __FUNCTION__,
  29.658 +            (int) (mmyth_ui->tvplayer));
  29.659 +    res =
  29.660 +        mmyth_tvplayer_initialize(mmyth_ui->tvplayer,
  29.661 +                                  mmyth_ui->backend_info);
  29.662 +    if (!res) {
  29.663 +        g_warning("[%s] Could not initialize tvplayer", __FUNCTION__);
  29.664 +
  29.665 +        g_object_unref(mmyth_ui->tvplayer);
  29.666 +        mmyth_ui->tvplayer = NULL;
  29.667 +
  29.668 +        GtkWidget      *dialog =
  29.669 +            gtk_message_dialog_new(GTK_WINDOW(mmyth_ui->main_window),
  29.670 +                                   GTK_DIALOG_DESTROY_WITH_PARENT,
  29.671 +                                   GTK_MESSAGE_ERROR,
  29.672 +                                   GTK_BUTTONS_CLOSE,
  29.673 +                                   "MMyth found errors while starting TV Player, please check "
  29.674 +                                   "the GStreamer installation");
  29.675 +
  29.676 +        gtk_dialog_run(GTK_DIALOG(dialog));
  29.677 +        gtk_widget_destroy(dialog);
  29.678 +
  29.679 +        return;
  29.680 +    }
  29.681 +
  29.682 +    res = mmyth_tvplayer_record_setup(mmyth_ui->tvplayer, path);
  29.683 +
  29.684 +    if (mmyth_ui && mmyth_ui->tvplayer && res) {
  29.685 +        mmyth_tvplayer_set_widget(mmyth_ui->tvplayer, mmyth_ui->videow);
  29.686 +        mmyth_tvplayer_start_playing(mmyth_ui->tvplayer);
  29.687 +    } else {
  29.688 +        // TODO: Show Alert with error description!
  29.689 +        g_warning("[%s] MMythUI can't initialize tv_player", __FUNCTION__);
  29.690 +        g_object_unref(mmyth_ui->tvplayer);
  29.691 +        mmyth_ui->tvplayer = NULL;
  29.692 +        // FIXME: Show the exact error that happened
  29.693 +        GtkWidget      *dialog =
  29.694 +            gtk_message_dialog_new(GTK_WINDOW(mmyth_ui->main_window),
  29.695 +                                   GTK_DIALOG_DESTROY_WITH_PARENT,
  29.696 +                                   GTK_MESSAGE_ERROR,
  29.697 +                                   GTK_BUTTONS_CLOSE,
  29.698 +                                   "Error while starting TV Player, please check if the backend"
  29.699 +                                   " is running properly and a tv card is available!");
  29.700 +        gtk_dialog_run(GTK_DIALOG(dialog));
  29.701 +        gtk_widget_destroy(dialog);
  29.702 +        return;
  29.703 +    }
  29.704 +
  29.705 +    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->video_uicommon);
  29.706 +}
  29.707 +
  29.708 +static void
  29.709 +cb_play_clicked_recorded(GtkTreeView * tree_view, GtkTreePath * path,
  29.710 +                         GtkTreeViewColumn * column, gpointer user_data)
  29.711 +{
  29.712 +    play_selected_recorded(user_data);
  29.713 +}
  29.714 +
  29.715 +static void
  29.716 +cb_play_selected(GtkButton * button, gpointer user_data)
  29.717 +{
  29.718 +    play_selected_recorded(user_data);
  29.719 +}
  29.720 +
  29.721 +static void
  29.722 +cb_schedule_button(GtkButton * button, gpointer user_data)
  29.723 +{
  29.724 +    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  29.725 +
  29.726 +    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->schedule_uicommon);
  29.727 +}
  29.728 +
  29.729 +void
  29.730 +cb_switch_page(GtkNotebook * notebook, GtkNotebookPage * page,
  29.731 +               guint page_num, gpointer user_data)
  29.732 +{
  29.733 +    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  29.734 +    MMythUiCommon  *ui_common;
  29.735 +
  29.736 +    assert(mmyth_ui);
  29.737 +    assert(mmyth_ui->record_uicommon);
  29.738 +
  29.739 +    ui_common = mmyth_ui->record_uicommon;
  29.740 +
  29.741 +    if (page_num == 0) {        // Switched to Schedule list
  29.742 +        gtk_button_set_label(GTK_BUTTON(ui_common->button1), "New");
  29.743 +        g_signal_handlers_disconnect_by_func(G_OBJECT(ui_common->button1),
  29.744 +                                             G_CALLBACK(cb_play_selected),
  29.745 +                                             mmyth_ui);
  29.746 +        g_signal_connect(G_OBJECT(ui_common->button1), "clicked",
  29.747 +                         G_CALLBACK(cb_schedule_button), mmyth_ui);
  29.748 +    } else if (page_num == 1) {
  29.749 +        gtk_button_set_label(GTK_BUTTON(ui_common->button1), "Play");
  29.750 +        g_signal_handlers_disconnect_by_func(G_OBJECT(ui_common->button1),
  29.751 +                                             G_CALLBACK
  29.752 +                                             (cb_schedule_button),
  29.753 +                                             mmyth_ui);
  29.754 +        g_signal_connect(G_OBJECT(ui_common->button1), "clicked",
  29.755 +                         G_CALLBACK(cb_play_selected), mmyth_ui);
  29.756 +    }
  29.757 +}
  29.758 +
  29.759 +
  29.760 +static MMythUiCommon *
  29.761 +create_record_view(MMythUi * mmyth_ui)
  29.762 +{
  29.763 +    MMythUiCommon  *ui_common;
  29.764 +
  29.765 +    g_debug("Creating Record UI Common");
  29.766 +
  29.767 +    mmyth_ui->mmyth_recordui = mmyth_recordui_new(mmyth_ui->backend_info);
  29.768 +
  29.769 +    // FIXME: Change MMythRecordUI to a GtkWidget child and avoid this
  29.770 +    // call!
  29.771 +    gtk_widget_show_all(mmyth_ui->mmyth_recordui->scrolled_window);
  29.772 +
  29.773 +    ui_common =
  29.774 +        mmyth_uicommon_new(mmyth_ui->mmyth_recordui->scrolled_window,
  29.775 +                           "New", "Delete", "<<Back");
  29.776 +    g_object_ref(mmyth_ui->mmyth_recordui->scrolled_window);
  29.777 +
  29.778 +    /*
  29.779 +     * Button signals 
  29.780 +     */
  29.781 +    g_signal_connect(G_OBJECT(ui_common->button1), "clicked",
  29.782 +                     G_CALLBACK(cb_schedule_button), mmyth_ui);
  29.783 +    g_signal_connect(G_OBJECT(ui_common->button2), "clicked",
  29.784 +                     G_CALLBACK(mmyth_recordui_delete_selected),
  29.785 +                     mmyth_ui->mmyth_recordui);
  29.786 +    g_signal_connect(G_OBJECT(ui_common->button3), "clicked",
  29.787 +                     G_CALLBACK(cb_record_close_button), mmyth_ui);
  29.788 +    g_signal_connect(G_OBJECT(mmyth_ui->mmyth_recordui->notebook),
  29.789 +                     "switch-page", G_CALLBACK(cb_switch_page), mmyth_ui);
  29.790 +    g_signal_connect(G_OBJECT(mmyth_ui->mmyth_recordui->rec_treeview),
  29.791 +                     "row-activated", G_CALLBACK(cb_play_clicked_recorded),
  29.792 +                     mmyth_ui);
  29.793 +    g_signal_connect(G_OBJECT(mmyth_ui->mmyth_recordui->sch_treeview),
  29.794 +                     "row-activated", G_CALLBACK(cb_edit_scheduled),
  29.795 +                     mmyth_ui);
  29.796 +    return ui_common;
  29.797 +}
  29.798 +
  29.799 +
  29.800 +/******************************************************************************
  29.801 + *                         GST VIDEO WIDGET METHODS                           *
  29.802 + *****************************************************************************/
  29.803 +
  29.804 +static void
  29.805 +cb_video_close_button(GtkButton * button, gpointer user_data)
  29.806 +{
  29.807 +    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  29.808 +
  29.809 +    g_debug("MMythUI video close button pressed");
  29.810 +
  29.811 +    if (mmyth_ui && mmyth_ui->tvplayer) {
  29.812 +        mmyth_tvplayer_stop_playing(mmyth_ui->tvplayer);
  29.813 +
  29.814 +        g_object_unref(mmyth_ui->tvplayer);
  29.815 +        mmyth_ui->tvplayer = NULL;
  29.816 +    } else {
  29.817 +        g_warning("cb_video_close_button called with NULL pointer\n");
  29.818 +    }
  29.819 +
  29.820 +    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->main_uicommon);
  29.821 +}
  29.822 +
  29.823 +
  29.824 +static MMythUiCommon *
  29.825 +create_video_view(MMythUi * mmyth_ui)
  29.826 +{
  29.827 +
  29.828 +    MMythUiCommon  *ui_common;
  29.829 +
  29.830 +    g_debug("Creating Video UI Common");
  29.831 +
  29.832 +    /*
  29.833 +     * Creates widget to be user by MMythTVPlayer to draw the video 
  29.834 +     */
  29.835 +    mmyth_ui->videow = gtk_drawing_area_new();
  29.836 +    // FIXME: Get the widget size from settings
  29.837 +    gtk_widget_set_size_request(mmyth_ui->videow, 300, 240);
  29.838 +
  29.839 +    // mmiptv_ui->logo = gdk_pixbuf_new_from_file ("logo.png", NULL);
  29.840 +
  29.841 +    // Creates an alignment to place the video widget inside
  29.842 +    mmyth_ui->video_alignment = gtk_alignment_new(0.5, 0.5, 1, 1);
  29.843 +    gtk_widget_hide(mmyth_ui->video_alignment);
  29.844 +
  29.845 +    gtk_container_add(GTK_CONTAINER(mmyth_ui->video_alignment),
  29.846 +                      mmyth_ui->videow);
  29.847 +
  29.848 +    /*
  29.849 +     * Add the gst video widget to hbox. It should never be removed. 
  29.850 +     */
  29.851 +    /*
  29.852 +     * FIXME: mmyth_ui->video_alignment == NULL when mmyth_player_init
  29.853 +     * fails 
  29.854 +     */
  29.855 +    if ((mmyth_ui->main_hbox != NULL)
  29.856 +        && (mmyth_ui->video_alignment != NULL)) {
  29.857 +        gtk_box_pack_start(GTK_BOX(mmyth_ui->main_hbox),
  29.858 +                           mmyth_ui->video_alignment, TRUE, TRUE, 0);
  29.859 +    } else {
  29.860 +        g_warning("[%s] Error while adding video_alignment to main widget",
  29.861 +                  __FUNCTION__);
  29.862 +    }
  29.863 +
  29.864 +    g_object_ref(mmyth_ui->videow);
  29.865 +    g_object_ref(mmyth_ui->video_alignment);
  29.866 +
  29.867 +    ui_common = mmyth_uicommon_new(mmyth_ui->video_alignment,
  29.868 +                                   "  Full\nScreen", "Other\nServices",
  29.869 +                                   "Close");
  29.870 +
  29.871 +
  29.872 +    g_signal_connect(G_OBJECT(ui_common->button1), "clicked",
  29.873 +                     G_CALLBACK(cb_not_impl_button), mmyth_ui);
  29.874 +    g_signal_connect(G_OBJECT(ui_common->button2), "clicked",
  29.875 +                     G_CALLBACK(cb_not_impl_button), mmyth_ui);
  29.876 +    g_signal_connect(G_OBJECT(ui_common->button3), "clicked",
  29.877 +                     G_CALLBACK(cb_video_close_button), mmyth_ui);
  29.878 +
  29.879 +    if (ui_common)
  29.880 +        g_debug("Video UI_Common sucessfull created");
  29.881 +
  29.882 +    return ui_common;
  29.883 +}
  29.884 +
  29.885 +
  29.886 +
  29.887 +GtkWidget      *
  29.888 +mmyth_ui_get_video_widget(MMythUi * mmyth_ui)
  29.889 +{
  29.890 +
  29.891 +    if (mmyth_ui && mmyth_ui->videow) {
  29.892 +
  29.893 +        return mmyth_ui->videow;
  29.894 +    }
  29.895 +
  29.896 +    return NULL;
  29.897 +}
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/maemo-ui-old/src/mmyth_ui.h	Wed Aug 01 14:50:29 2007 +0100
    30.3 @@ -0,0 +1,91 @@
    30.4 +#ifndef MMYTH_UI_H_
    30.5 +#define MMYTH_UI_H_
    30.6 +
    30.7 +#include <gtk/gtk.h>
    30.8 +#include <gst/gst.h>
    30.9 +
   30.10 +#include "config.h"
   30.11 +
   30.12 +#ifdef MAEMO_PLATFORM
   30.13 +#include "hildon-widgets/hildon-program.h"
   30.14 +#include "hildon-widgets/hildon-window.h"
   30.15 +#endif
   30.16 +
   30.17 +#include "mmyth_uicommon.h"
   30.18 +#include "mmyth_recordui.h"
   30.19 +#include "mmyth_schedulerui.h"
   30.20 +#include "mmyth_tvplayer.h"
   30.21 +
   30.22 +/*
   30.23 + * GMyth specific includes 
   30.24 + */
   30.25 +#include <gmyth/gmyth_backendinfo.h>
   30.26 +
   30.27 +typedef struct _MMythUi {
   30.28 +
   30.29 +    /*
   30.30 +     * The main application window 
   30.31 +     */
   30.32 +    GtkWidget      *main_window;
   30.33 +    MMythUiCommon  *current_uicommon;
   30.34 +
   30.35 +    /*
   30.36 +     * Main widget components 
   30.37 +     */
   30.38 +    GtkWidget      *main_hbox;
   30.39 +    GtkWidget      *video_alignment;
   30.40 +    GdkPixbuf      *logo;
   30.41 +
   30.42 +    /*
   30.43 +     * Main widgets grouping 
   30.44 +     */
   30.45 +    MMythUiCommon  *main_uicommon;
   30.46 +    MMythUiCommon  *video_uicommon;
   30.47 +    MMythUiCommon  *epg_grid_uicommon;
   30.48 +    MMythUiCommon  *record_uicommon;
   30.49 +    MMythUiCommon  *schedule_uicommon;
   30.50 +
   30.51 +    GMythBackendInfo *backend_info;
   30.52 +
   30.53 +    GtkWidget      *videow;
   30.54 +    int             idle_id;
   30.55 +    // GstTagList *tagcache;
   30.56 +
   30.57 +    MMythRecordUI  *mmyth_recordui;
   30.58 +    MMythSchedulerUI *mmyth_schedulerui;
   30.59 +
   30.60 +#ifdef MAEMO_PLATFORM
   30.61 +    HildonProgram  *program;
   30.62 +    GtkMenu        *main_menu;
   30.63 +    GtkWidget      *menu_setup;
   30.64 +#endif
   30.65 +
   30.66 +    MMythTVPlayer  *tvplayer;
   30.67 +
   30.68 +} MMythUi;
   30.69 +
   30.70 +GdkPixbuf      *icon_sports,
   30.71 +               *icon_news,
   30.72 +               *icon_movies,
   30.73 +               *icon_shows;
   30.74 +GdkColor        main_bg_color;
   30.75 +
   30.76 +void            mmyth_set_main_widget(MMythUi * mmyth_ui,
   30.77 +                                      MMythUiCommon * new_ui);
   30.78 +// void mmyth_play_selected(GtkButton * button, gpointer user_data);
   30.79 +
   30.80 +#ifdef MAEMO_PLATFORM
   30.81 +MMythUi        *mmyth_ui_initialize(HildonProgram * program,
   30.82 +                                    GtkWidget * main_window);
   30.83 +#else
   30.84 +MMythUi        *mmyth_ui_initialize(GtkWidget * main_window);
   30.85 +#endif
   30.86 +
   30.87 +void            mmyth_ui_finalize(MMythUi * mmyth_ui);
   30.88 +
   30.89 +void            mmyth_ui_set_widget(MMythUi * mmyth_ui,
   30.90 +                                    MMythUiCommon * new_uicommon);
   30.91 +
   30.92 +GtkWidget      *mmyth_ui_get_video_widget(MMythUi * mmyth_ui);
   30.93 +
   30.94 +#endif                          /* MMYTH_UI_H_ */
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/maemo-ui-old/src/mmyth_uicommon.c	Wed Aug 01 14:50:29 2007 +0100
    31.3 @@ -0,0 +1,156 @@
    31.4 +
    31.5 +#include <gtk/gtk.h>
    31.6 +#include <glib.h>
    31.7 +#include <glib/gprintf.h>
    31.8 +
    31.9 +#include "mmyth_uicommon.h"
   31.10 +#include "mmyth_ui.h"
   31.11 +
   31.12 +static void
   31.13 +refresh_time_on_screen(GtkWidget * label)
   31.14 +{
   31.15 +    time_t          real_time;
   31.16 +    struct tm       sched_time;
   31.17 +    GString        *time_showed;
   31.18 +
   31.19 +    time_showed = g_string_new("");
   31.20 +    time(&real_time);
   31.21 +
   31.22 +    if (localtime_r((time_t *) & real_time, &sched_time) == NULL) {
   31.23 +        g_error("localtime_r error in mmyth_epg_grid_view!\n");
   31.24 +        return;
   31.25 +    }
   31.26 +
   31.27 +    g_string_printf(time_showed, "%d:%02d:%02d",
   31.28 +                    sched_time.tm_hour,
   31.29 +                    sched_time.tm_min, sched_time.tm_sec);
   31.30 +
   31.31 +    gtk_label_set_text(GTK_LABEL(label), time_showed->str);
   31.32 +}
   31.33 +
   31.34 +MMythUiCommon  *
   31.35 +mmyth_uicommon_new(GtkWidget * main_widget, const gchar * label1,
   31.36 +                   const gchar * label2, const gchar * label3)
   31.37 +{
   31.38 +
   31.39 +    MMythUiCommon  *ui_common = g_new0(MMythUiCommon, 1);
   31.40 +
   31.41 +    if (!main_widget) {
   31.42 +        g_warning("MMythUICommon created with a NULL main widget\n");
   31.43 +    }
   31.44 +
   31.45 +    ui_common->main_widget = main_widget;
   31.46 +
   31.47 +    ui_common->event_box = gtk_event_box_new();
   31.48 +
   31.49 +    /*
   31.50 +     * Vertical box that divides the control area into two (buttons +
   31.51 +     * clock) 
   31.52 +     */
   31.53 +    ui_common->vbox = gtk_vbox_new(FALSE, 0);   /* spacing */
   31.54 +    gtk_container_set_border_width(GTK_CONTAINER(ui_common->vbox), 4);
   31.55 +
   31.56 +    gtk_container_add(GTK_CONTAINER(ui_common->event_box),
   31.57 +                      ui_common->vbox);
   31.58 +    gtk_widget_modify_bg(ui_common->event_box, GTK_STATE_NORMAL,
   31.59 +                         &main_bg_color);
   31.60 +
   31.61 +    /*
   31.62 +     * Vertical box that divides the control area into four 
   31.63 +     */
   31.64 +    ui_common->button_vbox = gtk_vbox_new(TRUE, 0); /* spacing */
   31.65 +
   31.66 +    gtk_container_set_border_width(GTK_CONTAINER(ui_common->button_vbox),
   31.67 +                                   0);
   31.68 +
   31.69 +    /*
   31.70 +     * The button 1 
   31.71 +     */
   31.72 +    ui_common->button1 = gtk_button_new_with_label(label1);
   31.73 +    gtk_widget_modify_bg(ui_common->button1, GTK_STATE_NORMAL,
   31.74 +                         &main_bg_color);
   31.75 +    gtk_widget_set_size_request(ui_common->button1, BUTTON_WIDTH,
   31.76 +                                BUTTON_HEIGHT);
   31.77 +
   31.78 +    /*
   31.79 +     * The button 2 
   31.80 +     */
   31.81 +    ui_common->button2 = gtk_button_new_with_label(label2);
   31.82 +    gtk_widget_modify_bg(ui_common->button2, GTK_STATE_NORMAL,
   31.83 +                         &main_bg_color);
   31.84 +    gtk_widget_set_size_request(ui_common->button2, BUTTON_WIDTH,
   31.85 +                                BUTTON_HEIGHT);
   31.86 +
   31.87 +    /*
   31.88 +     * The button 3 
   31.89 +     */
   31.90 +    ui_common->button3 = gtk_button_new_with_label(label3);
   31.91 +    gtk_widget_modify_bg(ui_common->button3, GTK_STATE_NORMAL,
   31.92 +                         &main_bg_color);
   31.93 +    gtk_widget_set_size_request(ui_common->button3, BUTTON_WIDTH,
   31.94 +                                BUTTON_HEIGHT);
   31.95 +
   31.96 +    /*
   31.97 +     * The clock label 
   31.98 +     */
   31.99 +    ui_common->label = gtk_label_new("Starting...");
  31.100 +    gtk_widget_show(ui_common->label);
  31.101 +    ui_common->source_id =
  31.102 +        g_timeout_add(500, (GSourceFunc) refresh_time_on_screen,
  31.103 +                      ui_common->label);
  31.104 +
  31.105 +    /*
  31.106 +     * Packing components 
  31.107 +     */
  31.108 +    gtk_box_pack_start(GTK_BOX(ui_common->vbox),
  31.109 +                       ui_common->button_vbox, TRUE, TRUE, 0);
  31.110 +
  31.111 +    gtk_box_pack_start(GTK_BOX(ui_common->vbox),
  31.112 +                       ui_common->label, FALSE, FALSE, 0);
  31.113 +
  31.114 +    gtk_box_pack_start(GTK_BOX(ui_common->button_vbox),
  31.115 +                       ui_common->button1, FALSE, FALSE, 0);
  31.116 +
  31.117 +    gtk_box_pack_start(GTK_BOX(ui_common->button_vbox),
  31.118 +                       ui_common->button2, FALSE, FALSE, 0);
  31.119 +
  31.120 +    gtk_box_pack_start(GTK_BOX(ui_common->button_vbox),
  31.121 +                       ui_common->button3, FALSE, FALSE, 0);
  31.122 +
  31.123 +    gtk_widget_show_all(ui_common->event_box);
  31.124 +
  31.125 +    /*
  31.126 +     * FIXME: mmyth_ui->video_alignment == NULL when mmyth_player_init
  31.127 +     * fails 
  31.128 +     */
  31.129 +    if (ui_common->main_widget != NULL)
  31.130 +        g_object_ref(ui_common->main_widget);
  31.131 +
  31.132 +    g_object_ref(ui_common->vbox);
  31.133 +    g_object_ref(ui_common->button_vbox);
  31.134 +    g_object_ref(ui_common->label);
  31.135 +    g_object_ref(ui_common->button1);
  31.136 +    g_object_ref(ui_common->button2);
  31.137 +    g_object_ref(ui_common->button3);
  31.138 +    g_object_ref(ui_common->event_box);
  31.139 +    return ui_common;
  31.140 +}
  31.141 +
  31.142 +void
  31.143 +mmyth_uicommon_free(MMythUiCommon * ui_common)
  31.144 +{
  31.145 +    g_debug("[%s] Clean uicommon used memory", __FUNCTION__);
  31.146 +
  31.147 +    g_source_remove(ui_common->source_id);
  31.148 +
  31.149 +    g_object_unref(ui_common->main_widget);
  31.150 +    g_object_unref(ui_common->vbox);
  31.151 +    g_object_unref(ui_common->button_vbox);
  31.152 +    g_object_unref(ui_common->label);
  31.153 +    g_object_unref(ui_common->button1);
  31.154 +    g_object_unref(ui_common->button2);
  31.155 +    g_object_unref(ui_common->button3);
  31.156 +    g_object_unref(ui_common->event_box);
  31.157 +
  31.158 +    g_free(ui_common);
  31.159 +}
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/maemo-ui-old/src/mmyth_uicommon.h	Wed Aug 01 14:50:29 2007 +0100
    32.3 @@ -0,0 +1,53 @@
    32.4 +#ifndef MMYTH_UICOMMON_H_
    32.5 +#define MMYTH_UICOMMON_H_
    32.6 +
    32.7 +#include "config.h"
    32.8 +
    32.9 +#include <gtk/gtk.h>
   32.10 +#include <glib.h>
   32.11 +
   32.12 +#ifndef MAEMO_PLATFORM
   32.13 +#define BUTTON_HEIGHT        50
   32.14 +#define BUTTON_WIDTH        100
   32.15 +#else
   32.16 +#define BUTTON_HEIGHT       80
   32.17 +#define BUTTON_WIDTH        150
   32.18 +#endif
   32.19 +
   32.20 +#define MAIN_WINDOW_WIDTH	550
   32.21 +#define MAIN_WINDOW_HEIGHT	250
   32.22 +
   32.23 +#define CHANNELS_DIALOG_WIDTH	300
   32.24 +#define CHANNELS_DIALOG_HEIGHT	200
   32.25 +
   32.26 +#define SETTINGS_DIALOG_WIDTH	300
   32.27 +#define SETTINGS_DIALOG_HEIGHT	120
   32.28 +
   32.29 +extern GdkColor main_bg_color;
   32.30 +
   32.31 +typedef struct _MMythUiCommon {
   32.32 +    GtkWidget      *main_widget;
   32.33 +
   32.34 +    /*
   32.35 +     * event box to set the background color
   32.36 +     */
   32.37 +    GtkWidget      *event_box;
   32.38 +
   32.39 +    GtkWidget      *vbox;
   32.40 +    GtkWidget      *button_vbox;
   32.41 +    GtkWidget      *label;
   32.42 +
   32.43 +    GtkWidget      *button1;
   32.44 +    GtkWidget      *button2;
   32.45 +    GtkWidget      *button3;
   32.46 +
   32.47 +    gint            source_id;
   32.48 +} MMythUiCommon;
   32.49 +
   32.50 +MMythUiCommon  *mmyth_uicommon_new(GtkWidget * main_widget,
   32.51 +                                   const gchar * label1,
   32.52 +                                   const gchar * label2,
   32.53 +                                   const gchar * label3);
   32.54 +void            mmyth_uicommon_free(MMythUiCommon * ui_common);
   32.55 +
   32.56 +#endif                          /* MMYTH_UICOMMON_H_ */
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/maemo-ui-old/src/mmyth_uisettings.c	Wed Aug 01 14:50:29 2007 +0100
    33.3 @@ -0,0 +1,196 @@
    33.4 +#include<gtk/gtk.h>
    33.5 +#include<glib.h>
    33.6 +#include <sys/types.h>
    33.7 +#include <sys/stat.h>
    33.8 +#include <unistd.h>
    33.9 +#include <string.h>
   33.10 +#include <stdio.h>
   33.11 +#include <stdlib.h>
   33.12 +
   33.13 +#include "mmyth_uisettings.h"
   33.14 +
   33.15 +#include <gmyth/gmyth_backendinfo.h>
   33.16 +
   33.17 +static GtkWidget *settings_dialog;
   33.18 +static GtkWidget *entry_hostname;
   33.19 +static GtkWidget *entry_dbname;
   33.20 +static GtkWidget *entry_username;
   33.21 +static GtkWidget *entry_passwd;
   33.22 +static GtkWidget *entry_port;
   33.23 +
   33.24 +static void     settings_dialog_update_data(void);
   33.25 +static GtkWidget *add_entry_to_table(GtkWidget * table,
   33.26 +                                     const gchar * init_str,
   33.27 +                                     guint pos_left, guint pos_right,
   33.28 +                                     guint pos_top, guint pos_bottom);
   33.29 +static GtkWidget *add_label_to_table(GtkWidget * table, const gchar * str,
   33.30 +                                     guint pos_left, guint pos_right,
   33.31 +                                     guint pos_top, guint pos_bottom);
   33.32 +
   33.33 +static GMythBackendInfo *backend_info = NULL;
   33.34 +
   33.35 +gboolean
   33.36 +mmyth_uisettings_run(GtkWindow * main_window)
   33.37 +{
   33.38 +
   33.39 +    GtkWidget      *settings_table;
   33.40 +    GtkWidget      *label_hostname,
   33.41 +                   *label_dbname;
   33.42 +    GtkWidget      *label_username,
   33.43 +                   *label_passwd,
   33.44 +                   *label_port;
   33.45 +
   33.46 +    backend_info = gmyth_backend_info_new_full("localhost", "mythtv",
   33.47 +                                               "mythtv", "mythconverg",
   33.48 +                                               6543);
   33.49 +
   33.50 +    settings_dialog = gtk_dialog_new_with_buttons("Settings",
   33.51 +                                                  main_window,
   33.52 +                                                  GTK_DIALOG_DESTROY_WITH_PARENT,
   33.53 +                                                  GTK_STOCK_OK,
   33.54 +                                                  GTK_RESPONSE_ACCEPT,
   33.55 +                                                  GTK_STOCK_CANCEL,
   33.56 +                                                  GTK_RESPONSE_REJECT,
   33.57 +                                                  NULL);
   33.58 +
   33.59 +    gtk_widget_set_size_request(settings_dialog, 400, 244);
   33.60 +
   33.61 +    /*
   33.62 +     * scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
   33.63 +     * gtk_widget_show (scrolledwindow1); gtk_container_add (GTK_CONTAINER 
   33.64 +     * (window1), scrolledwindow1); gtk_scrolled_window_set_policy
   33.65 +     * (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC,
   33.66 +     * GTK_POLICY_NEVER);
   33.67 +     * 
   33.68 +     * viewport1 = gtk_viewport_new (NULL, NULL); gtk_widget_show
   33.69 +     * (viewport1); gtk_container_add (GTK_CONTAINER (scrolledwindow1),
   33.70 +     * viewport1); gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport1), 
   33.71 +     * GTK_SHADOW_NONE); 
   33.72 +     */
   33.73 +
   33.74 +    // Creates the table and attach it to the settings dialog
   33.75 +    settings_table = gtk_table_new(5, 2, FALSE);
   33.76 +    gtk_widget_show(settings_table);
   33.77 +    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(settings_dialog)->vbox),
   33.78 +                       settings_table, FALSE, TRUE, 0);
   33.79 +    gtk_container_set_border_width(GTK_CONTAINER(settings_table), 3);
   33.80 +    gtk_table_set_row_spacings(GTK_TABLE(settings_table), 5);
   33.81 +    gtk_table_set_col_spacings(GTK_TABLE(settings_table), 10);
   33.82 +
   33.83 +    label_hostname =
   33.84 +        add_label_to_table(settings_table, "Host Name:", 0, 1, 0, 1);
   33.85 +    label_dbname =
   33.86 +        add_label_to_table(settings_table, "Database Name:", 0, 1, 1, 2);
   33.87 +    label_username =
   33.88 +        add_label_to_table(settings_table, "Username:", 0, 1, 2, 3);
   33.89 +    label_passwd =
   33.90 +        add_label_to_table(settings_table, "Password:", 0, 1, 3, 4);
   33.91 +    label_port =
   33.92 +        add_label_to_table(settings_table, "Server port:", 0, 1, 4, 5);
   33.93 +
   33.94 +    entry_hostname = add_entry_to_table(settings_table,
   33.95 +                                        gmyth_backend_info_get_hostname
   33.96 +                                        (backend_info), 1, 2, 0, 1);
   33.97 +    entry_dbname =
   33.98 +        add_entry_to_table(settings_table,
   33.99 +                           gmyth_backend_info_get_db_name(backend_info), 1,
  33.100 +                           2, 1, 2);
  33.101 +    entry_username =
  33.102 +        add_entry_to_table(settings_table,
  33.103 +                           gmyth_backend_info_get_username(backend_info),
  33.104 +                           1, 2, 2, 3);
  33.105 +    entry_passwd =
  33.106 +        add_entry_to_table(settings_table,
  33.107 +                           gmyth_backend_info_get_password(backend_info),
  33.108 +                           1, 2, 3, 4);
  33.109 +
  33.110 +    entry_port =
  33.111 +        add_entry_to_table(settings_table,
  33.112 +                           g_strdup_printf("%d",
  33.113 +                                           gmyth_backend_info_get_port
  33.114 +                                           (backend_info)), 1, 2, 4, 5);
  33.115 +
  33.116 +    if (gtk_dialog_run(GTK_DIALOG(settings_dialog)) == GTK_RESPONSE_ACCEPT) {
  33.117 +        settings_dialog_update_data();
  33.118 +        gtk_widget_destroy(settings_dialog);
  33.119 +        return TRUE;
  33.120 +    }
  33.121 +
  33.122 +    gtk_widget_destroy(settings_dialog);
  33.123 +
  33.124 +    return FALSE;
  33.125 +
  33.126 +}
  33.127 +
  33.128 +static GtkWidget *
  33.129 +add_label_to_table(GtkWidget * table, const gchar * str, guint pos_left,
  33.130 +                   guint pos_right, guint pos_top, guint pos_bottom)
  33.131 +{
  33.132 +    GtkWidget      *tmp_label = gtk_label_new(str);
  33.133 +
  33.134 +    gtk_widget_show(tmp_label);
  33.135 +    gtk_table_attach(GTK_TABLE(table), tmp_label,
  33.136 +                     pos_left, pos_right, pos_top, pos_bottom,
  33.137 +                     (GtkAttachOptions) (GTK_FILL),
  33.138 +                     (GtkAttachOptions) (0), 0, 0);
  33.139 +    gtk_misc_set_alignment(GTK_MISC(tmp_label), 0, 0.5);
  33.140 +
  33.141 +    return tmp_label;
  33.142 +}
  33.143 +
  33.144 +static GtkWidget *
  33.145 +add_entry_to_table(GtkWidget * table, const gchar * init_str,
  33.146 +                   guint pos_left, guint pos_right, guint pos_top,
  33.147 +                   guint pos_bottom)
  33.148 +{
  33.149 +    GtkWidget      *tmp_entry = gtk_entry_new();
  33.150 +    gtk_widget_show(tmp_entry);
  33.151 +    gtk_table_attach(GTK_TABLE(table), tmp_entry,
  33.152 +                     pos_left, pos_right, pos_top, pos_bottom,
  33.153 +                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
  33.154 +                     (GtkAttachOptions) (0), 0, 0);
  33.155 +    if (init_str)
  33.156 +        gtk_entry_set_text(GTK_ENTRY(tmp_entry), init_str);
  33.157 +
  33.158 +    // gtk_entry_set_invisible_char (GTK_ENTRY (entry_port), 9679);
  33.159 +
  33.160 +    return tmp_entry;
  33.161 +}
  33.162 +
  33.163 +static void
  33.164 +settings_dialog_update_data(void)
  33.165 +{
  33.166 +    // GMythSettings *backend_info = gmyth_context_get_settings();
  33.167 +
  33.168 +    if (!backend_info) {
  33.169 +        g_warning
  33.170 +            ("[%s] Could not get GMythSettings instance from context\n",
  33.171 +             __FUNCTION__);
  33.172 +        return;
  33.173 +    }
  33.174 +
  33.175 +    gmyth_backend_info_set_hostname(backend_info,
  33.176 +                                    gtk_entry_get_text(GTK_ENTRY
  33.177 +                                                       (entry_hostname)));
  33.178 +
  33.179 +    gmyth_backend_info_set_db_name(backend_info,
  33.180 +                                   gtk_entry_get_text(GTK_ENTRY
  33.181 +                                                      (entry_dbname)));
  33.182 +
  33.183 +    gmyth_backend_info_set_username(backend_info,
  33.184 +                                    gtk_entry_get_text(GTK_ENTRY
  33.185 +                                                       (entry_username)));
  33.186 +
  33.187 +    gmyth_backend_info_set_password(backend_info,
  33.188 +                                    gtk_entry_get_text(GTK_ENTRY
  33.189 +                                                       (entry_passwd)));
  33.190 +
  33.191 +    gmyth_backend_info_set_port(backend_info,
  33.192 +                                (gint)
  33.193 +                                g_ascii_strtoull(gtk_entry_get_text
  33.194 +                                                 (GTK_ENTRY(entry_port)),
  33.195 +                                                 NULL, 10));
  33.196 +
  33.197 +    // gmyth_backend_info_save (backend_info);
  33.198 +
  33.199 +}
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/maemo-ui-old/src/mmyth_uisettings.h	Wed Aug 01 14:50:29 2007 +0100
    34.3 @@ -0,0 +1,6 @@
    34.4 +#ifndef MMYTH_SETTINGS_H_
    34.5 +#define MMYTH_SETTINGS_H_
    34.6 +
    34.7 +gboolean        mmyth_uisettings_run(GtkWindow * main_window);
    34.8 +
    34.9 +#endif                          /* MMYTH_SETTINGS_H_ */
    35.1 --- a/maemo-ui/AUTHORS	Wed Aug 01 14:22:14 2007 +0100
    35.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.3 @@ -1,4 +0,0 @@
    35.4 -Alexsandro Jose Virginio dos Santos <alexsandro.santos@indt.org.br>
    35.5 -Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
    35.6 -Leonardo Sobral Cunha <leonardo.cunha@indt.org.br>
    35.7 -Rosfran Lins Borges <rosfran.borges@indt.org.br>
    36.1 --- a/maemo-ui/COPYING	Wed Aug 01 14:22:14 2007 +0100
    36.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.3 @@ -1,504 +0,0 @@
    36.4 -		  GNU LESSER GENERAL PUBLIC LICENSE
    36.5 -		       Version 2.1, February 1999
    36.6 -
    36.7 - Copyright (C) 1991, 1999 Free Software Foundation, Inc.
    36.8 -     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    36.9 - Everyone is permitted to copy and distribute verbatim copies
   36.10 - of this license document, but changing it is not allowed.
   36.11 -
   36.12 -[This is the first released version of the Lesser GPL.  It also counts
   36.13 - as the successor of the GNU Library Public License, version 2, hence
   36.14 - the version number 2.1.]
   36.15 -
   36.16 -			    Preamble
   36.17 -
   36.18 -  The licenses for most software are designed to take away your
   36.19 -freedom to share and change it.  By contrast, the GNU General Public
   36.20 -Licenses are intended to guarantee your freedom to share and change
   36.21 -free software--to make sure the software is free for all its users.
   36.22 -
   36.23 -  This license, the Lesser General Public License, applies to some
   36.24 -specially designated software packages--typically libraries--of the
   36.25 -Free Software Foundation and other authors who decide to use it.  You
   36.26 -can use it too, but we suggest you first think carefully about whether
   36.27 -this license or the ordinary General Public License is the better
   36.28 -strategy to use in any particular case, based on the explanations below.
   36.29 -
   36.30 -  When we speak of free software, we are referring to freedom of use,
   36.31 -not price.  Our General Public Licenses are designed to make sure that
   36.32 -you have the freedom to distribute copies of free software (and charge
   36.33 -for this service if you wish); that you receive source code or can get
   36.34 -it if you want it; that you can change the software and use pieces of
   36.35 -it in new free programs; and that you are informed that you can do
   36.36 -these things.
   36.37 -
   36.38 -  To protect your rights, we need to make restrictions that forbid
   36.39 -distributors to deny you these rights or to ask you to surrender these
   36.40 -rights.  These restrictions translate to certain responsibilities for
   36.41 -you if you distribute copies of the library or if you modify it.
   36.42 -
   36.43 -  For example, if you distribute copies of the library, whether gratis
   36.44 -or for a fee, you must give the recipients all the rights that we gave
   36.45 -you.  You must make sure that they, too, receive or can get the source
   36.46 -code.  If you link other code with the library, you must provide
   36.47 -complete object files to the recipients, so that they can relink them
   36.48 -with the library after making changes to the library and recompiling
   36.49 -it.  And you must show them these terms so they know their rights.
   36.50 -
   36.51 -  We protect your rights with a two-step method: (1) we copyright the
   36.52 -library, and (2) we offer you this license, which gives you legal
   36.53 -permission to copy, distribute and/or modify the library.
   36.54 -
   36.55 -  To protect each distributor, we want to make it very clear that
   36.56 -there is no warranty for the free library.  Also, if the library is
   36.57 -modified by someone else and passed on, the recipients should know
   36.58 -that what they have is not the original version, so that the original
   36.59 -author's reputation will not be affected by problems that might be
   36.60 -introduced by others.
   36.61 -
   36.62 -  Finally, software patents pose a constant threat to the existence of
   36.63 -any free program.  We wish to make sure that a company cannot
   36.64 -effectively restrict the users of a free program by obtaining a
   36.65 -restrictive license from a patent holder.  Therefore, we insist that
   36.66 -any patent license obtained for a version of the library must be
   36.67 -consistent with the full freedom of use specified in this license.
   36.68 -
   36.69 -  Most GNU software, including some libraries, is covered by the
   36.70 -ordinary GNU General Public License.  This license, the GNU Lesser
   36.71 -General Public License, applies to certain designated libraries, and
   36.72 -is quite different from the ordinary General Public License.  We use
   36.73 -this license for certain libraries in order to permit linking those
   36.74 -libraries into non-free programs.
   36.75 -
   36.76 -  When a program is linked with a library, whether statically or using
   36.77 -a shared library, the combination of the two is legally speaking a
   36.78 -combined work, a derivative of the original library.  The ordinary
   36.79 -General Public License therefore permits such linking only if the
   36.80 -entire combination fits its criteria of freedom.  The Lesser General
   36.81 -Public License permits more lax criteria for linking other code with
   36.82 -the library.
   36.83 -
   36.84 -  We call this license the "Lesser" General Public License because it
   36.85 -does Less to protect the user's freedom than the ordinary General
   36.86 -Public License.  It also provides other free software developers Less
   36.87 -of an advantage over competing non-free programs.  These disadvantages
   36.88 -are the reason we use the ordinary General Public License for many
   36.89 -libraries.  However, the Lesser license provides advantages in certain
   36.90 -special circumstances.
   36.91 -
   36.92 -  For example, on rare occasions, there may be a special need to
   36.93 -encourage the widest possible use of a certain library, so that it becomes
   36.94 -a de-facto standard.  To achieve this, non-free programs must be
   36.95 -allowed to use the library.  A more frequent case is that a free
   36.96 -library does the same job as widely used non-free libraries.  In this
   36.97 -case, there is little to gain by limiting the free library to free
   36.98 -software only, so we use the Lesser General Public License.
   36.99 -
  36.100 -  In other cases, permission to use a particular library in non-free
  36.101 -programs enables a greater number of people to use a large body of
  36.102 -free software.  For example, permission to use the GNU C Library in
  36.103 -non-free programs enables many more people to use the whole GNU
  36.104 -operating system, as well as its variant, the GNU/Linux operating
  36.105 -system.
  36.106 -
  36.107 -  Although the Lesser General Public License is Less protective of the
  36.108 -users' freedom, it does ensure that the user of a program that is
  36.109 -linked with the Library has the freedom and the wherewithal to run
  36.110 -that program using a modified version of the Library.
  36.111 -
  36.112 -  The precise terms and conditions for copying, distribution and
  36.113 -modification follow.  Pay close attention to the difference between a
  36.114 -"work based on the library" and a "work that uses the library".  The
  36.115 -former contains code derived from the library, whereas the latter must
  36.116 -be combined with the library in order to run.
  36.117 -
  36.118 -		  GNU LESSER GENERAL PUBLIC LICENSE
  36.119 -   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  36.120 -
  36.121 -  0. This License Agreement applies to any software library or other
  36.122 -program which contains a notice placed by the copyright holder or
  36.123 -other authorized party saying it may be distributed under the terms of
  36.124 -this Lesser General Public License (also called "this License").
  36.125 -Each licensee is addressed as "you".
  36.126 -
  36.127 -  A "library" means a collection of software functions and/or data
  36.128 -prepared so as to be conveniently linked with application programs
  36.129 -(which use some of those functions and data) to form executables.
  36.130 -
  36.131 -  The "Library", below, refers to any such software library or work
  36.132 -which has been distributed under these terms.  A "work based on the
  36.133 -Library" means either the Library or any derivative work under
  36.134 -copyright law: that is to say, a work containing the Library or a
  36.135 -portion of it, either verbatim or with modifications and/or translated
  36.136 -straightforwardly into another language.  (Hereinafter, translation is
  36.137 -included without limitation in the term "modification".)
  36.138 -
  36.139 -  "Source code" for a work means the preferred form of the work for
  36.140 -making modifications to it.  For a library, complete source code means
  36.141 -all the source code for all modules it contains, plus any associated
  36.142 -interface definition files, plus the scripts used to control compilation
  36.143 -and installation of the library.
  36.144 -
  36.145 -  Activities other than copying, distribution and modification are not
  36.146 -covered by this License; they are outside its scope.  The act of
  36.147 -running a program using the Library is not restricted, and output from
  36.148 -such a program is covered only if its contents constitute a work based
  36.149 -on the Library (independent of the use of the Library in a tool for
  36.150 -writing it).  Whether that is true depends on what the Library does
  36.151 -and what the program that uses the Library does.
  36.152 -  
  36.153 -  1. You may copy and distribute verbatim copies of the Library's
  36.154 -complete source code as you receive it, in any medium, provided that
  36.155 -you conspicuously and appropriately publish on each copy an
  36.156 -appropriate copyright notice and disclaimer of warranty; keep intact
  36.157 -all the notices that refer to this License and to the absence of any
  36.158 -warranty; and distribute a copy of this License along with the
  36.159 -Library.
  36.160 -
  36.161 -  You may charge a fee for the physical act of transferring a copy,
  36.162 -and you may at your option offer warranty protection in exchange for a
  36.163 -fee.
  36.164 -
  36.165 -  2. You may modify your copy or copies of the Library or any portion
  36.166 -of it, thus forming a work based on the Library, and copy and
  36.167 -distribute such modifications or work under the terms of Section 1
  36.168 -above, provided that you also meet all of these conditions:
  36.169 -
  36.170 -    a) The modified work must itself be a software library.
  36.171 -
  36.172 -    b) You must cause the files modified to carry prominent notices
  36.173 -    stating that you changed the files and the date of any change.
  36.174 -
  36.175 -    c) You must cause the whole of the work to be licensed at no
  36.176 -    charge to all third parties under the terms of this License.
  36.177 -
  36.178 -    d) If a facility in the modified Library refers to a function or a
  36.179 -    table of data to be supplied by an application program that uses
  36.180 -    the facility, other than as an argument passed when the facility
  36.181 -    is invoked, then you must make a good faith effort to ensure that,
  36.182 -    in the event an application does not supply such function or
  36.183 -    table, the facility still operates, and performs whatever part of
  36.184 -    its purpose remains meaningful.
  36.185 -
  36.186 -    (For example, a function in a library to compute square roots has
  36.187 -    a purpose that is entirely well-defined independent of the
  36.188 -    application.  Therefore, Subsection 2d requires that any
  36.189 -    application-supplied function or table used by this function must
  36.190 -    be optional: if the application does not supply it, the square
  36.191 -    root function must still compute square roots.)
  36.192 -
  36.193 -These requirements apply to the modified work as a whole.  If
  36.194 -identifiable sections of that work are not derived from the Library,
  36.195 -and can be reasonably considered independent and separate works in
  36.196 -themselves, then this License, and its terms, do not apply to those
  36.197 -sections when you distribute them as separate works.  But when you
  36.198 -distribute the same sections as part of a whole which is a work based
  36.199 -on the Library, the distribution of the whole must be on the terms of
  36.200 -this License, whose permissions for other licensees extend to the
  36.201 -entire whole, and thus to each and every part regardless of who wrote
  36.202 -it.
  36.203 -
  36.204 -Thus, it is not the intent of this section to claim rights or contest
  36.205 -your rights to work written entirely by you; rather, the intent is to
  36.206 -exercise the right to control the distribution of derivative or
  36.207 -collective works based on the Library.
  36.208 -
  36.209 -In addition, mere aggregation of another work not based on the Library
  36.210 -with the Library (or with a work based on the Library) on a volume of
  36.211 -a storage or distribution medium does not bring the other work under
  36.212 -the scope of this License.
  36.213 -
  36.214 -  3. You may opt to apply the terms of the ordinary GNU General Public
  36.215 -License instead of this License to a given copy of the Library.  To do
  36.216 -this, you must alter all the notices that refer to this License, so
  36.217 -that they refer to the ordinary GNU General Public License, version 2,
  36.218 -instead of to this License.  (If a newer version than version 2 of the
  36.219 -ordinary GNU General Public License has appeared, then you can specify
  36.220 -that version instead if you wish.)  Do not make any other change in
  36.221 -these notices.
  36.222 -
  36.223 -  Once this change is made in a given copy, it is irreversible for
  36.224 -that copy, so the ordinary GNU General Public License applies to all
  36.225 -subsequent copies and derivative works made from that copy.
  36.226 -
  36.227 -  This option is useful when you wish to copy part of the code of
  36.228 -the Library into a program that is not a library.
  36.229 -
  36.230 -  4. You may copy and distribute the Library (or a portion or
  36.231 -derivative of it, under Section 2) in object code or executable form
  36.232 -under the terms of Sections 1 and 2 above provided that you accompany
  36.233 -it with the complete corresponding machine-readable source code, which
  36.234 -must be distributed under the terms of Sections 1 and 2 above on a
  36.235 -medium customarily used for software interchange.
  36.236 -
  36.237 -  If distribution of object code is made by offering access to copy
  36.238 -from a designated place, then offering equivalent access to copy the
  36.239 -source code from the same place satisfies the requirement to
  36.240 -distribute the source code, even though third parties are not
  36.241 -compelled to copy the source along with the object code.
  36.242 -
  36.243 -  5. A program that contains no derivative of any portion of the
  36.244 -Library, but is designed to work with the Library by being compiled or
  36.245 -linked with it, is called a "work that uses the Library".  Such a
  36.246 -work, in isolation, is not a derivative work of the Library, and
  36.247 -therefore falls outside the scope of this License.
  36.248 -
  36.249 -  However, linking a "work that uses the Library" with the Library
  36.250 -creates an executable that is a derivative of the Library (because it
  36.251 -contains portions of the Library), rather than a "work that uses the
  36.252 -library".  The executable is therefore covered by this License.
  36.253 -Section 6 states terms for distribution of such executables.
  36.254 -
  36.255 -  When a "work that uses the Library" uses material from a header file
  36.256 -that is part of the Library, the object code for the work may be a
  36.257 -derivative work of the Library even though the source code is not.
  36.258 -Whether this is true is especially significant if the work can be
  36.259 -linked without the Library, or if the work is itself a library.  The
  36.260 -threshold for this to be true is not precisely defined by law.
  36.261 -
  36.262 -  If such an object file uses only numerical parameters, data
  36.263 -structure layouts and accessors, and small macros and small inline
  36.264 -functions (ten lines or less in length), then the use of the object
  36.265 -file is unrestricted, regardless of whether it is legally a derivative
  36.266 -work.  (Executables containing this object code plus portions of the
  36.267 -Library will still fall under Section 6.)
  36.268 -
  36.269 -  Otherwise, if the work is a derivative of the Library, you may
  36.270 -distribute the object code for the work under the terms of Section 6.
  36.271 -Any executables containing that work also fall under Section 6,
  36.272 -whether or not they are linked directly with the Library itself.
  36.273 -
  36.274 -  6. As an exception to the Sections above, you may also combine or
  36.275 -link a "work that uses the Library" with the Library to produce a
  36.276 -work containing portions of the Library, and distribute that work
  36.277 -under terms of your choice, provided that the terms permit
  36.278 -modification of the work for the customer's own use and reverse
  36.279 -engineering for debugging such modifications.
  36.280 -
  36.281 -  You must give prominent notice with each copy of the work that the
  36.282 -Library is used in it and that the Library and its use are covered by
  36.283 -this License.  You must supply a copy of this License.  If the work
  36.284 -during execution displays copyright notices, you must include the
  36.285 -copyright notice for the Library among them, as well as a reference
  36.286 -directing the user to the copy of this License.  Also, you must do one
  36.287 -of these things:
  36.288 -
  36.289 -    a) Accompany the work with the complete corresponding
  36.290 -    machine-readable source code for the Library including whatever
  36.291 -    changes were used in the work (which must be distributed under
  36.292 -    Sections 1 and 2 above); and, if the work is an executable linked
  36.293 -    with the Library, with the complete machine-readable "work that
  36.294 -    uses the Library", as object code and/or source code, so that the
  36.295 -    user can modify the Library and then relink to produce a modified
  36.296 -    executable containing the modified Library.  (It is understood
  36.297 -    that the user who changes the contents of definitions files in the
  36.298 -    Library will not necessarily be able to recompile the application
  36.299 -    to use the modified definitions.)
  36.300 -
  36.301 -    b) Use a suitable shared library mechanism for linking with the
  36.302 -    Library.  A suitable mechanism is one that (1) uses at run time a
  36.303 -    copy of the library already present on the user's computer system,
  36.304 -    rather than copying library functions into the executable, and (2)
  36.305 -    will operate properly with a modified version of the library, if
  36.306 -    the user installs one, as long as the modified version is
  36.307 -    interface-compatible with the version that the work was made with.
  36.308 -
  36.309 -    c) Accompany the work with a written offer, valid for at
  36.310 -    least three years, to give the same user the materials
  36.311 -    specified in Subsection 6a, above, for a charge no more
  36.312 -    than the cost of performing this distribution.
  36.313 -
  36.314 -    d) If distribution of the work is made by offering access to copy
  36.315 -    from a designated place, offer equivalent access to copy the above
  36.316 -    specified materials from the same place.
  36.317 -
  36.318 -    e) Verify that the user has already received a copy of these
  36.319 -    materials or that you have already sent this user a copy.
  36.320 -
  36.321 -  For an executable, the required form of the "work that uses the
  36.322 -Library" must include any data and utility programs needed for
  36.323 -reproducing the executable from it.  However, as a special exception,
  36.324 -the materials to be distributed need not include anything that is
  36.325 -normally distributed (in either source or binary form) with the major
  36.326 -components (compiler, kernel, and so on) of the operating system on
  36.327 -which the executable runs, unless that component itself accompanies
  36.328 -the executable.
  36.329 -
  36.330 -  It may happen that this requirement contradicts the license
  36.331 -restrictions of other proprietary libraries that do not normally
  36.332 -accompany the operating system.  Such a contradiction means you cannot
  36.333 -use both them and the Library together in an executable that you
  36.334 -distribute.
  36.335 -
  36.336 -  7. You may place library facilities that are a work based on the
  36.337 -Library side-by-side in a single library together with other library
  36.338 -facilities not covered by this License, and distribute such a combined
  36.339 -library, provided that the separate distribution of the work based on
  36.340 -the Library and of the other library facilities is otherwise
  36.341 -permitted, and provided that you do these two things:
  36.342 -
  36.343 -    a) Accompany the combined library with a copy of the same work
  36.344 -    based on the Library, uncombined with any other library
  36.345 -    facilities.  This must be distributed under the terms of the
  36.346 -    Sections above.
  36.347 -
  36.348 -    b) Give prominent notice with the combined library of the fact
  36.349 -    that part of it is a work based on the Library, and explaining
  36.350 -    where to find the accompanying uncombined form of the same work.
  36.351 -
  36.352 -  8. You may not copy, modify, sublicense, link with, or distribute
  36.353 -the Library except as expressly provided under this License.  Any
  36.354 -attempt otherwise to copy, modify, sublicense, link with, or
  36.355 -distribute the Library is void, and will automatically terminate your
  36.356 -rights under this License.  However, parties who have received copies,
  36.357 -or rights, from you under this License will not have their licenses
  36.358 -terminated so long as such parties remain in full compliance.
  36.359 -
  36.360 -  9. You are not required to accept this License, since you have not
  36.361 -signed it.  However, nothing else grants you permission to modify or
  36.362 -distribute the Library or its derivative works.  These actions are
  36.363 -prohibited by law if you do not accept this License.  Therefore, by
  36.364 -modifying or distributing the Library (or any work based on the
  36.365 -Library), you indicate your acceptance of this License to do so, and
  36.366 -all its terms and conditions for copying, distributing or modifying
  36.367 -the Library or works based on it.
  36.368 -
  36.369 -  10. Each time you redistribute the Library (or any work based on the
  36.370 -Library), the recipient automatically receives a license from the
  36.371 -original licensor to copy, distribute, link with or modify the Library
  36.372 -subject to these terms and conditions.  You may not impose any further
  36.373 -restrictions on the recipients' exercise of the rights granted herein.
  36.374 -You are not responsible for enforcing compliance by third parties with
  36.375 -this License.
  36.376 -
  36.377 -  11. If, as a consequence of a court judgment or allegation of patent
  36.378 -infringement or for any other reason (not limited to patent issues),
  36.379 -conditions are imposed on you (whether by court order, agreement or
  36.380 -otherwise) that contradict the conditions of this License, they do not
  36.381 -excuse you from the conditions of this License.  If you cannot
  36.382 -distribute so as to satisfy simultaneously your obligations under this
  36.383 -License and any other pertinent obligations, then as a consequence you
  36.384 -may not distribute the Library at all.  For example, if a patent
  36.385 -license would not permit royalty-free redistribution of the Library by
  36.386 -all those who receive copies directly or indirectly through you, then
  36.387 -the only way you could satisfy both it and this License would be to
  36.388 -refrain entirely from distribution of the Library.
  36.389 -
  36.390 -If any portion of this section is held invalid or unenforceable under any
  36.391 -particular circumstance, the balance of the section is intended to apply,
  36.392 -and the section as a whole is intended to apply in other circumstances.
  36.393 -
  36.394 -It is not the purpose of this section to induce you to infringe any
  36.395 -patents or other property right claims or to contest validity of any
  36.396 -such claims; this section has the sole purpose of protecting the
  36.397 -integrity of the free software distribution system which is
  36.398 -implemented by public license practices.  Many people have made
  36.399 -generous contributions to the wide range of software distributed
  36.400 -through that system in reliance on consistent application of that
  36.401 -system; it is up to the author/donor to decide if he or she is willing
  36.402 -to distribute software through any other system and a licensee cannot
  36.403 -impose that choice.
  36.404 -
  36.405 -This section is intended to make thoroughly clear what is believed to
  36.406 -be a consequence of the rest of this License.
  36.407 -
  36.408 -  12. If the distribution and/or use of the Library is restricted in
  36.409 -certain countries either by patents or by copyrighted interfaces, the
  36.410 -original copyright holder who places the Library under this License may add
  36.411 -an explicit geographical distribution limitation excluding those countries,
  36.412 -so that distribution is permitted only in or among countries not thus
  36.413 -excluded.  In such case, this License incorporates the limitation as if
  36.414 -written in the body of this License.
  36.415 -
  36.416 -  13. The Free Software Foundation may publish revised and/or new
  36.417 -versions of the Lesser General Public License from time to time.
  36.418 -Such new versions will be similar in spirit to the present version,
  36.419 -but may differ in detail to address new problems or concerns.
  36.420 -
  36.421 -Each version is given a distinguishing version number.  If the Library
  36.422 -specifies a version number of this License which applies to it and
  36.423 -"any later version", you have the option of following the terms and
  36.424 -conditions either of that version or of any later version published by
  36.425 -the Free Software Foundation.  If the Library does not specify a
  36.426 -license version number, you may choose any version ever published by
  36.427 -the Free Software Foundation.
  36.428 -
  36.429 -  14. If you wish to incorporate parts of the Library into other free
  36.430 -programs whose distribution conditions are incompatible with these,
  36.431 -write to the author to ask for permission.  For software which is
  36.432 -copyrighted by the Free Software Foundation, write to the Free
  36.433 -Software Foundation; we sometimes make exceptions for this.  Our
  36.434 -decision will be guided by the two goals of preserving the free status
  36.435 -of all derivatives of our free software and of promoting the sharing
  36.436 -and reuse of software generally.
  36.437 -
  36.438 -			    NO WARRANTY
  36.439 -
  36.440 -  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
  36.441 -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
  36.442 -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
  36.443 -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
  36.444 -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
  36.445 -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  36.446 -PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
  36.447 -LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
  36.448 -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  36.449 -
  36.450 -  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  36.451 -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
  36.452 -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
  36.453 -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
  36.454 -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
  36.455 -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
  36.456 -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
  36.457 -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
  36.458 -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
  36.459 -DAMAGES.
  36.460 -
  36.461 -		     END OF TERMS AND CONDITIONS
  36.462 -
  36.463 -           How to Apply These Terms to Your New Libraries
  36.464 -
  36.465 -  If you develop a new library, and you want it to be of the greatest
  36.466 -possible use to the public, we recommend making it free software that
  36.467 -everyone can redistribute and change.  You can do so by permitting
  36.468 -redistribution under these terms (or, alternatively, under the terms of the
  36.469 -ordinary General Public License).
  36.470 -
  36.471 -  To apply these terms, attach the following notices to the library.  It is
  36.472 -safest to attach them to the start of each source file to most effectively
  36.473 -convey the exclusion of warranty; and each file should have at least the
  36.474 -"copyright" line and a pointer to where the full notice is found.
  36.475 -
  36.476 -    <one line to give the library's name and a brief idea of what it does.>
  36.477 -    Copyright (C) <year>  <name of author>
  36.478 -
  36.479 -    This library is free software; you can redistribute it and/or
  36.480 -    modify it under the terms of the GNU Lesser General Public
  36.481 -    License as published by the Free Software Foundation; either
  36.482 -    version 2.1 of the License, or (at your option) any later version.
  36.483 -
  36.484 -    This library is distributed in the hope that it will be useful,
  36.485 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
  36.486 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  36.487 -    Lesser General Public License for more details.
  36.488 -
  36.489 -    You should have received a copy of the GNU Lesser General Public
  36.490 -    License along with this library; if not, write to the Free Software
  36.491 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  36.492 -
  36.493 -Also add information on how to contact you by electronic and paper mail.
  36.494 -
  36.495 -You should also get your employer (if you work as a programmer) or your
  36.496 -school, if any, to sign a "copyright disclaimer" for the library, if
  36.497 -necessary.  Here is a sample; alter the names:
  36.498 -
  36.499 -  Yoyodyne, Inc., hereby disclaims all copyright interest in the
  36.500 -  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
  36.501 -
  36.502 -  <signature of Ty Coon>, 1 April 1990
  36.503 -  Ty Coon, President of Vice
  36.504 -
  36.505 -That's all there is to it!
  36.506 -
  36.507 -
    37.1 --- a/maemo-ui/ChangeLog	Wed Aug 01 14:22:14 2007 +0100
    37.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.3 @@ -1,24 +0,0 @@
    37.4 -2006-08-17 Rosfran Borges <rosfran.borges@indt.org.br>
    37.5 -	* Added the correct gstreamer-base package (GSTBASE) at the configure.ac; 
    37.6 -	GSTBASE_CFLAGS and GSTBASE_LIBS variables had the same values from
    37.7 -	the GST_CFLAGS/GST_LIBS.
    37.8 -
    37.9 -2006-08-16 Rosfran Borges <rosfran.borges@indt.org.br>
   37.10 -	* Fixed some installation issues, regarding lib-installing to the
   37.11 -	correct directory, and copying the header files to the destination
   37.12 -	dir (make install).
   37.13 -	* Put 'pkg-config' resource to the Maemo Myth library. The name of the
   37.14 -	PKG-CONFIG resource is 'maemo-myth', plus the minor and major version.
   37.15 -	Actually, the version is '0.1', so the library config file is:  
   37.16 -	'maemo-myth-0.1.pc'. You can type: 'pkg-config --cflags --libs 
   37.17 -	maemo-myth-0.1'.
   37.18 -	* Many adjustments in the automake/autoconf configuration files
   37.19 -	(configure.ac, Makefile.am) - some autotools misusage fixed.
   37.20 -	* Added the MythURI structure, and the URI parsing utility functions
   37.21 -	(missing in the GLib).
   37.22 -	* Some functions were exported (myth_socket, mmyth_context), that's 
   37.23 -	why many ther modules need to use them.
   37.24 -	* Fixed some library dependencies.
   37.25 -	* Prepared to be used inside the GStreamer (linking with the MythTV
   37.26 -	plug-in).
   37.27 -
    38.1 --- a/maemo-ui/INSTALL	Wed Aug 01 14:22:14 2007 +0100
    38.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.3 @@ -1,236 +0,0 @@
    38.4 -Installation Instructions
    38.5 -*************************
    38.6 -
    38.7 -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
    38.8 -Software Foundation, Inc.
    38.9 -
   38.10 -This file is free documentation; the Free Software Foundation gives
   38.11 -unlimited permission to copy, distribute and modify it.
   38.12 -
   38.13 -Basic Installation
   38.14 -==================
   38.15 -
   38.16 -These are generic installation instructions.
   38.17 -
   38.18 -   The `configure' shell script attempts to guess correct values for
   38.19 -various system-dependent variables used during compilation.  It uses
   38.20 -those values to create a `Makefile' in each directory of the package.
   38.21 -It may also create one or more `.h' files containing system-dependent
   38.22 -definitions.  Finally, it creates a shell script `config.status' that
   38.23 -you can run in the future to recreate the current configuration, and a
   38.24 -file `config.log' containing compiler output (useful mainly for
   38.25 -debugging `configure').
   38.26 -
   38.27 -   It can also use an optional file (typically called `config.cache'
   38.28 -and enabled with `--cache-file=config.cache' or simply `-C') that saves
   38.29 -the results of its tests to speed up reconfiguring.  (Caching is
   38.30 -disabled by default to prevent problems with accidental use of stale
   38.31 -cache files.)
   38.32 -
   38.33 -   If you need to do unusual things to compile the package, please try
   38.34 -to figure out how `configure' could check whether to do them, and mail
   38.35 -diffs or instructions to the address given in the `README' so they can
   38.36 -be considered for the next release.  If you are using the cache, and at
   38.37 -some point `config.cache' contains results you don't want to keep, you
   38.38 -may remove or edit it.
   38.39 -
   38.40 -   The file `configure.ac' (or `configure.in') is used to create
   38.41 -`configure' by a program called `autoconf'.  You only need
   38.42 -`configure.ac' if you want to change it or regenerate `configure' using
   38.43 -a newer version of `autoconf'.
   38.44 -
   38.45 -The simplest way to compile this package is:
   38.46 -
   38.47 -  1. `cd' to the directory containing the package's source code and type
   38.48 -     `./configure' to configure the package for your system.  If you're
   38.49 -     using `csh' on an old version of System V, you might need to type
   38.50 -     `sh ./configure' instead to prevent `csh' from trying to execute
   38.51 -     `configure' itself.
   38.52 -
   38.53 -     Running `configure' takes awhile.  While running, it prints some
   38.54 -     messages telling which features it is checking for.
   38.55 -
   38.56 -  2. Type `make' to compile the package.
   38.57 -
   38.58 -  3. Optionally, type `make check' to run any self-tests that come with
   38.59 -     the package.
   38.60 -
   38.61 -  4. Type `make install' to install the programs and any data files and
   38.62 -     documentation.
   38.63 -
   38.64 -  5. You can remove the program binaries and object files from the
   38.65 -     source code directory by typing `make clean'.  To also remove the
   38.66 -     files that `configure' created (so you can compile the package for
   38.67 -     a different kind of computer), type `make distclean'.  There is
   38.68 -     also a `make maintainer-clean' target, but that is intended mainly
   38.69 -     for the package's developers.  If you use it, you may have to get
   38.70 -     all sorts of other programs in order to regenerate files that came
   38.71 -     with the distribution.
   38.72 -
   38.73 -Compilers and Options
   38.74 -=====================
   38.75 -
   38.76 -Some systems require unusual options for compilation or linking that the
   38.77 -`configure' script does not know about.  Run `./configure --help' for
   38.78 -details on some of the pertinent environment variables.
   38.79 -
   38.80 -   You can give `configure' initial values for configuration parameters
   38.81 -by setting variables in the command line or in the environment.  Here
   38.82 -is an example:
   38.83 -
   38.84 -     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
   38.85 -
   38.86 -   *Note Defining Variables::, for more details.
   38.87 -
   38.88 -Compiling For Multiple Architectures
   38.89 -====================================
   38.90 -
   38.91 -You can compile the package for more than one kind of computer at the
   38.92 -same time, by placing the object files for each architecture in their
   38.93 -own directory.  To do this, you must use a version of `make' that
   38.94 -supports the `VPATH' variable, such as GNU `make'.  `cd' to the
   38.95 -directory where you want the object files and executables to go and run
   38.96 -the `configure' script.  `configure' automatically checks for the
   38.97 -source code in the directory that `configure' is in and in `..'.
   38.98 -
   38.99 -   If you have to use a `make' that does not support the `VPATH'
  38.100 -variable, you have to compile the package for one architecture at a
  38.101 -time in the source code directory.  After you have installed the
  38.102 -package for one architecture, use `make distclean' before reconfiguring
  38.103 -for another architecture.
  38.104 -
  38.105 -Installation Names
  38.106 -==================
  38.107 -
  38.108 -By default, `make install' installs the package's commands under
  38.109 -`/usr/local/bin', include files under `/usr/local/include', etc.  You
  38.110 -can specify an installation prefix other than `/usr/local' by giving
  38.111 -`configure' the option `--prefix=PREFIX'.
  38.112 -
  38.113 -   You can specify separate installation prefixes for
  38.114 -architecture-specific files and architecture-independent files.  If you
  38.115 -pass the option `--exec-prefix=PREFIX' to `configure', the package uses
  38.116 -PREFIX as the prefix for installing programs and libraries.
  38.117 -Documentation and other data files still use the regular prefix.
  38.118 -
  38.119 -   In addition, if you use an unusual directory layout you can give
  38.120 -options like `--bindir=DIR' to specify different values for particular
  38.121 -kinds of files.  Run `configure --help' for a list of the directories
  38.122 -you can set and what kinds of files go in them.
  38.123 -
  38.124 -   If the package supports it, you can cause programs to be installed
  38.125 -with an extra prefix or suffix on their names by giving `configure' the
  38.126 -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
  38.127 -
  38.128 -Optional Features
  38.129 -=================
  38.130 -
  38.131 -Some packages pay attention to `--enable-FEATURE' options to
  38.132 -`configure', where FEATURE indicates an optional part of the package.
  38.133 -They may also pay attention to `--with-PACKAGE' options, where PACKAGE
  38.134 -is something like `gnu-as' or `x' (for the X Window System).  The
  38.135 -`README' should mention any `--enable-' and `--with-' options that the
  38.136 -package recognizes.
  38.137 -
  38.138 -   For packages that use the X Window System, `configure' can usually
  38.139 -find the X include and library files automatically, but if it doesn't,
  38.140 -you can use the `configure' options `--x-includes=DIR' and
  38.141 -`--x-libraries=DIR' to specify their locations.
  38.142 -
  38.143 -Specifying the System Type
  38.144 -==========================
  38.145 -
  38.146 -There may be some features `configure' cannot figure out automatically,
  38.147 -but needs to determine by the type of machine the package will run on.
  38.148 -Usually, assuming the package is built to be run on the _same_
  38.149 -architectures, `configure' can figure that out, but if it prints a
  38.150 -message saying it cannot guess the machine type, give it the
  38.151 -`--build=TYPE' option.  TYPE can either be a short name for the system
  38.152 -type, such as `sun4', or a canonical name which has the form:
  38.153 -
  38.154 -     CPU-COMPANY-SYSTEM
  38.155 -
  38.156 -where SYSTEM can have one of these forms:
  38.157 -
  38.158 -     OS KERNEL-OS
  38.159 -
  38.160 -   See the file `config.sub' for the possible values of each field.  If
  38.161 -`config.sub' isn't included in this package, then this package doesn't
  38.162 -need to know the machine type.
  38.163 -
  38.164 -   If you are _building_ compiler tools for cross-compiling, you should
  38.165 -use the option `--target=TYPE' to select the type of system they will
  38.166 -produce code for.
  38.167 -
  38.168 -   If you want to _use_ a cross compiler, that generates code for a
  38.169 -platform different from the build platform, you should specify the
  38.170 -"host" platform (i.e., that on which the generated programs will
  38.171 -eventually be run) with `--host=TYPE'.
  38.172 -
  38.173 -Sharing Defaults
  38.174 -================
  38.175 -
  38.176 -If you want to set default values for `configure' scripts to share, you
  38.177 -can create a site shell script called `config.site' that gives default
  38.178 -values for variables like `CC', `cache_file', and `prefix'.
  38.179 -`configure' looks for `PREFIX/share/config.site' if it exists, then
  38.180 -`PREFIX/etc/config.site' if it exists.  Or, you can set the
  38.181 -`CONFIG_SITE' environment variable to the location of the site script.
  38.182 -A warning: not all `configure' scripts look for a site script.
  38.183 -
  38.184 -Defining Variables
  38.185 -==================
  38.186 -
  38.187 -Variables not defined in a site shell script can be set in the
  38.188 -environment passed to `configure'.  However, some packages may run
  38.189 -configure again during the build, and the customized values of these
  38.190 -variables may be lost.  In order to avoid this problem, you should set
  38.191 -them in the `configure' command line, using `VAR=value'.  For example:
  38.192 -
  38.193 -     ./configure CC=/usr/local2/bin/gcc
  38.194 -
  38.195 -causes the specified `gcc' to be used as the C compiler (unless it is
  38.196 -overridden in the site shell script).  Here is a another example:
  38.197 -
  38.198 -     /bin/bash ./configure CONFIG_SHELL=/bin/bash
  38.199 -
  38.200 -Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
  38.201 -configuration-related scripts to be executed by `/bin/bash'.
  38.202 -
  38.203 -`configure' Invocation
  38.204 -======================
  38.205 -
  38.206 -`configure' recognizes the following options to control how it operates.
  38.207 -
  38.208 -`--help'
  38.209 -`-h'
  38.210 -     Print a summary of the options to `configure', and exit.
  38.211 -
  38.212 -`--version'
  38.213 -`-V'
  38.214 -     Print the version of Autoconf used to generate the `configure'
  38.215 -     script, and exit.
  38.216 -
  38.217 -`--cache-file=FILE'
  38.218 -     Enable the cache: use and save the results of the tests in FILE,
  38.219 -     traditionally `config.cache'.  FILE defaults to `/dev/null' to
  38.220 -     disable caching.
  38.221 -
  38.222 -`--config-cache'
  38.223 -`-C'
  38.224 -     Alias for `--cache-file=config.cache'.
  38.225 -
  38.226 -`--quiet'
  38.227 -`--silent'
  38.228 -`-q'
  38.229 -     Do not print messages saying which checks are being made.  To
  38.230 -     suppress all normal output, redirect it to `/dev/null' (any error
  38.231 -     messages will still be shown).
  38.232 -
  38.233 -`--srcdir=DIR'
  38.234 -     Look for the package's source code in directory DIR.  Usually
  38.235 -     `configure' can determine that directory automatically.
  38.236 -
  38.237 -`configure' also accepts some other, not widely useful, options.  Run
  38.238 -`configure --help' for more details.
  38.239 -
    39.1 --- a/maemo-ui/Makefile.am	Wed Aug 01 14:22:14 2007 +0100
    39.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.3 @@ -1,8 +0,0 @@
    39.4 -SUBDIRS= src pixmaps
    39.5 -
    39.6 -EXTRA_DIST =                            \
    39.7 -        autogen.sh                      \
    39.8 -        AUTHORS                         \
    39.9 -        COPYING                         \
   39.10 -        README
   39.11 -
    40.1 --- a/maemo-ui/autogen.sh	Wed Aug 01 14:22:14 2007 +0100
    40.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.3 @@ -1,99 +0,0 @@
    40.4 -#!/bin/sh
    40.5 -# Run this to generate all the initial makefiles, etc.
    40.6 -
    40.7 -DIE=0
    40.8 -package=gmyth
    40.9 -srcfile=configure.ac
   40.10 -
   40.11 -# a quick cvs co if necessary to alleviate the pain - may remove this
   40.12 -# when developers get a clue ;)
   40.13 -if test ! -d common; 
   40.14 -then 
   40.15 -  echo "+ getting common/ from svn"
   40.16 - svn co common 
   40.17 -fi
   40.18 -
   40.19 -# source helper functions
   40.20 -if test ! -f common/autogen-helper.sh;
   40.21 -then
   40.22 -  echo There is something wrong with your source tree.
   40.23 -  echo You are missing common/autogen-helper.sh
   40.24 -  exit 1
   40.25 -fi
   40.26 -. common/autogen-helper.sh
   40.27 -
   40.28 -CONFIGURE_DEF_OPT='--enable-maintainer-mode'
   40.29 -
   40.30 -autogen_options 
   40.31 -
   40.32 -echo -n "+ check for build tools"
   40.33 -if test ! -z "$NOCHECK"; then echo " skipped"; else  echo; fi
   40.34 -version_check "autoconf" "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53" \
   40.35 -              "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 53 || DIE=1
   40.36 -version_check "automake" "$AUTOMAKE automake automake-1.9 automake-1.8 automake-1.7 automake-1.6" \
   40.37 -              "ftp://ftp.gnu.org/pub/gnu/automake/" 1 6 || DIE=1
   40.38 -version_check "libtoolize" "$LIBTOOLIZE libtoolize" \
   40.39 -              "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1
   40.40 -version_check "pkg-config" "" \
   40.41 -              "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
   40.42 -
   40.43 -die_check $DIE
   40.44 -
   40.45 -aclocal_check || DIE=1
   40.46 -autoheader_check || DIE=1
   40.47 -
   40.48 -die_check $DIE
   40.49 -
   40.50 -# if no arguments specified then this will be printed
   40.51 -if test -z "$*"; then
   40.52 -  echo "+ checking for autogen.sh options"
   40.53 -  echo "  This autogen script will automatically run ./configure as:"
   40.54 -  echo "  ./configure $CONFIGURE_DEF_OPT"
   40.55 -  echo "  To pass any additional options, please specify them on the $0"
   40.56 -  echo "  command line."
   40.57 -fi
   40.58 -
   40.59 -toplevel_check $srcfile
   40.60 -
   40.61 -tool_run "$aclocal" "-I m4 $ACLOCAL_FLAGS"
   40.62 -tool_run "$libtoolize" "--copy --force"
   40.63 -tool_run "$autoheader"
   40.64 -
   40.65 -# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
   40.66 -echo timestamp > stamp-h.in 2> /dev/null
   40.67 -
   40.68 -tool_run "$autoconf"
   40.69 -tool_run "$automake" "-a -c"
   40.70 -
   40.71 -# if enable exists, add an -enable option for each of the lines in that file
   40.72 -if test -f enable; then
   40.73 -  for a in `cat enable`; do
   40.74 -    CONFIGURE_FILE_OPT="--enable-$a"
   40.75 -  done
   40.76 -fi
   40.77 -
   40.78 -# if disable exists, add an -disable option for each of the lines in that file
   40.79 -if test -f disable; then
   40.80 -  for a in `cat disable`; do
   40.81 -    CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a"
   40.82 -  done
   40.83 -fi
   40.84 -
   40.85 -test -n "$NOCONFIGURE" && {
   40.86 -  echo "+ skipping configure stage for package $package, as requested."
   40.87 -  echo "+ autogen.sh done."
   40.88 -  exit 0
   40.89 -}
   40.90 -
   40.91 -echo "+ running configure ... "
   40.92 -test ! -z "$CONFIGURE_DEF_OPT" && echo "  ./configure default flags: $CONFIGURE_DEF_OPT"
   40.93 -test ! -z "$CONFIGURE_EXT_OPT" && echo "  ./configure external flags: $CONFIGURE_EXT_OPT"
   40.94 -test ! -z "$CONFIGURE_FILE_OPT" && echo "  ./configure enable/disable flags: $CONFIGURE_FILE_OPT"
   40.95 -echo
   40.96 -
   40.97 -./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || {
   40.98 -        echo "  configure failed"
   40.99 -        exit 1
  40.100 -}
  40.101 -
  40.102 -echo "Now type 'make' to compile $package."
    41.1 --- a/maemo-ui/common/Makefile.am	Wed Aug 01 14:22:14 2007 +0100
    41.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.3 @@ -1,1 +0,0 @@
    41.4 -EXTRA_DIST = autogen-helper.sh
    42.1 --- a/maemo-ui/common/autogen-helper.sh	Wed Aug 01 14:22:14 2007 +0100
    42.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.3 @@ -1,302 +0,0 @@
    42.4 -# a silly hack that generates autoregen.sh but it's handy
    42.5 -echo "#!/bin/sh" > autoregen.sh
    42.6 -echo "./autogen.sh $@ \$@" >> autoregen.sh
    42.7 -chmod +x autoregen.sh
    42.8 -
    42.9 -# helper functions for autogen.sh
   42.10 -
   42.11 -debug ()
   42.12 -# print out a debug message if DEBUG is a defined variable
   42.13 -{
   42.14 -  if test ! -z "$DEBUG"
   42.15 -  then
   42.16 -    echo "DEBUG: $1"
   42.17 -  fi
   42.18 -}
   42.19 -
   42.20 -version_check ()
   42.21 -# check the version of a package
   42.22 -# first argument : package name (executable)
   42.23 -# second argument : optional path where to look for it instead
   42.24 -# third argument : source download url
   42.25 -# rest of arguments : major, minor, micro version
   42.26 -# all consecutive ones : suggestions for binaries to use
   42.27 -# (if not specified in second argument)
   42.28 -{
   42.29 -  PACKAGE=$1
   42.30 -  PKG_PATH=$2
   42.31 -  URL=$3
   42.32 -  MAJOR=$4
   42.33 -  MINOR=$5
   42.34 -  MICRO=$6
   42.35 -
   42.36 -  # for backwards compatibility, we let PKG_PATH=PACKAGE when PKG_PATH null
   42.37 -  if test -z "$PKG_PATH"; then PKG_PATH=$PACKAGE; fi
   42.38 -  debug "major $MAJOR minor $MINOR micro $MICRO"
   42.39 -  VERSION=$MAJOR
   42.40 -  if test ! -z "$MINOR"; then VERSION=$VERSION.$MINOR; else MINOR=0; fi
   42.41 -  if test ! -z "$MICRO"; then VERSION=$VERSION.$MICRO; else MICRO=0; fi
   42.42 -
   42.43 -  debug "major $MAJOR minor $MINOR micro $MICRO"
   42.44 -  
   42.45 -  for SUGGESTION in $PKG_PATH; do 
   42.46 -    COMMAND="$SUGGESTION"
   42.47 -
   42.48 -    # don't check if asked not to
   42.49 -    test -z "$NOCHECK" && {
   42.50 -      echo -n "  checking for $COMMAND >= $VERSION ... "
   42.51 -    } || {
   42.52 -      # we set a var with the same name as the package, but stripped of
   42.53 -      # unwanted chars
   42.54 -      VAR=`echo $PACKAGE | sed 's/-//g'`
   42.55 -      debug "setting $VAR"
   42.56 -      eval $VAR="$COMMAND"
   42.57 -      return 0
   42.58 -    }
   42.59 -
   42.60 -    debug "checking version with $COMMAND"
   42.61 -    ($COMMAND --version) < /dev/null > /dev/null 2>&1 || 
   42.62 -    {
   42.63 -      echo "not found."
   42.64 -      continue
   42.65 -    }
   42.66 -    # strip everything that's not a digit, then use cut to get the first field
   42.67 -    pkg_version=`$COMMAND --version|head -n 1|sed 's/^[^0-9]*//'|cut -d' ' -f1`
   42.68 -    debug "pkg_version $pkg_version"
   42.69 -    # remove any non-digit characters from the version numbers to permit numeric
   42.70 -    # comparison
   42.71 -    pkg_major=`echo $pkg_version | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
   42.72 -    pkg_minor=`echo $pkg_version | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
   42.73 -    pkg_micro=`echo $pkg_version | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
   42.74 -    test -z "$pkg_major" && pkg_major=0
   42.75 -    test -z "$pkg_minor" && pkg_minor=0
   42.76 -    test -z "$pkg_micro" && pkg_micro=0
   42.77 -    debug "found major $pkg_major minor $pkg_minor micro $pkg_micro"
   42.78 -
   42.79 -    #start checking the version
   42.80 -    debug "version check"
   42.81 -
   42.82 -    # reset check
   42.83 -    WRONG=
   42.84 -
   42.85 -    if [ ! "$pkg_major" -gt "$MAJOR" ]; then
   42.86 -      debug "major: $pkg_major <= $MAJOR"
   42.87 -      if [ "$pkg_major" -lt "$MAJOR" ]; then
   42.88 -        debug "major: $pkg_major < $MAJOR"
   42.89 -        WRONG=1
   42.90 -      elif [ ! "$pkg_minor" -gt "$MINOR" ]; then
   42.91 -        debug "minor: $pkg_minor <= $MINOR"
   42.92 -        if [ "$pkg_minor" -lt "$MINOR" ]; then
   42.93 -          debug "minor: $pkg_minor < $MINOR"
   42.94 -          WRONG=1
   42.95 -        elif [ "$pkg_micro" -lt "$MICRO" ]; then
   42.96 -          debug "micro: $pkg_micro < $MICRO"
   42.97 -	  WRONG=1
   42.98 -        fi
   42.99 -      fi
  42.100 -    fi
  42.101 -
  42.102 -    if test ! -z "$WRONG"; then
  42.103 -      echo "found $pkg_version, not ok !"
  42.104 -      continue
  42.105 -    else
  42.106 -      echo "found $pkg_version, ok."
  42.107 -      # we set a var with the same name as the package, but stripped of
  42.108 -      # unwanted chars
  42.109 -      VAR=`echo $PACKAGE | sed 's/-//g'`
  42.110 -      debug "setting $VAR"
  42.111 -      eval $VAR="$COMMAND"
  42.112 -      return 0
  42.113 -    fi
  42.114 -  done
  42.115 -
  42.116 -  echo "not found !"
  42.117 -  echo "You must have $PACKAGE installed to compile $package."
  42.118 -  echo "Download the appropriate package for your distribution,"
  42.119 -  echo "or get the source tarball at $URL"
  42.120 -  return 1;
  42.121 -}
  42.122 -
  42.123 -aclocal_check ()
  42.124 -{
  42.125 -  # normally aclocal is part of automake
  42.126 -  # so we expect it to be in the same place as automake
  42.127 -  # so if a different automake is supplied, we need to adapt as well
  42.128 -  # so how's about replacing automake with aclocal in the set var,
  42.129 -  # and saving that in $aclocal ?
  42.130 -  # note, this will fail if the actual automake isn't called automake*
  42.131 -  # or if part of the path before it contains it
  42.132 -  if [ -z "$automake" ]; then
  42.133 -    echo "Error: no automake variable set !"
  42.134 -    return 1
  42.135 -  else
  42.136 -    aclocal=`echo $automake | sed s/automake/aclocal/`
  42.137 -    debug "aclocal: $aclocal"
  42.138 -    if [ "$aclocal" != "aclocal" ];
  42.139 -    then
  42.140 -      CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-aclocal=$aclocal"
  42.141 -    fi
  42.142 -    if [ ! -x `which $aclocal` ]; then
  42.143 -      echo "Error: cannot execute $aclocal !"
  42.144 -      return 1
  42.145 -    fi
  42.146 -  fi
  42.147 -}
  42.148 -
  42.149 -autoheader_check ()
  42.150 -{
  42.151 -  # same here - autoheader is part of autoconf
  42.152 -  # use the same voodoo
  42.153 -  if [ -z "$autoconf" ]; then
  42.154 -    echo "Error: no autoconf variable set !"
  42.155 -    return 1
  42.156 -  else
  42.157 -    autoheader=`echo $autoconf | sed s/autoconf/autoheader/`
  42.158 -    debug "autoheader: $autoheader"
  42.159 -    if [ "$autoheader" != "autoheader" ];
  42.160 -    then
  42.161 -      CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoheader=$autoheader"
  42.162 -    fi
  42.163 -    if [ ! -x `which $autoheader` ]; then
  42.164 -      echo "Error: cannot execute $autoheader !"
  42.165 -      return 1
  42.166 -    fi
  42.167 -  fi
  42.168 -
  42.169 -}
  42.170 -
  42.171 -autoconf_2_52d_check ()
  42.172 -{
  42.173 -  # autoconf 2.52d has a weird issue involving a yes:no error
  42.174 -  # so don't allow it's use
  42.175 -  test -z "$NOCHECK" && {
  42.176 -    ac_version=`$autoconf --version|head -n 1|sed 's/^[a-zA-Z\.\ ()]*//;s/ .*$//'`
  42.177 -    if test "$ac_version" = "2.52d"; then
  42.178 -      echo "autoconf 2.52d has an issue with our current build."
  42.179 -      echo "We don't know who's to blame however.  So until we do, get a"
  42.180 -      echo "regular version.  RPM's of a working version are on the gstreamer site."
  42.181 -      exit 1
  42.182 -    fi
  42.183 -  }
  42.184 -  return 0
  42.185 -}
  42.186 -
  42.187 -die_check ()
  42.188 -{
  42.189 -  # call with $DIE
  42.190 -  # if set to 1, we need to print something helpful then die
  42.191 -  DIE=$1
  42.192 -  if test "x$DIE" = "x1";
  42.193 -  then
  42.194 -    echo
  42.195 -    echo "- Please get the right tools before proceeding."
  42.196 -    echo "- Alternatively, if you're sure we're wrong, run with --nocheck."
  42.197 -    exit 1
  42.198 -  fi
  42.199 -}
  42.200 -
  42.201 -autogen_options ()
  42.202 -{
  42.203 -  if test "x$1" = "x"; then
  42.204 -    return 0
  42.205 -  fi
  42.206 -
  42.207 -  while test "x$1" != "x" ; do
  42.208 -    optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
  42.209 -    case "$1" in
  42.210 -      --noconfigure)
  42.211 -          NOCONFIGURE=defined
  42.212 -	  AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --noconfigure"
  42.213 -          echo "+ configure run disabled"
  42.214 -          shift
  42.215 -          ;;
  42.216 -      --nocheck)
  42.217 -	  AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --nocheck"
  42.218 -          NOCHECK=defined
  42.219 -          echo "+ autotools version check disabled"
  42.220 -          shift
  42.221 -          ;;
  42.222 -      --debug)
  42.223 -          DEBUG=defined
  42.224 -	  AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --debug"
  42.225 -          echo "+ debug output enabled"
  42.226 -          shift
  42.227 -          ;;
  42.228 -      --prefix=*)
  42.229 -	  CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT --prefix=$optarg"
  42.230 -	  echo "+ passing --prefix=$optarg to configure"
  42.231 -          shift
  42.232 -          ;;
  42.233 -      --prefix)
  42.234 -	  shift
  42.235 -	  echo "DEBUG: $1"
  42.236 -	  CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT --prefix=$1"
  42.237 -	  echo "+ passing --prefix=$1 to configure"
  42.238 -          shift
  42.239 -          ;;
  42.240 -      -h|--help)
  42.241 -          echo "autogen.sh (autogen options) -- (configure options)"
  42.242 -          echo "autogen.sh help options: "
  42.243 -          echo " --noconfigure            don't run the configure script"
  42.244 -          echo " --nocheck                don't do version checks"
  42.245 -          echo " --debug                  debug the autogen process"
  42.246 -	  echo " --prefix		  will be passed on to configure"
  42.247 -          echo
  42.248 -          echo " --with-autoconf PATH     use autoconf in PATH"
  42.249 -          echo " --with-automake PATH     use automake in PATH"
  42.250 -          echo
  42.251 -          echo "to pass options to configure, put them as arguments after -- "
  42.252 -	  exit 1
  42.253 -          ;;
  42.254 -      --with-automake=*)
  42.255 -          AUTOMAKE=$optarg
  42.256 -          echo "+ using alternate automake in $optarg"
  42.257 -	  CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-automake=$AUTOMAKE"
  42.258 -          shift
  42.259 -          ;;
  42.260 -      --with-autoconf=*)
  42.261 -          AUTOCONF=$optarg
  42.262 -          echo "+ using alternate autoconf in $optarg"
  42.263 -	  CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoconf=$AUTOCONF"
  42.264 -          shift
  42.265 -          ;;
  42.266 -      --disable*|--enable*|--with*)
  42.267 -          echo "+ passing option $1 to configure"
  42.268 -	  CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $1"
  42.269 -          shift
  42.270 -          ;;
  42.271 -       --) shift ; break ;;
  42.272 -      *) echo "- ignoring unknown autogen.sh argument $1"; shift ;;
  42.273 -    esac
  42.274 -  done
  42.275 -
  42.276 -  for arg do CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $arg"; done
  42.277 -  if test ! -z "$CONFIGURE_EXT_OPT"
  42.278 -  then
  42.279 -    echo "+ options passed to configure: $CONFIGURE_EXT_OPT"
  42.280 -  fi
  42.281 -}
  42.282 -
  42.283 -toplevel_check ()
  42.284 -{
  42.285 -  srcfile=$1
  42.286 -  test -f $srcfile || {
  42.287 -        echo "You must run this script in the top-level $package directory"
  42.288 -        exit 1
  42.289 -  }
  42.290 -}
  42.291 -
  42.292 -
  42.293 -tool_run ()
  42.294 -{
  42.295 -  tool=$1
  42.296 -  options=$2
  42.297 -  run_if_fail=$3
  42.298 -  echo "+ running $tool $options..."
  42.299 -  $tool $options || {
  42.300 -    echo
  42.301 -    echo $tool failed
  42.302 -    eval $run_if_fail
  42.303 -    exit 1
  42.304 -  }
  42.305 -}
    43.1 --- a/maemo-ui/configure.ac	Wed Aug 01 14:22:14 2007 +0100
    43.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.3 @@ -1,229 +0,0 @@
    43.4 -#                                               -*- Autoconf -*-
    43.5 -# Process this file with autoconf to produce a configure script.
    43.6 -
    43.7 -AC_PREREQ(2.50)
    43.8 -
    43.9 -AC_INIT([maemo-myth],[0.1])
   43.10 -
   43.11 -dnl AC_CONFIG_SRCDIR([src/mmyth_main.c])
   43.12 -AC_CONFIG_HEADER(config.h)
   43.13 -
   43.14 -dnl when going to/from release please set the nano (fourth number) right !
   43.15 -dnl releases only do Wall, SVN and prerelease does Werror too
   43.16 -AS_VERSION(maemo-myth, GMYTH, 0, 1, 0, 3, GMYTH_SVN="no", GMYTH_SVN="yes")
   43.17 -
   43.18 -GMYTH_MAJORMINOR=$GMYTH_MAJOR_VERSION.$GMYTH_MINOR_VERSION
   43.19 -
   43.20 -AC_SUBST(GMYTH_MAJORMINOR)
   43.21 -
   43.22 -dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
   43.23 -AM_MAINTAINER_MODE
   43.24 -dnl make aclocal work in maintainer mode
   43.25 -AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
   43.26 -
   43.27 -# Checks for programs.
   43.28 -# check for tools
   43.29 -# Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
   43.30 -CFLAGS="$CFLAGS -Wall"
   43.31 -AC_PROG_CC
   43.32 -AC_PROG_LIBTOOL
   43.33 -
   43.34 -# Checks for libraries.
   43.35 -
   43.36 -# Checks for header files.
   43.37 -AC_HEADER_STDC
   43.38 -AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h])
   43.39 -
   43.40 -# Checks for typedefs, structures, and compiler characteristics.
   43.41 -AC_C_CONST
   43.42 -AC_TYPE_PID_T
   43.43 -AC_STRUCT_TM
   43.44 -
   43.45 -# Checks for library functions.
   43.46 -AC_FUNC_FORK
   43.47 -AC_PROG_GCC_TRADITIONAL
   43.48 -AC_FUNC_MALLOC
   43.49 -AC_FUNC_MKTIME
   43.50 -AC_FUNC_VPRINTF
   43.51 -AC_CHECK_FUNCS([memset socket stime strstr strtoul])
   43.52 -
   43.53 -AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
   43.54 -
   43.55 -# Checks required packages
   43.56 -
   43.57 -dnl Test if --disable-debug given
   43.58 -AC_ARG_ENABLE(debug,
   43.59 -	[AC_HELP_STRING([--disable-debug], [disable debugging mode])],
   43.60 -	enable_debug="$enableval",
   43.61 -	enable_debug=yes)
   43.62 -
   43.63 -if test "x$enable_debug" = "xyes" ; then
   43.64 -      CFLAGS="$CFLAGS -g"
   43.65 -else
   43.66 -      AC_DEFINE( NDEBUG, 1, [disable debug messages] )
   43.67 -      CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS -DNDEBUG"
   43.68 -fi          
   43.69 -
   43.70 -AM_CONDITIONAL( NDEBUG, test "x$enable_debug" = "xyes" )
   43.71 -
   43.72 -# Check for pkgconfig
   43.73 -AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
   43.74 -# Give error and exit if we don't have pkgconfig
   43.75 -if test "x$HAVE_PKGCONFIG" = "xno"; then
   43.76 -  AC_MSG_ERROR(you need to have pkgconfig installed !)
   43.77 -fi
   43.78 -
   43.79 -# Check for Glib2.0
   43.80 -PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
   43.81 -
   43.82 -# Give error and exit if we don't have glib
   43.83 -if test "x$HAVE_GLIB" = "xno"; then
   43.84 -  AC_MSG_ERROR(you need glib-2.0 installed)
   43.85 -fi
   43.86 -
   43.87 -# make GLIB_CFLAGS and GLIB_LIBS available
   43.88 -AC_SUBST(GLIB_CFLAGS)
   43.89 -AC_SUBST(GLIB_LIBS)
   43.90 -
   43.91 -# Check for GObject2.0
   43.92 -PKG_CHECK_MODULES(GOBJECT,
   43.93 -  gobject-2.0,
   43.94 -  HAVE_GOBJECT=yes, HAVE_GOBJECT=no)
   43.95 -
   43.96 -# Give error and exit if we don't have gobject
   43.97 -if test "x$HAVE_GOBJECT" = "xno"; then
   43.98 -  AC_MSG_ERROR(you need gobject-2.0 installed)
   43.99 -fi
  43.100 -
  43.101 -# make GOBJECT_CFLAGS and GOBJECT_LIBS available
  43.102 -AC_SUBST(GOBJECT_CFLAGS)
  43.103 -AC_SUBST(GOBJECT_LIBS)
  43.104 -
  43.105 -# Check for GTK+-2.0
  43.106 -PKG_CHECK_MODULES(GTK, gtk+-2.0, HAVE_GTK=yes,HAVE_GTK=no)
  43.107 -
  43.108 -# Give error and exit if we don't have gtk
  43.109 -if test "x$HAVE_GTK" = "xyes"; then
  43.110 -  AC_DEFINE(WITH_GTK, 1, [build with GTK+ related stuff])
  43.111 -  dnl AC_MSG_ERROR(you need gtk+-2.0 installed)
  43.112 -else
  43.113 -  AC_MSG_RESULT(no)
  43.114 -fi
  43.115 -
  43.116 -AM_CONDITIONAL(WITH_GTK, test "x$HAVE_GTK" = "xyes" )
  43.117 -
  43.118 -# make GTK_CFLAGS and GTK_LIBS available
  43.119 -AC_SUBST(GTK_CFLAGS)
  43.120 -AC_SUBST(GTK_LIBS)
  43.121 -
  43.122 -dnl ========== Check for Hildon Libraries
  43.123 -PKG_CHECK_MODULES(HILDON,
  43.124 -  libosso hildon-lgpl libosso hildon-status-bar-lib libhildonmenu hildon-base-lib hildon-control-panel hildon-libs,
  43.125 -  HAVE_HILDON=yes, HAVE_HILDON=no)
  43.126 -
  43.127 -if test "x$HAVE_HILDON" = "xyes"; then
  43.128 -  HILDON_CFLAGS="$HILDON_CFLAGS -DMAEMO_PLATFORM"
  43.129 -  AC_DEFINE(MAEMO_PLATFORM, 1, [build with hildon libs])
  43.130 -else
  43.131 -  AC_MSG_RESULT(no)
  43.132 -fi
  43.133 -
  43.134 -AM_CONDITIONAL(MAEMO_PLATFORM, test "x$HAVE_HILDON" = "xyes")
  43.135 -
  43.136 -dnl make HILDON_CFLAGS and HILDON_LIBS available
  43.137 -AC_SUBST(HILDON_CFLAGS)
  43.138 -AC_SUBST(HILDON_LIBS)
  43.139 -
  43.140 -# Check for libxml-2.0
  43.141 -PKG_CHECK_MODULES(LIBXML, libxml-2.0, HAVE_LIBXML=yes,HAVE_LIBXML=no)
  43.142 -
  43.143 -# Give error and exit if we don't have libxml
  43.144 -if test "x$HAVE_LIBXML" = "xno"; then
  43.145 -  AC_MSG_ERROR(you need libxml-2.0 installed)
  43.146 -fi
  43.147 -
  43.148 -# make LIBXML_CFLAGS and LIBXML_LIBS available
  43.149 -AC_SUBST(LIBXML_CFLAGS)
  43.150 -AC_SUBST(LIBXML_LIBS)
  43.151 -
  43.152 -
  43.153 -# check for gstreamer development files
  43.154 -GST_REQUIRED=0.10
  43.155 -GST_MAJORMINOR=0.10
  43.156 -PKG_CHECK_MODULES(GST, \
  43.157 -  gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED,
  43.158 -  HAVE_GST=yes, HAVE_GST=no)
  43.159 -
  43.160 -# Give error and exit if we don't have gstreamer
  43.161 -if test "x$HAVE_GST" = "xno"; then
  43.162 -  AC_MSG_ERROR(you need gstreamer development packages installed !)
  43.163 -fi
  43.164 -
  43.165 -# make GST_CFLAGS and GST_LIBS available
  43.166 -AC_SUBST(GST_CFLAGS)
  43.167 -AC_SUBST(GST_LIBS)
  43.168 -
  43.169 -# check for gstreamer-base plugins (xoverlay interface)
  43.170 -GSTBASE_REQUIRED=0.10
  43.171 -GSTBASE_MAJORMINOR=0.10
  43.172 -PKG_CHECK_MODULES(GSTBASE, \
  43.173 -  gstreamer-base-$GSTBASE_MAJORMINOR >= $GSTBASE_REQUIRED,
  43.174 -  HAVE_GSTBASE=yes, HAVE_GSTBASE=no)
  43.175 -
  43.176 -# Give error and exit if we don't have gstreamer base libraries
  43.177 -if test "x$HAVE_GSTBASE" = "xno"; then
  43.178 -  AC_MSG_ERROR(you need gstreamer base development packages installed !)
  43.179 -fi
  43.180 -
  43.181 -# make GSTBASE_CFLAGS and GSTBASE_LIBS available
  43.182 -AC_SUBST(GSTBASE_CFLAGS)
  43.183 -AC_SUBST(GSTBASE_LIBS)
  43.184 -
  43.185 -# make GST_MAJORMINOR available in Makefile.am
  43.186 -AC_SUBST(GST_MAJORMINOR)
  43.187 -
  43.188 -
  43.189 -# check for gstreamer-base plugins (xoverlay interface)
  43.190 -GSTPLUGINSBASE_REQUIRED=0.10
  43.191 -GSTPLUGINSBASE_MAJORMINOR=0.10
  43.192 -PKG_CHECK_MODULES(GSTPLUGINSBASE, \
  43.193 -  gstreamer-plugins-base-$GSTPLUGINSBASE_MAJORMINOR >= $GSTPLUGINSBASE_REQUIRED,
  43.194 -  HAVE_GSTPLUGINSBASE=yes, HAVE_GSTPLUGINSBASE=no)
  43.195 -
  43.196 -# Give error and exit if we don't have gstreamer base libraries
  43.197 -if test "x$HAVE_GSTPLUGINSBASE" = "xno"; then
  43.198 -  AC_MSG_ERROR(you need gstreamer plugins base development packages installed !)
  43.199 -fi
  43.200 -
  43.201 -# make GSTPLUGINSBASE_CFLAGS and GSTPLUGINSBASE_LIBS available
  43.202 -AC_SUBST(GSTPLUGINSBASE_CFLAGS)
  43.203 -AC_SUBST(GSTPLUGINSBASE_LIBS)
  43.204 -
  43.205 -# check for gstreamer-interfaces (xoverlay interface)
  43.206 -AC_CHECK_FUNC( gst_x_overlay_get_type,
  43.207 -  HAVE_GSTINTERFACES=yes, HAVE_GSTINTERFACES=no )
  43.208 -
  43.209 -# Give error and exit if we don't have gstreamer base libraries
  43.210 -if test "x$HAVE_GSTINTERFACES" = "xno"; then
  43.211 -  AC_MSG_NOTICE(you need gstreamer interfaces development packages installed !)
  43.212 -  CFLAGS="$CFLAGS -lgstinterfaces-$GSTPLUGINSBASE_MAJORMINOR"
  43.213 -fi
  43.214 -
  43.215 -# Check for gmyth-0.1
  43.216 -
  43.217 -PKG_CHECK_MODULES(LIBGMYTH, gmyth-0.1, HAVE_LIBGMYTH=yes,HAVE_LIBGMYTH=no)
  43.218 -
  43.219 -# Give error and exit if we don't have gmyth-0.1
  43.220 -if test "x$HAVE_LIBGMYTH" = "xno"; then
  43.221 -  AC_MSG_ERROR(you need gmyth-0.1 installed)
  43.222 -fi
  43.223 -
  43.224 -# make LIBXML_CFLAGS and LIBXML_LIBS available
  43.225 -AC_SUBST(LIBGMYTH_CFLAGS)
  43.226 -AC_SUBST(LIBGMYTH_LIBS)
  43.227 -
  43.228 -
  43.229 -AC_CONFIG_FILES([Makefile
  43.230 -                src/Makefile
  43.231 -                pixmaps/Makefile])
  43.232 -AC_OUTPUT
    44.1 --- a/maemo-ui/m4/Makefile.am	Wed Aug 01 14:22:14 2007 +0100
    44.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.3 @@ -1,7 +0,0 @@
    44.4 -EXTRA_DIST = \
    44.5 -        ac_doxygen.m4 \
    44.6 -        as-compiler-flag.m4 \
    44.7 -        as-expand.m4 \
    44.8 -        as-version.m4 \
    44.9 -        as-gtk-doc.m4
   44.10 -
    45.1 --- a/maemo-ui/m4/ac_doxygen.m4	Wed Aug 01 14:22:14 2007 +0100
    45.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.3 @@ -1,312 +0,0 @@
    45.4 -# This file is part of Autoconf.                       -*- Autoconf -*-
    45.5 -
    45.6 -# Copyright (C) 2004 Oren Ben-Kiki
    45.7 -# This file is distributed under the same terms as the Autoconf macro files.
    45.8 -
    45.9 -# Generate automatic documentation using Doxygen. Works in concert with the
   45.10 -# aminclude.m4 file and a compatible doxygen configuration file. Defines the
   45.11 -# following public macros:
   45.12 -#
   45.13 -# DX_???_FEATURE(ON|OFF) - control the default setting fo a Doxygen feature.
   45.14 -# Supported features are 'DOXYGEN' itself, 'DOT' for generating graphics,
   45.15 -# 'HTML' for plain HTML, 'CHM' for compressed HTML help (for MS users), 'CHI'
   45.16 -# for generating a seperate .chi file by the .chm file, and 'MAN', 'RTF',
   45.17 -# 'XML', 'PDF' and 'PS' for the appropriate output formats. The environment
   45.18 -# variable DOXYGEN_PAPER_SIZE may be specified to override the default 'a4wide'
   45.19 -# paper size.
   45.20 -#
   45.21 -# By default, HTML, PDF and PS documentation is generated as this seems to be
   45.22 -# the most popular and portable combination. MAN pages created by Doxygen are
   45.23 -# usually problematic, though by picking an appropriate subset and doing some
   45.24 -# massaging they might be better than nothing. CHM and RTF are specific for MS
   45.25 -# (note that you can't generate both HTML and CHM at the same time). The XML is
   45.26 -# rather useless unless you apply specialized post-processing to it.
   45.27 -#
   45.28 -# The macro mainly controls the default state of the feature. The use can
   45.29 -# override the default by specifying --enable or --disable. The macros ensure
   45.30 -# that contradictory flags are not given (e.g., --enable-doxygen-html and
   45.31 -# --enable-doxygen-chm, --enable-doxygen-anything with --disable-doxygen, etc.)
   45.32 -# Finally, each feature will be automatically disabled (with a warning) if the
   45.33 -# required programs are missing.
   45.34 -#
   45.35 -# Once all the feature defaults have been specified, call DX_INIT_DOXYGEN with
   45.36 -# the following parameters: a one-word name for the project for use as a
   45.37 -# filename base etc., an optional configuration file name (the default is
   45.38 -# 'Doxyfile', the same as Doxygen's default), and an optional output directory
   45.39 -# name (the default is 'doxygen-doc').
   45.40 -
   45.41 -## ----------##
   45.42 -## Defaults. ##
   45.43 -## ----------##
   45.44 -
   45.45 -DX_ENV=""
   45.46 -AC_DEFUN([DX_FEATURE_doc],  ON)
   45.47 -AC_DEFUN([DX_FEATURE_dot],  ON)
   45.48 -AC_DEFUN([DX_FEATURE_man],  OFF)
   45.49 -AC_DEFUN([DX_FEATURE_html], ON)
   45.50 -AC_DEFUN([DX_FEATURE_chm],  OFF)
   45.51 -AC_DEFUN([DX_FEATURE_chi],  OFF)
   45.52 -AC_DEFUN([DX_FEATURE_rtf],  OFF)
   45.53 -AC_DEFUN([DX_FEATURE_xml],  OFF)
   45.54 -AC_DEFUN([DX_FEATURE_pdf],  ON)
   45.55 -AC_DEFUN([DX_FEATURE_ps],   ON)
   45.56 -
   45.57 -## --------------- ##
   45.58 -## Private macros. ##
   45.59 -## --------------- ##
   45.60 -
   45.61 -# DX_ENV_APPEND(VARIABLE, VALUE)
   45.62 -# ------------------------------
   45.63 -# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen.
   45.64 -AC_DEFUN([DX_ENV_APPEND], [AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])])
   45.65 -
   45.66 -# DX_DIRNAME_EXPR
   45.67 -# ---------------
   45.68 -# Expand into a shell expression prints the directory part of a path.
   45.69 -AC_DEFUN([DX_DIRNAME_EXPR],
   45.70 -         [[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']])
   45.71 -
   45.72 -# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF)
   45.73 -# -------------------------------------
   45.74 -# Expands according to the M4 (static) status of the feature.
   45.75 -AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])])
   45.76 -
   45.77 -# DX_REQUIRE_PROG(VARIABLE, PROGRAM)
   45.78 -# ----------------------------------
   45.79 -# Require the specified program to be found for the DX_CURRENT_FEATURE to work.
   45.80 -AC_DEFUN([DX_REQUIRE_PROG], [
   45.81 -AC_PATH_TOOL([$1], [$2])
   45.82 -if test "$DX_FLAG_[]DX_CURRENT_FEATURE$$1" = 1; then
   45.83 -    AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION])
   45.84 -    AC_SUBST([DX_FLAG_[]DX_CURRENT_FEATURE], 0)
   45.85 -fi
   45.86 -])
   45.87 -
   45.88 -# DX_TEST_FEATURE(FEATURE)
   45.89 -# ------------------------
   45.90 -# Expand to a shell expression testing whether the feature is active.
   45.91 -AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1])
   45.92 -
   45.93 -# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE)
   45.94 -# -------------------------------------------------
   45.95 -# Verify that a required features has the right state before trying to turn on
   45.96 -# the DX_CURRENT_FEATURE.
   45.97 -AC_DEFUN([DX_CHECK_DEPEND], [
   45.98 -test "$DX_FLAG_$1" = "$2" \
   45.99 -|| AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1,
  45.100 -                            requires, contradicts) doxygen-DX_CURRENT_FEATURE])
  45.101 -])
  45.102 -
  45.103 -# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE)
  45.104 -# ----------------------------------------------------------
  45.105 -# Turn off the DX_CURRENT_FEATURE if the required feature is off.
  45.106 -AC_DEFUN([DX_CLEAR_DEPEND], [
  45.107 -test "$DX_FLAG_$1" = "$2" || AC_SUBST([DX_FLAG_[]DX_CURRENT_FEATURE], 0)
  45.108 -])
  45.109 -
  45.110 -# DX_FEATURE_ARG(FEATURE, DESCRIPTION,
  45.111 -#                CHECK_DEPEND, CLEAR_DEPEND,
  45.112 -#                REQUIRE, DO-IF-ON, DO-IF-OFF)
  45.113 -# --------------------------------------------
  45.114 -# Parse the command-line option controlling a feature. CHECK_DEPEND is called
  45.115 -# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND),
  45.116 -# otherwise CLEAR_DEPEND is called to turn off the default state if a required
  45.117 -# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional
  45.118 -# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and
  45.119 -# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature.
  45.120 -AC_DEFUN([DX_ARG_ABLE], [
  45.121 -    AC_DEFUN([DX_CURRENT_FEATURE], [$1])
  45.122 -    AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2])
  45.123 -    AC_ARG_ENABLE(doxygen-$1,
  45.124 -                  [AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1],
  45.125 -                                                      [--enable-doxygen-$1]),
  45.126 -                                  DX_IF_FEATURE([$1], [don't $2], [$2]))],
  45.127 -                  [
  45.128 -case "$enableval" in
  45.129 -#(
  45.130 -y|Y|yes|Yes|YES)
  45.131 -    AC_SUBST([DX_FLAG_$1], 1)
  45.132 -    $3
  45.133 -;; #(
  45.134 -n|N|no|No|NO)
  45.135 -    AC_SUBST([DX_FLAG_$1], 0)
  45.136 -;; #(
  45.137 -*)
  45.138 -    AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1])
  45.139 -;;
  45.140 -esac
  45.141 -], [
  45.142 -AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)])
  45.143 -$4
  45.144 -])
  45.145 -if DX_TEST_FEATURE([$1]); then
  45.146 -    $5
  45.147 -    :
  45.148 -fi
  45.149 -if DX_TEST_FEATURE([$1]); then
  45.150 -    AM_CONDITIONAL(DX_COND_$1, :)
  45.151 -    $6
  45.152 -    :
  45.153 -else
  45.154 -    AM_CONDITIONAL(DX_COND_$1, false)
  45.155 -    $7
  45.156 -    :
  45.157 -fi
  45.158 -])
  45.159 -
  45.160 -## -------------- ##
  45.161 -## Public macros. ##
  45.162 -## -------------- ##
  45.163 -
  45.164 -# DX_XXX_FEATURE(DEFAULT_STATE)
  45.165 -# -----------------------------
  45.166 -AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc],  [$1])])
  45.167 -AC_DEFUN([DX_MAN_FEATURE],     [AC_DEFUN([DX_FEATURE_man],  [$1])])
  45.168 -AC_DEFUN([DX_HTML_FEATURE],    [AC_DEFUN([DX_FEATURE_html], [$1])])
  45.169 -AC_DEFUN([DX_CHM_FEATURE],     [AC_DEFUN([DX_FEATURE_chm],  [$1])])
  45.170 -AC_DEFUN([DX_CHI_FEATURE],     [AC_DEFUN([DX_FEATURE_chi],  [$1])])
  45.171 -AC_DEFUN([DX_RTF_FEATURE],     [AC_DEFUN([DX_FEATURE_rtf],  [$1])])
  45.172 -AC_DEFUN([DX_XML_FEATURE],     [AC_DEFUN([DX_FEATURE_xml],  [$1])])
  45.173 -AC_DEFUN([DX_XML_FEATURE],     [AC_DEFUN([DX_FEATURE_xml],  [$1])])
  45.174 -AC_DEFUN([DX_PDF_FEATURE],     [AC_DEFUN([DX_FEATURE_pdf],  [$1])])
  45.175 -AC_DEFUN([DX_PS_FEATURE],      [AC_DEFUN([DX_FEATURE_ps],   [$1])])
  45.176 -
  45.177 -# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR])
  45.178 -# ---------------------------------------------------------
  45.179 -# PROJECT also serves as the base name for the documentation files.
  45.180 -# The default CONFIG-FILE is "Doxyfile" and OUTPUT-DOC-DIR is "doxygen-doc".
  45.181 -AC_DEFUN([DX_INIT_DOXYGEN], [
  45.182 -
  45.183 -# Files:
  45.184 -AC_SUBST([DX_PROJECT], [$1])
  45.185 -AC_SUBST([DX_CONFIG], [ifelse([$2], [], Doxyfile, [$2])])
  45.186 -AC_SUBST([DX_DOCDIR], [ifelse([$3], [], doxygen-doc, [$3])])
  45.187 -
  45.188 -# Environment variables used inside doxygen.cfg:
  45.189 -DX_ENV_APPEND(SRCDIR, $srcdir)
  45.190 -DX_ENV_APPEND(PROJECT, $DX_PROJECT)
  45.191 -DX_ENV_APPEND(DOCDIR, $DX_DOCDIR)
  45.192 -DX_ENV_APPEND(VERSION, $PACKAGE_VERSION)
  45.193 -
  45.194 -# Doxygen itself:
  45.195 -DX_ARG_ABLE(doc, [generate any doxygen documentation],
  45.196 -            [],
  45.197 -            [],
  45.198 -            [DX_REQUIRE_PROG([DX_DOXYGEN], doxygen)
  45.199 -             DX_REQUIRE_PROG([DX_PERL], perl)],
  45.200 -            [DX_ENV_APPEND(PERL_PATH, $DX_PERL)])
  45.201 -
  45.202 -# Dot for graphics:
  45.203 -DX_ARG_ABLE(dot, [generate graphics for doxygen documentation],
  45.204 -            [DX_CHECK_DEPEND(doc, 1)],
  45.205 -            [DX_CLEAR_DEPEND(doc, 1)],
  45.206 -            [DX_REQUIRE_PROG([DX_DOT], dot)],
  45.207 -            [DX_ENV_APPEND(HAVE_DOT, YES)
  45.208 -             DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])],
  45.209 -            [DX_ENV_APPEND(HAVE_DOT, NO)])
  45.210 -
  45.211 -# Man pages generation:
  45.212 -DX_ARG_ABLE(man, [generate doxygen manual pages],
  45.213 -            [DX_CHECK_DEPEND(doc, 1)],
  45.214 -            [DX_CLEAR_DEPEND(doc, 1)],
  45.215 -            [],
  45.216 -            [DX_ENV_APPEND(GENERATE_MAN, YES)],
  45.217 -            [DX_ENV_APPEND(GENERATE_MAN, NO)])
  45.218 -
  45.219 -# RTF file generation:
  45.220 -DX_ARG_ABLE(rtf, [generate doxygen RTF documentation],
  45.221 -            [DX_CHECK_DEPEND(doc, 1)],
  45.222 -            [DX_CLEAR_DEPEND(doc, 1)],
  45.223 -            [],
  45.224 -            [DX_ENV_APPEND(GENERATE_RTF, YES)],
  45.225 -            [DX_ENV_APPEND(GENERATE_RTF, NO)])
  45.226 -
  45.227 -# XML file generation:
  45.228 -DX_ARG_ABLE(xml, [generate doxygen XML documentation],
  45.229 -            [DX_CHECK_DEPEND(doc, 1)],
  45.230 -            [DX_CLEAR_DEPEND(doc, 1)],
  45.231 -            [],
  45.232 -            [DX_ENV_APPEND(GENERATE_XML, YES)],
  45.233 -            [DX_ENV_APPEND(GENERATE_XML, NO)])
  45.234 -
  45.235 -# (Compressed) HTML help generation:
  45.236 -DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation],
  45.237 -            [DX_CHECK_DEPEND(doc, 1)],
  45.238 -            [DX_CLEAR_DEPEND(doc, 1)],
  45.239 -            [DX_REQUIRE_PROG([DX_HHC], hhc)],
  45.240 -            [DX_ENV_APPEND(HHC_PATH, $DX_HHC)
  45.241 -             DX_ENV_APPEND(GENERATE_HTML, YES)
  45.242 -             DX_ENV_APPEND(GENERATE_HTMLHELP, YES)],
  45.243 -            [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)])
  45.244 -
  45.245 -# Seperate CHI file generation.
  45.246 -DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file],
  45.247 -            [DX_CHECK_DEPEND(chm, 1)],
  45.248 -            [DX_CLEAR_DEPEND(chm, 1)],
  45.249 -            [],
  45.250 -            [DX_ENV_APPEND(GENERATE_CHI, YES)],
  45.251 -            [DX_ENV_APPEND(GENERATE_CHI, NO)])
  45.252 -
  45.253 -# Plain HTML pages generation:
  45.254 -DX_ARG_ABLE(html, [generate doxygen plain HTML documentation],
  45.255 -            [DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)],
  45.256 -            [DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)],
  45.257 -            [],
  45.258 -            [DX_ENV_APPEND(GENERATE_HTML, YES)],
  45.259 -            [DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)])
  45.260 -
  45.261 -# PostScript file generation:
  45.262 -DX_ARG_ABLE(ps, [generate doxygen PostScript documentation],
  45.263 -            [DX_CHECK_DEPEND(doc, 1)],
  45.264 -            [DX_CLEAR_DEPEND(doc, 1)],
  45.265 -            [DX_REQUIRE_PROG([DX_LATEX], latex)
  45.266 -             DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
  45.267 -             DX_REQUIRE_PROG([DX_DVIPS], dvips)
  45.268 -             DX_REQUIRE_PROG([DX_EGREP], egrep)])
  45.269 -
  45.270 -# PDF file generation:
  45.271 -DX_ARG_ABLE(pdf, [generate doxygen PDF documentation],
  45.272 -            [DX_CHECK_DEPEND(doc, 1)],
  45.273 -            [DX_CLEAR_DEPEND(doc, 1)],
  45.274 -            [DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex)
  45.275 -             DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
  45.276 -             DX_REQUIRE_PROG([DX_EGREP], egrep)])
  45.277 -
  45.278 -# LaTeX generation for PS and/or PDF:
  45.279 -if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then
  45.280 -    AM_CONDITIONAL(DX_COND_latex, :)
  45.281 -    DX_ENV_APPEND(GENERATE_LATEX, YES)
  45.282 -else
  45.283 -    AM_CONDITIONAL(DX_COND_latex, false)
  45.284 -    DX_ENV_APPEND(GENERATE_LATEX, NO)
  45.285 -fi
  45.286 -
  45.287 -# Paper size for PS and/or PDF:
  45.288 -AC_ARG_VAR(DOXYGEN_PAPER_SIZE,
  45.289 -           [a4wide (default), a4, letter, legal or executive])
  45.290 -case "$DOXYGEN_PAPER_SIZE" in
  45.291 -#(
  45.292 -"")
  45.293 -    AC_SUBST(DOXYGEN_PAPER_SIZE, "")
  45.294 -;; #(
  45.295 -a4wide|a4|letter|legal|executive)
  45.296 -    DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE)
  45.297 -;; #(
  45.298 -*)
  45.299 -    AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'])
  45.300 -;;
  45.301 -esac
  45.302 -
  45.303 -#For debugging:
  45.304 -#echo DX_FLAG_doc=$DX_FLAG_doc
  45.305 -#echo DX_FLAG_dot=$DX_FLAG_dot
  45.306 -#echo DX_FLAG_man=$DX_FLAG_man
  45.307 -#echo DX_FLAG_html=$DX_FLAG_html
  45.308 -#echo DX_FLAG_chm=$DX_FLAG_chm
  45.309 -#echo DX_FLAG_chi=$DX_FLAG_chi
  45.310 -#echo DX_FLAG_rtf=$DX_FLAG_rtf
  45.311 -#echo DX_FLAG_xml=$DX_FLAG_xml
  45.312 -#echo DX_FLAG_pdf=$DX_FLAG_pdf
  45.313 -#echo DX_FLAG_ps=$DX_FLAG_ps
  45.314 -#echo DX_ENV=$DX_ENV
  45.315 -])
    46.1 --- a/maemo-ui/m4/as-compiler-flag.m4	Wed Aug 01 14:22:14 2007 +0100
    46.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.3 @@ -1,33 +0,0 @@
    46.4 -dnl as-compiler-flag.m4 0.1.0
    46.5 -
    46.6 -dnl autostars m4 macro for detection of compiler flags
    46.7 -
    46.8 -dnl David Schleef <ds@schleef.org>
    46.9 -
   46.10 -dnl $Id: as-compiler-flag.m4,v 1.1.1.1 2005/08/26 00:42:44 andrunko Exp $
   46.11 -
   46.12 -dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
   46.13 -dnl Tries to compile with the given CFLAGS.
   46.14 -dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
   46.15 -dnl and ACTION-IF-NOT-ACCEPTED otherwise.
   46.16 -
   46.17 -AC_DEFUN([AS_COMPILER_FLAG],
   46.18 -[
   46.19 -  AC_MSG_CHECKING([to see if compiler understands $1])
   46.20 -
   46.21 -  save_CFLAGS="$CFLAGS"
   46.22 -  CFLAGS="$CFLAGS $1"
   46.23 -
   46.24 -  AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
   46.25 -  CFLAGS="$save_CFLAGS"
   46.26 -
   46.27 -  if test "X$flag_ok" = Xyes ; then
   46.28 -    $2
   46.29 -    true
   46.30 -  else
   46.31 -    $3
   46.32 -    true
   46.33 -  fi
   46.34 -  AC_MSG_RESULT([$flag_ok])
   46.35 -])
   46.36 -
    47.1 --- a/maemo-ui/m4/as-expand.m4	Wed Aug 01 14:22:14 2007 +0100
    47.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.3 @@ -1,40 +0,0 @@
    47.4 -dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
    47.5 -dnl
    47.6 -dnl example
    47.7 -dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
    47.8 -dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
    47.9 -
   47.10 -AC_DEFUN([AS_AC_EXPAND],
   47.11 -[
   47.12 -  EXP_VAR=[$1]
   47.13 -  FROM_VAR=[$2]
   47.14 -
   47.15 -  dnl first expand prefix and exec_prefix if necessary
   47.16 -  prefix_save=$prefix
   47.17 -  exec_prefix_save=$exec_prefix
   47.18 -
   47.19 -  dnl if no prefix given, then use /usr/local, the default prefix
   47.20 -  if test "x$prefix" = "xNONE"; then
   47.21 -    prefix=$ac_default_prefix
   47.22 -  fi
   47.23 -  dnl if no exec_prefix given, then use prefix
   47.24 -  if test "x$exec_prefix" = "xNONE"; then
   47.25 -    exec_prefix=$prefix
   47.26 -  fi
   47.27 -
   47.28 -  full_var="$FROM_VAR"
   47.29 -  dnl loop until it doesn't change anymore
   47.30 -  while true; do
   47.31 -    new_full_var="`eval echo $full_var`"
   47.32 -    if test "x$new_full_var"="x$full_var"; then break; fi
   47.33 -    full_var=$new_full_var
   47.34 -  done
   47.35 -
   47.36 -  dnl clean up
   47.37 -  full_var=$new_full_var
   47.38 -  AC_SUBST([$1], "$full_var")
   47.39 -
   47.40 -  dnl restore prefix and exec_prefix
   47.41 -  prefix=$prefix_save
   47.42 -  exec_prefix=$exec_prefix_save
   47.43 -])
    48.1 --- a/maemo-ui/m4/as-version.m4	Wed Aug 01 14:22:14 2007 +0100
    48.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.3 @@ -1,59 +0,0 @@
    48.4 -dnl version.m4 0.0.5
    48.5 -dnl autostars m4 macro for versioning
    48.6 -dnl thomas@apestaart.org
    48.7 -dnl
    48.8 -dnl AS_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, MICRO, NANO, ACTION_IF_NO_NANO, ACTION_IF_NANO)
    48.9 -dnl example
   48.10 -dnl AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2,)
   48.11 -dnl for a 0.3.2 release version
   48.12 -dnl
   48.13 -dnl this macro
   48.14 -dnl - defines [$PREFIX]_MAJOR, MINOR and MICRO
   48.15 -dnl - if NANO is empty, then we're in release mode, else in cvs/dev mode
   48.16 -dnl - defines [$PREFIX], VERSION, and [$PREFIX]_RELEASE
   48.17 -dnl - executes the relevant action
   48.18 -dnl - AC_SUBST's PACKAGE, VERSION, [$PREFIX] and [$PREFIX]_RELEASE
   48.19 -dnl   as well as the little ones
   48.20 -dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents
   48.21 -dnl   maintainer mode from running ok
   48.22 -dnl
   48.23 -dnl don't forget to put #undef [$2] and [$2]_RELEASE in acconfig.h
   48.24 -
   48.25 -AC_DEFUN([AS_VERSION],
   48.26 -[
   48.27 -  PACKAGE=[$1]
   48.28 -  [$2]_MAJOR_VERSION=[$3]
   48.29 -  [$2]_MINOR_VERSION=[$4]
   48.30 -  [$2]_MICRO_VERSION=[$5]
   48.31 -  NANO=[$6]
   48.32 -  [$2]_NANO_VERSION=$NANO
   48.33 -  if test "x$NANO" = "x" || test "x$NANO" = "x0";
   48.34 -  then
   48.35 -      AC_MSG_NOTICE(configuring [$1] for release)
   48.36 -      VERSION=[$3].[$4].[$5]
   48.37 -      [$2]_RELEASE=1
   48.38 -      dnl execute action
   48.39 -      ifelse([$7], , :, [$7])
   48.40 -  else
   48.41 -      AC_MSG_NOTICE(configuring [$1] for development with nano $NANO)
   48.42 -      VERSION=[$3].[$4].[$5].$NANO
   48.43 -      [$2]_RELEASE=`date +%Y%m%d_%H%M%S`
   48.44 -      dnl execute action
   48.45 -      ifelse([$8], , :, [$8])
   48.46 -  fi
   48.47 -
   48.48 -  [$2]_VERSION=$VERSION
   48.49 -  AC_DEFINE_UNQUOTED([$2]_VERSION, "$[$2]_VERSION", [Define the version])
   48.50 -  AC_SUBST([$2]_VERSION)
   48.51 -  
   48.52 -  AC_SUBST([$2]_RELEASE)
   48.53 -
   48.54 -  AC_SUBST([$2]_MAJOR_VERSION)
   48.55 -  AC_SUBST([$2]_MINOR_VERSION)
   48.56 -  AC_SUBST([$2]_MICRO_VERSION)
   48.57 -  AC_SUBST([$2]_NANO_VERSION)
   48.58 -  AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name])
   48.59 -  AC_SUBST(PACKAGE)
   48.60 -  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version])
   48.61 -  AC_SUBST(VERSION)
   48.62 -])
    49.1 --- a/maemo-ui/pixmaps/Makefile.am	Wed Aug 01 14:22:14 2007 +0100
    49.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.3 @@ -1,11 +0,0 @@
    49.4 -# Adding the application icon
    49.5 -#icondir = $(datadir)/mmyth/pixmaps
    49.6 -#icon_DATA = \
    49.7 -#	mmyth.png
    49.8 -
    49.9 -
   49.10 -# Adding the application resources
   49.11 -pixmapdir = $(pkgdatadir)/pixmaps
   49.12 -pixmap_DATA = mmyth_logo.png
   49.13 -
   49.14 -EXTRA_DIST = $(pixmap_DATA)
    50.1 Binary file maemo-ui/pixmaps/mmyth_logo.png has changed
    51.1 --- a/maemo-ui/src/Makefile.am	Wed Aug 01 14:22:14 2007 +0100
    51.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.3 @@ -1,46 +0,0 @@
    51.4 -bin_PROGRAMS = mmyth
    51.5 -
    51.6 -mmyth_SOURCES =	\
    51.7 -		mmyth_main.c			\
    51.8 -		mmyth_ui.c				\
    51.9 -		mmyth_uicommon.c		\
   51.10 -		mmyth_epg_grid_view.c	\
   51.11 -		mmyth_epg_grid_widget.c	\
   51.12 -		mmyth_recordui.c		\
   51.13 -		mmyth_uisettings.c		\
   51.14 -		mmyth_schedulerui.c		\
   51.15 -		mmyth_tvplayer.c
   51.16 -
   51.17 -mmyth_CFLAGS = \
   51.18 -		$(GTK_CFLAGS) \
   51.19 -		$(GLIB_CFLAGS) \
   51.20 -		$(GST_CFLAGS) \
   51.21 -		$(GSTBASE_CFLAGS) \
   51.22 -		$(GSTPLUGINSBASE_CFLAGS) \
   51.23 -		$(MYSQL_CFLAGS) \
   51.24 -		$(LIBGMYTH_CFLAGS) \
   51.25 -		-I$(top_srcdir)/src \
   51.26 -		-DDATA_DIR=\""$(pkgdatadir)"\" \
   51.27 -		-DPIX_DIR=\""$(pkgdatadir)/pixmaps/"\" \
   51.28 -		-DICON_DIR=\""$(datadir)/pixmaps/"\" \
   51.29 -		-g3 -O0
   51.30 -
   51.31 -if MAEMO_PLATFORM 
   51.32 -mmyth_CFLAGS+= \
   51.33 -	$(HILDON_CFLAGS)
   51.34 -endif
   51.35 -
   51.36 -mmyth_LDADD = 	\
   51.37 -		$(LIBGMYTH_LIBS) \
   51.38 -		$(GTK_LIBS) \
   51.39 -		$(GLIB_LIBS) \
   51.40 -		$(GST_LIBS) \
   51.41 -		$(GSTBASE_LIBS) \
   51.42 -		$(GSTPLUGINSBASE_LIBS) \
   51.43 -		$(GSTINTERFACES_LIBS)
   51.44 -
   51.45 -if MAEMO_PLATFORM
   51.46 -mmyth_LDADD += 	\
   51.47 -	$(HILDON_LIBS)
   51.48 -endif
   51.49 -
    52.1 --- a/maemo-ui/src/mmyth_epg_grid_view.c	Wed Aug 01 14:22:14 2007 +0100
    52.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.3 @@ -1,243 +0,0 @@
    52.4 -#include <string.h>
    52.5 -#include <stdlib.h>
    52.6 -#include <gtk/gtk.h>
    52.7 -#include <gdk/gdkkeysyms.h>
    52.8 -#include <time.h>
    52.9 -
   52.10 -#include "mmyth_epg_grid_view.h"
   52.11 -#include "mmyth_epg_grid_widget.h"
   52.12 -
   52.13 -/*
   52.14 - * Service genre 
   52.15 - */
   52.16 -#define GENRE_MIN               0
   52.17 -#define GENRE_MAX               10
   52.18 -#define GENRE_UNDEFINED         0
   52.19 -#define GENRE_MOVIE             1
   52.20 -#define GENRE_NEWS              2
   52.21 -#define GENRE_SHOW              3
   52.22 -#define GENRE_SPORTS            4
   52.23 -#define GENRE_CHILDREN          5
   52.24 -#define GENRE_MUSIC             6
   52.25 -#define GENRE_CULTURE           7
   52.26 -#define GENRE_SOCIAL            8
   52.27 -#define GENRE_EDUCATION         9
   52.28 -#define GENRE_LEISURE           10
   52.29 -
   52.30 -#define NRO_HOURS 3
   52.31 -
   52.32 -/*
   52.33 - * Function prototypes
   52.34 - */
   52.35 -static void     update_service_details(MMythEpgGridWidget * object,
   52.36 -                                       gpointer arg1, gpointer user_data);
   52.37 -static gboolean key_press_epg_grid_view(GtkWidget * widget,
   52.38 -                                        GdkEventKey * event,
   52.39 -                                        gpointer user_data);
   52.40 -
   52.41 -static GtkWidget *mmyth_epg_grid_widget = NULL;
   52.42 -
   52.43 -/*
   52.44 - * is a GtkEventBox 
   52.45 - */
   52.46 -static GtkWidget *program_details_area = NULL;
   52.47 -static GtkWidget *details_main_hbox = NULL;
   52.48 -static GtkWidget *details_vbox = NULL;
   52.49 -static GtkWidget *details_logo_vbox = NULL;
   52.50 -
   52.51 -/*
   52.52 - * update signal callback from MMythEpgGridWidget 
   52.53 - */
   52.54 -static void
   52.55 -update_service_details(MMythEpgGridWidget * object, gpointer arg1,
   52.56 -                       gpointer user_data)
   52.57 -{
   52.58 -    g_return_if_fail(arg1 != NULL);
   52.59 -
   52.60 -    EpgGridItem    *epg_grid_item = (EpgGridItem *) arg1;
   52.61 -
   52.62 -    gchar           sel_prog_desc[100] = "<big><b>";
   52.63 -    gchar           time_buffer[50];
   52.64 -
   52.65 -    /*
   52.66 -     * FIXME: get first content from content_list
   52.67 -     */
   52.68 -    GMythProgramInfo *proginfo =
   52.69 -        (GMythProgramInfo *) epg_grid_item->proginfo;
   52.70 -
   52.71 -    if (proginfo) {
   52.72 -        GString        *prog_name = proginfo->title;
   52.73 -        GString        *service_name = proginfo->chanid;
   52.74 -
   52.75 -        if (details_vbox != NULL)
   52.76 -            gtk_container_remove(GTK_CONTAINER(details_main_hbox),
   52.77 -                                 details_vbox);
   52.78 -
   52.79 -        /*
   52.80 -         * update service description 
   52.81 -         */
   52.82 -        strcat(sel_prog_desc, service_name->str);
   52.83 -        strcat(sel_prog_desc, "</b></big>");
   52.84 -
   52.85 -        GtkWidget      *fst_line_lbl = gtk_label_new(NULL);
   52.86 -        gtk_misc_set_alignment(GTK_MISC(fst_line_lbl), 0.0, 0.0);
   52.87 -        gtk_label_set_markup(GTK_LABEL(fst_line_lbl), sel_prog_desc);
   52.88 -
   52.89 -        /*
   52.90 -         * freeing char[] 
   52.91 -         */
   52.92 -        sel_prog_desc[0] = 0;
   52.93 -        strcat(sel_prog_desc, "\t");
   52.94 -        strcat(sel_prog_desc, prog_name->str);
   52.95 -
   52.96 -        struct tm       loctime_start,
   52.97 -                        loctime_end;
   52.98 -
   52.99 -        // Convert it to local time representation. 
  52.100 -        /*
  52.101 -         * FIXME: conversion from time to localtime is different in
  52.102 -         * different machines 
  52.103 -         */
  52.104 -        long int        schedule_start_time = proginfo->startts->tv_sec;
  52.105 -        long int        schedule_end_time = proginfo->endts->tv_sec;
  52.106 -
  52.107 -        if (localtime_r(&schedule_start_time, &loctime_start) == NULL) {
  52.108 -            g_warning("localtime_r error in mmyth_epg_grid_view!\n");
  52.109 -        }
  52.110 -#if 0
  52.111 -        fprintf(stderr, asctime(loctime_start));
  52.112 -#endif
  52.113 -
  52.114 -        strftime(time_buffer, 100, "  %H:%M - ", &loctime_start);
  52.115 -        strcat(sel_prog_desc, time_buffer);
  52.116 -
  52.117 -        if (localtime_r(&schedule_end_time, &loctime_end) == NULL) {
  52.118 -            g_warning("localtime_r error in mmyth_epg_grid_view!\n");
  52.119 -        }
  52.120 -#if 0
  52.121 -        fprintf(stderr, asctime(loctime_end));
  52.122 -#endif
  52.123 -
  52.124 -        strftime(time_buffer, 100, "%H:%M\n", &loctime_end);
  52.125 -        strcat(sel_prog_desc, time_buffer);
  52.126 -
  52.127 -        GtkWidget      *snd_line_lbl = gtk_label_new(NULL);
  52.128 -        gtk_misc_set_alignment(GTK_MISC(snd_line_lbl), 0.0, 0.0);
  52.129 -        gtk_label_set_markup(GTK_LABEL(snd_line_lbl), sel_prog_desc);
  52.130 -
  52.131 -        // add the current selected program description to the label
  52.132 -        details_vbox = gtk_vbox_new(FALSE, 0);
  52.133 -        GtkWidget      *fst_line_hbox = gtk_hbox_new(FALSE, 0);
  52.134 -
  52.135 -        gtk_box_pack_start(GTK_BOX(fst_line_hbox),
  52.136 -                           fst_line_lbl, FALSE, FALSE, 6);
  52.137 -        gtk_box_pack_start(GTK_BOX(details_vbox),
  52.138 -                           fst_line_hbox, FALSE, FALSE, 0);
  52.139 -        gtk_box_pack_start(GTK_BOX(details_vbox),
  52.140 -                           snd_line_lbl, FALSE, FALSE, 0);
  52.141 -        gtk_box_pack_start(GTK_BOX(details_main_hbox),
  52.142 -                           details_vbox, FALSE, FALSE, 0);
  52.143 -
  52.144 -        gtk_widget_show_all(details_main_hbox);
  52.145 -    }
  52.146 -}
  52.147 -
  52.148 -/*
  52.149 - * Callback for hardware keys 
  52.150 - */
  52.151 -static          gboolean
  52.152 -key_press_epg_grid_view(GtkWidget * widget,
  52.153 -                        GdkEventKey * event, gpointer user_data)
  52.154 -{
  52.155 -    MMythEpgGridWidget *mmyth_epg_grid_widget =
  52.156 -        (MMythEpgGridWidget *) user_data;
  52.157 -
  52.158 -    return mmyth_epg_grid_widget_key_press(mmyth_epg_grid_widget, widget,
  52.159 -                                           event);
  52.160 -}
  52.161 -
  52.162 -GtkWidget      *
  52.163 -epg_grid_view_new(MMythUi * mmyth_ui)
  52.164 -{
  52.165 -    GtkWidget      *scrolled_window;
  52.166 -    scrolled_window = gtk_scrolled_window_new(NULL, NULL);
  52.167 -    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window),
  52.168 -                                   GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
  52.169 -
  52.170 -    gtk_widget_modify_bg(scrolled_window, GTK_STATE_NORMAL,
  52.171 -                         &main_bg_color);
  52.172 -
  52.173 -    GtkWidget      *main_vbox = gtk_vbox_new(FALSE, 0);
  52.174 -    // gtk_container_set_border_width(main_vbox, 4); 
  52.175 -
  52.176 -    GtkWidget      *details_event_box = gtk_event_box_new();
  52.177 -    gtk_widget_modify_bg(details_event_box, GTK_STATE_NORMAL,
  52.178 -                         &main_bg_color);
  52.179 -
  52.180 -    program_details_area = gtk_vbox_new(FALSE, 0);
  52.181 -    gtk_container_add(GTK_CONTAINER(details_event_box),
  52.182 -                      program_details_area);
  52.183 -    gtk_container_set_border_width(GTK_CONTAINER(program_details_area), 4);
  52.184 -
  52.185 -    details_main_hbox = gtk_hbox_new(FALSE, 10);
  52.186 -
  52.187 -    gtk_box_pack_start(GTK_BOX(program_details_area),
  52.188 -                       details_main_hbox, FALSE, FALSE, 0);
  52.189 -
  52.190 -    details_logo_vbox = gtk_vbox_new(FALSE, 0);
  52.191 -
  52.192 -    GtkWidget      *details_desc_vbox = gtk_vbox_new(FALSE, 0);
  52.193 -
  52.194 -    gtk_box_pack_start(GTK_BOX(details_main_hbox),
  52.195 -                       details_desc_vbox, FALSE, FALSE, 0);
  52.196 -    gtk_box_pack_start(GTK_BOX(details_main_hbox),
  52.197 -                       details_logo_vbox, FALSE, FALSE, 0);
  52.198 -
  52.199 -    gtk_widget_set_size_request(program_details_area, -1, 120);
  52.200 -
  52.201 -    mmyth_epg_grid_widget = mmyth_epg_grid_widget_new();
  52.202 -    g_signal_connect(mmyth_epg_grid_widget, "selection_updated",
  52.203 -                     G_CALLBACK(update_service_details), NULL);
  52.204 -
  52.205 -    /*
  52.206 -     * select by default the first service 
  52.207 -     */
  52.208 -    /*
  52.209 -     * depends on mount services 
  52.210 -     */
  52.211 -    if (MMYTH_EPG_GRID_WIDGET(mmyth_epg_grid_widget)->epg_view_model) {
  52.212 -        GList          *fst_service = (GList *)
  52.213 -            MMYTH_EPG_GRID_WIDGET(mmyth_epg_grid_widget)->epg_view_model->
  52.214 -            data;
  52.215 -        mmyth_epg_grid_widget_update_service(MMYTH_EPG_GRID_WIDGET
  52.216 -                                             (mmyth_epg_grid_widget),
  52.217 -                                             fst_service);
  52.218 -    }
  52.219 -
  52.220 -    gtk_box_pack_start(GTK_BOX(main_vbox),
  52.221 -                       details_event_box, FALSE, FALSE, 0);
  52.222 -    gtk_box_pack_start(GTK_BOX(main_vbox),
  52.223 -                       gtk_hseparator_new(), FALSE, FALSE, 0);
  52.224 -    gtk_box_pack_start(GTK_BOX(main_vbox),
  52.225 -                       mmyth_epg_grid_widget, FALSE, FALSE, 0);
  52.226 -
  52.227 -    gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW
  52.228 -                                          (scrolled_window), main_vbox);
  52.229 -
  52.230 -    /*
  52.231 -     * Add hardware button listener to application 
  52.232 -     */
  52.233 -    g_signal_connect(mmyth_ui->main_window, "key_press_event",
  52.234 -                     G_CALLBACK(key_press_epg_grid_view),
  52.235 -                     mmyth_epg_grid_widget);
  52.236 -
  52.237 -    gtk_widget_show_all(scrolled_window);
  52.238 -
  52.239 -    return scrolled_window;
  52.240 -}
  52.241 -
  52.242 -/*
  52.243 - * DVBHScheduleEvent * mmyth_epg_grid_view_get_selected_schedule() {
  52.244 - * return mmyth_epg_grid_get_selected_schedule
  52.245 - * (MMYTH_EPG_GRID_WIDGET(mmyth_epg_grid_widget)); } 
  52.246 - */
    53.1 --- a/maemo-ui/src/mmyth_epg_grid_view.h	Wed Aug 01 14:22:14 2007 +0100
    53.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.3 @@ -1,8 +0,0 @@
    53.4 -#ifndef MMYTH_ESG_GRID_VIEW_H_
    53.5 -#define MMYTH_ESG_GRID_VIEW_H_
    53.6 -
    53.7 -#include "mmyth_ui.h"
    53.8 -
    53.9 -GtkWidget      *epg_grid_view_new(MMythUi * mmyth_ui);
   53.10 -
   53.11 -#endif                          /* MMYTH_ESG_GRID_VIEW_H_ */
    54.1 --- a/maemo-ui/src/mmyth_epg_grid_widget.c	Wed Aug 01 14:22:14 2007 +0100
    54.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.3 @@ -1,776 +0,0 @@
    54.4 -#include <gtk/gtksignal.h>
    54.5 -#include <gdk/gdkevents.h>
    54.6 -#include <gdk/gdkkeysyms.h>
    54.7 -
    54.8 -#include "mmyth_uicommon.h"
    54.9 -#include "mmyth_epg_grid_widget.h"
   54.10 -
   54.11 -#include <gmyth/gmyth_util.h>
   54.12 -#include <gmyth/gmyth_epg.h>
   54.13 -
   54.14 -#define PIXELS_HOUR 105
   54.15 -#define PROGRAM_SEPARATION 2
   54.16 -
   54.17 -enum {
   54.18 -    SELECTION_UPDATED_SIGNAL,
   54.19 -    LAST_SIGNAL
   54.20 -};
   54.21 -
   54.22 -struct _MMythEpgGridWidgetPrivate {
   54.23 -    /*
   54.24 -     * private widget components 
   54.25 -     */
   54.26 -    GtkWidget      *epg_channels_vbox;
   54.27 -    GtkWidget      *epg_programs_vbox;
   54.28 -
   54.29 -    GHashTable     *service_model_hash;
   54.30 -
   54.31 -    /*
   54.32 -     * guidegrid attributes 
   54.33 -     */
   54.34 -    gboolean        show_favorites;
   54.35 -    gint            current_start_channel_id;
   54.36 -
   54.37 -    GTimeVal       *current_start_time;
   54.38 -    GTimeVal       *current_end_time;
   54.39 -
   54.40 -    guint           selected_channel_index;
   54.41 -
   54.42 -    /*
   54.43 -     * GList of ProgramInfo for each Channel 
   54.44 -     */
   54.45 -    GList          *program_list[MAX_DISPLAY_CHANS];
   54.46 -    GList          *channel_list;
   54.47 -
   54.48 -    GMythEPG       *mmyth_epg;
   54.49 -
   54.50 -    GMythBackendInfo *backend_info;
   54.51 -
   54.52 -    gint            DISPLAY_CHANS;
   54.53 -};
   54.54 -
   54.55 -static void     mmyth_epg_grid_widget_class_init(MMythEpgGridWidgetClass *
   54.56 -                                                 klass);
   54.57 -static void     mmyth_epg_grid_widget_init(MMythEpgGridWidget * object);
   54.58 -static void    
   54.59 -mmyth_epg_grid_widget_private_init(MMythEpgGridWidgetPrivate * private);
   54.60 -static void     mmyth_epg_grid_widget_mount_services(MMythEpgGridWidget *
   54.61 -                                                     object,
   54.62 -                                                     GTimeVal * start_time,
   54.63 -                                                     GTimeVal * end_time);
   54.64 -static void     mmyth_epg_grid_widget_mount_header(MMythEpgGridWidget *
   54.65 -                                                   object);
   54.66 -static void     mmyth_epg_grid_widget_clicked(GtkWidget * widget,
   54.67 -                                              GdkEventExpose * event,
   54.68 -                                              gpointer data);
   54.69 -static GtkWidget *create_event_box_lbl(gchar * str, int width,
   54.70 -                                       const GdkColor * bg_color,
   54.71 -                                       const GdkColor * fg_color);
   54.72 -
   54.73 -static void    
   54.74 -mmyth_epg_grid_widget_fill_programinfos(MMythEpgGridWidgetPrivate *
   54.75 -                                        private);
   54.76 -static void    
   54.77 -mmyth_epg_grid_widget_fill_program_row_infos(MMythEpgGridWidgetPrivate *
   54.78 -                                             private, unsigned int chanNum,
   54.79 -                                             unsigned int row);
   54.80 -
   54.81 -static gint     mmyth_epg_grid_widget_signals[LAST_SIGNAL] = { 0 };
   54.82 -
   54.83 -G_DEFINE_TYPE(MMythEpgGridWidget, mmyth_epg_grid_widget,
   54.84 -              GTK_TYPE_EVENT_BOX)
   54.85 -
   54.86 -    static void
   54.87 -     
   54.88 -        
   54.89 -        
   54.90 -        
   54.91 -        
   54.92 -        
   54.93 -        
   54.94 -        
   54.95 -        
   54.96 -        
   54.97 -        
   54.98 -        
   54.99 -        
  54.100 -          mmyth_epg_grid_widget_class_init(MMythEpgGridWidgetClass * klass)
  54.101 -{
  54.102 -    g_type_class_add_private(klass, sizeof(MMythEpgGridWidgetPrivate));
  54.103 -
  54.104 -    mmyth_epg_grid_widget_signals[SELECTION_UPDATED_SIGNAL] =
  54.105 -        g_signal_new("selection_updated", G_TYPE_FROM_CLASS(klass),
  54.106 -                     G_SIGNAL_RUN_FIRST, 0, NULL, NULL,
  54.107 -                     g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
  54.108 -                     G_TYPE_POINTER);
  54.109 -}
  54.110 -
  54.111 -static void
  54.112 -mmyth_epg_grid_widget_private_init(MMythEpgGridWidgetPrivate * private)
  54.113 -{
  54.114 -    time_t          cur_time;
  54.115 -
  54.116 -    g_return_if_fail(private != NULL);
  54.117 -
  54.118 -    private->epg_channels_vbox = NULL;
  54.119 -    private->epg_programs_vbox = NULL;
  54.120 -    private->service_model_hash = NULL;
  54.121 -
  54.122 -    private->show_favorites = FALSE;
  54.123 -    private->current_start_channel_id = -1;
  54.124 -
  54.125 -    /*
  54.126 -     * Selected the first diplayable channel initially 
  54.127 -     */
  54.128 -    private->selected_channel_index = 0;
  54.129 -
  54.130 -    /*
  54.131 -     * TODO fix the current start/end time 
  54.132 -     */
  54.133 -    private->current_start_time = g_new0(GTimeVal, 1);
  54.134 -    private->current_start_time->tv_sec = time(&cur_time);
  54.135 -
  54.136 -    private->current_end_time = g_new0(GTimeVal, 1);
  54.137 -    private->current_end_time->tv_sec = time(&cur_time) + 10800;
  54.138 -
  54.139 -    private->DISPLAY_CHANS = MAX_DISPLAY_CHANS;
  54.140 -
  54.141 -    private->backend_info =
  54.142 -        gmyth_backend_info_new_full("localhost", "mythtv", "mythtv",
  54.143 -                                    "mythconverg", 6543);
  54.144 -
  54.145 -    // TODO: Close the epg and unref it in dispose call
  54.146 -    private->mmyth_epg = gmyth_epg_new();
  54.147 -    if (!gmyth_epg_connect(private->mmyth_epg, private->backend_info)) {
  54.148 -        g_warning("[%s] Could not connect mysql handler to db",
  54.149 -                  __FUNCTION__);
  54.150 -        g_object_unref(private->mmyth_epg);
  54.151 -        private->mmyth_epg = NULL;
  54.152 -    }
  54.153 -}
  54.154 -
  54.155 -static void
  54.156 -mmyth_epg_grid_widget_init(MMythEpgGridWidget * mmyth_epg_grid_widget)
  54.157 -{
  54.158 -    MMythEpgGridWidgetPrivate *private =
  54.159 -        MMYTH_EPG_GRID_WIDGET_GET_PRIVATE(mmyth_epg_grid_widget);
  54.160 -
  54.161 -    /*
  54.162 -     * init private fields 
  54.163 -     */
  54.164 -    mmyth_epg_grid_widget_private_init(private);
  54.165 -
  54.166 -    mmyth_epg_grid_widget->epg_view_model = NULL;
  54.167 -    mmyth_epg_grid_widget->selected_grid_item = NULL;
  54.168 -
  54.169 -    GtkWidget      *epg_event_box = GTK_WIDGET(mmyth_epg_grid_widget);
  54.170 -    gtk_widget_modify_bg(epg_event_box, GTK_STATE_NORMAL, &main_bg_color);
  54.171 -    gtk_widget_set_size_request(epg_event_box, 0, 125);
  54.172 -
  54.173 -    GtkWidget      *epg_main_hbox = gtk_hbox_new(FALSE, 10);
  54.174 -    gtk_container_set_border_width(GTK_CONTAINER(epg_main_hbox), 10);
  54.175 -
  54.176 -    gtk_container_add(GTK_CONTAINER(epg_event_box), epg_main_hbox);
  54.177 -
  54.178 -    /*
  54.179 -     * channels vbox 
  54.180 -     */
  54.181 -    GtkWidget      *epg_channels_vbox = gtk_vbox_new(FALSE, 3);
  54.182 -    private->epg_channels_vbox = epg_channels_vbox;
  54.183 -
  54.184 -    /*
  54.185 -     * programs vbox 
  54.186 -     */
  54.187 -    GtkWidget      *epg_programs_vbox = gtk_vbox_new(FALSE, 3);
  54.188 -    private->epg_programs_vbox = epg_programs_vbox;
  54.189 -
  54.190 -    /*
  54.191 -     * packing start 
  54.192 -     */
  54.193 -    gtk_box_pack_start(GTK_BOX(epg_main_hbox),
  54.194 -                       epg_channels_vbox, FALSE, FALSE, 0);
  54.195 -    gtk_box_pack_start(GTK_BOX(epg_main_hbox),
  54.196 -                       epg_programs_vbox, FALSE, FALSE, 0);
  54.197 -
  54.198 -    /*
  54.199 -     * table header (first line) 
  54.200 -     */
  54.201 -    mmyth_epg_grid_widget_mount_header(mmyth_epg_grid_widget);
  54.202 -
  54.203 -    /*
  54.204 -     * service programs 
  54.205 -     */
  54.206 -    /*
  54.207 -     * mount service programs with current time 
  54.208 -     */
  54.209 -    mmyth_epg_grid_widget_mount_services(mmyth_epg_grid_widget,
  54.210 -                                         private->current_start_time,
  54.211 -                                         private->current_end_time);
  54.212 -}
  54.213 -
  54.214 -GtkWidget      *
  54.215 -mmyth_epg_grid_widget_new()
  54.216 -{
  54.217 -    return GTK_WIDGET(gtk_type_new(mmyth_epg_grid_widget_get_type()));
  54.218 -}
  54.219 -
  54.220 -static void
  54.221 -mmyth_epg_grid_widget_mount_services(MMythEpgGridWidget *
  54.222 -                                     mmyth_epg_grid_widget,
  54.223 -                                     GTimeVal * start_time,
  54.224 -                                     GTimeVal * end_time)
  54.225 -{
  54.226 -    GList          *proglist;
  54.227 -    GList          *channel_list = NULL;
  54.228 -    GMythChannelInfo *channel_info;
  54.229 -
  54.230 -    int             chanid;
  54.231 -    MMythEpgGridWidgetPrivate *private =
  54.232 -        MMYTH_EPG_GRID_WIDGET_GET_PRIVATE(mmyth_epg_grid_widget);
  54.233 -
  54.234 -    // update view_model
  54.235 -    /*
  54.236 -     * FIXME shallow free or recursive? 
  54.237 -     */
  54.238 -    if (mmyth_epg_grid_widget->epg_view_model != NULL) {
  54.239 -        g_list_free(mmyth_epg_grid_widget->epg_view_model);
  54.240 -        mmyth_epg_grid_widget->epg_view_model = NULL;
  54.241 -    }
  54.242 -
  54.243 -    if (private->service_model_hash != NULL) {
  54.244 -        g_hash_table_destroy(private->service_model_hash);
  54.245 -    }
  54.246 -
  54.247 -    private->service_model_hash = g_hash_table_new(NULL, NULL);
  54.248 -
  54.249 -    /*
  54.250 -     * fill program infos from db 
  54.251 -     */
  54.252 -    mmyth_epg_grid_widget_fill_programinfos(private);
  54.253 -
  54.254 -    channel_list = private->channel_list;
  54.255 -
  54.256 -    /*
  54.257 -     * for each channel get_programs() 
  54.258 -     */
  54.259 -    for (chanid = 0; channel_list &&
  54.260 -         chanid < private->DISPLAY_CHANS; chanid++) {
  54.261 -        proglist = (GList *) private->program_list[chanid];
  54.262 -
  54.263 -        channel_info = (GMythChannelInfo *) channel_list->data;
  54.264 -        channel_list = g_list_next(channel_list);
  54.265 -
  54.266 -        /*
  54.267 -         * Service Title
  54.268 -         */
  54.269 -        GString        *name = NULL;
  54.270 -        if (channel_info->channel_name)
  54.271 -            name = g_string_new(channel_info->channel_name->str);
  54.272 -
  54.273 -        GdkColor        title_bg_color;
  54.274 -        title_bg_color.red = 5000;
  54.275 -        title_bg_color.green = 9000;
  54.276 -        title_bg_color.blue = 40000;
  54.277 -
  54.278 -        GdkColor        title_fg_color;
  54.279 -        title_fg_color.red = 60000;
  54.280 -        title_fg_color.green = 60000;
  54.281 -        title_fg_color.blue = 60000;
  54.282 -
  54.283 -        GtkWidget      *event_box_channel =
  54.284 -            create_event_box_lbl(name->str, 90,
  54.285 -                                 &title_bg_color,
  54.286 -                                 &title_fg_color);
  54.287 -
  54.288 -        gtk_box_pack_start(GTK_BOX(private->epg_channels_vbox),
  54.289 -                           event_box_channel, FALSE, FALSE, 0);
  54.290 -
  54.291 -        GtkWidget      *epg_line_hbox = gtk_hbox_new(FALSE, 0);
  54.292 -
  54.293 -        GdkColor        bg_color;
  54.294 -        bg_color.red = 5000;
  54.295 -        bg_color.green = 30000;
  54.296 -        bg_color.blue = 60000;
  54.297 -
  54.298 -        GdkColor        fg_color;
  54.299 -        fg_color.red = 60000;
  54.300 -        fg_color.green = 60000;
  54.301 -        fg_color.blue = 60000;
  54.302 -
  54.303 -        /*
  54.304 -         * Content parsing 
  54.305 -         */
  54.306 -        GList          *epg_grid_list = NULL;
  54.307 -
  54.308 -        GMythProgramInfo *proginfo;
  54.309 -        int             pixel_count = 0;
  54.310 -        for (; proglist; proglist = proglist->next) {
  54.311 -            proginfo = (GMythProgramInfo *) proglist->data;
  54.312 -
  54.313 -            GString        *content_name = proginfo->title;
  54.314 -
  54.315 -            GTimeVal       *initial_time = g_new0(GTimeVal, 1);
  54.316 -            GTimeVal       *last_time = g_new0(GTimeVal, 1);
  54.317 -            GTimeVal       *duration = g_new0(GTimeVal, 1);
  54.318 -
  54.319 -            GTimeVal       *schedule_start_time = proginfo->startts;
  54.320 -            GTimeVal       *schedule_end_time = proginfo->endts;
  54.321 -
  54.322 -            initial_time->tv_sec =
  54.323 -                (schedule_start_time->tv_sec <
  54.324 -                 start_time->tv_sec) ? start_time->
  54.325 -                tv_sec : schedule_start_time->tv_sec;
  54.326 -            last_time->tv_sec =
  54.327 -                (schedule_end_time->tv_sec >
  54.328 -                 end_time->tv_sec) ? end_time->tv_sec : schedule_end_time->
  54.329 -                tv_sec;
  54.330 -            duration->tv_sec = last_time->tv_sec - initial_time->tv_sec;
  54.331 -
  54.332 -            // Verify program time 
  54.333 -#if 0
  54.334 -            g_debug("ServiceID: %d, ScheduleID: %d\n", service->id,
  54.335 -                    schedule->id);
  54.336 -            fprintf(stderr, "program time\nfrom = %d, to = %d\n",
  54.337 -                    schedule->validFrom, schedule->validTo);
  54.338 -
  54.339 -            struct tm       loctime;
  54.340 -
  54.341 -            /*
  54.342 -             * Convert it to local time representation. 
  54.343 -             */
  54.344 -            if (localtime_r((time_t *) & schedule->validFrom, &loctime) ==
  54.345 -                NULL) {
  54.346 -                g_warning("localtime_r error in mmyth_epg_grid_widget!\n");
  54.347 -                return NULL;
  54.348 -            }
  54.349 -            fprintf(stderr, asctime(&loctime));
  54.350 -
  54.351 -            if (localtime_r((time_t *) & schedule->validTo, &loctime) ==
  54.352 -                NULL) {
  54.353 -                g_warning("localtime_r error in mmyth_epg_grid_widget!\n");
  54.354 -                return NULL;
  54.355 -            }
  54.356 -            fprintf(stderr, asctime(&loctime));
  54.357 -#endif
  54.358 -
  54.359 -            /*
  54.360 -             * fprintf(stderr, "duration = %d\n", duration); 
  54.361 -             */
  54.362 -            double          duration_hour =
  54.363 -                duration->tv_sec / (double) 3600.0;
  54.364 -            /*
  54.365 -             * fprintf(stderr, "duration_hour = %lf\n", duration_hour); 
  54.366 -             */
  54.367 -
  54.368 -            int             size = PIXELS_HOUR * duration_hour;
  54.369 -
  54.370 -            /*
  54.371 -             * complete hour 
  54.372 -             */
  54.373 -            /*
  54.374 -             * FIXME: UGLY WRONG HACK TO ALIGN PROGRAM TIME!!!
  54.375 -             */
  54.376 -            if (last_time->tv_sec % 3600 != 0) {
  54.377 -                size -= PROGRAM_SEPARATION;
  54.378 -            }
  54.379 -            if (initial_time->tv_sec % 3600 != 0) {
  54.380 -                size -= PROGRAM_SEPARATION;
  54.381 -            }
  54.382 -
  54.383 -            pixel_count += size + PROGRAM_SEPARATION;
  54.384 -            GtkWidget      *event_box =
  54.385 -                create_event_box_lbl(content_name->str,
  54.386 -                                     size, &bg_color,
  54.387 -                                     &fg_color);
  54.388 -            gtk_widget_add_events(event_box,
  54.389 -                                  GDK_BUTTON_PRESS_MASK |
  54.390 -                                  GDK_BUTTON_RELEASE_MASK);
  54.391 -
  54.392 -            /*
  54.393 -             * create EpgGridItem 
  54.394 -             */
  54.395 -            EpgGridItem    *epg_grid_item = g_new0(EpgGridItem, 1);
  54.396 -            epg_grid_item->proginfo = proginfo;
  54.397 -            epg_grid_item->event_box = event_box;
  54.398 -            epg_grid_item->object = mmyth_epg_grid_widget;
  54.399 -
  54.400 -            epg_grid_list =
  54.401 -                g_list_prepend(epg_grid_list, (gpointer) epg_grid_item);
  54.402 -
  54.403 -            gtk_box_pack_start(GTK_BOX(epg_line_hbox),
  54.404 -                               event_box, FALSE, FALSE,
  54.405 -                               PROGRAM_SEPARATION);
  54.406 -
  54.407 -            g_signal_connect(G_OBJECT(event_box), "button-press-event",
  54.408 -                             G_CALLBACK(mmyth_epg_grid_widget_clicked),
  54.409 -                             (gpointer *) epg_grid_list);
  54.410 -        }
  54.411 -#if 0
  54.412 -        printf("chaind = %d!!!!" chanid);
  54.413 -        fflush(stdout);
  54.414 -#endif
  54.415 -
  54.416 -        if (!epg_grid_list) {
  54.417 -            /*
  54.418 -             * No programs for current channel 
  54.419 -             */
  54.420 -            /*
  54.421 -             * FIXME: size HARDCODED 
  54.422 -             */
  54.423 -            GtkWidget      *event_box =
  54.424 -                create_event_box_lbl("No program list available",
  54.425 -                                     PIXELS_HOUR * 3, &bg_color,
  54.426 -                                     &fg_color);
  54.427 -            gtk_widget_add_events(event_box,
  54.428 -                                  GDK_BUTTON_PRESS_MASK |
  54.429 -                                  GDK_BUTTON_RELEASE_MASK);
  54.430 -
  54.431 -            /*
  54.432 -             * create EpgGridItem 
  54.433 -             */
  54.434 -            EpgGridItem    *epg_grid_item = g_new0(EpgGridItem, 1);
  54.435 -            epg_grid_item->proginfo = NULL;
  54.436 -            epg_grid_item->event_box = event_box;
  54.437 -            epg_grid_item->object = mmyth_epg_grid_widget;
  54.438 -
  54.439 -            epg_grid_list =
  54.440 -                g_list_prepend(epg_grid_list, (gpointer) epg_grid_item);
  54.441 -
  54.442 -            gtk_box_pack_start(GTK_BOX(epg_line_hbox),
  54.443 -                               event_box, FALSE, FALSE,
  54.444 -                               PROGRAM_SEPARATION);
  54.445 -
  54.446 -            g_signal_connect(G_OBJECT(event_box), "button-press-event",
  54.447 -                             G_CALLBACK(mmyth_epg_grid_widget_clicked),
  54.448 -                             (gpointer *) epg_grid_list);
  54.449 -        }
  54.450 -
  54.451 -        epg_grid_list = g_list_reverse(epg_grid_list);
  54.452 -        mmyth_epg_grid_widget->epg_view_model =
  54.453 -            g_list_append(mmyth_epg_grid_widget->epg_view_model,
  54.454 -                          epg_grid_list);
  54.455 -
  54.456 -        gtk_box_pack_start(GTK_BOX(private->epg_programs_vbox),
  54.457 -                           epg_line_hbox, FALSE, FALSE, 0);
  54.458 -    }
  54.459 -}
  54.460 -
  54.461 -static void
  54.462 -mmyth_epg_grid_widget_mount_header(MMythEpgGridWidget *
  54.463 -                                   mmyth_epg_grid_widget)
  54.464 -{
  54.465 -    MMythEpgGridWidgetPrivate *private =
  54.466 -        MMYTH_EPG_GRID_WIDGET_GET_PRIVATE(mmyth_epg_grid_widget);
  54.467 -
  54.468 -    struct tm       hour_tm;
  54.469 -    const gchar     name_title[] = "Today";
  54.470 -    GtkWidget      *lbl_title = gtk_label_new(name_title);
  54.471 -
  54.472 -    gtk_misc_set_alignment(GTK_MISC(lbl_title), 0.0, 0.5);
  54.473 -
  54.474 -    gtk_box_pack_start(GTK_BOX(private->epg_channels_vbox),
  54.475 -                       lbl_title, FALSE, FALSE, 0);
  54.476 -
  54.477 -    /*
  54.478 -     * hours title line 
  54.479 -     */
  54.480 -    GtkWidget      *epg_programs_hours_hbox = gtk_hbox_new(TRUE, 0);
  54.481 -
  54.482 -    if (localtime_r
  54.483 -        ((time_t *) & private->current_start_time->tv_sec,
  54.484 -         &hour_tm) == NULL) {
  54.485 -        g_warning("localtime_r error in mmyth_epg_grid_widget!\n");
  54.486 -        return;
  54.487 -    }
  54.488 -
  54.489 -    if (hour_tm.tm_min > 30) {
  54.490 -        hour_tm.tm_min = 30;
  54.491 -    } else if (hour_tm.tm_min > 0) {
  54.492 -        hour_tm.tm_min = 0;
  54.493 -    }
  54.494 -
  54.495 -    gchar           hour1_str[10];
  54.496 -    strftime(hour1_str, 8, "%H:%M", &hour_tm);
  54.497 -    GtkWidget      *lbl_hour1 = gtk_label_new(hour1_str);
  54.498 -    gtk_misc_set_alignment(GTK_MISC(lbl_hour1), 0.0, 0.5);
  54.499 -
  54.500 -    hour_tm.tm_hour++;
  54.501 -    gchar           hour2_str[10];
  54.502 -    strftime(hour2_str, 8, "%H:%M", &hour_tm);
  54.503 -    GtkWidget      *lbl_hour2 = gtk_label_new(hour2_str);
  54.504 -    gtk_misc_set_alignment(GTK_MISC(lbl_hour2), 0.0, 0.5);
  54.505 -
  54.506 -    hour_tm.tm_hour++;
  54.507 -    gchar           hour3_str[10];
  54.508 -    strftime(hour3_str, 8, "%H:%M", &hour_tm);
  54.509 -    GtkWidget      *lbl_hour3 = gtk_label_new(hour3_str);
  54.510 -    gtk_misc_set_alignment(GTK_MISC(lbl_hour3), 0.0, 0.5);
  54.511 -
  54.512 -    gtk_box_pack_start(GTK_BOX(epg_programs_hours_hbox),
  54.513 -                       lbl_hour1, TRUE, TRUE, 0);
  54.514 -    gtk_box_pack_start(GTK_BOX(epg_programs_hours_hbox),
  54.515 -                       lbl_hour2, TRUE, TRUE, 0);
  54.516 -    gtk_box_pack_start(GTK_BOX(epg_programs_hours_hbox),
  54.517 -                       lbl_hour3, TRUE, TRUE, 0);
  54.518 -
  54.519 -    gtk_box_pack_start(GTK_BOX(private->epg_programs_vbox),
  54.520 -                       epg_programs_hours_hbox, FALSE, FALSE, 0);
  54.521 -}
  54.522 -
  54.523 -/******************************************************************************
  54.524 - *              INTERNAL CALLBACKS FOR STATE CHANGE                           *
  54.525 - *****************************************************************************/
  54.526 -static void
  54.527 -mmyth_epg_grid_widget_deselect_service(MMythEpgGridWidget *
  54.528 -                                       mmyth_epg_grid_widget)
  54.529 -{
  54.530 -    EpgGridItem    *epg_grid_item;
  54.531 -
  54.532 -    /*
  54.533 -     * deselect
  54.534 -     */
  54.535 -    if (mmyth_epg_grid_widget->selected_grid_item != NULL) {
  54.536 -        epg_grid_item =
  54.537 -            (EpgGridItem *) mmyth_epg_grid_widget->selected_grid_item->
  54.538 -            data;
  54.539 -        gtk_widget_set_state(GTK_WIDGET(epg_grid_item->event_box),
  54.540 -                             GTK_STATE_NORMAL);
  54.541 -    }
  54.542 -}
  54.543 -
  54.544 -static void
  54.545 -mmyth_epg_grid_widget_clicked(GtkWidget * widget,
  54.546 -                              GdkEventExpose * event, gpointer data)
  54.547 -{
  54.548 -    g_return_if_fail(data != NULL);
  54.549 -
  54.550 -    GList          *epg_grid_item_list = (GList *) data;
  54.551 -    EpgGridItem    *epg_grid_item =
  54.552 -        (EpgGridItem *) epg_grid_item_list->data;
  54.553 -
  54.554 -    /*
  54.555 -     * update the selected service 
  54.556 -     */
  54.557 -    mmyth_epg_grid_widget_update_service(epg_grid_item->object,
  54.558 -                                         (GList *) data);
  54.559 -}
  54.560 -
  54.561 -void
  54.562 -mmyth_epg_grid_widget_update_service(MMythEpgGridWidget * object,
  54.563 -                                     GList * selected_grid_list)
  54.564 -{
  54.565 -    g_return_if_fail(object != NULL);
  54.566 -    g_return_if_fail(selected_grid_list != NULL);
  54.567 -
  54.568 -    EpgGridItem    *epg_grid_item =
  54.569 -        (EpgGridItem *) selected_grid_list->data;
  54.570 -
  54.571 -    mmyth_epg_grid_widget_deselect_service(epg_grid_item->object);
  54.572 -
  54.573 -    /*
  54.574 -     * updating current selected schedule_item and schedule_list
  54.575 -     */
  54.576 -    object->selected_grid_item = selected_grid_list;
  54.577 -
  54.578 -    /*
  54.579 -     * set state of the event box 
  54.580 -     */
  54.581 -    gtk_widget_set_state(GTK_WIDGET(epg_grid_item->event_box),
  54.582 -                         GTK_STATE_SELECTED);
  54.583 -    /*
  54.584 -     * emit update signal for listeners 
  54.585 -     */
  54.586 -    g_signal_emit(object,
  54.587 -                  mmyth_epg_grid_widget_signals[SELECTION_UPDATED_SIGNAL],
  54.588 -                  0, (gpointer) epg_grid_item);
  54.589 -}
  54.590 -
  54.591 -static GtkWidget *
  54.592 -create_event_box_lbl(gchar * str, int width, const GdkColor * bg_color,
  54.593 -                     const GdkColor * fg_color)
  54.594 -{
  54.595 -    GtkWidget      *event_box = gtk_event_box_new();
  54.596 -    GtkWidget      *lbl = gtk_label_new(str);
  54.597 -    gtk_label_set_ellipsize(GTK_LABEL(lbl), PANGO_ELLIPSIZE_END);
  54.598 -
  54.599 -    gtk_widget_modify_bg(event_box, GTK_STATE_NORMAL, bg_color);
  54.600 -    gtk_widget_modify_fg(lbl, GTK_STATE_NORMAL, fg_color);
  54.601 -
  54.602 -    /*
  54.603 -     * selected colors are const
  54.604 -     */
  54.605 -    GdkColor        selected_bg_color;
  54.606 -    selected_bg_color.red = 100;
  54.607 -    selected_bg_color.green = 40000;
  54.608 -    selected_bg_color.blue = 100;
  54.609 -
  54.610 -    GdkColor        selected_fg_color;
  54.611 -    selected_fg_color.red = 100;
  54.612 -    selected_fg_color.green = 100;
  54.613 -    selected_fg_color.blue = 100;
  54.614 -
  54.615 -    gtk_widget_modify_bg(event_box, GTK_STATE_SELECTED,
  54.616 -                         &selected_bg_color);
  54.617 -    gtk_widget_modify_fg(lbl, GTK_STATE_SELECTED, &selected_fg_color);
  54.618 -
  54.619 -    gtk_misc_set_alignment(GTK_MISC(lbl), 0.0, 0.5);
  54.620 -    gtk_container_add(GTK_CONTAINER(event_box), lbl);
  54.621 -    gtk_widget_set_size_request(event_box, width, -1);
  54.622 -
  54.623 -    return event_box;
  54.624 -}
  54.625 -
  54.626 -/******************************************************************************
  54.627 - *                            METHODS                                         *
  54.628 - *****************************************************************************/
  54.629 -
  54.630 -/*
  54.631 - * Callback for hardware keys 
  54.632 - */
  54.633 -gboolean
  54.634 -mmyth_epg_grid_widget_key_press(MMythEpgGridWidget * object,
  54.635 -                                GtkWidget * widget, GdkEventKey * event)
  54.636 -{
  54.637 -    MMythEpgGridWidgetPrivate *private =
  54.638 -        MMYTH_EPG_GRID_WIDGET_GET_PRIVATE(object);
  54.639 -
  54.640 -    EpgGridItem    *epg_grid_item;
  54.641 -    GList          *tmp;
  54.642 -
  54.643 -    /*
  54.644 -     * List of selected_grid_item 
  54.645 -     */
  54.646 -    GList          *selected_view_model;
  54.647 -
  54.648 -    gint            channel_index;
  54.649 -
  54.650 -    if (object->selected_grid_item == NULL) {
  54.651 -        g_warning("No program selected");
  54.652 -        return FALSE;
  54.653 -    }
  54.654 -
  54.655 -    epg_grid_item = (EpgGridItem *) object->selected_grid_item->data;
  54.656 -
  54.657 -    channel_index = private->selected_channel_index;
  54.658 -
  54.659 -    switch (event->keyval) {
  54.660 -    case GDK_Up:
  54.661 -        selected_view_model =
  54.662 -            g_list_nth(object->epg_view_model, channel_index - 1);
  54.663 -        if (selected_view_model != NULL) {
  54.664 -            private->selected_channel_index = channel_index - 1;
  54.665 -            tmp = (GList *) selected_view_model->data;
  54.666 -            /*
  54.667 -             * TODO: select a better centralized item currently is
  54.668 -             * picking the 1st or last item 
  54.669 -             */
  54.670 -            if (g_list_next(object->selected_grid_item) == NULL &&
  54.671 -                g_list_previous(object->selected_grid_item) != NULL) {
  54.672 -                /*
  54.673 -                 * in this case the new selected will be the last 
  54.674 -                 */
  54.675 -                tmp = g_list_last(tmp);
  54.676 -            }
  54.677 -
  54.678 -            /*
  54.679 -             * update the selected service 
  54.680 -             */
  54.681 -            mmyth_epg_grid_widget_update_service(object, tmp);
  54.682 -        }
  54.683 -        return TRUE;
  54.684 -    case GDK_Down:
  54.685 -        selected_view_model =
  54.686 -            g_list_nth(object->epg_view_model, channel_index + 1);
  54.687 -        if (selected_view_model != NULL) {
  54.688 -            private->selected_channel_index = channel_index + 1;
  54.689 -            tmp = (GList *) selected_view_model->data;
  54.690 -            /*
  54.691 -             * TODO: select a better centralized item currently is
  54.692 -             * picking the 1st or last item 
  54.693 -             */
  54.694 -            if (g_list_next(object->selected_grid_item) == NULL &&
  54.695 -                g_list_previous(object->selected_grid_item) != NULL) {
  54.696 -                /*
  54.697 -                 * in this case the new selected will be the last 
  54.698 -                 */
  54.699 -                tmp = g_list_last(tmp);
  54.700 -            }
  54.701 -
  54.702 -            /*
  54.703 -             * update the selected service 
  54.704 -             */
  54.705 -            mmyth_epg_grid_widget_update_service(object, tmp);
  54.706 -        }
  54.707 -        return TRUE;
  54.708 -    case GDK_Left:
  54.709 -        tmp = g_list_previous(object->selected_grid_item);
  54.710 -        if (tmp != NULL) {
  54.711 -            /*
  54.712 -             * update the selected service 
  54.713 -             */
  54.714 -            mmyth_epg_grid_widget_update_service(object, tmp);
  54.715 -        }
  54.716 -        return TRUE;
  54.717 -    case GDK_Right:
  54.718 -        tmp = g_list_next(object->selected_grid_item);
  54.719 -        if (tmp != NULL) {
  54.720 -            /*
  54.721 -             * update the selected service 
  54.722 -             */
  54.723 -            mmyth_epg_grid_widget_update_service(object, tmp);
  54.724 -        }
  54.725 -        return TRUE;
  54.726 -    default:
  54.727 -        return TRUE;
  54.728 -    }
  54.729 -
  54.730 -    return FALSE;
  54.731 -}
  54.732 -
  54.733 -static void
  54.734 -mmyth_epg_grid_widget_fill_programinfos(MMythEpgGridWidgetPrivate *
  54.735 -                                        private)
  54.736 -{
  54.737 -    GList          *channels_list = NULL;
  54.738 -    int             y;
  54.739 -
  54.740 -    if ((private->mmyth_epg != NULL) &&
  54.741 -        (gmyth_epg_get_channel_list(private->mmyth_epg, &channels_list) <
  54.742 -         0)) {
  54.743 -        private->channel_list = NULL;
  54.744 -        return;
  54.745 -    }
  54.746 -
  54.747 -    private->channel_list = channels_list;
  54.748 -
  54.749 -    for (y = 0; y < private->DISPLAY_CHANS && channels_list; y++) {
  54.750 -        GMythChannelInfo *channel_info =
  54.751 -            (GMythChannelInfo *) channels_list->data;
  54.752 -
  54.753 -        mmyth_epg_grid_widget_fill_program_row_infos(private,
  54.754 -                                                     channel_info->
  54.755 -                                                     channel_ID, y);
  54.756 -
  54.757 -        channels_list = g_list_next(channels_list);
  54.758 -    }
  54.759 -}
  54.760 -
  54.761 -static void
  54.762 -mmyth_epg_grid_widget_fill_program_row_infos(MMythEpgGridWidgetPrivate *
  54.763 -                                             private, guint chanNum,
  54.764 -                                             guint row)
  54.765 -{
  54.766 -    gint            res = gmyth_epg_get_program_list(private->mmyth_epg,
  54.767 -                                                     &(private->
  54.768 -                                                       program_list[row]),
  54.769 -                                                     chanNum,
  54.770 -                                                     private->
  54.771 -                                                     current_start_time,
  54.772 -                                                     private->
  54.773 -                                                     current_end_time);
  54.774 -
  54.775 -    if (res < 0) {
  54.776 -        g_warning("[%s] Error while retrieving epg programs",
  54.777 -                  __FUNCTION__);
  54.778 -    }
  54.779 -}
    55.1 --- a/maemo-ui/src/mmyth_epg_grid_widget.h	Wed Aug 01 14:22:14 2007 +0100
    55.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.3 @@ -1,87 +0,0 @@
    55.4 -#ifndef __MMYTH_EPG_GRID_WIDGET_H__
    55.5 -#define __MMYTH_EPG_GRID_WIDGET_H__
    55.6 -
    55.7 -#include <glib-object.h>
    55.8 -#include <gdk/gdk.h>
    55.9 -#include <gtk/gtkvbox.h>
   55.10 -#include <gtk/gtkeventbox.h>
   55.11 -
   55.12 -#include <gmyth/gmyth_common.h>
   55.13 -#include <gmyth/gmyth_backendinfo.h>
   55.14 -#define MAX_DISPLAY_CHANS 4
   55.15 -
   55.16 -G_BEGIN_DECLS
   55.17 -#define MMYTH_EPG_GRID_WIDGET_TYPE               (mmyth_epg_grid_widget_get_type ())
   55.18 -#define MMYTH_EPG_GRID_WIDGET(obj)               (GTK_CHECK_CAST ((obj), MMYTH_EPG_GRID_WIDGET_TYPE, MMythEpgGridWidget))
   55.19 -#define MMYTH_EPG_GRID_WIDGET_CLASS(klass)       (GTK_CHECK_CLASS_CAST ((klass), MMYTH_EPG_GRID_WIDGET_TYPE, MMythEpgGridWidgetClass))
   55.20 -#define IS_MMYTH_EPG_GRID_WIDGET(obj)            (GTK_CHECK_TYPE ((obj), MMYTH_EPG_GRID_WIDGET_TYPE))
   55.21 -#define IS_MMYTH_EPG_GRID_WIDGET_CLASS(klass)    (GTK_CHECK_CLASS_TYPE ((klass), MMYTH_EPG_GRID_WIDGET_TYPE))
   55.22 -#define MMYTH_EPG_GRID_WIDGET_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), MMYTH_EPG_GRID_WIDGET_TYPE, MMythEpgGridWidgetClass))
   55.23 -#define MMYTH_EPG_GRID_WIDGET_GET_PRIVATE(obj)   (G_TYPE_INSTANCE_GET_PRIVATE ((obj), MMYTH_EPG_GRID_WIDGET_TYPE, MMythEpgGridWidgetPrivate))
   55.24 -typedef struct _MMythEpgGridWidget MMythEpgGridWidget;
   55.25 -typedef struct _MMythEpgGridWidgetClass MMythEpgGridWidgetClass;
   55.26 -typedef struct _MMythEpgGridWidgetPrivate MMythEpgGridWidgetPrivate;
   55.27 -
   55.28 -struct _MMythEpgGridWidgetClass {
   55.29 -    GtkEventBoxClass parent_class;
   55.30 -
   55.31 -    /*
   55.32 -     * callbacks 
   55.33 -     */
   55.34 -    /*
   55.35 -     * no one for now 
   55.36 -     */
   55.37 -};
   55.38 -
   55.39 -struct _MMythEpgGridWidget {
   55.40 -    GtkEventBox     event_box;
   55.41 -
   55.42 -    /*
   55.43 -     * Selected Widgets Logic
   55.44 -     */
   55.45 -    /*
   55.46 -     * List os Service Model in the current view the data of this list are 
   55.47 -     * GList for the programs of each service 
   55.48 -     */
   55.49 -    GList          *epg_view_model;
   55.50 -
   55.51 -    /*
   55.52 -     * Selected Schedule Item
   55.53 -     */
   55.54 -    GList          *selected_grid_item;
   55.55 -
   55.56 -};
   55.57 -
   55.58 -
   55.59 -GType           mmyth_epg_grid_widget_get_type(void);
   55.60 -GtkWidget      *mmyth_epg_grid_widget_new(void);
   55.61 -/*
   55.62 - * DVBHScheduleEvent* mmyth_epg_grid_get_selected_schedule
   55.63 - * (MMythEpgGridWidget * object);
   55.64 - */
   55.65 -void            mmyth_epg_grid_widget_update_service(MMythEpgGridWidget *
   55.66 -                                                     object,
   55.67 -                                                     GList *
   55.68 -                                                     epg_grid_item_node);
   55.69 -gboolean        mmyth_epg_grid_widget_key_press(MMythEpgGridWidget *
   55.70 -                                                object, GtkWidget * widget,
   55.71 -                                                GdkEventKey * event);
   55.72 -
   55.73 -typedef struct _EpgGridItem EpgGridItem;
   55.74 -
   55.75 -/*
   55.76 - * FIXME: auxiliary struct 
   55.77 - */
   55.78 -struct _EpgGridItem {
   55.79 -
   55.80 -    GMythProgramInfo *proginfo;
   55.81 -    GtkWidget      *event_box;
   55.82 -
   55.83 -    /*
   55.84 -     * for callback purposes 
   55.85 -     */
   55.86 -    MMythEpgGridWidget *object;
   55.87 -};
   55.88 -
   55.89 -G_END_DECLS
   55.90 -#endif                          /* __MMYTH_EPG_GRID_WIDGET_H__ */
    56.1 --- a/maemo-ui/src/mmyth_main.c	Wed Aug 01 14:22:14 2007 +0100
    56.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.3 @@ -1,122 +0,0 @@
    56.4 -
    56.5 -#include <gtk/gtk.h>
    56.6 -
    56.7 -#include "config.h"
    56.8 -
    56.9 -#ifdef MAEMO_PLATFORM
   56.10 -#include "hildon-widgets/hildon-program.h"
   56.11 -#include "hildon-widgets/hildon-window.h"
   56.12 -#endif
   56.13 -
   56.14 -#include <gmyth/gmyth_recorder.h>
   56.15 -#include <gmyth/gmyth_backendinfo.h>
   56.16 -#include <gmyth/gmyth_tvchain.h>
   56.17 -#include <gmyth/gmyth_remote_util.h>
   56.18 -
   56.19 -#include "mmyth_ui.h"
   56.20 -#include "mmyth_tvplayer.h"
   56.21 -
   56.22 -static void
   56.23 -cb_destroy(GtkWidget * widget, gpointer data)
   56.24 -{
   56.25 -    MMythUi        *mmyth_ui = (MMythUi *) data;
   56.26 -
   56.27 -    if (mmyth_ui->tvplayer != NULL) {
   56.28 -        if (mmyth_tvplayer_is_playing(mmyth_ui->tvplayer))
   56.29 -            mmyth_tvplayer_stop_playing(mmyth_ui->tvplayer);
   56.30 -    }
   56.31 -
   56.32 -    mmyth_ui_finalize(mmyth_ui);
   56.33 -
   56.34 -    gtk_main_quit();
   56.35 -}
   56.36 -
   56.37 -#ifdef NDEBUG
   56.38 -static void
   56.39 -debug_error_func(const gchar * log_domain, GLogLevelFlags log_level,
   56.40 -                 const gchar * message, gpointer user_data)
   56.41 -{
   56.42 -    /*
   56.43 -     * leave this with NO print out messages, once you need to disable
   56.44 -     * debug messages! 
   56.45 -     */
   56.46 -    // g_print ( "[%s] DEBUG messages disabled!\n", __FUNCTION__ );
   56.47 -}
   56.48 -#endif
   56.49 -
   56.50 -gint
   56.51 -main(gint argc, gchar * argv[])
   56.52 -{
   56.53 -    GtkWidget      *window;
   56.54 -    MMythUi        *mmyth_ui;
   56.55 -#ifdef MAEMO_PLATFORM
   56.56 -    HildonProgram  *program = NULL;
   56.57 -#endif
   56.58 -
   56.59 -    /*
   56.60 -     * init threads 
   56.61 -     */
   56.62 -    g_thread_init(NULL);
   56.63 -
   56.64 -    /*
   56.65 -     * Initializes GTK 
   56.66 -     */
   56.67 -    gtk_init(&argc, &argv);
   56.68 -    gst_init(&argc, &argv);
   56.69 -#ifdef NDEBUG
   56.70 -    g_log_set_default_handler(debug_error_func, NULL);
   56.71 -#endif
   56.72 -
   56.73 -    /*
   56.74 -     * Init libmmyth context 
   56.75 -     */
   56.76 -    /*
   56.77 -     * TODO 
   56.78 -     */
   56.79 -#ifndef MAEMO_PLATFORM
   56.80 -    /*
   56.81 -     * create the main window 
   56.82 -     */
   56.83 -    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   56.84 -    gtk_widget_set_size_request(window, MAIN_WINDOW_WIDTH,
   56.85 -                                MAIN_WINDOW_HEIGHT);
   56.86 -    gtk_window_set_title(GTK_WINDOW(window), "Mythtv Frontend");
   56.87 -#else
   56.88 -    /*
   56.89 -     * Creating Hildonized main view 
   56.90 -     */
   56.91 -    program = HILDON_PROGRAM(hildon_program_get_instance());
   56.92 -    window = hildon_window_new();
   56.93 -
   56.94 -    // g_signal_connect(G_OBJECT(window), "delete_event", gtk_main_quit,
   56.95 -    // NULL);
   56.96 -
   56.97 -    hildon_program_add_window(program, HILDON_WINDOW(window));
   56.98 -    g_set_application_name("Maemo Mythtv");
   56.99 -#endif
  56.100 -
  56.101 -    /*
  56.102 -     * Initializes MMyth Widgets 
  56.103 -     */
  56.104 -#ifdef MAEMO_PLATFORM
  56.105 -    mmyth_ui = mmyth_ui_initialize(program, window);
  56.106 -#else
  56.107 -    mmyth_ui = mmyth_ui_initialize(window);
  56.108 -#endif
  56.109 -
  56.110 -    // mmyth_ui->loop = g_main_loop_new (NULL, FALSE);
  56.111 -
  56.112 -    /*
  56.113 -     * Connect destroy signal handling 
  56.114 -     */
  56.115 -    g_signal_connect(window, "destroy", G_CALLBACK(cb_destroy), mmyth_ui);
  56.116 -
  56.117 -    /*
  56.118 -     * Shows main window and start gtk loop 
  56.119 -     */
  56.120 -    gtk_widget_show(window);
  56.121 -
  56.122 -    gtk_main();
  56.123 -
  56.124 -    return 0;
  56.125 -}
    57.1 --- a/maemo-ui/src/mmyth_recordui.c	Wed Aug 01 14:22:14 2007 +0100
    57.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.3 @@ -1,433 +0,0 @@
    57.4 -#include <gtk/gtk.h>
    57.5 -#include <glib.h>
    57.6 -#include <sys/types.h>
    57.7 -#include <sys/stat.h>
    57.8 -#include <unistd.h>
    57.9 -#include <string.h>
   57.10 -#include <stdio.h>
   57.11 -#include <stdlib.h>
   57.12 -
   57.13 -#include "mmyth_ui.h"
   57.14 -#include "mmyth_recordui.h"
   57.15 -
   57.16 -/*
   57.17 - * GMyth library includes 
   57.18 - */
   57.19 -#include <gmyth/gmyth_scheduler.h>
   57.20 -#include <gmyth/gmyth_util.h>
   57.21 -
   57.22 -enum {
   57.23 -    START_DATE_COLUMN = 0,
   57.24 -    TITLE_COLUMN,
   57.25 -    CHAN_ID_COLUMN,
   57.26 -    END_TIME_COLUMN,
   57.27 -    RECORD_ID_COLUMN,
   57.28 -    BASENAME_COLUMN,
   57.29 -    N_COLUMNS
   57.30 -};
   57.31 -
   57.32 -gboolean
   57.33 -mmyth_recordui_reload_all(MMythRecordUI * recordui)
   57.34 -{
   57.35 -    gboolean        res = FALSE;
   57.36 -
   57.37 -    res = mmyth_recordui_reload_schedule(recordui);
   57.38 -
   57.39 -    res = res & mmyth_recordui_reload_record(recordui);
   57.40 -
   57.41 -
   57.42 -    if (!res)
   57.43 -        g_warning
   57.44 -            ("[%s] Error while reloading schedule and recording content",
   57.45 -             __FUNCTION__);
   57.46 -
   57.47 -    return res;
   57.48 -}
   57.49 -
   57.50 -gboolean
   57.51 -mmyth_recordui_reload_schedule(MMythRecordUI * recordui)
   57.52 -{
   57.53 -    gint            new_row = 0;
   57.54 -    ScheduleInfo   *schedule_info;
   57.55 -    GList          *schedule_list;
   57.56 -    GtkTreeIter     iter;
   57.57 -    gchar          *start_date_time = NULL;
   57.58 -    gchar          *end_date_time = NULL;
   57.59 -    GString        *str_aux = g_string_new("");
   57.60 -    gint            res;
   57.61 -
   57.62 -    gtk_tree_store_clear(recordui->sch_tree_store);
   57.63 -
   57.64 -    res =
   57.65 -        gmyth_scheduler_get_schedule_list(recordui->scheduler,
   57.66 -                                          &(schedule_list));
   57.67 -    if (res < 0) {
   57.68 -        g_warning
   57.69 -            ("[%s] Retrieved NULL list of scheduled data from database",
   57.70 -             __FUNCTION__);
   57.71 -        return FALSE;
   57.72 -    }
   57.73 -
   57.74 -    for (; schedule_list; schedule_list = schedule_list->next) {
   57.75 -        schedule_info = (ScheduleInfo *) schedule_list->data;
   57.76 -
   57.77 -        gtk_tree_store_insert(recordui->sch_tree_store, &iter, NULL,
   57.78 -                              new_row++);
   57.79 -
   57.80 -        start_date_time =
   57.81 -            gmyth_util_time_to_string_from_time_val(schedule_info->
   57.82 -                                                    start_time);
   57.83 -        end_date_time =
   57.84 -            gmyth_util_time_to_string_from_time_val(schedule_info->
   57.85 -                                                    end_time);
   57.86 -
   57.87 -        g_string_printf(str_aux, "%d", schedule_info->channel_id);
   57.88 -
   57.89 -        gtk_tree_store_set(recordui->sch_tree_store, &iter, START_DATE_COLUMN, start_date_time, TITLE_COLUMN, schedule_info->title->str, CHAN_ID_COLUMN, str_aux->str, END_TIME_COLUMN, end_date_time,  // It 
   57.90 -                                                                                                                                                                                                        // doesn't 
   57.91 -                                                                                                                                                                                                        // appear
   57.92 -                           RECORD_ID_COLUMN, schedule_info->record_id, -1); // the 
   57.93 -                                                                            // last 
   57.94 -                                                                            // line 
   57.95 -                                                                            // is 
   57.96 -                                                                            // a 
   57.97 -                                                                            // hidden 
   57.98 -                                                                            // item 
   57.99 -                                                                            // to 
  57.100 -                                                                            // be 
  57.101 -                                                                            // used 
  57.102 -                                                                            // in 
  57.103 -                                                                            // searching 
  57.104 -                                                                            // tasks
  57.105 -    }
  57.106 -
  57.107 -    g_debug("[%s] %d lines added to schedule list UI", __FUNCTION__,
  57.108 -            new_row);
  57.109 -
  57.110 -    /*
  57.111 -     * free allocated memory 
  57.112 -     */
  57.113 -    if (!start_date_time)
  57.114 -        g_free(start_date_time);
  57.115 -    if (!end_date_time)
  57.116 -        g_free(end_date_time);
  57.117 -    g_string_free(str_aux, FALSE);
  57.118 -
  57.119 -    return TRUE;
  57.120 -}
  57.121 -
  57.122 -gboolean
  57.123 -mmyth_recordui_reload_record(MMythRecordUI * recordui)
  57.124 -{
  57.125 -    gint            new_row = 0;
  57.126 -    RecordedInfo   *recorded_info;
  57.127 -    GList          *record_list = NULL;
  57.128 -    GtkTreeIter     iter;
  57.129 -    gchar          *start_date_time = NULL;
  57.130 -    gchar          *end_date_time = NULL;
  57.131 -    GString        *str_aux = g_string_new("");
  57.132 -    gint            res;
  57.133 -
  57.134 -    gtk_tree_store_clear(recordui->rec_tree_store);
  57.135 -
  57.136 -    res =
  57.137 -        gmyth_scheduler_get_recorded_list(recordui->scheduler,
  57.138 -                                          &record_list);
  57.139 -    if (res < 0) {
  57.140 -        g_warning
  57.141 -            ("[%s] Retrieved NULL list of recorded data from database",
  57.142 -             __FUNCTION__);
  57.143 -        return FALSE;
  57.144 -    }
  57.145 -
  57.146 -    for (; record_list; record_list = record_list->next) {
  57.147 -        recorded_info = (RecordedInfo *) record_list->data;
  57.148 -
  57.149 -        gtk_tree_store_insert(recordui->rec_tree_store, &iter, NULL,
  57.150 -                              new_row++);
  57.151 -
  57.152 -        start_date_time =
  57.153 -            gmyth_util_time_to_string_from_time_val(recorded_info->
  57.154 -                                                    start_time);
  57.155 -        end_date_time =
  57.156 -            gmyth_util_time_to_string_from_time_val(recorded_info->
  57.157 -                                                    end_time);
  57.158 -
  57.159 -        g_string_printf(str_aux, "%d", recorded_info->channel_id);
  57.160 -
  57.161 -        gtk_tree_store_set(recordui->rec_tree_store, &iter, START_DATE_COLUMN, start_date_time, TITLE_COLUMN, recorded_info->title->str, CHAN_ID_COLUMN, str_aux->str, END_TIME_COLUMN, end_date_time,  // It 
  57.162 -                                                                                                                                                                                                        // doesn't 
  57.163 -                                                                                                                                                                                                        // appear
  57.164 -                           RECORD_ID_COLUMN, recorded_info->record_id,
  57.165 -                           BASENAME_COLUMN, recorded_info->basename->str,
  57.166 -                           -1);
  57.167 -        // the last line is a hidden item to be used in searching tasks 
  57.168 -    }
  57.169 -
  57.170 -    g_debug("[%s] %d lines added to record list UI", __FUNCTION__,
  57.171 -            new_row);
  57.172 -
  57.173 -    /*
  57.174 -     * free allocated memory 
  57.175 -     */
  57.176 -    if (NULL != start_date_time)
  57.177 -        g_free(start_date_time);
  57.178 -    if (NULL != end_date_time)
  57.179 -        g_free(end_date_time);
  57.180 -    g_string_free(str_aux, FALSE);
  57.181 -
  57.182 -    return TRUE;
  57.183 -}
  57.184 -
  57.185 -
  57.186 -MMythRecordUI  *
  57.187 -mmyth_recordui_new(GMythBackendInfo * backend_info)
  57.188 -{
  57.189 -    MMythRecordUI  *recordui = g_new0(MMythRecordUI, 1);
  57.190 -
  57.191 -    g_return_val_if_fail(backend_info != NULL, NULL);
  57.192 -
  57.193 -    recordui->backend_info = backend_info;
  57.194 -
  57.195 -    recordui->scrolled_window = gtk_scrolled_window_new(NULL, NULL);
  57.196 -    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW
  57.197 -                                   (recordui->scrolled_window),
  57.198 -                                   GTK_POLICY_AUTOMATIC,
  57.199 -                                   GTK_POLICY_AUTOMATIC);
  57.200 -
  57.201 -    recordui->viewport = gtk_viewport_new(NULL, NULL);
  57.202 -    gtk_container_add(GTK_CONTAINER(recordui->scrolled_window),
  57.203 -                      recordui->viewport);
  57.204 -
  57.205 -    recordui->notebook = gtk_notebook_new();
  57.206 -    gtk_container_set_border_width(GTK_CONTAINER(recordui->notebook), 1);
  57.207 -    gtk_notebook_set_scrollable(GTK_NOTEBOOK(recordui->notebook), TRUE);
  57.208 -    gtk_notebook_popup_enable(GTK_NOTEBOOK(recordui->notebook));
  57.209 -    gtk_container_add(GTK_CONTAINER(recordui->viewport),
  57.210 -                      recordui->notebook);
  57.211 -    gtk_notebook_popup_disable(GTK_NOTEBOOK(recordui->notebook));
  57.212 -
  57.213 -    /*
  57.214 -     * Schedule tab 
  57.215 -     */
  57.216 -    recordui->sch_scrolled_window = gtk_scrolled_window_new(NULL, NULL);
  57.217 -    gtk_container_add(GTK_CONTAINER(recordui->notebook),
  57.218 -                      recordui->sch_scrolled_window);
  57.219 -    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW
  57.220 -                                   (recordui->sch_scrolled_window),
  57.221 -                                   GTK_POLICY_AUTOMATIC,
  57.222 -                                   GTK_POLICY_AUTOMATIC);
  57.223 -    gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW
  57.224 -                                        (recordui->sch_scrolled_window),
  57.225 -                                        GTK_SHADOW_IN);
  57.226 -
  57.227 -    /*
  57.228 -     * The basename column in the sched_tree_store is not being used
  57.229 -     */
  57.230 -    recordui->sch_tree_store =
  57.231 -        gtk_tree_store_new(N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING,
  57.232 -                           G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT,
  57.233 -                           G_TYPE_STRING);
  57.234 -
  57.235 -    recordui->sch_treeview =
  57.236 -        gtk_tree_view_new_with_model(GTK_TREE_MODEL
  57.237 -                                     (recordui->sch_tree_store));
  57.238 -    gtk_container_add(GTK_CONTAINER(recordui->sch_scrolled_window),
  57.239 -                      recordui->sch_treeview);
  57.240 -    recordui->sch_renderer = gtk_cell_renderer_text_new();
  57.241 -    // g_object_set(G_OBJECT(renderer1), "foreground", "green",
  57.242 -    // "background", "black", NULL);
  57.243 -    recordui->sch_column1 =
  57.244 -        gtk_tree_view_column_new_with_attributes("Start time",
  57.245 -                                                 recordui->sch_renderer,
  57.246 -                                                 "text", START_DATE_COLUMN,
  57.247 -                                                 NULL);
  57.248 -    gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->sch_treeview),
  57.249 -                                recordui->sch_column1);
  57.250 -    recordui->sch_column2 =
  57.251 -        gtk_tree_view_column_new_with_attributes("Title",
  57.252 -                                                 recordui->sch_renderer,
  57.253 -                                                 "text", TITLE_COLUMN,
  57.254 -                                                 NULL);
  57.255 -    gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->sch_treeview),
  57.256 -                                recordui->sch_column2);
  57.257 -    recordui->sch_column3 =
  57.258 -        gtk_tree_view_column_new_with_attributes("Channel",
  57.259 -                                                 recordui->sch_renderer,
  57.260 -                                                 "text", CHAN_ID_COLUMN,
  57.261 -                                                 NULL);
  57.262 -    gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->sch_treeview),
  57.263 -                                recordui->sch_column3);
  57.264 -    gtk_tree_view_column_set_resizable(recordui->sch_column1, TRUE);
  57.265 -    gtk_tree_view_column_set_resizable(recordui->sch_column2, TRUE);
  57.266 -    gtk_tree_view_column_set_resizable(recordui->sch_column3, TRUE);
  57.267 -    gtk_tree_view_column_set_reorderable(recordui->sch_column1, TRUE);
  57.268 -    gtk_tree_view_column_set_reorderable(recordui->sch_column2, TRUE);
  57.269 -    gtk_tree_view_column_set_reorderable(recordui->sch_column3, TRUE);
  57.270 -    // recordui->sch_column4 = 
  57.271 -    // gtk_tree_view_column_new_with_attributes("",
  57.272 -    // recordui->sch_renderer, "text", END_TIME_COLUMN, NULL);
  57.273 -    // gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->sch_treeview), 
  57.274 -    // recordui->sch_column4);
  57.275 -
  57.276 -    recordui->sch_label = gtk_label_new(("Schedule"));
  57.277 -    gtk_notebook_set_tab_label(GTK_NOTEBOOK(recordui->notebook),
  57.278 -                               gtk_notebook_get_nth_page(GTK_NOTEBOOK
  57.279 -                                                         (recordui->
  57.280 -                                                          notebook), 0),
  57.281 -                               recordui->sch_label);
  57.282 -
  57.283 -    // Record items tab
  57.284 -    // g_object_set(G_OBJECT(renderer2), "foreground", "blue", NULL);
  57.285 -    recordui->rec_scrolled_window = gtk_scrolled_window_new(NULL, NULL);
  57.286 -    gtk_container_add(GTK_CONTAINER(recordui->notebook),
  57.287 -                      recordui->rec_scrolled_window);
  57.288 -    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW
  57.289 -                                   (recordui->rec_scrolled_window),
  57.290 -                                   GTK_POLICY_AUTOMATIC,
  57.291 -                                   GTK_POLICY_AUTOMATIC);
  57.292 -    gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW
  57.293 -                                        (recordui->rec_scrolled_window),
  57.294 -                                        GTK_SHADOW_IN);
  57.295 -
  57.296 -    recordui->rec_tree_store =
  57.297 -        gtk_tree_store_new(N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING,
  57.298 -                           G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT,
  57.299 -                           G_TYPE_STRING);
  57.300 -    recordui->rec_treeview =
  57.301 -        gtk_tree_view_new_with_model(GTK_TREE_MODEL
  57.302 -                                     (recordui->rec_tree_store));
  57.303 -    gtk_container_add(GTK_CONTAINER(recordui->rec_scrolled_window),
  57.304 -                      recordui->rec_treeview);
  57.305 -    recordui->rec_renderer = gtk_cell_renderer_text_new();
  57.306 -    // g_object_set(G_OBJECT(renderer1), "foreground", "green",
  57.307 -    // "background", "black", NULL);
  57.308 -
  57.309 -    recordui->rec_column1 =
  57.310 -        gtk_tree_view_column_new_with_attributes("Start time",
  57.311 -                                                 recordui->rec_renderer,
  57.312 -                                                 "text", START_DATE_COLUMN,
  57.313 -                                                 NULL);
  57.314 -    gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->rec_treeview),
  57.315 -                                recordui->rec_column1);
  57.316 -    recordui->rec_column2 =
  57.317 -        gtk_tree_view_column_new_with_attributes("Title",
  57.318 -                                                 recordui->rec_renderer,
  57.319 -                                                 "text", TITLE_COLUMN,
  57.320 -                                                 NULL);
  57.321 -    gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->rec_treeview),
  57.322 -                                recordui->rec_column2);
  57.323 -    recordui->rec_column3 =
  57.324 -        gtk_tree_view_column_new_with_attributes("Channel",
  57.325 -                                                 recordui->rec_renderer,
  57.326 -                                                 "text", CHAN_ID_COLUMN,
  57.327 -                                                 NULL);
  57.328 -    gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->rec_treeview),
  57.329 -                                recordui->rec_column3);
  57.330 -    gtk_tree_view_column_set_resizable(recordui->rec_column1, TRUE);
  57.331 -    gtk_tree_view_column_set_resizable(recordui->rec_column2, TRUE);
  57.332 -    gtk_tree_view_column_set_resizable(recordui->rec_column3, TRUE);
  57.333 -    gtk_tree_view_column_set_reorderable(recordui->rec_column1, TRUE);
  57.334 -    gtk_tree_view_column_set_reorderable(recordui->rec_column2, TRUE);
  57.335 -    gtk_tree_view_column_set_reorderable(recordui->rec_column3, TRUE);
  57.336 -    // recordui->rec_column4 =
  57.337 -    // gtk_tree_view_column_new_with_attributes("",
  57.338 -    // recordui->rec_renderer, "text", END_TIME_COLUMN, NULL);
  57.339 -    // gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->rec_treeview),
  57.340 -    // recordui->rec_column4);
  57.341 -
  57.342 -    recordui->rec_label = gtk_label_new(("Recorded"));
  57.343 -    gtk_notebook_set_tab_label(GTK_NOTEBOOK(recordui->notebook),
  57.344 -                               gtk_notebook_get_nth_page(GTK_NOTEBOOK
  57.345 -                                                         (recordui->
  57.346 -                                                          notebook), 1),
  57.347 -                               recordui->rec_label);
  57.348 -
  57.349 -    // Gets the mmyth scheduler manager
  57.350 -    recordui->scheduler = gmyth_scheduler_new(backend_info);
  57.351 -
  57.352 -    /*
  57.353 -     * init connection to the backend 
  57.354 -     */
  57.355 -    gmyth_scheduler_connect(recordui->scheduler,
  57.356 -                            recordui->scheduler->backend_info);
  57.357 -
  57.358 -    return recordui;
  57.359 -}
  57.360 -
  57.361 -void
  57.362 -mmyth_recordui_free(MMythRecordUI * recordui)
  57.363 -{
  57.364 -    // FIXME: Release memory here!
  57.365 -    /*
  57.366 -     * close connection to the backend 
  57.367 -     */
  57.368 -    gmyth_scheduler_disconnect(recordui->scheduler);
  57.369 -}
  57.370 -
  57.371 -void
  57.372 -mmyth_recordui_delete_selected(GtkButton * button,
  57.373 -                               MMythRecordUI * recordui)
  57.374 -{
  57.375 -    GtkTreeSelection *selection;
  57.376 -    GtkTreeModel   *list_store;
  57.377 -    GtkTreeIter     iter;
  57.378 -    int             index;
  57.379 -    int             curr_page = 0;
  57.380 -
  57.381 -    curr_page =
  57.382 -        gtk_notebook_get_current_page(GTK_NOTEBOOK(recordui->notebook));
  57.383 -
  57.384 -    if (curr_page == 0) {
  57.385 -        selection =
  57.386 -            gtk_tree_view_get_selection(GTK_TREE_VIEW
  57.387 -                                        (recordui->sch_treeview));
  57.388 -        if (selection != NULL) {
  57.389 -            gtk_tree_selection_get_selected(selection, &list_store, &iter);
  57.390 -            gtk_tree_model_get(list_store, &iter, RECORD_ID_COLUMN, &index,
  57.391 -                               -1);
  57.392 -            gmyth_scheduler_delete_schedule(recordui->scheduler, index);
  57.393 -            mmyth_recordui_reload_schedule(recordui);
  57.394 -            return;
  57.395 -        }
  57.396 -
  57.397 -    } else if (curr_page == 1) {
  57.398 -        selection =
  57.399 -            gtk_tree_view_get_selection(GTK_TREE_VIEW
  57.400 -                                        (recordui->rec_treeview));
  57.401 -        if (selection != NULL) {
  57.402 -            gtk_tree_selection_get_selected(selection, &list_store, &iter);
  57.403 -            gtk_tree_model_get(list_store, &iter, RECORD_ID_COLUMN, &index,
  57.404 -                               -1);
  57.405 -            gmyth_scheduler_delete_recorded(recordui->scheduler, index);
  57.406 -            mmyth_recordui_reload_record(recordui);
  57.407 -            return;
  57.408 -        }
  57.409 -    }
  57.410 -
  57.411 -    g_warning("[%s] None element was removed from the list", __FUNCTION__);
  57.412 -}
  57.413 -
  57.414 -/*
  57.415 - * FIXME: change this function name, it is returning the basename_column
  57.416 - * that represents the nuv filename of the recorded content 
  57.417 - */
  57.418 -gchar          *
  57.419 -mmyth_recordui_get_selected_recorded(MMythRecordUI * recordui)
  57.420 -{
  57.421 -    GtkTreeSelection *selection = NULL;
  57.422 -    GtkTreeModel   *list_store = NULL;
  57.423 -    GtkTreeIter     iter;
  57.424 -    gchar          *path = NULL;
  57.425 -
  57.426 -    /*
  57.427 -     * returning nuv filename, basename_column 
  57.428 -     */
  57.429 -    selection =
  57.430 -        gtk_tree_view_get_selection(GTK_TREE_VIEW(recordui->rec_treeview));
  57.431 -    if (gtk_tree_selection_get_selected(selection, &list_store, &iter)) {
  57.432 -        gtk_tree_model_get(list_store, &iter, BASENAME_COLUMN, &path, -1);
  57.433 -    }
  57.434 -    // FIXME: MOVE THIS TO OTHER PLACE
  57.435 -    return path;
  57.436 -}
    58.1 --- a/maemo-ui/src/mmyth_recordui.h	Wed Aug 01 14:22:14 2007 +0100
    58.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.3 @@ -1,52 +0,0 @@
    58.4 -#ifndef MMYTH_RECORD_H_
    58.5 -#define MMYTH_RECORD_H_
    58.6 -
    58.7 -#include <gmyth/gmyth_scheduler.h>
    58.8 -#include <gmyth/gmyth_backendinfo.h>
    58.9 -
   58.10 -typedef struct _MMythRecordUI {
   58.11 -    GtkWidget      *scrolled_window;
   58.12 -    GtkWidget      *viewport;
   58.13 -    GtkWidget      *notebook;
   58.14 -
   58.15 -    GtkWidget      *rec_scrolled_window;
   58.16 -    GtkWidget      *sch_scrolled_window;
   58.17 -    GtkWidget      *rec_treeview;
   58.18 -    GtkWidget      *sch_treeview;
   58.19 -    GtkWidget      *rec_label;
   58.20 -    GtkWidget      *sch_label;
   58.21 -
   58.22 -    GtkTreeViewColumn *rec_column1;
   58.23 -    GtkTreeViewColumn *rec_column2;
   58.24 -    GtkTreeViewColumn *rec_column3;
   58.25 -    GtkTreeViewColumn *rec_column4;
   58.26 -    GtkTreeViewColumn *sch_column1;
   58.27 -    GtkTreeViewColumn *sch_column2;
   58.28 -    GtkTreeViewColumn *sch_column3;
   58.29 -    GtkTreeViewColumn *sch_column4;
   58.30 -
   58.31 -    GtkCellRenderer *rec_renderer;
   58.32 -    GtkCellRenderer *sch_renderer;
   58.33 -
   58.34 -    GtkTreeStore   *sch_tree_store;
   58.35 -    GtkTreeStore   *rec_tree_store;
   58.36 -
   58.37 -    GMythScheduler *scheduler;
   58.38 -
   58.39 -    GMythBackendInfo *backend_info;
   58.40 -
   58.41 -} MMythRecordUI;
   58.42 -
   58.43 -MMythRecordUI  *mmyth_recordui_new(GMythBackendInfo * backend_info);
   58.44 -void            mmyth_recordui_free(MMythRecordUI * recordui);
   58.45 -
   58.46 -void            mmyth_recordui_delete_selected(GtkButton * button,
   58.47 -                                               MMythRecordUI * recordui);
   58.48 -gboolean        mmyth_recordui_reload_all(MMythRecordUI * recordui);
   58.49 -gboolean        mmyth_recordui_reload_schedule(MMythRecordUI * recordui);
   58.50 -gboolean        mmyth_recordui_reload_record(MMythRecordUI * recordui);
   58.51 -
   58.52 -gchar          *mmyth_recordui_get_selected_recorded(MMythRecordUI *
   58.53 -                                                     recordui);
   58.54 -
   58.55 -#endif                          /* MMYTH_RECORD_H_ */
    59.1 --- a/maemo-ui/src/mmyth_schedulerui.c	Wed Aug 01 14:22:14 2007 +0100
    59.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    59.3 @@ -1,443 +0,0 @@
    59.4 -#include <gtk/gtk.h>
    59.5 -#include <glib.h>
    59.6 -#include <glib/gprintf.h>
    59.7 -#include <sys/types.h>
    59.8 -#include <sys/stat.h>
    59.9 -#include <unistd.h>
   59.10 -#include <string.h>
   59.11 -#include <stdio.h>
   59.12 -
   59.13 -#include "mmyth_ui.h"
   59.14 -#include "mmyth_uicommon.h"
   59.15 -#include "mmyth_recordui.h"
   59.16 -#include "mmyth_schedulerui.h"
   59.17 -
   59.18 -/*
   59.19 - * GMyth library includes 
   59.20 - */
   59.21 -#include <gmyth/gmyth_scheduler.h>
   59.22 -#include <gmyth/gmyth_common.h>
   59.23 -#include <gmyth/gmyth_epg.h>
   59.24 -
   59.25 -static void     run_calendar_dialog(GtkButton * button, gpointer data);
   59.26 -
   59.27 -static void     add_channel_field(MMythSchedulerUI * scheduler_ui,
   59.28 -                                  GtkWidget * vbox);
   59.29 -static void     add_time_field(MMythSchedulerUI * scheduler_ui,
   59.30 -                               GtkWidget * vbox);
   59.31 -static void     add_date_field(MMythSchedulerUI * scheduler_ui,
   59.32 -                               GtkWidget * vbox);
   59.33 -static void     add_duration_field(MMythSchedulerUI * scheduler_ui,
   59.34 -                                   GtkWidget * vbox);
   59.35 -static void     add_frequency_field(MMythSchedulerUI * scheduler_ui,
   59.36 -                                    GtkWidget * vbox);
   59.37 -static void     add_title_field(MMythSchedulerUI * scheduler_ui,
   59.38 -                                GtkWidget * vbox);
   59.39 -
   59.40 -MMythSchedulerUI *
   59.41 -mmyth_schedulerui_new(GMythBackendInfo * backend_info)
   59.42 -{
   59.43 -    GtkWidget      *scrolledwindow;
   59.44 -    GtkWidget      *viewport;
   59.45 -    GtkWidget      *head_hbox;
   59.46 -    GtkWidget      *fields_vbox;
   59.47 -    GtkWidget      *hseparator;
   59.48 -    GtkWidget      *label;
   59.49 -
   59.50 -    MMythSchedulerUI *scheduler_ui = g_new0(MMythSchedulerUI, 1);
   59.51 -
   59.52 -    scheduler_ui->backend_info = backend_info;
   59.53 -
   59.54 -    scrolledwindow = gtk_scrolled_window_new(NULL, NULL);
   59.55 -    scheduler_ui->main_widget = scrolledwindow;
   59.56 -    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow),
   59.57 -                                   GTK_POLICY_AUTOMATIC,
   59.58 -                                   GTK_POLICY_AUTOMATIC);
   59.59 -
   59.60 -    // Is this needed? 
   59.61 -    viewport = gtk_viewport_new(NULL, NULL);
   59.62 -    gtk_container_add(GTK_CONTAINER(scrolledwindow), viewport);
   59.63 -
   59.64 -    // Is this needed?
   59.65 -    head_hbox = gtk_hbox_new(FALSE, 0);
   59.66 -    gtk_container_add(GTK_CONTAINER(viewport), head_hbox);
   59.67 -
   59.68 -    fields_vbox = gtk_vbox_new(FALSE, 0);
   59.69 -    gtk_box_pack_start(GTK_BOX(head_hbox), fields_vbox, TRUE, TRUE, 0);
   59.70 -    gtk_container_set_border_width(GTK_CONTAINER(fields_vbox), 10);
   59.71 -
   59.72 -    label = gtk_label_new_with_mnemonic(("Manual Schedule Recording"));
   59.73 -    gtk_box_pack_start(GTK_BOX(fields_vbox), label, FALSE, FALSE, 0);
   59.74 -    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
   59.75 -
   59.76 -    hseparator = gtk_hseparator_new();
   59.77 -    gtk_box_pack_start(GTK_BOX(fields_vbox), hseparator, FALSE, TRUE, 0);
   59.78 -
   59.79 -    add_channel_field(scheduler_ui, fields_vbox);
   59.80 -    add_time_field(scheduler_ui, fields_vbox);
   59.81 -    add_date_field(scheduler_ui, fields_vbox);
   59.82 -    add_duration_field(scheduler_ui, fields_vbox);
   59.83 -    add_frequency_field(scheduler_ui, fields_vbox);
   59.84 -    add_title_field(scheduler_ui, fields_vbox);
   59.85 -
   59.86 -    return scheduler_ui;
   59.87 -}
   59.88 -
   59.89 -static void
   59.90 -set_date_from_calendar(GtkCalendar * calendar, gpointer data)
   59.91 -{
   59.92 -    char            sched_date[24];
   59.93 -
   59.94 -    MMythSchedulerUI *scheduler_ui = (MMythSchedulerUI *) data;
   59.95 -
   59.96 -    // FIXME: Change this, save another value instead of month_temp,
   59.97 -    // day_temp, ... 
   59.98 -    gtk_calendar_get_date(GTK_CALENDAR(calendar),
   59.99 -                          &(scheduler_ui->year_temp),
  59.100 -                          &(scheduler_ui->month_temp),
  59.101 -                          &(scheduler_ui->day_temp));
  59.102 -
  59.103 -    sched_date[23] = '\0';
  59.104 -    g_sprintf(sched_date, "%04d %02d %02d (yyyy mm dd)",
  59.105 -              scheduler_ui->year_temp, scheduler_ui->month_temp + 1,
  59.106 -              scheduler_ui->day_temp);
  59.107 -
  59.108 -    gtk_button_set_label(GTK_BUTTON(scheduler_ui->date_button),
  59.109 -                         sched_date);
  59.110 -
  59.111 -    gtk_widget_destroy(scheduler_ui->calendar_dialog);
  59.112 -    scheduler_ui->calendar_dialog = NULL;
  59.113 -    scheduler_ui->calendar = NULL;
  59.114 -}
  59.115 -
  59.116 -// calendar
  59.117 -static void
  59.118 -run_calendar_dialog(GtkButton * button, gpointer data)
  59.119 -{
  59.120 -
  59.121 -    GtkWidget      *dialog_vbox;
  59.122 -    MMythSchedulerUI *scheduler_ui = (MMythSchedulerUI *) data;
  59.123 -
  59.124 -    // calendar_dialog and calendar are been released at
  59.125 -    // set_date_from_calendar ()
  59.126 -    scheduler_ui->calendar_dialog = gtk_dialog_new();
  59.127 -    gtk_container_set_border_width(GTK_CONTAINER
  59.128 -                                   (scheduler_ui->calendar_dialog), 1);
  59.129 -    gtk_window_set_title(GTK_WINDOW(scheduler_ui->calendar_dialog),
  59.130 -                         "Select starting date");
  59.131 -    gtk_window_set_position(GTK_WINDOW(scheduler_ui->calendar_dialog),
  59.132 -                            GTK_WIN_POS_CENTER);
  59.133 -    gtk_window_set_decorated(GTK_WINDOW(scheduler_ui->calendar_dialog),
  59.134 -                             FALSE);
  59.135 -
  59.136 -    dialog_vbox = GTK_DIALOG(scheduler_ui->calendar_dialog)->vbox;
  59.137 -
  59.138 -    scheduler_ui->calendar = gtk_calendar_new();
  59.139 -
  59.140 -    gtk_box_pack_start(GTK_BOX(dialog_vbox), scheduler_ui->calendar, TRUE,
  59.141 -                       TRUE, 0);
  59.142 -    gtk_calendar_display_options(GTK_CALENDAR(scheduler_ui->calendar),
  59.143 -                                 GTK_CALENDAR_SHOW_HEADING |
  59.144 -                                 GTK_CALENDAR_SHOW_DAY_NAMES);
  59.145 -
  59.146 -    gtk_widget_show_all(scheduler_ui->calendar_dialog);
  59.147 -
  59.148 -    g_signal_connect(G_OBJECT(scheduler_ui->calendar),
  59.149 -                     "day-selected-double-click",
  59.150 -                     G_CALLBACK(set_date_from_calendar), data);
  59.151 -}
  59.152 -
  59.153 -
  59.154 -gboolean
  59.155 -mmyth_schedulerui_save(MMythSchedulerUI * scheduler_ui)
  59.156 -{
  59.157 -    GMythScheduler *scheduler;
  59.158 -    ScheduleInfo   *schedule_info;
  59.159 -    GMythChannelInfo *channel_info;
  59.160 -
  59.161 -    GList          *clist;
  59.162 -    gint            index,
  59.163 -                    duration;
  59.164 -    gint            frequency;
  59.165 -    struct tm       start_tm;
  59.166 -
  59.167 -    schedule_info = g_new0(ScheduleInfo, 1);
  59.168 -    if (schedule_info == NULL) {
  59.169 -        g_warning("Error allocating memory");
  59.170 -        return FALSE;
  59.171 -    }
  59.172 -
  59.173 -    clist = scheduler_ui->channel_list;
  59.174 -
  59.175 -    index =
  59.176 -        gtk_combo_box_get_active(GTK_COMBO_BOX
  59.177 -                                 (scheduler_ui->channel_combobox));
  59.178 -
  59.179 -    if (clist != NULL)
  59.180 -        clist = g_list_nth(clist, index);
  59.181 -
  59.182 -    if (clist) {
  59.183 -        g_debug("[%s] New schedule: %d", __FUNCTION__, index);
  59.184 -    } else {
  59.185 -        g_warning("[%s] Error when adding new schedule", __FUNCTION__);
  59.186 -        return FALSE;
  59.187 -    }
  59.188 -
  59.189 -    channel_info = clist->data;
  59.190 -
  59.191 -    /*
  59.192 -     * initialize schedule_info 
  59.193 -     */
  59.194 -    schedule_info->channel_id = channel_info->channel_ID;
  59.195 -
  59.196 -    start_tm.tm_hour =
  59.197 -        (int)
  59.198 -        gtk_spin_button_get_value(GTK_SPIN_BUTTON
  59.199 -                                  (scheduler_ui->hour_spinbutton));
  59.200 -    start_tm.tm_min =
  59.201 -        (int)
  59.202 -        gtk_spin_button_get_value(GTK_SPIN_BUTTON
  59.203 -                                  (scheduler_ui->min_spinbutton));
  59.204 -    start_tm.tm_sec = 0;
  59.205 -
  59.206 -    start_tm.tm_mday = (gint) scheduler_ui->day_temp;
  59.207 -    start_tm.tm_mon = (gint) scheduler_ui->month_temp;
  59.208 -    start_tm.tm_year = (gint) scheduler_ui->year_temp - 1900;   // years
  59.209 -                                                                // since
  59.210 -                                                                // 1900
  59.211 -    GTimeVal       *time_val_local = g_new0(GTimeVal, 1);
  59.212 -    time_val_local->tv_sec = timelocal(&start_tm);
  59.213 -
  59.214 -    schedule_info->start_time = time_val_local;
  59.215 -    if (NULL == schedule_info->start_time) {
  59.216 -        g_warning("timelocal error!\n");
  59.217 -        return FALSE;
  59.218 -    }
  59.219 -
  59.220 -    duration =
  59.221 -        (gint)
  59.222 -        gtk_spin_button_get_value(GTK_SPIN_BUTTON
  59.223 -                                  (scheduler_ui->duration_spinbutton));
  59.224 -    schedule_info->end_time = schedule_info->start_time + (duration * 60);
  59.225 -
  59.226 -    /*
  59.227 -     * TODO: frequency is not implemented yet 
  59.228 -     */
  59.229 -    frequency =
  59.230 -        gtk_combo_box_get_active(GTK_COMBO_BOX
  59.231 -                                 (scheduler_ui->freq_combobox));
  59.232 -
  59.233 -    schedule_info->title = g_string_new("");
  59.234 -    g_string_printf(schedule_info->title, "%s",
  59.235 -                    gtk_entry_get_text(GTK_ENTRY
  59.236 -                                       (scheduler_ui->title_entry)));
  59.237 -
  59.238 -    /*
  59.239 -     * FIXME: Architecture change to reuse the scheduler created in the
  59.240 -     * recordui! 
  59.241 -     */
  59.242 -    scheduler = gmyth_scheduler_new();
  59.243 -
  59.244 -    gmyth_scheduler_connect(scheduler, scheduler->backend_info);
  59.245 -
  59.246 -    /*
  59.247 -     * FIXME: set record_id = -1 to add a new schedule 
  59.248 -     */
  59.249 -    schedule_info->record_id = -1;
  59.250 -    gmyth_scheduler_add_schedule(scheduler, schedule_info);
  59.251 -
  59.252 -    gmyth_scheduler_disconnect(scheduler);
  59.253 -
  59.254 -    /*
  59.255 -     * free allocated memory 
  59.256 -     */
  59.257 -    g_object_unref(scheduler);
  59.258 -    g_free(schedule_info);
  59.259 -
  59.260 -    return TRUE;
  59.261 -}
  59.262 -
  59.263 -static GtkWidget *
  59.264 -add_line(GtkWidget * vbox, const gchar * str)
  59.265 -{
  59.266 -    GtkWidget      *label;
  59.267 -    GtkWidget      *hbox = gtk_hbox_new(FALSE, 0);
  59.268 -
  59.269 -    gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
  59.270 -    gtk_container_set_border_width(GTK_CONTAINER(hbox), 3);
  59.271 -
  59.272 -    label = gtk_label_new(str);
  59.273 -    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
  59.274 -    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
  59.275 -
  59.276 -    return hbox;
  59.277 -}
  59.278 -
  59.279 -static void
  59.280 -add_channel_field(MMythSchedulerUI * scheduler_ui, GtkWidget * vbox)
  59.281 -{
  59.282 -    GtkWidget      *combobox;
  59.283 -
  59.284 -    GtkWidget      *hbox = add_line(vbox, "Channel:    ");
  59.285 -
  59.286 -    combobox = gtk_combo_box_new_text();
  59.287 -
  59.288 -    scheduler_ui->channel_combobox = combobox;
  59.289 -    gtk_box_pack_start(GTK_BOX(hbox), combobox, FALSE, FALSE, 0);
  59.290 -
  59.291 -    GMythEPG       *mmyth_epg = gmyth_epg_new();
  59.292 -    if (!gmyth_epg_connect(mmyth_epg, scheduler_ui->backend_info)) {
  59.293 -        // FIXME: Without this list the scheduler UI should not be shown!
  59.294 -        g_warning("[%s] Error when getting list of channels",
  59.295 -                  __FUNCTION__);
  59.296 -    }
  59.297 -
  59.298 -    if (gmyth_epg_get_channel_list
  59.299 -        (mmyth_epg, &(scheduler_ui->channel_list)) < 0) {
  59.300 -        g_debug("[%s] Error while trying to retrieve channel list",
  59.301 -                __FUNCTION__);
  59.302 -    } else {
  59.303 -        GList          *clist = scheduler_ui->channel_list;
  59.304 -        GMythChannelInfo *channel_info;
  59.305 -
  59.306 -        while (clist != NULL) {
  59.307 -            channel_info = clist->data;
  59.308 -            clist = clist->next;
  59.309 -            gtk_combo_box_append_text(GTK_COMBO_BOX
  59.310 -                                      (scheduler_ui->channel_combobox),
  59.311 -                                      (channel_info->channel_name->str));
  59.312 -        }
  59.313 -
  59.314 -        gtk_combo_box_set_active(GTK_COMBO_BOX
  59.315 -                                 (scheduler_ui->channel_combobox), 0);
  59.316 -    }
  59.317 -}
  59.318 -
  59.319 -static void
  59.320 -add_time_field(MMythSchedulerUI * scheduler_ui, GtkWidget * vbox)
  59.321 -{
  59.322 -    GtkWidget      *label;
  59.323 -    GtkObject      *spinbutton_adj;
  59.324 -    GtkWidget      *hbox = add_line(vbox, "Time:         ");
  59.325 -
  59.326 -    time_t          real_time;
  59.327 -    struct tm       sched_time;
  59.328 -
  59.329 -    time(&real_time);
  59.330 -
  59.331 -    if (localtime_r((time_t *) & real_time, &sched_time) == NULL) {
  59.332 -        g_warning("localtime_r error in mmyth_epg_grid_view!\n");
  59.333 -        return;
  59.334 -    }
  59.335 -
  59.336 -    if (sched_time.tm_min > 30) {
  59.337 -        sched_time.tm_hour = sched_time.tm_hour + 1;
  59.338 -        sched_time.tm_min = 0;
  59.339 -    } else if (sched_time.tm_min > 0) {
  59.340 -        sched_time.tm_min = 30;
  59.341 -    }
  59.342 -
  59.343 -    scheduler_ui->year_temp = (guint) sched_time.tm_year + 1900;
  59.344 -    scheduler_ui->month_temp = (guint) sched_time.tm_mon;
  59.345 -    scheduler_ui->day_temp = (guint) sched_time.tm_mday;
  59.346 -
  59.347 -    // hour entry
  59.348 -    spinbutton_adj =
  59.349 -        gtk_adjustment_new(sched_time.tm_hour, 00, 23, 1, 10, 10);
  59.350 -    scheduler_ui->hour_spinbutton =
  59.351 -        gtk_spin_button_new(GTK_ADJUSTMENT(spinbutton_adj), 1, 0);
  59.352 -    gtk_box_pack_start(GTK_BOX(hbox), scheduler_ui->hour_spinbutton, FALSE,
  59.353 -                       FALSE, 0);
  59.354 -
  59.355 -    label = gtk_label_new((" : "));
  59.356 -    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
  59.357 -    gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT);
  59.358 -    gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
  59.359 -
  59.360 -    // minute entry
  59.361 -    spinbutton_adj =
  59.362 -        gtk_adjustment_new(sched_time.tm_min, 0, 59, 1, 10, 10);
  59.363 -    scheduler_ui->min_spinbutton =
  59.364 -        gtk_spin_button_new(GTK_ADJUSTMENT(spinbutton_adj), 1, 0);
  59.365 -    gtk_box_pack_start(GTK_BOX(hbox), scheduler_ui->min_spinbutton, FALSE,
  59.366 -                       FALSE, 0);
  59.367 -
  59.368 -    label = gtk_label_new((" (hh:mm)"));
  59.369 -
  59.370 -    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
  59.371 -
  59.372 -}
  59.373 -
  59.374 -static void
  59.375 -add_date_field(MMythSchedulerUI * scheduler_ui, GtkWidget * vbox)
  59.376 -{
  59.377 -    char            sched_date[24];
  59.378 -    GtkWidget      *hbox = add_line(vbox, "Date:        ");
  59.379 -
  59.380 -    // sched_date = ctime(&real_time);
  59.381 -    g_sprintf(sched_date, "%04d %02d %02d (yyyy mm dd)",
  59.382 -              scheduler_ui->year_temp, scheduler_ui->month_temp + 1,
  59.383 -              scheduler_ui->day_temp);
  59.384 -    sched_date[23] = '\0';
  59.385 -
  59.386 -    scheduler_ui->date_button = gtk_button_new_with_label(sched_date);
  59.387 -    gtk_box_pack_start(GTK_BOX(hbox), scheduler_ui->date_button, FALSE,
  59.388 -                       FALSE, 0);
  59.389 -    gtk_button_set_relief(GTK_BUTTON(scheduler_ui->date_button),
  59.390 -                          GTK_RELIEF_NONE);
  59.391 -
  59.392 -    g_signal_connect(G_OBJECT(scheduler_ui->date_button), "clicked",
  59.393 -                     G_CALLBACK(run_calendar_dialog), scheduler_ui);
  59.394 -
  59.395 -}
  59.396 -
  59.397 -static void
  59.398 -add_duration_field(MMythSchedulerUI * scheduler_ui, GtkWidget * vbox)
  59.399 -{
  59.400 -    GtkWidget      *hbox = add_line(vbox, "Duration:   ");
  59.401 -    GtkWidget      *label;
  59.402 -    GtkObject      *spinbutton_adj;
  59.403 -
  59.404 -    spinbutton_adj = gtk_adjustment_new(60, 5, 360, 5, 60, 60);
  59.405 -    scheduler_ui->duration_spinbutton =
  59.406 -        gtk_spin_button_new(GTK_ADJUSTMENT(spinbutton_adj), 1, 0);
  59.407 -    gtk_box_pack_start(GTK_BOX(hbox), scheduler_ui->duration_spinbutton,
  59.408 -                       FALSE, TRUE, 0);
  59.409 -    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON
  59.410 -                                (scheduler_ui->duration_spinbutton), TRUE);
  59.411 -
  59.412 -    label = gtk_label_new((" (minutes)     "));
  59.413 -    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
  59.414 -}
  59.415 -
  59.416 -static void
  59.417 -add_frequency_field(MMythSchedulerUI * scheduler_ui, GtkWidget * vbox)
  59.418 -{
  59.419 -
  59.420 -    GtkWidget      *hbox = add_line(vbox, "Frequency: ");
  59.421 -
  59.422 -    scheduler_ui->freq_combobox = gtk_combo_box_new_text();
  59.423 -    gtk_box_pack_start(GTK_BOX(hbox), scheduler_ui->freq_combobox, FALSE,
  59.424 -                       FALSE, 0);
  59.425 -    gtk_combo_box_append_text(GTK_COMBO_BOX(scheduler_ui->freq_combobox),
  59.426 -                              ("Only this day               "));
  59.427 -    gtk_combo_box_append_text(GTK_COMBO_BOX(scheduler_ui->freq_combobox),
  59.428 -                              ("Daily                            "));
  59.429 -    gtk_combo_box_append_text(GTK_COMBO_BOX(scheduler_ui->freq_combobox),
  59.430 -                              ("Weekly                         "));
  59.431 -    gtk_combo_box_set_active(GTK_COMBO_BOX(scheduler_ui->freq_combobox),
  59.432 -                             0);
  59.433 -
  59.434 -}
  59.435 -
  59.436 -static void
  59.437 -add_title_field(MMythSchedulerUI * scheduler_ui, GtkWidget * vbox)
  59.438 -{
  59.439 -    GtkWidget      *hbox = add_line(vbox, "Title:           ");
  59.440 -
  59.441 -    scheduler_ui->title_entry = gtk_entry_new();
  59.442 -    gtk_box_pack_start(GTK_BOX(hbox), scheduler_ui->title_entry, FALSE,
  59.443 -                       FALSE, 0);
  59.444 -    gtk_entry_set_text(GTK_ENTRY(scheduler_ui->title_entry), "(Optional)");
  59.445 -
  59.446 -}
    60.1 --- a/maemo-ui/src/mmyth_schedulerui.h	Wed Aug 01 14:22:14 2007 +0100
    60.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.3 @@ -1,53 +0,0 @@
    60.4 -#ifndef MMYTH_SCHEDULERECORDING_H_
    60.5 -#define MMYTH_SCHEDULERECORDING_H_
    60.6 -
    60.7 -#include <glib.h>
    60.8 -
    60.9 -#include <gmyth/gmyth_backendinfo.h>
   60.10 -
   60.11 -typedef struct _MMythSchedulerUI {
   60.12 -
   60.13 -    GList          *channel_list;
   60.14 -
   60.15 -    GtkWidget      *main_widget;
   60.16 -
   60.17 -    GtkWidget      *channel_combobox;
   60.18 -    GtkWidget      *freq_combobox;
   60.19 -    GtkWidget      *hour_spinbutton;
   60.20 -    GtkWidget      *min_spinbutton;
   60.21 -    GtkWidget      *duration_spinbutton;
   60.22 -    GtkWidget      *title_entry;
   60.23 -    GtkWidget      *date_button;
   60.24 -
   60.25 -    GtkWidget      *calendar_dialog;
   60.26 -    GtkWidget      *calendar;
   60.27 -
   60.28 -    guint           year_temp,
   60.29 -                    month_temp,
   60.30 -                    day_temp;
   60.31 -
   60.32 -    GMythBackendInfo *backend_info;
   60.33 -
   60.34 -} MMythSchedulerUI;
   60.35 -
   60.36 -typedef struct {
   60.37 -    long int        channel_id;
   60.38 -
   60.39 -    struct tm       start_tm;
   60.40 -
   60.41 -    int             duration;
   60.42 -    int             frequency;
   60.43 -
   60.44 -    GString        *title;
   60.45 -
   60.46 -} ScheduleEntry;
   60.47 -
   60.48 -MMythSchedulerUI *mmyth_schedulerui_new(GMythBackendInfo * backend_info);
   60.49 -
   60.50 -gboolean        mmyth_schedulerui_save(MMythSchedulerUI * scheduler_ui);
   60.51 -
   60.52 -void            mmyth_schedulerui_cb_schedule_button(GtkButton * button,
   60.53 -                                                     gpointer user_data);
   60.54 -
   60.55 -
   60.56 -#endif                          /* MMYTH_SCHEDULERECORDING_H_ */
    61.1 --- a/maemo-ui/src/mmyth_tvplayer.c	Wed Aug 01 14:22:14 2007 +0100
    61.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.3 @@ -1,712 +0,0 @@
    61.4 -/**
    61.5 - * GMyth Library
    61.6 - *
    61.7 - * @file gmyth/mmyth_tvplayer.c
    61.8 - * 
    61.9 - * @brief <p> This component provides playback of the remote A/V using
   61.10 - * GStreamer.
   61.11 - * 
   61.12 - * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
   61.13 - * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
   61.14 - *
   61.15 -    *//*
   61.16 -    * 
   61.17 -    * This program is free software; you can redistribute it and/or modify
   61.18 -    * it under the terms of the GNU Lesser General Public License as published by
   61.19 -    * the Free Software Foundation; either version 2 of the License, or
   61.20 -    * (at your option) any later version.
   61.21 -    *
   61.22 -    * This program is distributed in the hope that it will be useful,
   61.23 -    * but WITHOUT ANY WARRANTY; without even the implied warranty of
   61.24 -    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   61.25 -    * GNU General Public License for more details.
   61.26 -    *
   61.27 -    * You should have received a copy of the GNU Lesser General Public License
   61.28 -    * along with this program; if not, write to the Free Software
   61.29 -    * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   61.30 -    */
   61.31 -
   61.32 -#include "mmyth_tvplayer.h"
   61.33 -
   61.34 -#include <gdk/gdkx.h>
   61.35 -
   61.36 -#include <gmyth/gmyth_remote_util.h>
   61.37 -
   61.38 -#define MYTHTV_VERSION_DEFAULT	30
   61.39 -
   61.40 -typedef struct _GstPlayerWindowStateChange {
   61.41 -    GstElement     *play;
   61.42 -    GstState        old_state,
   61.43 -                    new_state;
   61.44 -    MMythTVPlayer  *tvplayer;
   61.45 -} GstPlayerWindowStateChange;
   61.46 -
   61.47 -typedef struct _GstPlayerWindowTagFound {
   61.48 -    GstElement     *play;
   61.49 -    GstTagList     *taglist;
   61.50 -    MMythTVPlayer  *tvplayer;
   61.51 -} GstPlayerWindowTagFound;
   61.52 -
   61.53 -/*
   61.54 - * static gboolean idle_state (gpointer data); 
   61.55 - */
   61.56 -static gboolean bus_call(GstBus * bus, GstMessage * msg, gpointer data);
   61.57 -
   61.58 -static void     mmyth_tvplayer_class_init(MMythTVPlayerClass * klass);
   61.59 -static void     mmyth_tvplayer_init(MMythTVPlayer * object);
   61.60 -
   61.61 -static void     mmyth_tvplayer_dispose(GObject * object);
   61.62 -static void     mmyth_tvplayer_finalize(GObject * object);
   61.63 -
   61.64 -G_DEFINE_TYPE(MMythTVPlayer, mmyth_tvplayer, G_TYPE_OBJECT)
   61.65 -
   61.66 -    static gboolean mmyth_tvplayer_create_pipeline(MMythTVPlayer *
   61.67 -                                                   tvplayer);
   61.68 -    static void     new_pad_cb(GstElement * element, GstPad * pad,
   61.69 -                               gpointer data);
   61.70 -
   61.71 -    static gboolean expose_cb(GtkWidget * widget,
   61.72 -                              GdkEventExpose * event, gpointer user_data);
   61.73 -
   61.74 -    static void
   61.75 -                    mmyth_tvplayer_class_init(MMythTVPlayerClass * klass)
   61.76 -{
   61.77 -    GObjectClass   *gobject_class;
   61.78 -
   61.79 -    gobject_class = (GObjectClass *) klass;
   61.80 -
   61.81 -    gobject_class->dispose = mmyth_tvplayer_dispose;
   61.82 -    gobject_class->finalize = mmyth_tvplayer_finalize;
   61.83 -}
   61.84 -
   61.85 -static void
   61.86 -new_pad_cb(GstElement * element, GstPad * pad, gpointer data)
   61.87 -{
   61.88 -    MMythTVPlayer  *tvplayer = MMYTH_TVPLAYER(data);
   61.89 -    GstPadLinkReturn ret;
   61.90 -    char           *s;
   61.91 -
   61.92 -    s = gst_caps_to_string(pad->caps);
   61.93 -
   61.94 -    if (s[0] == 'a') {
   61.95 -        ret =
   61.96 -            gst_pad_link(pad,
   61.97 -                         gst_element_get_pad(tvplayer->audioqueue1,
   61.98 -                                             "sink"));
   61.99 -    } else {
  61.100 -        ret =
  61.101 -            gst_pad_link(pad,
  61.102 -                         gst_element_get_pad(tvplayer->videoqueue1,
  61.103 -                                             "sink"));
  61.104 -    }
  61.105 -
  61.106 -    g_free(s);
  61.107 -}
  61.108 -
  61.109 -static          gboolean
  61.110 -expose_cb(GtkWidget * widget, GdkEventExpose * event, gpointer user_data)
  61.111 -{
  61.112 -    MMythTVPlayer  *tvplayer = MMYTH_TVPLAYER(user_data);
  61.113 -
  61.114 -    if (tvplayer && tvplayer->videow) {
  61.115 -        gst_x_overlay_set_xwindow_id(GST_X_OVERLAY
  61.116 -                                     (tvplayer->gst_videosink),
  61.117 -                                     GDK_WINDOW_XWINDOW(widget->window));
  61.118 -        return TRUE;
  61.119 -    }
  61.120 -
  61.121 -    g_warning("MMythTVPlayer expose called before setting video window\n");
  61.122 -
  61.123 -    return FALSE;
  61.124 -}
  61.125 -
  61.126 -static void
  61.127 -mmyth_tvplayer_init(MMythTVPlayer * tvplayer)
  61.128 -{
  61.129 -    tvplayer->gst_pipeline = NULL;
  61.130 -    tvplayer->gst_source = NULL;
  61.131 -    tvplayer->gst_videodec = NULL;
  61.132 -    tvplayer->gst_videosink = NULL;
  61.133 -    tvplayer->gst_videocolortrs = NULL;
  61.134 -    tvplayer->videoqueue1 = NULL;
  61.135 -    tvplayer->videoqueue2 = NULL;
  61.136 -    tvplayer->audioqueue1 = NULL;
  61.137 -    tvplayer->audioqueue2 = NULL;
  61.138 -
  61.139 -    /*
  61.140 -     * GTKWidget for rendering the video 
  61.141 -     */
  61.142 -    tvplayer->videow = NULL;
  61.143 -    tvplayer->expose_handler = 0;
  61.144 -
  61.145 -    tvplayer->backend_hostname = NULL;
  61.146 -    tvplayer->backend_port = 0;
  61.147 -    tvplayer->local_hostname = NULL;
  61.148 -
  61.149 -    tvplayer->recorder = NULL;
  61.150 -    tvplayer->tvchain = NULL;
  61.151 -    tvplayer->proginfo = NULL;
  61.152 -}
  61.153 -
  61.154 -static void
  61.155 -mmyth_tvplayer_dispose(GObject * object)
  61.156 -{
  61.157 -
  61.158 -    G_OBJECT_CLASS(mmyth_tvplayer_parent_class)->dispose(object);
  61.159 -}
  61.160 -
  61.161 -static void
  61.162 -mmyth_tvplayer_finalize(GObject * object)
  61.163 -{
  61.164 -    g_signal_handlers_destroy(object);
  61.165 -
  61.166 -    MMythTVPlayer  *tvplayer = MMYTH_TVPLAYER(object);
  61.167 -
  61.168 -    g_debug("[%s] Finalizing tvplayer", __FUNCTION__);
  61.169 -
  61.170 -    if (tvplayer->videow != NULL) {
  61.171 -        if (g_signal_handler_is_connected(tvplayer->videow,
  61.172 -                                          tvplayer->expose_handler)) {
  61.173 -            g_signal_handler_disconnect(tvplayer->videow,
  61.174 -                                        tvplayer->expose_handler);
  61.175 -        }
  61.176 -        g_object_unref(tvplayer->videow);
  61.177 -    }
  61.178 -
  61.179 -    if (tvplayer->recorder != NULL)
  61.180 -        g_object_unref(tvplayer->recorder);
  61.181 -    if (tvplayer->tvchain != NULL)
  61.182 -        g_object_unref(tvplayer->tvchain);
  61.183 -    if (tvplayer->proginfo != NULL)
  61.184 -        g_object_unref(tvplayer->proginfo);
  61.185 -
  61.186 -    // Release Gstreamer elements
  61.187 -    if (tvplayer->gst_pipeline != NULL)
  61.188 -        g_object_unref(tvplayer->gst_pipeline);
  61.189 -    if (tvplayer->gst_source != NULL)
  61.190 -        g_object_unref(tvplayer->gst_source);
  61.191 -    if (tvplayer->gst_videodec != NULL)
  61.192 -        g_object_unref(tvplayer->gst_videodec);
  61.193 -    if (tvplayer->gst_videocolortrs != NULL)
  61.194 -        g_object_unref(tvplayer->gst_videocolortrs);
  61.195 -    if (tvplayer->gst_videosink != NULL)
  61.196 -        g_object_unref(tvplayer->gst_videosink);
  61.197 -    if (tvplayer->videoqueue1 != NULL)
  61.198 -        g_object_unref(tvplayer->videoqueue1);
  61.199 -    if (tvplayer->videoqueue2 != NULL)
  61.200 -        g_object_unref(tvplayer->videoqueue2);
  61.201 -    if (tvplayer->audioqueue1 != NULL)
  61.202 -        g_object_unref(tvplayer->audioqueue1);
  61.203 -    if (tvplayer->audioqueue2 != NULL)
  61.204 -        g_object_unref(tvplayer->audioqueue2);
  61.205 -
  61.206 -    G_OBJECT_CLASS(mmyth_tvplayer_parent_class)->finalize(object);
  61.207 -}
  61.208 -
  61.209 -/** Creates a new instance of MMythTVPlayer. 
  61.210 - * 
  61.211 - * @return a new instance of MMythTVPlayer.
  61.212 - */
  61.213 -MMythTVPlayer  *
  61.214 -mmyth_tvplayer_new()
  61.215 -{
  61.216 -    MMythTVPlayer  *tvplayer =
  61.217 -        MMYTH_TVPLAYER(g_object_new(MMYTH_TVPLAYER_TYPE, NULL));
  61.218 -
  61.219 -    return tvplayer;
  61.220 -}
  61.221 -
  61.222 -/** Initializes the tv player.
  61.223 - *
  61.224 - * @param tvplayer the object instance.
  61.225 - * @return gboolean TRUE if the pipeline was created 
  61.226 - * successfully, FALSE otherwise.
  61.227 - */
  61.228 -gboolean
  61.229 -mmyth_tvplayer_initialize(MMythTVPlayer * tvplayer,
  61.230 -                          GMythBackendInfo * backend_info)
  61.231 -{
  61.232 -    tvplayer->backend_info = backend_info;
  61.233 -
  61.234 -    if (!mmyth_tvplayer_create_pipeline(tvplayer)) {
  61.235 -        g_warning
  61.236 -            ("[%s] Error while creating pipeline. TV Player not initialized",
  61.237 -             __FUNCTION__);
  61.238 -        return FALSE;
  61.239 -    } else {
  61.240 -        g_debug("[%s] GStreamer pipeline created", __FUNCTION__);
  61.241 -    }
  61.242 -
  61.243 -    return TRUE;
  61.244 -}
  61.245 -
  61.246 -/** Creates the GStreamer pipeline used by the player.
  61.247 - *
  61.248 - * @param tvplayer the object instance.
  61.249 - * @return gboolean TRUE if the pipeline was created 
  61.250 - * successfully, FALSE otherwise.
  61.251 - */
  61.252 -static          gboolean
  61.253 -mmyth_tvplayer_create_pipeline(MMythTVPlayer * tvplayer)
  61.254 -{
  61.255 -    GstElement     *pipeline;
  61.256 -    GstElement     *source,
  61.257 -                   *parser;
  61.258 -    GstElement     *videodec,
  61.259 -                   *videosink;
  61.260 -    GstElement     *videocolortrs;
  61.261 -#ifndef MAEMO_PLATFORM
  61.262 -    GstElement     *audiodec,
  61.263 -                   *audioconv,
  61.264 -                   *audioqueue2;
  61.265 -#endif
  61.266 -    GstElement     *audiosink;
  61.267 -    GstElement     *videoqueue1,
  61.268 -                   *videoqueue2,
  61.269 -                   *audioqueue1;
  61.270 -
  61.271 -    g_debug("MMythTVPlayer: Setting the Gstreamer pipeline\n");
  61.272 -
  61.273 -    pipeline = gst_pipeline_new("video-player");
  61.274 -    source = gst_element_factory_make("mythtvsrc", "myth-source");
  61.275 -    parser = gst_element_factory_make("nuvdemux", "nuv-demux");
  61.276 -
  61.277 -    /*
  61.278 -     * Gstreamer Video elements 
  61.279 -     */
  61.280 -    videoqueue1 = gst_element_factory_make("queue", "video-queue1");
  61.281 -    videodec = gst_element_factory_make("ffdec_mpeg4", "video-decoder");
  61.282 -    videoqueue2 = gst_element_factory_make("queue", "video-queue2");
  61.283 -    videocolortrs =
  61.284 -        gst_element_factory_make("ffmpegcolorspace",
  61.285 -                                 "image-color-transforms");
  61.286 -
  61.287 -#ifdef MAEMO_PLATFORM
  61.288 -    videosink = gst_element_factory_make("sdlvideosink", "image-output");
  61.289 -#else
  61.290 -    videosink = gst_element_factory_make("xvimagesink", "image-output");
  61.291 -#endif
  61.292 -
  61.293 -    /*
  61.294 -     * Gstreamer Audio elements 
  61.295 -     */
  61.296 -    audioqueue1 = gst_element_factory_make("queue", "audio-queue1");
  61.297 -#ifdef MAEMO_PLATFORM
  61.298 -    audiosink = gst_element_factory_make("dspmp3sink", "audio-output");
  61.299 -#else
  61.300 -    audioqueue2 = gst_element_factory_make("queue", "audio-queue2");
  61.301 -    audiodec = gst_element_factory_make("mad", "audio-decoder");
  61.302 -    audioconv =
  61.303 -        gst_element_factory_make("audioconvert", "audio-converter");
  61.304 -    audiosink = gst_element_factory_make("alsasink", "audio-output");
  61.305 -#endif
  61.306 -
  61.307 -    if (!(pipeline && source && parser && videodec && videosink) ||
  61.308 -        !(videoqueue1 && videoqueue2 && audioqueue1 && audiosink)) {
  61.309 -        /*
  61.310 -         * FIXME: hanlde the error correctly 
  61.311 -         */
  61.312 -        /*
  61.313 -         * video_alignment is not being created (below) and is causing
  61.314 -         * problems to the ui 
  61.315 -         */
  61.316 -
  61.317 -        tvplayer->gst_pipeline = NULL;
  61.318 -        tvplayer->gst_videodec = NULL;
  61.319 -        tvplayer->gst_videosink = NULL;
  61.320 -        tvplayer->gst_videocolortrs = NULL;
  61.321 -
  61.322 -        g_warning("GstElement creation error!\n");
  61.323 -        return FALSE;
  61.324 -    }
  61.325 -#ifndef MAEMO_PLATFORM
  61.326 -    if (!(audiodec && audioconv)) {
  61.327 -        g_warning("GstElement for audio stream creation error!");
  61.328 -        return FALSE;
  61.329 -    }
  61.330 -#endif
  61.331 -
  61.332 -    tvplayer->gst_pipeline = pipeline;
  61.333 -    tvplayer->gst_source = source;
  61.334 -    tvplayer->gst_videodec = videodec;
  61.335 -    tvplayer->gst_videosink = videosink;
  61.336 -    tvplayer->gst_videocolortrs = videocolortrs;
  61.337 -    g_object_ref(tvplayer->gst_pipeline);
  61.338 -    g_object_ref(tvplayer->gst_source);
  61.339 -    g_object_ref(tvplayer->gst_videodec);
  61.340 -    g_object_ref(tvplayer->gst_videosink);
  61.341 -    g_object_ref(tvplayer->gst_videocolortrs);
  61.342 -
  61.343 -    tvplayer->videoqueue1 = videoqueue1;
  61.344 -    tvplayer->videoqueue2 = videoqueue2;
  61.345 -    tvplayer->audioqueue1 = audioqueue1;
  61.346 -    g_object_ref(tvplayer->videoqueue1);
  61.347 -    g_object_ref(tvplayer->videoqueue2);
  61.348 -    g_object_ref(tvplayer->audioqueue1);
  61.349 -
  61.350 -#ifndef MAEMO_PLATFORM
  61.351 -    tvplayer->audioqueue2 = audioqueue2;
  61.352 -    g_object_ref(tvplayer->audioqueue2);
  61.353 -#endif
  61.354 -
  61.355 -    // g_object_set (G_OBJECT (videosink), "sync", TRUE, NULL);
  61.356 -    g_object_set(G_OBJECT(audiosink), "sync", FALSE, NULL);
  61.357 -
  61.358 -    gst_bus_add_watch(gst_pipeline_get_bus
  61.359 -                      (GST_PIPELINE(tvplayer->gst_pipeline)), bus_call,
  61.360 -                      tvplayer);
  61.361 -
  61.362 -    gst_bin_add_many(GST_BIN(pipeline), source, parser, videoqueue1,
  61.363 -                     videodec, videoqueue2, videocolortrs, videosink,
  61.364 -                     NULL);
  61.365 -
  61.366 -#ifndef MAEMO_PLATFORM
  61.367 -    gst_bin_add_many(GST_BIN(pipeline), audioqueue1, audiodec, audioconv,
  61.368 -                     audioqueue2, audiosink, NULL);
  61.369 -#else
  61.370 -    gst_bin_add_many(GST_BIN(pipeline), audioqueue1, audiosink, NULL);
  61.371 -#endif
  61.372 -
  61.373 -    {
  61.374 -        // GstCaps *rtpcaps = gst_caps_new_simple ("application/x-rtp",
  61.375 -        // NULL);
  61.376 -        // gst_element_link_filtered(source, parser, rtpcaps);
  61.377 -    }
  61.378 -
  61.379 -    gst_element_link(source, parser);
  61.380 -    gst_element_link_many(videoqueue1, videodec, videoqueue2,
  61.381 -                          videocolortrs, videosink, NULL);
  61.382 -
  61.383 -#ifndef MAEMO_PLATFORM
  61.384 -    gst_element_link_many(videosink, audioqueue1, audiodec, audioconv,
  61.385 -                          audioqueue2, audiosink, NULL);
  61.386 -#else
  61.387 -    gst_element_link_many(videosink, audioqueue1, audiosink, NULL);
  61.388 -#endif
  61.389 -
  61.390 -    g_signal_connect(parser, "pad-added", G_CALLBACK(new_pad_cb),
  61.391 -                     tvplayer);
  61.392 -
  61.393 -    return TRUE;
  61.394 -}
  61.395 -
  61.396 -/** Configures the backend and the tv player 
  61.397 - * for playing the recorded content A/V.
  61.398 - *
  61.399 - * FIXME: Change filename to program info or other structure about the recorded
  61.400 - *
  61.401 - * @param tvplayer the object instance.
  61.402 - * @param filename the file uri of the recorded content to be played.
  61.403 - * @return TRUE if successfull, FALSE if any error happens.
  61.404 - */
  61.405 -gboolean
  61.406 -mmyth_tvplayer_record_setup(MMythTVPlayer * tvplayer,
  61.407 -                            const gchar * filename)
  61.408 -{
  61.409 -    // FIXME: we should receive the uri instead of filename
  61.410 -    const gchar    *hostname =
  61.411 -        gmyth_backend_info_get_hostname(tvplayer->backend_info);
  61.412 -    const gint      port =
  61.413 -        gmyth_backend_info_get_port(tvplayer->backend_info);
  61.414 -
  61.415 -    GString        *fullpath = g_string_new("myth://");
  61.416 -    g_string_append_printf(fullpath, "%s:%d/%s", hostname, port, filename);
  61.417 -
  61.418 -    tvplayer->is_livetv = FALSE;
  61.419 -
  61.420 -    g_debug("[%s] Setting record uri to gstreamer pipeline to %s",
  61.421 -            __FUNCTION__, fullpath->str);
  61.422 -
  61.423 -    g_object_set(G_OBJECT(tvplayer->gst_source), "location",
  61.424 -                 fullpath->str, NULL);
  61.425 -
  61.426 -    return TRUE;
  61.427 -}
  61.428 -
  61.429 -/** Configures the backend and the tv player 
  61.430 - * for playing the live tv.
  61.431 - *
  61.432 - * @param tvplayer the object instance.
  61.433 - * @return TRUE if successfull, FALSE if any error happens.
  61.434 - */
  61.435 -gboolean
  61.436 -mmyth_tvplayer_livetv_setup(MMythTVPlayer * tvplayer)
  61.437 -{
  61.438 -    gboolean        res = TRUE;
  61.439 -
  61.440 -    tvplayer->livetv = gmyth_livetv_new();
  61.441 -
  61.442 -    if (!gmyth_livetv_setup(tvplayer->livetv, tvplayer->backend_info))
  61.443 -        goto error;
  61.444 -
  61.445 -    return res;
  61.446 -
  61.447 -  error:
  61.448 -    res = FALSE;
  61.449 -    if (tvplayer->livetv != NULL) {
  61.450 -        g_object_unref(tvplayer->livetv);
  61.451 -    }
  61.452 -
  61.453 -    if (tvplayer->local_hostname != NULL) {
  61.454 -        g_string_free(tvplayer->local_hostname, TRUE);
  61.455 -    }
  61.456 -
  61.457 -    if (tvplayer->recorder != NULL) {
  61.458 -        g_object_unref(tvplayer->recorder);
  61.459 -        tvplayer->recorder = NULL;
  61.460 -    }
  61.461 -
  61.462 -    if (tvplayer->tvchain != NULL) {
  61.463 -        g_object_unref(tvplayer->tvchain);
  61.464 -        tvplayer->tvchain = NULL;
  61.465 -    }
  61.466 -
  61.467 -    if (tvplayer->proginfo != NULL) {
  61.468 -        g_object_unref(tvplayer->proginfo);
  61.469 -        tvplayer->proginfo = NULL;
  61.470 -    }
  61.471 -
  61.472 -    return res;
  61.473 -
  61.474 -}
  61.475 -
  61.476 -/** Sets the GTK video widget for the tv player. 
  61.477 - *
  61.478 - * @param tvplayer the object instance.
  61.479 - * @param videow the GTK video window.
  61.480 - * @return TRUE if successfull, FALSE if any error happens.
  61.481 - */
  61.482 -gboolean
  61.483 -mmyth_tvplayer_set_widget(MMythTVPlayer * tvplayer, GtkWidget * videow)
  61.484 -{
  61.485 -    tvplayer->videow = videow;
  61.486 -    g_object_ref(videow);
  61.487 -
  61.488 -    g_debug("[%s] Setting widget for tv player render", __FUNCTION__);
  61.489 -
  61.490 -    tvplayer->expose_handler =
  61.491 -        g_signal_connect(tvplayer->videow, "expose-event",
  61.492 -                         G_CALLBACK(expose_cb), tvplayer);
  61.493 -
  61.494 -    // g_signal_connect(miptv_ui->videow, "size_request",
  61.495 -    // G_CALLBACK(cb_preferred_video_size), miptv_ui);
  61.496 -
  61.497 -    return TRUE;
  61.498 -}
  61.499 -
  61.500 -static          gboolean
  61.501 -bus_call(GstBus * bus, GstMessage * msg, gpointer data)
  61.502 -{
  61.503 -    // MMythTVPlayer *tvplayer = MMYTH_TVPLAYER ( data );
  61.504 -    // GMainLoop *loop = tvplayer->loop;
  61.505 -
  61.506 -    switch (GST_MESSAGE_TYPE(msg)) {
  61.507 -    case GST_MESSAGE_EOS:
  61.508 -        printf("End of stream\n");
  61.509 -        // g_idle_add ((GSourceFunc) idle_eos, data);
  61.510 -        gst_element_set_state(GST_ELEMENT(GST_MESSAGE_SRC(msg)),
  61.511 -                              GST_STATE_NULL);
  61.512 -        gst_element_set_locked_state(GST_ELEMENT(GST_MESSAGE_SRC(msg)),
  61.513 -                                     TRUE);
  61.514 -        break;
  61.515 -    case GST_MESSAGE_ERROR:
  61.516 -        {
  61.517 -            gchar          *debug;
  61.518 -            GError         *err;
  61.519 -
  61.520 -            gst_message_parse_error(msg, &err, &debug);
  61.521 -            g_free(debug);
  61.522 -
  61.523 -            printf("Error: %s\n", err->message);
  61.524 -            g_error_free(err);
  61.525 -
  61.526 -            // g_main_loop_quit (loop);
  61.527 -        }
  61.528 -        break;
  61.529 -    default:
  61.530 -        printf(gst_message_type_get_name(GST_MESSAGE_TYPE(msg)));
  61.531 -        printf("\n");
  61.532 -        break;
  61.533 -    }
  61.534 -
  61.535 -    return TRUE;
  61.536 -}
  61.537 -
  61.538 -
  61.539 -#if 0
  61.540 -static          gboolean
  61.541 -idle_state(gpointer data)
  61.542 -{
  61.543 -    GstPlayerWindowStateChange *st = data;
  61.544 -
  61.545 -    if (st->old_state == GST_STATE_PLAYING) {
  61.546 -        if (st->miptv_ui->idle_id != 0) {
  61.547 -            g_source_remove(st->miptv_ui->idle_id);
  61.548 -            st->miptv_ui->idle_id = 0;
  61.549 -        }
  61.550 -    } else if (st->new_state == GST_STATE_PLAYING) {
  61.551 -        if (st->miptv_ui->idle_id != 0)
  61.552 -            g_source_remove(st->miptv_ui->idle_id);
  61.553 -
  61.554 -        st->miptv_ui->idle_id = g_idle_add(cb_iterate, st->miptv_ui);
  61.555 -    }
  61.556 -
  61.557 -    /*
  61.558 -     * new movie loaded? 
  61.559 -     */
  61.560 -    if (st->old_state == GST_STATE_READY
  61.561 -        && st->new_state > GST_STATE_READY) {
  61.562 -
  61.563 -        /*
  61.564 -         * gboolean have_video = FALSE; 
  61.565 -         */
  61.566 -
  61.567 -        gtk_widget_show(st->miptv_ui->videow);
  61.568 -
  61.569 -        gtk_window_resize(GTK_WINDOW(st->miptv_ui->main_window), 1, 1);
  61.570 -
  61.571 -    }
  61.572 -
  61.573 -    /*
  61.574 -     * discarded movie? 
  61.575 -     */
  61.576 -    if (st->old_state > GST_STATE_READY
  61.577 -        && st->new_state == GST_STATE_READY) {
  61.578 -
  61.579 -        if (st->miptv_ui->tagcache) {
  61.580 -            gst_tag_list_free(st->miptv_ui->tagcache);
  61.581 -            st->miptv_ui->tagcache = NULL;
  61.582 -        }
  61.583 -    }
  61.584 -
  61.585 -    gst_object_unref(GST_OBJECT(st->play));
  61.586 -    // g_object_unref (G_OBJECT (st->win));
  61.587 -    g_free(st);
  61.588 -
  61.589 -    /*
  61.590 -     * once 
  61.591 -     */
  61.592 -    return FALSE;
  61.593 -}
  61.594 -
  61.595 -#endif
  61.596 -
  61.597 -/** Stops playing the current A/V.
  61.598 - *
  61.599 - * FIXME: How to proceed differently between livetv 
  61.600 - * and recorded content?
  61.601 - *
  61.602 - * @param tvplayer the object instance.
  61.603 - * @return void 
  61.604 - */
  61.605 -void
  61.606 -mmyth_tvplayer_stop_playing(MMythTVPlayer * tvplayer)
  61.607 -{
  61.608 -    g_debug("[%s] Setting gstreamer pipeline state to NULL", __FUNCTION__);
  61.609 -
  61.610 -    gst_element_set_state(tvplayer->gst_pipeline, GST_STATE_NULL);
  61.611 -
  61.612 -    if (tvplayer->is_livetv) {
  61.613 -        if (!gmyth_recorder_stop_livetv(tvplayer->recorder)) {
  61.614 -            g_warning("[%s] Error while stoping remote encoder",
  61.615 -                      __FUNCTION__);
  61.616 -        }
  61.617 -    }
  61.618 -}
  61.619 -
  61.620 -/** Queries if the tvplayer is active playing A/V content.
  61.621 - *
  61.622 - * @param tvplayer the object instance.
  61.623 - * @return TRUE if the tvplayer is active, FALSE otherwise.
  61.624 - */
  61.625 -gboolean
  61.626 -mmyth_tvplayer_is_playing(MMythTVPlayer * tvplayer)
  61.627 -{
  61.628 -    return (GST_STATE(tvplayer->gst_pipeline) == GST_STATE_PLAYING);
  61.629 -}
  61.630 -
  61.631 -/** Static function that sets the tvplayer state to PLAYING.
  61.632 - *
  61.633 - * @param tvplayer the object instance.
  61.634 - * @return TRUE if the tvplayer is active, FALSE otherwise.
  61.635 - */
  61.636 -static          gboolean
  61.637 -idle_play(gpointer data)
  61.638 -{
  61.639 -    MMythTVPlayer  *tvplayer = MMYTH_TVPLAYER(data);
  61.640 -
  61.641 -    g_debug("MMythTVPlayer: Setting pipeline state to PLAYING\n");
  61.642 -
  61.643 -    gst_element_set_state(tvplayer->gst_pipeline, GST_STATE_PLAYING);
  61.644 -
  61.645 -    return FALSE;
  61.646 -}
  61.647 -
  61.648 -/** Start playing A/V with the tvplayer attributes.
  61.649 - *
  61.650 - * @param tvplayer the object instance.
  61.651 - */
  61.652 -void
  61.653 -mmyth_tvplayer_start_playing(MMythTVPlayer * tvplayer)
  61.654 -{
  61.655 -
  61.656 -    // FIXME: Move this to livetv_setup??
  61.657 -    if (tvplayer->is_livetv) {
  61.658 -
  61.659 -#if 0
  61.660 -        if (!tvplayer || !(tvplayer->proginfo)
  61.661 -            || !(tvplayer->local_hostname)
  61.662 -            || !(tvplayer->gst_source)) {
  61.663 -            g_warning("GMythtvPlayer not ready to start playing\n");
  61.664 -        }
  61.665 -
  61.666 -        if (!(tvplayer->proginfo->pathname)) {
  61.667 -            g_warning
  61.668 -                ("[%s] Playback url is null, could not play the myth content",
  61.669 -                 __FUNCTION__);
  61.670 -            return;
  61.671 -        }
  61.672 -
  61.673 -        g_debug("MMythTVPlayer: Start playing %s",
  61.674 -                tvplayer->proginfo->pathname->str);
  61.675 -#endif
  61.676 -        g_object_set(G_OBJECT(tvplayer->gst_source), "mythtv-live",
  61.677 -                     TRUE, NULL);
  61.678 -#if 0
  61.679 -        if (tvplayer->tvchain != NULL) {
  61.680 -            GString        *str_chainid =
  61.681 -                gmyth_tvchain_get_id(tvplayer->tvchain);
  61.682 -            g_print("[%s]\tCHAIN ID: %s\n", __FUNCTION__,
  61.683 -                    str_chainid->str);
  61.684 -
  61.685 -            g_object_set(G_OBJECT(tvplayer->gst_source),
  61.686 -                         "mythtv-live-chainid", g_strdup(str_chainid->str),
  61.687 -                         NULL);
  61.688 -            if (str_chainid != NULL)
  61.689 -                g_string_free(str_chainid, FALSE);
  61.690 -        }
  61.691 -
  61.692 -        if (tvplayer->recorder != NULL)
  61.693 -            g_object_set(G_OBJECT(tvplayer->gst_source), "mythtv-live-id",
  61.694 -                         tvplayer->recorder->recorder_num, NULL);
  61.695 -        g_debug("[%s] Setting location to %s", __FUNCTION__,
  61.696 -                tvplayer->proginfo->pathname->str);
  61.697 -
  61.698 -        /*
  61.699 -         * Sets the gstreamer properties acording to the service access
  61.700 -         * address 
  61.701 -         */
  61.702 -        g_object_set(G_OBJECT(tvplayer->gst_source), "location",
  61.703 -                     tvplayer->proginfo->pathname->str, NULL);
  61.704 -#endif
  61.705 -    }
  61.706 -
  61.707 -    g_object_set(G_OBJECT(tvplayer->gst_source), "mythtv-version",
  61.708 -                 MYTHTV_VERSION_DEFAULT, NULL);
  61.709 -
  61.710 -    g_object_set(G_OBJECT(tvplayer->gst_source), "mythtv-debug",
  61.711 -                 TRUE, NULL);
  61.712 -
  61.713 -    g_idle_add(idle_play, tvplayer);
  61.714 -
  61.715 -}
    62.1 --- a/maemo-ui/src/mmyth_tvplayer.h	Wed Aug 01 14:22:14 2007 +0100
    62.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.3 @@ -1,122 +0,0 @@
    62.4 -/**
    62.5 - * GMyth Library
    62.6 - *
    62.7 - * @file gmyth/mmyth_tvplayer.h
    62.8 - * 
    62.9 - * @brief <p> This component provides playback of the remote A/V using
   62.10 - * GStreamer.
   62.11 - * 
   62.12 - * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
   62.13 - * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
   62.14 - *
   62.15 -    *//*
   62.16 -    * 
   62.17 -    * This program is free software; you can redistribute it and/or modify
   62.18 -    * it under the terms of the GNU Lesser General Public License as published by
   62.19 -    * the Free Software Foundation; either version 2 of the License, or
   62.20 -    * (at your option) any later version.
   62.21 -    *
   62.22 -    * This program is distributed in the hope that it will be useful,
   62.23 -    * but WITHOUT ANY WARRANTY; without even the implied warranty of
   62.24 -    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   62.25 -    * GNU General Public License for more details.
   62.26 -    *
   62.27 -    * You should have received a copy of the GNU Lesser General Public License
   62.28 -    * along with this program; if not, write to the Free Software
   62.29 -    * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   62.30 -    */
   62.31 -
   62.32 -#ifndef MMYTH_TVPLAYER_H_
   62.33 -#define MMYTH_TVPLAYER_H_
   62.34 -
   62.35 -#include <glib-object.h>
   62.36 -#include <gtk/gtk.h>
   62.37 -
   62.38 -/*
   62.39 - * GStreamer includes 
   62.40 - */
   62.41 -#include <gst/gst.h>
   62.42 -#include <gst/interfaces/xoverlay.h>
   62.43 -
   62.44 -#include <gmyth/gmyth_recorder.h>
   62.45 -#include <gmyth/gmyth_tvchain.h>
   62.46 -#include <gmyth/gmyth_common.h>
   62.47 -#include <gmyth/gmyth_livetv.h>
   62.48 -
   62.49 -G_BEGIN_DECLS
   62.50 -#define MMYTH_TVPLAYER_TYPE               (mmyth_tvplayer_get_type ())
   62.51 -#define MMYTH_TVPLAYER(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), MMYTH_TVPLAYER_TYPE, MMythTVPlayer))
   62.52 -#define MMYTH_TVPLAYER_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), MMYTH_TVPLAYER_TYPE, MMythTVPlayerClass))
   62.53 -#define IS_MMYTH_TVPLAYER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), MMYTH_TVPLAYER_TYPE))
   62.54 -#define IS_MMYTH_TVPLAYER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), MMYTH_TVPLAYER_TYPE))
   62.55 -#define MMYTH_TVPLAYER_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), MMYTH_TVPLAYER_TYPE, MMythTVPlayerClass))
   62.56 -typedef struct _MMythTVPlayer MMythTVPlayer;
   62.57 -typedef struct _MMythTVPlayerClass MMythTVPlayerClass;
   62.58 -
   62.59 -struct _MMythTVPlayerClass {
   62.60 -    GObjectClass    parent_class;
   62.61 -
   62.62 -    /*
   62.63 -     * callbacks 
   62.64 -     */
   62.65 -    /*
   62.66 -     * no one for now 
   62.67 -     */
   62.68 -};
   62.69 -
   62.70 -struct _MMythTVPlayer {
   62.71 -    GObject         parent;
   62.72 -
   62.73 -    GstElement     *gst_pipeline;
   62.74 -    GstElement     *gst_source;
   62.75 -    GstElement     *gst_videodec;
   62.76 -    GstElement     *gst_videosink;
   62.77 -    GstElement     *gst_videocolortrs;
   62.78 -    GstElement     *videoqueue1;
   62.79 -    GstElement     *videoqueue2;
   62.80 -    GstElement     *audioqueue1;
   62.81 -    GstElement     *audioqueue2;
   62.82 -
   62.83 -    gulong          expose_handler;
   62.84 -    // GMainLoop *loop;
   62.85 -
   62.86 -    GtkWidget      *videow;
   62.87 -
   62.88 -    /*
   62.89 -     * Backend connection related variables 
   62.90 -     */
   62.91 -    GString        *backend_hostname;
   62.92 -    gint            backend_port;
   62.93 -    GString        *local_hostname;
   62.94 -
   62.95 -    GMythRecorder  *recorder;
   62.96 -    GMythTVChain   *tvchain;
   62.97 -    GMythProgramInfo *proginfo;
   62.98 -    GMythLiveTV    *livetv;
   62.99 -
  62.100 -    GMythBackendInfo *backend_info;
  62.101 -
  62.102 -    gboolean        is_livetv;
  62.103 -};
  62.104 -
  62.105 -
  62.106 -GType           mmyth_tvplayer_get_type(void);
  62.107 -
  62.108 -MMythTVPlayer  *mmyth_tvplayer_new();
  62.109 -gboolean        mmyth_tvplayer_initialize(MMythTVPlayer * tvplayer,
  62.110 -                                          GMythBackendInfo * backend_info);
  62.111 -
  62.112 -void            mmyth_tvplayer_start_playing(MMythTVPlayer * tvplayer);
  62.113 -void            mmyth_tvplayer_stop_playing(MMythTVPlayer * tvplayer);
  62.114 -
  62.115 -gboolean        mmyth_tvplayer_set_widget(MMythTVPlayer * tvplayer,
  62.116 -                                          GtkWidget * videow);
  62.117 -
  62.118 -gboolean        mmyth_tvplayer_is_playing(MMythTVPlayer * tvplayer);
  62.119 -
  62.120 -gboolean        mmyth_tvplayer_record_setup(MMythTVPlayer * tvplayer,
  62.121 -                                            const gchar * filename);
  62.122 -gboolean        mmyth_tvplayer_livetv_setup(MMythTVPlayer * tvplayer);
  62.123 -
  62.124 -G_END_DECLS
  62.125 -#endif                          /* MMYTH_TVPLAYER_H_ */
    63.1 --- a/maemo-ui/src/mmyth_ui.c	Wed Aug 01 14:22:14 2007 +0100
    63.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.3 @@ -1,894 +0,0 @@
    63.4 -
    63.5 -#include <glib-object.h>
    63.6 -#include <sys/types.h>
    63.7 -#include <sys/stat.h>
    63.8 -#include <unistd.h>
    63.9 -#include <string.h>
   63.10 -#include <stdio.h>
   63.11 -#include <gtk/gtk.h>
   63.12 -#include <gdk/gdkx.h>
   63.13 -#include <gst/interfaces/xoverlay.h>
   63.14 -#include <assert.h>
   63.15 -
   63.16 -#include "mmyth_ui.h"
   63.17 -#include "mmyth_uicommon.h"
   63.18 -#include "mmyth_schedulerui.h"
   63.19 -#include "mmyth_recordui.h"
   63.20 -#include "mmyth_uisettings.h"
   63.21 -#include "mmyth_epg_grid_view.h"
   63.22 -#include "mmyth_tvplayer.h"
   63.23 -
   63.24 -/*
   63.25 - * GMyth library includes 
   63.26 - */
   63.27 -
   63.28 -#ifndef MAEMO_PLATFORM
   63.29 -static gint     button_press_handler(GtkWidget * widget, GdkEvent * event);
   63.30 -#endif
   63.31 -
   63.32 -static MMythUiCommon *create_main_view(MMythUi * mmyth_ui);
   63.33 -static MMythUiCommon *create_video_view(MMythUi * mmyth_ui);
   63.34 -static MMythUiCommon *create_epg_grid_view(MMythUi * mmyth_ui);
   63.35 -static MMythUiCommon *create_record_view(MMythUi * mmyth_ui);
   63.36 -static MMythUiCommon *create_schedule_view(MMythUi * mmyth_ui);
   63.37 -
   63.38 -static void     cb_video_close_button(GtkButton * button,
   63.39 -                                      gpointer user_data);
   63.40 -static void     cb_record_button(GtkButton * button, gpointer user_data);
   63.41 -static void     cb_menu_item_settings(GtkMenuItem * menuitem,
   63.42 -                                      gpointer user_data);
   63.43 -
   63.44 -/*
   63.45 - * main box from button box separator
   63.46 - */
   63.47 -static GtkWidget *main_vseparator = NULL;
   63.48 -
   63.49 -GdkPixbuf      *icon_sports,
   63.50 -               *icon_news,
   63.51 -               *icon_movies,
   63.52 -               *icon_shows,
   63.53 -               *icon_default;
   63.54 -
   63.55 -#ifndef MAEMO_PLATFORM
   63.56 -/*
   63.57 - * FIXME: 
   63.58 - */
   63.59 -static MMythUi *popup_mmyth_ui;
   63.60 -#endif
   63.61 -
   63.62 -MMythUi        *
   63.63 -mmyth_ui_initialize(
   63.64 -#ifdef MAEMO_PLATFORM
   63.65 -                       HildonProgram * program,
   63.66 -#endif
   63.67 -                       GtkWidget * main_window)
   63.68 -{
   63.69 -    MMythUi        *mmyth_ui;
   63.70 -
   63.71 -    mmyth_ui = g_new0(MMythUi, 1);
   63.72 -
   63.73 -    mmyth_ui->backend_info =
   63.74 -        gmyth_backend_info_new_full("localhost", "mythtv", "mythtv",
   63.75 -                                    "mythconverg", 6543);
   63.76 -
   63.77 -    mmyth_ui->main_window = main_window;
   63.78 -    mmyth_ui->videow = NULL;
   63.79 -    mmyth_ui->mmyth_recordui = NULL;
   63.80 -    mmyth_ui->mmyth_schedulerui = NULL;
   63.81 -
   63.82 -    /*
   63.83 -     * Horizontal box that divides the view into control and video area 
   63.84 -     */
   63.85 -    mmyth_ui->main_hbox = gtk_hbox_new(FALSE, 0);
   63.86 -    gtk_widget_show(mmyth_ui->main_hbox);
   63.87 -    g_object_ref(mmyth_ui->main_hbox);
   63.88 -
   63.89 -    main_bg_color.red = 65000;
   63.90 -    main_bg_color.green = 65000;
   63.91 -    main_bg_color.blue = 65000;
   63.92 -
   63.93 -
   63.94 -#ifndef MAEMO_PLATFORM
   63.95 -    /*
   63.96 -     * Popup menu 
   63.97 -     */
   63.98 -    popup_mmyth_ui = mmyth_ui;
   63.99 -    g_signal_connect(G_OBJECT(mmyth_ui->main_hbox), "event",
  63.100 -                     G_CALLBACK(button_press_handler),
  63.101 -                     G_OBJECT(mmyth_ui->main_hbox));
  63.102 -
  63.103 -#else                           // #ifdef MAEMO
  63.104 -
  63.105 -    mmyth_ui->main_menu = GTK_MENU(gtk_menu_new());
  63.106 -    hildon_program_set_common_menu(program, mmyth_ui->main_menu);
  63.107 -
  63.108 -    mmyth_ui->menu_setup = gtk_menu_item_new_with_label("Setup");
  63.109 -    gtk_widget_set_size_request(GTK_WIDGET(mmyth_ui->menu_setup), 150, 40);
  63.110 -    gtk_menu_append(mmyth_ui->main_menu, mmyth_ui->menu_setup);
  63.111 -
  63.112 -    g_signal_connect(G_OBJECT(mmyth_ui->menu_setup), "activate",
  63.113 -                     G_CALLBACK(cb_menu_item_settings), mmyth_ui);
  63.114 -
  63.115 -    gtk_widget_show_all(GTK_WIDGET(mmyth_ui->main_menu));
  63.116 -#endif
  63.117 -
  63.118 -    // Main widget is mmyth_ui->main_hbox
  63.119 -    mmyth_ui->main_uicommon = create_main_view(mmyth_ui);
  63.120 -
  63.121 -    gtk_container_add(GTK_CONTAINER(mmyth_ui->main_window),
  63.122 -                      mmyth_ui->main_hbox);
  63.123 -
  63.124 -    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->main_uicommon);
  63.125 -
  63.126 -    return mmyth_ui;
  63.127 -}
  63.128 -
  63.129 -void
  63.130 -mmyth_ui_finalize(MMythUi * mmyth_ui)
  63.131 -{
  63.132 -    if (mmyth_ui != NULL) {
  63.133 -        if (mmyth_ui->main_uicommon)
  63.134 -            mmyth_uicommon_free(mmyth_ui->main_uicommon);
  63.135 -        if (mmyth_ui->video_uicommon)
  63.136 -            mmyth_uicommon_free(mmyth_ui->video_uicommon);
  63.137 -        if (mmyth_ui->epg_grid_uicommon)
  63.138 -            mmyth_uicommon_free(mmyth_ui->epg_grid_uicommon);
  63.139 -        if (mmyth_ui->record_uicommon)
  63.140 -            mmyth_uicommon_free(mmyth_ui->record_uicommon);
  63.141 -        if (mmyth_ui->schedule_uicommon)
  63.142 -            mmyth_uicommon_free(mmyth_ui->schedule_uicommon);
  63.143 -
  63.144 -        g_free(mmyth_ui);
  63.145 -    }
  63.146 -}
  63.147 -
  63.148 -void
  63.149 -mmyth_ui_set_widget(MMythUi * mmyth_ui, MMythUiCommon * new_uicommon)
  63.150 -{
  63.151 -    if (new_uicommon == NULL) {
  63.152 -        g_warning("MMythUI setting a NULL UI_Common as current display\n");
  63.153 -        return;
  63.154 -    }
  63.155 -
  63.156 -    if (mmyth_ui->current_uicommon) {
  63.157 -        if (mmyth_ui->current_uicommon == mmyth_ui->video_uicommon) {
  63.158 -            gtk_widget_hide(mmyth_ui->current_uicommon->main_widget);
  63.159 -            gtk_widget_hide(mmyth_ui->videow);
  63.160 -        } else {
  63.161 -            gtk_container_remove(GTK_CONTAINER(mmyth_ui->main_hbox),
  63.162 -                                 mmyth_ui->current_uicommon->main_widget);
  63.163 -        }
  63.164 -
  63.165 -        gtk_container_remove(GTK_CONTAINER(mmyth_ui->main_hbox),
  63.166 -                             mmyth_ui->current_uicommon->event_box);
  63.167 -        gtk_container_remove(GTK_CONTAINER(mmyth_ui->main_hbox),
  63.168 -                             main_vseparator);
  63.169 -
  63.170 -    }
  63.171 -
  63.172 -    if (new_uicommon->main_widget == mmyth_ui->video_alignment) {
  63.173 -        // gst_player_video_show (GST_PLAYER_VIDEO(mmyth_ui->videow));
  63.174 -        gtk_widget_show(mmyth_ui->video_alignment);
  63.175 -        gtk_widget_show(mmyth_ui->videow);
  63.176 -    } else {
  63.177 -        /*
  63.178 -         * FIXME: Fst call is NULL when mmyth_player_init fails 
  63.179 -         */
  63.180 -        if (mmyth_ui->video_alignment != NULL)
  63.181 -            gtk_widget_hide(mmyth_ui->video_alignment);
  63.182 -        /*
  63.183 -         * FIXME: Fst call is NULL when mmyth_player_init fails 
  63.184 -         */
  63.185 -        if (mmyth_ui->videow != NULL)
  63.186 -            gtk_widget_hide(mmyth_ui->videow);
  63.187 -
  63.188 -        gtk_box_pack_start(GTK_BOX(mmyth_ui->main_hbox),
  63.189 -                           new_uicommon->main_widget, TRUE, TRUE, 0);
  63.190 -    }
  63.191 -
  63.192 -    if (main_vseparator == NULL) {
  63.193 -        /*
  63.194 -         * FIXME: should free this variable
  63.195 -         */
  63.196 -        main_vseparator = gtk_vseparator_new();
  63.197 -        g_object_ref(main_vseparator);
  63.198 -    }
  63.199 -    gtk_box_pack_start(GTK_BOX(mmyth_ui->main_hbox),
  63.200 -                       main_vseparator, FALSE, FALSE, 0);
  63.201 -    gtk_widget_show(main_vseparator);
  63.202 -
  63.203 -    gtk_box_pack_end(GTK_BOX(mmyth_ui->main_hbox), new_uicommon->event_box,
  63.204 -                     FALSE, FALSE, 0);
  63.205 -
  63.206 -    mmyth_ui->current_uicommon = new_uicommon;
  63.207 -
  63.208 -}
  63.209 -
  63.210 -/*
  63.211 - * The close callback is the same for all windows
  63.212 - */
  63.213 -static void
  63.214 -cb_not_impl_button(GtkButton * button, gpointer user_data)
  63.215 -{
  63.216 -    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  63.217 -
  63.218 -    GtkWidget      *msg_dialog =
  63.219 -        gtk_message_dialog_new(GTK_WINDOW(mmyth_ui->main_window),
  63.220 -                               GTK_DIALOG_MODAL |
  63.221 -                               GTK_DIALOG_DESTROY_WITH_PARENT,
  63.222 -                               GTK_MESSAGE_INFO,
  63.223 -                               GTK_BUTTONS_OK,
  63.224 -                               "Feature not implemented");
  63.225 -    gtk_widget_set_size_request(msg_dialog, 350, 120);
  63.226 -
  63.227 -    gtk_dialog_run(GTK_DIALOG(msg_dialog));
  63.228 -
  63.229 -    gtk_widget_destroy(GTK_WIDGET(msg_dialog));
  63.230 -}
  63.231 -
  63.232 -/******************************************************************************
  63.233 - *                        POPUP MENU WIDGET METHODS                           *
  63.234 - *****************************************************************************/
  63.235 -
  63.236 -static void
  63.237 -cb_menu_item_settings(GtkMenuItem * menuitem, gpointer user_data)
  63.238 -{
  63.239 -
  63.240 -    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  63.241 -
  63.242 -    if (mmyth_uisettings_run(GTK_WINDOW(mmyth_ui->main_window))) {
  63.243 -        // If user changes the settings, we restart the context
  63.244 -        g_debug("[%s] Restarting mmyth_context to new settings",
  63.245 -                __FUNCTION__);
  63.246 -        // gmyth_context_initialize();
  63.247 -    }
  63.248 -}
  63.249 -
  63.250 -#ifndef MAEMO_PLATFORM
  63.251 -
  63.252 -static void
  63.253 -detacher(GtkWidget * attach_widget, GtkMenu * menu)
  63.254 -{
  63.255 -
  63.256 -}
  63.257 -
  63.258 -static void
  63.259 -do_popup_menu(GtkWidget * my_widget, GdkEventButton * event)
  63.260 -{
  63.261 -    GtkWidget      *popup;
  63.262 -
  63.263 -    int             button,
  63.264 -                    event_time;
  63.265 -
  63.266 -    GtkWidget      *item_general;
  63.267 -    GtkWidget      *image;
  63.268 -
  63.269 -    popup = gtk_menu_new();
  63.270 -
  63.271 -    item_general = gtk_image_menu_item_new_with_mnemonic("Setup");
  63.272 -    gtk_widget_show(item_general);
  63.273 -    gtk_container_add(GTK_CONTAINER(popup), item_general);
  63.274 -
  63.275 -    image = gtk_image_new_from_stock("gtk-edit", GTK_ICON_SIZE_MENU);
  63.276 -    gtk_widget_show(image);
  63.277 -    gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item_general),
  63.278 -                                  image);
  63.279 -
  63.280 -    g_signal_connect(G_OBJECT(item_general), "activate",
  63.281 -                     G_CALLBACK(cb_menu_item_settings), popup_mmyth_ui);
  63.282 -
  63.283 -    if (event) {
  63.284 -        button = event->button;
  63.285 -        event_time = event->time;
  63.286 -    } else {
  63.287 -        button = 0;
  63.288 -        event_time = gtk_get_current_event_time();
  63.289 -    }
  63.290 -
  63.291 -    gtk_menu_attach_to_widget(GTK_MENU(popup), my_widget, detacher);
  63.292 -    gtk_menu_popup(GTK_MENU(popup), NULL, NULL, NULL, NULL,
  63.293 -                   button, event_time);
  63.294 -    gtk_widget_show_all(popup);
  63.295 -}
  63.296 -
  63.297 -/*
  63.298 - * Respond to a button-press by posting a menu passed in as widget. Note
  63.299 - * that the "widget" argument is the menu being posted, NOT the button
  63.300 - * that was pressed. 
  63.301 - */
  63.302 -static          gint
  63.303 -button_press_handler(GtkWidget * widget, GdkEvent * event)
  63.304 -{
  63.305 -
  63.306 -    if (event->type == GDK_BUTTON_PRESS) {
  63.307 -        GdkEventButton *bevent = (GdkEventButton *) event;
  63.308 -        /*
  63.309 -         * Ignore double-clicks and triple-clicks 
  63.310 -         */
  63.311 -        if (bevent->button == 3) {
  63.312 -            do_popup_menu(widget, bevent);
  63.313 -            return TRUE;
  63.314 -        }
  63.315 -    }
  63.316 -
  63.317 -    /*
  63.318 -     * Tell calling code that we have not handled this event; pass it on. 
  63.319 -     */
  63.320 -    return FALSE;
  63.321 -}
  63.322 -#endif
  63.323 -
  63.324 -/******************************************************************************
  63.325 - *                          MAIN APP VIEW METHODS                             *
  63.326 - *****************************************************************************/
  63.327 -
  63.328 -static void
  63.329 -cb_close_button(GtkButton * button, gpointer user_data)
  63.330 -{
  63.331 -    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  63.332 -
  63.333 -    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->main_uicommon);
  63.334 -}
  63.335 -
  63.336 -static void
  63.337 -cb_watch_tv_button(GtkButton * button, gpointer user_data)
  63.338 -{
  63.339 -    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  63.340 -    gboolean        res = FALSE;
  63.341 -
  63.342 -    if (!(mmyth_ui->video_uicommon))
  63.343 -        mmyth_ui->video_uicommon = create_video_view(mmyth_ui);
  63.344 -
  63.345 -    // Creates the tv player that will retrieve the mythtv content, decode 
  63.346 -    // and show it
  63.347 -    mmyth_ui->tvplayer = mmyth_tvplayer_new();
  63.348 -    /*
  63.349 -     * choose here if this is a LiveTV session 
  63.350 -     */
  63.351 -    mmyth_ui->tvplayer->is_livetv = TRUE;
  63.352 -
  63.353 -    res =
  63.354 -        mmyth_tvplayer_initialize(mmyth_ui->tvplayer,
  63.355 -                                  mmyth_ui->backend_info);
  63.356 -
  63.357 -    if (!res) {
  63.358 -        g_warning("[%s] Could not initialize tvplayer", __FUNCTION__);
  63.359 -
  63.360 -        g_object_unref(mmyth_ui->tvplayer);
  63.361 -        mmyth_ui->tvplayer = NULL;
  63.362 -
  63.363 -        GtkWidget      *dialog =
  63.364 -            gtk_message_dialog_new(GTK_WINDOW(mmyth_ui->main_window),
  63.365 -                                   GTK_DIALOG_DESTROY_WITH_PARENT,
  63.366 -                                   GTK_MESSAGE_ERROR,
  63.367 -                                   GTK_BUTTONS_CLOSE,
  63.368 -                                   "MMyth found errors while starting TV Player, please check "
  63.369 -                                   "the GStreamer installation");
  63.370 -
  63.371 -        gtk_dialog_run(GTK_DIALOG(dialog));
  63.372 -        gtk_widget_destroy(dialog);
  63.373 -
  63.374 -        return;
  63.375 -    }
  63.376 -    // res = mmyth_tvplayer_livetv_setup (mmyth_ui->tvplayer);
  63.377 -    // 
  63.378 -    if (mmyth_ui && mmyth_ui->tvplayer && res) {
  63.379 -        mmyth_tvplayer_set_widget(mmyth_ui->tvplayer, mmyth_ui->videow);
  63.380 -        mmyth_tvplayer_start_playing(mmyth_ui->tvplayer);
  63.381 -    } else {
  63.382 -        // TODO: Show Alert with error description!
  63.383 -        g_warning("[%s] MMythUI can't initialize tv_player", __FUNCTION__);
  63.384 -        g_object_unref(mmyth_ui->tvplayer);
  63.385 -        mmyth_ui->tvplayer = NULL;
  63.386 -        // FIXME: Show the exact error that happened
  63.387 -        GtkWidget      *dialog =
  63.388 -            gtk_message_dialog_new(GTK_WINDOW(mmyth_ui->main_window),
  63.389 -                                   GTK_DIALOG_DESTROY_WITH_PARENT,
  63.390 -                                   GTK_MESSAGE_ERROR,
  63.391 -                                   GTK_BUTTONS_CLOSE,
  63.392 -                                   "Error while starting TV Player, please check if the backend"
  63.393 -                                   " is running properly and a tv card is available!");
  63.394 -        gtk_dialog_run(GTK_DIALOG(dialog));
  63.395 -        gtk_widget_destroy(dialog);
  63.396 -        return;
  63.397 -    }
  63.398 -    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->video_uicommon);
  63.399 -
  63.400 -}
  63.401 -
  63.402 -static void
  63.403 -cb_epg_button(GtkButton * button, gpointer user_data)
  63.404 -{
  63.405 -    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  63.406 -
  63.407 -    if (!(mmyth_ui->epg_grid_uicommon))
  63.408 -        mmyth_ui->epg_grid_uicommon = create_epg_grid_view(mmyth_ui);
  63.409 -
  63.410 -    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->epg_grid_uicommon);
  63.411 -}
  63.412 -
  63.413 -static MMythUiCommon *
  63.414 -create_main_view(MMythUi * mmyth_ui)
  63.415 -{
  63.416 -    MMythUiCommon  *ui_common;
  63.417 -    GtkWidget      *main_widget;
  63.418 -    GtkWidget      *image;
  63.419 -
  63.420 -    g_debug("Creating Main UI Common");
  63.421 -
  63.422 -    // FIXME: file path
  63.423 -#ifdef MMYTH_DEV
  63.424 -    image = gtk_image_new_from_file("../pixmaps/mmyth_logo.png");
  63.425 -#else
  63.426 -    image = gtk_image_new_from_file(PIX_DIR "mmyth_logo.png");
  63.427 -#endif
  63.428 -
  63.429 -    main_widget = gtk_event_box_new();
  63.430 -
  63.431 -    gtk_container_add(GTK_CONTAINER(main_widget), image);
  63.432 -
  63.433 -
  63.434 -    gtk_widget_show_all(main_widget);
  63.435 -    g_object_ref(main_widget);
  63.436 -
  63.437 -    ui_common = mmyth_uicommon_new(main_widget,
  63.438 -                                   "Watch TV", "EPG", "Recording");
  63.439 -
  63.440 -    /*
  63.441 -     * Button signals 
  63.442 -     */
  63.443 -    // FIXME
  63.444 -    g_signal_connect(G_OBJECT(ui_common->button1), "clicked",
  63.445 -                     G_CALLBACK(cb_watch_tv_button), mmyth_ui);
  63.446 -    g_signal_connect(G_OBJECT(ui_common->button2), "clicked",
  63.447 -                     G_CALLBACK(cb_epg_button), mmyth_ui);
  63.448 -    g_signal_connect(G_OBJECT(ui_common->button3), "clicked",
  63.449 -                     G_CALLBACK(cb_record_button), mmyth_ui);
  63.450 -
  63.451 -    return ui_common;
  63.452 -
  63.453 -}
  63.454 -
  63.455 -/******************************************************************************
  63.456 - *                         epg GRID VIEW METHODS                              *
  63.457 - *****************************************************************************/
  63.458 -
  63.459 -static MMythUiCommon *
  63.460 -create_epg_grid_view(MMythUi * mmyth_ui)
  63.461 -{
  63.462 -    MMythUiCommon  *ui_common;
  63.463 -
  63.464 -    g_debug("Creating EPG Grid UI Common");
  63.465 -
  63.466 -    GtkWidget      *epg_grid_view =
  63.467 -        GTK_WIDGET(epg_grid_view_new(mmyth_ui));
  63.468 -
  63.469 -    ui_common = mmyth_uicommon_new(epg_grid_view,
  63.470 -                                   "Play", "Record", "Close");
  63.471 -
  63.472 -    /*
  63.473 -     * Button signals 
  63.474 -     */
  63.475 -    g_signal_connect(G_OBJECT(ui_common->button1), "clicked",
  63.476 -                     G_CALLBACK(cb_not_impl_button), mmyth_ui);
  63.477 -    g_signal_connect(G_OBJECT(ui_common->button2), "clicked",
  63.478 -                     G_CALLBACK(cb_record_button), mmyth_ui);
  63.479 -    g_signal_connect(G_OBJECT(ui_common->button3), "clicked",
  63.480 -                     G_CALLBACK(cb_close_button), mmyth_ui);
  63.481 -
  63.482 -    return ui_common;
  63.483 -}
  63.484 -/******************************************************************************
  63.485 - *                         SCHEDULE VIEW METHODS                                *
  63.486 - ******************************************************************************/
  63.487 -
  63.488 -static void
  63.489 -cb_save_new_schedule(GtkButton * button, gpointer user_data)
  63.490 -{
  63.491 -    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  63.492 -
  63.493 -    if (!(mmyth_ui->schedule_uicommon))
  63.494 -        mmyth_ui->schedule_uicommon = create_schedule_view(mmyth_ui);
  63.495 -
  63.496 -    mmyth_schedulerui_save(mmyth_ui->mmyth_schedulerui);
  63.497 -
  63.498 -    mmyth_recordui_reload_schedule(mmyth_ui->mmyth_recordui);
  63.499 -
  63.500 -    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->record_uicommon);
  63.501 -
  63.502 -}
  63.503 -
  63.504 -static void
  63.505 -cb_edit_scheduled(GtkTreeView * tree_view, GtkTreePath * path,
  63.506 -                  GtkTreeViewColumn * column, gpointer user_data)
  63.507 -{
  63.508 -    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  63.509 -    GtkTreeSelection *selection;
  63.510 -    GtkTreeModel   *list_store;
  63.511 -    GtkTreeIter     iter;
  63.512 -    int             index;
  63.513 -    // gint new_row = 0, record_id = 0;
  63.514 -    ScheduleInfo   *schedule_info;
  63.515 -    GList          *schedule_list;
  63.516 -    // GtkTreeIter iter;
  63.517 -    gint            res;
  63.518 -
  63.519 -    // gtk_tree_store_clear(recordui->sch_tree_store); 
  63.520 -
  63.521 -    res =
  63.522 -        gmyth_scheduler_get_schedule_list(mmyth_ui->mmyth_recordui->
  63.523 -                                          scheduler, &(schedule_list));
  63.524 -    if (res < 0) {
  63.525 -        g_warning
  63.526 -            ("[%s] Retrieved NULL list of scheduled data from database",
  63.527 -             __FUNCTION__);
  63.528 -        // return FALSE;
  63.529 -    }
  63.530 -    printf("\nX %d", res);
  63.531 -    fflush(stdout);
  63.532 -
  63.533 -    selection =
  63.534 -        gtk_tree_view_get_selection(GTK_TREE_VIEW
  63.535 -                                    (mmyth_ui->mmyth_recordui->
  63.536 -                                     sch_treeview));
  63.537 -
  63.538 -    gtk_tree_selection_get_selected(selection, &list_store, &iter);
  63.539 -    gtk_tree_model_get(list_store, &iter, 4, &index, -1);
  63.540 -
  63.541 -    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->schedule_uicommon);
  63.542 -
  63.543 -    if (!(mmyth_ui->schedule_uicommon))
  63.544 -        mmyth_ui->schedule_uicommon = create_schedule_view(mmyth_ui);
  63.545 -
  63.546 -    schedule_list =
  63.547 -        g_list_nth(schedule_list,
  63.548 -                   g_ascii_strtoull(gtk_tree_path_to_string(path), NULL,
  63.549 -                                    10));
  63.550 -    schedule_info = (ScheduleInfo *) schedule_list->data;
  63.551 -
  63.552 -    printf("\nstarttime: %ld", schedule_info->start_time->tv_sec);
  63.553 -    fflush(stdout);
  63.554 -}
  63.555 -
  63.556 -static MMythUiCommon *
  63.557 -create_schedule_view(MMythUi * mmyth_ui)
  63.558 -{
  63.559 -    MMythUiCommon  *ui_common;
  63.560 -    GtkWidget      *schedule_widget;
  63.561 -
  63.562 -    g_debug("Creating Schedule UI Common");
  63.563 -
  63.564 -    mmyth_ui->mmyth_schedulerui =
  63.565 -        mmyth_schedulerui_new(mmyth_ui->backend_info);
  63.566 -    if (mmyth_ui->mmyth_schedulerui == NULL) {
  63.567 -        g_warning("[%s] Error while creating scheduler ui", __FUNCTION__);
  63.568 -        return NULL;
  63.569 -    }
  63.570 -
  63.571 -    schedule_widget = mmyth_ui->mmyth_schedulerui->main_widget;
  63.572 -
  63.573 -    gtk_widget_show_all(schedule_widget);
  63.574 -    g_object_ref(schedule_widget);
  63.575 -
  63.576 -    ui_common = mmyth_uicommon_new(schedule_widget,
  63.577 -                                   "Save", "Clear", "Cancel");
  63.578 -
  63.579 -    /*
  63.580 -     * Button signals 
  63.581 -     */
  63.582 -    g_signal_connect(G_OBJECT(ui_common->button1), "clicked",
  63.583 -                     G_CALLBACK(cb_save_new_schedule), mmyth_ui);
  63.584 -    g_signal_connect(G_OBJECT(ui_common->button2), "clicked",
  63.585 -                     G_CALLBACK(cb_not_impl_button), mmyth_ui);
  63.586 -    g_signal_connect(G_OBJECT(ui_common->button3), "clicked",
  63.587 -                     G_CALLBACK(cb_record_button), mmyth_ui);
  63.588 -
  63.589 -    return ui_common;
  63.590 -}
  63.591 -/******************************************************************************
  63.592 - *                         RECORD VIEW METHODS                                *
  63.593 - ******************************************************************************/
  63.594 -static void
  63.595 -cb_record_button(GtkButton * button, gpointer user_data)
  63.596 -{
  63.597 -    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  63.598 -
  63.599 -    if (!(mmyth_ui->record_uicommon)) {
  63.600 -        mmyth_ui->record_uicommon = create_record_view(mmyth_ui);
  63.601 -        mmyth_ui->schedule_uicommon = create_schedule_view(mmyth_ui);
  63.602 -    }
  63.603 -
  63.604 -    mmyth_recordui_reload_all(mmyth_ui->mmyth_recordui);
  63.605 -
  63.606 -    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->record_uicommon);
  63.607 -
  63.608 -}
  63.609 -
  63.610 -static void
  63.611 -cb_record_close_button(GtkButton * button, gpointer user_data)
  63.612 -{
  63.613 -    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  63.614 -
  63.615 -    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->main_uicommon);
  63.616 -
  63.617 -    mmyth_recordui_free(mmyth_ui->mmyth_recordui);
  63.618 -
  63.619 -    if (mmyth_ui->record_uicommon) {
  63.620 -        gtk_widget_destroy(mmyth_ui->record_uicommon->main_widget);
  63.621 -        mmyth_uicommon_free(mmyth_ui->record_uicommon);
  63.622 -        mmyth_ui->record_uicommon = NULL;
  63.623 -    }
  63.624 -
  63.625 -    if (mmyth_ui->schedule_uicommon) {
  63.626 -        // mmyth_uicommon_free(mmyth_ui->schedule_uicommon);
  63.627 -    }
  63.628 -}
  63.629 -
  63.630 -
  63.631 -
  63.632 -
  63.633 -static void
  63.634 -play_selected_recorded(gpointer user_data)
  63.635 -{
  63.636 -    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  63.637 -    gboolean        res = FALSE;
  63.638 -
  63.639 -    gchar          *path =
  63.640 -        mmyth_recordui_get_selected_recorded(mmyth_ui->mmyth_recordui);
  63.641 -
  63.642 -    if (path == NULL) {
  63.643 -        // This should never happens. Play button is just activated when
  63.644 -        // a recording is selected.
  63.645 -        g_warning
  63.646 -            ("[%s] Play button pressed while none recorded is selected",
  63.647 -             __FUNCTION__);
  63.648 -        return;
  63.649 -    }
  63.650 -
  63.651 -    if (!(mmyth_ui->video_uicommon))
  63.652 -        mmyth_ui->video_uicommon = create_video_view(mmyth_ui);
  63.653 -
  63.654 -    // Creates the tv player that will retrieve the mythtv content, decode 
  63.655 -    // and show it
  63.656 -    mmyth_ui->tvplayer = mmyth_tvplayer_new();
  63.657 -    g_debug("[%s] New TV Player created: %d\n", __FUNCTION__,
  63.658 -            (int) (mmyth_ui->tvplayer));
  63.659 -    res =
  63.660 -        mmyth_tvplayer_initialize(mmyth_ui->tvplayer,
  63.661 -                                  mmyth_ui->backend_info);
  63.662 -    if (!res) {
  63.663 -        g_warning("[%s] Could not initialize tvplayer", __FUNCTION__);
  63.664 -
  63.665 -        g_object_unref(mmyth_ui->tvplayer);
  63.666 -        mmyth_ui->tvplayer = NULL;
  63.667 -
  63.668 -        GtkWidget      *dialog =
  63.669 -            gtk_message_dialog_new(GTK_WINDOW(mmyth_ui->main_window),
  63.670 -                                   GTK_DIALOG_DESTROY_WITH_PARENT,
  63.671 -                                   GTK_MESSAGE_ERROR,
  63.672 -                                   GTK_BUTTONS_CLOSE,
  63.673 -                                   "MMyth found errors while starting TV Player, please check "
  63.674 -                                   "the GStreamer installation");
  63.675 -
  63.676 -        gtk_dialog_run(GTK_DIALOG(dialog));
  63.677 -        gtk_widget_destroy(dialog);
  63.678 -
  63.679 -        return;
  63.680 -    }
  63.681 -
  63.682 -    res = mmyth_tvplayer_record_setup(mmyth_ui->tvplayer, path);
  63.683 -
  63.684 -    if (mmyth_ui && mmyth_ui->tvplayer && res) {
  63.685 -        mmyth_tvplayer_set_widget(mmyth_ui->tvplayer, mmyth_ui->videow);
  63.686 -        mmyth_tvplayer_start_playing(mmyth_ui->tvplayer);
  63.687 -    } else {
  63.688 -        // TODO: Show Alert with error description!
  63.689 -        g_warning("[%s] MMythUI can't initialize tv_player", __FUNCTION__);
  63.690 -        g_object_unref(mmyth_ui->tvplayer);
  63.691 -        mmyth_ui->tvplayer = NULL;
  63.692 -        // FIXME: Show the exact error that happened
  63.693 -        GtkWidget      *dialog =
  63.694 -            gtk_message_dialog_new(GTK_WINDOW(mmyth_ui->main_window),
  63.695 -                                   GTK_DIALOG_DESTROY_WITH_PARENT,
  63.696 -                                   GTK_MESSAGE_ERROR,
  63.697 -                                   GTK_BUTTONS_CLOSE,
  63.698 -                                   "Error while starting TV Player, please check if the backend"
  63.699 -                                   " is running properly and a tv card is available!");
  63.700 -        gtk_dialog_run(GTK_DIALOG(dialog));
  63.701 -        gtk_widget_destroy(dialog);
  63.702 -        return;
  63.703 -    }
  63.704 -
  63.705 -    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->video_uicommon);
  63.706 -}
  63.707 -
  63.708 -static void
  63.709 -cb_play_clicked_recorded(GtkTreeView * tree_view, GtkTreePath * path,
  63.710 -                         GtkTreeViewColumn * column, gpointer user_data)
  63.711 -{
  63.712 -    play_selected_recorded(user_data);
  63.713 -}
  63.714 -
  63.715 -static void
  63.716 -cb_play_selected(GtkButton * button, gpointer user_data)
  63.717 -{
  63.718 -    play_selected_recorded(user_data);
  63.719 -}
  63.720 -
  63.721 -static void
  63.722 -cb_schedule_button(GtkButton * button, gpointer user_data)
  63.723 -{
  63.724 -    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  63.725 -
  63.726 -    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->schedule_uicommon);
  63.727 -}
  63.728 -
  63.729 -void
  63.730 -cb_switch_page(GtkNotebook * notebook, GtkNotebookPage * page,
  63.731 -               guint page_num, gpointer user_data)
  63.732 -{
  63.733 -    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  63.734 -    MMythUiCommon  *ui_common;
  63.735 -
  63.736 -    assert(mmyth_ui);
  63.737 -    assert(mmyth_ui->record_uicommon);
  63.738 -
  63.739 -    ui_common = mmyth_ui->record_uicommon;
  63.740 -
  63.741 -    if (page_num == 0) {        // Switched to Schedule list
  63.742 -        gtk_button_set_label(GTK_BUTTON(ui_common->button1), "New");
  63.743 -        g_signal_handlers_disconnect_by_func(G_OBJECT(ui_common->button1),
  63.744 -                                             G_CALLBACK(cb_play_selected),
  63.745 -                                             mmyth_ui);
  63.746 -        g_signal_connect(G_OBJECT(ui_common->button1), "clicked",
  63.747 -                         G_CALLBACK(cb_schedule_button), mmyth_ui);
  63.748 -    } else if (page_num == 1) {
  63.749 -        gtk_button_set_label(GTK_BUTTON(ui_common->button1), "Play");
  63.750 -        g_signal_handlers_disconnect_by_func(G_OBJECT(ui_common->button1),
  63.751 -                                             G_CALLBACK
  63.752 -                                             (cb_schedule_button),
  63.753 -                                             mmyth_ui);
  63.754 -        g_signal_connect(G_OBJECT(ui_common->button1), "clicked",
  63.755 -                         G_CALLBACK(cb_play_selected), mmyth_ui);
  63.756 -    }
  63.757 -}
  63.758 -
  63.759 -
  63.760 -static MMythUiCommon *
  63.761 -create_record_view(MMythUi * mmyth_ui)
  63.762 -{
  63.763 -    MMythUiCommon  *ui_common;
  63.764 -
  63.765 -    g_debug("Creating Record UI Common");
  63.766 -
  63.767 -    mmyth_ui->mmyth_recordui = mmyth_recordui_new(mmyth_ui->backend_info);
  63.768 -
  63.769 -    // FIXME: Change MMythRecordUI to a GtkWidget child and avoid this
  63.770 -    // call!
  63.771 -    gtk_widget_show_all(mmyth_ui->mmyth_recordui->scrolled_window);
  63.772 -
  63.773 -    ui_common =
  63.774 -        mmyth_uicommon_new(mmyth_ui->mmyth_recordui->scrolled_window,
  63.775 -                           "New", "Delete", "<<Back");
  63.776 -    g_object_ref(mmyth_ui->mmyth_recordui->scrolled_window);
  63.777 -
  63.778 -    /*
  63.779 -     * Button signals 
  63.780 -     */
  63.781 -    g_signal_connect(G_OBJECT(ui_common->button1), "clicked",
  63.782 -                     G_CALLBACK(cb_schedule_button), mmyth_ui);
  63.783 -    g_signal_connect(G_OBJECT(ui_common->button2), "clicked",
  63.784 -                     G_CALLBACK(mmyth_recordui_delete_selected),
  63.785 -                     mmyth_ui->mmyth_recordui);
  63.786 -    g_signal_connect(G_OBJECT(ui_common->button3), "clicked",
  63.787 -                     G_CALLBACK(cb_record_close_button), mmyth_ui);
  63.788 -    g_signal_connect(G_OBJECT(mmyth_ui->mmyth_recordui->notebook),
  63.789 -                     "switch-page", G_CALLBACK(cb_switch_page), mmyth_ui);
  63.790 -    g_signal_connect(G_OBJECT(mmyth_ui->mmyth_recordui->rec_treeview),
  63.791 -                     "row-activated", G_CALLBACK(cb_play_clicked_recorded),
  63.792 -                     mmyth_ui);
  63.793 -    g_signal_connect(G_OBJECT(mmyth_ui->mmyth_recordui->sch_treeview),
  63.794 -                     "row-activated", G_CALLBACK(cb_edit_scheduled),
  63.795 -                     mmyth_ui);
  63.796 -    return ui_common;
  63.797 -}
  63.798 -
  63.799 -
  63.800 -/******************************************************************************
  63.801 - *                         GST VIDEO WIDGET METHODS                           *
  63.802 - *****************************************************************************/
  63.803 -
  63.804 -static void
  63.805 -cb_video_close_button(GtkButton * button, gpointer user_data)
  63.806 -{
  63.807 -    MMythUi        *mmyth_ui = (MMythUi *) user_data;
  63.808 -
  63.809 -    g_debug("MMythUI video close button pressed");
  63.810 -
  63.811 -    if (mmyth_ui && mmyth_ui->tvplayer) {
  63.812 -        mmyth_tvplayer_stop_playing(mmyth_ui->tvplayer);
  63.813 -
  63.814 -        g_object_unref(mmyth_ui->tvplayer);
  63.815 -        mmyth_ui->tvplayer = NULL;
  63.816 -    } else {
  63.817 -        g_warning("cb_video_close_button called with NULL pointer\n");
  63.818 -    }
  63.819 -
  63.820 -    mmyth_ui_set_widget(mmyth_ui, mmyth_ui->main_uicommon);
  63.821 -}
  63.822 -
  63.823 -
  63.824 -static MMythUiCommon *
  63.825 -create_video_view(MMythUi * mmyth_ui)
  63.826 -{
  63.827 -
  63.828 -    MMythUiCommon  *ui_common;
  63.829 -
  63.830 -    g_debug("Creating Video UI Common");
  63.831 -
  63.832 -    /*
  63.833 -     * Creates widget to be user by MMythTVPlayer to draw the video 
  63.834 -     */
  63.835 -    mmyth_ui->videow = gtk_drawing_area_new();
  63.836 -    // FIXME: Get the widget size from settings
  63.837 -    gtk_widget_set_size_request(mmyth_ui->videow, 300, 240);
  63.838 -
  63.839 -    // mmiptv_ui->logo = gdk_pixbuf_new_from_file ("logo.png", NULL);
  63.840 -
  63.841 -    // Creates an alignment to place the video widget inside
  63.842 -    mmyth_ui->video_alignment = gtk_alignment_new(0.5, 0.5, 1, 1);
  63.843 -    gtk_widget_hide(mmyth_ui->video_alignment);
  63.844 -
  63.845 -    gtk_container_add(GTK_CONTAINER(mmyth_ui->video_alignment),
  63.846 -                      mmyth_ui->videow);
  63.847 -
  63.848 -    /*
  63.849 -     * Add the gst video widget to hbox. It should never be removed. 
  63.850 -     */
  63.851 -    /*
  63.852 -     * FIXME: mmyth_ui->video_alignment == NULL when mmyth_player_init
  63.853 -     * fails 
  63.854 -     */
  63.855 -    if ((mmyth_ui->main_hbox != NULL)
  63.856 -        && (mmyth_ui->video_alignment != NULL)) {
  63.857 -        gtk_box_pack_start(GTK_BOX(mmyth_ui->main_hbox),
  63.858 -                           mmyth_ui->video_alignment, TRUE, TRUE, 0);
  63.859 -    } else {
  63.860 -        g_warning("[%s] Error while adding video_alignment to main widget",
  63.861 -                  __FUNCTION__);
  63.862 -    }
  63.863 -
  63.864 -    g_object_ref(mmyth_ui->videow);
  63.865 -    g_object_ref(mmyth_ui->video_alignment);
  63.866 -
  63.867 -    ui_common = mmyth_uicommon_new(mmyth_ui->video_alignment,
  63.868 -                                   "  Full\nScreen", "Other\nServices",
  63.869 -                                   "Close");
  63.870 -
  63.871 -
  63.872 -    g_signal_connect(G_OBJECT(ui_common->button1), "clicked",
  63.873 -                     G_CALLBACK(cb_not_impl_button), mmyth_ui);
  63.874 -    g_signal_connect(G_OBJECT(ui_common->button2), "clicked",
  63.875 -                     G_CALLBACK(cb_not_impl_button), mmyth_ui);
  63.876 -    g_signal_connect(G_OBJECT(ui_common->button3), "clicked",
  63.877 -                     G_CALLBACK(cb_video_close_button), mmyth_ui);
  63.878 -
  63.879 -    if (ui_common)
  63.880 -        g_debug("Video UI_Common sucessfull created");
  63.881 -
  63.882 -    return ui_common;
  63.883 -}
  63.884 -
  63.885 -
  63.886 -
  63.887 -GtkWidget      *
  63.888 -mmyth_ui_get_video_widget(MMythUi * mmyth_ui)
  63.889 -{
  63.890 -
  63.891 -    if (mmyth_ui && mmyth_ui->videow) {
  63.892 -
  63.893 -        return mmyth_ui->videow;
  63.894 -    }
  63.895 -
  63.896 -    return NULL;
  63.897 -}
    64.1 --- a/maemo-ui/src/mmyth_ui.h	Wed Aug 01 14:22:14 2007 +0100
    64.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.3 @@ -1,91 +0,0 @@
    64.4 -#ifndef MMYTH_UI_H_
    64.5 -#define MMYTH_UI_H_
    64.6 -
    64.7 -#include <gtk/gtk.h>
    64.8 -#include <gst/gst.h>
    64.9 -
   64.10 -#include "config.h"
   64.11 -
   64.12 -#ifdef MAEMO_PLATFORM
   64.13 -#include "hildon-widgets/hildon-program.h"
   64.14 -#include "hildon-widgets/hildon-window.h"
   64.15 -#endif
   64.16 -
   64.17 -#include "mmyth_uicommon.h"
   64.18 -#include "mmyth_recordui.h"
   64.19 -#include "mmyth_schedulerui.h"
   64.20 -#include "mmyth_tvplayer.h"
   64.21 -
   64.22 -/*
   64.23 - * GMyth specific includes 
   64.24 - */
   64.25 -#include <gmyth/gmyth_backendinfo.h>
   64.26 -
   64.27 -typedef struct _MMythUi {
   64.28 -
   64.29 -    /*
   64.30 -     * The main application window 
   64.31 -     */
   64.32 -    GtkWidget      *main_window;
   64.33 -    MMythUiCommon  *current_uicommon;
   64.34 -
   64.35 -    /*
   64.36 -     * Main widget components 
   64.37 -     */
   64.38 -    GtkWidget      *main_hbox;
   64.39 -    GtkWidget      *video_alignment;
   64.40 -    GdkPixbuf      *logo;
   64.41 -
   64.42 -    /*
   64.43 -     * Main widgets grouping 
   64.44 -     */
   64.45 -    MMythUiCommon  *main_uicommon;
   64.46 -    MMythUiCommon  *video_uicommon;
   64.47 -    MMythUiCommon  *epg_grid_uicommon;
   64.48 -    MMythUiCommon  *record_uicommon;
   64.49 -    MMythUiCommon  *schedule_uicommon;
   64.50 -
   64.51 -    GMythBackendInfo *backend_info;
   64.52 -
   64.53 -    GtkWidget      *videow;
   64.54 -    int             idle_id;
   64.55 -    // GstTagList *tagcache;
   64.56 -
   64.57 -    MMythRecordUI  *mmyth_recordui;
   64.58 -    MMythSchedulerUI *mmyth_schedulerui;
   64.59 -
   64.60 -#ifdef MAEMO_PLATFORM
   64.61 -    HildonProgram  *program;
   64.62 -    GtkMenu        *main_menu;
   64.63 -    GtkWidget      *menu_setup;
   64.64 -#endif
   64.65 -
   64.66 -    MMythTVPlayer  *tvplayer;
   64.67 -
   64.68 -} MMythUi;
   64.69 -
   64.70 -GdkPixbuf      *icon_sports,
   64.71 -               *icon_news,
   64.72 -               *icon_movies,
   64.73 -               *icon_shows;
   64.74 -GdkColor        main_bg_color;
   64.75 -
   64.76 -void            mmyth_set_main_widget(MMythUi * mmyth_ui,
   64.77 -                                      MMythUiCommon * new_ui);
   64.78 -// void mmyth_play_selected(GtkButton * button, gpointer user_data);
   64.79 -
   64.80 -#ifdef MAEMO_PLATFORM
   64.81 -MMythUi        *mmyth_ui_initialize(HildonProgram * program,
   64.82 -                                    GtkWidget * main_window);
   64.83 -#else
   64.84 -MMythUi        *mmyth_ui_initialize(GtkWidget * main_window);
   64.85 -#endif
   64.86 -
   64.87 -void            mmyth_ui_finalize(MMythUi * mmyth_ui);
   64.88 -
   64.89 -void            mmyth_ui_set_widget(MMythUi * mmyth_ui,
   64.90 -                                    MMythUiCommon * new_uicommon);
   64.91 -
   64.92 -GtkWidget      *mmyth_ui_get_video_widget(MMythUi * mmyth_ui);
   64.93 -
   64.94 -#endif                          /* MMYTH_UI_H_ */
    65.1 --- a/maemo-ui/src/mmyth_uicommon.c	Wed Aug 01 14:22:14 2007 +0100
    65.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.3 @@ -1,156 +0,0 @@
    65.4 -
    65.5 -#include <gtk/gtk.h>
    65.6 -#include <glib.h>
    65.7 -#include <glib/gprintf.h>
    65.8 -
    65.9 -#include "mmyth_uicommon.h"
   65.10 -#include "mmyth_ui.h"
   65.11 -
   65.12 -static void
   65.13 -refresh_time_on_screen(GtkWidget * label)
   65.14 -{
   65.15 -    time_t          real_time;
   65.16 -    struct tm       sched_time;
   65.17 -    GString        *time_showed;
   65.18 -
   65.19 -    time_showed = g_string_new("");
   65.20 -    time(&real_time);
   65.21 -
   65.22 -    if (localtime_r((time_t *) & real_time, &sched_time) == NULL) {
   65.23 -        g_error("localtime_r error in mmyth_epg_grid_view!\n");
   65.24 -        return;
   65.25 -    }
   65.26 -
   65.27 -    g_string_printf(time_showed, "%d:%02d:%02d",
   65.28 -                    sched_time.tm_hour,
   65.29 -                    sched_time.tm_min, sched_time.tm_sec);
   65.30 -
   65.31 -    gtk_label_set_text(GTK_LABEL(label), time_showed->str);
   65.32 -}
   65.33 -
   65.34 -MMythUiCommon  *
   65.35 -mmyth_uicommon_new(GtkWidget * main_widget, const gchar * label1,
   65.36 -                   const gchar * label2, const gchar * label3)
   65.37 -{
   65.38 -
   65.39 -    MMythUiCommon  *ui_common = g_new0(MMythUiCommon, 1);
   65.40 -
   65.41 -    if (!main_widget) {
   65.42 -        g_warning("MMythUICommon created with a NULL main widget\n");
   65.43 -    }
   65.44 -
   65.45 -    ui_common->main_widget = main_widget;
   65.46 -
   65.47 -    ui_common->event_box = gtk_event_box_new();
   65.48 -
   65.49 -    /*
   65.50 -     * Vertical box that divides the control area into two (buttons +
   65.51 -     * clock) 
   65.52 -     */
   65.53 -    ui_common->vbox = gtk_vbox_new(FALSE, 0);   /* spacing */
   65.54 -    gtk_container_set_border_width(GTK_CONTAINER(ui_common->vbox), 4);
   65.55 -
   65.56 -    gtk_container_add(GTK_CONTAINER(ui_common->event_box),
   65.57 -                      ui_common->vbox);
   65.58 -    gtk_widget_modify_bg(ui_common->event_box, GTK_STATE_NORMAL,
   65.59 -                         &main_bg_color);
   65.60 -
   65.61 -    /*
   65.62 -     * Vertical box that divides the control area into four 
   65.63 -     */
   65.64 -    ui_common->button_vbox = gtk_vbox_new(TRUE, 0); /* spacing */
   65.65 -
   65.66 -    gtk_container_set_border_width(GTK_CONTAINER(ui_common->button_vbox),
   65.67 -                                   0);
   65.68 -
   65.69 -    /*
   65.70 -     * The button 1 
   65.71 -     */
   65.72 -    ui_common->button1 = gtk_button_new_with_label(label1);
   65.73 -    gtk_widget_modify_bg(ui_common->button1, GTK_STATE_NORMAL,
   65.74 -                         &main_bg_color);
   65.75 -    gtk_widget_set_size_request(ui_common->button1, BUTTON_WIDTH,
   65.76 -                                BUTTON_HEIGHT);
   65.77 -
   65.78 -    /*
   65.79 -     * The button 2 
   65.80 -     */
   65.81 -    ui_common->button2 = gtk_button_new_with_label(label2);
   65.82 -    gtk_widget_modify_bg(ui_common->button2, GTK_STATE_NORMAL,
   65.83 -                         &main_bg_color);
   65.84 -    gtk_widget_set_size_request(ui_common->button2, BUTTON_WIDTH,
   65.85 -                                BUTTON_HEIGHT);
   65.86 -
   65.87 -    /*
   65.88 -     * The button 3 
   65.89 -     */
   65.90 -    ui_common->button3 = gtk_button_new_with_label(label3);
   65.91 -    gtk_widget_modify_bg(ui_common->button3, GTK_STATE_NORMAL,
   65.92 -                         &main_bg_color);
   65.93 -    gtk_widget_set_size_request(ui_common->button3, BUTTON_WIDTH,
   65.94 -                                BUTTON_HEIGHT);
   65.95 -
   65.96 -    /*
   65.97 -     * The clock label 
   65.98 -     */
   65.99 -    ui_common->label = gtk_label_new("Starting...");
  65.100 -    gtk_widget_show(ui_common->label);
  65.101 -    ui_common->source_id =
  65.102 -        g_timeout_add(500, (GSourceFunc) refresh_time_on_screen,
  65.103 -                      ui_common->label);
  65.104 -
  65.105 -    /*
  65.106 -     * Packing components 
  65.107 -     */
  65.108 -    gtk_box_pack_start(GTK_BOX(ui_common->vbox),
  65.109 -                       ui_common->button_vbox, TRUE, TRUE, 0);
  65.110 -
  65.111 -    gtk_box_pack_start(GTK_BOX(ui_common->vbox),
  65.112 -                       ui_common->label, FALSE, FALSE, 0);
  65.113 -
  65.114 -    gtk_box_pack_start(GTK_BOX(ui_common->button_vbox),
  65.115 -                       ui_common->button1, FALSE, FALSE, 0);
  65.116 -
  65.117 -    gtk_box_pack_start(GTK_BOX(ui_common->button_vbox),
  65.118 -                       ui_common->button2, FALSE, FALSE, 0);
  65.119 -
  65.120 -    gtk_box_pack_start(GTK_BOX(ui_common->button_vbox),
  65.121 -                       ui_common->button3, FALSE, FALSE, 0);
  65.122 -
  65.123 -    gtk_widget_show_all(ui_common->event_box);
  65.124 -
  65.125 -    /*
  65.126 -     * FIXME: mmyth_ui->video_alignment == NULL when mmyth_player_init
  65.127 -     * fails 
  65.128 -     */
  65.129 -    if (ui_common->main_widget != NULL)
  65.130 -        g_object_ref(ui_common->main_widget);
  65.131 -
  65.132 -    g_object_ref(ui_common->vbox);
  65.133 -    g_object_ref(ui_common->button_vbox);
  65.134 -    g_object_ref(ui_common->label);
  65.135 -    g_object_ref(ui_common->button1);
  65.136 -    g_object_ref(ui_common->button2);
  65.137 -    g_object_ref(ui_common->button3);
  65.138 -    g_object_ref(ui_common->event_box);
  65.139 -    return ui_common;
  65.140 -}
  65.141 -
  65.142 -void
  65.143 -mmyth_uicommon_free(MMythUiCommon * ui_common)
  65.144 -{
  65.145 -    g_debug("[%s] Clean uicommon used memory", __FUNCTION__);
  65.146 -
  65.147 -    g_source_remove(ui_common->source_id);
  65.148 -
  65.149 -    g_object_unref(ui_common->main_widget);
  65.150 -    g_object_unref(ui_common->vbox);
  65.151 -    g_object_unref(ui_common->button_vbox);
  65.152 -    g_object_unref(ui_common->label);
  65.153 -    g_object_unref(ui_common->button1);
  65.154 -    g_object_unref(ui_common->button2);
  65.155 -    g_object_unref(ui_common->button3);
  65.156 -    g_object_unref(ui_common->event_box);
  65.157 -
  65.158 -    g_free(ui_common);
  65.159 -}
    66.1 --- a/maemo-ui/src/mmyth_uicommon.h	Wed Aug 01 14:22:14 2007 +0100
    66.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.3 @@ -1,53 +0,0 @@
    66.4 -#ifndef MMYTH_UICOMMON_H_
    66.5 -#define MMYTH_UICOMMON_H_
    66.6 -
    66.7 -#include "config.h"
    66.8 -
    66.9 -#include <gtk/gtk.h>
   66.10 -#include <glib.h>
   66.11 -
   66.12 -#ifndef MAEMO_PLATFORM
   66.13 -#define BUTTON_HEIGHT        50
   66.14 -#define BUTTON_WIDTH        100
   66.15 -#else
   66.16 -#define BUTTON_HEIGHT       80
   66.17 -#define BUTTON_WIDTH        150
   66.18 -#endif
   66.19 -
   66.20 -#define MAIN_WINDOW_WIDTH	550
   66.21 -#define MAIN_WINDOW_HEIGHT	250
   66.22 -
   66.23 -#define CHANNELS_DIALOG_WIDTH	300
   66.24 -#define CHANNELS_DIALOG_HEIGHT	200
   66.25 -
   66.26 -#define SETTINGS_DIALOG_WIDTH	300
   66.27 -#define SETTINGS_DIALOG_HEIGHT	120
   66.28 -
   66.29 -extern GdkColor main_bg_color;
   66.30 -
   66.31 -typedef struct _MMythUiCommon {
   66.32 -    GtkWidget      *main_widget;
   66.33 -
   66.34 -    /*
   66.35 -     * event box to set the background color
   66.36 -     */
   66.37 -    GtkWidget      *event_box;
   66.38 -
   66.39 -    GtkWidget      *vbox;
   66.40 -    GtkWidget      *button_vbox;
   66.41 -    GtkWidget      *label;
   66.42 -
   66.43 -    GtkWidget      *button1;
   66.44 -    GtkWidget      *button2;
   66.45 -    GtkWidget      *button3;
   66.46 -
   66.47 -    gint            source_id;
   66.48 -} MMythUiCommon;
   66.49 -
   66.50 -MMythUiCommon  *mmyth_uicommon_new(GtkWidget * main_widget,
   66.51 -                                   const gchar * label1,
   66.52 -                                   const gchar * label2,
   66.53 -                                   const gchar * label3);
   66.54 -void            mmyth_uicommon_free(MMythUiCommon * ui_common);
   66.55 -
   66.56 -#endif                          /* MMYTH_UICOMMON_H_ */
    67.1 --- a/maemo-ui/src/mmyth_uisettings.c	Wed Aug 01 14:22:14 2007 +0100
    67.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.3 @@ -1,196 +0,0 @@
    67.4 -#include<gtk/gtk.h>
    67.5 -#include<glib.h>
    67.6 -#include <sys/types.h>
    67.7 -#include <sys/stat.h>
    67.8 -#include <unistd.h>
    67.9 -#include <string.h>
   67.10 -#include <stdio.h>
   67.11 -#include <stdlib.h>
   67.12 -
   67.13 -#include "mmyth_uisettings.h"
   67.14 -
   67.15 -#include <gmyth/gmyth_backendinfo.h>
   67.16 -
   67.17 -static GtkWidget *settings_dialog;
   67.18 -static GtkWidget *entry_hostname;
   67.19 -static GtkWidget *entry_dbname;
   67.20 -static GtkWidget *entry_username;
   67.21 -static GtkWidget *entry_passwd;
   67.22 -static GtkWidget *entry_port;
   67.23 -
   67.24 -static void     settings_dialog_update_data(void);
   67.25 -static GtkWidget *add_entry_to_table(GtkWidget * table,
   67.26 -                                     const gchar * init_str,
   67.27 -                                     guint pos_left, guint pos_right,
   67.28 -                                     guint pos_top, guint pos_bottom);
   67.29 -static GtkWidget *add_label_to_table(GtkWidget * table, const gchar * str,
   67.30 -                                     guint pos_left, guint pos_right,
   67.31 -                                     guint pos_top, guint pos_bottom);
   67.32 -
   67.33 -static GMythBackendInfo *backend_info = NULL;
   67.34 -
   67.35 -gboolean
   67.36 -mmyth_uisettings_run(GtkWindow * main_window)
   67.37 -{
   67.38 -
   67.39 -    GtkWidget      *settings_table;
   67.40 -    GtkWidget      *label_hostname,
   67.41 -                   *label_dbname;
   67.42 -    GtkWidget      *label_username,
   67.43 -                   *label_passwd,
   67.44 -                   *label_port;
   67.45 -
   67.46 -    backend_info = gmyth_backend_info_new_full("localhost", "mythtv",
   67.47 -                                               "mythtv", "mythconverg",
   67.48 -                                               6543);
   67.49 -
   67.50 -    settings_dialog = gtk_dialog_new_with_buttons("Settings",
   67.51 -                                                  main_window,
   67.52 -                                                  GTK_DIALOG_DESTROY_WITH_PARENT,
   67.53 -                                                  GTK_STOCK_OK,
   67.54 -                                                  GTK_RESPONSE_ACCEPT,
   67.55 -                                                  GTK_STOCK_CANCEL,
   67.56 -                                                  GTK_RESPONSE_REJECT,
   67.57 -                                                  NULL);
   67.58 -
   67.59 -    gtk_widget_set_size_request(settings_dialog, 400, 244);
   67.60 -
   67.61 -    /*
   67.62 -     * scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
   67.63 -     * gtk_widget_show (scrolledwindow1); gtk_container_add (GTK_CONTAINER 
   67.64 -     * (window1), scrolledwindow1); gtk_scrolled_window_set_policy
   67.65 -     * (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC,
   67.66 -     * GTK_POLICY_NEVER);
   67.67 -     * 
   67.68 -     * viewport1 = gtk_viewport_new (NULL, NULL); gtk_widget_show
   67.69 -     * (viewport1); gtk_container_add (GTK_CONTAINER (scrolledwindow1),
   67.70 -     * viewport1); gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport1), 
   67.71 -     * GTK_SHADOW_NONE); 
   67.72 -     */
   67.73 -
   67.74 -    // Creates the table and attach it to the settings dialog
   67.75 -    settings_table = gtk_table_new(5, 2, FALSE);
   67.76 -    gtk_widget_show(settings_table);
   67.77 -    gtk_box_pack_start(GTK_BOX(GTK_DIALOG(settings_dialog)->vbox),
   67.78 -                       settings_table, FALSE, TRUE, 0);
   67.79 -    gtk_container_set_border_width(GTK_CONTAINER(settings_table), 3);
   67.80 -    gtk_table_set_row_spacings(GTK_TABLE(settings_table), 5);
   67.81 -    gtk_table_set_col_spacings(GTK_TABLE(settings_table), 10);
   67.82 -
   67.83 -    label_hostname =
   67.84 -        add_label_to_table(settings_table, "Host Name:", 0, 1, 0, 1);
   67.85 -    label_dbname =
   67.86 -        add_label_to_table(settings_table, "Database Name:", 0, 1, 1, 2);
   67.87 -    label_username =
   67.88 -        add_label_to_table(settings_table, "Username:", 0, 1, 2, 3);
   67.89 -    label_passwd =
   67.90 -        add_label_to_table(settings_table, "Password:", 0, 1, 3, 4);
   67.91 -    label_port =
   67.92 -        add_label_to_table(settings_table, "Server port:", 0, 1, 4, 5);
   67.93 -
   67.94 -    entry_hostname = add_entry_to_table(settings_table,
   67.95 -                                        gmyth_backend_info_get_hostname
   67.96 -                                        (backend_info), 1, 2, 0, 1);
   67.97 -    entry_dbname =
   67.98 -        add_entry_to_table(settings_table,
   67.99 -                           gmyth_backend_info_get_db_name(backend_info), 1,
  67.100 -                           2, 1, 2);
  67.101 -    entry_username =
  67.102 -        add_entry_to_table(settings_table,
  67.103 -                           gmyth_backend_info_get_username(backend_info),
  67.104 -                           1, 2, 2, 3);
  67.105 -    entry_passwd =
  67.106 -        add_entry_to_table(settings_table,
  67.107 -                           gmyth_backend_info_get_password(backend_info),
  67.108 -                           1, 2, 3, 4);
  67.109 -
  67.110 -    entry_port =
  67.111 -        add_entry_to_table(settings_table,
  67.112 -                           g_strdup_printf("%d",
  67.113 -                                           gmyth_backend_info_get_port
  67.114 -                                           (backend_info)), 1, 2, 4, 5);
  67.115 -
  67.116 -    if (gtk_dialog_run(GTK_DIALOG(settings_dialog)) == GTK_RESPONSE_ACCEPT) {
  67.117 -        settings_dialog_update_data();
  67.118 -        gtk_widget_destroy(settings_dialog);
  67.119 -        return TRUE;
  67.120 -    }
  67.121 -
  67.122 -    gtk_widget_destroy(settings_dialog);
  67.123 -
  67.124 -    return FALSE;
  67.125 -
  67.126 -}
  67.127 -
  67.128 -static GtkWidget *
  67.129 -add_label_to_table(GtkWidget * table, const gchar * str, guint pos_left,
  67.130 -                   guint pos_right, guint pos_top, guint pos_bottom)
  67.131 -{
  67.132 -    GtkWidget      *tmp_label = gtk_label_new(str);
  67.133 -
  67.134 -    gtk_widget_show(tmp_label);
  67.135 -    gtk_table_attach(GTK_TABLE(table), tmp_label,
  67.136 -                     pos_left, pos_right, pos_top, pos_bottom,
  67.137 -                     (GtkAttachOptions) (GTK_FILL),
  67.138 -                     (GtkAttachOptions) (0), 0, 0);
  67.139 -    gtk_misc_set_alignment(GTK_MISC(tmp_label), 0, 0.5);
  67.140 -
  67.141 -    return tmp_label;
  67.142 -}
  67.143 -
  67.144 -static GtkWidget *
  67.145 -add_entry_to_table(GtkWidget * table, const gchar * init_str,
  67.146 -                   guint pos_left, guint pos_right, guint pos_top,
  67.147 -                   guint pos_bottom)
  67.148 -{
  67.149 -    GtkWidget      *tmp_entry = gtk_entry_new();
  67.150 -    gtk_widget_show(tmp_entry);
  67.151 -    gtk_table_attach(GTK_TABLE(table), tmp_entry,
  67.152 -                     pos_left, pos_right, pos_top, pos_bottom,
  67.153 -                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
  67.154 -                     (GtkAttachOptions) (0), 0, 0);
  67.155 -    if (init_str)
  67.156 -        gtk_entry_set_text(GTK_ENTRY(tmp_entry), init_str);
  67.157 -
  67.158 -    // gtk_entry_set_invisible_char (GTK_ENTRY (entry_port), 9679);
  67.159 -
  67.160 -    return tmp_entry;
  67.161 -}
  67.162 -
  67.163 -static void
  67.164 -settings_dialog_update_data(void)
  67.165 -{
  67.166 -    // GMythSettings *backend_info = gmyth_context_get_settings();
  67.167 -
  67.168 -    if (!backend_info) {
  67.169 -        g_warning
  67.170 -            ("[%s] Could not get GMythSettings instance from context\n",
  67.171 -             __FUNCTION__);
  67.172 -        return;
  67.173 -    }
  67.174 -
  67.175 -    gmyth_backend_info_set_hostname(backend_info,
  67.176 -                                    gtk_entry_get_text(GTK_ENTRY
  67.177 -                                                       (entry_hostname)));
  67.178 -
  67.179 -    gmyth_backend_info_set_db_name(backend_info,
  67.180 -                                   gtk_entry_get_text(GTK_ENTRY
  67.181 -                                                      (entry_dbname)));
  67.182 -
  67.183 -    gmyth_backend_info_set_username(backend_info,
  67.184 -                                    gtk_entry_get_text(GTK_ENTRY
  67.185 -                                                       (entry_username)));
  67.186 -
  67.187 -    gmyth_backend_info_set_password(backend_info,
  67.188 -                                    gtk_entry_get_text(GTK_ENTRY
  67.189 -                                                       (entry_passwd)));
  67.190 -
  67.191 -    gmyth_backend_info_set_port(backend_info,
  67.192 -                                (gint)
  67.193 -                                g_ascii_strtoull(gtk_entry_get_text
  67.194 -                                                 (GTK_ENTRY(entry_port)),
  67.195 -                                                 NULL, 10));
  67.196 -
  67.197 -    // gmyth_backend_info_save (backend_info);
  67.198 -
  67.199 -}
    68.1 --- a/maemo-ui/src/mmyth_uisettings.h	Wed Aug 01 14:22:14 2007 +0100
    68.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.3 @@ -1,6 +0,0 @@
    68.4 -#ifndef MMYTH_SETTINGS_H_
    68.5 -#define MMYTH_SETTINGS_H_
    68.6 -
    68.7 -gboolean        mmyth_uisettings_run(GtkWindow * main_window);
    68.8 -
    68.9 -#endif                          /* MMYTH_SETTINGS_H_ */