Bug 924232 - Part 2: Move preprocessed Gecko*.java.in to widget package. r=mfinkle
authorNick Alexander <nalexander@mozilla.com>
Thu, 10 Oct 2013 11:53:14 -0700
changeset 164143 2618d8170c70e7eed683854a8e66fe983c42b9bd
parent 164142 a222b928494de41b3c3d115865fb55045d1fedfc
child 164144 d28d34e013000f68f3781791105ac3fb11ae92f2
child 164238 211c60b0c91bc2969dd0be75305245940ae2d4ed
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs924232
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 924232 - Part 2: Move preprocessed Gecko*.java.in to widget package. r=mfinkle
mobile/android/base/BrowserToolbar.java
mobile/android/base/BrowserToolbarBackground.java
mobile/android/base/CustomEditText.java
mobile/android/base/GeckoButton.java.in
mobile/android/base/GeckoEditText.java.in
mobile/android/base/GeckoFrameLayout.java.in
mobile/android/base/GeckoImageButton.java.in
mobile/android/base/GeckoImageView.java.in
mobile/android/base/GeckoLinearLayout.java.in
mobile/android/base/GeckoRelativeLayout.java.in
mobile/android/base/GeckoTextSwitcher.java.in
mobile/android/base/GeckoTextView.java.in
mobile/android/base/GeckoView.java.frag
mobile/android/base/Makefile.in
mobile/android/base/ShapedButton.java
mobile/android/base/TabCounter.java
mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
mobile/android/base/resources/layout/browser_toolbar.xml
mobile/android/base/resources/layout/tabs_counter.xml
mobile/android/base/widget/GeckoEditText.java.in
mobile/android/base/widget/GeckoImageButton.java.in
mobile/android/base/widget/GeckoImageView.java.in
mobile/android/base/widget/GeckoLinearLayout.java.in
mobile/android/base/widget/GeckoRelativeLayout.java.in
mobile/android/base/widget/GeckoTextSwitcher.java.in
mobile/android/base/widget/GeckoTextView.java.in
mobile/android/base/widget/GeckoView.java.frag
--- a/mobile/android/base/BrowserToolbar.java
+++ b/mobile/android/base/BrowserToolbar.java
@@ -16,16 +16,20 @@ import org.mozilla.gecko.PageActionLayou
 import org.mozilla.gecko.PrefsHelper;
 import org.mozilla.gecko.util.Clipboard;
 import org.mozilla.gecko.util.StringUtils;
 import org.mozilla.gecko.util.HardwareUtils;
 import org.mozilla.gecko.util.ThreadUtils;
 import org.mozilla.gecko.util.UiAsyncTask;
 import org.mozilla.gecko.util.GeckoEventListener;
 import org.mozilla.gecko.util.StringUtils;
+import org.mozilla.gecko.widget.GeckoImageButton;
+import org.mozilla.gecko.widget.GeckoImageView;
+import org.mozilla.gecko.widget.GeckoRelativeLayout;
+import org.mozilla.gecko.widget.GeckoTextView;
 
 import org.json.JSONObject;
 
 import android.content.Context;
 import android.content.res.Resources;
 import android.graphics.Bitmap;
 import android.graphics.Color;
 import android.graphics.Rect;
--- a/mobile/android/base/BrowserToolbarBackground.java
+++ b/mobile/android/base/BrowserToolbarBackground.java
@@ -1,14 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko;
 
+import org.mozilla.gecko.widget.GeckoLinearLayout;
+
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.Canvas;
 import android.graphics.Path;
 import android.graphics.PorterDuff.Mode;
 import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.StateListDrawable;
--- a/mobile/android/base/CustomEditText.java
+++ b/mobile/android/base/CustomEditText.java
@@ -1,15 +1,17 @@
 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko;
 
