Contributors:
- Daniel Moerner <dmoerner@gmail.com>, man page
-
-
+ Daniel Moerner <dmoerner@gmail.com> : man page and debian package
+ Doug Barton : freebsd package
+ James Buren <ryuo@frugalware.org> : Frugalware package
+ Pierre-Emmanuel Andre <pea@raveland.org> : openbsd port
+ Redroar : arch package
+
+
-
-2008-09-30
-- change tintrc format
- background and border can use linear gradiant
-- update documentation
+2008-10-28
+- fixed issue : "untitled task", "task button did not update", "window don't shade",
+ "error if I don't do 'make install", "Makefile error"
2008-09-24
- change tintrc format
for latest release, documentation and sample config file.
+
ifndef PREFIX
BINDIR=/usr/bin
XDG_CONFIG_DIR=/etc/xdg
+ MAN_DIR=/usr/share/man
else
BINDIR=$(PREFIX)/bin
XDG_CONFIG_DIR=/etc/xdg
+ MAN_DIR=/usr/share/man
endif
else
BINDIR=$(DESTDIR)/usr/bin
XDG_CONFIG_DIR=$(DESTDIR)/etc/xdg
+ MAN_DIR=$(DESTDIR)/usr/share/man
endif
install:
mkdir -p $(BINDIR)
mkdir -p $(XDG_CONFIG_DIR)/tint2
+ mkdir -p $(MANDIR)
+ mkdir -p $(MANDIR)/man1
install $(PROGNAME) $(BINDIR)
cp -f ../tintrc06 $(XDG_CONFIG_DIR)/tint2/tint2rc
- cp -f ../doc/man/tint2.1 /usr/man/man1
+ cp -f ../doc/man/tint2.1 $(MAN_DIR)/man1
uninstall:
rm -f $(BINDIR)/$(PROGNAME)
+ rm -f $(MAN_DIR)/man1/tint2.1
clean:
rm -f $(PROGNAME)
+.PHONY: clean uninstall install
draw (&panel.area);
refresh (&panel.area);
-/*
-pour version 0.7
-gestion du systray
- positionnement et taille fixe du systray (objet systray)
- détection des notifications (détection des icones, ajout a la liste)
- ajouter la transparence des icones
- gérer le redimentionnement des éléments
- => voir si lon peut faire abstraction sur le positionnement des objets ?
- sachant que certains objets (task, taskbar) on une taille définit par l'extérieur
- et d'autres objets (clock, systray) on une taille définit par l'intérieur
-
-gestion du layout
- voir le positionnement des taskbar, task et systray
- définir panel_layout dans la configuration
- comment gérer le multi panel avec des layouts différents
-
-vérifier le niveau d'abstraction du code
- utiliser la fonction draw(obj) récurrente sur Taskbar, Task, Systray, Clock
- est ce compatible avec l'affichage de la tache active et les changement de taille -> redessine le panel
-
-correction de bugs :
- memory, segfault
- background
- remettre en place single_desktop avec nouveau layout
- remettre en place multi_monitor avec nouveau layout
- vérifier le changement de configuration
-
-pour version 0.8
-gestion du thème
- voir la gestion du dégradé sur le bord et le fond (inkscape)
- faut-il trois coordonnées de padding x, y, x inter-objects
-
-gestion du zoom
- définir le zoom du panel
-
-*/
-
if (panel.clock.time1_format) {
if (panel.clock.area.redraw)
panel.refresh = 1;
server.atom._WIN_LAYER = XInternAtom (server.dsp, "_WIN_LAYER", False);
server.atom._NET_WM_STRUT_PARTIAL = XInternAtom (server.dsp, "_NET_WM_STRUT_PARTIAL", False);
server.atom.WM_NAME = XInternAtom(server.dsp, "WM_NAME", False);
+ server.atom.__SWM_VROOT = XInternAtom(server.dsp, "__SWM_VROOT", False);
}
}
+Pixmap server_create_pixmap (int width, int height)
+{
+ return XCreatePixmap (server.dsp, server.root_win, width, height, server.depth);
+}
+
+
+Pixmap get_root_pixmap ()
+{
+ Pixmap ret;
+ Window root = RootWindow(server.dsp, server.screen);
+
+ ret = None;
+ int act_format, c = 2 ;
+ u_long nitems ;
+ u_long bytes_after ;
+ u_char *prop ;
+ Atom dummy_id;
+
+ do {
+ if (XGetWindowProperty(server.dsp, root, server.atom._XROOTPMAP_ID, 0, 1,
+ False, XA_PIXMAP, &dummy_id, &act_format,
+ &nitems, &bytes_after, &prop) == Success) {
+ if (prop) {
+ ret = *((Pixmap *)prop);
+ XFree(prop);
+ break;
+ }
+ }
+ } while (--c > 0);
+
+ return ret;
+}
+
+
+/*
Pixmap get_root_pixmap ()
{
// conky capture correctement le fond d'écran en xlib !!
Pixmap root_pixmap;
unsigned long *res;
+ server.root_win = window_get_root();
+
res = server_get_property (server.root_win, server.atom._XROOTPMAP_ID, XA_PIXMAP, 0);
if (res) {
root_pixmap = *((Drawable*) res);
printf("get_root_pixmap incorrect\n");
// try _XSETROOT_ID
}
-
return 0;
-}
-
-
-
-
-Pixmap server_create_pixmap (int width, int height)
-{
- return XCreatePixmap (server.dsp, server.root_win, width, height, server.depth);
-}
-
+}
+*/
void server_refresh_root_pixmap ()
{
Atom _WIN_LAYER;
Atom _NET_WM_STRUT_PARTIAL;
Atom WM_NAME;
+ Atom __SWM_VROOT;
} Global_atom;
void server_init_atoms ();
Pixmap server_create_pixmap (int width, int height);
void get_monitors();
+Pixmap get_root_pixmap();
#endif
}
server_init_atoms ();
server.screen = DefaultScreen (server.dsp);
- server.root_win = RootWindow (server.dsp, server.screen);
+ server.root_win = RootWindow(server.dsp, server.screen);
server.depth = DefaultDepth (server.dsp, server.screen);
server.visual = DefaultVisual (server.dsp, server.screen);
server.desktop = server_get_current_desktop ();
break;
case PropertyNotify:
+ //printf("PropertyNotify\n");
event_property_notify (e.xproperty.window, e.xproperty.atom);
break;
/**************************************************************************
-* base class for all objects (panel, taskbar, task, systray, clock, ...).
-* each object 'inherit' Area and implement draw_foreground if needed.
+* Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr)
*
-* Area is at the begining of each object so &object == &area.
+* base class for all graphical objects (panel, taskbar, task, systray, clock, ...).
+* Area is at the begining of each graphical object so &object == &area.
+*
+* Area manage the background and border drawing, size and padding.
+* Area manage also the tree of visible objects
+* panel -> taskbars -> tasks
+* -> clock
+* -> systray -> icons
*
-* une zone comprend :
-* - fond : couleur / opacité
-* - contenu
-* - largeur / hauteur
-* - paddingx / paddingy
-* - pixmap mémorisant l'affichage (évite de redessiner l'objet à chaque rafraichissement)
-* - une liste de sous objets
-*
* un objet comprend les actions:
* 1) redraw(obj)
* force l'indicateur 'redraw' sur l'objet
* 6) voir refresh(obj)
*
* Implémentation :
-* - tous les éléments du panel possèdent 1 objet en début de structure
-* panel, taskbar, systray, task, ...
* - l'objet est en fait une zone (area).
* l'imbrication des sous objet doit permettre de gérer le layout.
-* - on a une relation 1<->1 entre un objet et une zone graphique
-* les taskbar affichent toutes les taches.
-* donc on utilise la liste des objets pour gérer la liste des taches.
* - les taches ont 2 objets : l'un pour la tache inactive et l'autre pour la tache active
* draw(obj) est appellé sur le premier objet automatiquement
* et draw_foreground(obj) lance l'affichage du 2 ieme objet
* 3. tester l'implémentation et évaluer les autres abstractions possibles ?
*
* 4. comment gérer le groupage des taches
-* 5. la clock est le contenu du panel. mais elle ne tiens pas compte du padding vertical ?
-* c'est ok pour la clock. voir l'impact sur paddingx ?
*
* voir resize_taskbar(), resize_clock() et resize_tasks()
* voir les taches actives et inactives ?? une seule tache est active !
void window_toggle_shade (Window win)
{
- send_event32 (win, server.atom._NET_WM_STATE, 2, 0);
+ send_event32 (win, server.atom._NET_WM_STATE, 2, server.atom._NET_WM_STATE_SHADED);
}
}
-
#---------------------------------------------
# BACKGROUND AND BORDER
#---------------------------------------------
-rounded = 1
-border_width = 1
-background_color = #282828 100
-border_color = #000000 100
-
-rounded = 1
+rounded = 5
border_width = 1
-background_color = #282828 100
-#background_color = #3b3b3b 100
-border_color = #cccccc 100
+background_color = #ffffff 40
+border_color = #ffffff 70
+
+rounded = 4
+border_width = 0
+background_color = #ffffff 0
+border_color = #d1d1d1 0
+
+rounded = 4
+border_width = 0
+background_color = #ffffff 30
+border_color = #d1d1d1 14
#---------------------------------------------
# PANEL
#---------------------------------------------
panel_monitor = 1
-panel_position = bottom right
-panel_size = 0 27
-panel_margin = 0 0
-panel_padding = 3 2
+panel_position = bottom center
+panel_size = 1000 25
+panel_margin = 0 7
+panel_padding = 6 0
font_shadow = 0
panel_background_id = 1
# TASKBAR
#---------------------------------------------
taskbar_mode = multi_desktop
-taskbar_padding = 4 0
+taskbar_padding = 2 3
taskbar_background_id = 0
#---------------------------------------------
#---------------------------------------------
task_icon = 1
task_text = 1
-task_width = 200
+task_width = 150
task_centered = 1
-task_padding = 1 3
-task_font = sans 8
-task_font_color = #ffffff 40
-task_active_font_color = #ffffff 100
-task_background_id = 0
-task_active_background_id = 2
+task_padding = 3 2
+task_font = myriad pro 8
+task_font_color = #000000 70
+task_active_font_color = #000000 100
+task_background_id = 2
+task_active_background_id = 3
#---------------------------------------------
# SYSTRAY
#---------------------------------------------
# CLOCK
#---------------------------------------------
-time1_format = %H:%M:%S
-time1_font = sans 7
-time2_format = %A %d %B
-time2_font = sans 7
-clock_font_color = #ffffff 100
-clock_padding = 0 0
+time1_format = %H:%M
+time1_font = sans bold 12
+#time2_format = %A %d %B
+#time2_font = sans bold 10
+clock_font_color = #000000 70
+clock_padding = 6 0
clock_background_id = 0
#---------------------------------------------
#---------------------------------------------
# BACKGROUND AND BORDER
#---------------------------------------------
-rounded = 5
+rounded = 3
border_width = 1
-background_color = #ffffff 40
-border_color = #ffffff 70
+background_color = #3c3020 90
+border_color = #3c3020 90
-rounded = 4
-border_width = 0
-background_color = #ffffff 0
-border_color = #d1d1d1 0
-
-rounded = 4
-border_width = 0
-background_color = #ffffff 30
-border_color = #d1d1d1 14
+rounded = 3
+border_width = 1
+background_color = #3c3020 90
+border_color = #ffffff 30
#---------------------------------------------
# PANEL
#---------------------------------------------
panel_monitor = 1
panel_position = bottom center
-panel_size = 1000 25
+panel_size = 900 30
panel_margin = 0 0
-panel_padding = 6 0
+panel_padding = 10 2
font_shadow = 0
-panel_background_id = 1
+panel_background_id = 0
#---------------------------------------------
# TASKBAR
#---------------------------------------------
-taskbar_mode = multi_desktop
-taskbar_padding = 2 3
+taskbar_mode = single_desktop
+taskbar_padding = 9 0
taskbar_background_id = 0
#---------------------------------------------
# TASKS
#---------------------------------------------
-task_icon = 1
+task_icon = 0
task_text = 1
-task_width = 150
+task_width = 190
task_centered = 1
-task_padding = 3 2
-task_font = myriad pro 8
-task_font_color = #000000 70
-task_active_font_color = #000000 100
-task_background_id = 2
-task_active_background_id = 3
+task_padding = 2 0
+task_font = sans 8.4
+task_font_color = #ececec 50
+task_active_font_color = #ffffff 90
+task_background_id = 1
+task_active_background_id = 2
#---------------------------------------------
# SYSTRAY
# CLOCK
#---------------------------------------------
time1_format = %H:%M
-time1_font = sans bold 12
-#time2_format = %A %d %B
-#time2_font = sans bold 10
-clock_font_color = #000000 70
-clock_padding = 6 0
-clock_background_id = 0
+time1_font = sans bold 8
+time2_format = %A %d %B
+time2_font = sans 7
+clock_font_color = #ececec 50
+clock_padding = 4 0
+clock_background_id = 1
#---------------------------------------------
# MOUSE ACTION ON TASK