Mon Mar 5 15:04:44 2007 Michael Jennings (mej)

Remove broken modules.
----------------------------------------------------------------------


SVN revision: 28581
master
Michael Jennings 16 years ago
parent a8501f9868
commit 0b596e6d17
  1. 19
      .cvsignore
  2. 1
      AUTHORS
  3. 28
      COPYING
  4. 33
      COPYING-PLAIN
  5. 0
      ChangeLog
  6. 11
      INSTALL
  7. 33
      Makefile.am
  8. 3
      NEWS
  9. 11
      README
  10. 27
      autogen.sh
  11. 153
      configure.in
  12. 221
      e_mod_config.c
  13. 8
      e_mod_config.h
  14. 2715
      e_mod_main.c
  15. 134
      e_mod_main.h
  16. 32
      module_icon.edc
  17. BIN
      module_icon.png
  18. 329
      tray.c

@ -1,19 +0,0 @@
.deps
Makefile
Makefile.in
aclocal.m4
autom4te.cache
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
depcomp
install-sh
libtool
missing
ltmain.sh
stamp-h1
e_modules-engage.spec

@ -1 +0,0 @@
Andrew 'HandyAndE' Williams <http://handyande.co.uk/>

@ -1,28 +0,0 @@
Copyright (C) 2004 The Enlightenment Development Team
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:
The above copyright notice and this permission notice shall be included in
all copies of the Software and its Copyright notices. In addition publicly
documented acknowledgment must be given that this software has been used if no
source code of this software is made available publicly. This includes
acknowledgments in either Copyright notices, Manuals, Publicity and Marketing
documents or any documentation provided with any product containing this
software. This License does not apply to any software that links to the
libraries provided by this software (statically or dynamically), but only to
the software provided.
Please see the COPYING.PLAIN for a plain-english explanation of this notice
and it's intent.
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.

@ -1,33 +0,0 @@
Plain English Copyright Notice
This file is not intended to be the actual License. The reason this file
exists is that we here are programmers and engineers. We aren't lawyers. We
provide licenses that we THINK say the right things, but we have our own
intentions at heart. This is a plain-english explanation of what those
intentions are, and if you follow them you will be within the "spirit" of
the license.
The intent is for us to enjoy writing software that is useful to us (the
AUTHORS) and allow others to use it freely and also benefit from the work we
put into making it. We don't want to restrict others using it. They should
not *HAVE* to make the source code of the applications they write that
simply link to these libraries (be that statically or dynamically), or for
them to be limited as to what license they choose to use (be it open, closed
or anything else). But we would like to know you are using these libraries.
We simply would like to know that it has been useful to someone. This is why
we ask for acknowledgement of some sort.
You can do what you want with the source of this software - it doesn't
matter. We still have it here for ourselves and it is open and free to use
and download and play with. It can't be taken away. We don't really mind what
you do with the source to your software. We would simply like to know that
you are using it - especially if it makes it to a commerical product. If you
simply e-mail all the AUTHORS (see COPYING and AUTHORS files) telling us, and
then make sure you include a paragraph or page in the manual for the product
with the copyright notice and state that you used this software, we will be
very happy. If you want to contribute back modifications and fixes you may have
made we will welcome those too with open arms (generally). If you want help
with changes needed, ports needed or features to be added, arrangements can
be easily made with some dialogue.
Christopher Michael <devilhorns@comcast.net>

@ -1,11 +0,0 @@
COMPILING and INSTALLING:
If you got a official release tar archive do:
./autogen.sh
Then to compile:
make
To install:
make install

@ -1,33 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
# data files for the module
filesdir = $(datadir)
files_DATA = \
module.eap
EXTRA_DIST = $(files_DATA)
# the module .so file
INCLUDES = -I. \
-I$(top_srcdir) \
-I$(includedir) \
@e_cflags@
pkgdir = $(datadir)/$(MODULE_ARCH)
pkg_LTLIBRARIES = module.la
module_la_SOURCES = e_mod_main.c \
tray.c \
e_mod_config.h \
e_mod_config.c \
e_mod_main.h
module_la_LIBADD = @e_libs@ -lm
module_la_LDFLAGS = -module -avoid-version
module_la_DEPENDENCIES = $(top_builddir)/config.h
module.eap:
@edje_cc@ -v module_icon.edc module.eap
enlightenment_eapp module.eap \
-set-name "Engage" \
-set-generic "gadget" \
-set-comment "Engage module for e17" \
-set-exe "null" \
-set-icon-class "null"

