diff options
40 files changed, 0 insertions, 1951 deletions
diff --git a/eel/Makefile.am b/eel/Makefile.am index b2f35e95..d7a7515a 100644 --- a/eel/Makefile.am +++ b/eel/Makefile.am @@ -37,7 +37,6 @@ eel_headers = \ eel-background.h \ eel-background-box.h \ eel-canvas.h \ - eel-canvas-util.h \ eel-canvas-rect-ellipse.h \ eel-debug.h \ eel-editable-label.h \ @@ -67,7 +66,6 @@ libeel_2_la_SOURCES = \ eel-background.c \ eel-background-box.c \ eel-canvas.c \ - eel-canvas-util.c \ eel-canvas-rect-ellipse.c \ eel-debug.c \ eel-editable-label.c \ diff --git a/eel/eel-art-gtk-extensions.c b/eel/eel-art-gtk-extensions.c index 5e7f4dab..610cf129 100644 --- a/eel/eel-art-gtk-extensions.c +++ b/eel/eel-art-gtk-extensions.c @@ -25,116 +25,6 @@ #include <config.h> #include "eel-art-gtk-extensions.h" -#include <gdk/gdkx.h> - -#if !GTK_CHECK_VERSION(3,0,0) -#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y) -#endif - -/** - * eel_gdk_rectangle_to_eel_irect: - * @gdk_rectangle: The source GdkRectangle. - * - * Return value: An EelIRect representation of the GdkRectangle. - * - * This is a very simple conversion of rectangles from the Gdk to the Libeel - * universe. This is useful in code that does clipping (or other operations) - * using libeel and has a GdkRectangle to work with - for example expose_event() - * in GtkWidget's. - */ -EelIRect -eel_gdk_rectangle_to_eel_irect (GdkRectangle gdk_rectangle) -{ - EelIRect rectangle; - - rectangle.x0 = gdk_rectangle.x; - rectangle.y0 = gdk_rectangle.y; - rectangle.x1 = rectangle.x0 + (int) gdk_rectangle.width; - rectangle.y1 = rectangle.y0 + (int) gdk_rectangle.height; - - return rectangle; -} - -/** - * eel_screen_get_dimensions: - * - * Return value: The screen dimensions. - * - */ -EelDimensions -eel_screen_get_dimensions (void) -{ - EelDimensions screen_dimensions; - - screen_dimensions.width = gdk_screen_width (); - screen_dimensions.height = gdk_screen_height (); - - g_assert (screen_dimensions.width > 0); - g_assert (screen_dimensions.height > 0); - - return screen_dimensions; -} - -/** - * eel_gdk_window_get_bounds: - * @gdk_window: The source GdkWindow. - * - * Return value: An EelIRect representation of the given GdkWindow's geometry - * relative to its parent in the Gdk window hierarchy. - * - */ -EelIRect -eel_gdk_window_get_bounds (GdkWindow *gdk_window) -{ - EelIRect bounds; - int width; - int height; - - g_return_val_if_fail (gdk_window != NULL, eel_irect_empty); - - gdk_window_get_position (gdk_window, &bounds.x0, &bounds.y0); - - width = gdk_window_get_width(gdk_window); - height = gdk_window_get_height(gdk_window); - - bounds.x1 = bounds.x0 + width; - bounds.y1 = bounds.y0 + height; - - return bounds; -} - -/** - * eel_gdk_window_get_bounds: - * @gdk_window: The source GdkWindow. - * - * Return value: An EelIRect representation of the given GdkWindow's geometry - * relative to the screen. - * - */ -EelIRect -eel_gdk_window_get_screen_relative_bounds (GdkWindow *gdk_window) -{ - EelIRect screen_bounds; - int width; - int height; - - g_return_val_if_fail (gdk_window != NULL, eel_irect_empty); - - if (!gdk_window_get_origin (gdk_window, - &screen_bounds.x0, - &screen_bounds.y0)) - { - return eel_irect_empty; - } - - width = gdk_window_get_width(gdk_window); - height = gdk_window_get_height(gdk_window); - - screen_bounds.x1 = screen_bounds.x0 + width; - screen_bounds.y1 = screen_bounds.y0 + height; - - return screen_bounds; -} /** * eel_gtk_widget_get_bounds: @@ -178,173 +68,3 @@ eel_gtk_widget_get_dimensions (GtkWidget *gtk_widget) return dimensions; } - -/** - * eel_gtk_widget_get_preferred_dimensions: - * @gtk_widget: The source GtkWidget. - * - * Return value: The widget's preferred dimensions. The preferred dimensions are - * computed by calling the widget's 'size_request' method and thus - * could potentially be expensive for complicated widgets. - */ -EelDimensions -eel_gtk_widget_get_preferred_dimensions (GtkWidget *gtk_widget) -{ - GtkRequisition requisition; - EelDimensions preferred_dimensions; - - g_return_val_if_fail (GTK_IS_WIDGET (gtk_widget), eel_dimensions_empty); - - gtk_widget_get_preferred_size (gtk_widget, &requisition, NULL); - - preferred_dimensions.width = (int) requisition.width; - preferred_dimensions.height = (int) requisition.height; - - return preferred_dimensions; -} - -/** - * eel_gdk_window_clip_dirty_area_to_screen: - * @gdk_window: The GdkWindow that the damage occured on. - * @dirty_area: The dirty area as an EelIRect. - * - * Return value: An EelIRect of the dirty area clipped to the screen. - * - * This function is useful to do less work in expose_event() GtkWidget methods. - * It also ensures that any drawing that the widget does is actually onscreen. - */ -EelIRect -eel_gdk_window_clip_dirty_area_to_screen (GdkWindow *gdk_window, - EelIRect dirty_area) -{ - EelIRect clipped; - EelDimensions screen_dimensions; - EelIRect screen_relative_bounds; - int dirty_width; - int dirty_height; - - g_return_val_if_fail (gdk_window != NULL, eel_irect_empty); - - dirty_width = dirty_area.x1 - dirty_area.x0; - dirty_height = dirty_area.y1 - dirty_area.y0; - - g_return_val_if_fail (dirty_width > 0, eel_irect_empty); - g_return_val_if_fail (dirty_height > 0, eel_irect_empty); - - screen_dimensions = eel_screen_get_dimensions (); - screen_relative_bounds = eel_gdk_window_get_screen_relative_bounds (gdk_window); - - /* Window is obscured by left edge of screen */ - if ((screen_relative_bounds.x0 + dirty_area.x0) < 0) - { - int clipped_width = screen_relative_bounds.x0 + dirty_area.x0 + dirty_width; - clipped.x0 = dirty_area.x0 + dirty_width - clipped_width; - clipped.x1 = clipped.x0 + clipped_width; - } - else - { - clipped.x0 = dirty_area.x0; - clipped.x1 = clipped.x0 + dirty_width; - } - - /* Window is obscured by right edge of screen */ - if (screen_relative_bounds.x1 > screen_dimensions.width) - { - int obscured_width; - - obscured_width = - screen_relative_bounds.x0 + dirty_area.x0 + dirty_width - screen_dimensions.width; - - if (obscured_width > 0) - { - clipped.x1 -= obscured_width; - } - } - - /* Window is obscured by top edge of screen */ - if ((screen_relative_bounds.y0 + dirty_area.y0) < 0) - { - int clipped_height = screen_relative_bounds.y0 + dirty_area.y0 + dirty_height; - clipped.y0 = dirty_area.y0 + dirty_height - clipped_height; - clipped.y1 = clipped.y0 + clipped_height; - } - else - { - clipped.y0 = dirty_area.y0; - clipped.y1 = clipped.y0 + dirty_height; - } - - /* Window is obscured by bottom edge of screen */ - if (screen_relative_bounds.y1 > screen_dimensions.height) - { - int obscured_height; - - obscured_height = - screen_relative_bounds.y0 + dirty_area.y0 + dirty_height - screen_dimensions.height; - - if (obscured_height > 0) - { - clipped.y1 -= obscured_height; - } - } - - if (eel_irect_is_empty (&clipped)) - { - clipped = eel_irect_empty; - } - - return clipped; -} - -GdkRectangle -eel_irect_to_gdk_rectangle (EelIRect rectangle) -{ - GdkRectangle gdk_rect; - - gdk_rect.x = rectangle.x0; - gdk_rect.y = rectangle.y0; - gdk_rect.width = eel_irect_get_width (rectangle); - gdk_rect.height = eel_irect_get_height (rectangle); - - return gdk_rect; -} - -EelDimensions -eel_gdk_window_get_dimensions (GdkWindow *gdk_window) -{ - EelDimensions dimensions; - - g_return_val_if_fail (gdk_window != NULL, eel_dimensions_empty); - - dimensions.width = gdk_window_get_width(gdk_window); - dimensions.height = gdk_window_get_height(gdk_window); - - return dimensions; -} - -EelIPoint -eel_gdk_get_pointer_position (void) -{ - - EelIPoint position; -#if GTK_CHECK_VERSION (3, 0, 0) - GdkDeviceManager *manager; - GdkDevice *pointer; - - manager = gdk_display_get_device_manager (gdk_window_get_display (gdk_get_default_root_window ())); - pointer = gdk_device_manager_get_client_pointer (manager); - gdk_window_get_device_position (gdk_get_default_root_window (), - pointer, - &position.x, - &position.y, - NULL); -#else - - gdk_window_get_pointer (gdk_get_default_root_window (), - &position.x, - &position.y, - NULL); -#endif - - return position; -} diff --git a/eel/eel-art-gtk-extensions.h b/eel/eel-art-gtk-extensions.h index aea709c3..fbb554d5 100644 --- a/eel/eel-art-gtk-extensions.h +++ b/eel/eel-art-gtk-extensions.h @@ -35,7 +35,6 @@ #ifndef EEL_ART_GTK_EXTENSIONS_H #define EEL_ART_GTK_EXTENSIONS_H -#include <eel/eel-gdk-extensions.h> #include <eel/eel-gtk-extensions.h> #include <eel/eel-art-extensions.h> @@ -43,29 +42,9 @@ extern "C" { #endif - /* Convert between GdkRectangle and EelIRect and back */ - GdkRectangle eel_irect_to_gdk_rectangle (EelIRect rectangle); - EelIRect eel_gdk_rectangle_to_eel_irect (GdkRectangle gdk_rectangle); - EelDimensions eel_screen_get_dimensions (void); - - /* GdkWindow parent-relative bounds */ - EelIRect eel_gdk_window_get_bounds (GdkWindow *window); - - /* GdkWindow dimensions */ - EelDimensions eel_gdk_window_get_dimensions (GdkWindow *window); - - /* GdkWindow screen parent-relative bounds */ - EelIRect eel_gdk_window_get_screen_relative_bounds (GdkWindow *window); - - /* Clip a dirty area (from exposures) to the on screen parts of a GdkWindow */ - EelIRect eel_gdk_window_clip_dirty_area_to_screen (GdkWindow *window, - EelIRect dirty_area); - /* GtkWidget bounds and dimensions */ EelIRect eel_gtk_widget_get_bounds (GtkWidget *widget); EelDimensions eel_gtk_widget_get_dimensions (GtkWidget *widget); - EelDimensions eel_gtk_widget_get_preferred_dimensions (GtkWidget *widget); - EelIPoint eel_gdk_get_pointer_position (void); #ifdef __cplusplus } diff --git a/eel/eel-background.c b/eel/eel-background.c index d62bde6e..f652e98e 100644 --- a/eel/eel-background.c +++ b/eel/eel-background.c @@ -31,7 +31,6 @@ #include "eel-lib-self-check-functions.h" #include <gtk/gtk.h> #include <eel/eel-canvas.h> -#include <eel/eel-canvas-util.h> #if GTK_CHECK_VERSION (3, 0, 0) # include <cairo-xlib.h> #endif diff --git a/eel/eel-canvas-rect-ellipse.c b/eel/eel-canvas-rect-ellipse.c index 0ed0c826..b1300679 100644 --- a/eel/eel-canvas-rect-ellipse.c +++ b/eel/eel-canvas-rect-ellipse.c @@ -35,7 +35,6 @@ #include <config.h> #include <math.h> #include "eel-canvas-rect-ellipse.h" -#include "eel-canvas-util.h" #include <string.h> #ifdef HAVE_RENDER @@ -88,7 +87,6 @@ static void eel_canvas_re_unrealize (EelCanvasItem *item); static void eel_canvas_re_bounds (EelCanvasItem *item, double *x1, double *y1, double *x2, double *y2); static void eel_canvas_re_translate (EelCanvasItem *item, double dx, double dy); static void eel_canvas_rect_update (EelCanvasItem *item, double i2w_dx, double i2w_dy, int flags); -static void eel_canvas_ellipse_update (EelCanvasItem *item, double i2w_dx, double i2w_dy, int flags); typedef struct { @@ -1073,229 +1071,6 @@ eel_canvas_rect_update (EelCanvasItem *item, double i2w_dx, double i2w_dy, gint } } -/* Ellipse item */ - - -static void eel_canvas_ellipse_class_init (EelCanvasEllipseClass *klass); - -#if GTK_CHECK_VERSION(3,0,0) -static void eel_canvas_ellipse_draw (EelCanvasItem *item, cairo_t *cr, cairo_region_t *region); -#else -static void eel_canvas_ellipse_draw (EelCanvasItem *item, GdkDrawable *drawable, GdkEventExpose *expose); -#endif -static double eel_canvas_ellipse_point (EelCanvasItem *item, double x, double y, int cx, int cy, - EelCanvasItem **actual_item); - - -GType -eel_canvas_ellipse_get_type (void) -{ - static GType ellipse_type = 0; - - if (!ellipse_type) - { - GTypeInfo ellipse_info = - { - sizeof (EelCanvasEllipseClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) eel_canvas_ellipse_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (EelCanvasEllipse), - 0, /* n_preallocs */ - (GInstanceInitFunc) NULL - - }; - - ellipse_type = g_type_register_static (eel_canvas_re_get_type (), - "EelCanvasEllipse", - &ellipse_info, - 0); - } - - return ellipse_type; -} - -static void -eel_canvas_ellipse_class_init (EelCanvasEllipseClass *klass) -{ - EelCanvasItemClass *item_class; - - item_class = (EelCanvasItemClass *) klass; - - item_class->draw = eel_canvas_ellipse_draw; - item_class->point = eel_canvas_ellipse_point; - item_class->update = eel_canvas_ellipse_update; -} - -static void -#if GTK_CHECK_VERSION(3,0,0) -eel_canvas_ellipse_draw (EelCanvasItem *item, cairo_t *cr, cairo_region_t *region) -#else -eel_canvas_ellipse_draw (EelCanvasItem *item, GdkDrawable *drawable, GdkEventExpose *expose) -#endif -{ - EelCanvasRE *re; - int x1, y1, x2, y2; - double i2w_dx, i2w_dy; - - re = EEL_CANVAS_RE (item); - - /* Get canvas pixel coordinates */ - - i2w_dx = 0.0; - i2w_dy = 0.0; - eel_canvas_item_i2w (item, &i2w_dx, &i2w_dy); - - eel_canvas_w2c (item->canvas, - re->x1 + i2w_dx, - re->y1 + i2w_dy, - &x1, &y1); - eel_canvas_w2c (item->canvas, - re->x2 + i2w_dx, - re->y2 + i2w_dy, - &x2, &y2); - -#if GTK_CHECK_VERSION(3,0,0) - cairo_save (cr); -#else - cairo_t *cr = gdk_cairo_create (drawable); - gdk_cairo_region (cr, expose->region); - cairo_clip (cr); -#endif - - cairo_save (cr); - cairo_translate (cr, (x1 + x2) / 2., (y1 + y2) / 2.); - cairo_scale (cr, (x2 - x1), (y2 - y1)); - cairo_arc (cr, 0, 0, 1, 0, 2 * G_PI); - cairo_restore (cr); - - if (re->fill_set) - { -#if GTK_CHECK_VERSION(3,0,0) - eel_canvas_set_source_color (cr, &re->fill_color); -#else - eel_canvas_set_source_color (cr, re->fill_color); -#endif - cairo_fill_preserve (cr); - } - - if (re->outline_set) - { -#if GTK_CHECK_VERSION(3,0,0) - eel_canvas_set_source_color (cr, &re->outline_color); -#else - eel_canvas_set_source_color (cr, re->outline_color); -#endif - if (re->width_pixels) { - cairo_set_line_width (cr, (int) re->width); - } else { - cairo_set_line_width (cr, (int) (re->width * re->item.canvas->pixels_per_unit + 0.5)); - } - - cairo_stroke_preserve (cr); - } - -#if GTK_CHECK_VERSION(3,0,0) - cairo_restore (cr); -#else - cairo_destroy (cr); -#endif -} - -static double -eel_canvas_ellipse_point (EelCanvasItem *item, double x, double y, int cx, int cy, EelCanvasItem **actual_item) -{ - EelCanvasRE *re; - double dx, dy; - double scaled_dist; - double outline_dist; - double center_dist; - double width; - double a, b; - double diamx, diamy; - - re = EEL_CANVAS_RE (item); - - *actual_item = item; - - if (re->outline_set) - { - if (re->width_pixels) - width = re->width / item->canvas->pixels_per_unit; - else - width = re->width; - } - else - width = 0.0; - - /* Compute the distance between the center of the ellipse and the point, with the ellipse - * considered as being scaled to a circle. - */ - - dx = x - (re->x1 + re->x2) / 2.0; - dy = y - (re->y1 + re->y2) / 2.0; - center_dist = sqrt (dx * dx + dy * dy); - - a = dx / ((re->x2 + width - re->x1) / 2.0); - b = dy / ((re->y2 + width - re->y1) / 2.0); - scaled_dist = sqrt (a * a + b * b); - - /* If the scaled distance is greater than 1, then we are outside. Compute the distance from - * the point to the edge of the circle, then scale back to the original un-scaled coordinate - * system. - */ - - if (scaled_dist > 1.0) - return (center_dist / scaled_dist) * (scaled_dist - 1.0); - - /* We are inside the outer edge of the ellipse. If it is filled, then we are "inside". - * Otherwise, do the same computation as above, but also check whether we are inside the - * outline. - */ - - if (re->fill_set) - return 0.0; - - if (scaled_dist > EEL_CANVAS_EPSILON) - outline_dist = (center_dist / scaled_dist) * (1.0 - scaled_dist) - width; - else - { - /* Handle very small distance */ - - diamx = re->x2 - re->x1; - diamy = re->y2 - re->y1; - - if (diamx < diamy) - outline_dist = (diamx - width) / 2.0; - else - outline_dist = (diamy - width) / 2.0; - } - - if (outline_dist < 0.0) - return 0.0; - - return outline_dist; -} - -static void -eel_canvas_ellipse_update (EelCanvasItem *item, double i2w_dx, double i2w_dy, gint flags) -{ - EelCanvasRE *re; - double x0, y0, x1, y1; - -#ifdef VERBOSE - g_print ("eel_canvas_sllipse_update item %x\n", item); -#endif - - eel_canvas_re_update_shared (item, i2w_dx, i2w_dy, flags); - re = EEL_CANVAS_RE (item); - - get_bounds (re, &x0, &y0, &x1, &y1); - eel_canvas_update_bbox (item, x0, y0, x1, y1); -} - static int rect_empty (const Rect *src) { diff --git a/eel/eel-canvas-rect-ellipse.h b/eel/eel-canvas-rect-ellipse.h index d54de4d2..2d1dac59 100644 --- a/eel/eel-canvas-rect-ellipse.h +++ b/eel/eel-canvas-rect-ellipse.h @@ -143,38 +143,6 @@ extern "C" { /* Standard Gtk function */ GType eel_canvas_rect_get_type (void) G_GNUC_CONST; - - /* Ellipse item. No configurable or queryable arguments are available (use those in - * EelCanvasRE). - */ - - -#define EEL_TYPE_CANVAS_ELLIPSE (eel_canvas_ellipse_get_type ()) -#define EEL_CANVAS_ELLIPSE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EEL_TYPE_CANVAS_ELLIPSE, EelCanvasEllipse)) -#define EEL_CANVAS_ELLIPSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EEL_TYPE_CANVAS_ELLIPSE, EelCanvasEllipseClass)) -#define EEL_IS_CANVAS_ELLIPSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEL_TYPE_CANVAS_ELLIPSE)) -#define EEL_IS_CANVAS_ELLIPSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EEL_TYPE_CANVAS_ELLIPSE)) -#define EEL_CANVAS_ELLIPSE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EEL_TYPE_CANVAS_ELLIPSE, EelCanvasEllipseClass)) - - - typedef struct _EelCanvasEllipse EelCanvasEllipse; - typedef struct _EelCanvasEllipseClass EelCanvasEllipseClass; - - struct _EelCanvasEllipse - { - EelCanvasRE re; - }; - - struct _EelCanvasEllipseClass - { - EelCanvasREClass parent_class; - }; - - - /* Standard Gtk function */ - GType eel_canvas_ellipse_get_type (void) G_GNUC_CONST; - - #ifdef __cplusplus } #endif diff --git a/eel/eel-canvas-util.c b/eel/eel-canvas-util.c deleted file mode 100644 index 26e2b29e..00000000 --- a/eel/eel-canvas-util.c +++ /dev/null @@ -1,426 +0,0 @@ -/* - * Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation - * All rights reserved. - * - * This file is part of the Mate Library. - * - * The Mate Library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * The Mate Library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with the Mate Library; see the file COPYING.LIB. If not, - * write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -/* - @NOTATION@ - */ -/* Miscellaneous utility functions for the EelCanvas widget - * - * EelCanvas is basically a port of the Tk toolkit's most excellent canvas widget. Tk is - * copyrighted by the Regents of the University of California, Sun Microsystems, and other parties. - * - * - * Author: Federico Mena <[email protected]> - */ - -#include <config.h> - -#include <sys/types.h> -#include <glib.h> -#include <math.h> - -#include "eel-canvas.h" -#include "eel-canvas-util.h" - -/* - * Ok, so some systems require magic incantations for M_PI to be defined. - * It's not important enough to worry about. - */ -#ifndef M_PI -#define M_PI 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117 -#endif - -/** - * eel_canvas_points_new: - * @num_points: The number of points to allocate space for in the array. - * - * Creates a structure that should be used to pass an array of points to - * items. - * - * Return value: A newly-created array of points. It should be filled in - * by the user. - **/ -EelCanvasPoints * -eel_canvas_points_new (int num_points) -{ - EelCanvasPoints *points; - - g_return_val_if_fail (num_points > 1, NULL); - - points = g_new (EelCanvasPoints, 1); - points->num_points = num_points; - points->coords = g_new (double, 2 * num_points); - points->ref_count = 1; - - return points; -} - -/** - * eel_canvas_points_ref: - * @points: A canvas points structure. - * - * Increases the reference count of the specified points structure. - * - * Return value: The canvas points structure itself. - **/ -EelCanvasPoints * -eel_canvas_points_ref (EelCanvasPoints *points) -{ - g_return_val_if_fail (points != NULL, NULL); - - points->ref_count += 1; - return points; -} - -/** - * eel_canvas_points_free: - * @points: A canvas points structure. - * - * Decreases the reference count of the specified points structure. If it - * reaches zero, then the structure is freed. - **/ -void -eel_canvas_points_free (EelCanvasPoints *points) -{ - g_return_if_fail (points != NULL); - - points->ref_count -= 1; - if (points->ref_count == 0) - { - g_free (points->coords); - g_free (points); - } -} - -/** - * eel_canvas_get_miter_points: - * @x1: X coordinate of the first point - * @y1: Y coordinate of the first point - * @x2: X coordinate of the second (angle) point - * @y2: Y coordinate of the second (angle) point - * @x3: X coordinate of the third point - * @y3: Y coordinate of the third point - * @width: Width of the line - * @mx1: The X coordinate of the first miter point is returned here. - * @my1: The Y coordinate of the first miter point is returned here. - * @mx2: The X coordinate of the second miter point is returned here. - * @my2: The Y coordinate of the second miter point is returned here. - * - * Given three points forming an angle, computes the coordinates of the inside - * and outside points of the mitered corner formed by a line of a given width at - * that angle. - * - * Return value: FALSE if the angle is less than 11 degrees (this is the same - * threshold as X uses. If this occurs, the return points are not modified. - * Otherwise, returns TRUE. - **/ -int -eel_canvas_get_miter_points (double x1, double y1, double x2, double y2, double x3, double y3, - double width, - double *mx1, double *my1, double *mx2, double *my2) -{ - double theta1; /* angle of segment p2-p1 */ - double theta2; /* angle of segment p2-p3 */ - double theta; /* angle between line segments */ - double theta3; /* angle that bisects theta1 and theta2 and points to p1 */ - double dist; /* distance of miter points from p2 */ - double dx, dy; /* x and y offsets corresponding to dist */ - - double ELEVEN_DEGREES = 11.0 * M_PI / 180.0; - - /* Degenerate cases. */ - if ((x1 == x2 && y1 == y2) || (x2 == x3 && y2 == y3)) - return FALSE; - - theta1 = atan2 (y1 - y2, x1 - x2); - theta2 = atan2 (y3 - y2, x3 - x2); - theta = theta1 - theta2; - - /* Normalize to (-pi; pi]. */ - if (theta > M_PI) - theta -= 2.0 * M_PI; - else if (theta <= -M_PI) - theta += 2.0 * M_PI; - - if (fabs (theta) < ELEVEN_DEGREES) - return FALSE; - - dist = fabs (0.5 * width / sin (0.5 * theta)); - - theta3 = (theta1 + theta2) / 2.0; - if (sin (theta3 - theta1) > 0.0) - theta3 += M_PI; - - dx = dist * cos (theta3); - dy = dist * sin (theta3); - - *mx1 = x2 + dx; - *mx2 = x2 - dx; - *my1 = y2 + dy; - *my2 = y2 - dy; - - return TRUE; -} - -/** - * eel_canvas_get_butt_points: - * @x1: X coordinate of first point in the line - * @y1: Y cooordinate of first point in the line - * @x2: X coordinate of second point (endpoint) of the line - * @y2: Y coordinate of second point (endpoint) of the line - * @width: Width of the line - * @project: Whether the butt points should project out by width/2 distance - * @bx1: X coordinate of first butt point is returned here - * @by1: Y coordinate of first butt point is returned here - * @bx2: X coordinate of second butt point is returned here - * @by2: Y coordinate of second butt point is returned here - * - * Computes the butt points of a line segment. - **/ -void -eel_canvas_get_butt_points (double x1, double y1, double x2, double y2, - double width, int project, - double *bx1, double *by1, double *bx2, double *by2) -{ - double length; - double dx, dy; - - width *= 0.5; - dx = x2 - x1; - dy = y2 - y1; - length = sqrt (dx * dx + dy * dy); - - if (length < EEL_CANVAS_EPSILON) - { - *bx1 = *bx2 = x2; - *by1 = *by2 = y2; - } - else - { - dx = -width * (y2 - y1) / length; - dy = width * (x2 - x1) / length; - - *bx1 = x2 + dx; - *bx2 = x2 - dx; - *by1 = y2 + dy; - *by2 = y2 - dy; - - if (project) - { - *bx1 += dy; - *bx2 += dy; - *by1 -= dx; - *by2 -= dx; - } - } -} - -/** - * eel_canvas_polygon_to_point: - * @poly: Vertices of the polygon. X coordinates are in the even indices, and Y - * coordinates are in the odd indices - * @num_points: Number of points in the polygon - * @x: X coordinate of the point - * @y: Y coordinate of the point - * - * Computes the distance between a point and a polygon. - * - * Return value: The distance from the point to the polygon, or zero if the - * point is inside the polygon. - **/ -double -eel_canvas_polygon_to_point (double *poly, int num_points, double x, double y) -{ - double best; - int intersections; - int i; - double *p; - double dx, dy; - - /* Iterate through all the edges in the polygon, updating best and intersections. - * - * When computing intersections, include left X coordinate of line within its range, but not - * Y coordinate. Otherwise if the point lies exactly below a vertex we'll count it as two - * intersections. - */ - - best = 1.0e36; - if (poly == NULL) - return best; - - intersections = 0; - - for (i = num_points, p = poly; i > 1; i--, p += 2) - { - double px, py, dist; - - /* Compute the point on the current edge closest to the point and update the - * intersection count. This must be done separately for vertical edges, horizontal - * edges, and others. - */ - - if (p[2] == p[0]) - { - /* Vertical edge */ - - px = p[0]; - - if (p[1] >= p[3]) - { - py = MIN (p[1], y); - py = MAX (py, p[3]); - } - else - { - py = MIN (p[3], y); - py = MAX (py, p[1]); - } - } - else if (p[3] == p[1]) - { - /* Horizontal edge */ - - py = p[1]; - - if (p[0] >= p[2]) - { - px = MIN (p[0], x); - px = MAX (px, p[2]); - - if ((y < py) && (x < p[0]) && (x >= p[2])) - intersections++; - } - else - { - px = MIN (p[2], x); - px = MAX (px, p[0]); - - if ((y < py) && (x < p[2]) && (x >= p[0])) - intersections++; - } - } - else - { - double m1, b1, m2, b2; - int lower; - - /* Diagonal edge. Convert the edge to a line equation (y = m1*x + b1), then - * compute a line perpendicular to this edge but passing through the point, - * (y = m2*x + b2). - */ - - m1 = (p[3] - p[1]) / (p[2] - p[0]); - b1 = p[1] - m1 * p[0]; - - m2 = -1.0 / m1; - b2 = y - m2 * x; - - px = (b2 - b1) / (m1 - m2); - py = m1 * px + b1; - - if (p[0] > p[2]) - { - if (px > p[0]) - { - px = p[0]; - py = p[1]; - } - else if (px < p[2]) - { - px = p[2]; - py = p[3]; - } - } - else - { - if (px > p[2]) - { - px = p[2]; - py = p[3]; - } - else if (px < p[0]) - { - px = p[0]; - py = p[1]; - } - } - - lower = (m1 * x + b1) > y; - - if (lower && (x >= MIN (p[0], p[2])) && (x < MAX (p[0], p[2]))) - intersections++; - } - - /* Compute the distance to the closest point, and see if that is the best so far */ - - dx = x - px; - dy = y - py; - dist = sqrt (dx * dx + dy * dy); - if (dist < best) - best = dist; - } - - /* We've processed all the points. If the number of intersections is odd, the point is - * inside the polygon. - */ - - if (intersections & 0x1) - return 0.0; - else - return best; -} - -/** - * eel_canvas_item_reset_bounds: - * @item: A canvas item - * - * Resets the bounding box of a canvas item to an empty rectangle. - **/ -void -eel_canvas_item_reset_bounds (EelCanvasItem *item) -{ - item->x1 = 0.0; - item->y1 = 0.0; - item->x2 = 0.0; - item->y2 = 0.0; -} - -/** - * eel_canvas_update_bbox: - * @canvas: the canvas needing update - * @x1: Left coordinate of the new bounding box - * @y1: Top coordinate of the new bounding box - * @x2: Right coordinate of the new bounding box - * @y2: Bottom coordinate of the new bounding box - * - * Sets the bbox to the new value, requesting full repaint. - **/ -void -eel_canvas_update_bbox (EelCanvasItem *item, int x1, int y1, int x2, int y2) -{ - eel_canvas_item_request_redraw (item); - item->x1 = x1; - item->y1 = y1; - item->x2 = x2; - item->y2 = y2; - eel_canvas_item_request_redraw (item); -} - diff --git a/eel/eel-canvas-util.h b/eel/eel-canvas-util.h deleted file mode 100644 index 62e53d04..00000000 --- a/eel/eel-canvas-util.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation - * All rights reserved. - * - * This file is part of the Mate Library. - * - * The Mate Library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * The Mate Library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with the Mate Library; see the file COPYING.LIB. If not, - * write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -/* - @NOTATION@ - */ -/* Miscellaneous utility functions for the EelCanvas widget - * - * EelCanvas is basically a port of the Tk toolkit's most excellent canvas widget. Tk is - * copyrighted by the Regents of the University of California, Sun Microsystems, and other parties. - * - * Author: Federico Mena <[email protected]> - */ - -#ifndef EEL_CANVAS_UTIL_H -#define EEL_CANVAS_UTIL_H - - -#ifdef __cplusplus -extern "C" { -#endif - - - /* This structure defines an array of points. X coordinates are stored in the even-numbered - * indices, and Y coordinates are stored in the odd-numbered indices. num_points indicates the - * number of points, so the array is 2*num_points elements big. - */ - typedef struct - { - double *coords; - int num_points; - int ref_count; - } EelCanvasPoints; - - - /* Allocate a new EelCanvasPoints structure with enough space for the specified number of points */ - EelCanvasPoints *eel_canvas_points_new (int num_points); - - /* Increate ref count */ - EelCanvasPoints *eel_canvas_points_ref (EelCanvasPoints *points); -#define eel_canvas_points_unref eel_canvas_points_free - - /* Decrease ref count and free structure if it has reached zero */ - void eel_canvas_points_free (EelCanvasPoints *points); - - /* Given three points forming an angle, compute the coordinates of the inside and outside points of - * the mitered corner formed by a line of a given width at that angle. - * - * If the angle is less than 11 degrees, then FALSE is returned and the return points are not - * modified. Otherwise, TRUE is returned. - */ - int eel_canvas_get_miter_points (double x1, double y1, double x2, double y2, double x3, double y3, - double width, - double *mx1, double *my1, double *mx2, double *my2); - - /* Compute the butt points of a line segment. If project is FALSE, then the results are as follows: - * - * -------------------* (bx1, by1) - * | - * (x1, y1) *------------------* (x2, y2) - * | - * -------------------* (bx2, by2) - * - * that is, the line is not projected beyond (x2, y2). If project is TRUE, then the results are as - * follows: - * - * -------------------* (bx1, by1) - * (x2, y2) | - * (x1, y1) *-------------* | - * | - * -------------------* (bx2, by2) - */ - void eel_canvas_get_butt_points (double x1, double y1, double x2, double y2, - double width, int project, - double *bx1, double *by1, double *bx2, double *by2); - - /* Calculate the distance from a polygon to a point. The polygon's X coordinates are in the even - * indices of the poly array, and the Y coordinates are in the odd indices. - */ - double eel_canvas_polygon_to_point (double *poly, int num_points, double x, double y); - - - void eel_canvas_item_reset_bounds (EelCanvasItem *item); - - /* Sets the bbox to the new value, requesting full repaint. */ - void eel_canvas_update_bbox (EelCanvasItem *item, int x1, int y1, int x2, int y2); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/eel/eel-debug.c b/eel/eel-debug.c index 25bfaceb..46ad3330 100644 --- a/eel/eel-debug.c +++ b/eel/eel-debug.c @@ -74,34 +74,6 @@ eel_make_warnings_and_criticals_stop_in_debugger (void) g_log_set_default_handler (log_handler, NULL); } -int -eel_get_available_file_descriptor_count (void) -{ - int count; - GList *list; - GList *p; - FILE *file; - - list = NULL; - for (count = 0; ; count++) - { - file = fopen ("/dev/null", "r"); - if (file == NULL) - { - break; - } - list = g_list_prepend (list, file); - } - - for (p = list; p != NULL; p = p->next) - { - fclose (p->data); - } - g_list_free (list); - - return count; -} - void eel_debug_shut_down (void) { diff --git a/eel/eel-debug.h b/eel/eel-debug.h index 86a36ada..d3e2d90f 100644 --- a/eel/eel-debug.h +++ b/eel/eel-debug.h @@ -35,7 +35,6 @@ extern "C" { void eel_stop_in_debugger (void); void eel_make_warnings_and_criticals_stop_in_debugger (void); - int eel_get_available_file_descriptor_count (void); /* A way to do cleanup at exit for compatibility with shutdown tools * like the ones in MateComponent. diff --git a/eel/eel-gdk-extensions.c b/eel/eel-gdk-extensions.c index 58610529..448e933a 100644 --- a/eel/eel-gdk-extensions.c +++ b/eel/eel-gdk-extensions.c @@ -392,12 +392,6 @@ eel_rgb16_to_rgb (gushort r, gushort g, gushort b) return result; } -guint32 -eel_rgb8_to_rgb (guchar r, guchar g, guchar b) -{ - return eel_rgb16_to_rgb (r << 8, g << 8, b << 8); -} - #if GTK_CHECK_VERSION (3, 0, 0) /** * eel_gdk_rgba_to_rgb @@ -612,38 +606,6 @@ eel_gdk_draw_layout_with_drop_shadow (GdkDrawable *drawable, } #endif -#if GTK_CHECK_VERSION(3,0,0) -#define CLAMP_COLOR(v) (t = (v), CLAMP (t, 0, 1)) -#define SATURATE(v) ((1.0 - saturation) * intensity + saturation * (v)) - -void -eel_make_color_inactive (GdkRGBA *color) -{ - double intensity, saturation; - gdouble t; - - saturation = 0.7; - intensity = color->red * 0.30 + color->green * 0.59 + color->blue * 0.11; - color->red = SATURATE (color->red); - color->green = SATURATE (color->green); - color->blue = SATURATE (color->blue); - - if (intensity > 0.5) { - color->red *= 0.9; - color->green *= 0.9; - color->blue *= 0.9; - } else { - color->red *= 1.25; - color->green *= 1.25; - color->blue *= 1.25; - } - - color->red = CLAMP_COLOR (color->red); - color->green = CLAMP_COLOR (color->green); - color->blue = CLAMP_COLOR (color->blue); -} -#endif - #if ! defined (EEL_OMIT_SELF_CHECK) #if GTK_CHECK_VERSION(3,0,0) diff --git a/eel/eel-gdk-extensions.h b/eel/eel-gdk-extensions.h index cd2ab757..0e8af740 100644 --- a/eel/eel-gdk-extensions.h +++ b/eel/eel-gdk-extensions.h @@ -112,9 +112,6 @@ void eel_gdk_color_parse_with_white_default (const char guint32 eel_rgb16_to_rgb (gushort r, gushort g, gushort b); -guint32 eel_rgb8_to_rgb (guchar r, - guchar g, - guchar b); #if GTK_CHECK_VERSION (3, 0, 0) guint32 eel_gdk_rgba_to_rgb (const GdkRGBA *color); GdkRGBA eel_gdk_rgb_to_rgba (guint32 color); @@ -148,7 +145,4 @@ void eel_gdk_draw_layout_with_drop_shadow (GdkDrawable int x, int y, PangoLayout *layout); -#if GTK_CHECK_VERSION(3,0,0) -void eel_make_color_inactive (GdkRGBA *color); -#endif #endif /* EEL_GDK_EXTENSIONS_H */ diff --git a/eel/eel-gtk-extensions.h b/eel/eel-gtk-extensions.h index ba4beb1d..aec680f3 100644 --- a/eel/eel-gtk-extensions.h +++ b/eel/eel-gtk-extensions.h @@ -33,8 +33,6 @@ #include <eel/eel-gdk-extensions.h> #define EEL_DEFAULT_POPUP_MENU_DISPLACEMENT 2 -#define EEL_STANDARD_CLOSE_WINDOW_CONTROL_KEY 'w' - /* GtkWindow */ void eel_gtk_window_set_initial_geometry (GtkWindow *window, diff --git a/eel/eel-mate-extensions.c b/eel/eel-mate-extensions.c index 80563034..b40e4afc 100644 --- a/eel/eel-mate-extensions.c +++ b/eel/eel-mate-extensions.c @@ -199,9 +199,3 @@ eel_mate_open_terminal_on_screen (const char *command, mate_gdk_spawn_command_line_on_screen(screen, command_line, NULL); g_free (command_line); } - -void -eel_mate_open_terminal (const char *command) -{ - eel_mate_open_terminal_on_screen (command, NULL); -} diff --git a/eel/eel-mate-extensions.h b/eel/eel-mate-extensions.h index cb97e55b..711ce0ec 100644 --- a/eel/eel-mate-extensions.h +++ b/eel/eel-mate-extensions.h @@ -33,7 +33,6 @@ char * eel_mate_make_terminal_command (const char *command); /* Open up a new terminal, optionally passing in a command to execute */ -void eel_mate_open_terminal (const char *command); void eel_mate_open_terminal_on_screen (const char *command, GdkScreen *screen); diff --git a/eel/eel-stock-dialogs.c b/eel/eel-stock-dialogs.c index 7f83476e..1d6d0802 100644 --- a/eel/eel-stock-dialogs.c +++ b/eel/eel-stock-dialogs.c @@ -445,17 +445,6 @@ show_ok_dialog (const char *primary_text, } GtkDialog * -eel_create_info_dialog (const char *primary_text, - const char *secondary_text, - GtkWindow *parent) -{ - return create_message_dialog (primary_text, secondary_text, - GTK_MESSAGE_INFO, - GTK_BUTTONS_OK, - parent); -} - -GtkDialog * eel_show_info_dialog (const char *primary_text, const char *secondary_text, GtkWindow *parent) @@ -512,31 +501,6 @@ eel_show_error_dialog (const char *primary_text, GTK_MESSAGE_ERROR, parent); } -GtkDialog * -eel_show_error_dialog_with_details (const char *primary_text, - const char *secondary_text, - const char *detailed_error_message, - GtkWindow *parent) -{ - GtkDialog *dialog; - - g_return_val_if_fail (primary_text != NULL, NULL); - g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), NULL); - - if (detailed_error_message == NULL - || strcmp (primary_text, detailed_error_message) == 0) - { - return eel_show_error_dialog (primary_text, secondary_text, parent); - } - - dialog = show_message_dialog (primary_text, - secondary_text, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, detailed_error_message, - parent); - return dialog; -} - /** * eel_show_yes_no_dialog: * diff --git a/eel/eel-stock-dialogs.h b/eel/eel-stock-dialogs.h index 178f02de..8c138a14 100644 --- a/eel/eel-stock-dialogs.h +++ b/eel/eel-stock-dialogs.h @@ -68,10 +68,6 @@ GtkDialog *eel_show_warning_dialog (const char *primary_text, GtkDialog *eel_show_error_dialog (const char *primary_text, const char *secondary_text, GtkWindow *parent); -GtkDialog *eel_show_error_dialog_with_details (const char *primary_text, - const char *secondary_text, - const char *detailed_error_message, - GtkWindow *parent); GtkDialog *eel_show_yes_no_dialog (const char *primary_text, const char *secondary_text, const char *yes_label, @@ -84,8 +80,5 @@ GtkDialog *eel_create_question_dialog (const char *primary_text, const char *answer_two, int response_two, GtkWindow *parent); -GtkDialog *eel_create_info_dialog (const char *primary_text, - const char *secondary_text, - GtkWindow *parent); #endif /* EEL_STOCK_DIALOGS_H */ diff --git a/eel/eel-string.c b/eel/eel-string.c index 5d74c317..61343eec 100644 --- a/eel/eel-string.c +++ b/eel/eel-string.c @@ -59,36 +59,6 @@ eel_strcmp (const char *string_a, const char *string_b) string_b == NULL ? "" : string_b); } -int -eel_strcasecmp (const char *string_a, const char *string_b) -{ - /* FIXME bugzilla.eazel.com 5450: Maybe we need to make this - * treat 'NULL < ""', or have a flavor that does that. If we - * didn't have code that already relies on 'NULL == ""', I - * would change it right now. - */ - return g_ascii_strcasecmp (string_a == NULL ? "" : string_a, - string_b == NULL ? "" : string_b); -} - -int -eel_strcmp_case_breaks_ties (const char *string_a, const char *string_b) -{ - int casecmp_result; - - /* FIXME bugzilla.eazel.com 5450: Maybe we need to make this - * treat 'NULL < ""', or have a flavor that does that. If we - * didn't have code that already relies on 'NULL == ""', I - * would change it right now. - */ - casecmp_result = eel_strcasecmp (string_a, string_b); - if (casecmp_result != 0) - { - return casecmp_result; - } - return eel_strcmp (string_a, string_b); -} - gboolean eel_str_is_empty (const char *string_or_null) { @@ -96,28 +66,6 @@ eel_str_is_empty (const char *string_or_null) } gboolean -eel_str_is_equal (const char *string_a, const char *string_b) -{ - /* FIXME bugzilla.eazel.com 5450: Maybe we need to make this - * treat 'NULL != ""', or have a flavor that does that. If we - * didn't have code that already relies on 'NULL == ""', I - * would change it right now. - */ - return eel_strcmp (string_a, string_b) == 0; -} - -gboolean -eel_istr_is_equal (const char *string_a, const char *string_b) -{ - /* FIXME bugzilla.eazel.com 5450: Maybe we need to make this - * treat 'NULL != ""', or have a flavor that does that. If we - * didn't have code that already relies on 'NULL == ""', I - * would change it right now. - */ - return eel_strcasecmp (string_a, string_b) == 0; -} - -gboolean eel_str_has_prefix (const char *haystack, const char *needle) { return g_str_has_prefix (haystack == NULL ? "" : haystack, @@ -125,21 +73,6 @@ eel_str_has_prefix (const char *haystack, const char *needle) } gboolean -eel_str_has_suffix (const char *haystack, const char *needle) -{ - if (needle == NULL) - { - return TRUE; - } - if (haystack == NULL) - { - return needle[0] == '\0'; - } - - return g_str_has_suffix (haystack, needle); -} - -gboolean eel_istr_has_prefix (const char *haystack, const char *needle) { const char *h, *n; @@ -167,43 +100,6 @@ eel_istr_has_prefix (const char *haystack, const char *needle) return FALSE; } -gboolean -eel_istr_has_suffix (const char *haystack, const char *needle) -{ - const char *h, *n; - char hc, nc; - - if (needle == NULL) - { - return TRUE; - } - if (haystack == NULL) - { - return needle[0] == '\0'; - } - - /* Eat one character at a time. */ - h = haystack + strlen (haystack); - n = needle + strlen (needle); - do - { - if (n == needle) - { - return TRUE; - } - if (h == haystack) - { - return FALSE; - } - hc = *--h; - nc = *--n; - hc = g_ascii_tolower (hc); - nc = g_ascii_tolower (nc); - } - while (hc == nc); - return FALSE; -} - /** * eel_str_get_prefix: * Get a new string containing the first part of an existing string. @@ -244,46 +140,6 @@ eel_str_get_prefix (const char *source, return g_strndup (source, prefix_start - source); } -gboolean -eel_str_to_int (const char *string, int *integer) -{ - long result; - char *parse_end; - - /* Check for the case of an empty string. */ - if (string == NULL || *string == '\0') - { - return FALSE; - } - - /* Call the standard library routine to do the conversion. */ - errno = 0; - result = strtol (string, &parse_end, 0); - - /* Check that the result is in range. */ - if ((result == G_MINLONG || result == G_MAXLONG) && errno == ERANGE) - { - return FALSE; - } - if (result < G_MININT || result > G_MAXINT) - { - return FALSE; - } - - /* Check that all the trailing characters are spaces. */ - while (*parse_end != '\0') - { - if (!g_ascii_isspace (*parse_end++)) - { - return FALSE; - } - } - - /* Return the result. */ - *integer = result; - return TRUE; -} - char * eel_str_double_underscores (const char *string) { @@ -1005,16 +861,6 @@ retry_atomic_decrement: #if !defined (EEL_OMIT_SELF_CHECK) -static int -call_str_to_int (const char *string) -{ - int integer; - - integer = 9999; - eel_str_to_int (string, &integer); - return integer; -} - static void verify_printf (const char *format, ...) { @@ -1125,25 +971,6 @@ eel_self_check_string (void) EEL_CHECK_BOOLEAN_RESULT (eel_str_has_prefix ("aaa", "aaab"), FALSE); EEL_CHECK_BOOLEAN_RESULT (eel_str_has_prefix ("aaab", "aaa"), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix (NULL, NULL), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix (NULL, ""), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix ("", NULL), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix ("", ""), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix ("a", ""), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix ("", "a"), FALSE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix ("a", "a"), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix ("aaab", "aaab"), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix (NULL, "a"), FALSE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix ("a", NULL), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix ("", "a"), FALSE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix ("a", ""), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix ("a", "b"), FALSE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix ("a", "ab"), FALSE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix ("ab", "a"), FALSE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix ("ab", "b"), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix ("aaa", "baaa"), FALSE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_has_suffix ("baaa", "aaa"), TRUE); - EEL_CHECK_STRING_RESULT (eel_str_get_prefix (NULL, NULL), NULL); EEL_CHECK_STRING_RESULT (eel_str_get_prefix (NULL, "foo"), NULL); EEL_CHECK_STRING_RESULT (eel_str_get_prefix ("foo", NULL), "foo"); @@ -1201,49 +1028,6 @@ eel_self_check_string (void) EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_even", 14), "something_even"); EEL_CHECK_STRING_RESULT (eel_str_middle_truncate ("something_odd", 13), "something_odd"); -#define TEST_INTEGER_CONVERSION_FUNCTIONS(string, boolean_result, integer_result) \ - EEL_CHECK_BOOLEAN_RESULT (eel_str_to_int (string, &integer), boolean_result); \ - EEL_CHECK_INTEGER_RESULT (call_str_to_int (string), integer_result); - - TEST_INTEGER_CONVERSION_FUNCTIONS (NULL, FALSE, 9999) - TEST_INTEGER_CONVERSION_FUNCTIONS ("", FALSE, 9999) - TEST_INTEGER_CONVERSION_FUNCTIONS ("a", FALSE, 9999) - TEST_INTEGER_CONVERSION_FUNCTIONS (".", FALSE, 9999) - TEST_INTEGER_CONVERSION_FUNCTIONS ("0", TRUE, 0) - TEST_INTEGER_CONVERSION_FUNCTIONS ("1", TRUE, 1) - TEST_INTEGER_CONVERSION_FUNCTIONS ("+1", TRUE, 1) - TEST_INTEGER_CONVERSION_FUNCTIONS ("-1", TRUE, -1) - TEST_INTEGER_CONVERSION_FUNCTIONS ("2147483647", TRUE, 2147483647) - TEST_INTEGER_CONVERSION_FUNCTIONS ("2147483648", FALSE, 9999) - TEST_INTEGER_CONVERSION_FUNCTIONS ("+2147483647", TRUE, 2147483647) - TEST_INTEGER_CONVERSION_FUNCTIONS ("+2147483648", FALSE, 9999) - TEST_INTEGER_CONVERSION_FUNCTIONS ("-2147483648", TRUE, INT_MIN) - TEST_INTEGER_CONVERSION_FUNCTIONS ("-2147483649", FALSE, 9999) - TEST_INTEGER_CONVERSION_FUNCTIONS ("1a", FALSE, 9999) - TEST_INTEGER_CONVERSION_FUNCTIONS ("0.0", FALSE, 9999) - TEST_INTEGER_CONVERSION_FUNCTIONS ("1e1", FALSE, 9999) - TEST_INTEGER_CONVERSION_FUNCTIONS ("21474836470", FALSE, 9999) - TEST_INTEGER_CONVERSION_FUNCTIONS ("+21474836470", FALSE, 9999) - TEST_INTEGER_CONVERSION_FUNCTIONS ("-21474836480", FALSE, 9999) - - EEL_CHECK_BOOLEAN_RESULT (eel_str_is_equal (NULL, NULL), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_is_equal (NULL, ""), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_is_equal ("", ""), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_is_equal ("", NULL), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_is_equal ("", ""), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_is_equal ("foo", "foo"), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_str_is_equal ("foo", "bar"), FALSE); - - EEL_CHECK_BOOLEAN_RESULT (eel_istr_is_equal (NULL, NULL), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_istr_is_equal (NULL, ""), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_istr_is_equal ("", ""), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_istr_is_equal ("", NULL), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_istr_is_equal ("", ""), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_istr_is_equal ("foo", "foo"), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_istr_is_equal ("foo", "bar"), FALSE); - EEL_CHECK_BOOLEAN_RESULT (eel_istr_is_equal ("Foo", "foo"), TRUE); - EEL_CHECK_BOOLEAN_RESULT (eel_istr_is_equal ("foo", "Foo"), TRUE); - EEL_CHECK_STRING_RESULT (eel_str_strip_substring_and_after (NULL, "bar"), NULL); EEL_CHECK_STRING_RESULT (eel_str_strip_substring_and_after ("", "bar"), ""); EEL_CHECK_STRING_RESULT (eel_str_strip_substring_and_after ("foo", "bar"), "foo"); diff --git a/eel/eel-string.h b/eel/eel-string.h index fb98157a..929d11a2 100644 --- a/eel/eel-string.h +++ b/eel/eel-string.h @@ -46,31 +46,15 @@ char * eel_strchr (const char *haystack, char needle); int eel_strcmp (const char *str_a, const char *str_b); -int eel_strcasecmp (const char *str_a, - const char *str_b); -int eel_strcmp_case_breaks_ties (const char *str_a, - const char *str_b); /* Other basic string operations. */ gboolean eel_str_is_empty (const char *str_or_null); -gboolean eel_str_is_equal (const char *str_a, - const char *str_b); -gboolean eel_istr_is_equal (const char *str_a, - const char *str_b); gboolean eel_str_has_prefix (const char *target, const char *prefix); char * eel_str_get_prefix (const char *source, const char *delimiter); gboolean eel_istr_has_prefix (const char *target, const char *prefix); -gboolean eel_str_has_suffix (const char *target, - const char *suffix); -gboolean eel_istr_has_suffix (const char *target, - const char *suffix); - -/* Conversions to and from strings. */ -gboolean eel_str_to_int (const char *str, - int *integer); /* Escape function for '_' character. */ char * eel_str_double_underscores (const char *str); diff --git a/eel/eel-xml-extensions.c b/eel/eel-xml-extensions.c index 2bcd4477..de09b99f 100644 --- a/eel/eel-xml-extensions.c +++ b/eel/eel-xml-extensions.c @@ -43,12 +43,6 @@ eel_xml_get_children (xmlNodePtr parent) } xmlNodePtr -eel_xml_get_root_children (xmlDocPtr document) -{ - return eel_xml_get_children (xmlDocGetRootElement (document)); -} - -xmlNodePtr eel_xml_get_child_by_name_and_property (xmlNodePtr parent, const char *child_name, const char *property_name, @@ -78,29 +72,6 @@ eel_xml_get_child_by_name_and_property (xmlNodePtr parent, return NULL; } -/* return a child of the passed-in node with a matching name */ - -xmlNodePtr -eel_xml_get_child_by_name (xmlNodePtr parent, - const char *child_name) -{ - xmlNodePtr child; - - if (parent == NULL) - { - return NULL; - } - for (child = eel_xml_get_children (parent); child != NULL; child = child->next) - { - if (strcmp (child->name, child_name) == 0) - { - return child; - } - } - return NULL; -} - - xmlNodePtr eel_xml_get_root_child_by_name_and_property (xmlDocPtr document, const char *child_name, @@ -114,50 +85,6 @@ eel_xml_get_root_child_by_name_and_property (xmlDocPtr document, property_value); } -/** - * eel_xml_get_property_for_children - * - * Returns a list of the values for the specified property for all - * children of the node that have the specified name. - * - * @parent: xmlNodePtr representing the node in question. - * @child_name: child element name to look for - * @property: name of propety to reutnr for matching children that have the property - * - * Returns: A list of keywords. - * - **/ -GList * -eel_xml_get_property_for_children (xmlNodePtr parent, - const char *child_name, - const char *property_name) -{ - GList *properties; - xmlNode *child; - xmlChar *property; - - properties = NULL; - - for (child = eel_xml_get_children (parent); - child != NULL; - child = child->next) - { - if (strcmp (child->name, child_name) == 0) - { - property = xmlGetProp (child, property_name); - if (property != NULL) - { - properties = g_list_prepend (properties, - g_strdup (property)); - xmlFree (property); - } - } - } - - /* Reverse so you get them in the same order as the XML file. */ - return g_list_reverse (properties); -} - xmlChar * eel_xml_get_property_translated (xmlNodePtr parent, const char *property_name) diff --git a/eel/eel-xml-extensions.h b/eel/eel-xml-extensions.h index 328e1d33..90d19f5f 100644 --- a/eel/eel-xml-extensions.h +++ b/eel/eel-xml-extensions.h @@ -29,9 +29,6 @@ #include <glib.h> xmlNodePtr eel_xml_get_children (xmlNodePtr parent); -xmlNodePtr eel_xml_get_root_children (xmlDocPtr document); -xmlNodePtr eel_xml_get_child_by_name (xmlNodePtr parent, - const char *child_name); xmlNodePtr eel_xml_get_child_by_name_and_property (xmlNodePtr parent, const char *child_name, const char *property_name, @@ -40,9 +37,6 @@ xmlNodePtr eel_xml_get_root_child_by_name_and_property (xmlDocPtr document, const char *child_name, const char *property_name, const char *property_value); -GList *eel_xml_get_property_for_children (xmlNodePtr parent, - const char *child_name, - const char *property_name); xmlChar *eel_xml_get_property_translated (xmlNodePtr parent, const char *property_name); diff --git a/libcaja-private/caja-desktop-link-monitor.c b/libcaja-private/caja-desktop-link-monitor.c index 5a959d20..05cb7f4a 100644 --- a/libcaja-private/caja-desktop-link-monitor.c +++ b/libcaja-private/caja-desktop-link-monitor.c @@ -89,70 +89,6 @@ caja_desktop_link_monitor_get (void) return the_link_monitor; } -static void -volume_delete_dialog (GtkWidget *parent_view, - CajaDesktopLink *link) -{ - GMount *mount; - char *dialog_str; - char *display_name; - - mount = caja_desktop_link_get_mount (link); - - if (mount != NULL) - { - display_name = caja_desktop_link_get_display_name (link); - dialog_str = g_strdup_printf (_("You cannot move the volume \"%s\" to the trash."), - display_name); - g_free (display_name); - - if (g_mount_can_eject (mount)) - { - eel_run_simple_dialog - (parent_view, - FALSE, - GTK_MESSAGE_ERROR, - dialog_str, - _("If you want to eject the volume, please use \"Eject\" in the " - "popup menu of the volume."), - GTK_STOCK_OK, NULL); - } - else - { - eel_run_simple_dialog - (parent_view, - FALSE, - GTK_MESSAGE_ERROR, - dialog_str, - _("If you want to unmount the volume, please use \"Unmount Volume\" in the " - "popup menu of the volume."), - GTK_STOCK_OK, NULL); - } - - g_object_unref (mount); - g_free (dialog_str); - } -} - -void -caja_desktop_link_monitor_delete_link (CajaDesktopLinkMonitor *monitor, - CajaDesktopLink *link, - GtkWidget *parent_view) -{ - switch (caja_desktop_link_get_link_type (link)) - { - case CAJA_DESKTOP_LINK_HOME: - case CAJA_DESKTOP_LINK_COMPUTER: - case CAJA_DESKTOP_LINK_TRASH: - case CAJA_DESKTOP_LINK_NETWORK: - /* just ignore. We don't allow you to delete these */ - break; - default: - volume_delete_dialog (parent_view, link); - break; - } -} - static gboolean volume_file_name_used (CajaDesktopLinkMonitor *monitor, const char *name) diff --git a/libcaja-private/caja-desktop-link-monitor.h b/libcaja-private/caja-desktop-link-monitor.h index e962386e..bcf89c0d 100644 --- a/libcaja-private/caja-desktop-link-monitor.h +++ b/libcaja-private/caja-desktop-link-monitor.h @@ -56,9 +56,6 @@ typedef struct GType caja_desktop_link_monitor_get_type (void); CajaDesktopLinkMonitor * caja_desktop_link_monitor_get (void); -void caja_desktop_link_monitor_delete_link (CajaDesktopLinkMonitor *monitor, - CajaDesktopLink *link, - GtkWidget *parent_view); /* Used by caja-desktop-link.c */ char * caja_desktop_link_monitor_make_filename_unique (CajaDesktopLinkMonitor *monitor, diff --git a/libcaja-private/caja-entry.c b/libcaja-private/caja-entry.c index a4baa8c8..698954f8 100644 --- a/libcaja-private/caja-entry.c +++ b/libcaja-private/caja-entry.c @@ -77,17 +77,6 @@ caja_entry_new (void) return gtk_widget_new (CAJA_TYPE_ENTRY, NULL); } -GtkWidget * -caja_entry_new_with_max_length (guint16 max) -{ - GtkWidget *widget; - - widget = gtk_widget_new (CAJA_TYPE_ENTRY, NULL); - gtk_entry_set_max_length (GTK_ENTRY (widget), max); - - return widget; -} - static void caja_entry_finalize (GObject *object) { diff --git a/libcaja-private/caja-entry.h b/libcaja-private/caja-entry.h index afe2204a..3784c097 100644 --- a/libcaja-private/caja-entry.h +++ b/libcaja-private/caja-entry.h @@ -63,7 +63,6 @@ extern "C" { GType caja_entry_get_type (void); GtkWidget *caja_entry_new (void); - GtkWidget *caja_entry_new_with_max_length (guint16 max); void caja_entry_set_text (CajaEntry *entry, const char *text); void caja_entry_select_all (CajaEntry *entry); diff --git a/libcaja-private/caja-file-utilities.c b/libcaja-private/caja-file-utilities.c index 48cdb68a..41f80c29 100644 --- a/libcaja-private/caja-file-utilities.c +++ b/libcaja-private/caja-file-utilities.c @@ -40,20 +40,16 @@ #include <glib/gi18n.h> #include <glib/gstdio.h> #include <gio/gio.h> -#include <unistd.h> #include <stdlib.h> -#define CAJA_USER_DIRECTORY_NAME ".config/caja" #define DEFAULT_CAJA_DIRECTORY_MODE (0755) #define DESKTOP_DIRECTORY_NAME "Desktop" -#define LEGACY_DESKTOP_DIRECTORY_NAME ".mate-desktop" #define DEFAULT_DESKTOP_DIRECTORY_MODE (0755) static void update_xdg_dir_cache (void); static void schedule_user_dirs_changed (void); static void desktop_dir_changed (void); -static GFile *caja_find_file_insensitive_next (GFile *parent, const gchar *name); char * caja_compute_title_for_location (GFile *location) @@ -588,19 +584,6 @@ caja_get_desktop_directory_uri (void) } char * -caja_get_desktop_directory_uri_no_create (void) -{ - char *desktop_path; - char *desktop_uri; - - desktop_path = get_desktop_path (); - desktop_uri = g_filename_to_uri (desktop_path, NULL, NULL); - g_free (desktop_path); - - return desktop_uri; -} - -char * caja_get_home_directory_uri (void) { return g_filename_to_uri (g_get_home_dir (), NULL, NULL); @@ -649,22 +632,6 @@ caja_get_templates_directory_uri (void) return uri; } -char * -caja_get_searches_directory (void) -{ - char *user_dir; - char *searches_dir; - - user_dir = caja_get_user_directory (); - searches_dir = g_build_filename (user_dir, "searches", NULL); - g_free (user_dir); - - if (!g_file_test (searches_dir, G_FILE_TEST_EXISTS)) - g_mkdir (searches_dir, DEFAULT_CAJA_DIRECTORY_MODE); - - return searches_dir; -} - /* These need to be reset to NULL when desktop_is_home_dir changes */ static GFile *desktop_dir = NULL; static GFile *desktop_dir_dir = NULL; @@ -800,20 +767,6 @@ caja_is_desktop_directory (GFile *dir) return g_file_equal (dir, desktop_dir); } - -/** - * caja_get_gmc_desktop_directory: - * - * Get the path for the directory containing the legacy gmc desktop. - * - * Return value: the directory path. - **/ -char * -caja_get_gmc_desktop_directory (void) -{ - return g_build_filename (g_get_home_dir (), LEGACY_DESKTOP_DIRECTORY_NAME, NULL); -} - /** * caja_get_pixmap_directory * @@ -929,29 +882,6 @@ caja_ensure_unique_file_name (const char *directory_uri, return res; } -char * -caja_unique_temporary_file_name (void) -{ - const char *prefix = "/tmp/caja-temp-file"; - char *file_name; - int fd; - - file_name = g_strdup_printf ("%sXXXXXX", prefix); - - fd = g_mkstemp (file_name); - if (fd == -1) - { - g_free (file_name); - file_name = NULL; - } - else - { - close (fd); - } - - return file_name; -} - GFile * caja_find_existing_uri_in_hierarchy (GFile *location) { @@ -979,129 +909,6 @@ caja_find_existing_uri_in_hierarchy (GFile *location) return location; } -/** - * caja_find_file_insensitive - * - * Attempt to find a file case-insentively. If the path can be found, the - * returned file maps directly to it. Otherwise, a file using the - * originally-cased path is returned. This function performs might perform - * I/O. - * - * Return value: a #GFile to a child specified by @name. - **/ -GFile * -caja_find_file_insensitive (GFile *parent, const gchar *name) -{ - gchar **split_path; - gchar *component; - GFile *file, *next; - gint i; - - split_path = g_strsplit (name, G_DIR_SEPARATOR_S, -1); - - file = g_object_ref (parent); - - for (i = 0; (component = split_path[i]) != NULL; i++) - { - if (!(next = caja_find_file_insensitive_next (file, - component))) - { - /* File does not exist */ - g_object_unref (file); - file = NULL; - break; - } - g_object_unref (file); - file = next; - } - g_strfreev (split_path); - - if (file) - { - return file; - } - return g_file_get_child (parent, name); -} - -static GFile * -caja_find_file_insensitive_next (GFile *parent, const gchar *name) -{ - GFileEnumerator *children; - GFileInfo *info; - gboolean use_utf8, found; - char *filename, *case_folded_name, *utf8_collation_key, *ascii_collation_key, *child_key; - GFile *file; - const char *child_name, *compare_key; - - /* First check the given version */ - file = g_file_get_child (parent, name); - if (g_file_query_exists (file, NULL)) - { - return file; - } - g_object_unref (file); - - ascii_collation_key = g_ascii_strdown (name, -1); - use_utf8 = g_utf8_validate (name, -1, NULL); - utf8_collation_key = NULL; - if (use_utf8) - { - case_folded_name = g_utf8_casefold (name, -1); - utf8_collation_key = g_utf8_collate_key (case_folded_name, -1); - g_free (case_folded_name); - } - - /* Enumerate and compare insensitive */ - filename = NULL; - children = g_file_enumerate_children (parent, - G_FILE_ATTRIBUTE_STANDARD_NAME, - 0, NULL, NULL); - if (children != NULL) - { - while ((info = g_file_enumerator_next_file (children, NULL, NULL))) - { - child_name = g_file_info_get_name (info); - - if (use_utf8 && g_utf8_validate (child_name, -1, NULL)) - { - gchar *case_folded; - - case_folded = g_utf8_casefold (child_name, -1); - child_key = g_utf8_collate_key (case_folded, -1); - g_free (case_folded); - compare_key = utf8_collation_key; - } - else - { - child_key = g_ascii_strdown (child_name, -1); - compare_key = ascii_collation_key; - } - - found = strcmp (child_key, compare_key) == 0; - g_free (child_key); - if (found) - { - filename = g_strdup (child_name); - break; - } - } - g_file_enumerator_close (children, NULL, NULL); - g_object_unref (children); - } - - g_free (ascii_collation_key); - g_free (utf8_collation_key); - - if (filename) - { - file = g_file_get_child (parent, filename); - g_free (filename); - return file; - } - - return NULL; -} - gboolean caja_is_engrampa_installed (void) { diff --git a/libcaja-private/caja-file-utilities.h b/libcaja-private/caja-file-utilities.h index 3dd0e1a3..370cec02 100644 --- a/libcaja-private/caja-file-utilities.h +++ b/libcaja-private/caja-file-utilities.h @@ -48,7 +48,6 @@ gboolean caja_is_home_directory (GFile *dir); gboolean caja_is_home_directory_file (GFile *dir, const char *filename); gboolean caja_is_in_system_dir (GFile *location); -char * caja_get_gmc_desktop_directory (void); char * caja_get_pixmap_directory (void); gboolean caja_should_use_templates_directory (void); @@ -56,14 +55,8 @@ char * caja_get_templates_directory (void); char * caja_get_templates_directory_uri (void); void caja_create_templates_directory (void); -char * caja_get_searches_directory (void); - char * caja_compute_title_for_location (GFile *file); -/* This function returns something that needs to be freed with g_free, - * is not NULL, but is not garaunteed to exist */ -char * caja_get_desktop_directory_uri_no_create (void); - /* A version of mate's mate_pixmap_file that works for the caja prefix. * Otherwise similar to mate_pixmap_file in that it checks to see if the file * exists and returns NULL if it doesn't. @@ -90,13 +83,9 @@ void caja_uninhibit_power_manager (int cookie); char * caja_ensure_unique_file_name (const char *directory_uri, const char *base_name, const char *extension); -char * caja_unique_temporary_file_name (void); GFile * caja_find_existing_uri_in_hierarchy (GFile *location); -GFile * -caja_find_file_insensitive (GFile *parent, const gchar *name); - char * caja_get_accel_map_file (void); GHashTable * caja_trashed_files_get_original_directories (GList *files, diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c index 811d811f..93a4d17c 100644 --- a/libcaja-private/caja-file.c +++ b/libcaja-private/caja-file.c @@ -4941,35 +4941,6 @@ caja_file_recompute_deep_counts (CajaFile *file) } } - -/** - * caja_file_get_directory_item_mime_types - * - * Get the list of mime-types present in a directory. - * @file: CajaFile representing a directory. It is an error to - * call this function on a file that is not a directory. - * @mime_list: Place to put the list of mime-types. - * - * Returns: TRUE if mime-type list is available. - * - **/ -gboolean -caja_file_get_directory_item_mime_types (CajaFile *file, - GList **mime_list) -{ - g_return_val_if_fail (CAJA_IS_FILE (file), FALSE); - g_return_val_if_fail (mime_list != NULL, FALSE); - - if (!caja_file_is_directory (file) - || !file->details->got_mime_list) { - *mime_list = NULL; - return FALSE; - } - - *mime_list = eel_g_str_list_copy (file->details->mime_list); - return TRUE; -} - gboolean caja_file_can_get_size (CajaFile *file) { diff --git a/libcaja-private/caja-file.h b/libcaja-private/caja-file.h index e4a2e9fb..5aba9726 100644 --- a/libcaja-private/caja-file.h +++ b/libcaja-private/caja-file.h @@ -226,8 +226,6 @@ char * caja_file_get_top_left_text (CajaFile char * caja_file_peek_top_left_text (CajaFile *file, gboolean need_large_text, gboolean *got_top_left_text); -gboolean caja_file_get_directory_item_mime_types (CajaFile *file, - GList **mime_list); void caja_file_set_attributes (CajaFile *file, GFileInfo *attributes, diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c index 21da113f..dbe6a7ff 100644 --- a/libcaja-private/caja-icon-canvas-item.c +++ b/libcaja-private/caja-icon-canvas-item.c @@ -43,7 +43,6 @@ #include <gtk/gtk.h> #include <gdk/gdk.h> #include <glib/gi18n.h> -#include <eel/eel-canvas-util.h> #include <atk/atkimage.h> #include <atk/atkcomponent.h> #include <atk/atknoopobject.h> diff --git a/libcaja-private/caja-icon-names.h b/libcaja-private/caja-icon-names.h index 20aee326..b4a7278f 100644 --- a/libcaja-private/caja-icon-names.h +++ b/libcaja-private/caja-icon-names.h @@ -15,11 +15,6 @@ #define CAJA_ICON_TRASH_FULL "user-trash-full" #define CAJA_ICON_DELETE "edit-delete" -/* Icons for emblems */ -#define CAJA_ICON_EMBLEM_READONLY "emblem-readonly" -#define CAJA_ICON_EMBLEM_UNREADABLE "emblem-unreadable" -#define CAJA_ICON_EMBLEM_SYMLINK "emblem-symbolic-link" - #define CAJA_ICON_FOLDER_DESKTOP "user-desktop" #define CAJA_ICON_FOLDER_DOCUMENTS "folder-documents" #define CAJA_ICON_FOLDER_DOWNLOAD "folder-download" @@ -32,8 +27,5 @@ /* Other icons */ #define CAJA_ICON_TEMPLATE "text-x-generic-template" -/* Icons not provided by fd.o naming spec or caja itself */ -#define CAJA_ICON_BURN "caja-cd-burner" - #endif /* CAJA_ICON_NAMES_H */ diff --git a/libcaja-private/caja-mime-actions.c b/libcaja-private/caja-mime-actions.c index 2a303f72..46e3bdc3 100644 --- a/libcaja-private/caja-mime-actions.c +++ b/libcaja-private/caja-mime-actions.c @@ -676,43 +676,6 @@ caja_mime_get_applications_for_files (GList *files) return ret; } -gboolean -caja_mime_has_any_applications_for_files (GList *files) -{ - GList *l, *sorted_files; - CajaFile *file; - gboolean ret; - - g_assert (files != NULL); - - sorted_files = g_list_sort (g_list_copy (files), (GCompareFunc) file_compare_by_mime_type); - - ret = TRUE; - for (l = sorted_files; l != NULL; l = l->next) - { - file = CAJA_FILE (l->data); - - if (l->prev && - file_compare_by_mime_type (file, l->prev->data) == 0 && - file_compare_by_parent_uri (file, l->prev->data) == 0) - { - continue; - } - - if (!caja_mime_has_any_applications_for_file (file)) - { - ret = FALSE; - break; - } - } - - g_list_free (sorted_files); - - return ret; -} - - - static void trash_or_delete_files (GtkWindow *parent_window, const GList *files, diff --git a/libcaja-private/caja-mime-actions.h b/libcaja-private/caja-mime-actions.h index 863491b8..3a8ba638 100644 --- a/libcaja-private/caja-mime-actions.h +++ b/libcaja-private/caja-mime-actions.h @@ -40,7 +40,6 @@ GAppInfo * caja_mime_get_default_application_for_files (GList GList * caja_mime_get_applications_for_files (GList *file); gboolean caja_mime_has_any_applications_for_file (CajaFile *file); -gboolean caja_mime_has_any_applications_for_files (GList *files); gboolean caja_mime_file_opens_in_view (CajaFile *file); gboolean caja_mime_file_opens_in_external_app (CajaFile *file); diff --git a/libcaja-private/caja-trash-monitor.c b/libcaja-private/caja-trash-monitor.c index b7c3b8b7..2e6aeb78 100644 --- a/libcaja-private/caja-trash-monitor.c +++ b/libcaja-private/caja-trash-monitor.c @@ -242,9 +242,3 @@ caja_trash_monitor_get_icon (void) } return NULL; } - -void -caja_trash_monitor_add_new_trash_directories (void) -{ - /* We trashed something... */ -} diff --git a/libcaja-private/caja-trash-monitor.h b/libcaja-private/caja-trash-monitor.h index e420d064..c3aa7c9a 100644 --- a/libcaja-private/caja-trash-monitor.h +++ b/libcaja-private/caja-trash-monitor.h @@ -65,6 +65,4 @@ CajaTrashMonitor *caja_trash_monitor_get (void); gboolean caja_trash_monitor_is_empty (void); GIcon *caja_trash_monitor_get_icon (void); -void caja_trash_monitor_add_new_trash_directories (void); - #endif diff --git a/src/caja-file-management-properties.c b/src/caja-file-management-properties.c index f5d9e400..94ce7443 100644 --- a/src/caja-file-management-properties.c +++ b/src/caja-file-management-properties.c @@ -64,7 +64,6 @@ #define CAJA_FILE_MANAGEMENT_PROPERTIES_ALWAYS_USE_LOCATION_ENTRY_WIDGET "always_use_location_entry_checkbutton" #define CAJA_FILE_MANAGEMENT_PROPERTIES_TRASH_CONFIRM_WIDGET "trash_confirm_checkbutton" #define CAJA_FILE_MANAGEMENT_PROPERTIES_TRASH_DELETE_WIDGET "trash_delete_checkbutton" -#define CAJA_FILE_MANAGEMENT_PROPERTIES_OPEN_NEW_WINDOW_WIDGET "new_window_checkbutton" #define CAJA_FILE_MANAGEMENT_PROPERTIES_SHOW_HIDDEN_WIDGET "hidden_files_checkbutton" #define CAJA_FILE_MANAGEMENT_PROPERTIES_TREE_VIEW_FOLDERS_WIDGET "treeview_folders_checkbutton" #define CAJA_FILE_MANAGEMENT_PROPERTIES_MEDIA_AUTOMOUNT_OPEN "media_automount_open_checkbutton" diff --git a/src/caja-navigation-window.c b/src/caja-navigation-window.c index 8c1db6a8..5d0fdf47 100644 --- a/src/caja-navigation-window.c +++ b/src/caja-navigation-window.c @@ -69,26 +69,10 @@ #include <math.h> #include <sys/time.h> - -/* FIXME bugzilla.gnome.org 41243: - * We should use inheritance instead of these special cases - * for the desktop window. - */ -#include "caja-desktop-window.h" - #define MAX_TITLE_LENGTH 180 #define MENU_PATH_BOOKMARKS_PLACEHOLDER "/MenuBar/Other Menus/Bookmarks/Bookmarks Placeholder" -enum -{ - ARG_0, - ARG_APP_ID, - ARG_APP -}; - - - /* Forward and back buttons on the mouse */ static gboolean mouse_extra_buttons = TRUE; static int mouse_forward_button = 9; diff --git a/src/caja-window-menus.c b/src/caja-window-menus.c index edf1bd71..d0fc2254 100644 --- a/src/caja-window-menus.c +++ b/src/caja-window-menus.c @@ -54,9 +54,6 @@ #include <libcaja-private/caja-search-engine.h> #include <libcaja-private/caja-signaller.h> #include <libcaja-private/caja-trash-monitor.h> - -#define MATE_DESKTOP_USE_UNSTABLE_API - #include <string.h> #define MENU_PATH_EXTENSION_ACTIONS "/MenuBar/File/Extension Actions" @@ -64,7 +61,6 @@ #define NETWORK_URI "network:" #define COMPUTER_URI "computer:" -#define BURN_CD_URI "burn:" /* Struct that stores all the info necessary to activate a bookmark. */ typedef struct diff --git a/src/file-manager/fm-list-model.c b/src/file-manager/fm-list-model.c index 1bf2d599..f33da35d 100644 --- a/src/file-manager/fm-list-model.c +++ b/src/file-manager/fm-list-model.c @@ -1593,32 +1593,6 @@ fm_list_model_add_column (FMListModel *model, return FM_LIST_MODEL_NUM_COLUMNS + (model->details->columns->len - 1); } -int -fm_list_model_get_column_number (FMListModel *model, - const char *column_name) -{ - int i; - - for (i = 0; i < model->details->columns->len; i++) - { - CajaColumn *column; - char *name; - - column = model->details->columns->pdata[i]; - - g_object_get (G_OBJECT (column), "name", &name, NULL); - - if (!strcmp (name, column_name)) - { - g_free (name); - return FM_LIST_MODEL_NUM_COLUMNS + i; - } - g_free (name); - } - - return -1; -} - static void fm_list_model_dispose (GObject *object) { diff --git a/src/file-manager/fm-list-model.h b/src/file-manager/fm-list-model.h index 2d4ff88b..33b5add7 100644 --- a/src/file-manager/fm-list-model.h +++ b/src/file-manager/fm-list-model.h @@ -127,8 +127,6 @@ int fm_list_model_compare_func (FMListModel *model, int fm_list_model_add_column (FMListModel *model, CajaColumn *column); -int fm_list_model_get_column_number (FMListModel *model, - const char *column_name); void fm_list_model_subdirectory_done_loading (FMListModel *model, CajaDirectory *directory); |