Merge lp:~elementaryart/lightdm-webkit-greeter/fixes-ubuntu-old into lp:~lightdm-team/lightdm-webkit-greeter/trunk

Proposed by Fabian Thoma
Status: Work in progress
Proposed branch: lp:~elementaryart/lightdm-webkit-greeter/fixes-ubuntu-old
Merge into: lp:~lightdm-team/lightdm-webkit-greeter/trunk
Diff against target: 1349 lines (+344/-267)
14 files modified
Makefile.am (+3/-0)
configure.ac (+4/-3)
debian/changelog (+24/-0)
debian/compat (+1/-0)
debian/control (+21/-0)
debian/copyright (+24/-0)
debian/postinst (+18/-0)
debian/postrm (+13/-0)
debian/prerm (+9/-0)
debian/rules (+12/-0)
debian/watch (+2/-0)
lightdm-webkit-greeter.conf (+18/-0)
src/Makefile.am (+1/-1)
src/lightdm-webkit-greeter.c (+194/-263)
To merge this branch: bzr merge lp:~elementaryart/lightdm-webkit-greeter/fixes-ubuntu-old
Reviewer Review Type Date Requested Status
Robert Ancell Needs Fixing
Review via email: mp+75399@code.launchpad.net

Description of the change

Changed the packaging to reflect dependency changes

To post a comment you must log in.
17. By Sergey "Shnatsel" Davidoff

Switched to XZ compression for better compression and faster unpacking

18. By Sergey "Shnatsel" Davidoff

added pre-depends needed by xz compression

19. By Sergey "Shnatsel" Davidoff

added a symlink that allows using debian alternatives system for theme switching

20. By Sergey "Shnatsel" Davidoff

added registering the greeter in the system, so it's taken into accound and defaulted to if no other greeters are available

21. By Sergey "Shnatsel" Davidoff

removed symlinking; it turns out that alternatives system handles that automagically

22. By Sergey "Shnatsel" Davidoff

fixed the theme "webkit" shipped with the greeter not being considered by alternatives system

23. By Sergey "Shnatsel" Davidoff

pass the correct name to lightdm-set-defaults

24. By Sergey "Shnatsel" Davidoff

now I'm totally confused by your naming conventions, guys

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Could you split this into a merge request for lp:lightdm-webkit-greeter (the upstream project) and lp:~ubuntu-desktop/lightdm-webkit-greeter/ubuntu (the packaging).

Apart from that the changes are good, but please:
- Remove commented out code
- Remove any temporary debugging (note there is a debug line that will print users passwords to the log which is a big security issue)
- Check whitespace (no tabs, four space indent).

review: Needs Fixing
Revision history for this message
Robert Ancell (robert-ancell) wrote :

And then I look at my next merge request :). Ok, just change this to packaging only and do the appropriate merge with lp:~ubuntu-desktop/lightdm-webkit-greeter/ubuntu

Unmerged revisions

24. By Sergey "Shnatsel" Davidoff

now I'm totally confused by your naming conventions, guys

23. By Sergey "Shnatsel" Davidoff

pass the correct name to lightdm-set-defaults

22. By Sergey "Shnatsel" Davidoff

fixed the theme "webkit" shipped with the greeter not being considered by alternatives system

21. By Sergey "Shnatsel" Davidoff

removed symlinking; it turns out that alternatives system handles that automagically

20. By Sergey "Shnatsel" Davidoff

added registering the greeter in the system, so it's taken into accound and defaulted to if no other greeters are available

19. By Sergey "Shnatsel" Davidoff

added a symlink that allows using debian alternatives system for theme switching

18. By Sergey "Shnatsel" Davidoff

added pre-depends needed by xz compression

17. By Sergey "Shnatsel" Davidoff

Switched to XZ compression for better compression and faster unpacking

16. By Sergey "Shnatsel" Davidoff