@ -1,3 +0,0 @@
03/09/06
Gifted engage module to the e_modules repository

@ -1,11 +0,0 @@
This is the e17 engage module which features real transparency and fits nicely
in the sexiest window manager out there :)
To use it compile as before (you must have e17 installed when you run
./configure (or ./autogen.sh) ) then with e17 running type:
enlightenment_remote -module-load engage
enlightenment_remote -module-enable engage
enjoy
HandyAndE

@ -1,27 +0,0 @@
#!/bin/sh
rm -rf autom4te.cache
rm -f aclocal.m4 ltmain.sh
touch README
echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS || 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
echo "Generating gettext rain.pot template"; \
xgettext \
--output rain.pot \
--output-dir=po \
--language=C \
--add-location \
--keyword=D_ \
--sort-by-file \
--copyright-holder="TODO" \
--foreign-user \
`find . -name "*.[ch]" -print` || exit 1
if [ -z "$NOCONFIGURE" ]; then
./configure "$@"
fi

@ -1,153 +0,0 @@
dnl Process this file with autoconf to produce a configure script.
# get rid of that stupid cache mechanism
rm -f config.cache
AC_INIT(configure.in)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE(engage, 0.0.1)
AM_CONFIG_HEADER(config.h)
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_C_CONST
AM_ENABLE_SHARED
AM_PROG_LIBTOOL
ALL_LINGUAS="eo fi fr it ja sv"
AC_SUBST(ALL_LINGUAS)
#AM_GNU_GETTEXT([external])
#AM_GNU_GETTEXT_VERSION(0.14)
MODULE_ARCH="$host_os-$host_cpu"
AC_SUBST(MODULE_ARCH)
AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture")
if test "x${bindir}" = 'x${exec_prefix}/bin'; then
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
else
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
fi
fi
if test "x${libdir}" = 'x${exec_prefix}/lib'; then
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
fi
else
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
fi
fi
fi
dnl Set PACKAGE_BIN_DIR in config.h.
if test "x${bindir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${ac_default_prefix}/bin", "Package installed binaries destination")
else
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${prefix}/bin", "Package installed binaries destination")
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${bindir}", "Package installed binaries destination")
fi
dnl Set PACKAGE_LIB_DIR in config.h.
if test "x${libdir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${ac_default_prefix}/lib", "Package installed libraries destination")
else
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${prefix}/lib", "Package installed libraries destination")
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${libdir}", "Package installed libraries destination")
fi
dnl Set PACKAGE_DATA_DIR in config.h.
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${HOME}/.e/e/modules/${PACKAGE}", "Package installed data destination")
datadir="${HOME}/.e/e/modules/${PACKAGE}"
else
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${libdir}/enlightenment/modules/${PACKAGE}", "Package installed data destination")
datadir="${libdir}/enlightenment/modules/${PACKAGE}"
fi
AC_PREFIX_DEFAULT(${HOME}/.e/e)
if test "x$prefix" = "xNONE"; then
datarootdir=${ac_default_prefix}
else
datarootdir=${prefix}/share
fi
localedir=${datarootdir}/locale
AC_SUBST(LOCALEDIR, "${localedir}")
AC_DEFINE_UNQUOTED(LOCALEDIR, "${localedir}", [Module Locale Directory])
#AC_CHECK_LIB(dl, dlopen, dlopen_libs=-ldl)
#AC_SUBST(dlopen_libs)
AC_ARG_WITH(edje-config,
[ --with-edje-config=EDJE_CONFIG use edje-config specified ],
[
EDJE_CONFIG=$withval;
echo "using "$EDJE_CONFIG" for edje-config";
/
],[
PROG="edje-config";
AC_PATH_PROG(EDJE_CONFIG, $PROG, "", $PATH)
])
edje_cflags=`$EDJE_CONFIG --cflags`
edje_libs=`$EDJE_CONFIG --libs`
AC_SUBST(edje_cflags)
AC_SUBST(edje_libs)
edje_cc="`$EDJE_CONFIG --prefix`/bin/edje_cc"
AC_ARG_WITH(edje-cc,
[ --with-edje-cc=PATH specify a specific path to edje_cc],
[
v=$withval;
edje_cc=$v
echo " Enlightenment edje_cc explicitly set to "$edje_cc;
],[
edje_cc="`$EDJE_CONFIG --prefix`/bin/edje_cc"
])
AC_SUBST(edje_cc)
AC_ARG_WITH(enlightenment-config,
[ --with-enlightenment-config=E_CONFIG use enlightenment-config specified ],
[
E_CONFIG=$withval;
echo "using "$E_CONFIG" for enlightenment-config";
],[
PROG="enlightenment-config";
AC_PATH_PROG(E_CONFIG, $PROG, "", $PATH)
])
e_cflags=`$E_CONFIG --cflags`
e_libs=`$E_CONFIG --libs`
e_modules=`$E_CONFIG --module-dir`
AC_SUBST(e_cflags)
AC_SUBST(e_libs)
AC_SUBST(e_modules)
AC_OUTPUT([
Makefile
],[
])

