]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins/controls/text.cpp
* x11/x11_timer.* : classes to implement platform-independant timers
[vlc] / modules / gui / skins / controls / text.cpp
index 581980de2f6c1a055ca63b85e5c2f78dfb548f9c..676975e72c1fc52debaeb4b2d80e4ebb192abc28 100644 (file)
@@ -2,10 +2,11 @@
  * text.cpp: Text control
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: text.cpp,v 1.7 2003/04/21 21:51:16 asmax Exp $
+ * $Id: text.cpp,v 1.10 2003/06/05 22:16:15 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *          Cyril Deguet     <asmax@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #include "../os_window.h"
 #include "../src/skin_common.h"
 
+#ifdef X11_SKINS
+#include "../x11/x11_timer.h"
+extern intf_thread_t *g_pIntf;
+#endif
+
 
 
 //---------------------------------------------------------------------------
@@ -77,7 +83,7 @@
     }
     //-----------------------------------------------------------------------
 
-    #else
+    #elif defined GTK2_SKINS
 
     //-----------------------------------------------------------------------
     // Gtk2 methods
     }
     //-----------------------------------------------------------------------
 
+    #elif defined X11_SKINS
+
+    //-----------------------------------------------------------------------
+    // X11 methods
+    //----------------------------------------------------------------------- 
+    void ScrollingTextTimer( void *data )
+    { 
+        if( (ControlText *)data != NULL
+            && !( (ControlText *)data )->GetSelected() )
+        {
+            ( (ControlText *)data )->DoScroll();
+        }
+    }
+
+    //-----------------------------------------------------------------------
+    void ControlText::StartScrolling()
+    {
+        X11Timer *timer = new X11Timer( g_pIntf, 100000, ScrollingTextTimer, 
+                                        (void*)this );
+        X11TimerManager *timerManager = X11TimerManager::Instance( g_pIntf );
+        timerManager->addTimer( timer );
+    }
+    //-----------------------------------------------------------------------
+    void ControlText::StopScrolling()
+    {
+    }
+    //-----------------------------------------------------------------------
 
     #endif
 //---------------------------------------------------------------------------
@@ -231,7 +264,7 @@ void ControlText::SetSize()
     if( TextClipRgn != NULL )
         delete TextClipRgn;
 
-    TextClipRgn = (Region *)new OSRegion( Left, Top, Width, Height );
+    TextClipRgn = (SkinRegion *)new OSRegion( Left, Top, Width, Height );
 
 }
 //---------------------------------------------------------------------------
@@ -300,7 +333,7 @@ void ControlText::Draw( int x, int y, int w, int h, Graphics *dest )
     }
 
     // Reset clipping region to old region
-    Region *destClipRgn = (Region *)new OSRegion( 0, 0, w, h );
+    SkinRegion *destClipRgn = (SkinRegion *)new OSRegion( 0, 0, w, h );
     dest->SetClipRegion( destClipRgn );
     delete destClipRgn;
     TextClipRgn->Move( x, y );