• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegraphics API Reference
  • KDE Home
  • Contact Us
 

okular

  • sources
  • kde-4.12
  • kdegraphics
  • okular
  • core
  • script
kjs_fullscreen.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2008 by Pino Toscano <pino@kde.org> *
3  * Copyright (C) 2008 by Harri Porten <porten@kde.org> *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  ***************************************************************************/
10 
11 #include "kjs_fullscreen_p.h"
12 
13 #include <assert.h>
14 
15 #include <kjs/kjsobject.h>
16 #include <kjs/kjsprototype.h>
17 
18 #include "settings_core.h"
19 
20 using namespace Okular;
21 
22 static KJSPrototype *g_fsProto;
23 
24 static KJSObject fsGetLoop( KJSContext *, void * )
25 {
26  return KJSBoolean( SettingsCore::slidesLoop() );
27 }
28 
29 static void fsSetLoop( KJSContext *ctx, void *, KJSObject value )
30 {
31  bool loop = value.toBoolean( ctx );
32  SettingsCore::setSlidesLoop( loop );
33 }
34 
35 static KJSObject fsGetUseTimer( KJSContext *, void * )
36 {
37  return KJSBoolean( SettingsCore::slidesAdvance() );
38 }
39 
40 static void fsSetUseTimer( KJSContext *ctx, void *, KJSObject value )
41 {
42  bool use = value.toBoolean( ctx );
43  SettingsCore::setSlidesAdvance( use );
44 }
45 
46 static KJSObject fsGetTimeDelay( KJSContext *, void * )
47 {
48  return KJSNumber( SettingsCore::slidesAdvanceTime() );
49 }
50 
51 static void fsSetTimeDelay( KJSContext *ctx, void *, KJSObject value )
52 {
53  int time = static_cast<int>( value.toNumber( ctx ) );
54  SettingsCore::setSlidesAdvanceTime( time );
55 }
56 
57 void JSFullscreen::initType( KJSContext *ctx )
58 {
59  static bool initialized = false;
60  if ( initialized )
61  return;
62  initialized = true;
63 
64  if ( !g_fsProto )
65  g_fsProto = new KJSPrototype();
66 
67  g_fsProto->defineProperty( ctx, "loop", fsGetLoop, fsSetLoop );
68  g_fsProto->defineProperty( ctx, "useTimer",
69  fsGetUseTimer, fsSetUseTimer );
70  g_fsProto->defineProperty( ctx, "timeDelay",
71  fsGetTimeDelay, fsSetTimeDelay );
72 }
73 
74 KJSObject JSFullscreen::object( KJSContext *ctx )
75 {
76  assert( g_fsProto );
77  return g_fsProto->constructObject( ctx );
78 }
kjs_fullscreen_p.h
fsGetUseTimer
static KJSObject fsGetUseTimer(KJSContext *, void *)
Definition: kjs_fullscreen.cpp:35
fsSetLoop
static void fsSetLoop(KJSContext *ctx, void *, KJSObject value)
Definition: kjs_fullscreen.cpp:29
fsGetLoop
static KJSObject fsGetLoop(KJSContext *, void *)
Definition: kjs_fullscreen.cpp:24
fsSetUseTimer
static void fsSetUseTimer(KJSContext *ctx, void *, KJSObject value)
Definition: kjs_fullscreen.cpp:40
Okular::JSFullscreen::object
static KJSObject object(KJSContext *ctx)
Definition: kjs_fullscreen.cpp:74
fsGetTimeDelay
static KJSObject fsGetTimeDelay(KJSContext *, void *)
Definition: kjs_fullscreen.cpp:46
Okular::JSFullscreen::initType
static void initType(KJSContext *ctx)
Definition: kjs_fullscreen.cpp:57
g_fsProto
static KJSPrototype * g_fsProto
Definition: kjs_fullscreen.cpp:22
fsSetTimeDelay
static void fsSetTimeDelay(KJSContext *ctx, void *, KJSObject value)
Definition: kjs_fullscreen.cpp:51
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okular

Skip menu "okular"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdegraphics API Reference

Skip menu "kdegraphics API Reference"
  •     libkdcraw
  •     libkexiv2
  •     libkipi
  •     libksane
  • okular

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal