This email list is read-only. Emails sent to this list will be discarded
----------------------------------
Makefile | 18 --
Makefile.am | 9 +
app-switcher.c | 605 ---------------------------------------------------
autogen.sh | 10 +
configure.in | 18 ++
src/Makefile.am | 19 ++
src/app-switcher.c | 606 ++++++++++++++++++++++++++++++++++++++++++++++++++++
src/moblin-film.c | 431 +++++++++++++++++++++++++++++++++++++
src/moblin-film.h | 93 ++++++++
src/tween.c | 378 ++++++++++++++++++++++++++++++++
src/tween.h | 42 ++++
tween.c | 378 --------------------------------
tween.h | 42 ----
13 files changed, 1606 insertions(+), 1043 deletions(-)
New commits:
commit 8fc8f57f65609d7023bf27f61d0dfcb2c7e63c95
Author: James Ketrenos <[EMAIL PROTECTED]>
Date: Tue Nov 4 06:48:08 2008 -0800
Autoconfuscated
Signed-off-by: James Ketrenos <[EMAIL PROTECTED]>
Diff in this email is a maximum of 400 lines.
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..e69de29
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..e69de29
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..e69de29
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..e69de29
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..e69de29
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 56b3f32..0000000
--- a/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-app-switcher: app-switcher.c
- gcc -ggdb -o app-switcher app-switcher.c tween.c \
- -Wall \
- -DWNCK_I_KNOW_THIS_IS_UNSTABLE \
- -I/usr/include/clutter-0.7 \
- -I/usr/include/glib-2.0 \
- -I/usr/lib/glib-2.0/include \
- -I/usr/include/libwnck-1.0 \
- -I/usr/include/gtk-2.0 \
- -I/usr/include/cairo \
- -I/usr/include/pango-1.0 \
- -I/usr/lib/gtk-2.0/include \
- -I/usr/include/atk-1.0 \
- -lwnck-1 \
- -lclutter-glx-0.7
-
-clean:
- rm -f app-switcher *.o *~
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..51aa523
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,9 @@
+EXTRA_DIST = autogen.sh
+SUBDIRS = src
+
+real-clean:
+ make clean
+ make -C src real-clean
+ rm -rf aclocal.m4 autom4te.cache config.log config.status \
+ configure depcomp install-sh Makefile.in missing \
+ Makefile config.sub config.guess libtool ltmain.sh
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
diff --git a/app-switcher.c b/app-switcher.c
deleted file mode 100644
index 1eb68fb..0000000
--- a/app-switcher.c
+++ /dev/null
@@ -1,605 +0,0 @@
-#include <libwnck/libwnck.h>
-#include <clutter/clutter.h>
-#include <clutter/x11/clutter-x11.h>
-#include <clutter/glx/clutter-glx.h>
-#include <clutter/glx/clutter-glx-texture-pixmap.h>
-#include <X11/Xlib.h>
-#include <X11/extensions/Xcomposite.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "tween.h"
-
-#define SCREEN_WIDTH 800
-#define SCREEN_HEIGHT 480
-
-#define THUMB_WIDTH 160
-#define THUMB_HEIGHT 96
-#define CYCLE_TIME_MS 2000
-
-const ClutterColor black = { 0x00, 0x00, 0x00, 0xff };
-const ClutterColor white = { 0xff, 0xff, 0xff, 0xff };
-
-typedef struct _MoblinWindowActor {
- ClutterActor *actor;
- ClutterActor *reflection;
- Window xid;
- gint w, h;
- gint thumb_w, thumb_h;
- gint dying;
- gint active;
-} MoblinWindowActor;
-
-GList *window_actors = NULL;
-
-
-/*
- * MoblinWindowActor is in one of three states:
- * THUMB ACTIVATING
- * THUMB NORMAL
- * ACTIVE ACTIVATING
- * ACTIVE NORMAL
- *
- */
-
-/*
- * film_strip_layout
- *
- * Walk through the list of window_actors. If the window is the *active*
- * window then skip it (last on list).
- * If the window opacity is 0 tween to full opacity.
- * Tween to target calculated position.
- *
- * NOTE: window_actors list is assumed to sorted such that the active window
- * is the last window in the list.
- */
-void film_strip_layout()
-{
- GList *iter;
- MoblinWindowActor *window_actor = NULL;
- int x, y = 0;
-
- iter = window_actors;
- while (iter != NULL) {
- window_actor = (MoblinWindowActor *)iter->data;
- if (iter->next && !window_actor->dying)
- y += window_actor->thumb_h + 8;
- iter = iter->next;
- }
-
- x = 12;
- y = (CLUTTER_STAGE_HEIGHT() - y) / 2;
-
- iter = window_actors;
-
- while (iter != NULL) {
- gchar opacity;
- gint yp, xp;
-
- window_actor = (MoblinWindowActor *)iter->data;
-
- if (!iter->next) {
- if (!window_actor->active) {
- gdouble target_w, target_h;
-
- printf("Activating actor.\n");
- /* We want to calculate the scaling factor
- * for the largest window that will fit into
- * the "active app" region */
- window_actor->active = 1;
- target_w = CLUTTER_STAGE_WIDTH() -
- (THUMB_WIDTH + 32);
- if (target_w * window_actor->h /
- window_actor->w >
- (2.0 * CLUTTER_STAGE_HEIGHT() / 3.0 - 8)) {
- target_w = (2.0 *
- CLUTTER_STAGE_HEIGHT() /
- 3.0 - 8) * window_actor->w
/
- window_actor->h;
-
- }
-
- target_h = target_w * window_actor->h /
- window_actor->w;
-
- tween(window_actor->actor, 300,
- "x", (float)THUMB_WIDTH + 24 +
- (CLUTTER_STAGE_WIDTH() -
- (THUMB_WIDTH + 32) - target_w) / 2.0,
- "y",
- 2.0 * CLUTTER_STAGE_HEIGHT() / 3.0 -
- target_h,
- "opacity", 255.0,
- "scale", target_w /
- clutter_actor_get_width(
- window_actor->actor),
- NULL);
-
- clutter_actor_set_opacity(
- window_actor->reflection, 0);
- clutter_actor_set_size(
- window_actor->reflection,
- (gint)target_w, (gint)target_h);
- clutter_actor_set_position(
- window_actor->reflection,
- THUMB_WIDTH + 24 +
- (CLUTTER_STAGE_WIDTH() -
- (THUMB_WIDTH + 32) - target_w) / 2.0,
- 2.0 * CLUTTER_STAGE_HEIGHT() / 3.0 +
- (target_h + 8));
- clutter_actor_show(window_actor->reflection);
- tween(window_actor->reflection, 1500,
- "opacity", 255.0 / 3.0,
- NULL);
- }
-
- break;
- }
-
-
- if (window_actor->dying) {
- iter = iter->next;
- continue;
- }
-
- opacity = clutter_actor_get_opacity(window_actor->actor);
- clutter_actor_get_position(window_actor->actor, &xp, &yp);
- if (opacity == 0) {
- printf("Showing NON-ACTIVE actor.\n");
- clutter_actor_set_position(
- window_actor->actor,
- x +
- (THUMB_WIDTH - window_actor->thumb_w) / 2,
- y + (window_actor->thumb_h / 2));
- tween(window_actor->actor, 1000,
- "x", (float)
- x +
- (THUMB_WIDTH - window_actor->thumb_w) / 2,
- "y", (float)y,
- "scale", (gdouble)(window_actor->thumb_w /
- clutter_actor_get_width(
- window_actor->actor)),
- "opacity", 255.0, NULL);
- } else {
- printf("Moving actor.\n");
- if (window_actor->active)
- window_actor->active = 0;
- tween(window_actor->actor, 500,
- "x", (float)
- x +
- (THUMB_WIDTH - window_actor->thumb_w) / 2,
- "y", (float)y,
- "scale", (gdouble)(window_actor->thumb_w /
- clutter_actor_get_width(
- window_actor->actor)),
- NULL);
- }
-
- tween(window_actor->reflection, 100,
- "opacity", 0.0,
- NULL);
-
- y += window_actor->thumb_h + 8;
- iter = iter->next;
- }
-
- iter = window_actors;
- while (iter != NULL) {
- window_actor = (MoblinWindowActor *)iter->data;
- if (window_actor->dying &&
- clutter_actor_get_opacity(window_actor->actor) == 0) {
- /* This actor was dying and is dead... so nuke it.
- * FIXME: Use safe lists so we can nuke and continue
- * walking the list vs. only taking out one per pass */
- printf("Nuking 0x%08lx\n", window_actor->xid);
- clutter_container_remove_actor(
- CLUTTER_CONTAINER(clutter_stage_get_default()),
- window_actor->actor);
- free(window_actor);
- window_actors = g_list_delete_link(window_actors,
- iter);
- break;
- }
-
- iter = iter->next;
- }
-}
-
-static void button_press_event(ClutterActor *actor,
- ClutterButtonEvent *button_event,
- MoblinWindowActor *window_actor)
-{
- printf("Button pressed for window 0x%08lx\n", window_actor->xid);
- if (window_actor->active) {
- XButtonEvent bev;
- gint xp, yp;
- float x, y;
-
- clutter_actor_get_position(actor, &xp, &yp);
-
- x = button_event->x - xp;
- y = button_event->y - yp;
-
- x = (x / clutter_actor_get_width(actor)) * window_actor->w;
- y = (y / clutter_actor_get_height(actor)) * window_actor->h;
- printf("Press at %d, %d\n", (int)x, (int)y);
- } else {
- XSetInputFocus(clutter_x11_get_default_display(),
- window_actor->xid, RevertToNone, CurrentTime);
- }
-}
-
-MoblinWindowActor *moblin_window_actor_new(Window xid)
-{
- MoblinWindowActor *actor;
- float w, h;
-
- actor = malloc(sizeof(*actor));
- memset(actor, 0, sizeof(*actor));
- actor->xid = xid;
-
- actor->actor = clutter_glx_texture_pixmap_new_with_window(xid);
- clutter_texture_set_filter_quality(CLUTTER_TEXTURE(actor->actor),
- CLUTTER_TEXTURE_QUALITY_MEDIUM);
- clutter_x11_texture_pixmap_set_automatic(
- CLUTTER_X11_TEXTURE_PIXMAP(actor->actor), TRUE);
-
- actor->w = clutter_actor_get_width(actor->actor);
- actor->h = clutter_actor_get_height(actor->actor);
-
- actor->reflection = clutter_clone_texture_new(
- CLUTTER_TEXTURE(actor->actor));
- clutter_actor_set_size(actor->reflection, actor->w, actor->h);
- clutter_actor_set_opacity(actor->reflection, 0);
- clutter_actor_set_rotation(actor->reflection, CLUTTER_X_AXIS, 180.0,
- 0, h / 2, 0);
- clutter_actor_hide(actor->reflection);
-
- w = actor->w;
- h = actor->h;
-
- if (w == 0 || h == 0) {
- /* For now if the window dimensions are zero, we don't
- * try and use it -- we could potenitally pull the
- * the thumbnail or icon for the window and use that
- */
- printf("Skipping 0x%08lx -- zero sized window...\n", xid);
- free(actor);
- return NULL;
- }
-
- if (w > h) {
- h = THUMB_WIDTH * h / w;
- w = THUMB_WIDTH;
- if (h > THUMB_HEIGHT) {
- w = THUMB_HEIGHT * w / h;
- h = THUMB_HEIGHT;
- }
- } else {
- w = THUMB_HEIGHT * w / h;
- h = THUMB_HEIGHT;
- if (w > THUMB_WIDTH) {
- h = THUMB_WIDTH * h / w;
- w = THUMB_WIDTH;
- }
- }
-
- actor->thumb_w = w;
- actor->thumb_h = h;
-
- clutter_actor_set_reactive(actor->actor, TRUE);
- g_signal_connect(actor->actor, "button-press-event",
- G_CALLBACK(button_press_event),
- actor);
-
- clutter_actor_set_size(actor->actor, w, h);
- clutter_container_add(
- CLUTTER_CONTAINER(clutter_stage_get_default()), actor->actor,
- actor->reflection, NULL);
-
- return actor;
-}
-
-MoblinWindowActor *film_strip_insert_window(Window xid)
-{
- MoblinWindowActor *window_actor = NULL;
- GList *iter = window_actors;
-
- /* Find the MoblinWindowActor for this xid */
- while (iter != NULL) {
- window_actor = (MoblinWindowActor *)iter->data;
- if (window_actor->xid == xid)
- break;
- window_actor = NULL;
- iter = iter->next;
- }
-
- /* If the xid doesn't exist, create a new MoblinWindowActor */
- if (!window_actor) {
- window_actor = moblin_window_actor_new(xid);
- if (!window_actor)
- return NULL;
- window_actors = g_list_append(window_actors, window_actor);
- clutter_actor_set_opacity(window_actor->actor, 0);
- clutter_actor_show(window_actor->actor);
-
- }
-
- film_strip_layout();
-
- return window_actor;
-}
-
-void film_strip_remove_window(Window xid)
-{
- MoblinWindowActor *window_actor;
_______________________________________________
Commits mailing list
[email protected]
https://lists.moblin.org/mailman/listinfo/commits