/usr/lib/Wt/examples/widgetgallery/Media.C is in witty-examples 3.3.0-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | /*
* Copyright (C) 2009 Emweb bvba, Kessel-Lo, Belgium.
*
* See the LICENSE file for terms of use.
*/
#include "DeferredWidget.h"
#include "Media.h"
#include "TopicTemplate.h"
Media::Media()
: TopicWidget()
{
addText(tr("specialpurposewidgets-intro"), this);
}
void Media::populateSubMenu(Wt::WMenu *menu)
{
menu->addItem("WMediaPlayer",
deferCreate(boost::bind(&Media::mediaPlayer, this)))
->setPathComponent("");
menu->addItem("WSound",
deferCreate(boost::bind(&Media::sound, this)));
menu->addItem("WAudio",
deferCreate(boost::bind(&Media::audio, this)));
menu->addItem("WVideo",
deferCreate(boost::bind(&Media::video, this)));
menu->addItem("WFlashObject",
deferCreate(boost::bind(&Media::flashObject, this)));
menu->addItem("Resources",
deferCreate(boost::bind(&Media::resources, this)));
menu->addItem("PDF output",
deferCreate(boost::bind(&Media::pdf, this)));
}
#include "examples/MediaPlayerVideo.cpp"
#include "examples/MediaPlayerAudio.cpp"
Wt::WWidget *Media::mediaPlayer()
{
Wt::WTemplate *result = new TopicTemplate("media-MediaPlayer");
result->bindWidget("MediaPlayerVideo", MediaPlayerVideo());
result->bindWidget("MediaPlayerAudio", MediaPlayerAudio());
return result;
}
#include "examples/Sound.cpp"
Wt::WWidget *Media::sound()
{
Wt::WTemplate *result = new TopicTemplate("media-Sound");
result->bindWidget("Sound", Sound());
return result;
}
#include "examples/Audio.cpp"
Wt::WWidget *Media::audio()
{
Wt::WTemplate *result = new TopicTemplate("media-Audio");
result->bindWidget("Audio", Audio());
return result;
}
#include "examples/Video.cpp"
#include "examples/VideoFallback.cpp"
Wt::WWidget *Media::video()
{
Wt::WTemplate *result = new TopicTemplate("media-Video");
result->bindWidget("Video", Video());
result->bindWidget("VideoFallback", VideoFallback());
return result;
}
#include "examples/Flash.cpp"
Wt::WWidget *Media::flashObject()
{
Wt::WTemplate *result = new TopicTemplate("media-FlashObject");
result->bindWidget("Flash", Flash());
return result;
}
#include "examples/ResourceCustom.cpp"
#include "examples/ResourceStatic.cpp"
Wt::WWidget *Media::resources()
{
Wt::WTemplate *result = new TopicTemplate("media-Resources");
result->bindWidget("ResourceCustom", ResourceCustom());
result->bindWidget("ResourceStatic", ResourceStatic());
return result;
}
#ifdef WT_HAS_WPDFIMAGE
#include "examples/PdfImage.cpp"
#ifdef WT_TARGET_JAVA
#include "examples/JavaPdfRenderer.cpp"
#else
#include "examples/PdfRenderer.cpp"
#endif
#endif
Wt::WWidget *Media::pdf()
{
Wt::WTemplate *result = new TopicTemplate("media-PDF");
#ifdef WT_HAS_WPDFIMAGE
result->bindWidget("PdfImage", PdfImage());
result->bindWidget("PdfRenderer", PdfRenderer());
#else
result->bindString("PdfImage", "This example requires Wt built with PDF"
" support.");
result->bindString("PdfImage", "This example requires Wt built with PDF"
" support.");
#endif
// Show the source code only for write to file example.
result->bindString("PdfImageWrite",
reindent(tr("media-PdfImageWrite")), Wt::PlainText);
return result;
}
|