[Commits] Makefile.am 1.1.2.12 1.1.2.13 poppler_viewer.h 1.1.2.13 1.1.2.14 poppler_viewer.c 1.1.2.94 1.1.2.95

iwkse at claws-mail.org iwkse at claws-mail.org
Mon Mar 26 10:22:13 CEST 2012


Update of /home/claws-mail/plugins/pdf_viewer/src
In directory srv:/tmp/cvs-serv9959/src

Modified Files:
      Tag: gtk2
	Makefile.am poppler_viewer.h poppler_viewer.c 
Log Message:
2012-03-26 [iwkse]	0.9.1cvs18

	* src/Makefile.am
	* src/poppler_viewer.h
	* src/poppler_viewer.c
			Use GTK STOCK images for buttons

Index: poppler_viewer.c
===================================================================
RCS file: /home/claws-mail/plugins/pdf_viewer/src/Attic/poppler_viewer.c,v
retrieving revision 1.1.2.94
retrieving revision 1.1.2.95
diff -u -d -r1.1.2.94 -r1.1.2.95
--- poppler_viewer.c	22 Oct 2011 18:26:08 -0000	1.1.2.94
+++ poppler_viewer.c	26 Mar 2012 08:22:11 -0000	1.1.2.95
@@ -77,7 +77,6 @@
 static void pdf_viewer_show_controls(PdfViewer *viewer, gboolean show);
 static gboolean pdf_viewer_scroll_page(MimeViewer *_viewer, gboolean up);
 static void pdf_viewer_scroll_one_line(MimeViewer *_viewer, gboolean up);
-static void button_set_pixmap(GtkWidget *widg, char **button_image);
 
 /** Claws-Mail Plugin functions*/
 gint plugin_init(gchar **error);
@@ -1416,29 +1415,11 @@
 
 }
 
-static void button_set_pixmap(GtkWidget *widg, char **button_image) 
-{
-	GdkPixmap *pixmap;
-	GdkBitmap *mask;
-	GtkStyle *style;
-
-	pixmap = mask = NULL;
-
-	style = gtk_widget_get_style(mainwindow_get_mainwindow()->window);
-	pixmap = gdk_pixmap_create_from_xpm_d
-		(mainwindow_get_mainwindow()->window->window, &mask,
-		 &style->bg[GTK_STATE_NORMAL], button_image);
-
-	gtk_container_add(GTK_CONTAINER(widg), 
-	gtk_image_new_from_pixmap(pixmap, mask));
-	gtk_widget_show_all(widg);
-}
-
 #define BUTTON_H_PADDING 3
-#define ADD_BUTTON_TO_TABLE(widget, xpm) \
+#define ADD_BUTTON_TO_TABLE(widget, stock_image) \
 	widget = gtk_button_new(); \
-	button_set_pixmap(widget, xpm); \
-	gtk_widget_set_size_request(GTK_WIDGET(widget), 26, 26); \
+	img = gtk_image_new_from_stock(stock_image, GTK_ICON_SIZE_MENU); \
+	gtk_button_set_image(GTK_BUTTON(widget), img); \
 	gtk_table_attach(GTK_TABLE(viewer->buttons_table), GTK_WIDGET(widget), \
 				col, col+1, 0, 1, 0, 0, BUTTON_H_PADDING, 0); \
 	col++;
@@ -1527,6 +1508,7 @@
 	GtkCellRenderer *renderer;
 	GtkTreeStore *tree_store;
 	GtkWidget *sep;
+	GtkWidget *img;
 	gint col = 0;
 
 	viewer = g_new0(PdfViewer, 1);
@@ -1581,8 +1563,8 @@
 #endif
 
 	ADD_SEP_TO_TABLE
-	ADD_BUTTON_TO_TABLE(viewer->first_page, first_arrow_xpm)
-	ADD_BUTTON_TO_TABLE(viewer->prev_page, left_arrow_xpm)
+	ADD_BUTTON_TO_TABLE(viewer->first_page, GTK_STOCK_GOTO_FIRST)
+	ADD_BUTTON_TO_TABLE(viewer->prev_page, GTK_STOCK_GO_BACK)
 	viewer->cur_page = gtk_spin_button_new_with_range(0.0, 0.0, 1.0);
 	viewer->zoom_scroll = gtk_spin_button_new_with_range(0.20, 8.0, 0.20);
 	gtk_spin_button_set_value(GTK_SPIN_BUTTON(viewer->zoom_scroll), 1.0);
@@ -1596,27 +1578,26 @@
 					0);
 	col++;
 
-	ADD_BUTTON_TO_TABLE(viewer->next_page, right_arrow_xpm)
-	ADD_BUTTON_TO_TABLE(viewer->last_page, last_arrow_xpm)
+	ADD_BUTTON_TO_TABLE(viewer->next_page, GTK_STOCK_GO_FORWARD)
+	ADD_BUTTON_TO_TABLE(viewer->last_page, GTK_STOCK_GOTO_LAST)
 	ADD_SEP_TO_TABLE
