[anjal: 1/3] One more API to find, whether we are on the blockquote or not.



commit 5e96b398c58c640b81abc9ad6f19065cd305c8bc
Author: Srinivasa Ragavan <sragavan novell com>
Date:   Mon Mar 23 16:07:04 2009 +0530

    One more API to find, whether we are on the blockquote or not.
---
 webkit.patch |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 63 insertions(+), 7 deletions(-)

diff --git a/webkit.patch b/webkit.patch
index 4ee0fe6..840e14b 100644
--- a/webkit.patch
+++ b/webkit.patch
@@ -1,8 +1,39 @@
+diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
+index 1edcdc6..8a7676b 100644
+--- a/WebCore/editing/Editor.cpp
++++ b/WebCore/editing/Editor.cpp
+@@ -220,6 +220,14 @@ bool Editor::isSelectTrailingWhitespaceEnabled()
+     return client() && client()->isSelectTrailingWhitespaceEnabled();
+ }
+ 
++int Editor::numEnclosedBlockquotes()
++{
++    SelectionController* sel = m_frame->selection();
++    Position start = sel->selection().start();
++
++    return WebCore::numEnclosingMailBlockquotes(start);
++}
++
+ bool Editor::deleteWithDirection(SelectionController::EDirection direction, TextGranularity granularity, bool killRing, bool isTypingAction)
+ {
+     if (!canEdit())
+diff --git a/WebCore/editing/Editor.h b/WebCore/editing/Editor.h
+index 2f67723..dc6a7b9 100644
+--- a/WebCore/editing/Editor.h
++++ b/WebCore/editing/Editor.h
+@@ -269,6 +269,7 @@ public:
+     PassRefPtr<Range> nextVisibleRange(Range*, const String&, bool forward, bool caseFlag, bool wrapFlag);
+     
+     void addToKillRing(Range*, bool prepend);
++    int numEnclosedBlockquotes ();
+ private:
+     Frame* m_frame;
+     OwnPtr<DeleteButtonController> m_deleteButtonController;
 diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp
-index e2b10b6..e4dd6e9 100644
+index e2b10b6..51e824c 100644
 --- a/WebKit/gtk/webkit/webkitwebframe.cpp
 +++ b/WebKit/gtk/webkit/webkitwebframe.cpp
-@@ -429,6 +429,16 @@ void webkit_web_frame_load_string(WebKitWebFrame* frame, const gchar* content, c
+@@ -429,6 +429,38 @@ void webkit_web_frame_load_string(WebKitWebFrame* frame, const gchar* content, c
      coreFrame->loader()->load(ResourceRequest(url), substituteData, false);
  }
  
@@ -16,10 +47,32 @@ index e2b10b6..e4dd6e9 100644
 +    return g_strdup(foo.utf8().data());
 +}
 +
++/*
++ * Insert new line into the webkit editor quoted data
++ */
++gboolean
++webkit_web_frame_is_cursor_at_blockquote (WebKitWebFrame *frame)
++{
++    Frame* coreFrame = core(frame);
++
++    return coreFrame->editor()->numEnclosedBlockquotes() != 0;
++}
++
++/*
++ * Insert new line into the webkit editor quoted data
++ */
++void
++webkit_web_frame_break_quote (WebKitWebFrame *frame)
++{
++    Frame* coreFrame = core(frame);
++	
++    coreFrame->editor()->command("InsertNewlineInQuotedContent").execute();
++}
++
  /**
   * webkit_web_frame_load_request:
   * @frame: a #WebKitWebFrame
-@@ -610,6 +620,15 @@ gchar* webkit_web_frame_dump_render_tree(WebKitWebFrame* frame)
+@@ -610,6 +642,15 @@ gchar* webkit_web_frame_dump_render_tree(WebKitWebFrame* frame)
      return g_strdup(string.utf8().data());
  }
  
@@ -36,20 +89,23 @@ index e2b10b6..e4dd6e9 100644
  
  static void begin_print(GtkPrintOperation* op, GtkPrintContext* context, gpointer user_data)
 diff --git a/WebKit/gtk/webkit/webkitwebframe.h b/WebKit/gtk/webkit/webkitwebframe.h
-index 7e24565..920ee17 100644
+index 7e24565..4328c0e 100644
 --- a/WebKit/gtk/webkit/webkitwebframe.h
 +++ b/WebKit/gtk/webkit/webkitwebframe.h
-@@ -84,6 +84,9 @@ WEBKIT_API void
+@@ -84,6 +84,12 @@ WEBKIT_API void
  webkit_web_frame_load_uri           (WebKitWebFrame       *frame,
                                       const gchar          *uri);
  
 +WEBKIT_API gchar *
 +webkit_web_frame_get_string         (WebKitWebFrame       *frame);
-+
++WEBKIT_API gboolean
++webkit_web_frame_is_cursor_at_blockquote (WebKitWebFrame *frame);
++WEBKIT_API void
++webkit_web_frame_break_quote        (WebKitWebFrame       *frame);
  WEBKIT_API void
  webkit_web_frame_load_string        (WebKitWebFrame       *frame,
                                       const gchar          *content,
-@@ -107,7 +110,8 @@ webkit_web_frame_find_frame         (WebKitWebFrame       *frame,
+@@ -107,7 +113,8 @@ webkit_web_frame_find_frame         (WebKitWebFrame       *frame,
  
  WEBKIT_API JSGlobalContextRef
  webkit_web_frame_get_global_context (WebKitWebFrame       *frame);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]