@ -1,221 +0,0 @@
#include <e.h>
#include "e_mod_main.h"
#include "config.h"
struct _E_Config_Dialog_Data
{
int click_focus;
int enabled;
double iconsize;
int zoom, zoom_stretch;
double zoom_factor, zoom_duration;
int tray;
};
/* Protos */
static void *_create_data(E_Config_Dialog *cfd);
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *data);
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *data);
static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *data);
static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *data);
static int _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *data);
void _engage_module_config(E_Container *con, Engage_Bar *eb)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
if (eb->cfd)
return;
v = E_NEW(E_Config_Dialog_View, 1);
if (v)
{
char buf[4096];
v->create_cfdata = _create_data;
v->free_cfdata = _free_data;
v->basic.apply_cfdata = _basic_apply_data;
v->basic.create_widgets = _basic_create_widgets;
v->advanced.apply_cfdata = _advanced_apply_data;
v->advanced.create_widgets = _advanced_create_widgets;
snprintf(buf, sizeof(buf), "%s/module.eap", e_module_dir_get(eb->engage->module));
cfd = e_config_dialog_new(con, "Engage Configuration", "Engage", "_e_modules_engage_config_dialog", buf, 0, v, eb);
eb->cfd = cfd;
}
}
static void
_fill_data(Engage_Bar *eb, E_Config_Dialog_Data *cfdata)
{
cfdata->click_focus = eb->engage->conf->click_focus;
cfdata->enabled = eb->conf->enabled;
cfdata->iconsize = (double) eb->conf->iconsize;
cfdata->zoom = eb->conf->zoom;
cfdata->zoom_factor = eb->conf->zoom_factor;
cfdata->zoom_duration = eb->conf->zoom_duration;
cfdata->zoom_stretch = eb->conf->zoom_stretch;
cfdata->tray = eb->conf->tray;
}
static void *
_create_data(E_Config_Dialog *cfd)
{
E_Config_Dialog_Data *cfdata;
Engage_Bar *eb;
eb = cfd->data;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
_fill_data(eb, cfdata);
return cfdata;
}
static void
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
Engage_Bar *eb;
free(cfdata);
eb = cfd->data;
eb->cfd = NULL;
}
static Evas_Object *
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *data)
{
Evas_Object *o, *of, *ob;
E_Config_Dialog_Data *cfdata;
Engage_Bar *eb;
eb = cfd->data;
cfdata = data;
o = e_widget_list_add(evas, 0, 0);
of = e_widget_framelist_add(evas, "Global Options", 0);
ob = e_widget_check_add(evas, "Focus Applications on Icon Click", &(cfdata->click_focus));
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
of = e_widget_framelist_add(evas, "Bar Options", 0);
ob = e_widget_check_add(evas, "Enable Bar", &(cfdata->enabled));
e_widget_framelist_object_append(of, ob);
/* FIXME - hook in a resize method, as engage only accepts gadman controlled
* resize at the moment
ob = e_widget_label_add(evas, "Icon Size");
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, "%1.0f Pixels", 2.0, 400.0, 1.0, 0, &(cfdata->iconsize), NULL, 150);
e_widget_framelist_object_append(of, ob);*/
e_widget_list_object_append(o, of, 1, 1, 0.5);
of = e_widget_framelist_add(evas, "Zoom Options", 0);
ob = e_widget_check_add(evas, "Enable Zooming", &(cfdata->zoom));
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, "Stretch Bar", &(cfdata->zoom_stretch));
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
of = e_widget_framelist_add(evas, "System Tray", 0);
ob = e_widget_check_add(evas, "Enable System Tray", &(cfdata->tray));
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
return o;
}
static int
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
Engage_Bar *eb;
eb = cfd->data;
eb->engage->conf->click_focus = cfdata->click_focus;
eb->conf->enabled = cfdata->enabled;
eb->conf->iconsize = (int) cfdata->iconsize;
eb->conf->zoom = cfdata->zoom;
eb->conf->zoom_stretch = cfdata->zoom_stretch;
eb->conf->tray = cfdata->tray;
_engage_cb_config_updated(eb);
return 1;
}
static Evas_Object *
_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
{
Evas_Object *o, *of, *ob;
Engage_Bar *eb;
eb = cfd->data;
o = e_widget_list_add(evas, 0, 0);
of = e_widget_framelist_add(evas, "Global Options", 0);
ob = e_widget_check_add(evas, "Focus Applications on Icon Click", &(cfdata->click_focus));
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
of = e_widget_framelist_add(evas, "Bar Options", 0);
ob = e_widget_check_add(evas, "Enable Bar", &(cfdata->enabled));
e_widget_framelist_object_append(of, ob);
/* FIXME - hook in a resize method, as engage only accepts gadman controlled
* resize at the moment
ob = e_widget_label_add(evas, "Icon Size");
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, "%1.0f Pixels", 2.0, 400.0, 1.0, 0, &(cfdata->iconsize), NULL, 150);
e_widget_framelist_object_append(of, ob);*/
e_widget_list_object_append(o, of, 1, 1, 0.5);
of = e_widget_framelist_add(evas, "Zoom Options", 0);
ob = e_widget_check_add(evas, "Enable Zooming", &(cfdata->zoom));
e_widget_framelist_object_append(of, ob);
ob = e_widget_label_add(evas, "Zoom Factor");
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, "%1.1f*", 1.0, 4.0, 0.1, 0, &(cfdata->zoom_factor), NULL, 150);
e_widget_framelist_object_append(of, ob);
ob = e_widget_label_add(evas, "Zoom Duration");
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, "%1.2f secs", 0.1, 0.5, 0.01, 0, &(cfdata->zoom_duration), NULL, 150);
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, "Stretch Bar", &(cfdata->zoom_stretch));
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
of = e_widget_framelist_add(evas, "System Tray", 0);
ob = e_widget_check_add(evas, "Enable System Tray", &(cfdata->tray));
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
return o;
}
static int
_advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
Engage_Bar *eb;
eb = cfd->data;
eb->engage->conf->click_focus = cfdata->click_focus;
eb->conf->enabled = cfdata->enabled;
eb->conf->iconsize = (int) cfdata->iconsize;
eb->conf->zoom = cfdata->zoom;
eb->conf->zoom_factor = cfdata->zoom_factor;
eb->conf->zoom_duration = cfdata->zoom_duration;
eb->conf->zoom_stretch = cfdata->zoom_stretch;
eb->conf->tray = cfdata->tray;
_engage_cb_config_updated(eb);
return 1;
}

