elementary becomes its own tree/lib/test binary

SVN revision: 36343
devs/felipealmeida/promises
Carsten Haitzler 15 years ago
commit 51123a3452
  1. 1
      legacy/elementary/AUTHORS
  2. 1
      legacy/elementary/COPYING
  3. 0
      legacy/elementary/ChangeLog
  4. 14
      legacy/elementary/INSTALL
  5. 14
      legacy/elementary/Makefile.am
  6. 0
      legacy/elementary/NEWS
  7. 1
      legacy/elementary/README
  8. 19
      legacy/elementary/autogen.sh
  9. 57
      legacy/elementary/configure.in
  10. 3
      legacy/elementary/data/.cvsignore
  11. 3
      legacy/elementary/data/Makefile.am
  12. 68
      legacy/elementary/data/themes/Makefile.am
  13. BIN
      legacy/elementary/data/themes/arrow_down.png
  14. BIN
      legacy/elementary/data/themes/arrow_down.xcf.gz
  15. BIN
      legacy/elementary/data/themes/arrow_up.png
  16. BIN
      legacy/elementary/data/themes/arrow_up.xcf.gz
  17. BIN
      legacy/elementary/data/themes/bt_base1.png
  18. BIN
      legacy/elementary/data/themes/bt_base2.png
  19. BIN
      legacy/elementary/data/themes/bt_bases.png
  20. BIN
      legacy/elementary/data/themes/bt_basew.png
  21. BIN
      legacy/elementary/data/themes/bt_hilight.png
  22. BIN
      legacy/elementary/data/themes/bt_hilightw.png
  23. BIN
      legacy/elementary/data/themes/bt_shine.png
  24. BIN
      legacy/elementary/data/themes/bt_sm_base1.png
  25. BIN
      legacy/elementary/data/themes/bt_sm_base2.png
  26. BIN
      legacy/elementary/data/themes/bt_sm_hilight.png
  27. BIN
      legacy/elementary/data/themes/bt_sm_shine.png
  28. 2121
      legacy/elementary/data/themes/default.edc
  29. BIN
      legacy/elementary/data/themes/dia_botshad.png
  30. BIN
      legacy/elementary/data/themes/dia_grad.png
  31. BIN
      legacy/elementary/data/themes/dia_topshad.png
  32. BIN
      legacy/elementary/data/themes/flip.xcf.gz
  33. BIN
      legacy/elementary/data/themes/flip_0b.png
  34. BIN
      legacy/elementary/data/themes/flip_0t.png
  35. BIN
      legacy/elementary/data/themes/flip_1b.png
  36. BIN
      legacy/elementary/data/themes/flip_1t.png
  37. BIN
      legacy/elementary/data/themes/flip_2b.png
  38. BIN
      legacy/elementary/data/themes/flip_2t.png
  39. BIN
      legacy/elementary/data/themes/flip_3b.png
  40. BIN
      legacy/elementary/data/themes/flip_3t.png
  41. BIN
      legacy/elementary/data/themes/flip_4b.png
  42. BIN
      legacy/elementary/data/themes/flip_4t.png
  43. BIN
      legacy/elementary/data/themes/flip_5b.png
  44. BIN
      legacy/elementary/data/themes/flip_5t.png
  45. BIN
      legacy/elementary/data/themes/flip_6b.png
  46. BIN
      legacy/elementary/data/themes/flip_6t.png
  47. BIN
      legacy/elementary/data/themes/flip_7b.png
  48. BIN
      legacy/elementary/data/themes/flip_7t.png
  49. BIN
      legacy/elementary/data/themes/flip_8b.png
  50. BIN
      legacy/elementary/data/themes/flip_8t.png
  51. BIN
      legacy/elementary/data/themes/flip_9b.png
  52. BIN
      legacy/elementary/data/themes/flip_9t.png
  53. BIN
      legacy/elementary/data/themes/flip_amb.png
  54. BIN
      legacy/elementary/data/themes/flip_amt.png
  55. BIN
      legacy/elementary/data/themes/flip_base.png
  56. BIN
      legacy/elementary/data/themes/flip_base_shad.png
  57. BIN
      legacy/elementary/data/themes/flip_pmb.png
  58. BIN
      legacy/elementary/data/themes/flip_pmt.png
  59. BIN
      legacy/elementary/data/themes/flip_shad.png
  60. BIN
      legacy/elementary/data/themes/frame_1.png
  61. BIN
      legacy/elementary/data/themes/frame_2.png
  62. BIN
      legacy/elementary/data/themes/sb_runnerh.png
  63. BIN
      legacy/elementary/data/themes/sb_runnerv.png
  64. BIN
      legacy/elementary/data/themes/shelf_inset.png
  65. BIN
      legacy/elementary/data/themes/tog_base.png
  66. 11
      legacy/elementary/elementary.pc.in
  67. 2
      legacy/elementary/src/.cvsignore
  68. 4
      legacy/elementary/src/Makefile.am
  69. 7
      legacy/elementary/src/bin/.cvsignore
  70. 17
      legacy/elementary/src/bin/Makefile.am
  71. 999
      legacy/elementary/src/bin/test.c
  72. 553
      legacy/elementary/src/lib/Elementary.h
  73. 54
      legacy/elementary/src/lib/Makefile.am
  74. 99
      legacy/elementary/src/lib/elm_bg.c
  75. 131
      legacy/elementary/src/lib/elm_box.c
  76. 170
      legacy/elementary/src/lib/elm_button.c
  77. 58
      legacy/elementary/src/lib/elm_callback.c
  78. 393
      legacy/elementary/src/lib/elm_clock.c
  79. 138
      legacy/elementary/src/lib/elm_frame.c
  80. 103
      legacy/elementary/src/lib/elm_icon.c
  81. 68
      legacy/elementary/src/lib/elm_label.c
  82. 79
      legacy/elementary/src/lib/elm_main.c
  83. 177
      legacy/elementary/src/lib/elm_obj.c
  84. 116
      legacy/elementary/src/lib/elm_pad.c
  85. 64
      legacy/elementary/src/lib/elm_priv.h
  86. 99
      legacy/elementary/src/lib/elm_scroller.c
  87. 104
      legacy/elementary/src/lib/elm_table.c
  88. 13
      legacy/elementary/src/lib/elm_theme.c
  89. 210
      legacy/elementary/src/lib/elm_toggle.c
  90. 137
      legacy/elementary/src/lib/elm_widget.c
  91. 307
      legacy/elementary/src/lib/elm_win.c
  92. 712
      legacy/elementary/src/lib/els_box.c
  93. 14
      legacy/elementary/src/lib/els_box.h
  94. 364
      legacy/elementary/src/lib/els_icon.c
  95. 10
      legacy/elementary/src/lib/els_icon.h
  96. 270
      legacy/elementary/src/lib/els_pan.c
  97. 7
      legacy/elementary/src/lib/els_pan.h
  98. 1052
      legacy/elementary/src/lib/els_scroller.c
  99. 25
      legacy/elementary/src/lib/els_scroller.h
  100. 953
      legacy/elementary/src/lib/els_table.c
  101. Some files were not shown because too many files have changed in this diff Show More

