[prev in list] [next in list] [prev in thread] [next in thread] 

List:       moblin-commits
Subject:    [Moblin-Commits] moblin-compiz-plugins: Changes to 'master'
From:       sbryan () moblin ! org (Shane Bryan)
Date:       2008-09-04 22:13:47
Message-ID: 20080904221347.B6E3592C117 () moblin ! org
[Download RAW message or body]

This email list is read-only.  Emails sent to this list will be discarded
----------------------------------
 four-corners/TODO                                  |    5 -
 four-corners/fc.c                                  |  200 ++++++++++++--------
 four-corners/fc.xml.in                             |   39 +++-
 four-corners/images/fc/set7/appMenu_Round02.svg    |  101 +++--------
 .../images/fc/set7/appSwitcher_Round02.svg         |  144 +++-----------
 four-corners/images/fc/set7/device_Round02.svg     |   97 +++++------
 four-corners/images/fc/set7/share_Round02.svg      |  155 ++-------------
 four-corners/images/fc/set9/AppMenu_Simple02.svg   |   71 +-------
 .../images/fc/set9/AppSwitcher_Simple02.svg        |  127 +------------
 four-corners/images/fc/set9/Device_Simple02.svg    |  173 ++----------------
 four-corners/images/fc/set9/Share_Simple02.svg     |  167 +----------------
 11 files changed, 312 insertions(+), 967 deletions(-)

New commits:
commit 09f37c1cc4a24615472a03454bc27396e805a5b7
Author: Shane Bryan <dbryans@gmail.com>
Date:   Thu Sep 4 15:11:00 2008 -0700

    - Added user configurable keybinding mapping to trigger button "press" events
      in addition to mouse based events.  New options (fc.xml.in) and callbacks
      (fc.c) added to trigger button actions when configured keysym is pressed
      (for example, "<super><shift>l").)
    
    Signed-off-by: Shane Bryan <dbryans@gmail.com>

commit 143d8026b4a596bee400d889af2d9e0c54979eef
Author: Shane Bryan <dbryans@gmail.com>
Date:   Wed Aug 27 14:03:54 2008 -0700

    - Updating several sample icons with real SVG files instead of encapsulated
      PNG files
    
    Signed-off-by: Shane Bryan <dbryans@gmail.com>


Diff in this email is a maximum of 400 lines.
diff --git a/four-corners/TODO b/four-corners/TODO
index fbc2d2c..b5dc493 100644
--- a/four-corners/TODO
+++ b/four-corners/TODO
@@ -1,10 +1,5 @@
 
 Moblin Four Courners Compiz plugin TODO list:
-- Add option to each corner to enable or disable it
-
-- Add user configurable keybinding mapping to trigger button "press" events in
-  addition to mouse based events
-
 - Experiment with using Genesis to launch apps by name
 
 - cool visualizations (lighting, motion, shadows) on buttons when interesting
diff --git a/four-corners/fc.c b/four-corners/fc.c
index d406960..27e09ed 100644
--- a/four-corners/fc.c
+++ b/four-corners/fc.c
@@ -181,6 +181,36 @@ static void fcUnPressButton(void)
         }
 }
 
