diff options
author | Timothy Pearson <[email protected]> | 2011-12-15 15:30:48 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2011-12-15 15:30:48 -0600 |
commit | f97c8a56e217f04e08776ccf8021721b7d919b7d (patch) | |
tree | 436c68db12057f4d08acfbf37bec9cd8dfafcec8 /src/kmplayer_smil.cpp | |
parent | d211eb866a067b537fb32cab5f10f8dd24a73ad7 (diff) | |
download | kmplayer-f97c8a56e217f04e08776ccf8021721b7d919b7d.tar.gz kmplayer-f97c8a56e217f04e08776ccf8021721b7d919b7d.zip |
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'src/kmplayer_smil.cpp')
-rw-r--r-- | src/kmplayer_smil.cpp | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/src/kmplayer_smil.cpp b/src/kmplayer_smil.cpp index a48640b..c3dd483 100644 --- a/src/kmplayer_smil.cpp +++ b/src/kmplayer_smil.cpp @@ -20,12 +20,12 @@ #include <stdlib.h> -#include <tqtextstream.h> +#include <textstream.h> #include <tqcolor.h> #include <tqpixmap.h> #include <tqmovie.h> #include <tqimage.h> -#include <tqtextcodec.h> +#include <textcodec.h> #include <tqfont.h> #include <tqapplication.h> #include <tqregexp.h> @@ -635,7 +635,7 @@ KDE_NO_EXPORT void CalculatedSizer::resetSizes () { right.reset (); bottom.reset (); reg_point.truncate (0); - reg_align = TQString::tqfromLatin1 ("topLeft"); + reg_align = TQString::fromLatin1 ("topLeft"); } static bool regPoints (const TQString & str, Single & x, Single & y) { @@ -939,11 +939,11 @@ bool AnimateData::parseParam (const TrieString & name, const TQString & val) { } else if (name == "values") { change_values = TQStringList::split (TQString (";"), val); } else if (name == "calcMode") { - if (val == TQString::tqfromLatin1 ("discrete")) + if (val == TQString::fromLatin1 ("discrete")) calcMode = calc_discrete; - else if (val == TQString::tqfromLatin1 ("linear")) + else if (val == TQString::fromLatin1 ("linear")) calcMode = calc_linear; - else if (val == TQString::tqfromLatin1 ("paced")) + else if (val == TQString::fromLatin1 ("paced")) calcMode = calc_paced; } else return AnimateGroupData::parseParam (name, val); @@ -1052,8 +1052,8 @@ KDE_NO_EXPORT void AnimateData::stopped () { KDE_NO_EXPORT void AnimateData::applyStep () { Element * target = convertNode <Element> (target_element); if (target && calcMode == calc_linear) - target->setParam (changed_attribute, TQString ("%1%2").tqarg ( - change_from_val).tqarg(change_from_unit), + target->setParam (changed_attribute, TQString ("%1%2").arg ( + change_from_val).arg(change_from_unit), &modification_id); else if (target && calcMode == calc_discrete) target->setParam (changed_attribute, @@ -1156,13 +1156,13 @@ bool AnimateMotionData::parseParam (const TrieString & name, const TQString & va } else if (name == "keySplines") { splines = TQStringList::split (TQString (";"), val); } else if (name == "calcMode") { - if (val == TQString::tqfromLatin1 ("discrete")) + if (val == TQString::fromLatin1 ("discrete")) calcMode = calc_discrete; - else if (val == TQString::tqfromLatin1 ("linear")) + else if (val == TQString::fromLatin1 ("linear")) calcMode = calc_linear; - else if (val == TQString::tqfromLatin1 ("paced")) + else if (val == TQString::fromLatin1 ("paced")) calcMode = calc_paced; - else if (val == TQString::tqfromLatin1 ("spline")) + else if (val == TQString::fromLatin1 ("spline")) calcMode = calc_spline; } else return AnimateGroupData::parseParam (name, val); @@ -1403,7 +1403,7 @@ KDE_NO_EXPORT void KMPlayer::MediaTypeRuntime::reset () { } /** - * will request a tqrepaint of attached region + * will request a repaint of attached region */ KDE_NO_EXPORT void MediaTypeRuntime::stopped () { clipStop (); @@ -1611,11 +1611,11 @@ KDE_NO_EXPORT void SMIL::Smil::activate () { //kdDebug () << "Smil::activate" << endl; current_av_media_type = NodePtr (); resolved = true; - SMIL::Layout * tqlayout = convertNode <SMIL::Layout> (layout_node); - if (tqlayout && tqlayout->region_surface) { + SMIL::Layout * layout = convertNode <SMIL::Layout> (layout_node); + if (layout && layout->region_surface) { kdError() << "Layout already has a surface" << endl; } - if (tqlayout) + if (layout) Element::activate (); else Element::deactivate(); // some unfortunate reset in parent doc @@ -1623,7 +1623,7 @@ KDE_NO_EXPORT void SMIL::Smil::activate () { KDE_NO_EXPORT void SMIL::Smil::deactivate () { if (layout_node) - convertNode <SMIL::Layout> (layout_node)->tqrepaint (); + convertNode <SMIL::Layout> (layout_node)->repaint (); if (layout_node) convertNode <SMIL::Layout> (layout_node)->region_surface = NULL; Mrl::getSurface(0L); @@ -1657,14 +1657,14 @@ KDE_NO_EXPORT void SMIL::Smil::closed () { } else if (e->id == id_node_meta) { Element * elm = convertNode <Element> (e); const TQString name = elm->getAttribute (StringPool::attr_name); - if (name == TQString::tqfromLatin1 ("title")) + if (name == TQString::fromLatin1 ("title")) pretty_name = elm->getAttribute ("content"); - else if (name == TQString::tqfromLatin1 ("base")) + else if (name == TQString::fromLatin1 ("base")) src = elm->getAttribute ("content"); } } if (!layout_node) { - kdError () << "no <root-tqlayout>" << endl; + kdError () << "no <root-layout>" << endl; return; } } @@ -1738,7 +1738,7 @@ static void headChildDone (NodePtr node, NodePtr child) { KDE_NO_EXPORT NodePtr SMIL::Head::childFromTag (const TQString & tag) { const char * ctag = tag.ascii (); - if (!strcmp (ctag, "tqlayout")) + if (!strcmp (ctag, "layout")) return new SMIL::Layout (m_doc); else if (!strcmp (ctag, "title")) return new DarkNode (m_doc, tag, id_node_title); @@ -1757,10 +1757,10 @@ KDE_NO_EXPORT void SMIL::Head::closed () { for (NodePtr e = firstChild (); e; e = e->nextSibling ()) if (e->id == id_node_layout) return; - SMIL::Layout * tqlayout = new SMIL::Layout (m_doc); - appendChild (tqlayout); - tqlayout->setAuxiliaryNode (true); - tqlayout->closed (); // add root-tqlayout and a region + SMIL::Layout * layout = new SMIL::Layout (m_doc); + appendChild (layout); + layout->setAuxiliaryNode (true); + layout->closed (); // add root-layout and a region } KDE_NO_EXPORT void SMIL::Head::childDone (NodePtr child) { @@ -1774,7 +1774,7 @@ KDE_NO_CDTOR_EXPORT SMIL::Layout::Layout (NodePtr & d) KDE_NO_EXPORT NodePtr SMIL::Layout::childFromTag (const TQString & tag) { const char * ctag = tag.ascii (); - if (!strcmp (ctag, "root-tqlayout")) { + if (!strcmp (ctag, "root-layout")) { NodePtr e = new SMIL::RootLayout (m_doc); rootLayout = e; return e; @@ -1816,7 +1816,7 @@ KDE_NO_EXPORT void SMIL::Layout::closed () { rl->setAttribute(StringPool::attr_height,TQString::number(h_root)); insertBefore (sr, firstChild ()); } else { - if (childNodes ()->length () < 2) { // only a root-tqlayout + if (childNodes ()->length () < 2) { // only a root-layout SMIL::Region * r = new SMIL::Region (m_doc); appendChild (r); r->setAuxiliaryNode (true); @@ -1834,7 +1834,7 @@ KDE_NO_EXPORT void SMIL::Layout::activate () { RegionBase::activate (); if (surface ()) { updateDimensions (); - tqrepaint (); + repaint (); } finish (); // proceed and allow 'head' to finish } @@ -1928,14 +1928,14 @@ KDE_NO_EXPORT void SMIL::RegionBase::remoteReady (TQByteArray & data) { postpone_lock = 0L; } -KDE_NO_EXPORT void SMIL::RegionBase::tqrepaint () { +KDE_NO_EXPORT void SMIL::RegionBase::repaint () { if (surface ()) - region_surface->tqrepaint (SRect (0, 0, w, h)); + region_surface->repaint (SRect (0, 0, w, h)); } -KDE_NO_EXPORT void SMIL::RegionBase::tqrepaint (const SRect & rect) { +KDE_NO_EXPORT void SMIL::RegionBase::repaint (const SRect & rect) { if (surface ()) - region_surface->tqrepaint (SRect (0, 0, w, h).intersect (rect)); + region_surface->repaint (SRect (0, 0, w, h).intersect (rect)); } KDE_NO_EXPORT void SMIL::RegionBase::updateDimensions () { @@ -1949,7 +1949,7 @@ KDE_NO_EXPORT void SMIL::RegionBase::updateDimensions () { } KDE_NO_EXPORT void SMIL::RegionBase::boundsUpdate () { - // if there is a region_surface and it's moved, do a limit tqrepaint + // if there is a region_surface and it's moved, do a limit repaint NodePtr p = parentNode (); if (p && (p->id==SMIL::id_node_region || p->id==SMIL::id_node_layout) && region_surface) { @@ -1958,7 +1958,7 @@ KDE_NO_EXPORT void SMIL::RegionBase::boundsUpdate () { w = 0; h = 0; sizes.calcSizes (this, pr->w, pr->h, x, y, w, h); region_surface->bounds = SRect (x, y, w, h); - pr->tqrepaint (region_surface->bounds.unite (old_bounds)); + pr->repaint (region_surface->bounds.unite (old_bounds)); } } @@ -1981,7 +1981,7 @@ KDE_NO_EXPORT Surface *SMIL::RegionBase::surface () { KDE_NO_EXPORT void SMIL::RegionBase::parseParam (const TrieString & name, const TQString & val) { //kdDebug () << "RegionBase::parseParam " << getAttribute ("id") << " " << name << "=" << val << " active:" << active() << endl; - bool need_tqrepaint = false; + bool need_repaint = false; SRect rect = SRect (x, y, w, h); bool dim_changed; if (name == "background-color" || name == "backgroundColor") { @@ -1991,10 +1991,10 @@ void SMIL::RegionBase::parseParam (const TrieString & name, const TQString & val background_color = 0xff000000 | TQColor (val).rgb (); if (region_surface || (active () && surface ())) region_surface->background_color = background_color; - need_tqrepaint = true; + need_repaint = true; } else if (name == "z-index") { z_order = val.toInt (); - need_tqrepaint = true; + need_repaint = true; } else if (sizes.setSizeParam (name, val, dim_changed)) { if (active ()) { if (region_surface) { @@ -2009,20 +2009,20 @@ void SMIL::RegionBase::parseParam (const TrieString & name, const TQString & val if (p &&(p->id==SMIL::id_node_region ||p->id==SMIL::id_node_layout)) convertNode <SMIL::RegionBase> (p)->updateDimensions (); rect = rect.unite (SRect (x, y, w, h)); - need_tqrepaint = true; + need_repaint = true; } } else if (name == "showBackground") { if (val == "whenActive") show_background = ShowWhenActive; else show_background = ShowAlways; - need_tqrepaint = true; + need_repaint = true; } else if (name == "backgroundImage") { background_image = val; Smil * s = SMIL::Smil::findSmilNode (this); if (s) { killWGet (); - need_tqrepaint = !cached_img.isEmpty (); + need_repaint = !cached_img.isEmpty (); Mrl *mrl = s->parentNode () ? s->parentNode ()->mrl () : NULL; TQString url = mrl ? KURL (mrl->absolutePath (), val).url () : val; cached_img.setUrl (url); @@ -2030,12 +2030,12 @@ void SMIL::RegionBase::parseParam (const TrieString & name, const TQString & val postpone_lock = document ()->postpone (); wget (url); } else { - need_tqrepaint = true; + need_repaint = true; } } } - if (need_tqrepaint && active () && surface() && region_surface->parentNode ()) - region_surface->parentNode ()->tqrepaint (rect); + if (need_repaint && active () && surface() && region_surface->parentNode ()) + region_surface->parentNode ()->repaint (rect); Element::parseParam (name, val); } @@ -2083,7 +2083,7 @@ KDE_NO_EXPORT void SMIL::Region::accept (Visitor * v) { KDE_NO_EXPORT void SMIL::RegPoint::parseParam (const TrieString & p, const TQString & v) { bool b; - sizes.setSizeParam (p, v, b); // TODO: if dynamic, make sure to tqrepaint + sizes.setSizeParam (p, v, b); // TODO: if dynamic, make sure to repaint Element::parseParam (p, v); } @@ -2570,7 +2570,7 @@ KDE_NO_EXPORT void SMIL::Excl::begin () { for (NodePtr e = firstChild (); e; e = e->nextSibling ()) if (isTimedMrl (e)) { SMIL::TimedMrl * tm = static_cast <SMIL::TimedMrl *> (e.ptr ()); - if (tm) { // make aboutToStart connection with TimedMrl tqchildren + if (tm) { // make aboutToStart connection with TimedMrl children ConnectionPtr c = tm->connectTo (this, event_to_be_started); started_event_list.append (new ConnectionStoreItem (c)); } @@ -2857,10 +2857,10 @@ void SMIL::MediaType::parseParam (const TrieString ¶, const TQString & val) TimedMrl::parseParam (para, val); } if (sub_surface) - sub_surface->tqrepaint (); + sub_surface->repaint (); resetSurface (); if (surface ()) - sub_surface->tqrepaint (); + sub_surface->repaint (); } KDE_NO_EXPORT void SMIL::MediaType::boundsUpdate () { @@ -2869,7 +2869,7 @@ KDE_NO_EXPORT void SMIL::MediaType::boundsUpdate () { SRect new_bounds = calculateBounds (); SRect repaint_rect = sub_surface->bounds.unite (new_bounds); sub_surface->bounds = new_bounds; - rb->tqrepaint (repaint_rect); + rb->repaint (repaint_rect); } } @@ -2881,7 +2881,7 @@ KDE_NO_EXPORT void SMIL::MediaType::activate () { setState (state_activated); for (NodePtr c = firstChild (); c; c = c->nextSibling ()) if (c != external_tree) { - // activate param/set/animate.. tqchildren + // activate param/set/animate.. children c->activate (); break; // childDone will handle next siblings } @@ -2896,7 +2896,7 @@ KDE_NO_EXPORT void SMIL::MediaType::deactivate () { region_attach = 0L; trans_step = trans_steps = 0; if (region_node) - convertNode <SMIL::RegionBase> (region_node)->tqrepaint (); + convertNode <SMIL::RegionBase> (region_node)->repaint (); if (trans_timer) document ()->cancelTimer (trans_timer); if (trans_out_timer) @@ -2918,7 +2918,7 @@ KDE_NO_EXPORT void SMIL::MediaType::begin () { region_mouse_leave = r->connectTo (this, event_outbounds); region_mouse_click = r->connectTo (this, event_activated); region_attach = r->connectTo (this, mediatype_attached); - r->tqrepaint (); + r->repaint (); tr->clipStart (); Transition * trans = convertNode <Transition> (trans_in); if (trans && trans->supported ()) { @@ -2955,13 +2955,13 @@ KDE_NO_EXPORT void SMIL::MediaType::finish () { ASSERT(!trans_timer); } if (region_node) - convertNode <SMIL::RegionBase> (region_node)->tqrepaint (); + convertNode <SMIL::RegionBase> (region_node)->repaint (); TimedMrl::finish (); static_cast <MediaTypeRuntime *> (runtime ())->clipStop (); } /** - * Re-implement from TimedMrl, because we may have tqchildren like + * Re-implement from TimedMrl, because we may have children like * param/set/animatie that should all be activate, but also other smil or imfl * documents, that should only be activated if the runtime has started */ @@ -2969,7 +2969,7 @@ KDE_NO_EXPORT void SMIL::MediaType::childDone (NodePtr child) { bool child_doc = child->mrl () && child->mrl ()->opener.ptr () == this; if (child_doc) { child->deactivate (); // should only if fill not is freeze or hold - } else if (active ()) { // traverse param or area tqchildren + } else if (active ()) { // traverse param or area children for (NodePtr c = child->nextSibling(); c; c = c->nextSibling ()) if (!c->mrl () || c->mrl ()->opener.ptr () != this ) { c->activate (); @@ -3086,7 +3086,7 @@ bool SMIL::MediaType::handleEvent (EventPtr event) { else te->interval = trans_step++ < trans_steps; if (s && s->parentNode()) - s->parentNode()->tqrepaint (s->bounds); + s->parentNode()->repaint (s->bounds); return true; } else if (te->timer_info->event_id == trans_out_timer_id) { active_trans = trans_out; @@ -3104,7 +3104,7 @@ bool SMIL::MediaType::handleEvent (EventPtr event) { } trans_out_active = true; if (s) - s->tqrepaint (); + s->repaint (); } return true; } @@ -3377,7 +3377,7 @@ bool ImageRuntime::parseParam (const TrieString & name, const TQString & val) { } /** - * start_timer timer expired, tqrepaint if we have an image + * start_timer timer expired, repaint if we have an image */ KDE_NO_EXPORT void ImageRuntime::started () { if (element && downloading ()) { @@ -3409,7 +3409,7 @@ KDE_NO_EXPORT void ImageRuntime::remoteReady (TQByteArray & data) { mt->resetSurface (); TQString mime = mimetype (); kdDebug () << "ImageRuntime::remoteReady " << mime << " empty:" << cached_img.isEmpty () << " " << mt->src << endl; - if (mime.startsWith (TQString::tqfromLatin1 ("text/"))) { + if (mime.startsWith (TQString::fromLatin1 ("text/"))) { TQTextStream ts (data, IO_ReadOnly); readXML (element, ts, TQString ()); Mrl *mrl = mt->external_tree ? mt->external_tree->mrl () : NULL; @@ -3426,13 +3426,13 @@ KDE_NO_EXPORT void ImageRuntime::remoteReady (TQByteArray & data) { cached_img.data->image = pix; img_movie = new TQMovie (data, data.size ()); img_movie->connectUpdate(this,TQT_SLOT(movieUpdated(const TQRect&))); - img_movie->connectStatus (this, TQT_SLOT (movietqStatus (int))); + img_movie->connectStatus (this, TQT_SLOT (movieStatus (int))); img_movie->connectResize(this,TQT_SLOT (movieResize(const TQSize&))); frame_nr = 0; mt->width = pix->width (); mt->height = pix->height (); if (mt->surface ()) - mt->sub_surface->tqrepaint (); + mt->sub_surface->repaint (); } else delete pix; } @@ -3451,13 +3451,13 @@ KDE_NO_EXPORT void ImageRuntime::movieUpdated (const TQRect &) { cached_img.data->image = new TQImage; *cached_img.data->image = (img_movie->framePixmap ()); if (mt->surface()) - mt->sub_surface->tqrepaint (); + mt->sub_surface->repaint (); } if (timingstate != timings_started && img_movie) img_movie->pause (); } -KDE_NO_EXPORT void ImageRuntime::movietqStatus (int s) { +KDE_NO_EXPORT void ImageRuntime::movieStatus (int s) { if (element && element->state >= Node::state_began && SMIL::TimedMrl::keepContent (element)) { if (s == TQMovie::EndOfMovie) { @@ -3469,7 +3469,7 @@ KDE_NO_EXPORT void ImageRuntime::movietqStatus (int s) { KDE_NO_EXPORT void ImageRuntime::movieResize (const TQSize &) { SMIL::MediaType * mt = convertNode <SMIL::MediaType> (element); if (mt->surface ()) - mt->sub_surface->tqrepaint (); + mt->sub_surface->repaint (); //kdDebug () << "movieResize" << endl; } @@ -3564,12 +3564,12 @@ bool TextRuntime::parseParam (const TrieString & name, const TQString & val) { return MediaTypeRuntime::parseParam (name, val); mt->resetSurface (); if (mt->surface ()) - mt->sub_surface->tqrepaint (); + mt->sub_surface->repaint (); return true; } /** - * start_timer timer expired, tqrepaint if we have text + * start_timer timer expired, repaint if we have text */ KDE_NO_EXPORT void TextRuntime::started () { if (element && downloading ()) { @@ -3592,7 +3592,7 @@ KDE_NO_EXPORT void TextRuntime::remoteReady (TQByteArray & data) { ts.setCodec (d->codec); text = ts.read (); if (mt->surface ()) - mt->sub_surface->tqrepaint (); + mt->sub_surface->repaint (); } postpone_lock = 0L; if (timingstate == timings_started) |