Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1 from radorodopski/linux
Browse files Browse the repository at this point in the history
  • Loading branch information
pritambaral committed Nov 12, 2012
2 parents 3870093 + 923c4b6 commit c883bde
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,13 @@ tools
*.wixpdb
*.wixobj
bracketsharvestmanager.wxs
fr-fr.mst
fr-fr.mst

appshell_extensions_js.o
Makefile
appshell.Makefile
Brackets.target.mk
libcef_dll_wrapper.target.mk
appshell/gtk
appshell/gtk/*

7 changes: 6 additions & 1 deletion appshell/cefclient_gtk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,14 @@ int main(int argc, char* argv[]) {

GtkWidget* vbox = gtk_vbox_new(FALSE, 0);

#ifdef SHOW_TOOLBAR_UI
GtkToolItem* back = gtk_tool_button_new(NULL, NULL);
GtkToolItem* forward = gtk_tool_button_new(NULL, NULL);
GtkToolItem* reload = gtk_tool_button_new(NULL, NULL);
GtkToolItem* stop = gtk_tool_button_new(NULL, NULL);

GtkWidget* m_editWnd = gtk_entry_new();
#endif // SHOW_TOOLBAR_UI

g_signal_connect(G_OBJECT(window), "delete_event",
G_CALLBACK(HandleQuit), NULL);
Expand All @@ -165,9 +167,11 @@ int main(int argc, char* argv[]) {
// Create the handler.
g_handler = new ClientHandler();
g_handler->SetMainHwnd(vbox);
#ifdef SHOW_TOOLBAR_UI
g_handler->SetEditHwnd(m_editWnd);
g_handler->SetButtonHwnds(GTK_WIDGET(back), GTK_WIDGET(forward),
GTK_WIDGET(reload), GTK_WIDGET(stop));
#endif // SHOW_TOOLBAR_UI

// Create the browser view.
CefWindowInfo window_info;
Expand Down Expand Up @@ -198,4 +202,5 @@ int main(int argc, char* argv[]) {
CefShutdown();

return 0;
}
}

7 changes: 7 additions & 0 deletions appshell/client_handler_gtk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ bool ClientHandler::OnBeforePopup(CefRefPtr<CefBrowser> parentBrowser,
void ClientHandler::OnAddressChange(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& url) {
#ifdef SHOW_TOOLBAR_UI
REQUIRE_UI_THREAD();

if (m_BrowserId == browser->GetIdentifier() && frame->IsMain()) {
// Set the edit window text
std::string urlStr(url);
gtk_entry_set_text(GTK_ENTRY(m_EditHwnd), urlStr.c_str());
}
#endif // SHOW_TOOLBAR_UI
}

void ClientHandler::OnTitleChange(CefRefPtr<CefBrowser> browser,
Expand All @@ -52,13 +54,16 @@ void ClientHandler::SendNotification(NotificationType type) {
}

void ClientHandler::SetLoading(bool isLoading) {
#ifdef SHOW_TOOLBAR_UI
if (isLoading)
gtk_widget_set_sensitive(GTK_WIDGET(m_StopHwnd), true);
else
gtk_widget_set_sensitive(GTK_WIDGET(m_StopHwnd), false);
#endif // SHOW_TOOLBAR_UI
}

void ClientHandler::SetNavState(bool canGoBack, bool canGoForward) {
#ifdef SHOW_TOOLBAR_UI
if (canGoBack)
gtk_widget_set_sensitive(GTK_WIDGET(m_BackHwnd), true);
else
Expand All @@ -68,6 +73,7 @@ void ClientHandler::SetNavState(bool canGoBack, bool canGoForward) {
gtk_widget_set_sensitive(GTK_WIDGET(m_ForwardHwnd), true);
else
gtk_widget_set_sensitive(GTK_WIDGET(m_ForwardHwnd), false);
#endif // SHOW_TOOLBAR_UI
}

void ClientHandler::CloseMainWindow() {
Expand All @@ -86,3 +92,4 @@ void ClientHandler::PopupCreated(CefRefPtr<CefBrowser> browser)
bool ClientHandler::CanCloseBrowser(CefRefPtr<CefBrowser> browser) {
return true;
}

3 changes: 3 additions & 0 deletions appshell_paths.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
'appshell_bundle_resources_linux': [
'$(BUILDTYPE)/locales',
'appshell/res/brackets.ico',
'$(BUILDTYPE)/cef.pak',
'$(BUILDTYPE)/cef_resources.pak',
'$(BUILDTYPE)/devtools_resources.pak',
],
'appshell_bundle_libraries_linux': [
'$(BUILDTYPE)/lib.target/libcef.so',
Expand Down

0 comments on commit c883bde

Please sign in to comment.