added debian packaging

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile.am'
2--- Makefile.am 2011-02-12 00:33:07 +0000
3+++ Makefile.am 2011-09-24 18:40:28 +0000
4@@ -18,3 +18,6 @@
5 omf.make \
6 xmldocs.make \
7 po/Makefile.in.in
8+
9+etcdir = /etc/lightdm/
10+etc_DATA = lightdm-webkit-greeter.conf
11
12=== modified file 'configure.ac'
13--- configure.ac 2011-05-20 05:03:42 +0000
14+++ configure.ac 2011-09-24 18:40:28 +0000
15@@ -2,6 +2,7 @@
16
17 AC_INIT(lightdm-webkit-greeter, 0.1.0)
18 AC_CONFIG_MACRO_DIR(m4)
19+AC_SUBST(THEME_DIR)
20 AC_CONFIG_HEADER(config.h)
21 AM_INIT_AUTOMAKE
22 AM_PROG_CC_C_O
23@@ -15,7 +16,7 @@
24 dnl ###########################################################################
25
26 PKG_CHECK_MODULES(GREETER, [
27- liblightdm-gobject-0
28+ liblightdm-gobject-1
29 gtk+-2.0
30 webkit-1.0
31 dbus-glib-1
32@@ -24,10 +25,10 @@
33 dnl ###########################################################################
34 dnl Configurable values
35 dnl ###########################################################################
36-THEME_DIR=`$PKG_CONFIG --define-variable=prefix=$prefix --variable=themedir liblightdm-gobject-0`
37+THEME_DIR=`pkg-config --define-variable=prefix=$prefix --variable=themedir liblightdm-gobject-0`
38 AC_SUBST(THEME_DIR)
39
40-GREETER_DIR=`$PKG_CONFIG --define-variable=prefix=$prefix --variable=greeterdir liblightdm-gobject-0`
41+GREETER_DIR=`pkg-config --define-variable=prefix=$prefix --variable=greeterdir liblightdm-gobject-0`
42 AC_SUBST(GREETER_DIR)
43
44 dnl ###########################################################################
45
46=== added directory 'debian'
47=== added file 'debian/changelog'
48--- debian/changelog 1970-01-01 00:00:00 +0000
49+++ debian/changelog 2011-09-24 18:40:28 +0000
50@@ -0,0 +1,24 @@
51+lightdm-webkit-greeter (0.1.0-0ubuntu4) oneiric; urgency=low
52+
53+ * Switched to XZ compression for better compression and faster unpacking
54+
55+ -- Sergey "Shnatsel" Davidoff <shnatsel@gmail.com> Fri, 16 Sep 2011 22:08:51 +0400
56+
57+lightdm-webkit-greeter (0.1.0-0ubuntu3) oneiric; urgency=low
58+
59+ * Fixed the ugly thing
60+
61+ -- Sergey "Shnatsel" Davidoff <shnatsel@gmail.com> Sun, 11 Sep 2011 06:25:14 +0400
62+
63+lightdm-webkit-greeter (0.1.0-0ubuntu2) natty; urgency=low
64+
65+ * debian/control:
66+ - Add build-depends on gnome-common
67+
68+ -- Robert Ancell <robert.ancell@canonical.com> Fri, 20 May 2011 16:24:26 +1000
69+
70+lightdm-webkit-greeter (0.1.0-0ubuntu1) natty; urgency=low
71+
72+ * New upstream release
73+
74+ -- Robert Ancell <robert.ancell@canonical.com> Fri, 20 May 2011 14:10:34 +1000
75
76=== added file 'debian/compat'
77--- debian/compat 1970-01-01 00:00:00 +0000
78+++ debian/compat 2011-09-24 18:40:28 +0000
79@@ -0,0 +1,1 @@
80+7
81
82=== added file 'debian/control'
83--- debian/control 1970-01-01 00:00:00 +0000
84+++ debian/control 2011-09-24 18:40:28 +0000
85@@ -0,0 +1,21 @@
86+Source: lightdm-webkit-greeter
87+Section: x11
88+Priority: optional
89+Maintainer: Robert Ancell <robert.ancell@ubuntu.com>
90+Standards-Version: 3.9.1
91+Build-Depends: debhelper (>= 7.0.50~),
92+ gnome-common,
93+ liblightdm-gobject-1-dev,
94+ libwebkit-dev
95+Homepage: https://launchpad.net/lightdm
96+Vcs-Bzr: https://code.launchpad.net/~ubuntu-desktop/lightdm-webkit-greeter/ubuntu
97+
98+Package: lightdm-webkit-greeter
99+Architecture: any
100+Depends: ${misc:Depends},
101+ ${shlibs:Depends}
102+Pre-Depends: dpkg (>= 1.15.6)
103+Recommends: lightdm
104+Provides: lightdm-greeter
105+Description: LightDM Webkit Greeter
106+ A LightDM greeter that uses WebKit (HTML/CSS).
107
108=== added file 'debian/copyright'
109--- debian/copyright 1970-01-01 00:00:00 +0000
110+++ debian/copyright 2011-09-24 18:40:28 +0000
111@@ -0,0 +1,24 @@
112+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=59
113+Name: LightDM Webkit Greeter
114+Maintainer: Robert Ancell <robert.ancell@gmail.com>
115+Source: https://launchpad.net/lightdm
116+
117+Files: *
118+Copyright: 2010-2011, Robert Ancell <robert.ancell@gmail.com>
119+License: GPL-3+
120+
121+License: GPL-3+
122+ This program is free software: you can redistribute it and/or modify
123+ it under the terms of the GNU General Public License as published by
124+ the Free Software Foundation, either version 3 of the License, or
125+ (at your option) any later version.
126+ .
127+ This program is distributed in the hope that it will be useful,
128+ but WITHOUT ANY WARRANTY; without even the implied warranty of
129+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
130+ GNU General Public License for more details.
131+ .
132+ You should have received a copy of the GNU General Public License
133+ along with this program. If not, see <http://www.gnu.org/licenses/>.
134+X-Comment: On Debian systems, the complete text of the GNU General
135+ Public License can be found in `/usr/share/common-licenses/GPL-3’.
136
137=== added file 'debian/postinst'
138--- debian/postinst 1970-01-01 00:00:00 +0000
139+++ debian/postinst 2011-09-24 18:40:28 +0000
140@@ -0,0 +1,18 @@
141+#!/bin/sh
142+set -e
143+
144+case "$1" in
145+ configure|upgrade)
146+ if [ -x /usr/lib/lightdm/lightdm-set-defaults ] ; then
147+ /usr/lib/lightdm/lightdm-set-defaults --keep-old --greeter=lightdm-webkit-greeter || true
148+ fi
149+ ;;
150+esac
151+
152+if [ "$1" = configure ]; then
153+ update-alternatives --install /usr/share/lightdm-webkit/themes/default \
154+ lightdm-webkit-theme /usr/share/lightdm-webkit/themes/webkit 5
155+fi
156+
157+#DEBHELPER#
158+
159
160=== added file 'debian/postrm'
161--- debian/postrm 1970-01-01 00:00:00 +0000
162+++ debian/postrm 2011-09-24 18:40:28 +0000
163@@ -0,0 +1,13 @@
164+#!/bin/sh
165+set -e
166+
167+case "$1" in
168+ remove|purge)
169+ if [ -x /usr/lib/lightdm/lightdm-set-defaults ] ; then
170+ /usr/lib/lightdm/lightdm-set-defaults --remove --greeter=lightdm-webkit-greeter || true
171+ fi
172+ ;;
173+esac
174+
175+#DEBHELPER#
176+
177
178=== added file 'debian/prerm'
179--- debian/prerm 1970-01-01 00:00:00 +0000
180+++ debian/prerm 2011-09-24 18:40:28 +0000
181@@ -0,0 +1,9 @@
182+#!/bin/sh
183+
184+set -e
185+
186+if [ "$1" = "remove" ]; then
187+ update-alternatives --remove lightdm-webkit-theme /usr/share/lightdm-webkit/themes/webkit
188+fi
189+
190+#DEBHELPER#
191
192=== added file 'debian/rules'
193--- debian/rules 1970-01-01 00:00:00 +0000
194+++ debian/rules 2011-09-24 18:40:28 +0000
195@@ -0,0 +1,12 @@
196+#!/usr/bin/make -f
197+
198+LDFLAGS+=-Wl,--as-needed
199+
200+%:
201+ dh $@
202+
203+override_dh_auto_configure:
204+ ./autogen.sh --prefix=/usr
205+
206+override_dh_builddeb:
207+ dh_builddeb -- -Zxz
208
209=== added file 'debian/watch'
210--- debian/watch 1970-01-01 00:00:00 +0000
211+++ debian/watch 2011-09-24 18:40:28 +0000
212@@ -0,0 +1,2 @@
213+version=3
214+http://people.ubuntu.com/~robert-ancell/lightdm/releases/lightdm-webkit-greeter-(.*)\.tar\.gz
215
216=== added file 'lightdm-webkit-greeter.conf'
217--- lightdm-webkit-greeter.conf 1970-01-01 00:00:00 +0000
218+++ lightdm-webkit-greeter.conf 2011-09-24 18:40:28 +0000
219@@ -0,0 +1,18 @@
220+#
221+# background = Background file to use, either an image path or a color (e.g. #772953)
222+# theme-name = GTK+ theme to use
223+# font-name = Font to use
224+# xft-antialias = Whether to antialias Xft fonts (true or false)
225+# xft-dpi = Resolution for Xft in dots per inch (e.g. 96)
226+# xft-hintstyle = What degree of hinting to use (hintnone, hintslight, hintmedium, or hintfull)
227+# xft-rgba = Type of subpixel antialiasing (none, rgb, bgr, vrgb or vbgr)
228+#
229+[greeter]
230+background=/usr/share/backgrounds/warty-final-ubuntu.png
231+theme-name=Ambiance
232+webkit-theme=elementary
233+font-name=Ubuntu 11
234+xft-antialias=true
235+xft-dpi=96
236+xft-hintstyle=slight
237+xft-rgba=rgb
238
239=== modified file 'src/Makefile.am'
240--- src/Makefile.am 2011-05-20 05:03:42 +0000
241+++ src/Makefile.am 2011-09-24 18:40:28 +0000
242@@ -1,5 +1,5 @@
243 greeter_PROGRAMS = lightdm-webkit-greeter
244-greeterdir = $(GREETER_DIR)
245+greeterdir = $(bindir)
246
247 lightdm_webkit_greeter_SOURCES = \
248 lightdm-webkit-greeter.c
249
250=== modified file 'src/lightdm-webkit-greeter.c'
251--- src/lightdm-webkit-greeter.c 2011-05-20 05:28:00 +0000
252+++ src/lightdm-webkit-greeter.c 2011-09-24 18:40:28 +0000
253@@ -15,25 +15,28 @@
254 #include <JavaScriptCore/JavaScript.h>
255 #include <glib/gi18n.h>
256
257-#include <lightdm/greeter.h>
258+#include <lightdm.h>
259
260-static JSClassRef gettext_class, ldm_greeter_class, ldm_user_class, ldm_language_class, ldm_layout_class, ldm_session_class;
261+static JSClassRef gettext_class, lightdm_greeter_class, lightdm_user_class, lightdm_language_class, lightdm_layout_class, lightdm_session_class;
262
263 static GtkWidget *web_view, *window;
264
265 static void
266-show_prompt_cb (LdmGreeter *greeter, const gchar *text, WebKitWebView *view)
267+show_prompt_cb (LightDMGreeter *greeter, const gchar *text, WebKitWebView *view)
268 {
269 gchar *command;
270
271+ g_debug("Show prompt %s", text);
272+
273 command = g_strdup_printf ("show_prompt('%s')", text); // FIXME: Escape text
274- webkit_web_view_execute_script (view, command);
275+ webkit_web_view_execute_script (web_view, command);
276 g_free (command);
277 }
278
279 static void
280-show_message_cb (LdmGreeter *greeter, const gchar *text, WebKitWebView *view)
281+show_message_cb (LightDMGreeter *greeter, const gchar *text, WebKitWebView *view)
282 {
283+ g_debug("%s %d", __FUNCTION__, __LINE__);
284 gchar *command;
285
286 command = g_strdup_printf ("show_message('%s')", text); // FIXME: Escape text
287@@ -42,13 +45,14 @@
288 }
289
290 static void
291-authentication_complete_cb (LdmGreeter *greeter, WebKitWebView *view)
292+authentication_complete_cb (LightDMGreeter *greeter, WebKitWebView *view)
293 {
294+ g_debug("%s %d", __FUNCTION__, __LINE__);
295 webkit_web_view_execute_script (view, "authentication_complete()");
296 }
297
298 static void
299-timed_login_cb (LdmGreeter *greeter, const gchar *username, WebKitWebView *view)
300+timed_login_cb (LightDMGreeter *greeter, const gchar *username, WebKitWebView *view)
301 {
302 gchar *command;
303
304@@ -60,6 +64,7 @@
305 static gboolean
306 fade_timer_cb (gpointer data)
307 {
308+ g_debug("%s %d", __FUNCTION__, __LINE__);
309 gdouble opacity;
310
311 opacity = gtk_window_get_opacity (GTK_WINDOW (window));
312@@ -75,7 +80,7 @@
313 }
314
315 static void
316-quit_cb (LdmGreeter *greeter, const gchar *username)
317+quit_cb (LightDMGreeter *greeter, const gchar *username)
318 {
319 /* Fade out the greeter */
320 g_timeout_add (40, (GSourceFunc) fade_timer_cb, NULL);
321@@ -87,10 +92,10 @@
322 JSStringRef propertyName,
323 JSValueRef *exception)
324 {
325- LdmUser *user = JSObjectGetPrivate (thisObject);
326+ LightDMUser *user = JSObjectGetPrivate (thisObject);
327 JSStringRef string;
328
329- string = JSStringCreateWithUTF8CString (ldm_user_get_name (user));
330+ string = JSStringCreateWithUTF8CString (lightdm_user_get_name (user));
331 return JSValueMakeString (context, string);
332 }
333
334@@ -100,10 +105,10 @@
335 JSStringRef propertyName,
336 JSValueRef *exception)
337 {
338- LdmUser *user = JSObjectGetPrivate (thisObject);
339+ LightDMUser *user = JSObjectGetPrivate (thisObject);
340 JSStringRef string;
341
342- string = JSStringCreateWithUTF8CString (ldm_user_get_real_name (user));
343+ string = JSStringCreateWithUTF8CString (lightdm_user_get_real_name (user));
344 return JSValueMakeString (context, string);
345 }
346
347@@ -113,10 +118,10 @@
348 JSStringRef propertyName,
349 JSValueRef *exception)
350 {
351- LdmUser *user = JSObjectGetPrivate (thisObject);
352+ LightDMUser *user = JSObjectGetPrivate (thisObject);
353 JSStringRef string;
354
355- string = JSStringCreateWithUTF8CString (ldm_user_get_display_name (user));
356+ string = JSStringCreateWithUTF8CString (lightdm_user_get_display_name (user));
357 return JSValueMakeString (context, string);
358 }
359
360@@ -126,10 +131,10 @@
361 JSStringRef propertyName,
362 JSValueRef *exception)
363 {
364- LdmUser *user = JSObjectGetPrivate (thisObject);
365+ LightDMUser *user = JSObjectGetPrivate (thisObject);
366 JSStringRef string;
367
368- string = JSStringCreateWithUTF8CString (ldm_user_get_image (user));
369+ string = JSStringCreateWithUTF8CString (lightdm_user_get_image (user));
370 return JSValueMakeString (context, string);
371 }
372
373@@ -139,8 +144,8 @@
374 JSStringRef propertyName,
375 JSValueRef *exception)
376 {
377- LdmUser *user = JSObjectGetPrivate (thisObject);
378- const gchar *language = ldm_user_get_language (user);
379+ LightDMUser *user = JSObjectGetPrivate (thisObject);
380+ const gchar *language = lightdm_user_get_language (user);
381 JSStringRef string;
382
383 if (!language)
384@@ -156,8 +161,8 @@
385 JSStringRef propertyName,
386 JSValueRef *exception)
387 {
388- LdmUser *user = JSObjectGetPrivate (thisObject);
389- const gchar *layout = ldm_user_get_layout (user);
390+ LightDMUser *user = JSObjectGetPrivate (thisObject);
391+ const gchar *layout = lightdm_user_get_layout (user);
392 JSStringRef string;
393
394 if (!layout)
395@@ -173,8 +178,9 @@
396 JSStringRef propertyName,
397 JSValueRef *exception)
398 {
399- LdmUser *user = JSObjectGetPrivate (thisObject);
400- const gchar *session = ldm_user_get_session (user);
401+ g_debug("%s %d", __FUNCTION__, __LINE__);
402+ LightDMUser *user = JSObjectGetPrivate (thisObject);
403+ const gchar *session = lightdm_user_get_session (user);
404 JSStringRef string;
405
406 if (!session)
407@@ -190,8 +196,8 @@
408 JSStringRef propertyName,
409 JSValueRef *exception)
410 {
411- LdmUser *user = JSObjectGetPrivate (thisObject);
412- return JSValueMakeBoolean (context, ldm_user_get_logged_in (user));
413+ LightDMUser *user = JSObjectGetPrivate (thisObject);
414+ return JSValueMakeBoolean (context, lightdm_user_get_logged_in (user));
415 }
416
417 static JSValueRef
418@@ -200,10 +206,10 @@
419 JSStringRef propertyName,
420 JSValueRef *exception)
421 {
422- LdmLanguage *language = JSObjectGetPrivate (thisObject);
423+ LightDMLanguage *language = JSObjectGetPrivate (thisObject);
424 JSStringRef string;
425
426- string = JSStringCreateWithUTF8CString (ldm_language_get_code (language));
427+ string = JSStringCreateWithUTF8CString (lightdm_language_get_code (language));
428 return JSValueMakeString (context, string);
429 }
430
431@@ -213,10 +219,10 @@
432 JSStringRef propertyName,
433 JSValueRef *exception)
434 {
435- LdmLanguage *language = JSObjectGetPrivate (thisObject);
436+ LightDMLanguage *language = JSObjectGetPrivate (thisObject);
437 JSStringRef string;
438
439- string = JSStringCreateWithUTF8CString (ldm_language_get_name (language));
440+ string = JSStringCreateWithUTF8CString (lightdm_language_get_name (language));
441 return JSValueMakeString (context, string);
442 }
443
444@@ -226,10 +232,10 @@
445 JSStringRef propertyName,
446 JSValueRef *exception)
447 {
448- LdmLanguage *language = JSObjectGetPrivate (thisObject);
449+ LightDMLanguage *language = JSObjectGetPrivate (thisObject);
450 JSStringRef string;
451
452- string = JSStringCreateWithUTF8CString (ldm_language_get_territory (language));
453+ string = JSStringCreateWithUTF8CString (lightdm_language_get_territory (language));
454 return JSValueMakeString (context, string);
455 }
456
457@@ -239,10 +245,10 @@
458 JSStringRef propertyName,
459 JSValueRef *exception)
460 {
461- LdmLayout *layout = JSObjectGetPrivate (thisObject);
462+ LightDMLayout *layout = JSObjectGetPrivate (thisObject);
463 JSStringRef string;
464
465- string = JSStringCreateWithUTF8CString (ldm_layout_get_name (layout));
466+ string = JSStringCreateWithUTF8CString (lightdm_layout_get_name (layout));
467 return JSValueMakeString (context, string);
468 }
469
470@@ -252,10 +258,11 @@
471 JSStringRef propertyName,
472 JSValueRef *exception)
473 {
474- LdmLayout *layout = JSObjectGetPrivate (thisObject);
475+ g_debug("%s %d", __FUNCTION__, __LINE__);
476+ LightDMLayout *layout = JSObjectGetPrivate (thisObject);
477 JSStringRef string;
478
479- string = JSStringCreateWithUTF8CString (ldm_layout_get_short_description (layout));
480+ string = JSStringCreateWithUTF8CString (lightdm_layout_get_short_description (layout));
481 return JSValueMakeString (context, string);
482 }
483
484@@ -265,10 +272,11 @@
485 JSStringRef propertyName,
486 JSValueRef *exception)
487 {
488- LdmLayout *layout = JSObjectGetPrivate (thisObject);
489+ g_debug("%s %d", __FUNCTION__, __LINE__);
490+ LightDMLayout *layout = JSObjectGetPrivate (thisObject);
491 JSStringRef string;
492
493- string = JSStringCreateWithUTF8CString (ldm_layout_get_description (layout));
494+ string = JSStringCreateWithUTF8CString (lightdm_layout_get_description (layout));
495 return JSValueMakeString (context, string);
496 }
497
498@@ -278,10 +286,10 @@
499 JSStringRef propertyName,
500 JSValueRef *exception)
501 {
502- LdmSession *session = JSObjectGetPrivate (thisObject);
503+ LightDMSession *session = JSObjectGetPrivate (thisObject);
504 JSStringRef string;
505
506- string = JSStringCreateWithUTF8CString (ldm_session_get_key (session));
507+ string = JSStringCreateWithUTF8CString (lightdm_session_get_key (session));
508 return JSValueMakeString (context, string);
509
510 }
511@@ -291,10 +299,10 @@
512 JSStringRef propertyName,
513 JSValueRef *exception)
514 {
515- LdmSession *session = JSObjectGetPrivate (thisObject);
516+ LightDMSession *session = JSObjectGetPrivate (thisObject);
517 JSStringRef string;
518
519- string = JSStringCreateWithUTF8CString (ldm_session_get_name (session));
520+ string = JSStringCreateWithUTF8CString (lightdm_session_get_name (session));
521 return JSValueMakeString (context, string);
522 }
523
524@@ -304,10 +312,10 @@
525 JSStringRef propertyName,
526 JSValueRef *exception)
527 {
528- LdmSession *session = JSObjectGetPrivate (thisObject);
529+ LightDMSession *session = JSObjectGetPrivate (thisObject);
530 JSStringRef string;
531
532- string = JSStringCreateWithUTF8CString (ldm_session_get_comment (session));
533+ string = JSStringCreateWithUTF8CString (lightdm_session_get_comment (session));
534 return JSValueMakeString (context, string);
535 }
536
537@@ -317,10 +325,10 @@
538 JSStringRef propertyName,
539 JSValueRef *exception)
540 {
541- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
542+ LightDMGreeter *greeter = JSObjectGetPrivate (thisObject);
543 JSStringRef string;
544
545- string = JSStringCreateWithUTF8CString (ldm_greeter_get_hostname (greeter));
546+ string = JSStringCreateWithUTF8CString (lightdm_get_hostname ());
547
548 return JSValueMakeString (context, string);
549 }
550@@ -331,10 +339,10 @@
551 JSStringRef propertyName,
552 JSValueRef *exception)
553 {
554- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
555+ LightDMGreeter *greeter = JSObjectGetPrivate (thisObject);
556 gint num_users;
557
558- num_users = ldm_greeter_get_num_users (greeter);
559+ num_users = g_list_length(lightdm_user_list_get_users (lightdm_user_list_get_instance()));
560 return JSValueMakeNumber (context, num_users);
561 }
562
563@@ -344,20 +352,20 @@
564 JSStringRef propertyName,
565 JSValueRef *exception)
566 {
567- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
568+ LightDMGreeter *greeter = JSObjectGetPrivate (thisObject);
569 JSObjectRef array;
570 const GList *users, *link;
571 guint i, n_users = 0;
572 JSValueRef *args;
573
574- users = ldm_greeter_get_users (greeter);
575+ users = lightdm_user_list_get_users( lightdm_user_list_get_instance() );
576 n_users = g_list_length ((GList *)users);
577 args = g_malloc (sizeof (JSValueRef) * (n_users + 1));
578 for (i = 0, link = users; link; i++, link = link->next)
579 {
580- LdmUser *user = link->data;
581+ LightDMUser *user = link->data;
582 g_object_ref (user);
583- args[i] = JSObjectMake (context, ldm_user_class, user);
584+ args[i] = JSObjectMake (context, lightdm_user_class, user);
585 }
586
587 array = JSObjectMakeArray (context, n_users, args, NULL);
588@@ -371,20 +379,19 @@
589 JSStringRef propertyName,
590 JSValueRef *exception)
591 {
592- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
593 JSObjectRef array;
594 const GList *languages, *link;
595 guint i, n_languages = 0;
596 JSValueRef *args;
597
598- languages = ldm_greeter_get_languages (greeter);
599+ languages = lightdm_get_languages ();
600 n_languages = g_list_length ((GList *)languages);
601 args = g_malloc (sizeof (JSValueRef) * (n_languages + 1));
602 for (i = 0, link = languages; link; i++, link = link->next)
603 {
604- LdmLanguage *language = link->data;
605+ LightDMLanguage *language = link->data;
606 g_object_ref (language);
607- args[i] = JSObjectMake (context, ldm_language_class, language);
608+ args[i] = JSObjectMake (context, lightdm_language_class, language);
609 }
610
611 array = JSObjectMakeArray (context, n_languages, args, NULL);
612@@ -398,10 +405,10 @@
613 JSStringRef propertyName,
614 JSValueRef *exception)
615 {
616- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
617+ LightDMGreeter *greeter = JSObjectGetPrivate (thisObject);
618 JSStringRef string;
619
620- string = JSStringCreateWithUTF8CString (ldm_greeter_get_default_language (greeter));
621+ string = JSStringCreateWithUTF8CString (lightdm_language_get_name((LightDMLanguage *)lightdm_get_language ()));
622
623 return JSValueMakeString (context, string);
624 }
625@@ -412,10 +419,9 @@
626 JSStringRef propertyName,
627 JSValueRef *exception)
628 {
629- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
630 JSStringRef string;
631
632- string = JSStringCreateWithUTF8CString (ldm_greeter_get_default_layout (greeter));
633+ string = JSStringCreateWithUTF8CString (lightdm_layout_get_name(lightdm_get_layout ()));
634
635 return JSValueMakeString (context, string);
636 }
637@@ -426,20 +432,19 @@
638 JSStringRef propertyName,
639 JSValueRef *exception)
640 {
641- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
642 JSObjectRef array;
643 const GList *layouts, *link;
644 guint i, n_layouts = 0;
645 JSValueRef *args;
646
647- layouts = ldm_greeter_get_layouts (greeter);
648+ layouts = lightdm_get_layouts ();
649 n_layouts = g_list_length ((GList *)layouts);
650 args = g_malloc (sizeof (JSValueRef) * (n_layouts + 1));
651 for (i = 0, link = layouts; link; i++, link = link->next)
652 {
653- LdmLayout *layout = link->data;
654+ LightDMLayout *layout = link->data;
655 g_object_ref (layout);
656- args[i] = JSObjectMake (context, ldm_layout_class, layout);
657+ args[i] = JSObjectMake (context, lightdm_layout_class, layout);
658 }
659
660 array = JSObjectMakeArray (context, n_layouts, args, NULL);
661@@ -453,10 +458,10 @@
662 JSStringRef propertyName,
663 JSValueRef *exception)
664 {
665- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
666+ g_debug("%s %d", __FUNCTION__, __LINE__);
667 JSStringRef string;
668
669- string = JSStringCreateWithUTF8CString (ldm_greeter_get_layout (greeter));
670+ string = JSStringCreateWithUTF8CString (lightdm_layout_get_name(lightdm_get_layout ()));
671
672 return JSValueMakeString (context, string);
673 }
674@@ -468,7 +473,6 @@
675 JSValueRef value,
676 JSValueRef *exception)
677 {
678- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
679 JSStringRef layout_arg;
680 char layout[1024];
681
682@@ -480,7 +484,7 @@
683 JSStringGetUTF8CString (layout_arg, layout, 1024);
684 JSStringRelease (layout_arg);
685
686- ldm_greeter_set_layout (greeter, layout);
687+ //lightdm_set_layout (layout);
688
689 return true;
690 }
691@@ -491,20 +495,19 @@
692 JSStringRef propertyName,
693 JSValueRef *exception)
694 {
695- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
696 JSObjectRef array;
697 const GList *sessions, *link;
698 guint i, n_sessions = 0;
699 JSValueRef *args;
700
701- sessions = ldm_greeter_get_sessions (greeter);
702+ sessions = lightdm_get_sessions ();
703 n_sessions = g_list_length ((GList *)sessions);
704 args = g_malloc (sizeof (JSValueRef) * (n_sessions + 1));
705 for (i = 0, link = sessions; link; i++, link = link->next)
706 {
707- LdmSession *session = link->data;
708+ LightDMSession *session = link->data;
709 g_object_ref (session);
710- args[i] = JSObjectMake (context, ldm_session_class, session);
711+ args[i] = JSObjectMake (context, lightdm_session_class, session);
712 }
713
714 array = JSObjectMakeArray (context, n_sessions, args, NULL);
715@@ -518,10 +521,10 @@
716 JSStringRef propertyName,
717 JSValueRef *exception)
718 {
719- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
720+ LightDMGreeter *greeter = JSObjectGetPrivate (thisObject);
721 JSStringRef string;
722
723- string = JSStringCreateWithUTF8CString (ldm_greeter_get_default_session (greeter));
724+ string = JSStringCreateWithUTF8CString (lightdm_greeter_get_default_session_hint (greeter));
725
726 return JSValueMakeString (context, string);
727 }
728@@ -532,10 +535,10 @@
729 JSStringRef propertyName,
730 JSValueRef *exception)
731 {
732- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
733+ LightDMGreeter *greeter = JSObjectGetPrivate (thisObject);
734 JSStringRef string;
735
736- string = JSStringCreateWithUTF8CString (ldm_greeter_get_timed_login_user (greeter));
737+ string = JSStringCreateWithUTF8CString (lightdm_greeter_get_autologin_user_hint (greeter));
738
739 return JSValueMakeString (context, string);
740 }
741@@ -546,91 +549,13 @@
742 JSStringRef propertyName,
743 JSValueRef *exception)
744 {
745- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
746+ g_debug("%s %d", __FUNCTION__, __LINE__);
747+ LightDMGreeter *greeter = JSObjectGetPrivate (thisObject);
748 gint delay;
749
750- delay = ldm_greeter_get_timed_login_delay (greeter);
751+ delay = lightdm_greeter_get_autologin_timeout_hint (greeter);
752 return JSValueMakeNumber (context, delay);
753 }
754-
755-static JSValueRef
756-get_string_property_cb (JSContextRef context,
757- JSObjectRef function,
758- JSObjectRef thisObject,
759- size_t argumentCount,
760- const JSValueRef arguments[],
761- JSValueRef *exception)
762-{
763- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
764- JSStringRef name_arg;
765- char name[1024];
766- gchar *value;
767- JSStringRef string;
768-
769- // FIXME: Throw exception
770- if (argumentCount != 1)
771- return JSValueMakeNull (context);
772-
773- name_arg = JSValueToStringCopy (context, arguments[0], NULL);
774- JSStringGetUTF8CString (name_arg, name, 1024);
775- JSStringRelease (name_arg);
776-
777- value = ldm_greeter_get_string_property (greeter, name);
778-
779- if (!value)
780- return JSValueMakeNull (context);
781-
782- string = JSStringCreateWithUTF8CString (value);
783- g_free (value);
784- return JSValueMakeString (context, string);
785-}
786-
787-static JSValueRef
788-get_integer_property_cb (JSContextRef context,
789- JSObjectRef function,
790- JSObjectRef thisObject,
791- size_t argumentCount,
792- const JSValueRef arguments[],
793- JSValueRef *exception)
794-{
795- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
796- JSStringRef name_arg;
797- char name[1024];
798-
799- // FIXME: Throw exception
800- if (argumentCount != 1)
801- return JSValueMakeNull (context);
802-
803- name_arg = JSValueToStringCopy (context, arguments[0], NULL);
804- JSStringGetUTF8CString (name_arg, name, 1024);
805- JSStringRelease (name_arg);
806-
807- return JSValueMakeNumber (context, ldm_greeter_get_integer_property (greeter, name));
808-}
809-
810-static JSValueRef
811-get_boolean_property_cb (JSContextRef context,
812- JSObjectRef function,
813- JSObjectRef thisObject,
814- size_t argumentCount,
815- const JSValueRef arguments[],
816- JSValueRef *exception)
817-{
818- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
819- JSStringRef name_arg;
820- char name[1024];
821-
822- // FIXME: Throw exception
823- if (argumentCount != 1)
824- return JSValueMakeNull (context);
825-
826- name_arg = JSValueToStringCopy (context, arguments[0], NULL);
827- JSStringGetUTF8CString (name_arg, name, 1024);
828- JSStringRelease (name_arg);
829-
830- return JSValueMakeBoolean (context, ldm_greeter_get_boolean_property (greeter, name));
831-}
832-
833 static JSValueRef
834 cancel_timed_login_cb (JSContextRef context,
835 JSObjectRef function,
836@@ -639,13 +564,14 @@
837 const JSValueRef arguments[],
838 JSValueRef *exception)
839 {
840- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
841+ g_debug("%s %d", __FUNCTION__, __LINE__);
842+ LightDMGreeter *greeter = JSObjectGetPrivate (thisObject);
843
844 // FIXME: Throw exception
845 if (argumentCount != 0)
846 return JSValueMakeNull (context);
847
848- ldm_greeter_cancel_timed_login (greeter);
849+ lightdm_greeter_cancel_autologin (greeter);
850 return JSValueMakeNull (context);
851 }
852
853@@ -657,7 +583,8 @@
854 const JSValueRef arguments[],
855 JSValueRef *exception)
856 {
857- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
858+ g_debug("%s %d", __FUNCTION__, __LINE__);
859+ LightDMGreeter *greeter = JSObjectGetPrivate (thisObject);
860 JSStringRef name_arg;
861 char name[1024];
862
863@@ -669,7 +596,7 @@
864 JSStringGetUTF8CString (name_arg, name, 1024);
865 JSStringRelease (name_arg);
866
867- ldm_greeter_start_authentication (greeter, name);
868+ lightdm_greeter_authenticate (greeter, name);
869 return JSValueMakeNull (context);
870 }
871
872@@ -681,11 +608,13 @@
873 const JSValueRef arguments[],
874 JSValueRef *exception)
875 {
876- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
877+ g_debug("%s %d", __FUNCTION__, __LINE__);
878+ LightDMGreeter *greeter = JSObjectGetPrivate (thisObject);
879 JSStringRef secret_arg;
880 char secret[1024];
881
882 // FIXME: Throw exception
883+ g_debug("%d %d %d\n", argumentCount, argumentCount == 1, JSValueGetType (context, arguments[0]));
884 if (!(argumentCount == 1 && JSValueGetType (context, arguments[0]) == kJSTypeString))
885 return JSValueMakeNull (context);
886
887@@ -693,7 +622,9 @@
888 JSStringGetUTF8CString (secret_arg, secret, 1024);
889 JSStringRelease (secret_arg);
890
891- ldm_greeter_provide_secret (greeter, secret);
892+ g_debug(secret);
893+ // TODO
894+ lightdm_greeter_respond (greeter, secret);
895 return JSValueMakeNull (context);
896 }
897
898@@ -705,13 +636,13 @@
899 const JSValueRef arguments[],
900 JSValueRef *exception)
901 {
902- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
903+ LightDMGreeter *greeter = JSObjectGetPrivate (thisObject);
904
905 // FIXME: Throw exception
906 if (argumentCount != 0)
907 return JSValueMakeNull (context);
908
909- ldm_greeter_cancel_authentication (greeter);
910+ lightdm_greeter_cancel_authentication (greeter);
911 return JSValueMakeNull (context);
912 }
913
914@@ -721,8 +652,8 @@
915 JSStringRef propertyName,
916 JSValueRef *exception)
917 {
918- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
919- return JSValueMakeString (context, JSStringCreateWithUTF8CString (ldm_greeter_get_authentication_user (greeter)));
920+ LightDMGreeter *greeter = JSObjectGetPrivate (thisObject);
921+ return JSValueMakeString (context, JSStringCreateWithUTF8CString (lightdm_greeter_get_authentication_user (greeter)));
922 }
923
924 static JSValueRef
925@@ -731,8 +662,8 @@
926 JSStringRef propertyName,
927 JSValueRef *exception)
928 {
929- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
930- return JSValueMakeBoolean (context, ldm_greeter_get_is_authenticated (greeter));
931+ LightDMGreeter *greeter = JSObjectGetPrivate (thisObject);
932+ return JSValueMakeBoolean (context, lightdm_greeter_get_is_authenticated (greeter));
933 }
934
935 static JSValueRef
936@@ -741,8 +672,7 @@
937 JSStringRef propertyName,
938 JSValueRef *exception)
939 {
940- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
941- return JSValueMakeBoolean (context, ldm_greeter_get_can_suspend (greeter));
942+ return JSValueMakeBoolean (context, lightdm_get_can_suspend ());
943 }
944
945 static JSValueRef
946@@ -753,13 +683,12 @@
947 const JSValueRef arguments[],
948 JSValueRef *exception)
949 {
950- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
951-
952+ g_debug("%s %d", __FUNCTION__, __LINE__);
953 // FIXME: Throw exception
954 if (argumentCount != 0)
955 return JSValueMakeNull (context);
956
957- ldm_greeter_suspend (greeter);
958+ lightdm_suspend(NULL);
959 return JSValueMakeNull (context);
960 }
961
962@@ -769,8 +698,8 @@
963 JSStringRef propertyName,
964 JSValueRef *exception)
965 {
966- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
967- return JSValueMakeBoolean (context, ldm_greeter_get_can_hibernate (greeter));
968+ g_debug("%s %d", __FUNCTION__, __LINE__);
969+ return JSValueMakeBoolean (context, lightdm_get_can_hibernate ());
970 }
971
972 static JSValueRef
973@@ -781,13 +710,12 @@
974 const JSValueRef arguments[],
975 JSValueRef *exception)
976 {
977- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
978-
979+ g_debug("%s %d", __FUNCTION__, __LINE__);
980 // FIXME: Throw exception
981 if (argumentCount != 0)
982 return JSValueMakeNull (context);
983
984- ldm_greeter_hibernate (greeter);
985+ lightdm_hibernate (NULL);
986 return JSValueMakeNull (context);
987 }
988
989@@ -797,8 +725,8 @@
990 JSStringRef propertyName,
991 JSValueRef *exception)
992 {
993- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
994- return JSValueMakeBoolean (context, ldm_greeter_get_can_restart (greeter));
995+ g_debug("%s %d", __FUNCTION__, __LINE__);
996+ return JSValueMakeBoolean (context, lightdm_get_can_restart ());
997 }
998
999 static JSValueRef
1000@@ -809,13 +737,11 @@
1001 const JSValueRef arguments[],
1002 JSValueRef *exception)
1003 {
1004- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
1005-
1006 // FIXME: Throw exception
1007 if (argumentCount != 0)
1008 return JSValueMakeNull (context);
1009
1010- ldm_greeter_restart (greeter);
1011+ lightdm_restart (NULL);
1012 return JSValueMakeNull (context);
1013 }
1014
1015@@ -825,8 +751,7 @@
1016 JSStringRef propertyName,
1017 JSValueRef *exception)
1018 {
1019- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
1020- return JSValueMakeBoolean (context, ldm_greeter_get_can_shutdown (greeter));
1021+ return JSValueMakeBoolean (context, lightdm_get_can_shutdown ());
1022 }
1023
1024 static JSValueRef
1025@@ -837,13 +762,11 @@
1026 const JSValueRef arguments[],
1027 JSValueRef *exception)
1028 {
1029- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
1030-
1031 // FIXME: Throw exception
1032 if (argumentCount != 0)
1033 return JSValueMakeNull (context);
1034
1035- ldm_greeter_shutdown (greeter);
1036+ lightdm_shutdown (NULL);
1037 return JSValueMakeNull (context);
1038 }
1039
1040@@ -855,13 +778,12 @@
1041 const JSValueRef arguments[],
1042 JSValueRef *exception)
1043 {
1044- LdmGreeter *greeter = JSObjectGetPrivate (thisObject);
1045+ g_debug("%s", __FUNCTION__);
1046+ LightDMGreeter *greeter = JSObjectGetPrivate (thisObject);
1047 JSStringRef arg;
1048 char username[1024], *session = NULL, *language = NULL;
1049
1050 // FIXME: Throw exception
1051- if (argumentCount < 1 || argumentCount > 3)
1052- return JSValueMakeNull (context);
1053
1054 arg = JSValueToStringCopy (context, arguments[0], NULL);
1055 JSStringGetUTF8CString (arg, username, 1024);
1056@@ -883,7 +805,7 @@
1057 JSStringRelease (arg);
1058 }
1059
1060- ldm_greeter_login (greeter, username, session, language);
1061+ lightdm_greeter_start_session_sync (greeter, NULL, NULL);
1062 g_free (session);
1063 g_free (language);
1064
1065@@ -898,6 +820,7 @@
1066 const JSValueRef arguments[],
1067 JSValueRef *exception)
1068 {
1069+ g_debug("%s %d", __FUNCTION__, __LINE__);
1070 JSStringRef string_arg, result;
1071 char string[1024];
1072
1073@@ -921,6 +844,7 @@
1074 const JSValueRef arguments[],
1075 JSValueRef *exception)
1076 {
1077+ g_debug("%s %d", __FUNCTION__, __LINE__);
1078 JSStringRef string_arg, plural_string_arg, result;
1079 char string[1024], plural_string[1024];
1080 unsigned int n;
1081@@ -943,7 +867,7 @@
1082 return JSValueMakeString (context, result);
1083 }
1084
1085-static const JSStaticValue ldm_user_values[] =
1086+static const JSStaticValue lightdm_user_values[] =
1087 {
1088 { "name", get_user_name_cb, NULL, kJSPropertyAttributeReadOnly },
1089 { "real_name", get_user_real_name_cb, NULL, kJSPropertyAttributeReadOnly },
1090@@ -956,7 +880,7 @@
1091 { NULL, NULL, NULL, 0 }
1092 };
1093
1094-static const JSStaticValue ldm_language_values[] =
1095+static const JSStaticValue lightdm_language_values[] =
1096 {
1097 { "code", get_language_code_cb, NULL, kJSPropertyAttributeReadOnly },
1098 { "name", get_language_name_cb, NULL, kJSPropertyAttributeReadOnly },
1099@@ -964,7 +888,7 @@
1100 { NULL, NULL, NULL, 0 }
1101 };
1102
1103-static const JSStaticValue ldm_layout_values[] =
1104+static const JSStaticValue lightdm_layout_values[] =
1105 {
1106 { "name", get_layout_name_cb, NULL, kJSPropertyAttributeReadOnly },
1107 { "short_description", get_layout_short_description_cb, NULL, kJSPropertyAttributeReadOnly },
1108@@ -972,7 +896,7 @@
1109 { NULL, NULL, NULL, 0 }
1110 };
1111
1112-static const JSStaticValue ldm_session_values[] =
1113+static const JSStaticValue lightdm_session_values[] =
1114 {
1115 { "key", get_session_key_cb, NULL, kJSPropertyAttributeReadOnly },
1116 { "name", get_session_name_cb, NULL, kJSPropertyAttributeReadOnly },
1117@@ -980,7 +904,7 @@
1118 { NULL, NULL, NULL, 0 }
1119 };
1120
1121-static const JSStaticValue ldm_greeter_values[] =
1122+static const JSStaticValue lightdm_greeter_values[] =
1123 {
1124 { "hostname", get_hostname_cb, NULL, kJSPropertyAttributeReadOnly },
1125 { "users", get_users_cb, NULL, kJSPropertyAttributeReadOnly },
1126@@ -1003,11 +927,8 @@
1127 { NULL, NULL, NULL, 0 }
1128 };
1129
1130-static const JSStaticFunction ldm_greeter_functions[] =
1131+static const JSStaticFunction lightdm_greeter_functions[] =
1132 {
1133- { "get_string_property", get_string_property_cb, kJSPropertyAttributeReadOnly },
1134- { "get_integer_property", get_integer_property_cb, kJSPropertyAttributeReadOnly },
1135- { "get_boolean_property", get_boolean_property_cb, kJSPropertyAttributeReadOnly },
1136 { "cancel_timed_login", cancel_timed_login_cb, kJSPropertyAttributeReadOnly },
1137 { "start_authentication", start_authentication_cb, kJSPropertyAttributeReadOnly },
1138 { "provide_secret", provide_secret_cb, kJSPropertyAttributeReadOnly },
1139@@ -1027,50 +948,50 @@
1140 { NULL, NULL, 0 }
1141 };
1142
1143-static const JSClassDefinition ldm_user_definition =
1144-{
1145- 0, /* Version */
1146- kJSClassAttributeNone, /* Attributes */
1147- "LdmUser", /* Class name */
1148- NULL, /* Parent class */
1149- ldm_user_values, /* Static values */
1150-};
1151-
1152-static const JSClassDefinition ldm_language_definition =
1153-{
1154- 0, /* Version */
1155- kJSClassAttributeNone, /* Attributes */
1156- "LdmLanguage", /* Class name */
1157- NULL, /* Parent class */
1158- ldm_language_values, /* Static values */
1159-};
1160-
1161-static const JSClassDefinition ldm_layout_definition =
1162-{
1163- 0, /* Version */
1164- kJSClassAttributeNone, /* Attributes */
1165- "LdmLayout", /* Class name */
1166- NULL, /* Parent class */
1167- ldm_layout_values, /* Static values */
1168-};
1169-
1170-static const JSClassDefinition ldm_session_definition =
1171-{
1172- 0, /* Version */
1173- kJSClassAttributeNone, /* Attributes */
1174- "LdmSession", /* Class name */
1175- NULL, /* Parent class */
1176- ldm_session_values, /* Static values */
1177-};
1178-
1179-static const JSClassDefinition ldm_greeter_definition =
1180-{
1181- 0, /* Version */
1182- kJSClassAttributeNone, /* Attributes */
1183- "LdmGreeter", /* Class name */
1184- NULL, /* Parent class */
1185- ldm_greeter_values, /* Static values */
1186- ldm_greeter_functions, /* Static functions */
1187+static const JSClassDefinition lightdm_user_definition =
1188+{
1189+ 0, /* Version */
1190+ kJSClassAttributeNone, /* Attributes */
1191+ "LightDMUser", /* Class name */
1192+ NULL, /* Parent class */
1193+ lightdm_user_values, /* Static values */
1194+};
1195+
1196+static const JSClassDefinition lightdm_language_definition =
1197+{
1198+ 0, /* Version */
1199+ kJSClassAttributeNone, /* Attributes */
1200+ "LightDMLanguage", /* Class name */
1201+ NULL, /* Parent class */
1202+ lightdm_language_values, /* Static values */
1203+};
1204+
1205+static const JSClassDefinition lightdm_layout_definition =
1206+{
1207+ 0, /* Version */
1208+ kJSClassAttributeNone, /* Attributes */
1209+ "LightDMLayout", /* Class name */
1210+ NULL, /* Parent class */
1211+ lightdm_layout_values, /* Static values */
1212+};
1213+
1214+static const JSClassDefinition lightdm_session_definition =
1215+{
1216+ 0, /* Version */
1217+ kJSClassAttributeNone, /* Attributes */
1218+ "LightDMSession", /* Class name */
1219+ NULL, /* Parent class */
1220+ lightdm_session_values, /* Static values */
1221+};
1222+
1223+static const JSClassDefinition lightdm_greeter_definition =
1224+{
1225+ 0, /* Version */
1226+ kJSClassAttributeNone, /* Attributes */
1227+ "LightDMGreeter", /* Class name */
1228+ NULL, /* Parent class */
1229+ lightdm_greeter_values, /* Static values */
1230+ lightdm_greeter_functions, /* Static functions */
1231 };
1232
1233 static const JSClassDefinition gettext_definition =
1234@@ -1088,16 +1009,17 @@
1235 WebKitWebFrame *frame,
1236 JSGlobalContextRef context,
1237 JSObjectRef window_object,
1238- LdmGreeter *greeter)
1239+ LightDMGreeter *greeter)
1240 {
1241- JSObjectRef gettext_object, ldm_greeter_object;
1242+ g_debug("%s %d", __FUNCTION__, __LINE__);
1243+ JSObjectRef gettext_object, lightdm_greeter_object;
1244
1245 gettext_class = JSClassCreate (&gettext_definition);
1246- ldm_greeter_class = JSClassCreate (&ldm_greeter_definition);
1247- ldm_user_class = JSClassCreate (&ldm_user_definition);
1248- ldm_language_class = JSClassCreate (&ldm_language_definition);
1249- ldm_layout_class = JSClassCreate (&ldm_layout_definition);
1250- ldm_session_class = JSClassCreate (&ldm_session_definition);
1251+ lightdm_greeter_class = JSClassCreate (&lightdm_greeter_definition);
1252+ lightdm_user_class = JSClassCreate (&lightdm_user_definition);
1253+ lightdm_language_class = JSClassCreate (&lightdm_language_definition);
1254+ lightdm_layout_class = JSClassCreate (&lightdm_layout_definition);
1255+ lightdm_session_class = JSClassCreate (&lightdm_session_definition);
1256
1257 gettext_object = JSObjectMake (context, gettext_class, NULL);
1258 JSObjectSetProperty (context,
1259@@ -1105,11 +1027,11 @@
1260 JSStringCreateWithUTF8CString ("gettext"),
1261 gettext_object, kJSPropertyAttributeNone, NULL);
1262
1263- ldm_greeter_object = JSObjectMake (context, ldm_greeter_class, greeter);
1264+ lightdm_greeter_object = JSObjectMake (context, lightdm_greeter_class, greeter);
1265 JSObjectSetProperty (context,
1266 JSContextGetGlobalObject (context),
1267 JSStringCreateWithUTF8CString ("lightdm"),
1268- ldm_greeter_object, kJSPropertyAttributeNone, NULL);
1269+ lightdm_greeter_object, kJSPropertyAttributeNone, NULL);
1270 }
1271
1272 static void
1273@@ -1119,23 +1041,23 @@
1274 }
1275
1276 static void
1277-connected_cb (LdmGreeter *greeter)
1278+connected_cb (LightDMGreeter *greeter)
1279 {
1280+ g_debug("%s %d", __FUNCTION__, __LINE__);
1281 gchar *url;
1282
1283- url = ldm_greeter_get_string_property (greeter, "url");
1284+ url = "index.html";
1285 if (url)
1286 {
1287 gchar *theme_dir, *rel_url;
1288
1289- theme_dir = g_path_get_dirname (ldm_greeter_get_theme (greeter));
1290+ theme_dir = g_path_get_dirname ("/usr/share/lightdm/elementary/");
1291 rel_url = url;
1292 url = g_strdup_printf ("file://%s/%s", theme_dir, rel_url);
1293 g_free (theme_dir);
1294 g_free (rel_url);
1295
1296 g_debug ("Showing URL %s", url);
1297- webkit_web_view_load_uri (WEBKIT_WEB_VIEW (web_view), url);
1298 g_free (url);
1299 }
1300 else
1301@@ -1147,7 +1069,7 @@
1302 int
1303 main (int argc, char **argv)
1304 {
1305- LdmGreeter *greeter;
1306+ LightDMGreeter *greeter;
1307 GdkDisplay *display;
1308 GdkScreen *screen;
1309 gint screen_width, screen_height;
1310@@ -1155,8 +1077,13 @@
1311 signal (SIGTERM, sigterm_cb);
1312
1313 gtk_init (&argc, &argv);
1314+ gdk_window_set_cursor (gdk_get_default_root_window (), gdk_cursor_new (GDK_LEFT_PTR));
1315+ greeter = lightdm_greeter_new ();
1316
1317- greeter = ldm_greeter_new ();
1318+ /* settings */
1319+ GKeyFile* keyfile = g_key_file_new();
1320+ g_key_file_load_from_file(keyfile, "/etc/lightdm/lightdm-webkit-greeter.conf", G_KEY_FILE_NONE, NULL);
1321+ gchar* theme = g_key_file_get_string(keyfile, "greeter", "webkit-theme", NULL);
1322
1323 display = gdk_display_get_default ();
1324 screen = gdk_display_get_default_screen (display);
1325@@ -1171,16 +1098,20 @@
1326 g_signal_connect (G_OBJECT (web_view), "window-object-cleared", G_CALLBACK (window_object_cleared_cb), greeter);
1327 gtk_container_add (GTK_CONTAINER (window), web_view);
1328
1329- g_signal_connect (G_OBJECT (greeter), "connected", G_CALLBACK (connected_cb), web_view);
1330+ //g_signal_connect (G_OBJECT (greeter), "connected", G_CALLBACK (connected_cb), web_view);
1331 g_signal_connect (G_OBJECT (greeter), "show-prompt", G_CALLBACK (show_prompt_cb), web_view);
1332 g_signal_connect (G_OBJECT (greeter), "show-message", G_CALLBACK (show_message_cb), web_view);
1333 g_signal_connect (G_OBJECT (greeter), "show-error", G_CALLBACK (show_message_cb), web_view);
1334 g_signal_connect (G_OBJECT (greeter), "authentication-complete", G_CALLBACK (authentication_complete_cb), web_view);
1335- g_signal_connect (G_OBJECT (greeter), "timed-login", G_CALLBACK (timed_login_cb), web_view);
1336+ //g_signal_connect (G_OBJECT (greeter), "timed-login", G_CALLBACK (timed_login_cb), web_view);
1337 g_signal_connect (G_OBJECT (greeter), "quit", G_CALLBACK (quit_cb), web_view);
1338
1339- ldm_greeter_connect_to_server (greeter);
1340-
1341+ //lightdm_greeter_connect_to_server (greeter);
1342+
1343+ webkit_web_view_load_uri (WEBKIT_WEB_VIEW (web_view), g_strdup_printf("file:///usr/share/lightdm/%s/index.html", theme));
1344+
1345+ gtk_widget_show_all (window);
1346+lightdm_greeter_connect_sync (greeter, NULL);
1347 gtk_main ();
1348
1349 return 0;

Subscribers

People subscribed via source and target branches