summaryrefslogtreecommitdiff
path: root/trashapplet/src
diff options
context:
space:
mode:
Diffstat (limited to 'trashapplet/src')
-rw-r--r--trashapplet/src/Makefile.am2
-rw-r--r--trashapplet/src/trashapplet.c8
-rw-r--r--trashapplet/src/xstuff.c179
-rw-r--r--trashapplet/src/xstuff.h10
4 files changed, 0 insertions, 199 deletions
diff --git a/trashapplet/src/Makefile.am b/trashapplet/src/Makefile.am
index 6cb5ef0a..8e5eec2e 100644
--- a/trashapplet/src/Makefile.am
+++ b/trashapplet/src/Makefile.am
@@ -12,8 +12,6 @@ APPLET_SOURCES = \
trashapplet.c \
trash-empty.h \
trash-empty.c \
- xstuff.c \
- xstuff.h \
$(NULL)
APPLET_LIBS = \
diff --git a/trashapplet/src/trashapplet.c b/trashapplet/src/trashapplet.c
index 4a78623d..e4f2966b 100644
--- a/trashapplet/src/trashapplet.c
+++ b/trashapplet/src/trashapplet.c
@@ -35,7 +35,6 @@
#include <mate-panel-applet.h>
#include "trash-empty.h"
-#include "xstuff.h"
#define TRASH_TYPE_APPLET (trash_applet_get_type ())
@@ -263,14 +262,7 @@ trash_applet_button_release (GtkWidget *widget,
(event->type != GDK_2BUTTON_PRESS) &&
(event->type != GDK_3BUTTON_PRESS))
{
-#if defined(GDK_WINDOWING_X11) && !defined(ENABLE_IN_PROCESS)
- if (GDK_IS_X11_DISPLAY (gtk_widget_get_display (widget)) &&
- g_settings_get_boolean (settings, PANEL_ENABLE_ANIMATIONS))
- xstuff_zoom_animate (widget, NULL);
-#endif
-
trash_applet_open_folder (NULL, applet);
-
return TRUE;
}
diff --git a/trashapplet/src/xstuff.c b/trashapplet/src/xstuff.c
deleted file mode 100644
index fa990eb3..00000000
--- a/trashapplet/src/xstuff.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * MATE panel x stuff
- *
- * Copyright (C) 2000, 2001 Eazel, Inc.
- * 2002 Sun Microsystems Inc.
- *
- * Authors: George Lebl <[email protected]>
- * Mark McLoughlin <[email protected]>
- *
- * Contains code from the Window Maker window manager
- *
- * Copyright (c) 1997-2002 Alfredo K. Kojima
-
- */
-#include <config.h>
-#include <unistd.h>
-
-#include <gdk/gdk.h>
-#include <gdk/gdkx.h>
-
-#include <X11/Xlib.h>
-
-#include "xstuff.h"
-
-/* Zoom animation */
-#define MINIATURIZE_ANIMATION_FRAMES_Z 1
-#define MINIATURIZE_ANIMATION_STEPS_Z 6
-/* the delay per draw */
-#define MINIATURIZE_ANIMATION_DELAY_Z 10
-
-static void
-draw_zoom_animation (GdkScreen *gscreen,
- int x, int y, int w, int h,
- int fx, int fy, int fw, int fh,
- int steps)
-{
-#define FRAMES (MINIATURIZE_ANIMATION_FRAMES_Z)
- float cx[FRAMES], cy[FRAMES], cw[FRAMES], ch[FRAMES];
- int cxi[FRAMES], cyi[FRAMES], cwi[FRAMES], chi[FRAMES];
- float xstep, ystep, wstep, hstep;
- int i, j;
- GC frame_gc;
- XGCValues gcv;
- GdkColor color = { 0, 65535, 65535, 65535 };
- Display *dpy;
- Window root_win;
- int screen;
- int depth;
-
- dpy = gdk_x11_display_get_xdisplay (gdk_screen_get_display (gscreen));
- root_win = GDK_WINDOW_XID (gdk_screen_get_root_window (gscreen));
- screen = gdk_x11_screen_get_screen_number (gscreen);
- depth = DefaultDepth(dpy,screen);
-
- /* frame GC */
- gcv.function = GXxor;
- /* this will raise the probability of the XORed color being different
- * of the original color in PseudoColor when not all color cells are
- * initialized */
- if (DefaultVisual(dpy, screen)->class==PseudoColor)
- gcv.plane_mask = (1<<(depth-1))|1;
- else
- gcv.plane_mask = AllPlanes;
- gcv.foreground = color.pixel;
- if (gcv.foreground == 0)
- gcv.foreground = 1;
- gcv.line_width = 1;
- gcv.subwindow_mode = IncludeInferiors;
- gcv.graphics_exposures = False;
-
- frame_gc = XCreateGC(dpy, root_win, GCForeground|GCGraphicsExposures
- |GCFunction|GCSubwindowMode|GCLineWidth
- |GCPlaneMask, &gcv);
-
- xstep = (float)(fx-x)/steps;
- ystep = (float)(fy-y)/steps;
- wstep = (float)(fw-w)/steps;
- hstep = (float)(fh-h)/steps;
-
- for (j=0; j<FRAMES; j++) {
- cx[j] = (float)x;
- cy[j] = (float)y;
- cw[j] = (float)w;
- ch[j] = (float)h;
- cxi[j] = (int)cx[j];
- cyi[j] = (int)cy[j];
- cwi[j] = (int)cw[j];
- chi[j] = (int)ch[j];
- }
- XGrabServer(dpy);
- for (i=0; i<steps; i++) {
- for (j=0; j<FRAMES; j++) {
- XDrawRectangle(dpy, root_win, frame_gc, cxi[j], cyi[j], cwi[j], chi[j]);
- }
- XFlush(dpy);
-#if (MINIATURIZE_ANIMATION_DELAY_Z > 0)
- usleep(MINIATURIZE_ANIMATION_DELAY_Z);
-#else
- usleep(10);
-#endif
- for (j=0; j<FRAMES; j++) {
- XDrawRectangle(dpy, root_win, frame_gc,
- cxi[j], cyi[j], cwi[j], chi[j]);
- if (j<FRAMES-1) {
- cx[j]=cx[j+1];
- cy[j]=cy[j+1];
- cw[j]=cw[j+1];
- ch[j]=ch[j+1];
-
- cxi[j]=cxi[j+1];
- cyi[j]=cyi[j+1];
- cwi[j]=cwi[j+1];
- chi[j]=chi[j+1];
-
- } else {
- cx[j]+=xstep;
- cy[j]+=ystep;
- cw[j]+=wstep;
- ch[j]+=hstep;
-
- cxi[j] = (int)cx[j];
- cyi[j] = (int)cy[j];
- cwi[j] = (int)cw[j];
- chi[j] = (int)ch[j];
- }
- }
- }
-
- for (j=0; j<FRAMES; j++) {
- XDrawRectangle(dpy, root_win, frame_gc,
- cxi[j], cyi[j], cwi[j], chi[j]);
- }
- XFlush(dpy);
-#if (MINIATURIZE_ANIMATION_DELAY_Z > 0)
- usleep(MINIATURIZE_ANIMATION_DELAY_Z);
-#else
- usleep(10);
-#endif
- for (j=0; j<FRAMES; j++) {
- XDrawRectangle(dpy, root_win, frame_gc,
- cxi[j], cyi[j], cwi[j], chi[j]);
- }
-
- XUngrabServer(dpy);
- XFreeGC (dpy, frame_gc);
-}
-#undef FRAMES
-
-void
-xstuff_zoom_animate (GtkWidget *widget, GdkRectangle *opt_rect)
-{
- GdkScreen *gscreen;
- GdkRectangle rect, dest;
- GtkAllocation allocation;
- GdkMonitor *monitor;
-
- if (opt_rect)
- rect = *opt_rect;
- else {
- gdk_window_get_origin (gtk_widget_get_window (widget), &rect.x, &rect.y);
- gtk_widget_get_allocation (widget, &allocation);
- if (!gtk_widget_get_has_window (widget)) {
- rect.x += allocation.x;
- rect.y += allocation.y;
- }
- rect.height = allocation.height;
- rect.width = allocation.width;
- }
-
- gscreen = gtk_widget_get_screen (widget);
- monitor = gdk_display_get_monitor_at_window (gdk_screen_get_display (gscreen),
- gtk_widget_get_window (widget));
- gdk_monitor_get_geometry (monitor, &dest);
-
- draw_zoom_animation (gscreen,
- rect.x, rect.y, rect.width, rect.height,
- dest.x, dest.y, dest.width, dest.height,
- MINIATURIZE_ANIMATION_STEPS_Z);
-}
diff --git a/trashapplet/src/xstuff.h b/trashapplet/src/xstuff.h
deleted file mode 100644
index 0431ce79..00000000
--- a/trashapplet/src/xstuff.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __XSTUFF_H__
-#define __XSTUFF_H__
-
-#include <gdk/gdk.h>
-#include <gtk/gtk.h>
-
-void xstuff_zoom_animate (GtkWidget *widget,
- GdkRectangle *opt_src_rect);
-
-#endif /* __XSTUFF_H__ */