1999-10-04 15:06:00 -07:00
|
|
|
/*
|
2004-01-19 14:30:35 -08:00
|
|
|
* Copyright (C) 2000-2004 Carsten Haitzler, Geoff Harrison and various contributors
|
2000-04-05 16:22:56 -07:00
|
|
|
*
|
1999-10-04 15:06:00 -07:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to
|
|
|
|
* deal in the Software without restriction, including without limitation the
|
|
|
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
* sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
2000-04-05 16:22:56 -07:00
|
|
|
*
|
1999-10-04 15:06:00 -07:00
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies of the Software, its documentation and marketing & publicity
|
|
|
|
* materials, and acknowledgment shall be given in the documentation, materials
|
|
|
|
* and software packages that this Software was used.
|
2000-04-05 16:22:56 -07:00
|
|
|
*
|
1999-10-04 15:06:00 -07:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
|
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
1999-08-17 15:56:46 -07:00
|
|
|
#include "E.h"
|
2004-03-11 15:44:19 -08:00
|
|
|
#include <time.h>
|
1999-08-17 15:56:46 -07:00
|
|
|
|
2004-12-28 15:46:49 -08:00
|
|
|
Window init_win1 = 0;
|
|
|
|
Window init_win2 = 0;
|
1999-08-17 15:56:46 -07:00
|
|
|
|
|
|
|
void
|
|
|
|
CreateStartupDisplay(char start)
|
|
|
|
{
|
|
|
|
static Window w1, w2, win1, win2, b1, b2;
|
|
|
|
static Background *bg = NULL;
|
2003-05-22 12:15:03 -07:00
|
|
|
static Background *bg_sideways = NULL; /* currently used to determine if the startup screen should slide sideways */
|
1999-08-17 15:56:46 -07:00
|
|
|
static ImageClass *ic = NULL;
|
|
|
|
char pq;
|
|
|
|
|
2004-12-28 15:46:49 -08:00
|
|
|
if (!Conf.startup.animate)
|
|
|
|
return;
|
|
|
|
|
1999-08-17 15:56:46 -07:00
|
|
|
if (start)
|
2000-07-26 11:00:47 -07:00
|
|
|
{
|
2004-12-28 15:46:49 -08:00
|
|
|
bg_sideways = FindItem("STARTUP_BACKGROUND_SIDEWAYS", 0,
|
|
|
|
LIST_FINDBY_NAME, LIST_TYPE_BACKGROUND);
|
|
|
|
ic = ImageclassFind("STARTUP_BAR", 0);
|
2003-05-22 12:15:03 -07:00
|
|
|
if (!ic)
|
2004-12-28 15:46:49 -08:00
|
|
|
ic = ImageclassFind("DESKTOP_DRAGBUTTON_HORIZ", 0);
|
|
|
|
bg =
|
|
|
|
FindItem("STARTUP_BACKGROUND", 0, LIST_FINDBY_NAME,
|
|
|
|
LIST_TYPE_BACKGROUND);
|
2003-05-22 12:15:03 -07:00
|
|
|
if ((!ic) || (!bg))
|
|
|
|
EDBUG_RETURN_;
|
1999-08-17 15:56:46 -07:00
|
|
|
|
2003-05-22 12:15:03 -07:00
|
|
|
if (bg_sideways)
|
|
|
|
{
|
2004-05-04 12:04:42 -07:00
|
|
|
w1 =
|
|
|
|
ECreateWindow(VRoot.win, (VRoot.w / 2), 0, VRoot.w, VRoot.h, 1);
|
|
|
|
w2 =
|
|
|
|
ECreateWindow(VRoot.win, -(VRoot.w / 2), 0, VRoot.w, VRoot.h,
|
|
|
|
1);
|
|
|
|
win1 = ECreateWindow(w1, -(VRoot.w / 2), 0, VRoot.w, VRoot.h, 0);
|
|
|
|
win2 = ECreateWindow(w2, (VRoot.w / 2), 0, VRoot.w, VRoot.h, 0);
|
2003-05-22 12:15:03 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-05-04 12:04:42 -07:00
|
|
|
w1 =
|
|
|
|
ECreateWindow(VRoot.win, 0, -(VRoot.h / 2), VRoot.w, VRoot.h,
|
|
|
|
1);
|
|
|
|
w2 =
|
|
|
|
ECreateWindow(VRoot.win, 0, (VRoot.h / 2), VRoot.w, VRoot.h, 1);
|
|
|
|
win1 = ECreateWindow(w1, 0, (VRoot.h / 2), VRoot.w, VRoot.h, 0);
|
|
|
|
win2 = ECreateWindow(w2, 0, -(VRoot.h / 2), VRoot.w, VRoot.h, 0);
|
2003-05-22 12:15:03 -07:00
|
|
|
}
|
1999-08-23 16:18:33 -07:00
|
|
|
|
2003-05-22 12:15:03 -07:00
|
|
|
EMapWindow(disp, win1);
|
|
|
|
EMapWindow(disp, win2);
|
1999-08-17 15:56:46 -07:00
|
|
|
|
2004-05-04 12:04:42 -07:00
|
|
|
b1 = ECreateWindow(w1, 0, VRoot.h - Conf.desks.dragbar_width, VRoot.w,
|
2004-03-20 07:49:05 -08:00
|
|
|
Conf.desks.dragbar_width, 0);
|
2004-05-04 12:04:42 -07:00
|
|
|
b2 = ECreateWindow(w2, 0, 0, VRoot.w, Conf.desks.dragbar_width, 0);
|
2003-05-22 12:15:03 -07:00
|
|
|
EMapRaised(disp, b1);
|
|
|
|
EMapRaised(disp, b2);
|
1999-08-17 15:56:46 -07:00
|
|
|
|
2004-04-09 05:59:56 -07:00
|
|
|
pq = Mode.queue_up;
|
|
|
|
Mode.queue_up = 0;
|
2004-12-28 15:46:49 -08:00
|
|
|
ImageclassApply(ic, b1, VRoot.w, Conf.desks.dragbar_width, 0, 0, 0, 0,
|
|
|
|
ST_UNKNWN);
|
|
|
|
ImageclassApply(ic, b2, VRoot.w, Conf.desks.dragbar_width, 0, 0, 0, 0,
|
|
|
|
ST_UNKNWN);
|
2004-04-09 05:59:56 -07:00
|
|
|
Mode.queue_up = pq;
|
2004-04-10 12:39:02 -07:00
|
|
|
BackgroundApply(bg, win1, 1);
|
|
|
|
BackgroundApply(bg, win2, 1);
|
2004-04-12 01:28:34 -07:00
|
|
|
BackgroundImagesFree(bg, 1);
|
2003-05-22 12:15:03 -07:00
|
|
|
init_win1 = w1;
|
|
|
|
init_win2 = w2;
|
2003-07-12 02:28:56 -07:00
|
|
|
EMapRaised(disp, w1);
|
|
|
|
EMapRaised(disp, w2);
|
2000-07-26 11:00:47 -07:00
|
|
|
}
|
1999-08-17 15:56:46 -07:00
|
|
|
else
|
2000-07-26 11:00:47 -07:00
|
|
|
{
|
2004-09-11 03:45:21 -07:00
|
|
|
int k, x, y, xOffset, yOffset, ty, fy;
|
1999-08-17 15:56:46 -07:00
|
|
|
|
2003-05-22 12:15:03 -07:00
|
|
|
if ((!ic) || (!bg))
|
|
|
|
EDBUG_RETURN_;
|
1999-08-17 15:56:46 -07:00
|
|
|
|
2003-05-22 12:15:03 -07:00
|
|
|
fy = 0;
|
1999-08-23 16:18:33 -07:00
|
|
|
|
2004-09-11 03:45:21 -07:00
|
|
|
ETimedLoopInit(0, 1024, Conf.slidespeedcleanup / 2);
|
|
|
|
for (k = 0; k <= 1024;)
|
2003-05-22 12:15:03 -07:00
|
|
|
{
|
|
|
|
if (bg_sideways)
|
|
|
|
{ /* so we can have two different slide methods */
|
2004-05-04 12:04:42 -07:00
|
|
|
ty = (VRoot.w / 2);
|
2003-05-22 12:15:03 -07:00
|
|
|
xOffset = ((fy * (1024 - k)) + (ty * k)) >> 10;
|
|
|
|
x = ty;
|
|
|
|
yOffset = 0;
|
|
|
|
y = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-05-04 12:04:42 -07:00
|
|
|
ty = (VRoot.h / 2);
|
2003-05-22 12:15:03 -07:00
|
|
|
xOffset = 0;
|
|
|
|
x = 0;
|
|
|
|
yOffset = ((fy * (1024 - k)) + (ty * k)) >> 10;
|
|
|
|
y = ty;
|
|
|
|
}
|
2004-09-11 03:45:21 -07:00
|
|
|
|
2003-05-22 12:15:03 -07:00
|
|
|
EMoveWindow(disp, w1, x + xOffset, -y - yOffset);
|
|
|
|
EMoveWindow(disp, w2, -x - xOffset, y + yOffset);
|
2004-12-28 15:46:49 -08:00
|
|
|
ecore_x_sync();
|
2004-09-11 03:45:21 -07:00
|
|
|
|
|
|
|
k = ETimedLoopNext();
|
2003-05-22 12:15:03 -07:00
|
|
|
}
|
1999-08-23 16:18:33 -07:00
|
|
|
|
2003-05-22 12:15:03 -07:00
|
|
|
EDestroyWindow(disp, w1);
|
|
|
|
EDestroyWindow(disp, w2);
|
|
|
|
init_win1 = 0;
|
|
|
|
init_win2 = 0;
|
2004-12-28 15:46:49 -08:00
|
|
|
|
|
|
|
BackgroundDestroyByName("STARTUP_BACKGROUND_SIDEWAYS");
|
|
|
|
BackgroundDestroyByName("STARTUP_BACKGROUND");
|
2000-07-26 11:00:47 -07:00
|
|
|
}
|
1999-08-17 15:56:46 -07:00
|
|
|
EDBUG_RETURN_;
|
|
|
|
}
|