+static Bool fcButtonInitiate (CompDisplay     *d,
+                              CompAction      *action,
+                              CompActionState state,
+                              CompOption      *option,
+                              int             nOption)
+{
+    CompScreen *s = NULL;
+
+    s = findScreenAtDisplay(d,XDefaultRootWindow(d->display));
+
+    if (action->key.keycode == fcGetUtahKey(d)->key.keycode)
+    {
+        runCommand(s,fcGetUtahAction(s));
+    }
+    else if (action->key.keycode == fcGetColoradoKey(d)->key.keycode)
+    {
+        runCommand(s,fcGetColoradoAction(s));
+    }
+    else if (action->key.keycode == fcGetArizonaKey(d)->key.keycode)
+    {
+        runCommand(s,fcGetArizonaAction(s));
+    }
+    else if (action->key.keycode == fcGetNewmexicoKey(d)->key.keycode)
+    {
+        runCommand(s,fcGetNewmexicoAction(s));
+    }
+
+    return TRUE;
+}
+
 // One of the corner buttons was pressed
 static void fcButtonPressed(int g)
 {
@@ -922,68 +952,11 @@ static void fcScreenOptionChanged (CompScreen *s, CompOption \
*opt,  {
     Bool    redraw = FALSE;
     CompWindow *w;
-    int i;
-    FC_SCREEN(s);
 
     switch(num) {
-    case FcScreenOptionUtahEnable:
-        corners[NW].button->enabled=fcGetUtahEnable(s);
-        redraw = TRUE;
-        break;
-    case FcScreenOptionColoradoEnable:
-        corners[NE].button->enabled=fcGetColoradoEnable(s);
-        redraw = TRUE;
-        break;
-    case FcScreenOptionArizonaEnable:
-        corners[SW].button->enabled=fcGetArizonaEnable(s);
-        redraw = TRUE;
-        break;
-    case FcScreenOptionNewmexicoEnable:
-        corners[SE].button->enabled=fcGetNewmexicoEnable(s);
-        redraw = TRUE;
-        break;
-    case FcScreenOptionButtonSize:
-        // for now, we are assuming square buttons
-        fcButtonWidth = fcButtonHeight = fcGetButtonSize(s);
-
-        // since we've had a request to change size, re-calc all buttons
-        for (i=0;i<4;i++)
-        {
-            fcResizeButton (corners[i].button, fcButtonWidth, fcButtonHeight);
-        }
-        redraw = TRUE;
-        break;
-    case FcScreenOptionAnimationLength:
-        fc_screen->transTime = fcGetAnimationLength(s);
-        break;
-    case FcScreenOptionVisibleOpacity:
-        for (i=0;i<4;i++)
-        {
-            // rebase the desired opacity for full visible button
-            corners[i].button->visibleOpacity=fcGetVisibleOpacity(s);
-        }
-        redraw = TRUE;
-        break;
-    case FcScreenOptionHiddenOpacity:
-        for (i=0;i<4;i++)
-        {
-            // rebase the desired opacity for full visible button
-            corners[i].button->hiddenOpacity=fcGetHiddenOpacity(s);
-        }
-        break;
-    case FcScreenOptionHiddenScale:
-        for (i=0;i<4;i++)
-        {
-            // rebase the desired opacity for full visible button
-            corners[i].button->hiddenScale=fcGetHiddenScale(s);
-        }
-        break;
     case FcScreenOptionUtahAction:
-        break;
     case FcScreenOptionColoradoAction:
-        break;
     case FcScreenOptionArizonaAction:
-        break;
     case FcScreenOptionNewmexicoAction:
         break;
 
@@ -991,9 +964,9 @@ static void fcScreenOptionChanged (CompScreen *s, CompOption \
*opt,  case FcScreenOptionColoradoMatch:
     case FcScreenOptionArizonaMatch:
     case FcScreenOptionNewmexicoMatch:
-    for(w = s->windows; w; w = w->next)
-        fcUpdateWindowMatch(w);
-    break;
+        for(w = s->windows; w; w = w->next)
+            fcUpdateWindowMatch(w);
+        break;
 
     // ================================================================
     // TODO: For the following 4 options, if the file name has been 
@@ -1029,6 +1002,77 @@ static void fcScreenOptionChanged (CompScreen *s, CompOption \
*opt,  damageScreen(s);
 }
 
+static void fcDisplayOptionChanged (CompDisplay *d, CompOption *opt,
+                                    FcDisplayOptions num)
+{
+    Bool    redraw = FALSE;
+    CompScreen *s = NULL;
+    int i;
+
+    s = findScreenAtDisplay(d,XDefaultRootWindow(d->display));
+    FC_SCREEN(s);
+
+    switch(num) {
+    case FcDisplayOptionUtahEnable:
+        corners[NW].button->enabled=fcGetUtahEnable(d);
+        redraw = TRUE;
+        break;
+    case FcDisplayOptionColoradoEnable:
+        corners[NE].button->enabled=fcGetColoradoEnable(d);
+        redraw = TRUE;
+        break;
+    case FcDisplayOptionArizonaEnable:
+        corners[SW].button->enabled=fcGetArizonaEnable(d);
+        redraw = TRUE;
+        break;
+    case FcDisplayOptionNewmexicoEnable:
+        corners[SE].button->enabled=fcGetNewmexicoEnable(d);
+        redraw = TRUE;
+        break;
+    case FcDisplayOptionButtonSize:
+        // for now, we are assuming square buttons
+        fcButtonWidth = fcButtonHeight = fcGetButtonSize(d);
+
+        // since we've had a request to change size, re-calc all buttons
+        for (i=0;i<4;i++)
+        {
+            fcResizeButton (corners[i].button, fcButtonWidth, fcButtonHeight);
+        }
+        redraw = TRUE;
+        break;
+    case FcDisplayOptionAnimationLength:
+        fc_screen->transTime = fcGetAnimationLength(d);
+        break;
+    case FcDisplayOptionVisibleOpacity:
+        for (i=0;i<4;i++)
+        {
+            // rebase the desired opacity for full visible button
+            corners[i].button->visibleOpacity=fcGetVisibleOpacity(d);
+        }
+        redraw = TRUE;
+        break;
+    case FcDisplayOptionHiddenOpacity:
+        for (i=0;i<4;i++)
+        {
+            // rebase the desired opacity for full visible button
+            corners[i].button->hiddenOpacity=fcGetHiddenOpacity(d);
+        }
+        break;
+    case FcDisplayOptionHiddenScale:
+        for (i=0;i<4;i++)
+        {
+            // rebase the desired opacity for full visible button
+            corners[i].button->hiddenScale=fcGetHiddenScale(d);
+        }
+        break;
+    default:
+        break;
+    }
+
+    if (redraw)
+        damageScreen(s);
+}
+
 // Initialize our static array of 4 corner buttons, initialize the buttons
 static Bool fcInitCorners (CompScreen *s)
 {
@@ -1047,7 +1091,7 @@ static Bool fcInitCorners (CompScreen *s)
     }
 
     // Read in the initial values from Compiz default configuration
-    fcButtonWidth = fcButtonHeight = fcGetButtonSize(s);
+    fcButtonWidth = fcButtonHeight = fcGetButtonSize(s->display);
     corners[NW].filename = fcGetUtahIcon(s);
     corners[NE].filename = fcGetColoradoIcon(s);
     corners[SW].filename = fcGetArizonaIcon(s);
@@ -1060,16 +1104,16 @@ static Bool fcInitCorners (CompScreen *s)
         
     if (!corners[NW].button)
         corners[NW].button = fcNewButton(NW, s);
-        corners[NW].button->enabled = fcGetUtahEnable(s);
+        corners[NW].button->enabled = fcGetUtahEnable(s->display);
     if (!corners[NE].button)
         corners[NE].button = fcNewButton(NE, s);
-        corners[NE].button->enabled = fcGetColoradoEnable(s);
+        corners[NE].button->enabled = fcGetColoradoEnable(s->display);
     if (!corners[SW].button)
         corners[SW].button = fcNewButton(SW, s);
-        corners[SW].button->enabled = fcGetArizonaEnable(s);
+        corners[SW].button->enabled = fcGetArizonaEnable(s->display);
     if (!corners[SE].button)
         corners[SE].button = fcNewButton(SE, s);
-        corners[SE].button->enabled = fcGetNewmexicoEnable(s);
+        corners[SE].button->enabled = fcGetNewmexicoEnable(s->display);
 
     return TRUE;
 
@@ -1114,6 +1158,21 @@ static Bool fcInitDisplay (CompPlugin  *p, CompDisplay *d)
     WRAP (fc_display, d, handleEvent, fcHandleEvent);
     d->base.privates[displayPrivateIndex].ptr = fc_display;
 
+    fcSetUtahEnableNotify(d,fcDisplayOptionChanged);
+    fcSetColoradoEnableNotify(d,fcDisplayOptionChanged);
+    fcSetArizonaEnableNotify(d,fcDisplayOptionChanged);
+    fcSetNewmexicoEnableNotify(d,fcDisplayOptionChanged);
+    fcSetButtonSizeNotify(d,fcDisplayOptionChanged);
+    fcSetAnimationLengthNotify(d,fcDisplayOptionChanged);
+    fcSetVisibleOpacityNotify(d,fcDisplayOptionChanged);
+    fcSetHiddenOpacityNotify(d,fcDisplayOptionChanged);
+    fcSetHiddenScaleNotify(d,fcDisplayOptionChanged);
+
+    fcSetUtahKeyInitiate(d, fcButtonInitiate);
+    fcSetColoradoKeyInitiate(d, fcButtonInitiate);
+    fcSetArizonaKeyInitiate(d, fcButtonInitiate);
+    fcSetNewmexicoKeyInitiate(d, fcButtonInitiate);
+
     return TRUE;
 }
 
@@ -1153,15 +1212,6 @@ static Bool fcInitScreen (CompPlugin *p, CompScreen *s)
 
     fc_screen->grab = 0;
 
-    fcSetUtahEnableNotify(s,fcScreenOptionChanged);
-    fcSetColoradoEnableNotify(s,fcScreenOptionChanged);
-    fcSetArizonaEnableNotify(s,fcScreenOptionChanged);
-    fcSetNewmexicoEnableNotify(s,fcScreenOptionChanged);
-    fcSetButtonSizeNotify(s,fcScreenOptionChanged);
-    fcSetAnimationLengthNotify(s,fcScreenOptionChanged);
-    fcSetVisibleOpacityNotify(s,fcScreenOptionChanged);
-    fcSetHiddenOpacityNotify(s,fcScreenOptionChanged);
-    fcSetHiddenScaleNotify(s,fcScreenOptionChanged);
     fcSetUtahIconNotify(s,fcScreenOptionChanged);
     fcSetColoradoIconNotify(s,fcScreenOptionChanged);
     fcSetArizonaIconNotify(s,fcScreenOptionChanged);
@@ -1169,7 +1219,7 @@ static Bool fcInitScreen (CompPlugin *p, CompScreen *s)
 
     fc_screen->hiding = FALSE;
     fc_screen->showing = FALSE;
-    fc_screen->transTime = fcGetAnimationLength(s);
+    fc_screen->transTime = fcGetAnimationLength(s->display);
     timerclear(&fc_screen->startTime);
     timerclear(&fc_screen->lastTime);
 
diff --git a/four-corners/fc.xml.in b/four-corners/fc.xml.in
index b9464da..946d952 100644
--- a/four-corners/fc.xml.in
+++ b/four-corners/fc.xml.in
@@ -2,7 +2,7 @@
 <compiz>
     <plugin name="fc" useBcop="true">
         <_short>Four Corners Plugin</_short>
-	    <_long>Implementation for the Moblin four corner menu presentation and event \
triggering of the four corner apps (Utah, Colorado, Arizona, New Mexico)</_long> +    \
<_long>Implementation for the Moblin four corner menu presentation and event \
triggering of the four corner apps (Utah, Colorado, Arizona, New Mexico)</_long>  \
<category>Moblin Core</category>  <deps>
             <relation type="before">
@@ -14,31 +14,50 @@
                 <plugin>imgjpeg</plugin>
             </relation>
         </deps>
-        <display></display>
-        <screen>
+        <display>
             <group>
                 <option name="utah_enable" type="bool">
                     <_short>Enable Share Menu</_short>
                     <_long>Toggle the display of the Share Menu button</_long>
                     <default>true</default>
                 </option>
+                <option name="utah_key" type="key">
+                    <_short>Share Menu trigger (key)</_short>
+                    <_long>Key sequence to trigger the Share Menu</_long>
+                    <default></default>
+                </option>
                 <option name="colorado_enable" type="bool">
                     <_short>Enable Application Launcher</_short>
                     <_long>Toggle the display of the Application launcher \
button</_long>  <default>true</default>
                 </option>
+                <option name="colorado_key" type="key">
+                    <_short>Application Launcher trigger (key)</_short>
+                    <_long>Key sequence to trigger the Application Launcher</_long>
+                    <default></default>
+                </option>
                 <option name="arizona_enable" type="bool">
                     <_short>Enable Default Action Menu</_short>
                     <_long>Toggle the display of the Default Action Menu \
button</_long>  <default>true</default>
                 </option>
+                <option name="arizona_key" type="key">
+                    <_short>Default Action Menu trigger (key)</_short>
+                    <_long>Key sequence to trigger the Default Action Menu</_long>
+                    <default></default>
+                </option>
                 <option name="newmexico_enable" type="bool">
                     <_short>Enable Status Menu</_short>
                     <_long>Toggle the display of the Status Menu button</_long>
                     <default>true</default>
                 </option>
-				<subgroup>
-                    <_short>Behaviors</_short>
+                <option name="newmexico_key" type="key">
+                    <_short>Status Menu trigger (key)</_short>
+                    <_long>Key sequence to trigger the Status Menu</_long>
+                    <default></default>
+                </option>
+                <subgroup>
+                    <_short>Appearance</_short>
                     <option name="button_size" type="int">
                         <_short>Button Size(px)</_short>
                         <_long>Specify the size (in pixels) of the buttons to \
draw</_long> @@ -74,10 +93,12 @@
                         <min>0.0</min>
                         <max>1.0</max>
                     </option>
-				</subgroup>
-			</group>
-			<group>
-				<_short>Buttons</_short>
+                </subgroup>
+            </group>
+        </display>
+        <screen>
+            <group>
+                <_short>Button Options</_short>
                 <subgroup>
                     <_short>Share Menu</_short>
                     <option name="utah_icon" type="string">
diff --git a/four-corners/images/fc/set7/appMenu_Round02.svg \
b/four-corners/images/fc/set7/appMenu_Round02.svg index 211675a..be42d70 100644
--- a/four-corners/images/fc/set7/appMenu_Round02.svg
+++ b/four-corners/images/fc/set7/appMenu_Round02.svg
@@ -5,79 +5,30 @@
 ]>
 <svg version="1.1"
 	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" \
                xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="92px" height="92px" viewBox="566.614 57.34 92 92" \
enable-background="new 566.614 57.34 92 92" +	 x="0px" y="0px" width="92px" \
height="92px" viewBox="-10.697 -19.411 92 92" enable-background="new -10.697 -19.411 \
92 92"  xml:space="preserve">
 <defs>
 </defs>
-<rect display="none" width="1084" height="621.001"/>
-<image overflow="visible" width="60" height="57" \
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA5CAYAAABqMUjBAAAACXBIWXMAAAsSAAALEgHS3X78AAAA
                
-GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADhVJREFUeNq0W4t22zgOJSjZbpK2
-84ez82nTj5w2tkVieUGABCnZyXTPukeVTNESAVw8idDff//N4X/8EFFg5qMbIfyb8f/TB28ivY7+
-xvlykcW/vr3J+bNHI2I+nowvX15CPJ0DLUudVq5DrNdh9dcnuWZd+GePLa7tuhJNcr2ahJby4suX
-L2FdZSi8fv0q57dyNmGw/twLh/W/918/K9MKITmncuSQUw6pXOP+evkiY9zulfE1lmWcOjqWta2Q
-lRFyC2LhvJNcWgrD7tf9eFzlh0xLiPleGYrHlDGhLsZYGHkSokEgle8Yu99uMvl0Pldi2XMs6Pc6
-8nb6I2z3mywQxOEMQnA36fhyvsgY1i9Eb3chUuZtWyFSr9NW1lClGso1Fo7zSOxJnkmTaqQyF8+g
-wlh5TyFe5ijDqoQLcUuRLAjG+eXlNdzLIiHtWdUEJjrITtoLmMJvwoDMdZwLckSq/Kpj5Z7yOxUJ
_______________________________________________
Commits mailing list
Commits@moblin.org
https://www.moblin.org/mailman/listinfo/commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic