<commit_before>/* GnomeApp widget (C) 1998 Red Hat Software, <NAME>, <NAME>, <NAME>.
 *
 * Originally by <NAME>, with hacking by <NAME> for *_data, <NAME> added menu support,
 * toggle and radio support, and I don't know what you other people did :) menu insertion/removal
 * functions by <NAME>.
 *
 * Major cleanups and rearrangements by <NAME>.
 */

/* TO-DO list for GnomeAppHelper and friends:
 *
 * - Find out how to disable on-the-fly hotkey changing for menu items (GtkAccelGroup locking?).
 *
 * - Write a custom container for the GnomeApp window so that you can have multiple toolbars and
 *   such.
 *
 * - Fix GtkHandleBox so that it works right (i.e. is easy to re-dock) and so that it allows
 *   dragging into the top/bottom/left/right of the application window as well.
 */

#include <config.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include "libgnome/gnome-defs.h"
#include "libgnome/gnome-util.h"
#include "libgnome/gnome-config.h"
#include "libgnome/gnome-help.h"
/* Note that this file must include gnome-i18n, and not gnome-i18nP, so that _() is the same as the
 * one seen by the application.  This is moderately bogus; we should just call gettext() directly
 * here.
 */
#include "libgnome/gnome-i18n.h"
#include "gnome-app.h"
#include "gnome-app-helper.h"
#include "gnome-stock.h"
#include "gnome-pixmap.h"
#include "gnome-preferences.h"
#include "gnome-stock.h"


#define MENU_PIXMAP_LABEL_SPACING 2	/* Spacing between pixmap and label in menu items */


/* Creates a pixmap appropriate for items.  The window parameter is required by gnome-stock (bleah) */
static GtkWidget *
create_pixmap (GtkWidget *window, GnomeUIPixmapType pixmap_type, gpointer pixmap_info, int indent_missing_pixmaps)
{
	GtkWidget *pixmap;
	char *name;

	pixmap = NULL;

	switch (pixmap_type) {
	case GNOME_APP_PIXMAP_STOCK:
		pixmap = gnome_stock_pixmap_widget (window, pixmap_info);
		break;

	case GNOME_APP_PIXMAP_DATA:
		if (pixmap_info)
			pixmap = gnome_pixmap_new_from_xpm_d (pixmap_info);

		break;

	case GNOME_APP_PIXMAP_NONE:
		if (indent_missing_pixmaps)
			pixmap = gnome_stock_pixmap_widget (window, GNOME_STOCK_MENU_BLANK);

		break;

	case GNOME_APP_PIXMAP_FILENAME:
		name = gnome_pixmap_file (pixmap_info);

		if (!name)
			g_warning ("Could not find GNOME pixmap file %s", pixmap_info);
		else {
			pixmap = gnome_pixmap_new_from_file (name);
			g_free (name);
		}

		break;

	default:
		g_assert_not_reached ();
	}<commit_msg>Fixed a compiler warning - Federico<commit_after>/* GnomeApp widget (C) 1998 Red Hat Software, <NAME>, <NAME>, <NAME>.
 *
 * Originally by <NAME>, with hacking by <NAME> for *_data, <NAME> added menu support,
 * toggle and radio support, and I don't know what you other people did :) menu insertion/removal
 * functions by Jaka Mocnik.
 *
 * Major cleanups and rearrangements by <NAME>.
 */

/* TO-DO list for GnomeAppHelper and friends:
 *
 * - Find out how to disable on-the-fly hotkey changing for menu items (GtkAccelGroup locking?).
 *
 * - Write a custom container for the GnomeApp window so that you can have multiple toolbars and
 *   such.
 *
 * - Fix GtkHandleBox so that it works right (i.e. is easy to re-dock) and so that it allows
 *   dragging into the top/bottom/left/right of the application window as well.
 */

#include <config.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include "libgnome/gnome-defs.h"
#include "libgnome/gnome-util.h"
#include "libgnome/gnome-config.h"
#include "libgnome/gnome-help.h"
/* Note that this file must include gnome-i18n, and not gnome-i18nP, so that _() is the same as the
 * one seen by the application.  This is moderately bogus; we should just call gettext() directly
 * here.
 */
#include "libgnome/gnome-i18n.h"
#include "gnome-app.h"
#include "gnome-app-helper.h"
#include "gnome-stock.h"
#include "gnome-pixmap.h"
#include "gnome-preferences.h"
#include "gnome-stock.h"


#define MENU_PIXMAP_LABEL_SPACING 2	/* Spacing between pixmap and label in menu items */


/* Creates a pixmap appropriate for items.  The window parameter is required by gnome-stock (bleah) */
static GtkWidget *
create_pixmap (GtkWidget *window, GnomeUIPixmapType pixmap_type, gpointer pixmap_info, int indent_missing_pixmaps)
{
	GtkWidget *pixmap;
	char *name;

	pixmap = NULL;

	switch (pixmap_type) {
	case GNOME_APP_PIXMAP_STOCK:
		pixmap = gnome_stock_pixmap_widget (window, pixmap_info);
		break;

	case GNOME_APP_PIXMAP_DATA:
		if (pixmap_info)
			pixmap = gnome_pixmap_new_from_xpm_d (pixmap_info);

		break;

	case GNOME_APP_PIXMAP_NONE:
		if (indent_missing_pixmaps)
			pixmap = gnome_stock_pixmap_widget (window, GNOME_STOCK_MENU_BLANK);

		break;

	case GNOME_APP_PIXMAP_FILENAME:
		name = gnome_pixmap_file (pixmap_info);

		if (!name)
			g_warning ("Could not find GNOME pixmap file %s", (char *) pixmap_info);
		else {
			pixmap = gnome_pixmap_new_from_file (name);
			g_free (name);
		}

		break;

	default:
		g_assert_not_reached ();
	}
{'fraction_non_alphanumeric': 0.10580339518357679, 'fraction_numerical': 0.0043426766679826295, 'mean_word_length': 4.289144050104384, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '335485', 'n_tokens_mistral': 1987, 'n_tokens_neox': 1772, 'n_words': 548}