Preparing support for panel windows on the left and right sides

This commit is contained in:
Pierre Pronchery 2013-12-02 04:37:51 +01:00
parent f03bfa021f
commit 5323648965
4 changed files with 60 additions and 3 deletions

View File

@ -28,6 +28,7 @@
</authorgroup>
<copyright>
<year>2012</year>
<year>2013</year>
<holder>&firstname; &surname; &lt;&email;&gt;</holder>
</copyright>
<legalnotice>
@ -51,9 +52,13 @@
<command>&name;</command>
<group choice="plain">
<arg choice="plain">-B</arg>
<arg choice="plain">-L</arg>
<arg choice="plain">-R</arg>
<arg choice="plain">-S</arg>
<arg choice="plain">-T</arg>
<arg choice="plain">-b</arg>
<arg choice="plain">-l</arg>
<arg choice="plain">-r</arg>
<arg choice="plain">-t</arg>
</group>
</cmdsynopsis>
@ -74,6 +79,18 @@
<para>Show the bottom panel.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-L</option></term>
<listitem>
<para>Show the left panel.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-R</option></term>
<listitem>
<para>Show the right panel.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-S</option></term>
<listitem>
@ -92,6 +109,18 @@
<para>Hide the bottom panel.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-l</option></term>
<listitem>
<para>Hide the left panel.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-r</option></term>
<listitem>
<para>Hide the right panel.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-t</option></term>
<listitem>

View File

@ -77,7 +77,9 @@ typedef enum _PanelMessageShow
{
PANEL_MESSAGE_SHOW_PANEL_BOTTOM = 0x1,
PANEL_MESSAGE_SHOW_PANEL_TOP = 0x2,
PANEL_MESSAGE_SHOW_SETTINGS = 0x4
PANEL_MESSAGE_SHOW_PANEL_LEFT = 0x4,
PANEL_MESSAGE_SHOW_PANEL_RIGHT = 0x8,
PANEL_MESSAGE_SHOW_SETTINGS = 0x10
} PanelMessageShow;

View File

@ -410,6 +410,12 @@ static int _new_on_message(void * data, uint32_t value1, uint32_t value2,
if(what & PANEL_MESSAGE_SHOW_PANEL_BOTTOM
&& panel->bottom != NULL)
panel_window_show(panel->bottom, show);
if(what & PANEL_MESSAGE_SHOW_PANEL_LEFT
&& panel->left != NULL)
panel_window_show(panel->left, show);
if(what & PANEL_MESSAGE_SHOW_PANEL_RIGHT
&& panel->right != NULL)
panel_window_show(panel->right, show);
if(what & PANEL_MESSAGE_SHOW_PANEL_TOP
&& panel->top != NULL)
panel_window_show(panel->top, show);

View File

@ -60,11 +60,15 @@ static int _panelctl(PanelMessageShow what, gboolean show)
/* usage */
static int _usage(void)
{
fprintf(stderr, _("Usage: %s [-B|-S|-T|-b|-t]\n"
fprintf(stderr, _("Usage: %s [-B|-L|-R|-S|-T|-b|-l|-r|-t]\n"
" -B Show the bottom panel\n"
" -L Show the left panel\n"
" -R Show the right panel\n"
" -S Display or change settings\n"
" -T Show the top panel\n"
" -b Hide the bottom panel\n"
" -l Hide the left panel\n"
" -r Hide the right panel\n"
" -t Hide the top panel\n"), PROGNAME);
return 1;
}
@ -83,13 +87,21 @@ int main(int argc, char * argv[])
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
gtk_init(&argc, &argv);
while((o = getopt(argc, argv, "BSTbt")) != -1)
while((o = getopt(argc, argv, "BLRSTblrt")) != -1)
switch(o)
{
case 'B':
what = PANEL_MESSAGE_SHOW_PANEL_BOTTOM;
show = TRUE;
break;
case 'L':
what = PANEL_MESSAGE_SHOW_PANEL_LEFT;
show = TRUE;
break;
case 'R':
what = PANEL_MESSAGE_SHOW_PANEL_RIGHT;
show = TRUE;
break;
case 'S':
what = PANEL_MESSAGE_SHOW_SETTINGS;
show = TRUE;
@ -102,6 +114,14 @@ int main(int argc, char * argv[])
what = PANEL_MESSAGE_SHOW_PANEL_BOTTOM;
show = FALSE;
break;
case 'l':
what = PANEL_MESSAGE_SHOW_PANEL_LEFT;
show = FALSE;
break;
case 'r':
what = PANEL_MESSAGE_SHOW_PANEL_RIGHT;
show = FALSE;
break;
case 't':
what = PANEL_MESSAGE_SHOW_PANEL_TOP;
show = FALSE;