docker-1.4/0040775000175000017500000000000007563570157011054 5ustar xorxordocker-1.4/Makefile0100664000175000017500000000407207563570157012514 0ustar xorxor#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # # # Change these values to customize your installation and build process # # # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Change this PREFIX to where you want docker to be installed PREFIX=/usr/local # Change this XLIBPATH to point to your X11 development package's installation XLIBPATH=/usr/X11R6/lib #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # # # Leave the rest of the Makefile alone if you want it to build! # # # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# PACKAGE=docker VERSION=1.4 target=docker sources=docker.c kde.c icons.c xproperty.c net.c headers=docker.h kde.h icons.h xproperty.h net.h version.h extra=README COPYING version.h.in all: $(target) $(sources) $(headers) @echo Build Successful $(target): $(sources:.c=.o) $(CC) $(CFLAGS) -L$(XLIBPATH) -lX11 `pkg-config --libs glib-2.0` \ $^ -o $@ %.o: %.c $(CC) -c $(CFLAGS) `pkg-config --cflags glib-2.0` $< version.h: version.h.in Makefile sed -e "s/@VERSION@/$(VERSION)/" version.h.in > $@ install: all install $(target) $(PREFIX)/bin/$(target) uninstall: rm -f $(PREFIX)/$(target) clean: rm -rf .dist rm -f core *.o .\#* *\~ $(target) distclean: clean rm -f version.h rm -f $(PACKAGE)-*.tar.gz dist: Makefile $(sources) $(headers) $(extra) mkdir -p .dist/$(PACKAGE)-$(VERSION) && \ cp $^ .dist/$(PACKAGE)-$(VERSION) && \ tar -c -z -C .dist -f \ $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION) && \ rm -rf .dist love: $(sources) touch $^ # local dependancies docker.o: docker.c version.h kde.h icons.h docker.h net.h icons.o: icons.c icons.h docker.h kde.o: kde.c kde.h docker.h xproperty.h net.o: net.c net.h docker.h icons.h xproperty.o: xproperty.c xproperty.h docker.h docker-1.4/docker.c0100664000175000017500000002241007563570157012463 0ustar xorxor#include "version.h" #include "kde.h" #include "icons.h" #include "docker.h" #include "net.h" /*#include */ #include /*#include #include */ #include #include #include int argc; char **argv; Window win = None, hint_win = None, root = None; gboolean wmaker = FALSE; /* WindowMakerMode!!! wheeee */ Display *display = NULL; GSList *icons = NULL; int width = 0, height = 0; int border = 1; /* blank area around icons. must be > 0 */ gboolean horizontal = TRUE; /* layout direction */ int icon_size = 24; /* width and height of systray icons */ static char *display_string = NULL; /* excluding the border. sum of all child apps */ static gboolean exit_app = FALSE; void signal_handler(int signal) { switch (signal) { case SIGSEGV: case SIGFPE: g_printerr("Segmentation Fault or Critical Error encountered. " "Dumping core and aborting.\n"); abort(); case SIGPIPE: case SIGTERM: case SIGINT: case SIGHUP: exit_app = TRUE; } } void parse_cmd_line() { int i; gboolean help = FALSE; for (i = 1; i < argc; i++) { if (0 == strcasecmp(argv[i], "-display")) { ++i; if (i < argc) { display_string = argv[i]; } else { /* argument doesn't exist */ g_printerr("-display requires a parameter\n"); help = TRUE; } } else if (0 == strcasecmp(argv[i], "-wmaker")) { wmaker = TRUE; } else if (0 == strcasecmp(argv[i], "-vertical")) { horizontal = FALSE; } else if (0 == strcasecmp(argv[i], "-border")) { ++i; if (i < argc) { int b = atoi(argv[i]); if (b > 0) { border = b; } else { g_printerr("-border must be a value greater than 0\n"); help = TRUE; } } else { /* argument doesn't exist */ g_printerr("-border requires a parameter\n"); help = TRUE; } } else if (0 == strcasecmp(argv[i], "-iconsize")) { ++i; if (i < argc) { int s = atoi(argv[i]); if (s > 0) { icon_size = s; } else { g_printerr("-iconsize must be a value greater than 0\n"); help = TRUE; } } else { /* argument doesn't exist */ g_printerr("-iconsize requires a parameter\n"); help = TRUE; } } else { if (argv[i][0] == '-') help = TRUE; } if (help) { /* show usage help */ g_print("%s - version %s\n", argv[0], VERSION); g_print("Copyright 2003, Ben Jansens \n\n"); g_print("Usage: %s [OPTIONS]\n\n", argv[0]); g_print("Options:\n"); g_print(" -help Show this help.\n"); g_print(" -display DISLPAY The X display to connect to.\n"); g_print(" -border The width of the border to put around the\n" " system tray icons. Defaults to 1.\n"); g_print(" -vertical Line up the icons vertically. Defaults to\n" " horizontally.\n"); g_print(" -wmaker WindowMaker mode. This makes docker a\n" " fixed size (64x64) to appear nicely in\n" " in WindowMaker.\n" " Note: In this mode, you have a fixed\n" " number of icons that docker can hold.\n"); g_print(" -iconsize SIZE The size (width and height) to display\n" " icons as in the system tray. Defaults to\n" " 24.\n"); exit(1); } } } void create_hint_win() { XWMHints hints; XClassHint classhints; hint_win = XCreateSimpleWindow(display, root, 0, 0, 1, 1, 0, 0, 0); assert(hint_win); hints.flags = StateHint | WindowGroupHint | IconWindowHint; hints.initial_state = WithdrawnState; hints.window_group = hint_win; hints.icon_window = win; classhints.res_name = "docker"; classhints.res_class = "Docker"; XSetWMProperties(display, hint_win, NULL, NULL, argv, argc, NULL, &hints, &classhints); XMapWindow(display, hint_win); } void create_main_window() { XWMHints hints; XTextProperty text; /* the border must be > 0 if not in wmaker mode */ assert(wmaker || border > 0); if (!wmaker) win = XCreateSimpleWindow(display, root, 0, 0, border * 2, border * 2, 0, 0, 0); else win = XCreateSimpleWindow(display, root, 0, 0, 64, 64, 0, 0, 0); assert(win); char *name = "Docker"; XStringListToTextProperty(&name, 1, &text); XSetWMName(display, win, &text); hints.flags = StateHint; hints.initial_state = WithdrawnState; XSetWMHints(display, win, &hints); create_hint_win(); XSync(display, False); XSetWindowBackgroundPixmap(display, win, ParentRelative); XClearWindow(display, win); } void reposition_icons() { int x = border + ((width % icon_size) / 2), y = border + ((height % icon_size) / 2); GSList *it; for (it = icons; it != NULL; it = g_slist_next(it)) { TrayWindow *traywin = it->data; traywin->x = x; traywin->y = y; XMoveWindow(display, traywin->id, x, y); XSync(display, False); if (wmaker) { x += icon_size; if (x + icon_size > width) { x = border; y += icon_size; } } else if (horizontal) x += icon_size; else y += icon_size; } } void fix_geometry() { GSList *it; /* in wmaker mode we're a fixed size */ if (wmaker) return; /* find the proper width and height */ width = horizontal ? 0 : icon_size; height = horizontal ? icon_size : 0; for (it = icons; it != NULL; it = g_slist_next(it)) { TrayWindow *traywin = it->data; if (horizontal) width += icon_size; else height += icon_size; } XResizeWindow(display, win, width + border * 2, height + border * 2); } void event_loop() { XEvent e; Window cover; GSList *it; while (!exit_app) { while (XPending(display)) { XNextEvent(display, &e); switch (e.type) { case PropertyNotify: /* systray window list has changed? */ if (e.xproperty.atom == kde_systray_prop) { XSelectInput(display, win, NoEventMask); kde_update_icons(); XSelectInput(display, win, StructureNotifyMask); while (XCheckTypedEvent(display, PropertyNotify, &e)); } break; case ConfigureNotify: if (e.xany.window != win) { /* find the icon it pertains to and beat it into submission */ GSList *it; for (it = icons; it != NULL; it = g_slist_next(it)) { TrayWindow *traywin = it->data; if (traywin->id == e.xany.window) { XMoveResizeWindow(display, traywin->id, traywin->x, traywin->y, icon_size, icon_size); break; } } break; } /* briefly cover the entire containing window, which causes it and all of the icons to refresh their windows. finally, they update themselves when the background of the main window's parent changes. */ cover = XCreateSimpleWindow(display, win, 0, 0, border * 2 + width, border * 2 + height, 0, 0, 0); XMapWindow(display, cover); XDestroyWindow(display, cover); break; case ReparentNotify: if (e.xany.window == win) /* reparented to us */ break; case UnmapNotify: case DestroyNotify: for (it = icons; it; it = g_slist_next(it)) { if (((TrayWindow*)it->data)->id == e.xany.window) { icon_remove(it); break; } } break; case ClientMessage: if (e.xclient.message_type == net_opcode_atom && e.xclient.format == 32 && e.xclient.window == net_sel_win) net_message(&e.xclient); default: break; } } usleep(500000); } /* remove/unparent all the icons */ while (icons) { /* do the remove here explicitly, cuz the event handler isn't going to happen anymore. */ icon_remove(icons); } } int main(int c, char **v) { argc = c; argv = v; struct sigaction act; act.sa_handler = signal_handler; act.sa_flags = 0; sigaction(SIGSEGV, &act, NULL); sigaction(SIGPIPE, &act, NULL); sigaction(SIGFPE, &act, NULL); sigaction(SIGTERM, &act, NULL); sigaction(SIGINT, &act, NULL); sigaction(SIGHUP, &act, NULL); parse_cmd_line(argc, argv); display = XOpenDisplay(display_string); if (!display) { g_printerr("Unable to open Display %s. Exiting.\n", DisplayString(display_string)); } root = RootWindow(display, DefaultScreen(display)); assert(root); if (wmaker) width = height = 64 - border * 2; create_main_window(); /* set up to find KDE systray icons, and get any that already exist */ kde_init(); net_init(); /* we want to get ConfigureNotify events, and assume our parent's background has changed when we do, so we need to refresh ourself to match */ XSelectInput(display, win, StructureNotifyMask); event_loop(); XCloseDisplay(display); } docker-1.4/kde.c0100664000175000017500000000320307563570157011756 0ustar xorxor#include "kde.h" #include "docker.h" #include "xproperty.h" #include #include Atom kde_systray_prop = None; void kde_init() { kde_systray_prop = XInternAtom(display, "_KDE_NET_SYSTEM_TRAY_WINDOWS", False); assert(kde_systray_prop); XSelectInput(display, root, PropertyChangeMask); kde_update_icons(); } void kde_update_icons() { gulong count = (unsigned) -1; /* grab as many as possible */ Window *ids; int i; GSList *it, *next; gboolean removed = FALSE; /* were any removed? */ if (! xprop_get32(root, kde_systray_prop, XA_WINDOW, sizeof(Window)*8, &count, &ids)) return; /* add new windows to our list */ for (i = 0; i < count; ++i) { for (it = icons; it != NULL; it = g_slist_next(it)) { TrayWindow *traywin = it->data; if (traywin->id == ids[i]) break; } if (!it) icon_add(ids[i], KDE); } /* remove windows from our list that no longer exist in the property */ for (it = icons; it != NULL;) { TrayWindow *traywin = it->data; gboolean exists; if (traywin->type != KDE) { /* don't go removing non-kde windows */ exists = TRUE; } else { exists = FALSE; for (i = 0; i < count; ++i) { if (traywin->id == ids[i]) { exists = TRUE; break; } } } next = g_slist_next(it); if (!exists) { icon_remove(it); removed =TRUE; } it = next; } if (removed) { /* at least one tray app was removed, so reorganize 'em all and resize*/ reposition_icons(); fix_geometry(); } XFree(ids); } docker-1.4/icons.c0100664000175000017500000000540507563570157012334 0ustar xorxor#include "icons.h" #include gboolean error; int window_error_handler(Display *d, XErrorEvent *e) { d=d;e=e; if (e->error_code == BadWindow) { error = TRUE; } else { g_printerr("X ERROR NOT BAD WINDOW!\n"); abort(); } return 0; } gboolean icon_swallow(TrayWindow *traywin) { XErrorHandler old; error = FALSE; old = XSetErrorHandler(window_error_handler); XReparentWindow(display, traywin->id, win, 0, 0); XSync(display, False); XSetErrorHandler(old); return !error; } /* The traywin must have its id and type set. */ gboolean icon_add(Window id, TrayWindowType type) { TrayWindow *traywin; XEvent e; assert(id); assert(type); if (wmaker) { /* do we have room in our window for another icon? */ int max = (width / icon_size) * (height / icon_size); if (g_slist_length(icons) >= max) return; // no room, sorry! REJECTED! } traywin = g_new0(TrayWindow, 1); traywin->type = type; traywin->id = id; if (!icon_swallow(traywin)) { g_free(traywin); return FALSE; } /* find the positon for the systray app window */ if (!wmaker) { traywin->x = border + (horizontal ? width : 0); traywin->y = border + (horizontal ? 0 : height); } else { int count = g_slist_length(icons); traywin->x = border + ((width % icon_size) / 2) + (count % (width / icon_size)) * icon_size; traywin->y = border + ((height % icon_size) / 2) + (count / (height / icon_size)) * icon_size; } /* add the new icon to the list */ icons = g_slist_append(icons, traywin); /* watch for the icon trying to resize itself! BAD ICON! BAD! */ XSelectInput(display, traywin->id, StructureNotifyMask); /* position and size the icon window */ XMoveResizeWindow(display, traywin->id, traywin->x, traywin->y, icon_size, icon_size); /* resize our window so that the new window can fit in it */ fix_geometry(); /* flush before clearing, otherwise the clear isn't effective. */ XFlush(display); /* make sure the new child will get the right stuff in its background for ParentRelative. */ XClearWindow(display, win); /* show the window */ XMapRaised(display, traywin->id); return TRUE; } void icon_remove(GSList *node) { XErrorHandler old; TrayWindow *traywin = node->data; Window traywin_id = traywin->id; if (traywin->type == NET) net_icon_remove(traywin); XSelectInput(display, traywin->id, NoEventMask); /* remove it from our list */ g_free(node->data); icons = g_slist_remove_link(icons, node); /* reparent it to root */ error = FALSE; old = XSetErrorHandler(window_error_handler); XReparentWindow(display, traywin_id, root, 0, 0); XSync(display, False); XSetErrorHandler(old); reposition_icons(); fix_geometry(); } docker-1.4/xproperty.c0100664000175000017500000000421607563570157013274 0ustar xorxor#include "xproperty.h" #include "docker.h" gboolean xprop_get8(Window window, Atom atom, Atom type, int size, gulong *count, guchar **value) { Atom ret_type; int ret_size; unsigned long ret_bytes; int result; unsigned long nelements = *count; unsigned long maxread = nelements; *value = NULL; /* try get the first element */ result = XGetWindowProperty(display, window, atom, 0l, 1l, False, AnyPropertyType, &ret_type, &ret_size, &nelements, &ret_bytes, value); if (! (result == Success && ret_type == type && ret_size == size && nelements > 0)) { if (*value) XFree(*value); *value = NULL; nelements = 0; } else { /* we didn't the whole property's value, more to get */ if (! (ret_bytes == 0 || maxread <= nelements)) { int remain; /* get the entire property since it is larger than one element long */ XFree(*value); /* the number of longs that need to be retreived to get the property's entire value. The last + 1 is the first long that we retrieved above. */ remain = (ret_bytes - 1)/sizeof(long) + 1 + 1; /* dont get more than the max */ if (remain > size/8 * (signed)maxread) remain = size/8 * (signed)maxread; result = XGetWindowProperty(display, window, atom, 0l, remain, False, type, &ret_type, &ret_size, &nelements, &ret_bytes, value); /* If the property has changed type/size, or has grown since our first read of it, then stop here and try again. If it shrank, then this will still work. */ if (!(result == Success && ret_type == type && ret_size == size && ret_bytes == 0)) { if (*value) XFree(*value); xprop_get8(window, atom, type, size, count, value); } } } *count = nelements; return *value != NULL; } gboolean xprop_get32(Window window, Atom atom, Atom type, int size, gulong *count, gulong **value) { return xprop_get8(window, atom, type, size, count, (guchar**)value); } docker-1.4/net.c0100664000175000017500000000531207563570157012004 0ustar xorxor#include "net.h" #include "docker.h" #include "icons.h" #include Atom net_opcode_atom; Window net_sel_win; static Atom net_sel_atom; static Atom net_manager_atom; static Atom net_message_data_atom; /* defined in the systray spec */ #define SYSTEM_TRAY_REQUEST_DOCK 0 #define SYSTEM_TRAY_BEGIN_MESSAGE 1 #define SYSTEM_TRAY_CANCEL_MESSAGE 2 static net_create_selection_window() { net_sel_win = XCreateSimpleWindow(display, root, -1, -1, 1, 1, 0, 0, 0); assert(net_sel_win); } static net_destroy_selection_window() { XDestroyWindow(display, net_sel_win); net_sel_win = None; } void net_init() { char *name; XEvent m; name = g_strdup_printf("_NET_SYSTEM_TRAY_S%d", DefaultScreen(display)); net_sel_atom = XInternAtom(display, name, False); assert(net_sel_atom); net_opcode_atom = XInternAtom(display, "_NET_SYSTEM_TRAY_OPCODE", False); assert(net_opcode_atom); net_manager_atom = XInternAtom(display, "MANAGER", False); assert(net_manager_atom); net_message_data_atom = XInternAtom(display, "_NET_SYSTEM_TRAY_MESSAGE_DATA", False); assert(net_message_data_atom); net_create_selection_window(); XSetSelectionOwner(display, net_sel_atom, net_sel_win, CurrentTime); if (XGetSelectionOwner(display, net_sel_atom) != net_sel_win) return; /* we don't get the selection */ m.type = ClientMessage; m.xclient.message_type = net_manager_atom; m.xclient.format = 32; m.xclient.data.l[0] = CurrentTime; m.xclient.data.l[1] = net_sel_atom; m.xclient.data.l[2] = net_sel_win; m.xclient.data.l[3] = 0; m.xclient.data.l[4] = 0; XSendEvent(display, root, False, StructureNotifyMask, &m); } void net_destroy() { net_destroy_selection_window(); } void net_message(XClientMessageEvent *e) { long opcode; Window id; assert(e); opcode = e->data.l[1]; switch (opcode) { case SYSTEM_TRAY_REQUEST_DOCK: /* dock a new icon */ id = e->data.l[2]; if (id && icon_add(id, NET)) XSelectInput(display, id, StructureNotifyMask); break; case SYSTEM_TRAY_BEGIN_MESSAGE: g_printerr("Message From Dockapp\n"); id = e->window; break; case SYSTEM_TRAY_CANCEL_MESSAGE: g_printerr("Message Cancelled\n"); id = e->window; break; default: if (opcode == net_message_data_atom) { g_printerr("Text For Message From Dockapp:\n%s\n", e->data.b); id = e->window; break; } /* unknown message type. not in the spec. */ g_printerr("Warning: Received unknown client message to System Tray " "selection window.\n"); break; } } void net_icon_remove(TrayWindow *traywin) { assert(traywin); XSelectInput(display, traywin->id, NoEventMask); } docker-1.4/docker.h0100664000175000017500000000103707563570157012472 0ustar xorxor#ifndef __docker_h #define __docker_h #include #include extern Display *display; extern Window root, win; extern GSList *icons; extern int width, height; extern int border; extern gboolean horizontal; extern int icon_size; extern gboolean wmaker; typedef enum { KDE = 1, /* kde specific */ NET /* follows the standard (freedesktop.org) */ } TrayWindowType; typedef struct { TrayWindowType type; Window id; int x, y; } TrayWindow; void reposition_icons(); void fix_geometry(); #endif /* __docker_h */ docker-1.4/kde.h0100664000175000017500000000023007563570157011760 0ustar xorxor#ifndef __kde_h #define __kde_h #include #include extern Atom kde_systray_prop; void kde_update_icons(); #endif /* __kde_h */ docker-1.4/icons.h0100664000175000017500000000034507563570157012337 0ustar xorxor#ifndef __icons_h #define __icons_h #include #include #include "docker.h" extern gboolean error; gboolean icon_add(Window id, TrayWindowType type); void icon_remove(GSList *node); #endif /* __icons_h */ docker-1.4/xproperty.h0100664000175000017500000000064707563570157013305 0ustar xorxor#ifndef __xproperty_h #define __xproperty_h #include #include /* if the func returns TRUE, the returned value must be XFree()'d */ gboolean xprop_get8(Window window, Atom atom, Atom type, int size, gulong *count, guchar **value); gboolean xprop_get32(Window window, Atom atom, Atom type, int size, gulong *count, gulong **value); #endif /* __xproperty_h */ docker-1.4/net.h0100664000175000017500000000042307563570157012007 0ustar xorxor#ifndef __net_h #define __net_h #include #include #include "docker.h" extern Window net_sel_win; extern Atom net_opcode_atom; void net_init(); void net_message(XClientMessageEvent *e); void net_icon_remove(TrayWindow *traywin); #endif /* __net_h */ docker-1.4/version.h0100664000175000017500000000002607563570157012705 0ustar xorxor#define VERSION "1.4" docker-1.4/README0100664000175000017500000000505307563570157011734 0ustar xorxorDocker - Docking System Tray Copyright (C) 2003 Ben Jansens What is Docker? Docker is a docking application (WindowMaker dock app) which acts as a system tray for KDE3 and GNOME2. It can be used to replace the panel in either environment, allowing you to have a system tray without running the KDE/GNOME panel. What window managers can I use Docker with? I wrote and designed Docker to work with Openbox 2, but it should work fine in any window manager that supports WindowMaker dock apps. Why don't my KDE3 system tray icons show up? Docker requires a KDE3 compliant window manager to handle KDE3 system tray icons, and since it is a docking application, the window manager needs to also support WindowMaker Dock Apps. The only window manager that meets these requirements to my knowledge is: - Openbox 2 (http://icculus.org/openbox) If you know of any other window managers that support the KDE3 hints for the system tray and docking apps (i.e. that docker works in), please let me know so I can add them to this list, and test docker out in them! Why don't my GNOME2 system tray icons show up? I don't know! Email me and let me know what application isn't working. (Don't you dare email me about a GNOME1 application! :) Who wrote Docker? Me, of course. That is, Ben Jansens. I can be reached at . I am the founder and currently the project head of sorts for the Openbox project. =============================== || INSTALLATION INSTRUCTIONS || =============================== To install this application, simply do the following: % make (as root) # make install You can change a couple of things in the Makefile if you want to: PREFIX defines where the program will be installed to. XLIBPATH defines where your libX11.so is located. If it is not on the standard /usr/X11R6/lib path, then you will have to change this. ================== || LICENSE INFO || ================== 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; either version 2 of the License, or (at your option) any later version. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA docker-1.4/COPYING0100664000175000017500000004311007563570157012103 0ustar xorxor GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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; either version 2 of the License, or (at your option) any later version. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. docker-1.4/version.h.in0100664000175000017500000000003407563570157013311 0ustar xorxor#define VERSION "@VERSION@"