/* stock_icons.c generated by valac 0.16.0, the Vala compiler
 * generated from stock_icons.vala, do not modify */

/*
 * This file is part of LaTeXila.
 *
 * Copyright © 2012 Sébastien Wilmet
 *
 * LaTeXila 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 3 of the License, or
 * (at your option) any later version.
 *
 * LaTeXila 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 LaTeXila.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Author: Sébastien Wilmet
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include <gtk/gtk.h>


#define STOCK_ICONS_TYPE_STOCK_ICON (stock_icons_stock_icon_get_type ())
typedef struct _StockIconsStockIcon StockIconsStockIcon;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _gtk_icon_source_free0(var) ((var == NULL) ? NULL : (var = (gtk_icon_source_free (var), NULL)))
#define _gtk_icon_set_unref0(var) ((var == NULL) ? NULL : (var = (gtk_icon_set_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _StockIconsStockIcon {
	gchar* filename;
	gchar* stock_id;
};



void stock_icons_add_custom (void);
void stock_icons_register_my_stock_icons (void);
void stock_icons_add_theme_icon_to_stock (const gchar* icon_name, const gchar* stock_id);
GType stock_icons_stock_icon_get_type (void) G_GNUC_CONST;
StockIconsStockIcon* stock_icons_stock_icon_dup (const StockIconsStockIcon* self);
void stock_icons_stock_icon_free (StockIconsStockIcon* self);
void stock_icons_stock_icon_copy (const StockIconsStockIcon* self, StockIconsStockIcon* dest);
void stock_icons_stock_icon_destroy (StockIconsStockIcon* self);

const StockIconsStockIcon STOCK_ICONS_stock_icons[82] = {{DATA_DIR "/images/icons/compile_dvi.png", "compile_dvi"}, {DATA_DIR "/images/icons/compile_pdf.png", "compile_pdf"}, {DATA_DIR "/images/icons/compile_ps.png", "compile_ps"}, {DATA_DIR "/images/icons/view_dvi.png", "view_dvi"}, {DATA_DIR "/images/icons/view_pdf.png", "view_pdf"}, {DATA_DIR "/images/icons/view_ps.png", "view_ps"}, {DATA_DIR "/images/icons/textbf.png", "bold"}, {DATA_DIR "/images/icons/textit.png", "italic"}, {DATA_DIR "/images/icons/texttt.png", "typewriter"}, {DATA_DIR "/images/icons/textsl.png", "slanted"}, {DATA_DIR "/images/icons/textsc.png", "small_caps"}, {DATA_DIR "/images/icons/textsf.png", "sans_serif"}, {DATA_DIR "/images/icons/roman.png", "roman"}, {DATA_DIR "/images/icons/underline.png", "underline"}, {DATA_DIR "/images/misc-math/set-R.png", "blackboard"}, {DATA_DIR "/images/icons/sectioning-part.png", "sectioning-part"}, {DATA_DIR "/images/icons/sectioning-chapter.png", "sectioning-chapter"}, {DATA_DIR "/images/icons/sectioning-section.png", "sectioning-section"}, {DATA_DIR "/images/icons/sectioning-subsection.png", "sectioning-subsection"}, {DATA_DIR "/images/icons/sectioning-subsubsection.png", "sectioning-subsubsection"}, {DATA_DIR "/images/icons/sectioning-paragraph.png", "sectioning-paragraph"}, {DATA_DIR "/images/icons/character-size.png", "character-size"}, {DATA_DIR "/images/icons/list-itemize.png", "list-itemize"}, {DATA_DIR "/images/icons/list-enumerate.png", "list-enumerate"}, {DATA_DIR "/images/icons/list-description.png", "list-description"}, {DATA_DIR "/images/icons/list-item.png", "list-item"}, {DATA_DIR "/images/icons/references.png", "references"}, {DATA_DIR "/images/icons/math.png", "math"}, {DATA_DIR "/images/icons/math-centered.png", "math-centered"}, {DATA_DIR "/images/icons/math-numbered.png", "math-numbered"}, {DATA_DIR "/images/icons/math-array.png", "math-array"}, {DATA_DIR "/images/icons/math-numbered-array.png", "math-numbered-array"}, {DATA_DIR "/images/icons/math-superscript.png", "math-superscript"}, {DATA_DIR "/images/icons/math-subscript.png", "math-subscript"}, {DATA_DIR "/images/icons/math-frac.png", "math-frac"}, {DATA_DIR "/images/icons/math-square-root.png", "math-square-root"}, {DATA_DIR "/images/icons/math-nth-root.png", "math-nth-root"}, {DATA_DIR "/images/icons/mathcal.png", "mathcal"}, {DATA_DIR "/images/icons/mathfrak.png", "mathfrak"}, {DATA_DIR "/images/icons/delimiters-left.png", "delimiters-left"}, {DATA_DIR "/images/icons/delimiters-right.png", "delimiters-right"}, {DATA_DIR "/images/icons/badbox.png", "badbox"}, {DATA_DIR "/images/icons/logviewer.png", "view_log"}, {DATA_DIR "/images/greek/01.png", "symbol_alpha"}, {DATA_DIR "/images/icons/accent0.png", "accent0"}, {DATA_DIR "/images/icons/accent1.png", "accent1"}, {DATA_DIR "/images/icons/accent2.png", "accent2"}, {DATA_DIR "/images/icons/accent3.png", "accent3"}, {DATA_DIR "/images/icons/accent4.png", "accent4"}, {DATA_DIR "/images/icons/accent5.png", "accent5"}, {DATA_DIR "/images/icons/accent6.png", "accent6"}, {DATA_DIR "/images/icons/accent7.png", "accent7"}, {DATA_DIR "/images/icons/accent8.png", "accent8"}, {DATA_DIR "/images/icons/accent9.png", "accent9"}, {DATA_DIR "/images/icons/accent10.png", "accent10"}, {DATA_DIR "/images/icons/accent11.png", "accent11"}, {DATA_DIR "/images/icons/accent12.png", "accent12"}, {DATA_DIR "/images/icons/accent13.png", "accent13"}, {DATA_DIR "/images/icons/accent14.png", "accent14"}, {DATA_DIR "/images/icons/accent15.png", "accent15"}, {DATA_DIR "/images/icons/mathaccent0.png", "mathaccent0"}, {DATA_DIR "/images/icons/mathaccent1.png", "mathaccent1"}, {DATA_DIR "/images/icons/mathaccent2.png", "mathaccent2"}, {DATA_DIR "/images/icons/mathaccent3.png", "mathaccent3"}, {DATA_DIR "/images/icons/mathaccent4.png", "mathaccent4"}, {DATA_DIR "/images/icons/mathaccent5.png", "mathaccent5"}, {DATA_DIR "/images/icons/mathaccent6.png", "mathaccent6"}, {DATA_DIR "/images/icons/mathaccent7.png", "mathaccent7"}, {DATA_DIR "/images/icons/mathaccent8.png", "mathaccent8"}, {DATA_DIR "/images/icons/mathaccent9.png", "mathaccent9"}, {DATA_DIR "/images/icons/mathaccent10.png", "mathaccent10"}, {DATA_DIR "/images/icons/completion_choice.png", "completion_choice"}, {DATA_DIR "/images/icons/completion_cmd.png", "completion_cmd"}, {DATA_DIR "/images/icons/tree_part.png", "tree_part"}, {DATA_DIR "/images/icons/tree_chapter.png", "tree_chapter"}, {DATA_DIR "/images/icons/tree_section.png", "tree_section"}, {DATA_DIR "/images/icons/tree_subsection.png", "tree_subsection"}, {DATA_DIR "/images/icons/tree_subsubsection.png", "tree_subsubsection"}, {DATA_DIR "/images/icons/tree_paragraph.png", "tree_paragraph"}, {DATA_DIR "/images/icons/tree_todo.png", "tree_todo"}, {DATA_DIR "/images/icons/tree_label.png", "tree_label"}, {DATA_DIR "/images/icons/table.png", "table"}};

void stock_icons_add_custom (void) {
	stock_icons_register_my_stock_icons ();
	stock_icons_add_theme_icon_to_stock ("image-x-generic", "image");
	stock_icons_add_theme_icon_to_stock ("x-office-presentation", "presentation");
}


void stock_icons_stock_icon_copy (const StockIconsStockIcon* self, StockIconsStockIcon* dest) {
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	_tmp0_ = (*self).filename;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).filename);
	(*dest).filename = _tmp1_;
	_tmp2_ = (*self).stock_id;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 ((*dest).stock_id);
	(*dest).stock_id = _tmp3_;
}


void stock_icons_stock_icon_destroy (StockIconsStockIcon* self) {
	_g_free0 ((*self).filename);
	_g_free0 ((*self).stock_id);
}


StockIconsStockIcon* stock_icons_stock_icon_dup (const StockIconsStockIcon* self) {
	StockIconsStockIcon* dup;
	dup = g_new0 (StockIconsStockIcon, 1);
	stock_icons_stock_icon_copy (self, dup);
	return dup;
}


void stock_icons_stock_icon_free (StockIconsStockIcon* self) {
	stock_icons_stock_icon_destroy (self);
	g_free (self);
}


GType stock_icons_stock_icon_get_type (void) {
	static volatile gsize stock_icons_stock_icon_type_id__volatile = 0;
	if (g_once_init_enter (&stock_icons_stock_icon_type_id__volatile)) {
		GType stock_icons_stock_icon_type_id;
		stock_icons_stock_icon_type_id = g_boxed_type_register_static ("StockIconsStockIcon", (GBoxedCopyFunc) stock_icons_stock_icon_dup, (GBoxedFreeFunc) stock_icons_stock_icon_free);
		g_once_init_leave (&stock_icons_stock_icon_type_id__volatile, stock_icons_stock_icon_type_id);
	}
	return stock_icons_stock_icon_type_id__volatile;
}


void stock_icons_register_my_stock_icons (void) {
	GtkIconFactory* _tmp0_;
	GtkIconFactory* icon_factory;
	GtkIconFactory* _tmp13_;
	_tmp0_ = gtk_icon_factory_new ();
	icon_factory = _tmp0_;
	{
		StockIconsStockIcon* icon_collection = NULL;
		gint icon_collection_length1 = 0;
		gint _icon_collection_size_ = 0;
		gint icon_it = 0;
		icon_collection = STOCK_ICONS_stock_icons;
		icon_collection_length1 = G_N_ELEMENTS (STOCK_ICONS_stock_icons);
		for (icon_it = 0; icon_it < G_N_ELEMENTS (STOCK_ICONS_stock_icons); icon_it = icon_it + 1) {
			StockIconsStockIcon _tmp1_ = {0};
			StockIconsStockIcon icon = {0};
			stock_icons_stock_icon_copy (&icon_collection[icon_it], &_tmp1_);
			icon = _tmp1_;
			{
				GtkIconSet* _tmp2_;
				GtkIconSet* icon_set;
				GtkIconSource* _tmp3_;
				GtkIconSource* icon_source;
				GtkIconSource* _tmp4_;
				StockIconsStockIcon _tmp5_;
				const gchar* _tmp6_;
				GtkIconSet* _tmp7_;
				GtkIconSource* _tmp8_;
				GtkIconFactory* _tmp9_;
				StockIconsStockIcon _tmp10_;
				const gchar* _tmp11_;
				GtkIconSet* _tmp12_;
				_tmp2_ = gtk_icon_set_new ();
				icon_set = _tmp2_;
				_tmp3_ = gtk_icon_source_new ();
				icon_source = _tmp3_;
				_tmp4_ = icon_source;
				_tmp5_ = icon;
				_tmp6_ = _tmp5_.filename;
				gtk_icon_source_set_filename (_tmp4_, _tmp6_);
				_tmp7_ = icon_set;
				_tmp8_ = icon_source;
				gtk_icon_set_add_source (_tmp7_, _tmp8_);
				_tmp9_ = icon_factory;
				_tmp10_ = icon;
				_tmp11_ = _tmp10_.stock_id;
				_tmp12_ = icon_set;
				gtk_icon_factory_add (_tmp9_, _tmp11_, _tmp12_);
				_gtk_icon_source_free0 (icon_source);
				_gtk_icon_set_unref0 (icon_set);
				stock_icons_stock_icon_destroy (&icon);
			}
		}
	}
	_tmp13_ = icon_factory;
	gtk_icon_factory_add_default (_tmp13_);
	_g_object_unref0 (icon_factory);
}


void stock_icons_add_theme_icon_to_stock (const gchar* icon_name, const gchar* stock_id) {
	GtkIconSource* _tmp0_;
	GtkIconSource* icon_source;
	const gchar* _tmp1_;
	GtkIconSet* _tmp2_;
	GtkIconSet* icon_set;
	GtkIconFactory* _tmp3_;
	GtkIconFactory* icon_factory;
	const gchar* _tmp4_;
	g_return_if_fail (icon_name != NULL);
	g_return_if_fail (stock_id != NULL);
	_tmp0_ = gtk_icon_source_new ();
	icon_source = _tmp0_;
	_tmp1_ = icon_name;
	gtk_icon_source_set_icon_name (icon_source, _tmp1_);
	_tmp2_ = gtk_icon_set_new ();
	icon_set = _tmp2_;
	gtk_icon_set_add_source (icon_set, icon_source);
	_tmp3_ = gtk_icon_factory_new ();
	icon_factory = _tmp3_;
	_tmp4_ = stock_id;
	gtk_icon_factory_add (icon_factory, _tmp4_, icon_set);
	gtk_icon_factory_add_default (icon_factory);
	_g_object_unref0 (icon_factory);
	_gtk_icon_set_unref0 (icon_set);
	_gtk_icon_source_free0 (icon_source);
}



