Helping the migration to Gtk+ 3.0

This commit is contained in:
Pierre Pronchery 2012-09-21 23:22:14 +00:00
parent f323873d71
commit 2613e1820e
5 changed files with 44 additions and 2 deletions

View File

@ -61,6 +61,7 @@ dist:
$(PACKAGE)-$(VERSION)/src/about.c \
$(PACKAGE)-$(VERSION)/src/accel.c \
$(PACKAGE)-$(VERSION)/src/assistant.c \
$(PACKAGE)-$(VERSION)/src/compat.c \
$(PACKAGE)-$(VERSION)/src/help.c \
$(PACKAGE)-$(VERSION)/src/menubar.c \
$(PACKAGE)-$(VERSION)/src/message.c \

View File

@ -87,4 +87,8 @@
# define GDK_KEY_uparrow GDK_uparrow
# endif
# if GTK_CHECK_VERSION(3, 0, 0)
void gdk_window_clear(GdkWindow * window);
# endif
#endif /* !LIBDESKTOP_DESKTOP_COMPAT_H */

View File

@ -19,7 +19,7 @@ INSTALL ?= install
all: $(TARGETS)
libDesktop_OBJS = about.o accel.o assistant.o help.o menubar.o message.o mime.o toolbar.o
libDesktop_OBJS = about.o accel.o assistant.o compat.o help.o menubar.o message.o mime.o toolbar.o
libDesktop_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS)
libDesktop_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
@ -41,6 +41,9 @@ accel.o: accel.c
assistant.o: assistant.c
$(CC) $(libDesktop_CFLAGS) -c assistant.c
compat.o: compat.c
$(CC) $(libDesktop_CFLAGS) -c compat.c
help.o: help.c
$(CC) $(libDesktop_CFLAGS) -c help.c

34
src/compat.c Normal file
View File

@ -0,0 +1,34 @@
/* $Id$ */
/* Copyright (c) 2012 Pierre Pronchery <khorben@defora.org> */
/* This file is part of DeforaOS Desktop libDesktop */
/* This program 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, version 3 of the License.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>. */
#include <gdk/gdkx.h>
#include "Desktop.h"
/* Compat */
#if GTK_CHECK_VERSION(3, 0, 0)
/* gdk_window_clear */
void gdk_window_clear(GdkWindow * window)
{
Display * display;
Window wid;
display = gdk_x11_get_default_xdisplay();
wid = gdk_x11_window_get_xid(window);
XClearWindow(display, wid);
}
#endif

View File

@ -7,5 +7,5 @@ dist=Makefile
[libDesktop]
type=library
sources=about.c,accel.c,assistant.c,help.c,menubar.c,message.c,mime.c,toolbar.c
sources=about.c,accel.c,assistant.c,compat.c,help.c,menubar.c,message.c,mime.c,toolbar.c
install=$(PREFIX)/lib