Code cleanup
This commit is contained in:
parent
5d76bb7571
commit
d8839cc076
1
Makefile
1
Makefile
|
@ -49,6 +49,7 @@ dist:
|
||||||
$(PACKAGE)-$(VERSION)/include/Makefile \
|
$(PACKAGE)-$(VERSION)/include/Makefile \
|
||||||
$(PACKAGE)-$(VERSION)/include/project.conf \
|
$(PACKAGE)-$(VERSION)/include/project.conf \
|
||||||
$(PACKAGE)-$(VERSION)/include/Browser/desktop.h \
|
$(PACKAGE)-$(VERSION)/include/Browser/desktop.h \
|
||||||
|
$(PACKAGE)-$(VERSION)/include/Browser/plugin.h \
|
||||||
$(PACKAGE)-$(VERSION)/include/Browser/Makefile \
|
$(PACKAGE)-$(VERSION)/include/Browser/Makefile \
|
||||||
$(PACKAGE)-$(VERSION)/include/Browser/project.conf \
|
$(PACKAGE)-$(VERSION)/include/Browser/project.conf \
|
||||||
$(PACKAGE)-$(VERSION)/po/Makefile \
|
$(PACKAGE)-$(VERSION)/po/Makefile \
|
||||||
|
|
|
@ -18,41 +18,7 @@
|
||||||
#ifndef DESKTOP_BROWSER_H
|
#ifndef DESKTOP_BROWSER_H
|
||||||
# define DESKTOP_BROWSER_H
|
# define DESKTOP_BROWSER_H
|
||||||
|
|
||||||
# include <sys/stat.h>
|
|
||||||
# include <gtk/gtk.h>
|
|
||||||
# include <Desktop.h>
|
|
||||||
# include "Browser/desktop.h"
|
# include "Browser/desktop.h"
|
||||||
|
# include "Browser/plugin.h"
|
||||||
|
|
||||||
/* Browser */
|
|
||||||
/* public */
|
|
||||||
/* types */
|
|
||||||
typedef struct _Browser Browser;
|
|
||||||
|
|
||||||
typedef struct _BrowserPlugin BrowserPlugin;
|
|
||||||
|
|
||||||
typedef struct _BrowserPluginHelper
|
|
||||||
{
|
|
||||||
Browser * browser;
|
|
||||||
int (*error)(Browser * browser, char const * message, int ret);
|
|
||||||
GdkPixbuf * (*get_icon)(Browser * browser, char const * filename,
|
|
||||||
char const * type, struct stat * lst, struct stat * st,
|
|
||||||
int size);
|
|
||||||
Mime * (*get_mime)(Browser * browser);
|
|
||||||
char const * (*get_type)(Browser * browser, char const * filename,
|
|
||||||
mode_t mode);
|
|
||||||
int (*set_location)(Browser * browser, char const * path);
|
|
||||||
} BrowserPluginHelper;
|
|
||||||
|
|
||||||
typedef const struct _BrowserPluginDefinition
|
|
||||||
{
|
|
||||||
char const * name;
|
|
||||||
char const * icon;
|
|
||||||
char const * description;
|
|
||||||
BrowserPlugin * (*init)(BrowserPluginHelper * helper);
|
|
||||||
void (*destroy)(BrowserPlugin * plugin);
|
|
||||||
GtkWidget * (*get_widget)(BrowserPlugin * plugin);
|
|
||||||
void (*refresh)(BrowserPlugin * plugin, GList * selection);
|
|
||||||
} BrowserPluginDefinition;
|
|
||||||
|
|
||||||
#endif /* !DESKTOP_BROWSER_H */
|
#endif /* !DESKTOP_BROWSER_H */
|
||||||
|
|
|
@ -14,10 +14,13 @@ clean:
|
||||||
distclean: clean
|
distclean: clean
|
||||||
|
|
||||||
install:
|
install:
|
||||||
$(MKDIR) $(DESTDIR)$(PREFIX)/include/Desktop/Browser
|
$(MKDIR) $(DESTDIR)$(INCLUDEDIR)/Desktop/Browser
|
||||||
$(INSTALL) -m 0644 -- desktop.h $(DESTDIR)$(PREFIX)/include/Desktop/Browser/desktop.h
|
$(INSTALL) -m 0644 -- desktop.h $(DESTDIR)$(INCLUDEDIR)/Desktop/Browser/desktop.h
|
||||||
|
$(MKDIR) $(DESTDIR)$(INCLUDEDIR)/Desktop/Browser
|
||||||
|
$(INSTALL) -m 0644 -- plugin.h $(DESTDIR)$(INCLUDEDIR)/Desktop/Browser/plugin.h
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
$(RM) -- $(DESTDIR)$(PREFIX)/include/Desktop/Browser/desktop.h
|
$(RM) -- $(DESTDIR)$(INCLUDEDIR)/Desktop/Browser/desktop.h
|
||||||
|
$(RM) -- $(DESTDIR)$(INCLUDEDIR)/Desktop/Browser/plugin.h
|
||||||
|
|
||||||
.PHONY: all clean distclean install uninstall
|
.PHONY: all clean distclean install uninstall
|
||||||
|
|
57
include/Browser/plugin.h
Normal file
57
include/Browser/plugin.h
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
/* $Id$ */
|
||||||
|
/* Copyright (c) 2012 Pierre Pronchery <khorben@defora.org> */
|
||||||
|
/* This file is part of DeforaOS Desktop Browser */
|
||||||
|
/* 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/>. */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef DESKTOP_BROWSER_PLUGIN_H
|
||||||
|
# define DESKTOP_BROWSER_PLUGIN_H
|
||||||
|
|
||||||
|
# include <sys/stat.h>
|
||||||
|
# include <gtk/gtk.h>
|
||||||
|
# include <Desktop.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* Browser */
|
||||||
|
/* public */
|
||||||
|
/* types */
|
||||||
|
typedef struct _Browser Browser;
|
||||||
|
|
||||||
|
typedef struct _BrowserPlugin BrowserPlugin;
|
||||||
|
|
||||||
|
typedef struct _BrowserPluginHelper
|
||||||
|
{
|
||||||
|
Browser * browser;
|
||||||
|
int (*error)(Browser * browser, char const * message, int ret);
|
||||||
|
GdkPixbuf * (*get_icon)(Browser * browser, char const * filename,
|
||||||
|
char const * type, struct stat * lst, struct stat * st,
|
||||||
|
int size);
|
||||||
|
Mime * (*get_mime)(Browser * browser);
|
||||||
|
char const * (*get_type)(Browser * browser, char const * filename,
|
||||||
|
mode_t mode);
|
||||||
|
int (*set_location)(Browser * browser, char const * path);
|
||||||
|
} BrowserPluginHelper;
|
||||||
|
|
||||||
|
typedef const struct _BrowserPluginDefinition
|
||||||
|
{
|
||||||
|
char const * name;
|
||||||
|
char const * icon;
|
||||||
|
char const * description;
|
||||||
|
BrowserPlugin * (*init)(BrowserPluginHelper * helper);
|
||||||
|
void (*destroy)(BrowserPlugin * plugin);
|
||||||
|
GtkWidget * (*get_widget)(BrowserPlugin * plugin);
|
||||||
|
void (*refresh)(BrowserPlugin * plugin, GList * selection);
|
||||||
|
} BrowserPluginDefinition;
|
||||||
|
|
||||||
|
#endif /* !DESKTOP_BROWSER_PLUGIN_H */
|
|
@ -1,5 +1,8 @@
|
||||||
includes=desktop.h
|
includes=desktop.h,plugin.h
|
||||||
dist=Makefile
|
dist=Makefile
|
||||||
|
|
||||||
[desktop.h]
|
[desktop.h]
|
||||||
install=$(PREFIX)/include/Desktop/Browser
|
install=$(INCLUDEDIR)/Desktop/Browser
|
||||||
|
|
||||||
|
[plugin.h]
|
||||||
|
install=$(INCLUDEDIR)/Desktop/Browser
|
||||||
|
|
|
@ -21,11 +21,11 @@ distclean:
|
||||||
|
|
||||||
install:
|
install:
|
||||||
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) install) || exit; done
|
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) install) || exit; done
|
||||||
$(MKDIR) $(DESTDIR)$(PREFIX)/include/Desktop
|
$(MKDIR) $(DESTDIR)$(INCLUDEDIR)/Desktop
|
||||||
$(INSTALL) -m 0644 -- Browser.h $(DESTDIR)$(PREFIX)/include/Desktop/Browser.h
|
$(INSTALL) -m 0644 -- Browser.h $(DESTDIR)$(INCLUDEDIR)/Desktop/Browser.h
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit; done
|
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit; done
|
||||||
$(RM) -- $(DESTDIR)$(PREFIX)/include/Desktop/Browser.h
|
$(RM) -- $(DESTDIR)$(INCLUDEDIR)/Desktop/Browser.h
|
||||||
|
|
||||||
.PHONY: all subdirs clean distclean install uninstall
|
.PHONY: all subdirs clean distclean install uninstall
|
||||||
|
|
|
@ -3,4 +3,4 @@ includes=Browser.h
|
||||||
dist=Makefile
|
dist=Makefile
|
||||||
|
|
||||||
[Browser.h]
|
[Browser.h]
|
||||||
install=$(PREFIX)/include/Desktop
|
install=$(INCLUDEDIR)/Desktop
|
||||||
|
|
Loading…
Reference in New Issue
Block a user