Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: [ANNOUNCE] calendar-0.1.0



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jan Rieger wrote:
>>>
>>>>On Thursday 11 September 2003 09:35, you wrote:
>>>>
>>>>#include "vdr/../../menu.c"
>>>
>>>@Jan Ekholm
>>>If it also works for you then i'll change it.
>>
>>Which include file do you try to find? menu.c from VDR's own sources? May
>>I ask why you'd want to include a .c file in the first place? If there are
>>some definitions in that file that you do need, maybe they really should
>>be moved into menu.h (or some other headerfile).
>
>
> In princliple you are right. But I'm sure that Klaus didn't want to make
> such a
> big change to the current vdr 1.2.x line.
> So I choosed the way to include the hole menu.c into the plugin :-(
>

Wow, this seems pretty dangerous as all implementation in menu.c appears
twice (in vdr itself and in your plugin). This can lead to _very_
strange phenomenons. I agree with you, not to ask Klaus for the required
changes for the current 1.2-branch. Here is a sugestion from me, how to
solve se problem:

Copy the declaration from vdr's menu.c to your own header file and do
NOT include vdr's menu.c.

I attach a patch, which does this exactly. BTW: I also added apropriate
ifndef's for the _GNU_SOURCE define, to avoid the warnings, decribed in
this thread, as I had them too.

CU/all
- --
Patrick Cernko | mailto:errror@errror.de | http://www.errror.de
Quote of the Week: "Is net scheen, das Bild, awwer einmalisch!"
                   (Markus Sand)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/YF/AB6g1EUxThvcRAlaeAJ9J1TB0OQvFq1cj5zBFzNbaD38NPwCgsg8o
O2Bup2StT9tsC2I4fS+K3Xs=
=v1lr
-----END PGP SIGNATURE-----
Binärdateien calendar-0.1.0.orig/calendar.o and calendar-0.1.0/calendar.o sind verschieden.
Binärdateien calendar-0.1.0.orig/config.o and calendar-0.1.0/config.o sind verschieden.
Binärdateien calendar-0.1.0.orig/i18n.o and calendar-0.1.0/i18n.o sind verschieden.
Binärdateien calendar-0.1.0.orig/libvdr-calendar.so and calendar-0.1.0/libvdr-calendar.so sind verschieden.
diff -Nru calendar-0.1.0.orig/menu.c calendar-0.1.0/menu.c
--- calendar-0.1.0.orig/menu.c	2003-09-10 21:16:01.000000000 +0200
+++ calendar-0.1.0/menu.c	2003-09-11 13:36:52.000000000 +0200
@@ -8,14 +8,52 @@
  */
 
 
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 
 #include <string.h>
 
 #include <vdr/i18n.h>
 #include <vdr/channels.h>
 #include <vdr/eit.h>
-#include <vdr/../../menu.c>
+
+#include <vdr/../../menuitems.h>
+
+/**
+ * we have to declare these two classes here until they are declared
+ * in the above header file too, instead of only in the vdr source
+ * file menu.c.
+ * This is just copy and paste from vdr's menu.c.
+ * @Klaus: FIXME: Please declare the classes below in one of your
+ * header files.
+ */
+class cMenuEditTimeItem : public cMenuEditItem {
+protected:
+  int *value;
+  int hh, mm;
+  int pos;
+  virtual void Set(void);
+public:
+  cMenuEditTimeItem(const char *Name, int *Value);
+  virtual eOSState ProcessKey(eKeys Key);
+  };
+
+class cMenuSchedule : public cOsdMenu {
+private:
+  cMutexLock mutexLock;
+  const cSchedules *schedules;
+  bool now, next;
+  int otherChannel;
+  eOSState Record(void);
+  eOSState Switch(void);
+  void PrepareSchedule(cChannel *Channel);
+public:
+  cMenuSchedule(void);
+  virtual ~cMenuSchedule();
+  virtual eOSState ProcessKey(eKeys Key);
+  };
+
 
 #include "menu.h"
 #include "menuitem.h"
diff -Nru calendar-0.1.0.orig/menuitem.c calendar-0.1.0/menuitem.c
--- calendar-0.1.0.orig/menuitem.c	2003-09-10 21:53:38.000000000 +0200
+++ calendar-0.1.0/menuitem.c	2003-09-11 13:33:20.000000000 +0200
@@ -9,7 +9,9 @@
 
 
 
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 
 #include <string.h>
 
Binärdateien calendar-0.1.0.orig/menuitem.o and calendar-0.1.0/menuitem.o sind verschieden.
Binärdateien calendar-0.1.0.orig/menu.o and calendar-0.1.0/menu.o sind verschieden.
diff -Nru calendar-0.1.0.orig/menusetup.c calendar-0.1.0/menusetup.c
--- calendar-0.1.0.orig/menusetup.c	2003-09-10 21:22:23.000000000 +0200
+++ calendar-0.1.0/menusetup.c	2003-09-11 13:33:36.000000000 +0200
@@ -8,7 +8,9 @@
  */
 
 
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 
 #include <string.h>
 

Home | Main Index | Thread Index