+import org.mozilla.gecko.widget.GeckoEditText;
+
 import android.content.Context;
 import android.util.AttributeSet;
 import android.view.KeyEvent;
 import android.view.View;
 
 public class CustomEditText extends GeckoEditText {
     private OnKeyPreImeListener mOnKeyPreImeListener;
     private OnSelectionChangedListener mOnSelectionChangedListener;
deleted file mode 100644
--- a/mobile/android/base/GeckoButton.java.in
+++ /dev/null
@@ -1,3 +0,0 @@
-#filter substitution
-#define VIEWTYPE Button
-#include GeckoView.java.frag
deleted file mode 100644
--- a/mobile/android/base/GeckoFrameLayout.java.in
+++ /dev/null
@@ -1,3 +0,0 @@
-#filter substitution
-#define VIEWTYPE FrameLayout
-#include GeckoView.java.frag
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -296,25 +296,23 @@ endif
 
 ifdef MOZ_ANDROID_ANR_REPORTER
 DEFINES += -DMOZ_ANDROID_ANR_REPORTER=1
 endif
 
 FENNEC_PP_JAVA_FILES := \
   App.java \
   AppConstants.java \
-  GeckoButton.java \
-  GeckoEditText.java \
-  GeckoFrameLayout.java \
-  GeckoImageButton.java \
-  GeckoImageView.java \
-  GeckoLinearLayout.java \
-  GeckoRelativeLayout.java \
-  GeckoTextSwitcher.java \
-  GeckoTextView.java \
+  widget/GeckoEditText.java \
+  widget/GeckoImageButton.java \
+  widget/GeckoImageView.java \
+  widget/GeckoLinearLayout.java \
+  widget/GeckoRelativeLayout.java \
+  widget/GeckoTextSwitcher.java \
+  widget/GeckoTextView.java \
   SysInfo.java \
   WebApp.java \
   WebApps.java \
   $(NULL)
 
 FENNEC_PP_XML_FILES = \
   res/xml/preferences.xml \
   res/xml/preferences_customize.xml \
@@ -1353,16 +1351,17 @@ android-tgts = \
   $(MOZGLUE_PP_JAVA_FILES) \
   $(FENNEC_PP_JAVA_FILES) \
   $(SYNC_PP_JAVA_FILES) \
   package-name.txt \
   $(NULL)
 
 android-preqs = \
   Makefile.in \
+  widget/GeckoView.java.frag \
   $(call mkdir_deps,$(sort $(dir $(MOZGLUE_PP_JAVA_FILES)))) \
   $(call mkdir_deps,$(sort $(dir $(FENNEC_PP_JAVA_FILES)))) \
   $(call mkdir_deps,$(sort $(dir $(SYNC_PP_JAVA_FILES)))) \
   $(SERVICES_MANIFEST_FRAGMENTS) \
   $(NULL)
 
 $(android-tgts): % : %.in $(android-preqs)
 	$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
--- a/mobile/android/base/ShapedButton.java
+++ b/mobile/android/base/ShapedButton.java
@@ -1,14 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko;
 
+import org.mozilla.gecko.widget.GeckoImageButton;
+
 import android.content.Context;
 import android.content.res.Resources;
 import android.content.res.TypedArray;
 import android.graphics.Canvas;
 import android.graphics.Path;
 import android.graphics.PorterDuff.Mode;
 import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.Drawable;
--- a/mobile/android/base/TabCounter.java
+++ b/mobile/android/base/TabCounter.java
@@ -1,16 +1,17 @@
 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko;
 
 import org.mozilla.gecko.animation.Rotate3DAnimation;
+import org.mozilla.gecko.widget.GeckoTextSwitcher;
 
 import android.content.Context;
 import android.os.Build;
 import android.view.accessibility.AccessibilityNodeInfo;
 import android.view.animation.Animation;
 import android.view.animation.AnimationSet;
 import android.view.animation.AlphaAnimation;
 import android.view.LayoutInflater;
--- a/mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
+++ b/mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
@@ -123,29 +123,29 @@
                      style="@style/UrlBar.ImageButton"
                      android:layout_width="@dimen/browser_toolbar_lock_width"
                      android:scaleType="fitCenter"
                      android:layout_marginLeft="-4dip"
                      android:src="@drawable/site_security_level"
                      android:contentDescription="@string/site_security"
                      android:visibility="gone"/>
 
-        <org.mozilla.gecko.GeckoTextView android:id="@+id/url_bar_title"
-                                         style="@style/UrlBar.Button"
-                                         android:layout_width="fill_parent"
-                                         android:layout_height="fill_parent"
-                                         android:layout_weight="1.0"
-                                         android:singleLine="true"
-                                         android:paddingRight="8dp"
-                                         android:textColor="@color/url_bar_title"
-                                         android:textColorHint="@color/url_bar_title_hint"
-                                         android:gravity="center_vertical|left"
-                                         android:hint="@string/url_bar_default_text"
-                                         android:layout_gravity="center_vertical"
-                                         gecko:autoUpdateTheme="false"/>
+        <org.mozilla.gecko.widget.GeckoTextView android:id="@+id/url_bar_title"
+                                                style="@style/UrlBar.Button"
+                                                android:layout_width="fill_parent"
+                                                android:layout_height="fill_parent"
+                                                android:layout_weight="1.0"
+                                                android:singleLine="true"
+                                                android:paddingRight="8dp"
+                                                android:textColor="@color/url_bar_title"
+                                                android:textColorHint="@color/url_bar_title_hint"
+                                                android:gravity="center_vertical|left"
+                                                android:hint="@string/url_bar_default_text"
+                                                android:layout_gravity="center_vertical"
+                                                gecko:autoUpdateTheme="false"/>
 
         <org.mozilla.gecko.PageActionLayout android:id="@+id/page_action_layout"
                                             android:layout_width="wrap_content"
                                             android:layout_height="match_parent"
                                             android:layout_marginRight="@dimen/browser_toolbar_button_padding"
                                             android:visibility="gone"
                                             android:orientation="horizontal"/>
 
@@ -160,31 +160,31 @@
     <LinearLayout android:id="@+id/menu_items"
                   android:layout_width="wrap_content"
                   android:layout_height="fill_parent"
                   android:layout_marginLeft="3dp"
                   android:orientation="horizontal"
                   android:layout_toLeftOf="@id/menu"
                   android:layout_alignWithParentIfMissing="true"/>
 
-    <org.mozilla.gecko.GeckoImageButton android:id="@+id/menu"
-                                        style="@style/UrlBar.ImageButton"
-                                        android:layout_width="56dip"
-                                        android:layout_alignParentRight="true"
-                                        android:contentDescription="@string/menu"
-                                        android:background="@drawable/action_bar_button"
-                                        android:visibility="gone"/>
+    <org.mozilla.gecko.widget.GeckoImageButton android:id="@+id/menu"
+                                               style="@style/UrlBar.ImageButton"
+                                               android:layout_width="56dip"
+                                               android:layout_alignParentRight="true"
+                                               android:contentDescription="@string/menu"
+                                               android:background="@drawable/action_bar_button"
+                                               android:visibility="gone"/>
 
-    <org.mozilla.gecko.GeckoImageView android:id="@+id/menu_icon"
-                                      style="@style/UrlBar.ImageButton"
-                                      android:layout_alignLeft="@id/menu"
-                                      android:layout_alignRight="@id/menu"
-                                      android:gravity="center_vertical"
-                                      android:src="@drawable/menu_level"
-                                      android:visibility="gone"/>
+    <org.mozilla.gecko.widget.GeckoImageView android:id="@+id/menu_icon"
+                                             style="@style/UrlBar.ImageButton"
+                                             android:layout_alignLeft="@id/menu"
+                                             android:layout_alignRight="@id/menu"
+                                             android:gravity="center_vertical"
+                                             android:src="@drawable/menu_level"
+                                             android:visibility="gone"/>
 
     <ImageView android:id="@+id/shadow"
                android:layout_width="fill_parent"
                android:layout_height="2dp"
                android:layout_alignParentBottom="true"
                android:background="@color/url_bar_shadow"
                android:contentDescription="@null"/>
 
--- a/mobile/android/base/resources/layout/browser_toolbar.xml
+++ b/mobile/android/base/resources/layout/browser_toolbar.xml
@@ -51,23 +51,23 @@
     <org.mozilla.gecko.ShapedButton android:id="@+id/menu"
                                     style="@style/UrlBar.ImageButton"
                                     android:layout_width="48dip"
                                     android:layout_alignParentRight="true"
                                     android:contentDescription="@string/menu"
                                     android:background="@drawable/shaped_button"
                                     android:visibility="gone"/>
 
-    <org.mozilla.gecko.GeckoImageView android:id="@+id/menu_icon"
-                                      style="@style/UrlBar.ImageButton"
-                                      android:layout_alignLeft="@id/menu"
-                                      android:layout_alignRight="@id/menu"
-                                      android:gravity="center_vertical"
-                                      android:src="@drawable/menu_level"
-                                      android:visibility="gone"/>
+    <org.mozilla.gecko.widget.GeckoImageView android:id="@+id/menu_icon"
+                                             style="@style/UrlBar.ImageButton"
+                                             android:layout_alignLeft="@id/menu"
+                                             android:layout_alignRight="@id/menu"
+                                             android:gravity="center_vertical"
+                                             android:src="@drawable/menu_level"
+                                             android:visibility="gone"/>
 
     <org.mozilla.gecko.ShapedButton android:id="@+id/tabs"
                                     style="@style/UrlBar.ImageButton"
                                     android:layout_width="72dip"
                                     android:layout_toLeftOf="@id/menu"
                                     android:layout_alignWithParentIfMissing="true"
                                     gecko:curveTowards="right"
                                     android:background="@drawable/shaped_button"
@@ -148,29 +148,29 @@
                      style="@style/UrlBar.ImageButton"
                      android:layout_width="@dimen/browser_toolbar_lock_width"
                      android:scaleType="fitCenter"
                      android:layout_marginLeft="-4dip"
                      android:src="@drawable/site_security_level"
                      android:contentDescription="@string/site_security"
                      android:visibility="gone"/>
 
-        <org.mozilla.gecko.GeckoTextView android:id="@+id/url_bar_title"
-                                         style="@style/UrlBar.Button"
-                                         android:layout_width="fill_parent"
-                                         android:layout_height="fill_parent"
-                                         android:layout_weight="1.0"
-                                         android:singleLine="true"
-                                         android:paddingRight="8dp"
-                                         android:textColor="@color/url_bar_title"
-                                         android:textColorHint="@color/url_bar_title_hint"
-                                         android:gravity="center_vertical|left"
-                                         android:hint="@string/url_bar_default_text"
-                                         android:layout_gravity="center_vertical"
-                                         gecko:autoUpdateTheme="false"/>
+        <org.mozilla.gecko.widget.GeckoTextView android:id="@+id/url_bar_title"
+                                                style="@style/UrlBar.Button"
+                                                android:layout_width="fill_parent"
+                                                android:layout_height="fill_parent"
+                                                android:layout_weight="1.0"
+                                                android:singleLine="true"
+                                                android:paddingRight="8dp"
+                                                android:textColor="@color/url_bar_title"
+                                                android:textColorHint="@color/url_bar_title_hint"
+                                                android:gravity="center_vertical|left"
+                                                android:hint="@string/url_bar_default_text"
+                                                android:layout_gravity="center_vertical"
+                                                gecko:autoUpdateTheme="false"/>
 
         <org.mozilla.gecko.PageActionLayout android:id="@+id/page_action_layout"
                                             android:layout_width="wrap_content"
                                             android:layout_height="match_parent"
                                             android:layout_marginRight="12dp"
                                             android:visibility="gone"
                                             android:orientation="horizontal"/>
 
--- a/mobile/android/base/resources/layout/tabs_counter.xml
+++ b/mobile/android/base/resources/layout/tabs_counter.xml
@@ -1,17 +1,17 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
-<org.mozilla.gecko.GeckoTextView xmlns:android="http://schemas.android.com/apk/res/android"
-                                 android:layout_width="24dip"
-                                 android:layout_height="24dip"
-                                 android:layout_margin="12dip"
-                                 android:paddingTop="2dip"
-                                 android:paddingLeft="4dip"
-                                 android:background="@drawable/tabs_count_foreground"
-                                 android:textAppearance="@style/TextAppearance.Micro"
-                                 android:textColor="#FF43484E"
-                                 android:textStyle="bold"
-                                 android:duplicateParentState="true"
-                                 android:gravity="center"/>
+<org.mozilla.gecko.widget.GeckoTextView xmlns:android="http://schemas.android.com/apk/res/android"
+                                        android:layout_width="24dip"
+                                        android:layout_height="24dip"
+                                        android:layout_margin="12dip"
+                                        android:paddingTop="2dip"
+                                        android:paddingLeft="4dip"
+                                        android:background="@drawable/tabs_count_foreground"
+                                        android:textAppearance="@style/TextAppearance.Micro"
+                                        android:textColor="#FF43484E"
+                                        android:textStyle="bold"
+                                        android:duplicateParentState="true"
+                                        android:gravity="center"/>
rename from mobile/android/base/GeckoEditText.java.in
rename to mobile/android/base/widget/GeckoEditText.java.in
rename from mobile/android/base/GeckoImageButton.java.in
rename to mobile/android/base/widget/GeckoImageButton.java.in
rename from mobile/android/base/GeckoImageView.java.in
rename to mobile/android/base/widget/GeckoImageView.java.in
rename from mobile/android/base/GeckoLinearLayout.java.in
rename to mobile/android/base/widget/GeckoLinearLayout.java.in
rename from mobile/android/base/GeckoRelativeLayout.java.in
rename to mobile/android/base/widget/GeckoRelativeLayout.java.in
rename from mobile/android/base/GeckoTextSwitcher.java.in
rename to mobile/android/base/widget/GeckoTextSwitcher.java.in
rename from mobile/android/base/GeckoTextView.java.in
rename to mobile/android/base/widget/GeckoTextView.java.in
rename from mobile/android/base/GeckoView.java.frag
rename to mobile/android/base/widget/GeckoView.java.frag
--- a/mobile/android/base/GeckoView.java.frag
+++ b/mobile/android/base/widget/GeckoView.java.frag
@@ -1,13 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-package org.mozilla.gecko;
+package org.mozilla.gecko.widget;
+
+import org.mozilla.gecko.GeckoActivity;
+import org.mozilla.gecko.LightweightTheme;
+import org.mozilla.gecko.R;
 
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.util.AttributeSet;
 import android.widget.@VIEWTYPE@;
 
 public class Gecko@VIEWTYPE@ extends @VIEWTYPE@
                              implements LightweightTheme.OnChangeListener {