Commit ac5ed202 authored by Victor Ananjevsky's avatar Victor Ananjevsky

make lookup_stock public

parent 64c6c96e
......@@ -21,5 +21,4 @@ src/text.c
src/browser.c
src/notebook.c
src/pfd.c
src/stock.h
data/yad-icon-browser.desktop.in
......@@ -26,7 +26,6 @@ yad_SOURCES = \
util.c \
main.c \
yad.h \
stock.h \
calendar.xpm
if TRAY
......
/*
* This file is part of YAD.
*
* YAD 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.
*
* YAD 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 YAD. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2008-2019, Victor Ananjevsky <ananasik@gmail.com>
*/
#ifndef _STOCK_H_
#define _STOCK_H_
#define YAD_STOCK_COUNT 19
typedef struct {
gchar *key;
gchar *label;
gchar *icon;
} YadStock;
const YadStock yad_stock_items[] = {
{ "yad-about", N_("About"), "help-about" },
{ "yad-add", N_("Add"), "list-add" },
{ "yad-apply", N_("Apply"), "gtk-apply" },
{ "yad-cancel", N_("Cancel"), "gtk-cancel" },
{ "yad-clear", N_("Clear"), "document-clear" },
{ "yad-close", N_("Close"), "window-close" },
{ "yad-edit", N_("Edit"), "gtk-edit" },
{ "yad-execute", N_("Execute"), "system-run" },
{ "yad-no", N_("No"), "gtk-no" },
{ "yad-ok", N_("OK"), "gtk-ok" },
{ "yad-open", N_("Open"), "document-open" },
{ "yad-print", N_("Print"), "document-print" },
{ "yad-quit", N_("Quit"), "application-exit" },
{ "yad-refresh", N_("Refresh"), "view-refresh" },
{ "yad-remove", N_("Remove"), "list-remove" },
{ "yad-save", N_("Save"), "document-save" },
{ "yad-search", N_("Search"), "system-search" },
{ "yad-settings", N_("Settings"), "gtk-preferences" },
{ "yad-yes", N_("Yes"), "gtk-yes" }
};
#endif /* _STOCK_H_ */
......@@ -29,10 +29,31 @@
#include <sys/shm.h>
#include "yad.h"
#include "stock.h"
YadSettings settings;
const YadStock yad_stock_items[] = {
{ "yad-about", N_("About"), "help-about" },
{ "yad-add", N_("Add"), "list-add" },
{ "yad-apply", N_("Apply"), "gtk-apply" },
{ "yad-cancel", N_("Cancel"), "gtk-cancel" },
{ "yad-clear", N_("Clear"), "document-clear" },
{ "yad-close", N_("Close"), "window-close" },
{ "yad-edit", N_("Edit"), "gtk-edit" },
{ "yad-execute", N_("Execute"), "system-run" },
{ "yad-no", N_("No"), "gtk-no" },
{ "yad-ok", N_("OK"), "gtk-ok" },
{ "yad-open", N_("Open"), "document-open" },
{ "yad-print", N_("Print"), "document-print" },
{ "yad-quit", N_("Quit"), "application-exit" },
{ "yad-refresh", N_("Refresh"), "view-refresh" },
{ "yad-remove", N_("Remove"), "list-remove" },
{ "yad-save", N_("Save"), "document-save" },
{ "yad-search", N_("Search"), "system-search" },
{ "yad-settings", N_("Settings"), "gtk-preferences" },
{ "yad-yes", N_("Yes"), "gtk-yes" }
};
void
read_settings (void)
{
......@@ -151,7 +172,7 @@ write_settings (void)
g_free (context);
}
static gboolean
gboolean
stock_lookup (gchar *key, YadStock *it)
{
gint i;
......
......@@ -521,6 +521,7 @@ typedef struct {
extern YadOptions options;
/* SETTINGS */
typedef struct {
guint width;
guint height;
......@@ -543,6 +544,7 @@ typedef struct {
extern YadSettings settings;
/* TABS */
typedef struct {
pid_t pid;
Window xid;
......@@ -554,6 +556,18 @@ typedef struct {
/* xid - allow plugs to write shmem (for sync) */
extern YadNTabs *tabs;
/* STOCK ITEMS */
#define YAD_STOCK_COUNT 19
typedef struct {
gchar *key;
gchar *label;
gchar *icon;
} YadStock;
extern const YadStock yad_stock_items[];
/* FUNCTION PROTOTYPES */
void yad_options_init (void);
GOptionContext *yad_create_context (void);
void yad_set_mode (void);
......@@ -621,6 +635,8 @@ gchar **split_arg (const gchar *str);
YadNTabs *get_tabs (key_t key, gboolean create);
gboolean stock_lookup (gchar *key, YadStock *it);
GtkWidget *get_label (gchar *str, guint border, GtkWidget *w);
gchar *escape_str (gchar *str);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment