1.1 --- a/maemo-ui-old/AUTHORS Fri Feb 01 14:30:21 2008 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,4 +0,0 @@
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 --- a/maemo-ui-old/COPYING Fri Feb 01 14:30:21 2008 +0000
2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2.3 @@ -1,504 +0,0 @@
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 --- a/maemo-ui-old/ChangeLog Fri Feb 01 14:30:21 2008 +0000
3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
3.3 @@ -1,24 +0,0 @@
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 --- a/maemo-ui-old/INSTALL Fri Feb 01 14:30:21 2008 +0000
4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
4.3 @@ -1,236 +0,0 @@
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 --- a/maemo-ui-old/Makefile.am Fri Feb 01 14:30:21 2008 +0000
5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
5.3 @@ -1,8 +0,0 @@
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 --- a/maemo-ui-old/autogen.sh Fri Feb 01 14:30:21 2008 +0000
6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
6.3 @@ -1,99 +0,0 @@
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 --- a/maemo-ui-old/common/Makefile.am Fri Feb 01 14:30:21 2008 +0000
7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
7.3 @@ -1,1 +0,0 @@
7.4 -EXTRA_DIST = autogen-helper.sh
8.1 --- a/maemo-ui-old/common/autogen-helper.sh Fri Feb 01 14:30:21 2008 +0000
8.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
8.3 @@ -1,302 +0,0 @@
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 --- a/maemo-ui-old/configure.ac Fri Feb 01 14:30:21 2008 +0000
9.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
9.3 @@ -1,229 +0,0 @@
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 --- a/maemo-ui-old/m4/Makefile.am Fri Feb 01 14:30:21 2008 +0000
10.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
10.3 @@ -1,7 +0,0 @@
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 --- a/maemo-ui-old/m4/ac_doxygen.m4 Fri Feb 01 14:30:21 2008 +0000
11.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
11.3 @@ -1,312 +0,0 @@
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 --- a/maemo-ui-old/m4/as-compiler-flag.m4 Fri Feb 01 14:30:21 2008 +0000
12.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
12.3 @@ -1,33 +0,0 @@
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 --- a/maemo-ui-old/m4/as-expand.m4 Fri Feb 01 14:30:21 2008 +0000
13.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
13.3 @@ -1,40 +0,0 @@
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 --- a/maemo-ui-old/m4/as-version.m4 Fri Feb 01 14:30:21 2008 +0000
14.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
14.3 @@ -1,59 +0,0 @@
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 --- a/maemo-ui-old/pixmaps/Makefile.am Fri Feb 01 14:30:21 2008 +0000
15.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
15.3 @@ -1,11 +0,0 @@
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 --- a/maemo-ui-old/src/Makefile.am Fri Feb 01 14:30:21 2008 +0000
17.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
17.3 @@ -1,46 +0,0 @@
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 --- a/maemo-ui-old/src/mmyth_epg_grid_view.c Fri Feb 01 14:30:21 2008 +0000
18.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
18.3 @@ -1,243 +0,0 @@
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 --- a/maemo-ui-old/src/mmyth_epg_grid_view.h Fri Feb 01 14:30:21 2008 +0000
19.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
19.3 @@ -1,8 +0,0 @@
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 --- a/maemo-ui-old/src/mmyth_epg_grid_widget.c Fri Feb 01 14:30:21 2008 +0000
20.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
20.3 @@ -1,776 +0,0 @@
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 --- a/maemo-ui-old/src/mmyth_epg_grid_widget.h Fri Feb 01 14:30:21 2008 +0000
21.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
21.3 @@ -1,87 +0,0 @@
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 --- a/maemo-ui-old/src/mmyth_main.c Fri Feb 01 14:30:21 2008 +0000
22.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
22.3 @@ -1,122 +0,0 @@
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 --- a/maemo-ui-old/src/mmyth_recordui.c Fri Feb 01 14:30:21 2008 +0000
23.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
23.3 @@ -1,433 +0,0 @@
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 --- a/maemo-ui-old/src/mmyth_recordui.h Fri Feb 01 14:30:21 2008 +0000
24.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
24.3 @@ -1,52 +0,0 @@
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 --- a/maemo-ui-old/src/mmyth_schedulerui.c Fri Feb 01 14:30:21 2008 +0000
25.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
25.3 @@ -1,443 +0,0 @@
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 --- a/maemo-ui-old/src/mmyth_schedulerui.h Fri Feb 01 14:30:21 2008 +0000
26.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
26.3 @@ -1,53 +0,0 @@
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 --- a/maemo-ui-old/src/mmyth_tvplayer.c Fri Feb 01 14:30:21 2008 +0000
27.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
27.3 @@ -1,712 +0,0 @@
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 --- a/maemo-ui-old/src/mmyth_tvplayer.h Fri Feb 01 14:30:21 2008 +0000
28.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
28.3 @@ -1,122 +0,0 @@
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 --- a/maemo-ui-old/src/mmyth_ui.c Fri Feb 01 14:30:21 2008 +0000
29.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
29.3 @@ -1,894 +0,0 @@
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 --- a/maemo-ui-old/src/mmyth_ui.h Fri Feb 01 14:30:21 2008 +0000
30.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
30.3 @@ -1,91 +0,0 @@
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 --- a/maemo-ui-old/src/mmyth_uicommon.c Fri Feb 01 14:30:21 2008 +0000
31.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
31.3 @@ -1,156 +0,0 @@
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 --- a/maemo-ui-old/src/mmyth_uicommon.h Fri Feb 01 14:30:21 2008 +0000
32.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
32.3 @@ -1,53 +0,0 @@
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 --- a/maemo-ui-old/src/mmyth_uisettings.c Fri Feb 01 14:30:21 2008 +0000
33.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
33.3 @@ -1,196 +0,0 @@
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 --- a/maemo-ui-old/src/mmyth_uisettings.h Fri Feb 01 14:30:21 2008 +0000
34.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
34.3 @@ -1,6 +0,0 @@
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_ */