/* * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors * Copyright (C) 2004-2010 Kim Woelders * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies of the Software, its documentation and marketing & publicity * materials, and acknowledgment shall be given in the documentation, materials * and software packages that this Software was used. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "E.h" #include "borders.h" #include "desktops.h" #include "dialog.h" #include "e16-ecore_list.h" #include "ewins.h" #include "file.h" #include "groups.h" #include "ipc.h" #include "settings.h" #include "snaps.h" #include "timers.h" #include "xwin.h" struct _snapshot { char *name; char *win_title; char *win_name; char *win_class; char *win_role; Window win; EWin *used; unsigned int startup_id; char track_changes; unsigned int match_flags; unsigned int use_flags; char *border_name; int desktop; int area_x, area_y; int x, y; int w, h; int layer; char sticky; char shaded; unsigned int flags[2]; char *cmd; int *groups; int num_groups; char skiptask; char skipfocus; char skipwinlist; #if USE_COMPOSITE int opacity; int focused_opacity; char shadow; #endif }; static Ecore_List *ss_list = NULL; static Timer *ss_timer = NULL; static Snapshot * _SnapCreate(const char *name) { Snapshot *sn; sn = ECALLOC(Snapshot, 1); if (!sn) return NULL; if (!ss_list) ss_list = ecore_list_new(); ecore_list_append(ss_list, sn); sn->name = Estrdup(name); return sn; } static void _SnapDestroy(Snapshot * sn) { /* Just making sure */ sn = (Snapshot *) ecore_list_node_remove(ss_list, sn); if (!sn) return; if (sn->used) sn->used->snap = NULL; Efree(sn->name); Efree(sn->win_title); Efree(sn->win_name); Efree(sn->win_class); Efree(sn->win_role); Efree(sn->border_name); Efree(sn->cmd); Efree(sn->groups); Efree(sn); } /* * Stupid hack to fix apps that set WM_WINDOW_ROLE to * a ---