@ -1,8 +0,0 @@
#ifdef E_TYPEDEFS
#else
#ifndef E_MOD_CONFIG_H
#define E_MOD_CONFIG_H
#include "e_mod_main.h"
EAPI void _engage_module_config(E_Container *con, Engage_Bar *eb);
#endif
#endif

File diff suppressed because it is too large Load Diff

@ -1,134 +0,0 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifndef E_MOD_MAIN_H
#define E_MOD_MAIN_H
typedef struct _Config Config;
typedef struct _Config_Bar Config_Bar;
typedef struct _Engage Engage;
typedef struct _Engage_Bar Engage_Bar;
typedef struct _Engage_Tray Engage_Tray;
typedef struct _Engage_Icon Engage_Icon;
typedef struct _Engage_App_Icon Engage_App_Icon;
struct _Config
{
const char *appdir;
Evas_List *bars;
unsigned char click_focus;
/*
double handle;
char autohide;
*/
};
struct _Config_Bar
{
unsigned char enabled;
int iconsize;
int zoom;
double zoom_factor, zoom_duration;
int zoom_stretch;
int tray;
};
struct _Engage
{
E_App *apps;
Evas_List *bars;
E_Menu *config_menu;
Config *conf;
E_Module *module;
};
struct _Engage_Tray
{
Evas_Object *tray;
int w, h;
int icons;
Evas_List *wins;
Ecore_X_Window win;
Ecore_X_Time select_time;
Ecore_Event_Handler *msg_handler;
Ecore_Event_Handler *dst_handler;
};
struct _Engage_Bar
{
Engage *engage;
E_Container *con;
Evas *evas;
E_Menu *menu;
E_Menu *zoom_size_menu;
E_Menu *zoom_speed_menu;
E_Menu *icon_menu;
E_Menu *context_menu;
Evas_Object *bar_object;
Evas_Object *box_object;
Evas_Object *event_object;
Evas_Coord bw, bh;
Evas_Coord mouse_out;
Evas_List *icons;
Evas_List *contexts;
double align, align_req;
int loaded;
Evas_Coord x, y, w, h;
double zoom;
int cancel_zoom_in:1, cancel_zoom_out:1;
double zoom_start_time;
enum {ENGAGE_NORMAL, ENGAGE_ZOOMING, ENGAGE_ZOOMED, ENGAGE_UNZOOMING} state;
E_Gadman_Client *gmc;
E_Config_Dialog *cfd;
Config_Bar *conf;
Ecore_Event_Handler *add_handler;
Ecore_Event_Handler *remove_handler;
Ecore_Event_Handler *iconify_handler;
Ecore_Event_Handler *uniconify_handler;
Engage_Tray *tray;
Engage_Icon *selected_ic;
};
struct _Engage_Icon
{
Engage_Bar *eb;
E_App *app;
Evas_Object *bg_object;
Evas_Object *icon_object;
Evas_Object *event_object;
Evas_List *extra_icons, *selected_app;
double scale;
int dotorder;
};
struct _Engage_App_Icon
{
Engage_Icon *ic;
Evas_Object *bg_object;
Evas_Object *icon_object;
Evas_Object *event_object;
int min;
E_Border *border;
};
EAPI extern E_Module_Api e_modapi;
EAPI void *e_modapi_init (E_Module *m);
EAPI int e_modapi_shutdown (E_Module *m);
EAPI int e_modapi_save (E_Module *m);
EAPI int e_modapi_about (E_Module *m);
EAPI int e_modapi_config (E_Module *m);
void _engage_cb_config_updated(void *data);
#endif

