nice new about box... fully themable. :)

SVN revision: 16782
This commit is contained in:
Carsten Haitzler 2005-09-20 08:34:23 +00:00
parent b56a8b947b
commit 0e96fd5484
24 changed files with 844 additions and 35 deletions

View File

@ -8,3 +8,6 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \
bin_SCRIPTS = enlightenment-config
EXTRA_DIST = README AUTHORS COPYING COPYING-PLAIN enlightenment.spec
filesdir = $(datadir)/enlightenment/
files_DATA = AUTHORS COPYING

View File

@ -34,7 +34,8 @@ default_transitions.edc \
default_dialog.edc \
default_icons.edc \
default_pointer.edc \
default_randr.edc
default_randr.edc \
default_about.edc
default.edj: Makefile $(EXTRA_DIST)
$(EDJE_CC) $(EDJE_FLAGS) \

View File

@ -44,5 +44,6 @@ collections {
#include "default_icons.edc"
#include "default_randr.edc"
#include "default_pointer.edc"
#include "default_about.edc"
}

View File

@ -0,0 +1,598 @@
images {
image: "e17_menu_bg_border.png" COMP;
image: "e17_button2.png" COMP;
image: "e17_button.png" COMP;
image: "e17_dialog_watermark.png" COMP;
image: "e17_about_bg_v.png" COMP;
image: "e17_about_over_v.png" COMP;
image: "e17_logo.png" COMP;
image: "e17_about_sky0.png" LOSSY 70;
image: "e17_about_sky1.png" LOSSY 70;
image: "e17_about_sky2.png" LOSSY 70;
image: "e17_about_sky3.png" LOSSY 70;
image: "e17_about_sky4.png" LOSSY 70;
image: "e17_about_sky_overlay.png" COMP;
}
styles
{
style {
name: "about_style";
base: "font=Edje-Vera font_size=10 align=center color=#000 style=shadow shadow_color=#ffffff80 wrap=word";
tag: "br" "\n";
tag: "hilight" "+ font=Edje-Vera-Bold style=glow color=#fff glow2_color=#fe87 glow_color=#fa14";
tag: "title" "+ font_size=12 font=Edje-Vera-Bold style=glow color=#fff glow2_color=#0003 glow_color=#0002";
tag: "/title" "- \n \n";
}
}
group {
name: "widgets/about/main";
parts {
part {
name: "base";
mouse_events: 0;
type: RECT;
description {
state: "default" 0.0;
rel1 {
relative: 0.0 0.0;
offset: 1 1;
}
rel2 {
relative: 1.0 1.0;
offset: -2 -2;
}
color: 221 221 221 255;
}
}
part {
name: "sky";
mouse_events: 0;
description {
state: "default" 0.0;
min: 400 160;
max: 400 160;
align: 0.5 1.0;
fixed: 1 1;
rel1 {
relative: 0.0 1.0;
offset: 7 -1;
}
rel2 {
relative: 1.0 1.0;
offset: -8 -1;
}
image {
normal: "e17_about_sky0.png";
}
}
}
part {
name: "sky1";
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
to: "sky";
}
rel2 {
to: "sky";
}
image {
normal: "e17_about_sky1.png";
}
fill {
smooth: 0;
size {
relative: 1.1075 1.0;
}
}
}
description {
state: "drift" 0.0;
inherit: "default" 0.0;
fill {
origin {
relative: -1.1075 0.0;
}
}
}
}
part {
name: "sky4";
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
to: "sky";
}
rel2 {
to: "sky";
}
image {
normal: "e17_about_sky4.png";
}
fill {
smooth: 0;
size {
relative: 1.12 1.0;
}
}
}
description {
state: "drift" 0.0;
inherit: "default" 0.0;
fill {
origin {
relative: -1.12 0.0;
}
}
}
}
part {
name: "sky2";
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
to: "sky";
}
rel2 {
to: "sky";
}
image {
normal: "e17_about_sky2.png";
}
fill {
smooth: 0;
size {
relative: 1.1765 1.0;
}
}
}
description {
state: "drift" 0.0;
inherit: "default" 0.0;
fill {
origin {
relative: -1.1765 0.0;
}
}
}
}
part {
name: "sky3";
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
to: "sky";
}
rel2 {
to: "sky";
}
image {
normal: "e17_about_sky3.png";
}
fill {
smooth: 0;
size {
relative: 2.1325 1.0;
}
}
}
description {
state: "drift" 0.0;
inherit: "default" 0.0;
fill {
origin {
relative: -2.1325 0.0;
}
}
}
}
part {
name: "sky_over";
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
to: "sky";
}
rel2 {
to: "sky";
}
image {
normal: "e17_about_sky_overlay.png";
}
}
}
part {
name: "about_bg";
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
to: "about";
offset: -7 -7;
}
rel2 {
to: "about";
offset: 6 6;
}
image {
normal: "e17_about_bg_v.png";
border: 7 7 7 7;
}
}
}
part {
name: "authors_bg";
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
to: "authors";
offset: -7 -7;
}
rel2 {
to: "authors";
offset: 6 6;
}
image {
normal: "e17_about_bg_v.png";
border: 7 7 7 7;
}
}
}
part {
name: "base2";
mouse_events: 0;
description {
state: "default" 0.0;
min: 200 138;
max: 200 138;
align: 1.0 1.0;
fixed: 1 1;
rel1 {
relative: 1.0 1.0;
offset: -1 -1;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
image {
normal: "e17_dialog_watermark.png";
}
}
}
part {
name: "base3";
mouse_events: 0;
description {
state: "default" 0.0;
image {
normal: "e17_menu_bg_border.png";
border: 1 1 1 1;
middle: 0;
}
fill {
smooth: 0;
}
}
}
part {
name: "about";
type: TEXTBLOCK;
mouse_events: 0;
description {
state: "default" 0.0;
max: 200 1000;
min: 200 0;
rel1 {
to_y: "logo";
relative: 0.0 1.0;
offset: 8 8;
}
rel2 {
to_y: "sky";
relative: 0.5 0.4;
offset: -9 -9;
}
text {
style: "about_style";
min: 0 1;
}
}
}
part {
name: "authors";
type: TEXTBLOCK;
mouse_events: 0;
description {
state: "default" 0.0;
max: 1000 1000;
min: 200 0;
rel1 {
to_y: "logo";
relative: 0.5 1.0;
offset: 8 8;
}
rel2 {
to_y: "sky";
relative: 1.0 0.4;
offset: -9 -9;
}
text {
style: "about_style";
min: 1 1;
}
}
}
part {
name: "about_over";
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
to: "about_bg";
}
rel2 {
to: "about_bg";
}
image {
normal: "e17_about_over_v.png";
border: 13 13 13 13;
}
}
}
part {
name: "authors_over";
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
to: "authors_bg";
}
rel2 {
to: "authors_bg";
}
image {
normal: "e17_about_over_v.png";
border: 13 13 13 13;
}
}
}
part {
name: "title";
type: TEXT;
effect: SOFT_SHADOW;
mouse_events: 0;
description {
state: "default" 0.0;
fixed: 0 1;
align: 0.5 0.0;
rel1 {
to_y: "logo";
relative: 0.0 0.0;
offset: 6 0;
}
rel2 {
to_y: "logo";
relative: 1.0 0.0;
offset: -7 6;
}
color: 255 255 255 255;
color3: 0 0 0 32;
text {
text: "Enlightenment";
font: "Edje-Vera-Bold";
size: 16;
min: 1 1;
align: 0.5 0.5;
}
}
}
part {
name: "version";
type: TEXT;
effect: SOFT_SHADOW;
mouse_events: 0;
description {
state: "default" 0.0;
fixed: 0 1;
align: 0.5 0.0;
rel1 {
to: "title";
relative: 0.0 1.0;
offset: 6 2;
}
rel2 {
to: "title";
relative: 1.0 1.0;
offset: -7 2;
}
color: 255 255 255 255;
color3: 0 0 0 32;
text {
text: "0.17.0.000";
font: "Edje-Vera-Bold";
size: 12;
min: 1 1;
align: 0.5 0.5;
}
}
}
part {
name: "logo";
type: IMAGE;
mouse_events: 0;
description {
state: "default" 0.0;
min: 63 63;
max: 63 63;
align: 0.0 0.0;
fixed: 1 1;
rel1 {
relative: 0.0 0.0;
offset: 8 8;
}
rel2 {
relative: 0.5 0.0;
offset: 8 8;
}
image {
normal: "e17_logo.png";
}
}
}
part {
name: "button";
type: IMAGE;
mouse_events: 1;
description {
state: "default" 0.0;
min: 64 32;
align: 0.5 1.0;
fixed: 1 1;
rel1 {
relative: 0.5 1.0;
offset: 0 -7;
}
rel2 {
relative: 0.5 1.0;
offset: 0 -7;
}
image {
normal: "e17_button.png";
border: 8 8 8 8;
}
}
description {
state: "clicked" 0.0;
inherit: "default" 0.0;
image {
normal: "e17_button2.png";
}
}
}
part {
name: "button_text";
type: TEXT;
effect: SHADOW;
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
relative: 0.0 0.0;
offset: 6 6;
to: "button";
}
rel2 {
relative: 1.0 1.0;
offset: -7 -7;
to: "button";
}
color: 0 0 0 255;
color3: 255 255 255 128;
text {
text: "OK";
font: "Edje-Vera";
size: 10;
min: 1 1;
align: 0.5 0.5;
}
}
}
}
programs {
program {
name: "button_click";
signal: "mouse,down,1";
source: "button";
action: STATE_SET "clicked" 0.0;
target: "button";
}
program {
name: "button_unclick";
signal: "mouse,up,1";
source: "button";
action: STATE_SET "default" 0.0;
target: "button";
}
program {
name: "button_unclick2";
signal: "mouse,clicked,1";
source: "button";
action: SIGNAL_EMIT "close" "";
}
program {
name: "anim_sky1a";
signal: "show";
source: "";
action: STATE_SET "drift" 0.0;
transition: LINEAR 20.0;
target: "sky1";
after: "anim_sky1b";
}
program {
name: "anim_sky1b";
action: STATE_SET "default" 0.0;
target: "sky1";
after: "anim_sky1a";
}
program {
name: "anim_sky4a";
signal: "show";
source: "";
action: STATE_SET "drift" 0.0;
transition: LINEAR 15.0;
target: "sky4";
after: "anim_sky4b";
}
program {
name: "anim_sky4b";
action: STATE_SET "default" 0.0;
target: "sky4";
after: "anim_sky4a";
}
program {
name: "anim_sky2a";
signal: "show";
source: "";
action: STATE_SET "drift" 0.0;
transition: LINEAR 15.0;
target: "sky2";
after: "anim_sky2b";
}
program {
name: "anim_sky2b";
action: STATE_SET "default" 0.0;
target: "sky2";
after: "anim_sky2a";
}
program {
name: "anim_sky3a";
signal: "show";
source: "";
action: STATE_SET "drift" 0.0;
transition: LINEAR 15.0;
target: "sky3";
after: "anim_sky3b";
}
program {
name: "anim_sky3b";
action: STATE_SET "default" 0.0;
target: "sky3";
after: "anim_sky3a";
}
}
}

