mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Remove cruft.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5353 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
033743ade2
commit
65138efba4
@ -1,133 +0,0 @@
|
|||||||
/********************************************************************\
|
|
||||||
* cursor.c -- functions for changing cursors *
|
|
||||||
* *
|
|
||||||
* Copyright (C) 1997 Robin D. Clark <rclark@cs.hmc.edu> *
|
|
||||||
* Copyright (C) 1998-2000 Linas Vepstas <linas@linas.org> *
|
|
||||||
* *
|
|
||||||
* This program is free software; you can redistribute it and/or *
|
|
||||||
* modify it under the terms of the GNU General Public License as *
|
|
||||||
* published by the Free Software Foundation; either version 2 of *
|
|
||||||
* the License, or (at your option) any later version. *
|
|
||||||
* *
|
|
||||||
* This program 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 General Public License for more details. *
|
|
||||||
* *
|
|
||||||
* You should have received a copy of the GNU General Public License*
|
|
||||||
* along with this program; if not, contact: *
|
|
||||||
* *
|
|
||||||
* Free Software Foundation Voice: +1-617-542-5942 *
|
|
||||||
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
|
|
||||||
* Boston, MA 02111-1307, USA gnu@gnu.org *
|
|
||||||
\********************************************************************/
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include <gnome.h>
|
|
||||||
|
|
||||||
#include "gnc-ui.h"
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
GNC_CURSOR_NORMAL = -1,
|
|
||||||
GNC_CURSOR_BUSY = GDK_WATCH
|
|
||||||
} GNCCursorType;
|
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************\
|
|
||||||
* gnc_ui_set_cursor *
|
|
||||||
* sets the cursor to the specified type *
|
|
||||||
* *
|
|
||||||
* Args: w - the widget over which to change the cursor *
|
|
||||||
* type - the type of cursor to make *
|
|
||||||
* Return: none *
|
|
||||||
\********************************************************************/
|
|
||||||
static void
|
|
||||||
gnc_ui_set_cursor (GdkWindow *win, GNCCursorType type, gboolean update_now)
|
|
||||||
{
|
|
||||||
GdkCursor *cursor = NULL;
|
|
||||||
|
|
||||||
if (win == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (type != GNC_CURSOR_NORMAL)
|
|
||||||
cursor = gdk_cursor_new (type);
|
|
||||||
|
|
||||||
gdk_window_set_cursor (win, cursor);
|
|
||||||
|
|
||||||
if (update_now && type != GNC_CURSOR_NORMAL)
|
|
||||||
{
|
|
||||||
while (gtk_events_pending ())
|
|
||||||
gtk_main_iteration ();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type != GNC_CURSOR_NORMAL)
|
|
||||||
gdk_cursor_destroy (cursor);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************\
|
|
||||||
* gnc_set_busy_cursor *
|
|
||||||
* sets the cursor to the busy watch for the given window. *
|
|
||||||
* if the window is null, sets the cursor for all toplevel windows*
|
|
||||||
* *
|
|
||||||
* Args: w - the widget over which to make cursor busy *
|
|
||||||
* update_now - if true the cursor will be changed when the *
|
|
||||||
* call returns. *
|
|
||||||
* Return: none *
|
|
||||||
\********************************************************************/
|
|
||||||
void
|
|
||||||
gnc_set_busy_cursor (GtkWidget *w, gboolean update_now)
|
|
||||||
{
|
|
||||||
if (w != NULL)
|
|
||||||
gnc_ui_set_cursor (w->window, GNC_CURSOR_BUSY, update_now);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GList *node;
|
|
||||||
|
|
||||||
for (node = gtk_container_get_toplevels (); node; node = node->next)
|
|
||||||
{
|
|
||||||
w = node->data;
|
|
||||||
|
|
||||||
if (!w || !GTK_IS_WIDGET (w) || !w->window)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
gnc_ui_set_cursor (w->window, GNC_CURSOR_BUSY, update_now);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************\
|
|
||||||
* gnc_unset_busy_cursor *
|
|
||||||
* sets the cursor to the default cursor for the given window. *
|
|
||||||
* if the window is null, sets the cursor for all toplevel windows*
|
|
||||||
* *
|
|
||||||
* Args: w - the widget over which to make cursor normal *
|
|
||||||
* Return: none *
|
|
||||||
\********************************************************************/
|
|
||||||
void
|
|
||||||
gnc_unset_busy_cursor (GtkWidget *w)
|
|
||||||
{
|
|
||||||
if (w != NULL)
|
|
||||||
gnc_ui_set_cursor (w->window, GNC_CURSOR_NORMAL, FALSE);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GList *node;
|
|
||||||
|
|
||||||
for (node = gtk_container_get_toplevels (); node; node = node->next)
|
|
||||||
{
|
|
||||||
w = GTK_WIDGET (node->data);
|
|
||||||
|
|
||||||
if (!w || !w->window)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
gnc_ui_set_cursor (w->window, GNC_CURSOR_NORMAL, FALSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************* END OF FILE ******************************\
|
|
||||||
\********************************************************************/
|
|
@ -1,151 +0,0 @@
|
|||||||
/********************************************************************\
|
|
||||||
* druid-utils.c -- utility functions for creating druids *
|
|
||||||
* Copyright (C) 2001 Jeremy Collins *
|
|
||||||
* Copyright (C) 2001 Dave Peticolas <dave@krondo.com> *
|
|
||||||
* *
|
|
||||||
* This program is free software; you can redistribute it and/or *
|
|
||||||
* modify it under the terms of the GNU General Public License as *
|
|
||||||
* published by the Free Software Foundation; either version 2 of *
|
|
||||||
* the License, or (at your option) any later version. *
|
|
||||||
* *
|
|
||||||
* This program 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 General Public License for more details. *
|
|
||||||
* *
|
|
||||||
* You should have received a copy of the GNU General Public License*
|
|
||||||
* along with this program; if not, contact: *
|
|
||||||
* *
|
|
||||||
* Free Software Foundation Voice: +1-617-542-5942 *
|
|
||||||
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
|
|
||||||
* Boston, MA 02111-1307, USA gnu@gnu.org *
|
|
||||||
* *
|
|
||||||
\********************************************************************/
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include "dialog-utils.h"
|
|
||||||
#include "druid-utils.h"
|
|
||||||
#include "gnc-engine-util.h"
|
|
||||||
|
|
||||||
|
|
||||||
/* This static indicates the debugging module that this .o belongs to. */
|
|
||||||
static short module = MOD_GUI;
|
|
||||||
|
|
||||||
void
|
|
||||||
gnc_druid_set_watermark_image (GnomeDruid *druid, char *image_path)
|
|
||||||
{
|
|
||||||
GdkImlibImage *image;
|
|
||||||
GList *pages = GNOME_DRUID(druid)->children;
|
|
||||||
|
|
||||||
while(pages != NULL) {
|
|
||||||
|
|
||||||
image = gnc_get_gdk_imlib_image(image_path);
|
|
||||||
|
|
||||||
if (g_list_previous(pages) == NULL) {
|
|
||||||
gnome_druid_page_start_set_watermark
|
|
||||||
(GNOME_DRUID_PAGE_START(pages->data), image);
|
|
||||||
} else if (g_list_next(pages) == NULL) {
|
|
||||||
gnome_druid_page_finish_set_watermark
|
|
||||||
(GNOME_DRUID_PAGE_FINISH(pages->data), image);
|
|
||||||
}
|
|
||||||
|
|
||||||
pages = g_list_next(pages);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gnc_druid_set_title_image (GnomeDruid *druid, char *image_path)
|
|
||||||
{
|
|
||||||
GtkWidget *canvas;
|
|
||||||
GnomeCanvasItem *item;
|
|
||||||
GnomeCanvasItem *title_item;
|
|
||||||
GdkImlibImage *image;
|
|
||||||
GList *pages = GNOME_DRUID(druid)->children;
|
|
||||||
|
|
||||||
while(pages != NULL) {
|
|
||||||
|
|
||||||
image = gnc_get_gdk_imlib_image(image_path);
|
|
||||||
|
|
||||||
if (g_list_previous(pages) == NULL) {
|
|
||||||
canvas = GNOME_DRUID_PAGE_START(pages->data)->canvas;
|
|
||||||
title_item = GNOME_DRUID_PAGE_START(pages->data)->title_item;
|
|
||||||
} else if (g_list_next(pages) == NULL) {
|
|
||||||
canvas = GNOME_DRUID_PAGE_FINISH(pages->data)->canvas;
|
|
||||||
title_item = GNOME_DRUID_PAGE_FINISH(pages->data)->title_item;
|
|
||||||
} else {
|
|
||||||
canvas = GNOME_DRUID_PAGE_STANDARD(pages->data)->canvas;
|
|
||||||
title_item = GNOME_DRUID_PAGE_STANDARD(pages->data)->title_item;
|
|
||||||
}
|
|
||||||
|
|
||||||
item = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (canvas)),
|
|
||||||
gnome_canvas_image_get_type (),
|
|
||||||
"image", image,
|
|
||||||
"x", 0.0,
|
|
||||||
"y", 0.0,
|
|
||||||
"anchor", GTK_ANCHOR_NORTH_WEST,
|
|
||||||
"width", (gfloat) 462,
|
|
||||||
"height", (gfloat) 67,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
gnome_canvas_item_raise_to_top (title_item);
|
|
||||||
|
|
||||||
pages = g_list_next(pages);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gnc_druid_set_colors (GnomeDruid *druid)
|
|
||||||
{
|
|
||||||
GList *pages;
|
|
||||||
GdkColor color;
|
|
||||||
GdkColormap *cm;
|
|
||||||
|
|
||||||
if (!druid) return;
|
|
||||||
if (!GNOME_IS_DRUID (druid)) return;
|
|
||||||
|
|
||||||
color.red = (gushort) (.60 * 65535);
|
|
||||||
color.green = (gushort) (.75 * 65535);
|
|
||||||
color.blue = (gushort) (.60 * 65535);
|
|
||||||
|
|
||||||
cm = gtk_widget_get_colormap (GTK_WIDGET (druid));
|
|
||||||
|
|
||||||
gdk_colormap_alloc_color(cm, &color, FALSE, TRUE);
|
|
||||||
|
|
||||||
pages = GNOME_DRUID(druid)->children;
|
|
||||||
|
|
||||||
while (pages != NULL)
|
|
||||||
{
|
|
||||||
GnomeDruidPage *page = GNOME_DRUID_PAGE (pages->data);
|
|
||||||
|
|
||||||
if (GNOME_IS_DRUID_PAGE_START (page))
|
|
||||||
{
|
|
||||||
GnomeDruidPageStart *page_start;
|
|
||||||
|
|
||||||
page_start = GNOME_DRUID_PAGE_START (page);
|
|
||||||
|
|
||||||
gnome_druid_page_start_set_bg_color (page_start, &color);
|
|
||||||
gnome_druid_page_start_set_logo_bg_color (page_start, &color);
|
|
||||||
}
|
|
||||||
else if (GNOME_IS_DRUID_PAGE_STANDARD (page))
|
|
||||||
{
|
|
||||||
GnomeDruidPageStandard *page_standard;
|
|
||||||
|
|
||||||
page_standard = GNOME_DRUID_PAGE_STANDARD (page);
|
|
||||||
|
|
||||||
gnome_druid_page_standard_set_bg_color (page_standard, &color);
|
|
||||||
gnome_druid_page_standard_set_logo_bg_color (page_standard, &color);
|
|
||||||
}
|
|
||||||
else if (GNOME_IS_DRUID_PAGE_FINISH (page))
|
|
||||||
{
|
|
||||||
GnomeDruidPageFinish *page_finish;
|
|
||||||
|
|
||||||
page_finish = GNOME_DRUID_PAGE_FINISH (page);
|
|
||||||
|
|
||||||
gnome_druid_page_finish_set_bg_color (page_finish, &color);
|
|
||||||
gnome_druid_page_finish_set_logo_bg_color (page_finish, &color);
|
|
||||||
}
|
|
||||||
|
|
||||||
pages = g_list_next (pages);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
/********************************************************************\
|
|
||||||
* druid-utils.h -- utility functions for creating druids *
|
|
||||||
* Copyright (C) 2001 Jeremy Collins *
|
|
||||||
* *
|
|
||||||
* This program is free software; you can redistribute it and/or *
|
|
||||||
* modify it under the terms of the GNU General Public License as *
|
|
||||||
* published by the Free Software Foundation; either version 2 of *
|
|
||||||
* the License, or (at your option) any later version. *
|
|
||||||
* *
|
|
||||||
* This program 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 General Public License for more details. *
|
|
||||||
* *
|
|
||||||
* You should have received a copy of the GNU General Public License*
|
|
||||||
* along with this program; if not, contact: *
|
|
||||||
* *
|
|
||||||
* Free Software Foundation Voice: +1-617-542-5942 *
|
|
||||||
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
|
|
||||||
* Boston, MA 02111-1307, USA gnu@gnu.org *
|
|
||||||
* *
|
|
||||||
\********************************************************************/
|
|
||||||
|
|
||||||
#ifndef DRUID_UTILS_H
|
|
||||||
#define DRUID_UTILS_H
|
|
||||||
|
|
||||||
#include <gnome.h>
|
|
||||||
|
|
||||||
void gnc_druid_set_title_image (GnomeDruid *druid, char *image_path);
|
|
||||||
void gnc_druid_set_watermark_image (GnomeDruid *druid, char *image_path);
|
|
||||||
|
|
||||||
void gnc_druid_set_colors (GnomeDruid *druid);
|
|
||||||
|
|
||||||
#endif
|
|
Loading…
Reference in New Issue
Block a user