@ -1,32 +0,0 @@
images {
image: "module_icon.png" COMP;
}
collections {
group {
name: "icon";
max: 24 24;
parts {
part {
name: "image";
type: IMAGE;
mouse_events: 0;
description {
state: "default" 0.00;
visible: 1;
aspect: 1.00 1.00;
rel1 {
relative: 0.00 0.00;
offset: 0 0;
}
rel2 {
relative: 1.00 1.00;
offset: -1 -1;
}
image {
normal: "module_icon.png";
}
}
}
}
}
}

Binary file not shown.

329
tray.c

@ -1,329 +0,0 @@
#include <e.h>
#include "e_mod_main.h"
#include "Ecore_X.h"
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#define SYSTEM_TRAY_REQUEST_DOCK 0
#define SYSTEM_TRAY_BEGIN_MESSAGE 1
#define SYSTEM_TRAY_CANCEL_MESSAGE 2
#define XEMBED_EMBEDDED_NOTIFY 0
static int _engage_tray_cb_msg(void *data, int type, void *event);
void _engage_tray_active_set(Engage_Bar *eb, int active);
static void _engage_tray_cb_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y);
static void _engage_tray_cb_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h);
void _engage_tray_layout(Engage_Bar *eb);
void _engage_tray_freeze(Engage_Bar *eb);
void _engage_tray_thaw(Engage_Bar *eb);
extern void _engage_bar_frame_resize(Engage_Bar *eb);
void
_engage_tray_init(Engage_Bar *eb)
{
/* FIXME - temp */
eb->tray = malloc(sizeof(Engage_Tray));
eb->tray->icons = 0;
eb->tray->w = 1;
eb->tray->h = 1;
eb->tray->wins = NULL;
eb->tray->tray = evas_object_rectangle_add(eb->evas);
eb->tray->msg_handler = NULL;
eb->tray->dst_handler = NULL;
eb->tray->win = 0;
evas_object_resize(eb->tray->tray, eb->tray->w, eb->tray->h);
evas_object_color_set(eb->tray->tray, 180, 0, 0, 255);
evas_object_show(eb->tray->tray);
_engage_tray_thaw(eb);
edje_object_part_swallow(eb->bar_object, "tray", eb->tray->tray);
_engage_tray_active_set(eb, eb->conf->tray);
}
void
_engage_tray_shutdown(Engage_Bar *eb)
{
_engage_tray_freeze(eb);
edje_object_part_unswallow(eb->bar_object, eb->tray->tray);
_engage_tray_active_set(eb, 0);
evas_list_free(eb->tray->wins);
evas_object_del(eb->tray->tray);
free(eb->tray);
eb->tray = NULL;
}
void
_engage_tray_active_set(Engage_Bar *eb, int active)
{
Ecore_X_Window win;
Display *display;
Window root;
char buf[32];
Atom selection_atom;
Evas_Coord x, y, w, h;
Ecore_X_Time time;
win = 0;
if (active)
{
win = eb->con->bg_win;
time = ecore_x_current_time_get();
eb->tray->select_time = time;
}
else
{
time = eb->tray->select_time;
}
display = ecore_x_display_get();
root = RootWindow (display, DefaultScreen(display));
snprintf(buf, sizeof(buf), "_NET_SYSTEM_TRAY_S%d", DefaultScreen(display));
selection_atom = ecore_x_atom_get(buf);
XSetSelectionOwner (display, selection_atom, win, time);
if (active &&
XGetSelectionOwner (display, selection_atom) == eb->con->bg_win)
{
printf("am a system tray :) :)\n");
ecore_x_client_message32_send(root, ecore_x_atom_get("MANAGER"),
ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
CurrentTime, selection_atom, win, 0, 0);
evas_object_geometry_get(eb->tray->tray, &x, &y, &w, &h);
if (w < 1) w = 1;
if (h < 1) h = 1;
eb->tray->win = ecore_x_window_new(eb->con->bg_win, x, y, w, h);
ecore_x_window_container_manage(eb->tray->win);
ecore_x_window_background_color_set(eb->tray->win, 0xcccc, 0xcccc, 0xcccc);
eb->tray->msg_handler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, _engage_tray_cb_msg, eb);
eb->tray->dst_handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY, _engage_tray_cb_msg, eb);
}
else
{
if (eb->tray->msg_handler)
ecore_event_handler_del(eb->tray->msg_handler);
if (eb->tray->dst_handler)
ecore_event_handler_del(eb->tray->dst_handler);
if (eb->tray->win)
ecore_x_window_del(eb->tray->win);
}
}
void
_engage_tray_freeze(Engage_Bar *eb)
{
if (!eb->tray)
return;
evas_object_intercept_move_callback_del(eb->tray->tray, _engage_tray_cb_move);
evas_object_intercept_resize_callback_del(eb->tray->tray, _engage_tray_cb_resize);
}
void
_engage_tray_thaw(Engage_Bar *eb)
{
if (!eb->tray)
return;
evas_object_intercept_move_callback_add(eb->tray->tray, _engage_tray_cb_move, eb);
evas_object_intercept_resize_callback_add(eb->tray->tray, _engage_tray_cb_resize, eb);
}
static void
_engage_tray_add(Engage_Bar *eb, Ecore_X_Window win)
{
if (!eb->conf->tray)
return;
if (evas_list_find(eb->tray->wins, (void *)win))
return;
ecore_x_window_show(eb->tray->win);
/* we want to insert at the end, so as not to move all icons on each add */
eb->tray->wins = evas_list_append(eb->tray->wins, (void *)win);
eb->tray->icons++;
ecore_x_window_resize(win, 24, 24);
ecore_x_window_reparent(win, eb->tray->win, 0, 0);
_engage_tray_layout(eb);
_engage_bar_frame_resize(eb);
ecore_x_window_show(win);
}
static void
_engage_tray_remove(Engage_Bar *eb, Ecore_X_Window win) {
if (!eb->conf->tray)
return;
if (!win)
return;
if (!evas_list_find(eb->tray->wins, (void *)win)) /* if was not found */
return;
eb->tray->wins = evas_list_remove(eb->tray->wins, (void *)win);
eb->tray->icons--;
_engage_tray_layout(eb);
_engage_bar_frame_resize(eb);
if (eb->tray->icons == 0)
ecore_x_window_hide(eb->tray->win);
}
static int
_engage_tray_cb_msg(void *data, int type, void *event)
{
Ecore_X_Event_Client_Message *ev;
Ecore_X_Event_Window_Destroy *dst;
Engage_Bar *eb;
eb = data;
if (!eb->conf->tray)
return 1;
if (type == ECORE_X_EVENT_CLIENT_MESSAGE) {
ev = event;
if (ev->message_type == ecore_x_atom_get("_NET_SYSTEM_TRAY_OPCODE")) {
_engage_tray_add(eb, (Ecore_X_Window) ev->data.l[2]);
/* Should proto be set according to clients _XEMBED_INFO? */
ecore_x_client_message32_send(ev->data.l[2], ecore_x_atom_get("_XEMBED"),
ECORE_X_EVENT_MASK_NONE, CurrentTime,
XEMBED_EMBEDDED_NOTIFY, 0, eb->con->bg_win, /*proto*/1);
} else if (ev->message_type == ecore_x_atom_get("_NET_SYSTEM_TRAY_MESSAGE_DATA")) {
printf("got message\n");
}
} else if (type == ECORE_X_EVENT_WINDOW_DESTROY) {
dst = event;
_engage_tray_remove(eb, (Ecore_X_Window) dst->win);
}
return 1;
}
static void
_engage_tray_cb_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y)
{
Engage_Bar *eb;
eb = data;
evas_object_move(o, x, y);
if (eb->conf->tray)
ecore_x_window_move(eb->tray->win, (int) x, (int) y);
}
static void
_engage_tray_cb_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h)
{
Engage_Bar *eb;
eb = data;
evas_object_resize(o, w, h);
_engage_tray_layout(eb);
}
void
_engage_tray_layout(Engage_Bar *eb)
{
Evas_Coord w, h, c, d;
int x, y;
Evas_List *wins;
E_Gadman_Edge edge;
if (!eb->gmc || !eb->conf || !eb->tray)
return;
edge = e_gadman_client_edge_get(eb->gmc);
if (!eb->conf->tray)
{
int w, h;
if (edge == E_GADMAN_EDGE_BOTTOM || edge == E_GADMAN_EDGE_TOP)
{
w = 0;
h = eb->conf->iconsize;
}
else
{
w = eb->conf->iconsize;
h = 0;
}
edje_object_part_unswallow(eb->bar_object, eb->tray->tray);
evas_object_resize(eb->tray->tray, w, h);
edje_extern_object_min_size_set(eb->tray->tray, w, h);
edje_extern_object_max_size_set(eb->tray->tray, w, h);
edje_object_part_swallow(eb->bar_object, "tray", eb->tray->tray);
return;
}
h = eb->conf->iconsize;
if (h < 24)
h = 24;
c = (h - (h % 24)) / 24;
w = (eb->tray->icons / c);
if ((eb->tray->icons % c) != 0)
w++;
w *= 24;
_engage_tray_freeze(eb);
edje_object_part_unswallow(eb->bar_object, eb->tray->tray);
if (edge == E_GADMAN_EDGE_BOTTOM || edge == E_GADMAN_EDGE_TOP) {
evas_object_resize(eb->tray->tray, w, h);
ecore_x_window_resize(eb->tray->win, (int) w, (int) h);
edje_extern_object_min_size_set(eb->tray->tray, w, h);
edje_extern_object_max_size_set(eb->tray->tray, w, h);
} else {
evas_object_resize(eb->tray->tray, h, w);
ecore_x_window_resize(eb->tray->win, (int) h, (int) w);
edje_extern_object_min_size_set(eb->tray->tray, h, w);
edje_extern_object_max_size_set(eb->tray->tray, h, w);
}
_engage_tray_thaw(eb);
edje_object_part_swallow(eb->bar_object, "tray", eb->tray->tray);
x = 0;
if (edge == E_GADMAN_EDGE_BOTTOM || edge == E_GADMAN_EDGE_RIGHT)
y = h - 24;
else
y = 0;
d = 0;
for (wins = eb->tray->wins; wins; wins = wins->next) {
if (edge == E_GADMAN_EDGE_BOTTOM || edge == E_GADMAN_EDGE_TOP)
ecore_x_window_move((Ecore_X_Window) wins->data, x, y);
else
ecore_x_window_move((Ecore_X_Window) wins->data, y, x);
d++;
if (d % c == 0) {
x += 24;
if (edge == E_GADMAN_EDGE_BOTTOM || edge == E_GADMAN_EDGE_RIGHT)
y = h - 24;
else
y = 0;
} else
if (edge == E_GADMAN_EDGE_BOTTOM || edge == E_GADMAN_EDGE_RIGHT)
y -= 24;
else
y += 24;
}
}
Loading…
Cancel
Save