1. 09 Apr, 2013 2 commits
  2. 23 Nov, 2012 1 commit
    • carlosgc@webkit.org's avatar
      [GTK] Use custom private macros to define GObjects · 3ebaacf1
      carlosgc@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=99705
      
      Reviewed by Martin Robinson.
      
      Add WEBKIT_DEFINE_TYPE macros, similar and compatible with
      G_DEFINE_TYPE macros, to define GObject types. These macros also
      define the init and finalize functions reducing the GObject
      boilerplate and hiding the placement new syntax that causes some
      confusion. The patch replaces the use of G_DEFINE_TYPE macros by
      WEBKIT_DEFINE_TYPE ones and removes the init and finalize
      implementations, moving custom code when needed to the private
      struct constructor/destructor or constructed/dispose virtual
      methods when appropriate.
      
      * UIProcess/API/gtk/WebKitBackForwardList.cpp:
      * UIProcess/API/gtk/WebKitBackForwardListItem.cpp:
      (webkit_back_forward_list_item_class_init):
      * UIProcess/API/gtk/WebKitContextMenu.cpp:
      (webkitContextMenuDispose):
      (webkit_context_menu_class_init):
      * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
      (_WebKitContextMenuItemPrivate::~_WebKitContextMenuItemPrivate):
      (_WebKitContextMenuItemPrivate):
      (webkit_context_menu_item_class_init):
      * UIProcess/API/gtk/WebKitCookieManager.cpp:
      (_WebKitCookieManagerPrivate::~_WebKitCookieManagerPrivate):
      (_WebKitCookieManagerPrivate):
      * UIProcess/API/gtk/WebKitDownload.cpp:
      (webkit_download_class_init):
      * UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
      (webkit_favicon_database_class_init):
      * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
      (webkitFileChooserRequestDispose):
      (webkit_file_chooser_request_class_init):
      * UIProcess/API/gtk/WebKitFindController.cpp:
      (webkit_find_controller_class_init):
      * UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp:
      (webkitFormSubmissionRequestDispose):
      (webkit_form_submission_request_class_init):
      * UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp:
      (webkitGeolocationPermissionRequestDispose):
      (webkit_geolocation_permission_request_class_init):
      * UIProcess/API/gtk/WebKitHitTestResult.cpp:
      (webkit_hit_test_result_class_init):
      * UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp:
      (webkit_navigation_policy_decision_class_init):
      * UIProcess/API/gtk/WebKitPlugin.cpp:
      (_WebKitPluginPrivate::~_WebKitPluginPrivate):
      (_WebKitPluginPrivate):
      (webkit_plugin_class_init):
      * UIProcess/API/gtk/WebKitPolicyDecision.cpp:
      (webkitPolicyDecisionDispose):
      (webkit_policy_decision_class_init):
      (webkit_policy_decision_use):
      (webkit_policy_decision_ignore):
      (webkit_policy_decision_download):
      * UIProcess/API/gtk/WebKitPrintOperation.cpp:
      (_WebKitPrintOperationPrivate::~_WebKitPrintOperationPrivate):
      (_WebKitPrintOperationPrivate):
      (webkit_print_operation_class_init):
      * UIProcess/API/gtk/WebKitPrivate.h:
      * UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp:
      (webkit_response_policy_decision_class_init):
      * UIProcess/API/gtk/WebKitSecurityManager.cpp:
      (webkit_security_manager_class_init):
      * UIProcess/API/gtk/WebKitSettings.cpp:
      (_WebKitSettingsPrivate::_WebKitSettingsPrivate):
      (_WebKitSettingsPrivate):
      (webkit_settings_class_init):
      * UIProcess/API/gtk/WebKitURIRequest.cpp:
      (webkit_uri_request_class_init):
      * UIProcess/API/gtk/WebKitURIResponse.cpp:
      (webkit_uri_response_class_init):
      * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
      (webkit_uri_scheme_request_class_init):
      * UIProcess/API/gtk/WebKitWebContext.cpp:
      * UIProcess/API/gtk/WebKitWebInspector.cpp:
      (_WebKitWebInspectorPrivate::~_WebKitWebInspectorPrivate):
      (_WebKitWebInspectorPrivate):
      (webkit_web_inspector_class_init):
      * UIProcess/API/gtk/WebKitWebResource.cpp:
      (webkit_web_resource_class_init):
      * UIProcess/API/gtk/WebKitWebView.cpp:
      (_WebKitWebViewPrivate::~_WebKitWebViewPrivate):
      (_WebKitWebViewPrivate):
      (webkitWebViewConstructed):
      (webkitWebViewDispose):
      (webkit_web_view_class_init):
      * UIProcess/API/gtk/WebKitWebViewBase.cpp:
      (_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate):
      (_WebKitWebViewBasePrivate):
      (_WebKitWebViewBasePrivate::~_WebKitWebViewBasePrivate):
      (webkitWebViewBaseDispose):
      (webkitWebViewBaseConstructed):
      (webkit_web_view_base_class_init):
      * UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp:
      (webkit_web_view_base_accessible_class_init):
      * UIProcess/API/gtk/WebKitWindowProperties.cpp:
      (webkit_window_properties_class_init):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135565 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3ebaacf1
  3. 18 Oct, 2012 2 commits
    • carlosgc@webkit.org's avatar
      [GTK] Don't use using namespace WebKit in private headers in WebKit2 · dc1c795c
      carlosgc@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=99724
      
      Reviewed by Xan Lopez.
      
      Move using namespace WebKit from private headers to the cpp file.
      
      * UIProcess/API/gtk/WebKitBackForwardList.cpp:
      * UIProcess/API/gtk/WebKitBackForwardListPrivate.h:
      * UIProcess/API/gtk/WebKitContextMenu.cpp:
      * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
      * UIProcess/API/gtk/WebKitContextMenuItemPrivate.h:
      * UIProcess/API/gtk/WebKitContextMenuPrivate.h:
      * UIProcess/API/gtk/WebKitCookieManager.cpp:
      * UIProcess/API/gtk/WebKitCookieManagerPrivate.h:
      * UIProcess/API/gtk/WebKitDownload.cpp:
      * UIProcess/API/gtk/WebKitDownloadPrivate.h:
      * UIProcess/API/gtk/WebKitFaviconDatabasePrivate.h:
      * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
      * UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h:
      * UIProcess/API/gtk/WebKitFindController.cpp:
      * UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp:
      * UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h:
      * UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp:
      * UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h:
      * UIProcess/API/gtk/WebKitGeolocationProvider.cpp:
      * UIProcess/API/gtk/WebKitGeolocationProvider.h:
      * UIProcess/API/gtk/WebKitHitTestResult.cpp:
      * UIProcess/API/gtk/WebKitHitTestResultPrivate.h:
      * UIProcess/API/gtk/WebKitJavascriptResult.cpp:
      * UIProcess/API/gtk/WebKitJavascriptResultPrivate.h:
      * UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp:
      * UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h:
      * UIProcess/API/gtk/WebKitPolicyDecision.cpp:
      * UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h:
      * UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp:
      * UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h:
      * UIProcess/API/gtk/WebKitSettings.cpp:
      * UIProcess/API/gtk/WebKitSettingsPrivate.h:
      * UIProcess/API/gtk/WebKitURIResponse.cpp:
      * UIProcess/API/gtk/WebKitURIResponsePrivate.h:
      * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
      * UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
      * UIProcess/API/gtk/WebKitWebContext.cpp:
      * UIProcess/API/gtk/WebKitWebContextPrivate.h:
      * UIProcess/API/gtk/WebKitWebInspector.cpp:
      * UIProcess/API/gtk/WebKitWebInspectorPrivate.h:
      * UIProcess/API/gtk/WebKitWebResource.cpp:
      * UIProcess/API/gtk/WebKitWebResourcePrivate.h:
      * UIProcess/API/gtk/WebKitWebView.cpp:
      * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
      * UIProcess/API/gtk/WebKitWebViewPrivate.h:
      * UIProcess/API/gtk/WebKitWindowProperties.cpp:
      * UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      dc1c795c
    • carlosgc@webkit.org's avatar
      [GTK] Don't use the C API internally in WebKitFileChooserRequest · a6105c6f
      carlosgc@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=96774
      
      Reviewed by Xan Lopez.
      
      Using the C++ classes directly instead of the C API wrappers we
      avoid a lot of toImpl/toAPI casts, string conversions and
      allocations. The code is also a lot simpler and easier to read.
      
      * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
      (_WebKitFileChooserRequestPrivate):
      (webkitFileChooserRequestCreate):
      (webkit_file_chooser_request_get_mime_types):
      (webkit_file_chooser_request_get_mime_types_filter):
      (webkit_file_chooser_request_get_select_multiple):
      (webkit_file_chooser_request_select_files):
      (webkit_file_chooser_request_get_selected_files):
      (webkit_file_chooser_request_cancel):
      * UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h:
      * UIProcess/API/gtk/WebKitUIClient.cpp:
      (runOpenPanel):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131757 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a6105c6f
  4. 30 Apr, 2012 1 commit
    • mario@webkit.org's avatar
      [GTK] Implement WebUIClient's runOpenPanel in WebKit2GTK+ · fd4d35a2
      mario@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=78491
      
      Reviewed by Martin Robinson.
      
      Add a new public class to the API, WebKitFileChooserRequest, to be
      emitted along with a new WebKitWebView::run-file-chooser signal to
      let client applications to provide their own file chooser dialog
      when the use interacts with HTML Input elements of type 'file'.
      
      * GNUmakefile.am: Added new source files and headers.
      * UIProcess/API/gtk/WebKitFileChooserRequest.cpp: Added.
      (_WebKitFileChooserRequestPrivate):
      (webkit_file_chooser_request_init):
      (webkitFileChooserRequestFinalize):
      (webkitFileChooserRequestGetProperty):
      (webkit_file_chooser_request_class_init):
      (webkitFileChooserRequestCreate):
      (webkit_file_chooser_request_get_mime_types):
      (webkit_file_chooser_request_get_mime_types_filter):
      (webkit_file_chooser_request_get_select_multiple):
      (webkit_file_chooser_request_select_files):
      (webkit_file_chooser_request_get_selected_files):
      (webkit_file_chooser_request_cancel):
      * UIProcess/API/gtk/WebKitFileChooserRequest.h: Added.
      (_WebKitFileChooserRequest):
      (_WebKitFileChooserRequestClass):
      * UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h: Added,
      containing the prototype of webkitFileChooserRequestCreate.
      
      Provide private API to make a file chooser request from the
      WebView, and provide a default handler for it.
      
      * UIProcess/API/gtk/WebKitWebView.cpp:
      (fileChooserDialogResponseCallback): Handler for the 'response'
      signal for the GtkFileChooserDialog used in the default
      handler. It will call to webkit_file_chooser_request_select_files
      or webkit_file_chooser_request_cancel as needed.
      (webkitWebViewRunFileChooser): Default handler for the new
      'run-file-chooser' signal. It will create a GtkFileChooserDialog,
      connect to the 'response' signal and show it.
      (webkit_web_view_class_init): Connect the 'run-file-chooser'
      signal to the default handler, webkitWebViewRunFileChooser.
      (webkitWebViewRunFileChooserRequest):
      * UIProcess/API/gtk/WebKitWebView.h:
      (_WebKitWebViewClass): Added prototype for the handler of the new
      'run-file-chooser' signal.
      * UIProcess/API/gtk/WebKitWebViewPrivate.h: Added prototype for
      private new function webkitWebViewRunFileChooserRequest.
      
      Provide an implementation for runOpenPanel in WebKitUIClient.
      
      * UIProcess/API/gtk/WebKitUIClient.cpp:
      (runOpenPanel): New, implements runOpenPanel by creating an
      instance of WebKitFileChooserRequest and asking the WebView to
      emit the 'run-file-chooser' signal with it.
      (attachUIClientToView): Reference the new runOpenPanel function.
      
      Added the new publich header to the main header.
      
      * UIProcess/API/gtk/webkit2.h: Added WebKitFileChooserRequest.h.
      
      New unit tests for the new WebKitFileChooserRequest API. Also,
      extended the WebViewTest class to allow simulating mouse clicks.
      
      * UIProcess/API/gtk/tests/TestWebKitWebView.cpp:
      (checkMimeTypeForFilter): New, checks whether a GtkFileFilter
      filters a given MIME type, as specified by RFC 2046.
      (testWebViewFileChooserRequest): New unit test.
      (beforeAll): Add the new unit test as an UIClientTest.
      
      * UIProcess/API/gtk/tests/WebViewTest.cpp:
      (WebViewTest::clickMouseButton): New public function to simulate a
      mouse click through GdkEvents, as the combination of a 'press' and
      a 'release' event. Used from the new unit test to simulate the
      user pressing in the button rendered for a HTML Input element.
      (WebViewTest::executeMouseButtonEvent): New private function to
      simulate a mouse event through GdkEvents.
      * UIProcess/API/gtk/tests/WebViewTest.h:
      
      Updated documentation related files with the new API.
      
      * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Added new API.
      * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Added new section.
      * UIProcess/API/gtk/docs/webkit2gtk.types: Added get_type function.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115627 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fd4d35a2