@ -0,0 +1 @@
The Rasterman (Carsten Haitzler) <raster@rasterman.com>

@ -0,0 +1,14 @@
COMPILING and INSTALLING:
If you got a official release tar archive do:
./configure
( otherwise if you got this from enlightenment cvs do: ./autogen.sh )
Then to compile:
make
To install (run this as root, or the user who handles installs):
make install
NOTE: You MUST make install Rage for it to run properly.

@ -0,0 +1,14 @@
SUBDIRS = src data
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \
config.h.in config.sub configure install-sh \
ltconfig ltmain.sh missing mkinstalldirs \
stamp-h.in acconfig.h depcomp
EXTRA_DIST = README AUTHORS COPYING autogen.sh eet.pc.in
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = elementary.pc
installed_headersdir = $(prefix)/include/elementary
installed_headers_DATA = elementary_config.h

@ -0,0 +1,19 @@
#!/bin/sh
rm -rf autom4te.cache
rm -f aclocal.m4 ltmain.sh
rm -rf m4
mkdir m4
touch README
echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1
echo "Running autoheader..." ; autoheader || exit 1
echo "Running autoconf..." ; autoconf || exit 1
echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1
echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1
if [ -z "$NOCONFIGURE" ]; then
./configure "$@"
fi

@ -0,0 +1,57 @@
# get rid of that stupid cache mechanism
rm -f config.cache
AC_INIT(elementary, 0.1.0.0, enlightenment-devel@lists.sourceforge.net)
AC_PREREQ(2.52)
AC_CONFIG_SRCDIR(configure.in)
AM_INIT_AUTOMAKE(1.6 dist-bzip2)
AM_CONFIG_HEADER(elementary_config.h)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_C_BIGENDIAN
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_C_CONST
AC_LIBTOOL_WIN32_DLL
define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
AC_PROG_LIBTOOL
VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
VMIC=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $3);}'`
SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
AC_SUBST(version_info)
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([ELEMENTARY], [
eet
evas
ecore
ecore-x
ecore-evas
ecore-job
ecore-txt
ecore-file
edje
edbus
])
my_libs="-lm"
AC_SUBST(my_libs)
AC_OUTPUT([
Makefile
elementary.pc
src/Makefile
src/lib/Makefile
src/bin/Makefile
data/Makefile
data/themes/Makefile
])

@ -0,0 +1,3 @@
Makefile
Makefile.in
default.edj

@ -0,0 +1,3 @@
AUTOMAKE_OPTIONS = 1.4 foreign
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = themes

