comparison src/stock.c @ 6009:5cd7a10c6ade

[gaim-migrate @ 6457] Renamed setup_stock() to gaim_gtk_stock_init(), to be more compliant with the rest of the naming schemes. We now initialize it before registering the debug stuff, so the debug window can use our stock icons. Also, added a Pause stock icon, and used it in the debug window. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Fri, 04 Jul 2003 00:04:07 +0000
parents 059d95c67cda
children f40283608e4b
comparison
equal deleted inserted replaced
6008:35679a3f2bcc 6009:5cd7a10c6ade
61 { GAIM_STOCK_INFO, NULL, GTK_STOCK_FIND }, 61 { GAIM_STOCK_INFO, NULL, GTK_STOCK_FIND },
62 { GAIM_STOCK_INVITE, NULL, GTK_STOCK_JUMP_TO }, 62 { GAIM_STOCK_INVITE, NULL, GTK_STOCK_JUMP_TO },
63 { GAIM_STOCK_LINK, "buttons", "insert-link-small.png" }, 63 { GAIM_STOCK_LINK, "buttons", "insert-link-small.png" },
64 { GAIM_STOCK_LOGO, "gaim", "logo.png" }, 64 { GAIM_STOCK_LOGO, "gaim", "logo.png" },
65 { GAIM_STOCK_MODIFY, NULL, GTK_STOCK_PREFERENCES }, 65 { GAIM_STOCK_MODIFY, NULL, GTK_STOCK_PREFERENCES },
66 { GAIM_STOCK_PAUSE, "buttons", "pause.png" },
66 { GAIM_STOCK_PRIVACY, NULL, GTK_STOCK_PROPERTIES }, 67 { GAIM_STOCK_PRIVACY, NULL, GTK_STOCK_PROPERTIES },
68 { GAIM_STOCK_OPEN_MAIL, NULL, GTK_STOCK_JUMP_TO },
67 { GAIM_STOCK_SEND, "buttons", "send-im.png" }, 69 { GAIM_STOCK_SEND, "buttons", "send-im.png" },
68 { GAIM_STOCK_SIGN_ON, NULL, GTK_STOCK_EXECUTE }, 70 { GAIM_STOCK_SIGN_ON, NULL, GTK_STOCK_EXECUTE },
69 { GAIM_STOCK_SIGN_OFF, NULL, GTK_STOCK_CLOSE }, 71 { GAIM_STOCK_SIGN_OFF, NULL, GTK_STOCK_CLOSE },
70 { GAIM_STOCK_SMILEY, "buttons", "insert-smiley-small.png" }, 72 { GAIM_STOCK_SMILEY, "buttons", "insert-smiley-small.png" },
71 { GAIM_STOCK_OPEN_MAIL, NULL, GTK_STOCK_JUMP_TO },
72 { GAIM_STOCK_TEXT_BIGGER, "buttons", "text_bigger.png" }, 73 { GAIM_STOCK_TEXT_BIGGER, "buttons", "text_bigger.png" },
73 { GAIM_STOCK_TEXT_NORMAL, "buttons", "text_normal.png" }, 74 { GAIM_STOCK_TEXT_NORMAL, "buttons", "text_normal.png" },
74 { GAIM_STOCK_TEXT_SMALLER, "buttons", "text_smaller.png" }, 75 { GAIM_STOCK_TEXT_SMALLER, "buttons", "text_smaller.png" },
75 { GAIM_STOCK_TYPED, "gaim", "typed.png" }, 76 { GAIM_STOCK_TYPED, "gaim", "typed.png" },
76 { GAIM_STOCK_TYPING, "gaim", "typing.png" }, 77 { GAIM_STOCK_TYPING, "gaim", "typing.png" },
79 }; 80 };
80 81
81 const GtkStockItem stock_items[] = 82 const GtkStockItem stock_items[] =
82 { 83 {
83 { GAIM_STOCK_MODIFY, N_("_Modify"), 0, 0, NULL }, 84 { GAIM_STOCK_MODIFY, N_("_Modify"), 0, 0, NULL },
84 { GAIM_STOCK_OPEN_MAIL, N_("_Open Mail"), 0, 0, NULL } 85 { GAIM_STOCK_OPEN_MAIL, N_("_Open Mail"), 0, 0, NULL },
86 { GAIM_STOCK_PAUSE, N_("_Pause"), 0, 0, NULL }
85 }; 87 };
86 88
87 static gint stock_icon_count = sizeof(stock_icons) / sizeof(*stock_icons); 89 static gint stock_icon_count = sizeof(stock_icons) / sizeof(*stock_icons);
88 static gint stock_item_count = sizeof(stock_items) / sizeof(*stock_items); 90 static gint stock_item_count = sizeof(stock_items) / sizeof(*stock_items);
91
92 static gboolean stock_inited = FALSE;
89 93
90 static gchar * 94 static gchar *
91 find_file(const char *dir, const char *base) 95 find_file(const char *dir, const char *base)
92 { 96 {
93 char *filename; 97 char *filename;
110 114
111 return filename; 115 return filename;
112 } 116 }
113 117
114 void 118 void
115 setup_stock() 119 gaim_gtk_stock_init(void)
116 { 120 {
117 GtkIconFactory *icon_factory; 121 GtkIconFactory *icon_factory;
118 int i; 122 int i;
119 GtkWidget *win; 123 GtkWidget *win;
124
125 if (stock_inited)
126 return;
120 127
121 /* Setup the icon factory. */ 128 /* Setup the icon factory. */
122 icon_factory = gtk_icon_factory_new(); 129 icon_factory = gtk_icon_factory_new();
123 130
124 gtk_icon_factory_add_default(icon_factory); 131 gtk_icon_factory_add_default(icon_factory);
163 170
164 g_object_unref(G_OBJECT(icon_factory)); 171 g_object_unref(G_OBJECT(icon_factory));
165 172
166 /* Register the stock items. */ 173 /* Register the stock items. */
167 gtk_stock_add_static(stock_items, stock_item_count); 174 gtk_stock_add_static(stock_items, stock_item_count);
175
176 stock_inited = TRUE;
168 } 177 }