diff -Nur Login.app-2.0.0-Alpha-7/Makefile Login.app-2.0.0-Alpha-7-frog/Makefile --- Login.app-2.0.0-Alpha-7/Makefile 2000-11-11 10:28:47.000000000 +0100 +++ Login.app-2.0.0-Alpha-7-frog/Makefile 2005-12-22 18:16:02.000000000 +0100 @@ -13,8 +13,8 @@ INSTALL = /usr/bin/install -c CC = cc -CFLAGS += -Wall -pedantic -D_GNU_SOURCE `get-wraster-flags --cflags` $(SHADOW) -LDFLAGS += `get-wraster-flags --ldflags` `get-wraster-flags --libs` -lXmu -lPropList -lcrypt +CFLAGS += -Wall -pedantic -D_GNU_SOURCE `get-wraster-flags --cflags` `get-wutil-flags --cflags` $(SHADOW) +LDFLAGS += `get-wraster-flags --ldflags --libs` `get-wutil-flags --ldflags --libs` -lXmu -lcrypt TARGET = Login diff -Nur Login.app-2.0.0-Alpha-7/Makefile.am Login.app-2.0.0-Alpha-7-frog/Makefile.am --- Login.app-2.0.0-Alpha-7/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ Login.app-2.0.0-Alpha-7-frog/Makefile.am 2005-12-22 18:09:25.000000000 +0100 @@ -0,0 +1,8 @@ +Programdir = $(prefix)/GNUstep/Apps/Login.app +Program_PROGRAMS = Login +Login_SOURCES = graphics.c panel.c config.h preferences.c resources.c switchuser.c util.c main.c graphics.h panel.h preferences.h resources.h switchuser.h util.h + +AM_CFLAGS += -pedantic -D_GNU_SOURCE `get-wutil-flags --cflags` `get-wraster-flags --cflags` -DSHADOW_PASSWD +Login_LDFLAGS += `get-wraster-flags --ldflags --libs` -lXmu `get-wutil-flags --ldflags --libs` -lcrypt +Login_LDADD = -lXmu -lWUtil -lcrypt + diff -Nur Login.app-2.0.0-Alpha-7/Makefile.in Login.app-2.0.0-Alpha-7-frog/Makefile.in --- Login.app-2.0.0-Alpha-7/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ Login.app-2.0.0-Alpha-7-frog/Makefile.in 2005-12-22 18:09:25.000000000 +0100 @@ -0,0 +1,317 @@ +# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +MAKEINFO = @MAKEINFO@ +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ +WRASTERLIBS = @WRASTERLIBS@ +wraster = @wraster@ +wutil = @wutil@ + +Programdir = $(prefix)/GNUstep/Apps/Login.app +Program_PROGRAMS = Login +Login_SOURCES = graphics.c panel.c config.h preferences.c resources.c switchuser.c util.c main.c graphics.h panel.h preferences.h resources.h switchuser.h util.h + +AM_CFLAGS = -pedantic -D_GNU_SOURCE `get-wutil-flags --cflags` `get-wraster-flags --cflags` -DSHADOW_PASSWD +Login_LDFLAGS = `get-wraster-flags --ldflags --libs` -lXmu `get-wutil-flags --ldflags --libs` -lcrypt +Login_LDADD = -lXmu -lWUtil -lcrypt +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = +PROGRAMS = $(Program_PROGRAMS) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +Login_OBJECTS = graphics.o panel.o preferences.o resources.o \ +switchuser.o util.o main.o +Login_DEPENDENCIES = +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +DEP_FILES = .deps/graphics.P .deps/main.P .deps/panel.P \ +.deps/preferences.P .deps/resources.P .deps/switchuser.P .deps/util.P +SOURCES = $(Login_SOURCES) +OBJECTS = $(Login_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-ProgramPROGRAMS: + +clean-ProgramPROGRAMS: + -test -z "$(Program_PROGRAMS)" || rm -f $(Program_PROGRAMS) + +distclean-ProgramPROGRAMS: + +maintainer-clean-ProgramPROGRAMS: + +install-ProgramPROGRAMS: $(Program_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(Programdir) + @list='$(Program_PROGRAMS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(Programdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(Programdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ + done + +uninstall-ProgramPROGRAMS: + @$(NORMAL_UNINSTALL) + list='$(Program_PROGRAMS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(Programdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + done + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +Login: $(Login_OBJECTS) $(Login_DEPENDENCIES) + @rm -f Login + $(LINK) $(Login_LDFLAGS) $(Login_OBJECTS) $(Login_LDADD) $(LIBS) + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = src + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + +DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) + +-include $(DEP_FILES) + +mostlyclean-depend: + +clean-depend: + +distclean-depend: + -rm -rf .deps + +maintainer-clean-depend: + +%.o: %.c + @echo '$(COMPILE) -c $<'; \ + $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.c + @echo '$(LTCOMPILE) -c $<'; \ + $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-ProgramPROGRAMS +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-ProgramPROGRAMS +uninstall: uninstall-am +all-am: Makefile $(PROGRAMS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(Programdir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-ProgramPROGRAMS mostlyclean-compile \ + mostlyclean-tags mostlyclean-depend mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-ProgramPROGRAMS clean-compile clean-tags clean-depend \ + clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-ProgramPROGRAMS distclean-compile \ + distclean-tags distclean-depend distclean-generic \ + clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-ProgramPROGRAMS \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-depend maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-ProgramPROGRAMS distclean-ProgramPROGRAMS \ +clean-ProgramPROGRAMS maintainer-clean-ProgramPROGRAMS \ +uninstall-ProgramPROGRAMS install-ProgramPROGRAMS mostlyclean-compile \ +distclean-compile clean-compile maintainer-clean-compile tags \ +mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \ +distdir mostlyclean-depend distclean-depend clean-depend \ +maintainer-clean-depend info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-am install-data install-am install uninstall-am uninstall \ +all-redirect all-am all installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nur Login.app-2.0.0-Alpha-7/graphics.c Login.app-2.0.0-Alpha-7-frog/graphics.c --- Login.app-2.0.0-Alpha-7/graphics.c 2000-07-04 00:03:30.000000000 +0200 +++ Login.app-2.0.0-Alpha-7-frog/graphics.c 2005-12-22 18:09:25.000000000 +0100 @@ -29,18 +29,18 @@ RContext* ctx = 0; -BOOL initGraphicsContext() { +Bool initGraphicsContext() { ctx = RCreateContext(dpy, DefaultScreen(dpy), 0); if (!ctx) { printError("could not initialize graphics library context (%s)", RMessageForError(RErrorCode)); - return NO; + return False; } - return YES; + return True; } -unsigned long getColorByName(const char* name) { +unsigned long getColorByName(char* name) { XWindowAttributes attributes; XColor color; @@ -77,7 +77,7 @@ } void drawText(Window win, XFontStruct* font, int justification, int x, int y, - unsigned long color, const char* text) { + unsigned long color, char* text) { int width; int length; GC gc; diff -Nur Login.app-2.0.0-Alpha-7/graphics.h Login.app-2.0.0-Alpha-7-frog/graphics.h --- Login.app-2.0.0-Alpha-7/graphics.h 2000-07-04 00:03:30.000000000 +0200 +++ Login.app-2.0.0-Alpha-7-frog/graphics.h 2005-12-22 18:09:25.000000000 +0100 @@ -25,17 +25,17 @@ #include #include #include -#include +#include #include "preferences.h" #include "resources.h" extern RContext *ctx; -BOOL initGraphicsContext(); -unsigned long getColorByName(const char* name); +Bool initGraphicsContext(); +unsigned long getColorByName(char* name); void setWindowImage(Window win, RImage* image); void setCombinedWindowImage(Window win, RImage* bottom, RImage* top); void drawText(Window win, XFontStruct* font, int justification, - int x, int y, unsigned long color, const char* text); + int x, int y, unsigned long color, char* text); #endif diff -Nur Login.app-2.0.0-Alpha-7/main.c Login.app-2.0.0-Alpha-7-frog/main.c --- Login.app-2.0.0-Alpha-7/main.c 2000-07-04 00:03:30.000000000 +0200 +++ Login.app-2.0.0-Alpha-7-frog/main.c 2005-12-22 18:12:54.000000000 +0100 @@ -21,6 +21,7 @@ #include #include +#include #include "panel.h" #include "preferences.h" #include "version.h" diff -Nur Login.app-2.0.0-Alpha-7/panel.c Login.app-2.0.0-Alpha-7-frog/panel.c --- Login.app-2.0.0-Alpha-7/panel.c 2000-07-04 00:03:30.000000000 +0200 +++ Login.app-2.0.0-Alpha-7-frog/panel.c 2005-12-22 18:09:25.000000000 +0100 @@ -77,16 +77,16 @@ static void resetInputFields(); /* -BOOL runAlertPanel(char* message) { +Bool runAlertPanel(char* message) { int x; int y; int width; int height; - BOOL result; + Bool result; Window win; XEvent event; - result = NO; + result = False; width = resources->panelImage->width; height = resources->panelImage->height; @@ -98,7 +98,7 @@ while(1) { Window buttonDown = 0; - BOOL inside = NO; + Bool inside = False; Action action = Wait; XNextEvent(dpy, &event); @@ -108,7 +108,7 @@ if (event.xbutton.button == Button1) { if (event.xbutton.window == restartButton || event.xbutton.window == powerButton) { buttonDown = event.xbutton.window; - inside = YES; + inside = True; if (buttonDown == restartButton) { setWindowImage(restartButton, resources->restartButtonDownImage); } else if (buttonDown == powerButton) { @@ -120,7 +120,7 @@ case ButtonRelease: if (event.xbutton.button == Button1) { - if (buttonDown == event.xbutton.window && inside == YES) { + if (buttonDown == event.xbutton.window && inside == True) { if (buttonDown == restartButton) { setWindowImage(restartButton, resources->restartButtonUpImage); action = Restart; @@ -130,7 +130,7 @@ } } buttonDown = 0; - inside = NO; + inside = False; } break; @@ -141,7 +141,7 @@ } else if (buttonDown == powerButton) { setWindowImage(powerButton, resources->powerButtonDownImage); } - inside = YES; + inside = True; } break; @@ -152,7 +152,7 @@ } else if (buttonDown == powerButton) { setWindowImage(powerButton, resources->powerButtonUpImage); } - inside = NO; + inside = False; } break; } @@ -162,7 +162,7 @@ } */ -static void createPanel(BOOL showWelcomeMsg) { +static void createPanel(Bool showWelcomeMsg) { int x; int y; int width; @@ -195,7 +195,7 @@ passwordFieldSwap.swap_action = XdbeBackground; /* Create buttons */ - if (preferences->disableUserShutdown == NO) { + if (preferences->disableUserShutdown == False) { restartButton = XCreateSimpleWindow(dpy, panel, preferences->restartButtonPosition[0], preferences->restartButtonPosition[1], 10, 10, 0, 0, 0); XSelectInput(dpy, restartButton, ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask); @@ -207,7 +207,7 @@ setWindowImage(powerButton, resources->powerButtonUpImage); } - if (showWelcomeMsg == YES && preferences->disableWelcomeMessage == NO) { + if (showWelcomeMsg == True && preferences->disableWelcomeMessage == False) { setWindowImage(panel, resources->panelImage); } else { setCombinedWindowImage(panel, resources->panelImage, resources->fieldLabelsImage); @@ -221,7 +221,7 @@ XSync(dpy, False); /* Draw welcome message */ - if (showWelcomeMsg == YES && preferences->disableWelcomeMessage == NO) { + if (showWelcomeMsg == True && preferences->disableWelcomeMessage == False) { drawText(panel, resources->messageFont, preferences->messageJustification, preferences->messagePosition[0], preferences->messagePosition[1], resources->messageColor, preferences->welcomeMessage); @@ -236,13 +236,13 @@ XMapRaised(dpy, passwordField); /* Show buttons */ - if (preferences->disableUserShutdown == NO) { + if (preferences->disableUserShutdown == False) { XMapWindow(dpy, restartButton); XMapWindow(dpy, powerButton); } /* Show hostname */ - if (preferences->disableHostname == NO) { + if (preferences->disableHostname == False) { drawText(panel, resources->hostnameFont, preferences->hostnameJustification, preferences->hostnamePosition[0], preferences->hostnamePosition[1], resources->hostnameColor, resources->hostname); @@ -253,51 +253,43 @@ } static void shakePanel() { - int i; - int j; - int x; - int y; - int width; - int height; + int i, j, x, y; + int width, height; - if (preferences->disableAnimations == NO) { + if (preferences->disableAnimations == False) { width = resources->panelImage->width; height = resources->panelImage->height; x = (XWidthOfScreen(ScreenOfDisplay(dpy, DefaultScreen(dpy))) - width + preferences->panelPosition[0]) / 2; y = (XHeightOfScreen(ScreenOfDisplay(dpy, DefaultScreen(dpy))) - height + preferences->panelPosition[1]) / 2; - + for(i = 0; i < 3; i++) { for(j = 3; j <= 21; j += 3) { XMoveWindow(dpy, panel, x + j, y); XFlush(dpy); usleep(10); - } for(j = 21; j >= -21; j -= 3) { XMoveWindow(dpy, panel, x + j, y); XFlush(dpy); usleep(10); - } for(j = -18; j <= 0; j += 3) { XMoveWindow(dpy, panel, x + j, y); XFlush(dpy); usleep(10); } - XFlush(dpy); + /*XFlush(dpy);*/ } } } -static void destroyPanel(BOOL shrink) { +static void destroyPanel(Bool shrink) { RImage* image; Pixmap shrinkPixmap; - int x; - int y; - int width; - int height; + int x, y; + int width, height; - if (shrink == YES && preferences->disableAnimations == NO) { + if (shrink == True && preferences->disableAnimations == False) { width = resources->panelImage->width; height = resources->panelImage->height; x = (XWidthOfScreen(ScreenOfDisplay(dpy, DefaultScreen(dpy))) - width + preferences->panelPosition[0]) / 2; @@ -325,7 +317,7 @@ XUngrabKeyboard(dpy, CurrentTime); XUnmapWindow(dpy, panel); - if (preferences->disableUserShutdown == NO) { + if (preferences->disableUserShutdown == False) { XDestroyWindow(dpy, restartButton); XDestroyWindow(dpy, powerButton); } @@ -462,13 +454,13 @@ command = getCommand(username); if (command == PowerOff || command == Restart) { - if (isPasswordCorrect("root", password) == YES) { + if (isPasswordCorrect("root", password) == True) { action = command; } else { action = Fail; } } else { - if (isPasswordCorrect(username, password) == YES) { + if (isPasswordCorrect(username, password) == True) { action = Login; } else { action = Fail; @@ -530,7 +522,7 @@ static Action eventHandler(XEvent* event) { static Window buttonDown = 0; - static BOOL inside = NO; + static Bool inside = False; Action action = Wait; switch (event->type) { @@ -538,7 +530,7 @@ if (event->xbutton.button == Button1) { if (event->xbutton.window == restartButton || event->xbutton.window == powerButton) { buttonDown = event->xbutton.window; - inside = YES; + inside = True; if (buttonDown == restartButton) { setWindowImage(restartButton, resources->restartButtonDownImage); } else if (buttonDown == powerButton) { @@ -550,7 +542,7 @@ case ButtonRelease: if (event->xbutton.button == Button1) { - if (buttonDown == event->xbutton.window && inside == YES) { + if (buttonDown == event->xbutton.window && inside == True) { if (buttonDown == restartButton) { setWindowImage(restartButton, resources->restartButtonUpImage); action = Restart; @@ -560,7 +552,7 @@ } } buttonDown = 0; - inside = NO; + inside = False; } break; @@ -571,7 +563,7 @@ } else if (buttonDown == powerButton) { setWindowImage(powerButton, resources->powerButtonDownImage); } - inside = YES; + inside = True; } break; @@ -582,7 +574,7 @@ } else if (buttonDown == powerButton) { setWindowImage(powerButton, resources->powerButtonUpImage); } - inside = NO; + inside = False; } break; @@ -602,7 +594,7 @@ return 0; } -static void closeAllClients(BOOL top) { +static void closeAllClients(Bool top) { Window dummywindow; Window* children; unsigned int nchildren; @@ -614,7 +606,7 @@ nchildren = 0; XQueryTree(dpy, root, &dummywindow, &dummywindow, &children, &nchildren); - if (top == NO) { + if (top == False) { for (i = 0; i < nchildren; i++) { if (XGetWindowAttributes(dpy, children[i], &attr) && (attr.map_state == IsViewable)) { children[i] = XmuClientWindow(dpy, children[i]); @@ -650,7 +642,7 @@ root = RootWindow(dpy, DefaultScreen(dpy)); - if (initGraphicsContext() == NO) { + if (initGraphicsContext() == False) { exit(0); } @@ -660,13 +652,13 @@ initRootWindow(); executeScript(appPath, STARTUP_SCRIPT); - createPanel(YES); + createPanel(True); while(1) { XNextEvent(dpy, &event); switch (eventHandler(&event)) { case Login: - destroyPanel(YES); + destroyPanel(True); pid = fork(); switch (pid) { @@ -686,8 +678,8 @@ } /* Close all clients */ - closeAllClients(NO); - closeAllClients(YES); + closeAllClients(False); + closeAllClients(True); /* Send HUP signal to clientgroup */ killpg(pid, SIGHUP); @@ -719,13 +711,13 @@ initRootWindow(); executeScript(appPath, STARTUP_SCRIPT); - createPanel(NO); + createPanel(False); break; case Console: - destroyPanel(YES); + destroyPanel(True); // execute console command - createPanel(NO); + createPanel(False); break; case Fail: @@ -767,7 +759,7 @@ break; case Exit: - destroyPanel(NO); + destroyPanel(False); exit(0); break; diff -Nur Login.app-2.0.0-Alpha-7/preferences.c Login.app-2.0.0-Alpha-7-frog/preferences.c --- Login.app-2.0.0-Alpha-7/preferences.c 2000-07-04 00:03:30.000000000 +0200 +++ Login.app-2.0.0-Alpha-7-frog/preferences.c 2005-12-22 18:09:25.000000000 +0100 @@ -25,8 +25,8 @@ #include "preferences.h" #include "config.h" -static const char* illegalValueMsg(const char* entryName) { - const char* msg = "illegal value assigned to \"%s\""; +static char* illegalValueMsg(char* entryName) { + char* msg = "illegal value assigned to \"%s\""; char* buffer; buffer = alloc(strlen(msg) + strlen(entryName)); @@ -34,51 +34,53 @@ return buffer; } -static BOOL readString(const proplist_t pl, const char* entryName, char** buffer, const char* defaultValue) { - proplist_t entry; - proplist_t key; - - key = PLMakeString((char*)entryName); - entry = PLGetDictionaryEntry(pl, key); - PLRelease(key); +static Bool readString(WMPropList *pl, char* entryName, char** buffer, char* defaultValue) { + WMPropList *entry; + WMPropList *key; + + key = WMCreatePLString(entryName); + entry = WMGetFromPLDictionary(pl, key); + WMReleasePropList(key); if (!entry) { /* Use default if not found */ - *buffer = strdup((char*)defaultValue); - } else if (!PLIsString(entry)) { + *buffer = strdup(defaultValue); + } else if (!WMIsPLString(entry)) { /* Not a string */ - return NO; + return False; } else { /* Use proplist value */ - *buffer = strdup(PLGetString(entry)); - PLRelease(entry); + *buffer = strdup(WMGetFromPLString(entry)); + WMReleasePropList(entry); } - return YES; + return True; } -static BOOL readStringArray(const proplist_t pl, const char* entryName, char*** buffer, const char* defaultValue) { - const char* space = " "; - proplist_t entry; - proplist_t key; +static Bool +readStringArray(WMPropList *pl, char* entryName, char*** buffer, char* defaultValue) +{ + char* space = " "; + WMPropList * entry; + WMPropList * key; char* value; char* tmp1; char* tmp2; int i; int numOfStrings; - key = PLMakeString((char*)entryName); - entry = PLGetDictionaryEntry(pl, key); - PLRelease(key); + key = WMCreatePLString((char*)entryName); + entry = WMGetFromPLDictionary(pl, key); + WMReleasePropList(key); if (!entry) { /* Use default if not found */ value = strdup(defaultValue); - } else if (!PLIsString(entry)) { + } else if (!WMIsPLString(entry)) { /* Not a string */ - return NO; + return False; } else { /* Use proplist value */ - value = strdup(PLGetString(entry)); - PLRelease(entry); + value = strdup(WMGetFromPLString(entry)); + WMReleasePropList(entry); } /* Count number of tokens */ @@ -97,92 +99,100 @@ (*buffer)[i] = strtok(NULL, space); } - return YES; + return True; } -static BOOL readBoolean(const proplist_t pl, const char* entryName, BOOL* buffer, const BOOL defaultValue) { - proplist_t entry; - proplist_t key; - - key = PLMakeString((char*)entryName); - entry = PLGetDictionaryEntry(pl, key); - PLRelease(key); +static Bool +readBoolean(WMPropList *pl, char* entryName, Bool* buffer, Bool defaultValue) +{ + WMPropList *entry; + WMPropList *key; + + key = WMCreatePLString((char*)entryName); + entry = WMGetFromPLDictionary(pl, key); + WMReleasePropList(key); if (!entry) { /* Use default if not found */ *buffer = defaultValue; - } else if (!PLIsString(entry)) { + } else if (!WMIsPLString(entry)) { /* Not a string */ - return NO; + return False; } else { /* Use proplist value */ - *buffer = !strcasecmp(PLGetString(entry), "YES")? YES : NO; - PLRelease(entry); + *buffer = !strcasecmp(WMGetFromPLString(entry), "YES")? True : False; + WMReleasePropList(entry); } - return YES; + return True; } -static BOOL readInteger(const proplist_t pl, const char* entryName, int* buffer, const int defaultValue) { - proplist_t entry; - proplist_t key; +static Bool +readInteger(WMPropList *pl, char* entryName, int* buffer, int defaultValue) +{ + WMPropList *entry; + WMPropList *key; - key = PLMakeString((char*)entryName); - entry = PLGetDictionaryEntry(pl, key); - PLRelease(key); + key = WMCreatePLString((char*)entryName); + entry = WMGetFromPLDictionary(pl, key); + WMReleasePropList(key); if (!entry) { /* Use default if not found */ *buffer = defaultValue; - } else if (!PLIsString(entry)) { + } else if (!WMIsPLString(entry)) { /* Not a string */ - return NO; + return False; } else { /* Use proplist value */ - sscanf(PLGetString(entry), "%d", buffer); - PLRelease(entry); + sscanf(WMGetFromPLString(entry), "%d", buffer); + WMReleasePropList(entry); } - return YES; + return True; } -static BOOL readPosition(const proplist_t pl, const char* entryName, int** buffer, const int defaultValueX, const int defaultValueY) { - proplist_t entry; - proplist_t key; +static Bool +readPosition(WMPropList *pl, char* entryName, int** buffer, int defaultValueX, int defaultValueY) +{ + WMPropList *entry; + WMPropList *key; - key = PLMakeString((char*)entryName); - entry = PLGetDictionaryEntry(pl, key); - PLRelease(key); + key = WMCreatePLString((char*)entryName); + entry = WMGetFromPLDictionary(pl, key); + WMReleasePropList(key); if (!entry) { /* Use default if not found */ (*buffer)[0] = defaultValueX; (*buffer)[1] = defaultValueY; - } else if (!PLIsString(entry)) { + } else if (!WMIsPLString(entry)) { /* Not a string */ - return NO; + return False; } else { /* Use proplist value */ - sscanf(PLGetString(entry), "%d, %d", (int*)&buffer[0], (int*)&(buffer[1])); - PLRelease(entry); + sscanf(WMGetFromPLString(entry), "%d, %d", (int*)&buffer[0], (int*)&(buffer[1])); + WMReleasePropList(entry); } - return YES; + return True; } -static BOOL readJustification(const proplist_t pl, const char* entryName, int* buffer, const int defaultValue) { - proplist_t entry; - proplist_t key; +static Bool +readJustification(WMPropList *pl, char* entryName, int* buffer, int defaultValue) +{ + WMPropList *entry; + WMPropList *key; - key = PLMakeString((char*)entryName); - entry = PLGetDictionaryEntry(pl, key); - PLRelease(key); + key = WMCreatePLString((char*)entryName); + entry = WMGetFromPLDictionary(pl, key); + WMReleasePropList(key); if (!entry) { /* Use default if not found */ *buffer = defaultValue; - } else if (!PLIsString(entry)) { + } else if (!WMIsPLString(entry)) { /* Not a string */ - return NO; + return False; } else { /* Use proplist value */ - char* value = PLGetString(entry); + char* value = WMGetFromPLString(entry); if (!strcasecmp(value, "RIGHT")) { *buffer = JUSTIFICATION_RIGHT; } else if (!strcasecmp(value, "LEFT")) { @@ -190,254 +200,256 @@ } else { *buffer = JUSTIFICATION_CENTER; } - PLRelease(entry); + WMReleasePropList(entry); } - return YES; + return True; } -static const char* readPreferences(const char* file, Preferences* pref) { - const char* entryWelcomeMessage = "WelcomeMessage"; - const char* entryRestartMessage = "RestartMessage"; - const char* entryPowerOffMessage = "PowerOffMessage"; - const char* entryXServer = "XServer"; - const char* entryTheme = "Theme"; - const char* entryDisableWelcomeMessage = "DisableWelcomeMessage"; - const char* entryDisableUserShutdown = "DisableUserShutdown"; - const char* entryDisableHostname = "DisableHostname"; - const char* entryDisableAnimations = "DisableAnimations"; - proplist_t pl; +static char* +readPreferences(char* file, Preferences* pref) { + char* entryWelcomeMessage = "WelcomeMessage"; + char* entryRestartMessage = "RestartMessage"; + char* entryPowerOffMessage = "PowerOffMessage"; + char* entryXServer = "XServer"; + char* entryTheme = "Theme"; + char* entryDisableWelcomeMessage = "DisableWelcomeMessage"; + char* entryDisableUserShutdown = "DisableUserShutdown"; + char* entryDisableHostname = "DisableHostname"; + char* entryDisableAnimations = "DisableAnimations"; + WMPropList * pl; /* Read file */ - pl = PLGetProplistWithPath(file); + pl = WMReadPropListFromFile(file); if (pl == NULL) { return "could not read preferences"; } /* WelcomeMessage */ - if (readString(pl, entryWelcomeMessage, &pref->welcomeMessage, DEFAULT_WELCOMEMESSAGE) == NO) { + if (readString(pl, entryWelcomeMessage, &pref->welcomeMessage, DEFAULT_WELCOMEMESSAGE) == False) { return illegalValueMsg(entryWelcomeMessage); } /* RestartMessage */ - if (readString(pl, entryRestartMessage, &pref->restartMessage, DEFAULT_RESTARTMESSAGE) == NO) { + if (readString(pl, entryRestartMessage, &pref->restartMessage, DEFAULT_RESTARTMESSAGE) == False) { return illegalValueMsg(entryRestartMessage); } /* PowerOffMessage */ - if (readString(pl, entryPowerOffMessage, &pref->powerOffMessage, DEFAULT_POWEROFFMESSAGE) == NO) { + if (readString(pl, entryPowerOffMessage, &pref->powerOffMessage, DEFAULT_POWEROFFMESSAGE) == False) { return illegalValueMsg(entryPowerOffMessage); } /* XServer */ - if (readStringArray(pl, entryXServer, &pref->xserver, DEFAULT_XSERVER) == NO) { + if (readStringArray(pl, entryXServer, &pref->xserver, DEFAULT_XSERVER) == False) { return illegalValueMsg(entryXServer); } /* Theme */ - if (readString(pl, entryTheme, &pref->theme, DEFAULT_THEME) == NO) { + if (readString(pl, entryTheme, &pref->theme, DEFAULT_THEME) == False) { return illegalValueMsg(entryTheme); } /* DisableWelcomeMessage */ - if (readBoolean(pl, entryDisableWelcomeMessage, &pref->disableWelcomeMessage, DEFAULT_DISABLEWELCOMEMESSAGE) == NO) { + if (readBoolean(pl, entryDisableWelcomeMessage, &pref->disableWelcomeMessage, DEFAULT_DISABLEWELCOMEMESSAGE) == False) { return illegalValueMsg(entryDisableWelcomeMessage); } /* DisableUserShutdown */ - if (readBoolean(pl, entryDisableUserShutdown, &pref->disableUserShutdown, DEFAULT_DISABLEUSERSHUTDOWN) == NO) { + if (readBoolean(pl, entryDisableUserShutdown, &pref->disableUserShutdown, DEFAULT_DISABLEUSERSHUTDOWN) == False) { return illegalValueMsg(entryDisableUserShutdown); } /* DisableHostname */ - if (readBoolean(pl, entryDisableHostname, &pref->disableHostname, DEFAULT_DISABLEHOSTNAME) == NO) { + if (readBoolean(pl, entryDisableHostname, &pref->disableHostname, DEFAULT_DISABLEHOSTNAME) == False) { return illegalValueMsg(entryDisableHostname); } /* DisableAnimations */ - if (readBoolean(pl, entryDisableAnimations, &pref->disableAnimations, DEFAULT_DISABLEANIMATIONS) == NO) { + if (readBoolean(pl, entryDisableAnimations, &pref->disableAnimations, DEFAULT_DISABLEANIMATIONS) == False) { return illegalValueMsg(entryDisableAnimations); } - /* PLRelease(pl); */ + /* WMReleasePropList(pl); */ return NULL; } -static const char* readThemeSettings(const char* file, Preferences* pref) { - const char* entryPanelImage = "PanelImage"; - const char* entryFieldLabelsImage = "FieldLabelsImage"; - const char* entryPowerButtonUpImage = "PowerButtonUpImage"; - const char* entryPowerButtonDownImage = "PowerButtonDownImage"; - const char* entryRestartButtonUpImage = "RestartButtonUpImage"; - const char* entryRestartButtonDownImage = "RestartButtonDownImage"; - const char* entryAlertIcon = "AlertIcon"; - const char* entryBackgroundColor = "BackgroundColor"; - const char* entryPanelPosition = "PanelPosition"; - const char* entryPowerButtonPosition = "PowerButtonPosition"; - const char* entryRestartButtonPosition = "RestartButtonPosition"; - const char* entryMessagePosition = "MessagePosition"; - const char* entryMessageJustification = "MessageJustification"; - const char* entryMessageColor = "MessageColor"; - const char* entryMessageFont = "MessageFont"; - const char* entryHostnamePosition = "HostnamePosition"; - const char* entryHostnameJustification = "HostnameJustification"; - const char* entryHostnameColor = "HostnameColor"; - const char* entryHostnameFont = "HostnameFont"; - const char* entryInputFont = "InputFont"; - const char* entryInputFontColor = "InputFontColor"; - const char* entryInputCursorHeight = "InputCursorHeight"; - const char* entryInputUserImage = "InputUserImage"; - const char* entryInputUserPosition = "InputUserPosition"; - const char* entryInputPasswordImage = "InputPasswordImage"; - const char* entryInputPasswordPosition = "InputPasswordPosition"; - proplist_t pl; +static char* +readThemeSettings(char* file, Preferences* pref) { + char* entryPanelImage = "PanelImage"; + char* entryFieldLabelsImage = "FieldLabelsImage"; + char* entryPowerButtonUpImage = "PowerButtonUpImage"; + char* entryPowerButtonDownImage = "PowerButtonDownImage"; + char* entryRestartButtonUpImage = "RestartButtonUpImage"; + char* entryRestartButtonDownImage = "RestartButtonDownImage"; + char* entryAlertIcon = "AlertIcon"; + char* entryBackgroundColor = "BackgroundColor"; + char* entryPanelPosition = "PanelPosition"; + char* entryPowerButtonPosition = "PowerButtonPosition"; + char* entryRestartButtonPosition = "RestartButtonPosition"; + char* entryMessagePosition = "MessagePosition"; + char* entryMessageJustification = "MessageJustification"; + char* entryMessageColor = "MessageColor"; + char* entryMessageFont = "MessageFont"; + char* entryHostnamePosition = "HostnamePosition"; + char* entryHostnameJustification = "HostnameJustification"; + char* entryHostnameColor = "HostnameColor"; + char* entryHostnameFont = "HostnameFont"; + char* entryInputFont = "InputFont"; + char* entryInputFontColor = "InputFontColor"; + char* entryInputCursorHeight = "InputCursorHeight"; + char* entryInputUserImage = "InputUserImage"; + char* entryInputUserPosition = "InputUserPosition"; + char* entryInputPasswordImage = "InputPasswordImage"; + char* entryInputPasswordPosition = "InputPasswordPosition"; + WMPropList * pl; /* Read file */ - pl = PLGetProplistWithPath(file); + pl = WMReadPropListFromFile(file); if (pl == NULL) { return "could not read theme settings"; } /* PanelImage */ - if (readString(pl, entryPanelImage, &pref->panelImage, DEFAULT_PANELIMAGE) == NO) { + if (readString(pl, entryPanelImage, &pref->panelImage, DEFAULT_PANELIMAGE) == False) { return illegalValueMsg(entryPanelImage); } /* FieldLabelsImage */ - if (readString(pl, entryFieldLabelsImage, &pref->fieldLabelsImage, DEFAULT_FIELDLABELSIMAGE) == NO) { + if (readString(pl, entryFieldLabelsImage, &pref->fieldLabelsImage, DEFAULT_FIELDLABELSIMAGE) == False) { return illegalValueMsg(entryFieldLabelsImage); } /* PowerButtonUpImage */ - if (readString(pl, entryPowerButtonUpImage, &pref->powerButtonUpImage, DEFAULT_POWERBUTTONUPIMAGE) == NO) { + if (readString(pl, entryPowerButtonUpImage, &pref->powerButtonUpImage, DEFAULT_POWERBUTTONUPIMAGE) == False) { return illegalValueMsg(entryPowerButtonUpImage); } /* PowerButtonDownImage */ - if (readString(pl, entryPowerButtonDownImage, &pref->powerButtonDownImage, DEFAULT_POWERBUTTONDOWNIMAGE) == NO) { + if (readString(pl, entryPowerButtonDownImage, &pref->powerButtonDownImage, DEFAULT_POWERBUTTONDOWNIMAGE) == False) { return illegalValueMsg(entryPowerButtonDownImage); } /* RestartButtonUpImage */ - if (readString(pl, entryRestartButtonUpImage, &pref->restartButtonUpImage, DEFAULT_RESTARTBUTTONUPIMAGE) == NO) { + if (readString(pl, entryRestartButtonUpImage, &pref->restartButtonUpImage, DEFAULT_RESTARTBUTTONUPIMAGE) == False) { return illegalValueMsg(entryRestartButtonUpImage); } /* RestartButtonDownImage */ - if (readString(pl, entryRestartButtonDownImage, &pref->restartButtonDownImage, DEFAULT_RESTARTBUTTONDOWNIMAGE) == NO) { + if (readString(pl, entryRestartButtonDownImage, &pref->restartButtonDownImage, DEFAULT_RESTARTBUTTONDOWNIMAGE) == False) { return illegalValueMsg(entryRestartButtonDownImage); } /* AlertIcon */ - if (readString(pl, entryAlertIcon, &pref->alertIcon, DEFAULT_ALERTICON) == NO) { + if (readString(pl, entryAlertIcon, &pref->alertIcon, DEFAULT_ALERTICON) == False) { return illegalValueMsg(entryAlertIcon); } /* BackgroundColor */ - if (readString(pl, entryBackgroundColor, &pref->backgroundColor, DEFAULT_BACKGROUNDCOLOR) == NO) { + if (readString(pl, entryBackgroundColor, &pref->backgroundColor, DEFAULT_BACKGROUNDCOLOR) == False) { return illegalValueMsg(entryBackgroundColor); } /* PanelPosition */ - if (readPosition(pl, entryPanelPosition, (int**)&pref->panelPosition, DEFAULT_PANELPOSITION_X, DEFAULT_PANELPOSITION_Y) == NO) { + if (readPosition(pl, entryPanelPosition, (int**)&pref->panelPosition, DEFAULT_PANELPOSITION_X, DEFAULT_PANELPOSITION_Y) == False) { return illegalValueMsg(entryPanelPosition); } /* PowerButtonPosition */ - if (readPosition(pl, entryPowerButtonPosition, (int**)&pref->powerButtonPosition, DEFAULT_POWERBUTTONPOSITION_X, DEFAULT_POWERBUTTONPOSITION_Y) == NO) { + if (readPosition(pl, entryPowerButtonPosition, (int**)&pref->powerButtonPosition, DEFAULT_POWERBUTTONPOSITION_X, DEFAULT_POWERBUTTONPOSITION_Y) == False) { return illegalValueMsg(entryPowerButtonPosition); } /* RestartButtonPosition */ - if (readPosition(pl, entryRestartButtonPosition, (int**)&pref->restartButtonPosition, DEFAULT_RESTARTBUTTONPOSITION_X, DEFAULT_RESTARTBUTTONPOSITION_Y) == NO) { + if (readPosition(pl, entryRestartButtonPosition, (int**)&pref->restartButtonPosition, DEFAULT_RESTARTBUTTONPOSITION_X, DEFAULT_RESTARTBUTTONPOSITION_Y) == False) { return illegalValueMsg(entryRestartButtonPosition); } /* MessagePosition */ - if (readPosition(pl, entryMessagePosition, (int**)&pref->messagePosition, DEFAULT_MESSAGEPOSITION_X, DEFAULT_MESSAGEPOSITION_Y) == NO) { + if (readPosition(pl, entryMessagePosition, (int**)&pref->messagePosition, DEFAULT_MESSAGEPOSITION_X, DEFAULT_MESSAGEPOSITION_Y) == False) { return illegalValueMsg(entryMessagePosition); } /* MessageJustification */ - if (readJustification(pl, entryMessageJustification, &pref->messageJustification, DEFAULT_MESSAGEJUSTIFICATION) == NO) { + if (readJustification(pl, entryMessageJustification, &pref->messageJustification, DEFAULT_MESSAGEJUSTIFICATION) == False) { return illegalValueMsg(entryMessageJustification); } /* MessageFont */ - if (readString(pl, entryMessageFont, &pref->messageFont, DEFAULT_MESSAGEFONT) == NO) { + if (readString(pl, entryMessageFont, &pref->messageFont, DEFAULT_MESSAGEFONT) == False) { return illegalValueMsg(entryMessageFont); } /* MessageColor */ - if (readString(pl, entryMessageColor, &pref->messageColor, DEFAULT_MESSAGECOLOR) == NO) { + if (readString(pl, entryMessageColor, &pref->messageColor, DEFAULT_MESSAGECOLOR) == False) { return illegalValueMsg(entryMessageColor); } /* HostnamePosition */ - if (readPosition(pl, entryHostnamePosition, (int**)&pref->hostnamePosition, DEFAULT_HOSTNAMEPOSITION_X, DEFAULT_HOSTNAMEPOSITION_Y) == NO) { + if (readPosition(pl, entryHostnamePosition, (int**)&pref->hostnamePosition, DEFAULT_HOSTNAMEPOSITION_X, DEFAULT_HOSTNAMEPOSITION_Y) == False) { return illegalValueMsg(entryHostnamePosition); } /* HostnameJustification */ - if (readJustification(pl, entryHostnameJustification, &pref->hostnameJustification, DEFAULT_HOSTNAMEJUSTIFICATION) == NO) { + if (readJustification(pl, entryHostnameJustification, &pref->hostnameJustification, DEFAULT_HOSTNAMEJUSTIFICATION) == False) { return illegalValueMsg(entryHostnameJustification); } /* HostnameFont */ - if (readString(pl, entryHostnameFont, &pref->hostnameFont, DEFAULT_HOSTNAMEFONT) == NO) { + if (readString(pl, entryHostnameFont, &pref->hostnameFont, DEFAULT_HOSTNAMEFONT) == False) { return illegalValueMsg(entryHostnameFont); } /* HostnameColor */ - if (readString(pl, entryHostnameColor, &pref->hostnameColor, DEFAULT_HOSTNAMECOLOR) == NO) { + if (readString(pl, entryHostnameColor, &pref->hostnameColor, DEFAULT_HOSTNAMECOLOR) == False) { return illegalValueMsg(entryHostnameColor); } /* InputFont */ - if (readString(pl, entryInputFont, &pref->inputFont, DEFAULT_INPUTFONT) == NO) { + if (readString(pl, entryInputFont, &pref->inputFont, DEFAULT_INPUTFONT) == False) { return illegalValueMsg(entryInputFont); } /* InputFontColor */ - if (readString(pl, entryInputFontColor, &pref->inputFontColor, DEFAULT_INPUTFONTCOLOR) == NO) { + if (readString(pl, entryInputFontColor, &pref->inputFontColor, DEFAULT_INPUTFONTCOLOR) == False) { return illegalValueMsg(entryInputFontColor); } /* InputCursorHeight */ - if (readInteger(pl, entryInputCursorHeight, &pref->inputCursorHeight, DEFAULT_INPUTCURSORHEIGHT) == NO) { + if (readInteger(pl, entryInputCursorHeight, &pref->inputCursorHeight, DEFAULT_INPUTCURSORHEIGHT) == False) { return illegalValueMsg(entryInputCursorHeight); } /* InputUserImage */ - if (readString(pl, entryInputUserImage, &pref->inputUserImage, DEFAULT_INPUTUSERIMAGE) == NO) { + if (readString(pl, entryInputUserImage, &pref->inputUserImage, DEFAULT_INPUTUSERIMAGE) == False) { return illegalValueMsg(entryInputUserImage); } /* InputUserPosition */ - if (readPosition(pl, entryInputUserPosition, (int**)&pref->inputUserPosition, DEFAULT_INPUTUSERPOSITION_X, DEFAULT_INPUTUSERPOSITION_Y) == NO) { + if (readPosition(pl, entryInputUserPosition, (int**)&pref->inputUserPosition, DEFAULT_INPUTUSERPOSITION_X, DEFAULT_INPUTUSERPOSITION_Y) == False) { return illegalValueMsg(entryInputUserPosition); } /* InputPasswordImage */ - if (readString(pl, entryInputPasswordImage, &pref->inputPasswordImage, DEFAULT_INPUTPASSWORDIMAGE) == NO) { + if (readString(pl, entryInputPasswordImage, &pref->inputPasswordImage, DEFAULT_INPUTPASSWORDIMAGE) == False) { return illegalValueMsg(entryInputPasswordImage); } /* InputPasswordPosition */ - if (readPosition(pl, entryInputPasswordPosition, (int**)&pref->inputPasswordPosition, DEFAULT_INPUTPASSWORDPOSITION_X, DEFAULT_INPUTPASSWORDPOSITION_Y) == NO) { + if (readPosition(pl, entryInputPasswordPosition, (int**)&pref->inputPasswordPosition, DEFAULT_INPUTPASSWORDPOSITION_X, DEFAULT_INPUTPASSWORDPOSITION_Y) == False) { return illegalValueMsg(entryInputPasswordPosition); } - /* PLRelease(pl); */ + /* WMReleasePropList(pl); */ return NULL; } -Preferences* readConfiguration(const char* programPath) { +Preferences* readConfiguration(char* programPath) { Preferences* pref; char* path; char* file; - const char* errorMsg; - const char* errorText = "%s\n\nYou can check your configuration with the \"--checkconfig\" option\nPress ENTER to terminate Login.app\n"; + char* errorMsg; + char* errorText = "%s\n\nYou can check your configuration with the \"--checkconfig\" option\nPress ENTER to terminate Login.app\n"; /* Initialize preferences structure */ pref = alloc(sizeof(Preferences)); @@ -471,11 +483,11 @@ return pref; } -void checkConfiguration(const char* programPath) { +void checkConfiguration(char* programPath) { Preferences* pref; - const char* yes = "Yes"; - const char* no = "No"; - const char* errorMsg; + char* yes = "Yes"; + char* no = "No"; + char* errorMsg; char* path; char* file; @@ -509,10 +521,10 @@ } printf("\"\n"); printf(" Theme:\t\t\t\"%s\"\n", pref->theme); - printf(" DisableWelcomeMessage:\t%s\n", pref->disableWelcomeMessage == YES ? yes : no); - printf(" DisableUserShutdown:\t\t%s\n", pref->disableUserShutdown == YES ? yes : no); - printf(" DisableHostname:\t\t%s\n", pref->disableHostname == YES ? yes : no); - printf(" DisableAnimations:\t\t%s\n", pref->disableAnimations == YES ? yes : no); + printf(" DisableWelcomeMessage:\t%s\n", pref->disableWelcomeMessage == True ? yes : no); + printf(" DisableUserShutdown:\t\t%s\n", pref->disableUserShutdown == True ? yes : no); + printf(" DisableHostname:\t\t%s\n", pref->disableHostname == True ? yes : no); + printf(" DisableAnimations:\t\t%s\n", pref->disableAnimations == True ? yes : no); } /* Read theme settings */ diff -Nur Login.app-2.0.0-Alpha-7/preferences.h Login.app-2.0.0-Alpha-7-frog/preferences.h --- Login.app-2.0.0-Alpha-7/preferences.h 2000-07-04 00:03:30.000000000 +0200 +++ Login.app-2.0.0-Alpha-7-frog/preferences.h 2005-12-22 18:11:49.000000000 +0100 @@ -23,7 +23,7 @@ #define PREFERENCES_H #include -#include +#include #include /* File names */ @@ -36,48 +36,56 @@ #define JUSTIFICATION_RIGHT 2 /* Default values */ -#define DEFAULT_WELCOMEMESSAGE "Welcome to LINUX" +#ifdef __FreeBSD__ + #define DEFAULT_WELCOMEMESSAGE "Welcome to FreeBSD" +#else + #ifdef __linux__ + #define DEFAULT_WELCOMEMESSAGE "Welcome to LINUX" + #else + #define DEFAULT_WELCOMEMESSAGE "Welcome" + #endif +#endif #define DEFAULT_POWEROFFMESSAGE "System is shutting down..." #define DEFAULT_RESTARTMESSAGE "System is rebooting..." #define DEFAULT_XSERVER "/usr/X11R6/bin/X" -#define DEFAULT_THEME "Linux" -#define DEFAULT_DISABLEWELCOMEMESSAGE NO -#define DEFAULT_DISABLEUSERSHUTDOWN NO -#define DEFAULT_DISABLEHOSTNAME NO -#define DEFAULT_DISABLEANIMATIONS NO -#define DEFAULT_PANELIMAGE "panel.tiff" -#define DEFAULT_FIELDLABELSIMAGE "fieldlabels.tiff" -#define DEFAULT_POWERBUTTONUPIMAGE "powerbuttonup.tiff" -#define DEFAULT_POWERBUTTONDOWNIMAGE "powerbuttondown.tiff" -#define DEFAULT_RESTARTBUTTONUPIMAGE "restartbuttonup.tiff" -#define DEFAULT_RESTARTBUTTONDOWNIMAGE "restartbuttondown.tiff" -#define DEFAULT_ALERTICON "stop.tiff" -#define DEFAULT_BACKGROUNDCOLOR "None" // Used to be #505075 +#define DEFAULT_THEME "Drone" +#define DEFAULT_DISABLEWELCOMEMESSAGE True +#define DEFAULT_DISABLEUSERSHUTDOWN False +#define DEFAULT_DISABLEHOSTNAME False +#define DEFAULT_DISABLEANIMATIONS False +#define DEFAULT_PANELIMAGE "panel.png" +#define DEFAULT_FIELDLABELSIMAGE "fieldlabels.png" +#define DEFAULT_POWERBUTTONUPIMAGE "powerbuttonup.png" +#define DEFAULT_POWERBUTTONDOWNIMAGE "powerbuttondown.png" +#define DEFAULT_RESTARTBUTTONUPIMAGE "restartbuttonup.png" +#define DEFAULT_RESTARTBUTTONDOWNIMAGE "restartbuttondown.png" +#define DEFAULT_ALERTICON "stop.png" +#define DEFAULT_BACKGROUNDCOLOR "#000000" /* Used to be #505075*/ #define DEFAULT_PANELPOSITION_X 0 -#define DEFAULT_PANELPOSITION_Y -100 -#define DEFAULT_POWERBUTTONPOSITION_X 0 -#define DEFAULT_POWERBUTTONPOSITION_Y 0 -#define DEFAULT_RESTARTBUTTONPOSITION_X 0 -#define DEFAULT_RESTARTBUTTONPOSITION_Y 0 -#define DEFAULT_MESSAGEPOSITION_X 100 -#define DEFAULT_MESSAGEPOSITION_Y 100 +#define DEFAULT_PANELPOSITION_Y 0 +#define DEFAULT_POWERBUTTONPOSITION_X 16 +#define DEFAULT_POWERBUTTONPOSITION_Y 203 +#define DEFAULT_RESTARTBUTTONPOSITION_X 329 +#define DEFAULT_RESTARTBUTTONPOSITION_Y 203 +#define DEFAULT_MESSAGEPOSITION_X 205 +#define DEFAULT_MESSAGEPOSITION_Y 280 #define DEFAULT_MESSAGEJUSTIFICATION JUSTIFICATION_CENTER -#define DEFAULT_MESSAGECOLOR "black" +#define DEFAULT_MESSAGECOLOR "grey20" #define DEFAULT_MESSAGEFONT "-*-utopia-*-*-*-*-18-*-*-*-*-*-*-*" -#define DEFAULT_HOSTNAMEPOSITION_X 100 -#define DEFAULT_HOSTNAMEPOSITION_Y 100 -#define DEFAULT_HOSTNAMEJUSTIFICATION JUSTIFICATION_RIGHT -#define DEFAULT_HOSTNAMECOLOR "grey" +#define DEFAULT_HOSTNAMEPOSITION_X 203 +#define DEFAULT_HOSTNAMEPOSITION_Y 249 +#define DEFAULT_HOSTNAMEJUSTIFICATION JUSTIFICATION_CENTER +#define DEFAULT_HOSTNAMECOLOR "grey30" #define DEFAULT_HOSTNAMEFONT "-*-utopia-*-*-*-*-18-*-*-*-*-*-*-*" #define DEFAULT_INPUTFONT "-*-helvetica-medium-r-*-*-18-*-*-*-*-*-*-*" #define DEFAULT_INPUTFONTCOLOR "black" -#define DEFAULT_INPUTCURSORHEIGHT 20 -#define DEFAULT_INPUTUSERIMAGE "inputfield.tiff" -#define DEFAULT_INPUTUSERPOSITION_X 156 -#define DEFAULT_INPUTUSERPOSITION_Y 120 -#define DEFAULT_INPUTPASSWORDIMAGE "inputfield.tiff" -#define DEFAULT_INPUTPASSWORDPOSITION_X 156 -#define DEFAULT_INPUTPASSWORDPOSITION_Y 154 +#define DEFAULT_INPUTCURSORHEIGHT 19 +#define DEFAULT_INPUTUSERIMAGE "inputfield1.png" +#define DEFAULT_INPUTUSERPOSITION_X 21 +#define DEFAULT_INPUTUSERPOSITION_Y 264 +#define DEFAULT_INPUTPASSWORDIMAGE "inputfield2.png" +#define DEFAULT_INPUTPASSWORDPOSITION_X 207 +#define DEFAULT_INPUTPASSWORDPOSITION_Y 264 typedef struct { @@ -87,10 +95,10 @@ char* powerOffMessage; char** xserver; char* theme; - BOOL disableWelcomeMessage; - BOOL disableUserShutdown; - BOOL disableHostname; - BOOL disableAnimations; + Bool disableWelcomeMessage; + Bool disableUserShutdown; + Bool disableHostname; + Bool disableAnimations; /* Theme settings */ char* panelImage; @@ -122,7 +130,7 @@ } Preferences; -Preferences* readConfiguration(const char* programPath); -void checkConfiguration(const char* programPath); +Preferences* readConfiguration(char* programPath); +void checkConfiguration(char* programPath); #endif diff -Nur Login.app-2.0.0-Alpha-7/resources.c Login.app-2.0.0-Alpha-7-frog/resources.c --- Login.app-2.0.0-Alpha-7/resources.c 2000-11-11 09:45:11.000000000 +0100 +++ Login.app-2.0.0-Alpha-7-frog/resources.c 2005-12-22 18:09:25.000000000 +0100 @@ -29,7 +29,7 @@ #include "config.h" -static RImage* loadImage(const char* appPath, const char* theme, const char* file) { +static RImage* loadImage(char* appPath, char* theme, char* file) { RImage* image; char* themeDir; char* imageFile; @@ -49,7 +49,7 @@ return image; } -Resources* allocResources(Display* dpy, const char* appPath, Preferences* preferences) { +Resources* allocResources(Display* dpy, char* appPath, Preferences* preferences) { Resources* resources; resources = alloc(sizeof(Resources)); @@ -78,7 +78,7 @@ } resources->messageColor = getColorByName(preferences->messageColor); resources->inputFontColor = getColorByName(preferences->inputFontColor); - if (preferences->disableHostname == NO) { + if (preferences->disableHostname == False) { resources->hostnameColor = getColorByName(preferences->hostnameColor); } @@ -93,7 +93,7 @@ "Try to edit your configuration file: ", appPath, "Themes/", preferences->theme, "/Settings"); return 0; } - if (preferences->disableHostname == NO) { + if (preferences->disableHostname == False) { if ((resources->hostnameFont = XLoadQueryFont(dpy, preferences->hostnameFont)) == NULL) { printError("could not load hostname font: %s\n%s%s%s%s%s", preferences->hostnameFont, \ "Try to edit your configuration file: ", appPath, "Themes/", preferences->theme, "/Settings"); @@ -102,10 +102,10 @@ } /* Get hostname */ - if (preferences->disableHostname == NO) { + if (preferences->disableHostname == False) { resources->hostname = alloc(256); if (gethostname(resources->hostname, 255) != 0) { - preferences->disableHostname = YES; + preferences->disableHostname = True; printError("could not get hostname"); } } diff -Nur Login.app-2.0.0-Alpha-7/resources.h Login.app-2.0.0-Alpha-7-frog/resources.h --- Login.app-2.0.0-Alpha-7/resources.h 2000-07-04 00:03:30.000000000 +0200 +++ Login.app-2.0.0-Alpha-7-frog/resources.h 2005-12-22 18:09:25.000000000 +0100 @@ -46,6 +46,6 @@ } Resources; -Resources* allocResources(Display* dpy, const char* appPath, Preferences* preferences); +Resources* allocResources(Display* dpy, char* appPath, Preferences* preferences); #endif diff -Nur Login.app-2.0.0-Alpha-7/switchuser.c Login.app-2.0.0-Alpha-7-frog/switchuser.c --- Login.app-2.0.0-Alpha-7/switchuser.c 2000-11-11 09:37:39.000000000 +0100 +++ Login.app-2.0.0-Alpha-7-frog/switchuser.c 2005-12-22 18:13:20.000000000 +0100 @@ -28,7 +28,7 @@ #ifndef __FreeBSD__ #include #endif -#include +#include #include "util.h" #include "config.h" @@ -36,8 +36,8 @@ extern char **environ; #endif -static char* baseName(const char* name) { - const char *base; +static char* baseName(char* name) { + char *base; base = name; while (*name) { @@ -50,7 +50,7 @@ return (char*) base; } -static void execute(struct passwd *pw, const char* path, const char* script) { +static void execute(struct passwd *pw, char* path, char* script) { char* args[4]; char* shell; char* shell_basename; @@ -72,7 +72,7 @@ execv(shell, args); } -BOOL isPasswordCorrect(char* username, char* password) { +Bool isPasswordCorrect(char* username, char* password) { char* encrypted; char* correct; struct passwd *pw; @@ -83,7 +83,7 @@ pw = getpwnam(username); endpwent(); if (!pw) { - return NO; + return False; } #ifdef SHADOW_PASSWD @@ -97,16 +97,16 @@ correct = pw->pw_passwd; if (correct == 0 || correct[0] == '\0') { - return YES; + return True; } encrypted = crypt(password, correct); memset(password, 0, strlen(password)); if (!strcmp(encrypted, correct)) { - return YES; + return True; } else { - return NO; + return False; } } @@ -125,7 +125,7 @@ /* Set environment */ environ = alloc(sizeof(char*) * 2); environ[0] = 0; - setenv("TERM", "vt100", 0); // TERM=linux? + setenv("TERM", "vt100", 0); /* TERM=linux? */ setenv("HOME", pw->pw_dir, 1); setenv("SHELL", pw->pw_shell, 1); setenv("USER", pw->pw_name, 1); @@ -139,7 +139,7 @@ chdir(pw->pw_dir); } -void switchUser(char* username, const char* path, const char* script) { +void switchUser(char* username, char* path, char* script) { struct passwd* pw; /* Get password struct */ diff -Nur Login.app-2.0.0-Alpha-7/switchuser.h Login.app-2.0.0-Alpha-7-frog/switchuser.h --- Login.app-2.0.0-Alpha-7/switchuser.h 2000-07-04 00:03:30.000000000 +0200 +++ Login.app-2.0.0-Alpha-7-frog/switchuser.h 2005-12-22 18:09:25.000000000 +0100 @@ -22,8 +22,8 @@ #ifndef SWITCHUSER_H #define SWITCHUSER_H -BOOL isPasswordCorrect(char* username, char* password); +Bool isPasswordCorrect(char* username, char* password); void setEnvironment(char* username); -void switchUser(char* username, const char* path, const char* script); +void switchUser(char* username, char* path, char* script); #endif diff -Nur Login.app-2.0.0-Alpha-7/version.h Login.app-2.0.0-Alpha-7-frog/version.h --- Login.app-2.0.0-Alpha-7/version.h 2000-07-04 00:03:30.000000000 +0200 +++ Login.app-2.0.0-Alpha-7-frog/version.h 2005-12-22 18:12:46.000000000 +0100 @@ -22,6 +22,6 @@ #ifndef VERSION_H #define VERSION_H -#define VERSION "2.0.0-Alpha-6" +#define VERSION "2.1.0-Alpha-3" #endif