@ -0,0 +1,68 @@
AUTOMAKE_OPTIONS = 1.4 foreign
MAINTAINERCLEANFILES = Makefile.in
EDJE_CC = edje_cc
EDJE_FLAGS = -v -id $(top_srcdir)/data/themes -fd $(top_srcdir)/data/themes
filesdir = $(datadir)/elementary/themes
files_DATA = default.edj
EXTRA_DIST = \
default.edc \
arrow_down.png \
arrow_up.png \
bt_base1.png \
bt_base2.png \
bt_bases.png \
bt_basew.png \
bt_hilight.png \
bt_hilightw.png \
bt_shine.png \
bt_sm_base1.png \
bt_sm_base2.png \
bt_sm_hilight.png \
bt_sm_shine.png \
dia_botshad.png \
dia_grad.png \
dia_topshad.png \
frame_1.png \
frame_2.png \
flip_0b.png \
flip_0t.png \
flip_1b.png \
flip_1t.png \
flip_2b.png \
flip_2t.png \
flip_3b.png \
flip_3t.png \
flip_4b.png \
flip_4t.png \
flip_5b.png \
flip_5t.png \
flip_6b.png \
flip_6t.png \
flip_7b.png \
flip_7t.png \
flip_8b.png \
flip_8t.png \
flip_9b.png \
flip_9t.png \
flip_amb.png \
flip_amt.png \
flip_base.png \
flip_base_shad.png \
flip_pmb.png \
flip_pmt.png \
flip_shad.png \
sb_runnerh.png \
sb_runnerv.png \
shelf_inset.png \
tog_base.png
default.edj: Makefile $(EXTRA_DIST)
$(EDJE_CC) $(EDJE_FLAGS) \
$(top_srcdir)/data/themes/default.edc \
$(top_builddir)/data/themes/default.edj
clean-local:
rm -f *.edj

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 705 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: eet
Description: Library for speedy data storage, retrieval, and compression
Version: @VERSION@
Libs: -L${libdir} -lelementary
Libs.private: @my_libs@ @ELEMENTARY_LIBS@
Cflags: -I${includedir} -I${includedir}/elementary

@ -0,0 +1,2 @@
Makefile
Makefile.in

@ -0,0 +1,4 @@
AUTOMAKE_OPTIONS = 1.4 foreign
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = lib bin

@ -0,0 +1,7 @@
.deps
.libs
Makefile
Makefile.in
rage
raged
rage_thumb

@ -0,0 +1,17 @@
AUTOMAKE_OPTIONS = 1.4 foreign
MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/src/lib \
-I$(top_srcdir)/src/bin \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
@ELEMENTARY_CFLAGS@
bin_PROGRAMS = elementary_test
elementary_test_SOURCES = test.c
elementary_test_LDADD = $(top_builddir)/src/lib/libelementary.la
elementary_test_LDFLAGS =
elementary_test_DEPENDENCIES = $(top_builddir)/src/lib/libelementary.la