-	ADD_BUTTON_TO_TABLE(viewer->zoom_fit, zoom_fit_xpm)
-	ADD_BUTTON_TO_TABLE(viewer->zoom_in, zoom_in_xpm)
+	ADD_BUTTON_TO_TABLE(viewer->zoom_fit, GTK_STOCK_ZOOM_FIT)
+	ADD_BUTTON_TO_TABLE(viewer->zoom_in, GTK_STOCK_ZOOM_IN)
 	gtk_table_attach(GTK_TABLE(viewer->buttons_table), GTK_WIDGET(viewer->zoom_scroll),
 					col, col+1, 
 					0, 1, 0, 0, 
 					BUTTON_H_PADDING, 
 					0);
 	col++;
-	ADD_BUTTON_TO_TABLE(viewer->zoom_out, zoom_out_xpm)
-	ADD_BUTTON_TO_TABLE(viewer->zoom_width, zoom_width_xpm)
+	ADD_BUTTON_TO_TABLE(viewer->zoom_out, GTK_STOCK_ZOOM_OUT)
+	ADD_BUTTON_TO_TABLE(viewer->zoom_width, GTK_STOCK_FULLSCREEN)
 	ADD_SEP_TO_TABLE
-	ADD_BUTTON_TO_TABLE(viewer->rotate_left, rotate_left_xpm)
-	ADD_BUTTON_TO_TABLE(viewer->rotate_right, rotate_right_xpm)
+	ADD_BUTTON_TO_TABLE(viewer->rotate_left, GTK_STOCK_UNDO)
+	ADD_BUTTON_TO_TABLE(viewer->rotate_right, GTK_STOCK_REDO)
 	ADD_SEP_TO_TABLE
-	ADD_BUTTON_TO_TABLE(viewer->doc_info, doc_info_xpm)
+	ADD_BUTTON_TO_TABLE(viewer->doc_info, GTK_STOCK_INFO)
 
-	viewer->doc_index = gtk_toggle_button_new();
-	button_set_pixmap(viewer->doc_index, doc_index_xpm);
+	viewer->doc_index = GTK_WIDGET(gtk_toggle_tool_button_new_from_stock(GTK_STOCK_INDEX));
 	gtk_widget_set_size_request(GTK_WIDGET(viewer->doc_index), 26, 26);
 	gtk_table_attach(GTK_TABLE(viewer->buttons_table), GTK_WIDGET(viewer->doc_index),
 					col, col+1, 

Index: poppler_viewer.h
===================================================================
RCS file: /home/claws-mail/plugins/pdf_viewer/src/Attic/poppler_viewer.h,v
retrieving revision 1.1.2.13
retrieving revision 1.1.2.14
diff -u -d -r1.1.2.13 -r1.1.2.14
--- poppler_viewer.h	2 Jan 2009 12:59:48 -0000	1.1.2.13
+++ poppler_viewer.h	26 Mar 2012 08:22:11 -0000	1.1.2.14
@@ -37,19 +37,6 @@
 #include <messageview.h>
 #include <alertpanel.h>
 
-#include "first_arrow.xpm"
-#include "last_arrow.xpm"
-#include "left_arrow.xpm"
-#include "right_arrow.xpm"
-#include "zoom_fit.xpm"
-#include "zoom_in.xpm"
-#include "zoom_out.xpm"
-#include "zoom_width.xpm"
-#include "rotate_right.xpm"
-#include "rotate_left.xpm"
-#include "doc_info.xpm"
-#include "doc_index.xpm"
-
 /*#ifdef USE_PTHREAD
  *#include <pthread.h>
  * #endif*/

Index: Makefile.am
===================================================================
RCS file: /home/claws-mail/plugins/pdf_viewer/src/Attic/Makefile.am,v
retrieving revision 1.1.2.12
retrieving revision 1.1.2.13
diff -u -d -r1.1.2.12 -r1.1.2.13
--- Makefile.am	10 Oct 2008 05:32:10 -0000	1.1.2.12
+++ Makefile.am	26 Mar 2012 08:22:11 -0000	1.1.2.13
@@ -24,17 +24,3 @@
 	$(GTK_CFLAGS) \
 	$(POPPLER_CFLAGS) \
 	-DLOCALEDIR=\""$(localedir)"\"
-
-EXTRA_DIST = \
-	doc_index.xpm \
-	doc_info.xpm \
-	first_arrow.xpm \
-	last_arrow.xpm \
-	left_arrow.xpm \
-	right_arrow.xpm \
-	rotate_left.xpm \
-	rotate_right.xpm \
-	zoom_fit.xpm \
-	zoom_in.xpm \
-	zoom_out.xpm \
-	zoom_width.xpm



More information about the Commits mailing list