View File

@ -1,5 +1,6 @@
images {
image: "e17_menu_bg.png" COMP;
image: "e17_menu_bg_border.png" COMP;
// image: "e17_menu_bg.png" COMP;
// image: "e17_winlist_top.png" COMP;
image: "e17_winlist_bottom.png" COMP;
image: "e17_button2.png" COMP;
@ -47,6 +48,7 @@ group {
min: 200 138;
max: 200 138;
align: 1.0 1.0;
fixed: 1 1;
rel1 {
relative: 1.0 1.0;
offset: -1 -1;

View File

@ -48,6 +48,9 @@ group {
description {
state: "vert" 0.0;
inherit: "default" 0.0;
image {
normal: "e17_ibar_bg_v.png";
}
}
}
part {

View File

@ -313,4 +313,12 @@ e17_icon_windows.png \
e17_icon_lost_windows.png \
e17_pointer.png \
e17_pointer_mono.png \
e17_dialog_watermark.png
e17_dialog_watermark.png \
e17_about_bg_v.png \
e17_about_over_v.png \
e17_about_sky0.png \
e17_about_sky1.png \
e17_about_sky2.png \
e17_about_sky3.png \
e17_about_sky4.png \
e17_about_sky_overlay.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 971 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@ -70,7 +70,8 @@ e_remember.h \
e_win.h \
e_pan.h \
e_dialog.h \
e_configure.h
e_configure.h \
e_about.h
enlightenment_SOURCES = \
e_main.c \
@ -129,6 +130,7 @@ e_win.c \
e_pan.c \
e_dialog.c \
e_configure.c \
e_about.c \
$(ENLIGHTENMENTHEADERS)
enlightenment_LDFLAGS = -export-dynamic @e_libs@ @x_libs@ @dlopen_libs@ @cf_libs@

167
src/bin/e_about.c Normal file
View File

@ -0,0 +1,167 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
/* local subsystem functions */
static void _e_about_free(E_About *about);
static void _e_about_cb_delete(E_Win *win);
static void _e_dialog_cb_close(void *data, Evas_Object *obj, const char *emission, const char *source);
/* local subsystem globals */
/* externally accessible functions */
E_About *
e_about_new(E_Container *con)
{
E_About *about;
E_Manager *man;
Evas_Object *o;
if (!con)
{
man = e_manager_current_get();
if (!man) return NULL;
con = e_container_current_get(man);
if (!con) con = e_container_number_get(man, 0);
if (!con) return NULL;
}
about = E_OBJECT_ALLOC(E_About, E_ABOUT_TYPE, _e_about_free);
if (!about) return NULL;
about->win = e_win_new(con);
if (!about->win)
{
free(about);
return NULL;
}
e_win_delete_callback_set(about->win, _e_about_cb_delete);
about->win->data = about;
e_win_name_class_set(about->win, "E", "_about");
e_win_title_set(about->win, _("About Enlightenment"));
o = edje_object_add(e_win_evas_get(about->win));
about->bg_object = o;
e_theme_edje_object_set(o, "base/theme/about",
"widgets/about/main");
evas_object_move(o, 0, 0);
evas_object_show(o);
edje_object_part_text_set(about->bg_object, "title", _("Enlightenment"));
edje_object_part_text_set(about->bg_object, "version", VERSION);
edje_object_part_text_set
(about->bg_object, "about",
_(
"Copyright © 1999-2005, by the Enlightenment Dev Team.<br>"
"<br>"
"We hope you enjoy using this software as much as we enjoyed writing it.<br>"
"<br>"
"Please think of the aardvarks. They need some love too."
)
);
edje_object_signal_callback_add(about->bg_object, "close", "",
_e_dialog_cb_close, about);
{
FILE *f;
char buf[4096], buf2[4096], *tbuf;
snprintf(buf, sizeof(buf), "%s/AUTHORS", e_prefix_data_get());
f = fopen(buf, "r");
if (f)
{
tbuf = strdup(_("<title>Authors</title>"));
while (fgets(buf, sizeof(buf), f))
{
int len;
len = strlen(buf);
if (len > 0)
{
if (buf[len - 1] == '\n')
{
buf[len - 1] = 0;
len--;
}
if (len > 0)
{
char *p;
do
{
p = strchr(buf, '<');
if (p) *p = 0;
}
while (p);
do
{
p = strchr(buf, '>');
if (p) *p = 0;
}
while (p);
snprintf(buf2, sizeof(buf2), "%s<br>", buf);
tbuf = realloc(tbuf, strlen(tbuf) + strlen(buf2) + 1);
strcat(tbuf, buf2);
}
}
}
fclose(f);
if (tbuf)
{
edje_object_part_text_set(about->bg_object, "authors", tbuf);
free(tbuf);
}
}
}
e_win_centered_set(about->win, 1);
return about;
}
void
e_about_show(E_About *about)
{
Evas_Coord w, h, mw, mh;
edje_object_size_min_get(about->bg_object, &w, &h);
edje_object_size_min_calc(about->bg_object, &mw, &mh);
if (w > mw) mw = w;
if (h > mh) mh = h;
evas_object_resize(about->bg_object, mw, mh);
e_win_resize(about->win, mw, mh);
e_win_size_min_set(about->win, mw, mh);
edje_object_size_max_get(about->bg_object, &w, &h);
if ((w > 0) && (h > 0))
{
if (w < mw) w = mw;
if (h < mh) h = mh;
e_win_size_max_set(about->win, mw, mh);
}
e_win_show(about->win);
}
/* local subsystem functions */
static void
_e_about_free(E_About *about)
{
if (about->bg_object) evas_object_del(about->bg_object);
e_object_del(E_OBJECT(about->win));
free(about);
}
static void
_e_about_cb_delete(E_Win *win)
{
E_About *about;
about = win->data;
e_object_del(E_OBJECT(about));
}
static void
_e_dialog_cb_close(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_About *about;
about = data;
e_object_del(E_OBJECT(about));
}

27
src/bin/e_about.h Normal file
View File

@ -0,0 +1,27 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
typedef struct _E_About E_About;
#else
#ifndef E_ABOUT_H
#define E_ABOUT_H
#define E_ABOUT_TYPE 0xE0b01013
struct _E_About
{
E_Object e_obj_inherit;
E_Win *win;
Evas_Object *bg_object;
void *data;
};
EAPI E_About *e_about_new (E_Container *con);
EAPI void e_about_show (E_About *about);
#endif
#endif

View File

@ -1,18 +1,5 @@
#include "e.h"
typedef struct E_Configure
{
E_Container *con;
E_Win *win;
Evas *evas;
Evas_Object *edje;
Evas_Object *box;
E_App *apps;
Evas_List *icons;
Evas_List *app_ref;
} E_Configure;
static void _e_configure_gui_show(E_Configure *app);
static void _e_configure_gui_hide(E_Win *win);
static void _e_configure_apps_load(E_Configure *app);
@ -20,18 +7,14 @@ static void _e_configure_apps_unload(E_Configure *app);
static void _e_configure_apps_click(void *data, Evas_Object *obj, const char *emission, const char *source);
E_Path *path_themes;
E_Configure *
e_configure_show(E_Container *con)
{
E_Configure *app;
app = malloc(sizeof(E_Configure));
app = calloc(1, sizeof(E_Configure));
app->con = con;
_e_configure_gui_show(app);
return app;
}
@ -122,6 +105,7 @@ _e_configure_apps_load(E_Configure *app)
Evas_Object *o, *icon;
Evas_Coord w, h;
if (!app->apps) return;
e_app_subdir_scan(app->apps, 0);
for (l = app->apps->subapps; l; l = l->next)
{
@ -172,7 +156,7 @@ _e_configure_apps_unload(E_Configure *app)
app->icons = evas_list_remove(app->icons, icon);
evas_object_free(icon);
}*/
while(app->app_ref)
while (app->app_ref)
{
a = evas_list_data(app->app_ref);

View File

@ -1,7 +1,21 @@
#ifdef E_TYPEDEFS
#ifndef E_WIN_H
#define E_WIN_H
typedef struct _E_Configure E_Configure;
#ifndef E_CONFIGURE_H
#define E_CONFIGURE_H
struct _E_Configure
{
E_Container *con;
E_Win *win;
Evas *evas;
Evas_Object *edje;
Evas_Object *box;
E_App *apps;
Evas_List *icons;
Evas_List *app_ref;
};
E_Configure *e_configure_show(E_Container *con);

View File

@ -19,7 +19,7 @@ struct _E_Dialog_Button
static void _e_dialog_free(E_Dialog *dia);
static void _e_dialog_cb_button_clicked(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _e_dialog_cb_delete(E_Win *win);
/* local subsystem globals */
/* externally accessible functions */
@ -47,6 +47,7 @@ e_dialog_new(E_Container *con)
free(dia);
return NULL;
}
e_win_delete_callback_set(dia->win, _e_dialog_cb_delete);
dia->win->data = dia;
e_win_name_class_set(dia->win, "E", "_dialog");
o = edje_object_add(e_win_evas_get(dia->win));

View File

@ -56,3 +56,5 @@
#include "e_win.h"
#include "e_pan.h"
#include "e_dialog.h"
#include "e_configure.h"
#include "e_about.h"

View File

@ -352,14 +352,10 @@ _e_int_menus_main_del_hook(void *obj)
static void
_e_int_menus_main_about(void *data, E_Menu *m, E_Menu_Item *mi)
{
e_error_dialog_show(_("About Enlightenment"),
_("This is Enlightenment %s.\n"
"Copyright © 1999-2005, by the Enlightenment Dev Team.\n"
"\n"
"We hope you enjoy using this software as much as we enjoyed writing it.\n\n"
"Please think of the aardvarks. They need some love too."),
VERSION
);
E_About *about;
about = e_about_new(e_container_current_get(e_manager_current_get()));
if (about) e_about_show(about);
}
static void

View File

@ -304,7 +304,7 @@ _e_test_internal(E_Container *con)
e_dialog_button_add(dia, "OK", NULL, NULL, NULL);
e_dialog_button_add(dia, "Apply", "enlightenment/reset", NULL, NULL);
e_dialog_button_add(dia, "Cancel", "enlightenment/exit", NULL, NULL);
e_win_centered_set(dia->win);
e_win_centered_set(dia->win, 1);
e_dialog_show(dia);
}
#elif 0