@ -0,0 +1,999 @@
#include <Elementary.h>
/* This is a test app (that is also functional) to test the api and serve
* as an example
*/
static void
on_win_resize(void *data, Elm_Win *win, Elm_Cb_Type type, void *info)
{
/* window is resized */
printf("resize to: %ix%i\n", win->w, win->h);
}
static void
on_win_del_req(void *data, Elm_Win *win, Elm_Cb_Type type, void *info)
{
/* because autodel is on - after this callback the window will be deleted */
/* but to be explicit - exit the app when window is closed */
elm_exit();
}
static void
win_bg_simple(void)
{
Elm_Win *win;
Elm_Bg *bg;
win = elm_win_new(); /* create a window */
win->name_set(win, "win_simple"); /* set the window name - used by window
* manager. make it uniqie for windows
* with in this application */
win->title_set(win, "Simple Window with default Bg"); /* set the title */
win->autodel = 0; /* dont auto delete the window if someone closes it.
* this means the del+req handler has to delete it. by
* default it is on */
/* add a callback that is called when the user tries to close the window */
win->cb_add(win, ELM_CB_DEL_REQ, on_win_del_req, NULL);
/* add a callback that gets called when the window is resized */
win->cb_add(win, ELM_CB_RESIZE, on_win_resize, NULL);
/* our window needs a baground, so ask for one - it will be set with a
* default bg */
bg = elm_bg_new(win);
bg->show(bg); /* show the bg */
win->size_req(win, NULL, 240, 320); /* request that the window is 240x240
* no min/max size enforced */
win->show(win); /* show the window */
}
static void
win_bg_image(void)
{
Elm_Win *win;
Elm_Bg *bg;
char buf[PATH_MAX];
win = elm_win_new();
win->name_set(win, "win_bg");
win->title_set(win, "Simple Window with and image Bg");
win->autodel = 0;
win->cb_add(win, ELM_CB_DEL_REQ, on_win_del_req, NULL);
win->cb_add(win, ELM_CB_RESIZE, on_win_resize, NULL);
bg = elm_bg_new(win);
/* this is a test - shows how to have your own custom wallpaper in
* your app - don't use this unless you have a very good reason! there
* is a default and all apps look nicer sharing the default, but if
* you insist... */
snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR);
bg->file_set(bg, buf, NULL); /* set the bg - the NULL is for special
* files that contain multiple images
* inside 1 file. not normally used but
* might be if you have archive files with
* multiple images in them */
bg->show(bg);
win->size_req(win, NULL, 240, 240);
win->show(win);
}
static void
win_scrollable_label(void)
{
Elm_Win *win;
Elm_Bg *bg;
Elm_Scroller *scroller;
Elm_Label *label;
win = elm_win_new();
win->name_set(win, "win_bg");
win->title_set(win, "Simple Window with scroller and label inside");
win->autodel = 0;
win->cb_add(win, ELM_CB_DEL_REQ, on_win_del_req, NULL);
win->cb_add(win, ELM_CB_RESIZE, on_win_resize, NULL);
bg = elm_bg_new(win);
bg->show(bg);
scroller = elm_scroller_new(win);
label = elm_label_new(win);
label->text_set(label,
"Hello world<br>"
"<br>"
"I am a label. I come here to temonstrate how to put<br>"
"text into a label, with newlines, even markup to test<br>"
"things like <b>bold text</b> where markup can be custom<br>"
"and extensible, defined by the theme's textbloxk style<br>"
"for the label.<br>"
"<br>"
"Note that the markup is html-like and things like newline<br>"
"chars and tab chars like stdout text are not valid text<br>"
"markup mechanisms. Use markup tags instead.<br>"
"<br>"
"Now we shall borrow some text from another test program<br>"
"(Expedite) to put some more tests in here<br>"
"<br>"
"<style=outline color=#fff outline_color=#000>Styled</> "
"<style=shadow shadow_color=#fff8>text</> "
"<style=soft_shadow shadow_color=#0002>should</> "
"<style=glow color=#fff glow2_color=#fe87 glow_color=#f214 >go here</> "
"<style=far_shadow shadow_color=#0005>as it is</> "
"<style=outline_shadow color=#fff outline_color=#8228 shadow_color=#005>within</> "
"<style=outline_soft_shadow color=#fff outline_color=#8228 shadow_color=#0002>right tags</> "
"<style=far_soft_shadow color=#fff shadow_color=#0002>to make it align to the</> "
"<underline=on underline_color=#00f>right hand</> "
"<backing=on backing_color=#fff8>side </><backing_color=#ff08>of</><backing_color=#0f08> </>"
"<strikethrough=on strikethrough_color=#f0f8>the textblock</>."
"<br>"
"<underline=double underline_color=#f00 underline2_color=#00f>now we need</> "
"to test some <color=#f00 font_size=8>C</><color=#0f0 font_size=10>O</>"
"<color=#00f font_size=12>L</><color=#fff font_size=14>O</>"
"<color=#ff0 font_size=16>R</><color=#0ff font_size=18> Bla Rai</>"
"<color=#f0f font_size=20> Stuff</>."
"<br>"
"<style=outline color=#fff outline_color=#000>Round about the cauldron go;</> "
"In the poison'd entrails throw.<br>"
"<style=shadow shadow_color=#fff8>Toad, that under cold stone</> "
"Days and nights has thirty-one<br>"
"<style=soft_shadow shadow_color=#0002>Swelter'd venom sleeping got,</> "
"<style=glow color=#fff glow2_color=#fe87 glow_color=#f214 >Boil thou first i' the charmed pot.</><br>"
"Double, double toil and trouble; "
"Fire burn, and cauldron bubble.<br>"
"<style=far_shadow shadow_color=#0005>Fillet of a fenny snake,</> "
"In the cauldron boil and bake;<br>"
"<style=outline_shadow color=#fff outline_color=#8228 shadow_color=#005>Eye of newt and toe of frog,</> "
"<underline=on underline_color=#00f>Wool of bat and tongue of dog,</><br>"
"<backing=on backing_color=#fff8>Adder's fork and blind-worm's sting,</> "
"<underline=double underline_color=#f00 underline2_color=#00f>Lizard's leg and owlet's wing,</><br>"
"<color=#808 font_size=20>For a charm of powerful trouble, "
"Like a hell-broth boil and bubble.<br>"
"Double, double toil and trouble;</> "
"Fire burn and cauldron bubble.<br>"
"Scale of dragon, tooth of wolf, "
"Witches' mummy, maw and gulf<br>"
"Of the ravin'd salt-sea shark, "
"Root of hemlock digg'd i' the dark,<br>"
"Liver of blaspheming Jew, "
"Gall of goat, and slips of yew<br>"
"Silver'd in the moon's eclipse, "
"Nose of Turk and Tartar's lips,<br>"
"Finger of birth-strangled babe "
"Ditch-deliver'd by a drab,<br>"
"Make the gruel thick and slab: "
"Add thereto a tiger's chaudron,<br>"
"For the ingredients of our cauldron. "
"Double, double toil and trouble;<br>"
"Fire burn and cauldron bubble. "
"Cool it with a baboon's blood,<br>"
"Then the charm is firm and good.<br>"
"<br>"
"HeizรถlrรผckstoรŸabdรคmpfung flรธde pingรผino kilรณmetros cล“ur dรฉรงu l'รขme<br>"
"plutรดt naรฏve Louรฟs rรชva crapaรผter รosa รšrmhac ร“ighe pรณr ร‰ava รdhaim<br>"
);
scroller->child_add(scroller, label);
label->show(label);
scroller->show(scroller);
win->size_req(win, NULL, 240, 480);
win->show(win);
}
static void
win_label_determines_min_size(void)
{
Elm_Win *win;
Elm_Bg *bg;
Elm_Label *label;
win = elm_win_new();
win->name_set(win, "win_bg");
win->title_set(win, "Simple Window with label setting minimum size");
win->autodel = 0;
win->cb_add(win, ELM_CB_DEL_REQ, on_win_del_req, NULL);
win->cb_add(win, ELM_CB_RESIZE, on_win_resize, NULL);
bg = elm_bg_new(win);
bg->expand_x = 0; /* allows the window to grow in the y axis because */
bg->expand_y = 1; /* its only child can expand in y */
bg->show(bg);
label = elm_label_new(win);
label->text_set(label,
"Hello world<br>"
"<br>"
"I am a label. I come here to temonstrate how to put<br>"
"text into a label, with newlines, even markup to test<br>"
"things like <b>bold text</b> where markup can be custom<br>"
"and extensible, defined by the theme's textbloxk style<br>"
"for the label.<br>"
"<br>"
"Note that the markup is html-like and things like newline<br>"
"chars and tab chars like stdout text are not valid text<br>"
"markup mechanisms. Use markup tags instead.<br>"
);
label->show(label);
label->expand_x = 0; /* allows the window to grow in the y axis because */
label->expand_y = 1; /* its only child can expand in y */
/* why do i change expand on both bg and label? both are children of the
* window widget and thus both affect the window sizing. if any expands
* in an axis then window expanding is allowed always */
elm_widget_sizing_update(label); /* make sure that the lable knows about its
* sizing changes like expand above */
win->show(win);
}
static void
win_box_vert_of_labels(void)
{
Elm_Win *win;
Elm_Bg *bg;
Elm_Box *box;
Elm_Label *label;
win = elm_win_new();
win->name_set(win, "win_bg");
win->title_set(win, "Simple Window with box + labels setting minimum size");
win->autodel = 0;
win->cb_add(win, ELM_CB_DEL_REQ, on_win_del_req, NULL);
win->cb_add(win, ELM_CB_RESIZE, on_win_resize, NULL);
bg = elm_bg_new(win);
bg->expand_x = 1;
bg->expand_y = 1;
bg->show(bg);
box = elm_box_new(win);
box->expand_x = 1;
box->expand_y = 1;
label = elm_label_new(win);
label->text_set(label, "Expand X/Y 0/0, Fill X/Y 0/0, Align: 0.5 0.5");
box->pack_end(box, label);
label->show(label);
label->align_x = 0.5;
label->align_y = 0.5;
label->expand_x = 0;
label->expand_y = 0;
label->fill_x = 0;
label->fill_y = 0;
elm_widget_sizing_update(label);
label = elm_label_new(win);
label->text_set(label, "Expand X/Y 1/1, Fill X/Y 0/0, Align: 0.5 0.5");
box->pack_end(box, label);
label->show(label);
label->align_x = 0.5;
label->align_y = 0.5;
label->expand_x = 1;
label->expand_y = 1;
label->fill_x = 0;
label->fill_y = 0;
elm_widget_sizing_update(label);
label = elm_label_new(win);
label->text_set(label, "Expand X/Y 1/1, Fill X/Y 1/1, Align: 0.5 0.5");
box->pack_end(box, label);
label->show(label);
label->align_x = 0.5;
label->align_y = 0.5;
label->expand_x = 1;
label->expand_y = 1;
label->fill_x = 1;
label->fill_y = 1;
elm_widget_sizing_update(label);
label = elm_label_new(win);
label->text_set(label, "Expand X/Y 0/0, Fill X/Y 1/1, Align: 0.5 0.5");
box->pack_end(box, label);
label->show(label);
label->align_x = 0.5;
label->align_y = 0.5;
label->expand_x = 0;
label->expand_y = 0;
label->fill_x = 1;
label->fill_y = 1;
elm_widget_sizing_update(label);
label = elm_label_new(win);
label->text_set(label, "Expand X/Y 0/0, Fill X/Y 1/1, Align: 0.0 0.5");
box->pack_end(box, label);
label->show(label);
label->align_x = 0.0;
label->align_y = 0.5;
label->expand_x = 0;
label->expand_y = 0;
label->fill_x = 1;
label->fill_y = 1;
elm_widget_sizing_update(label);
label = elm_label_new(win);
label->text_set(label, "Expand X/Y 0/0, Fill X/Y 1/1, Align: 1.0 0.5");
box->pack_end(box, label);
label->show(label);
label->align_x = 1.0;
label->align_y = 0.5;
label->expand_x = 0;
label->expand_y = 0;
label->fill_x = 1;
label->fill_y = 1;
elm_widget_sizing_update(label);
label = elm_label_new(win);
label->text_set(label, "Expand X/Y 0/0, Fill X/Y 1/1, Align: 0.5 0.0");
box->pack_end(box, label);
label->show(label);
label->align_x = 0.5;
label->align_y = 0.0;
label->expand_x = 0;
label->expand_y = 0;
label->fill_x = 1;
label->fill_y = 1;
elm_widget_sizing_update(label);
label = elm_label_new(win);
label->text_set(label, "Expand X/Y 0/0, Fill X/Y 1/1, Align: 0.5 1.0");
box->pack_end(box, label);
label->show(label);
label->align_x = 0.5;
label->align_y = 1.0;
label->expand_x = 0;
label->expand_y = 0;
label->fill_x = 1;
label->fill_y = 1;
elm_widget_sizing_update(label);
elm_widget_sizing_update(box);
box->show(box);
win->show(win);
}
static void
win_scrollable_box_vert_of_labels(void)
{
Elm_Win *win;
Elm_Bg *bg;
Elm_Scroller *scroller;
Elm_Box *box;
Elm_Label *label;
int i;
win = elm_win_new();
win->name_set(win, "win_bg");
win->title_set(win, "Simple Window with scroller and box + labels inside");
win->autodel = 0;
win->cb_add(win, ELM_CB_DEL_REQ, on_win_del_req, NULL);
win->cb_add(win, ELM_CB_RESIZE, on_win_resize, NULL);
bg = elm_bg_new(win);
bg->expand_x = 1;
bg->expand_y = 1;
bg->show(bg);
scroller = elm_scroller_new(win);
box = elm_box_new(win);
box->expand_x = 1;
box->expand_y = 1;
for (i = 0; i < 40; i++)
{
char buf[200];
snprintf(buf, sizeof(buf), "This is a Label in a box, #%i", i);
label = elm_label_new(win);
label->text_set(label, buf);
box->pack_end(box, label);
label->show(label);
label->expand_x = 0;
label->expand_y = 0;
elm_widget_sizing_update(label);
label->show(label);
}
scroller->child_add(scroller, box);
elm_widget_sizing_update(box);
box->show(box);
scroller->show(scroller);
win->size_req(win, NULL, 240, 240);
win->show(win);
}
static void
win_table_of_labels(void)
{
Elm_Win *win;
Elm_Bg *bg;
Elm_Table *table;
Elm_Label *label;
win = elm_win_new();
win->name_set(win, "win_bg");
win->title_set(win, "Simple Window with table + labels setting minimum size");
win->autodel = 0;
win->cb_add(win, ELM_CB_DEL_REQ, on_win_del_req, NULL);
win->cb_add(win, ELM_CB_RESIZE, on_win_resize, NULL);
bg = elm_bg_new(win);
bg->expand_x = 1;
bg->expand_y = 1;
bg->show(bg);
table = elm_table_new(win);
table->expand_x = 1;
table->expand_y = 1;
label = elm_label_new(win);
label->text_set(label, "X");
table->pack(table, label, 0, 0, 1, 1);
label->fill_x = 0;
label->fill_y = 0;
label->show(label);
elm_widget_sizing_update(label);
label = elm_label_new(win);
label->text_set(label, "Y");
table->pack(table, label, 1, 0, 1, 1);
label->fill_x = 0;
label->fill_y = 0;
label->show(label);
elm_widget_sizing_update(label);
label = elm_label_new(win);
label->text_set(label, "Z");
table->pack(table, label, 2, 0, 1, 1);
label->fill_x = 0;
label->fill_y = 0;
label->show(label);
elm_widget_sizing_update(label);
label = elm_label_new(win);
label->text_set(label, "A");
table->pack(table, label, 0, 1, 1, 1);
label->fill_x = 0;
label->fill_y = 0;
label->show(label);
elm_widget_sizing_update(label);
label = elm_label_new(win);
label->text_set(label, "BB");
table->pack(table, label, 1, 1, 2, 1);
label->fill_x = 0;
label->fill_y = 0;
label->show(label);
elm_widget_sizing_update(label);
label = elm_label_new(win);
label->text_set(label, "CCC");
table->pack(table, label, 0, 2, 3, 1);
label->fill_x = 0;
label->fill_y = 0;
label->show(label);
elm_widget_sizing_update(label);
elm_widget_sizing_update(table);
table->show(table);
win->show(win);
}
static void
on_button_activate(void *data, Elm_Button *bt, Elm_Cb_Type type, void *info)
{
printf("Button %p activate\n", bt);
}
static void
win_table_of_buttons(void)
{
Elm_Win *win;
Elm_Bg *bg;
Elm_Icon *icon;
Elm_Table *table;
Elm_Button *button;
char buf[PATH_MAX];
win = elm_win_new();
win->name_set(win, "win_bg");
win->title_set(win, "Simple Window with table + buttons setting minimum size");
win->autodel = 0;
win->cb_add(win, ELM_CB_DEL_REQ, on_win_del_req, NULL);
win->cb_add(win, ELM_CB_RESIZE, on_win_resize, NULL);
bg = elm_bg_new(win);
bg->expand_x = 1;
bg->expand_y = 1;
bg->show(bg);
table = elm_table_new(win);
table->expand_x = 1;
table->expand_y = 1;
button = elm_button_new(win);
button->text_set(button, "Button 1");
table->pack(table, button, 0, 0, 1, 1);
button->fill_x = 0;
button->fill_y = 0;
button->show(button);
elm_widget_sizing_update(button);
button->cb_add(button, ELM_CB_ACTIVATED, on_button_activate, NULL);
button = elm_button_new(win);
button->text_set(button, "Button 2");
table->pack(table, button, 1, 0, 1, 1);
button->fill_x = 0;
button->fill_y = 0;
button->show(button);
elm_widget_sizing_update(button);
button->cb_add(button, ELM_CB_ACTIVATED, on_button_activate, NULL);
button = elm_button_new(win);
button->text_set(button, "Button 3");
table->pack(table, button, 2, 0, 1, 1);
button->fill_x = 0;
button->fill_y = 0;
button->show(button);
elm_widget_sizing_update(button);
button->cb_add(button, ELM_CB_ACTIVATED, on_button_activate, NULL);
button = elm_button_new(win);
button->text_set(button, "Button 4");
table->pack(table, button, 0, 1, 1, 1);
button->fill_x = 1;
button->fill_y = 0;
button->show(button);
elm_widget_sizing_update(button);
button->cb_add(button, ELM_CB_ACTIVATED, on_button_activate, NULL);
button = elm_button_new(win);
icon = elm_icon_new(win);
snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
icon->file_set(icon, buf, NULL);
icon->scale_up = 0;
icon->layout_update(icon);
button->child_add(button, icon);
table->pack(table, button, 1, 1, 2, 1);
button->fill_x = 1;
button->fill_y = 1;
button->show(button);
elm_widget_sizing_update(button);
button->cb_add(button, ELM_CB_ACTIVATED, on_button_activate, NULL);
button = elm_button_new(win);
button->text_set(button, "Button 6");
icon = elm_icon_new(win);
snprintf(buf, sizeof(buf), "%s/images/logo.png", PACKAGE_DATA_DIR);
icon->file_set(icon, buf, NULL);
button->child_add(button, icon);
table->pack(table, button, 0, 2, 3, 1);
button->fill_x = 1;
button->fill_y = 1;
button->show(button);
elm_widget_sizing_update(button);
button->cb_add(button, ELM_CB_ACTIVATED, on_button_activate, NULL);
elm_widget_sizing_update(table);
table->show(table);
win->show(win);
}
static void
on_toggle_changed(void *data, Elm_Toggle *tg, Elm_Cb_Type type, void *info)
{
printf("toggle: %i\n", tg->state);
}
static void
win_box_vert_of_toggles(void)
{
Elm_Win *win;
Elm_Bg *bg;
Elm_Box *box;
Elm_Toggle *toggle;
Elm_Icon *icon;
char buf[PATH_MAX];
win = elm_win_new();
win->name_set(win, "win_bg");
win->title_set(win, "Simple Window with box + toggles setting min size");
win->autodel = 0;
win->cb_add(win, ELM_CB_DEL_REQ, on_win_del_req, NULL);
win->cb_add(win, ELM_CB_RESIZE, on_win_resize, NULL);
bg = elm_bg_new(win);
bg->expand_x = 0;
bg->expand_y = 0;
bg->show(bg);
box = elm_box_new(win);
box->expand_x = 0;
box->expand_y = 0;
toggle = elm_toggle_new(win);
toggle->text_set(toggle, "Label ON/OFF");
toggle->state = 1;
toggle->layout_update(toggle);
toggle->cb_add(toggle, ELM_CB_CHANGED, on_toggle_changed, NULL);
box->pack_end(box, toggle);
toggle->show(toggle);
toggle->expand_y = 0;
toggle->fill_y = 0;
elm_widget_sizing_update(toggle);
toggle = elm_toggle_new(win);
toggle->text_set(toggle, "Icon + Label ON/OFF");
icon = elm_icon_new(win);
snprintf(buf, sizeof(buf), "%s/images/logo.png", PACKAGE_DATA_DIR);
icon->file_set(icon, buf, NULL);
toggle->child_add(toggle, icon);
toggle->state = 1;
toggle->layout_update(toggle);
toggle->cb_add(toggle, ELM_CB_CHANGED, on_toggle_changed, NULL);
box->pack_end(box, toggle);
toggle->show(toggle);
toggle->expand_y = 0;
toggle->fill_y = 0;
elm_widget_sizing_update(toggle);
toggle = elm_toggle_new(win);
toggle->text_set(toggle, NULL);
icon = elm_icon_new(win);
snprintf(buf, sizeof(buf), "%s/images/logo.png", PACKAGE_DATA_DIR);
icon->file_set(icon, buf, NULL);
toggle->child_add(toggle, icon);
toggle->state = 1;
toggle->layout_update(toggle);
toggle->cb_add(toggle, ELM_CB_CHANGED, on_toggle_changed, NULL);
box->pack_end(box, toggle);
toggle->show(toggle);
toggle->expand_y = 0;
toggle->fill_y = 0;
elm_widget_sizing_update(toggle);
toggle = elm_toggle_new(win);
toggle->text_set(toggle, "Label Yes/No");
toggle->states_text_set(toggle, "Yes", "No");
toggle->state = 1;
toggle->layout_update(toggle);
toggle->cb_add(toggle, ELM_CB_CHANGED, on_toggle_changed, NULL);
box->pack_end(box, toggle);
toggle->show(toggle);
toggle->expand_y = 0;
toggle->fill_y = 0;
elm_widget_sizing_update(toggle);
elm_widget_sizing_update(box);
box->show(box);
win->show(win);
}
static void
win_scrollable_box_vert_of_toggles_and_buttons(void)
{
Elm_Win *win;
Elm_Bg *bg;
Elm_Box *box;
Elm_Scroller *scroller;
Elm_Toggle *toggle;
Elm_Icon *icon;
Elm_Button *button;
Elm_Label *label;
char buf[PATH_MAX];
win = elm_win_new();
win->name_set(win, "win_bg");
win->title_set(win, "Simple Window with scroller + box + toggles + buttons");
win->autodel = 0;
win->cb_add(win, ELM_CB_DEL_REQ, on_win_del_req, NULL);
win->cb_add(win, ELM_CB_RESIZE, on_win_resize, NULL);
bg = elm_bg_new(win);
bg->expand_x = 1;
bg->expand_y = 1;
bg->show(bg);
scroller = elm_scroller_new(win);
box = elm_box_new(win);
toggle = elm_toggle_new(win);
toggle->text_set(toggle, "Label ON/OFF");
toggle->state = 1;
toggle->layout_update(toggle);
toggle->cb_add(toggle, ELM_CB_CHANGED, on_toggle_changed, NULL);
box->pack_end(box, toggle);
toggle->show(toggle);
toggle->expand_y = 0;
toggle->fill_y = 0;
elm_widget_sizing_update(toggle);
toggle = elm_toggle_new(win);
toggle->text_set(toggle, "Icon + Label ON/OFF");
icon = elm_icon_new(win);
snprintf(buf, sizeof(buf), "%s/images/logo.png", PACKAGE_DATA_DIR);
icon->file_set(icon, buf, NULL);
toggle->child_add(toggle, icon);
toggle->state = 1;
toggle->layout_update(toggle);
toggle->cb_add(toggle, ELM_CB_CHANGED, on_toggle_changed, NULL);
box->pack_end(box, toggle);
toggle->show(toggle);
toggle->expand_y = 0;
toggle->fill_y = 0;
elm_widget_sizing_update(toggle);
toggle = elm_toggle_new(win);
toggle->text_set(toggle, NULL);
icon = elm_icon_new(win);
snprintf(buf, sizeof(buf), "%s/images/logo.png", PACKAGE_DATA_DIR);
icon->file_set(icon, buf, NULL);
toggle->child_add(toggle, icon);
toggle->state = 1;
toggle->layout_update(toggle);
toggle->cb_add(toggle, ELM_CB_CHANGED, on_toggle_changed, NULL);
box->pack_end(box, toggle);
toggle->show(toggle);
toggle->expand_y = 0;
toggle->fill_y = 0;
elm_widget_sizing_update(toggle);
toggle = elm_toggle_new(win);
toggle->text_set(toggle, "Label Yes/No");
toggle->states_text_set(toggle, "Yes", "No");